/* Global Counter v5.1 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Playfair+Display:wght@700&family=Roboto+Mono:wght@400;700&family=Raleway:wght@600;800&family=Oswald:wght@500;700&family=Lora:wght@600&display=swap');

/* ── Widget wrapper ──────────────────────────────────────────────────────────── */
.gc-widget {
    font-family: var(--gc-font);
    position: relative;
    width: 330px;
    max-width: 100%;
    /* No fixed height — grows with content, never clips */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px 28px;
    margin: 0 auto;
    background: var(--gc-bg);
    border-radius: var(--gc-radius);
    /* overflow visible so toast/badge can peek outside if needed */
    overflow: visible;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

/* Radial glow at top — clipped separately so it doesn't cause overflow scroll */
.gc-widget::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, var(--gc-radial) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
    overflow: hidden;
}

/* ── Inner column ────────────────────────────────────────────────────────────── */
.gc-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* ── Count wrap ──────────────────────────────────────────────────────────────── */
.gc-count-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.gc-count {
    display: block;
    width: 220px;
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--gc-cnt);
    background: var(--gc-cnt-bg);
    padding: 11px 16px;
    border-radius: calc(var(--gc-radius) * 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gc-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gc-text);
    opacity: 0.55;
    margin-top: 2px;
}

/* Personal count line */
.gc-yours {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--gc-text);
    opacity: 0.45;
    letter-spacing: 0.04em;
    margin-top: 1px;
}

/* ── Button group ────────────────────────────────────────────────────────────── */
.gc-btn-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 220px;
}

/* ── Shared button base ──────────────────────────────────────────────────────── */
.gc-btn,
.gc-mini {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    border: none;
    outline: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
    font-family: var(--gc-font);
    font-weight: 700;
    line-height: 1;
    text-align: center;
    background: var(--gc-btn);
    color: var(--gc-btn-text);
    border-radius: calc(var(--gc-radius) * 0.7);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.1s ease;
}

.gc-btn  { padding: 14px 0; font-size: 1rem; }
.gc-mini { padding: 9px 0;  font-size: 0.82rem; opacity: 0.82; overflow: hidden; }

/* Clip ripple inside main button without clipping the badge */
.gc-btn .gc-ripple {
    clip-path: inset(0 round calc(var(--gc-radius) * 0.7));
}

.gc-mini-row {
    display: flex;
    gap: 8px;
    width: 100%;
}
.gc-mini-row .gc-mini { flex: 1; }

/* ── Share button ────────────────────────────────────────────────────────────── */
.gc-share-btn {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 0;
    border: 1.5px solid var(--gc-btn);
    background: transparent;
    color: var(--gc-btn);
    border-radius: calc(var(--gc-radius) * 0.7);
    font-family: var(--gc-font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s ease, opacity 0.15s ease;
    opacity: 0.75;
    box-sizing: border-box;
}
.gc-share-btn:hover { background: var(--gc-radial); opacity: 1; }
.gc-share-btn:active { transform: scale(0.96); }

/* ── Streak badge ────────────────────────────────────────────────────────────── */
.gc-streak-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4d4d;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
    z-index: 10;
}
.gc-streak-badge.gc-streak-show {
    opacity: 1;
    transform: scale(1);
}
.gc-streak-badge.gc-streak-pulse {
    animation: gc-streak-pop 0.2s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes gc-streak-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* ── Ripple ──────────────────────────────────────────────────────────────────── */
.gc-ripple {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.35) 0%, transparent 70%);
    transform: scale(0);
}
.gc-btn.gc-fire .gc-ripple,
.gc-mini.gc-fire .gc-ripple {
    animation: gc-ripple-anim 0.5s ease-out forwards;
}
@keyframes gc-ripple-anim {
    0%   { opacity: 1; transform: scale(0); }
    100% { opacity: 0; transform: scale(3); }
}

/* ── Toast notification ──────────────────────────────────────────────────────── */
.gc-toast {
    position: absolute;
    bottom: -44px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(0,0,0,0.82);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 30;
    font-family: var(--gc-font);
}
.gc-toast.gc-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Confetti canvas ─────────────────────────────────────────────────────────── */
#gc-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    border-radius: inherit;
}

/* ── gc-anim ─────────────────────────────────────────────────────────────────── */
.gc-anim .gc-btn,
.gc-anim .gc-mini {
    box-shadow: var(--gc-btn-sh);
    transition: transform 0.1s ease, box-shadow 0.2s ease, opacity 0.15s ease;
}
.gc-anim .gc-count {
    text-shadow: var(--gc-cnt-glow);
    transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
.gc-anim .gc-count.gc-bump {
    animation: gc-bump 0.28s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes gc-bump {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.14); }
    100% { transform: scale(1); }
}

/* ── gc-hover ────────────────────────────────────────────────────────────────── */
.gc-hover .gc-btn:hover,
.gc-hover .gc-mini:hover {
    box-shadow: var(--gc-btn-sh-hov);
    transform: translateY(-2px);
    opacity: 1 !important;
}
.gc-hover .gc-btn:active,
.gc-hover .gc-mini:active { transform: scale(0.96); }

/* ── gc-pulse ────────────────────────────────────────────────────────────────── */
.gc-pulse .gc-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: calc(var(--gc-radius) * 0.7 + 4px);
    border: 2px solid var(--gc-btn);
    opacity: 0;
    pointer-events: none;
    animation: gc-pulse-ring 2.4s ease-out infinite;
}
@keyframes gc-pulse-ring {
    0%   { opacity: 0.65; transform: scale(1); }
    70%  { opacity: 0;    transform: scale(1.35); }
    100% { opacity: 0;    transform: scale(1.35); }
}

/* ── Pending ─────────────────────────────────────────────────────────────────── */
.gc-count.gc-pending { opacity: 0.72; }
