@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Oswald:wght@400;600&display=swap');

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(34, 197, 94, 0.16), transparent 34%),
        radial-gradient(circle at 88% 15%, rgba(59, 130, 246, 0.18), transparent 30%),
        linear-gradient(165deg, #11131e 0%, #191a2a 55%, #10121b 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-attachment: fixed;
    color: #eef2ff;
    font-family: 'Oswald', sans-serif;
    font-size: 1.15rem;
    letter-spacing: 0.03em;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

.g2-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 12px;
    padding: 14px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(3px);
}

.g2-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.65rem;
    letter-spacing: 0.06em;
    color: #fef08a;
    text-shadow: 0 0 16px rgba(250, 204, 21, 0.35);
    grid-column: 1;
}

.g2-balance {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    grid-column: 2;
    justify-self: center;
    font-size: 1.25rem;
    color: #bbf7d0;
    text-shadow: 0 0 12px rgba(34, 197, 94, 0.45);
    white-space: nowrap;
}

.g2-balance strong { color: #4ade80; }

.g2-coin-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: relative;
    display: inline-block;
    background: radial-gradient(circle at 30% 30%, #fff0a8 0%, #ffd84a 35%, #f2b11c 70%, #c57f00 100%);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
.g2-coin-icon::after {
    content: 'G';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.95rem;
    color: #5c3a00;
}

.g2-nav {
    display: flex;
    gap: 10px;
    grid-column: 3;
    justify-self: end;
}

.g2-nav-btn,
button.g2-nav-btn {
    font-family: 'Oswald', sans-serif;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

button.g2-nav-btn {
    display: inline-block;
}

/* Instructions modal (same pattern as GameYN) */
.g2-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.g2-modal.g2-hidden {
    display: none !important;
}

.g2-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.g2-modal-box {
    position: relative;
    max-width: 460px;
    width: 100%;
    padding: 28px 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.35);
    background: #1a1a22;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.g2-modal-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: #f3f4f6;
    margin: 0 0 18px;
    line-height: 1.4;
}

.g2-modal-text {
    margin: 0 0 20px;
    color: #d1d5db;
    font-size: 1.05rem;
    line-height: 1.5;
    text-align: left;
}

.g2-instructions-list {
    margin: 0;
    padding-left: 1.25em;
    text-align: left;
}

.g2-instructions-list li {
    margin-bottom: 0.5em;
}

.g2-instructions-list li:last-child {
    margin-bottom: 0;
}

.g2-intro-autostart {
    color: #fde68a;
}

.g2-dont-show-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 0 4px;
    text-align: left;
    color: #d1d5db;
    font-size: 0.98rem;
    line-height: 1.45;
    cursor: pointer;
}

.g2-dont-show-label input {
    margin-top: 4px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#g2Game.g2-game-blocked {
    display: none !important;
}

.g2-modal-close {
    margin-top: 4px;
}

.g2-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 20px 44px;
}

.g2-hidden { display: none !important; }

.g2-warn {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fcd34d;
    padding: 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.g2-top-row {
    display: grid;
    grid-template-columns: 195px 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

/* Character clip 01s.mp4 … 12s.mp4, rounded panel */
.g2-image-box {
    width: 195px;
    aspect-ratio: 9 / 16;
    height: auto;
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.24);
    display: block;
    position: relative;
    flex-shrink: 0;
}

.g2-character-photo {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    background: #0f0f13;
}

.g2-text-panel {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.24);
}

.g2-source-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding: 4px 2px;
}

.g2-source {
    font-size: 1.02rem;
    color: #e2e8f0;
    margin-bottom: 0;
}

.g2-tts-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.g2-tts-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.g2-tts-btn:hover {
    transform: scale(1.12);
}

.g2-tts-controls .tts-play {
    background: #22c55e;
    color: #fff;
}

.g2-tts-controls .tts-pause {
    background: #f59e0b;
    color: #fff;
}

.g2-tts-controls .tts-stop {
    background: #ef4444;
    color: #fff;
}

.g2-tts-controls .tts-speed {
    background: #444;
    color: #fff;
    font-weight: bold;
    font-size: 18px;
}

.g2-tts-speed {
    min-width: 34px;
    text-align: center;
    color: #aaa;
    font-size: 0.95rem;
}

.g2-text {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(5, 7, 15, 0.65);
    padding: 12px;
    margin-bottom: 10px;
    line-height: 1.5;
    color: #f8fafc;
    font-size: 1.875rem;
    min-height: 210px;
}

.g2-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    height: 32px;
    margin: 0 3px;
    border-radius: 8px;
    border: 1px dashed #6e7ec6;
    background: #0e1323;
    color: #a8b7ea;
    font-weight: 700;
    vertical-align: middle;
}
.g2-slot.is-filled {
    border-style: solid;
    border-color: #35d17d;
    background: #113526;
    color: #d8ffe8;
    font-size: calc(1.875rem - 2px);
}

.g2-slot.is-revealed-missed {
    border-color: #f59e0b;
    background: #3d2e10;
    color: #fde68a;
}

.g2-slot.is-revealed-wrong {
    border-color: #e34a4a;
    background: #3d1b22;
    color: #fecaca;
}

.g2-options {
    min-height: 98px;
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(5, 7, 15, 0.55);
    margin-bottom: 12px;
}

.g2-option {
    user-select: none;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(27, 42, 87, 0.9);
    color: #e8efff;
    font-weight: 700;
    font-size: calc(1.15rem + 5px);
    text-align: center;
    min-height: 42px;
    display: grid;
    place-items: center;
}

.g2-timer-wrap {
    height: 6px;
    border-radius: 999px;
    background: #20253c;
    overflow: hidden;
    border: 1px solid #3e4b7e;
    margin-bottom: 14px;
}
.g2-timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #38d67b 0%, #f1d450 62%, #e34a4a 100%);
    transform-origin: left center;
}
.g2-timer-bar.is-critical { animation: g2shake .22s infinite; }
@keyframes g2shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    50% { transform: translateX(1px); }
    75% { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

.g2-actions { margin-bottom: 8px; }
.g2-actions {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 10px;
    justify-items: end;
}
.g2-btn {
    font-family: 'Oswald', sans-serif;
    font-size: calc(1.05rem + 5px);
    padding: 12px 22px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.14);
    color: #e5e7eb;
    cursor: pointer;
}
.g2-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.g2-win-text {
    text-align: center;
    font-size: calc(1.05rem + 5px);
    color: #86efac;
    min-height: 24px;
    justify-self: center;
    white-space: pre-line;
    max-width: 100%;
    line-height: 1.35;
}

.g2-win-text.is-flash {
    animation: g2WinFlash 0.75s ease-in-out infinite;
}

@keyframes g2WinFlash {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
    }
    50% {
        opacity: 0.35;
        text-shadow: 0 0 18px rgba(74, 222, 128, 0.95);
    }
}

/* Vote Token bonus (G-coins → tokens): toast + fly to header — inlined so Game2 works with one upload */
.vtb-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 18vh 16px 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.vtb-overlay.vtb-visible {
    opacity: 1;
}

.vtb-overlay.vtb-leaving {
    opacity: 0;
}

.vtb-card {
    pointer-events: none;
    max-width: 420px;
    width: 100%;
    text-align: center;
    padding: 22px 26px 24px;
    border-radius: 18px;
    border: 1px solid rgba(250, 204, 21, 0.55);
    background: linear-gradient(155deg, rgba(30, 27, 18, 0.97) 0%, rgba(22, 24, 38, 0.98) 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        0 20px 50px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(250, 204, 21, 0.22);
    transform: scale(0.82) translateY(12px);
    opacity: 0;
    transition:
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.4s ease;
}

.vtb-overlay.vtb-visible .vtb-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.vtb-overlay.vtb-leaving .vtb-card {
    transform: scale(0.96) translateY(-10px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.35s ease;
}

.vtb-token-line {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.85rem, 4.5vw, 2.35rem);
    letter-spacing: 0.06em;
    color: #fef08a;
    text-shadow: 0 0 20px rgba(250, 204, 21, 0.45);
    margin: 0 0 10px;
    line-height: 1.15;
}

.vtb-subline {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1.1rem, 2.8vw, 1.35rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #c7f9cc;
    margin: 0;
    line-height: 1.35;
    animation: vtb-sub-pulse 1.1s ease-in-out infinite;
}

@keyframes vtb-sub-pulse {
    0%, 100% { opacity: 0.88; }
    50% { opacity: 1; }
}

.vtb-fly {
    position: fixed;
    z-index: 99999;
    margin: 0;
    border-radius: 50%;
    pointer-events: none;
    box-sizing: border-box;
    background: radial-gradient(circle at 32% 28%, #fffef0 0%, #fde047 38%, #eab308 72%, #a16207 100%);
    box-shadow:
        0 0 14px rgba(253, 224, 71, 1),
        0 0 32px rgba(234, 179, 8, 0.75),
        0 0 48px rgba(202, 138, 4, 0.45);
}

.g2-balance.vtb-balance-glow,
.gyn-balance.vtb-balance-glow,
.tok-balance.vtb-balance-glow {
    border-radius: 14px;
    outline: 2px solid rgba(250, 204, 21, 0.85);
    outline-offset: 4px;
    box-shadow: 0 0 28px rgba(253, 224, 71, 0.55), 0 0 48px rgba(234, 179, 8, 0.35);
    transition: box-shadow 0.2s ease, outline 0.2s ease;
}

#g2VoteTokens.vtb-token-counter-hit,
#gynVoteTokenBalance.vtb-token-counter-hit,
#tokVoteTokenBalance.vtb-token-counter-hit,
[data-bbg-vote-tokens].vtb-token-counter-hit {
    display: inline-block;
    animation: vtb-counter-bump 0.95s ease-out;
}

@keyframes vtb-counter-bump {
    0% {
        transform: scale(1);
        color: inherit;
        text-shadow: none;
    }
    35% {
        transform: scale(1.55);
        color: #fef08a;
        text-shadow: 0 0 18px rgba(250, 204, 21, 0.95), 0 0 36px rgba(234, 179, 8, 0.65);
    }
    100% {
        transform: scale(1);
        color: inherit;
        text-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    #g2VoteTokens.vtb-token-counter-hit,
    #gynVoteTokenBalance.vtb-token-counter-hit,
    #tokVoteTokenBalance.vtb-token-counter-hit,
    [data-bbg-vote-tokens].vtb-token-counter-hit {
        animation: none;
    }
}

