* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "SF Mono", "Consolas", "Courier New", monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 107, 107, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(79, 172, 254, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

button {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.app {
    width: min(900px, 100%);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 24px 16px 32px;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hud-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hud-row-secondary {
    gap: 8px;
}

.mini-btn {
    margin-left: 0;
    padding: 6px 12px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mini-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.mini-btn:active {
    transform: translateY(0);
}

.reward-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.reward-btn {
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(245, 87, 108, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.reward-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5);
}

.reward-btn:active {
    transform: translateY(0);
}

.reward-timer {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.4);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.reward-timer.hidden {
    display: none;
}

.answer-countdown {
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #facc15 0%, #fb7185 100%);
    box-shadow: 0 4px 14px rgba(251, 113, 133, 0.35);
}

.hud-sep {
    opacity: 0.6;
    font-weight: 700;
}

.stage {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
}

.set,
.probe {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 3vmin, 24px);
    min-height: 90px;
}

.token {
    min-width: clamp(44px, 9vmin, 72px);
    min-height: clamp(44px, 9vmin, 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(26px, 6vmin, 40px);
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.status-text {
    position: absolute;
    inset: auto;
    font-size: clamp(20px, 4.5vmin, 32px);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    padding: 10px 18px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.status-text.hidden {
    display: none;
}

.token::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.token:hover::before {
    opacity: 1;
}

.token:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 
        0 12px 32px rgba(102, 126, 234, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.probe .token {
    transform: scale(0.95);
    animation: pop 50ms ease-out forwards;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 50%, #f093fb 100%);
    box-shadow: 
        0 8px 24px rgba(79, 172, 254, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.glow {
    animation: pulseGlow 1.5s ease-in-out infinite;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.8),
        0 8px 24px rgba(102, 126, 234, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 
            0 0 30px rgba(255, 215, 0, 0.8),
            0 8px 24px rgba(102, 126, 234, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
    50% { 
        box-shadow: 
            0 0 40px rgba(255, 215, 0, 1),
            0 8px 24px rgba(102, 126, 234, 0.8),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
}

.actions {
    width: 100%;
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-bottom: 36px;
    margin-top: 6px;
}

.difficulty-row {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 6px 0 10px;
    margin-top: 6px;
}

.difficulty-btn {
    width: min(520px, 100%);
    padding: 12px 16px;
    border-radius: 18px;
    border: none;
    background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.5);
}

.difficulty-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%);
    backdrop-filter: blur(18px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    padding: 28px 28px 30px;
    border-radius: 24px;
    width: min(520px, 92%);
    text-align: left;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
}

.difficulty-options {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.difficulty-option {
    padding: 12px 16px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.difficulty-option:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.14));
    transform: translateY(-1px);
}

.difficulty-novice {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.35);
}

.difficulty-amateur {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}

.difficulty-pro {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.difficulty-cheater {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}
.btn {
    flex: 1 1 40%;
    max-width: 220px;
    padding: 16px 20px;
    border-radius: 20px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 800;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.35);
    box-shadow: none;
    transform: none;
}

.btn:disabled::before {
    opacity: 0;
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: scale(0.95);
}

.btn.yes {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    box-shadow: 0 8px 24px rgba(0, 242, 254, 0.4);
    color: #fff;
}

.btn.yes:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 242, 254, 0.5);
}

.btn.no {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    box-shadow: 0 8px 24px rgba(245, 87, 108, 0.4);
    color: #fff;
}

.btn.no:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(245, 87, 108, 0.5);
}

.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.overlay.hidden {
    display: none;
}

.welcome-overlay {
    z-index: 90;
}

.help-overlay {
    z-index: 110;
}

.welcome-card,
.help-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%);
    backdrop-filter: blur(18px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    padding: 28px 28px 30px;
    border-radius: 24px;
    width: min(520px, 92%);
    text-align: left;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.welcome-title,
.help-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.welcome-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 18px;
    font-weight: 600;
}

.welcome-steps {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.welcome-step {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 700;
}

.welcome-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.help-text {
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.9;
    margin-bottom: 16px;
}

.help-text ul {
    margin: 6px 0 10px 18px;
}

.help-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
}

.start-btn {
    padding: 14px 24px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.start-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

.start-btn:active {
    transform: translateY(-2px);
}

.exit-btn {
    margin-top: 12px;
    padding: 12px 20px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 700;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.exit-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    transform: translateY(-2px);
}

.gameover-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 28px 32px;
    border-radius: 24px;
    text-align: center;
    min-width: 280px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.gameover-title {
    font-size: 1.4rem;
    margin-bottom: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gameover-score,
.gameover-best {
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.apps-btn {
    margin-top: 0;
    background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
    box-shadow: 0 8px 22px rgba(236, 72, 153, 0.35);
    border: none;
}

.apps-row {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.apps-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%);
    backdrop-filter: blur(18px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    padding: 26px 24px 28px;
    border-radius: 24px;
    width: min(520px, 92%);
    text-align: left;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
}

.apps-links {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.apps-link {
    padding: 12px 16px;
    border-radius: 16px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.apps-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.apps-link-1 {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.apps-link-2 {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
}

.apps-link-3 {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
}

.apps-link-4 {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
}

.apps-link-5 {
    background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
}

.apps-link-6 {
    background: linear-gradient(135deg, #14b8a6 0%, #10b981 100%);
}

@keyframes pop {
    to { transform: scale(1); }
}

body.flash-good {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #667eea 100%);
    background-size: 400% 400%;
}

body.flash-bad {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 50%, #764ba2 100%);
    background-size: 400% 400%;
}

.hidden {
    display: none;
}

.neutral-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    min-width: 36px;
    min-height: 36px;
}

.subscribe-btn {
    padding: 6px 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-color: rgba(255, 255, 255, 0.4);
}

.neutral-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.neutral-btn:active {
    transform: translateY(0);
}

.neutral-btn svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

@media (max-width: 600px) {
    .hud {
        width: 100%;
        gap: 6px;
        font-size: 0.8rem;
        padding: 8px 10px;
        letter-spacing: 0.5px;
    }
    .hud-row {
        gap: 6px;
    }
    .hud-sep {
        display: none;
    }
    .mini-btn {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
    .actions {
        padding-bottom: 44px;
    }
    .difficulty-row {
        margin-top: 46px;
    }
    .difficulty-btn {
        font-size: 0.8rem;
        padding: 10px 14px;
    }
    .btn {
        max-width: none;
    }
    .neutral-btn {
        padding: 5px 8px;
        min-width: 32px;
        min-height: 32px;
    }
    .neutral-btn svg {
        width: 16px;
        height: 16px;
    }
}

.stage.shake {
    animation: shake 120ms ease-in-out;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    100% { transform: translateX(0); }
}

@keyframes pop {
    to { 
        transform: scale(1);
    }
}
