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

body {
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 25%, #f5f0ff 50%, #ffeef5 75%, #f0f4ff 100%);
    background-size: 400% 400%;
    animation: softGradient 25s ease infinite;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: 84px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 15% 25%, rgba(147, 51, 234, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

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

.app {
    width: min(800px, 100%);
    min-height: 680px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 24px;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: 18px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    position: relative;
    z-index: 1;
}

.app::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, 
        rgba(147, 51, 234, 0.2) 0%, 
        rgba(59, 130, 246, 0.2) 25%,
        rgba(236, 72, 153, 0.2) 50%,
        rgba(59, 130, 246, 0.2) 75%,
        rgba(147, 51, 234, 0.2) 100%);
    border-radius: 32px;
    z-index: -1;
    opacity: 0.5;
    animation: borderGlow 4s ease infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.topbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stat {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 12px 14px;
    text-align: center;
    border: 1px solid rgba(147, 51, 234, 0.15);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 20px rgba(147, 51, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(147, 51, 234, 0.25);
}

.label {
    font-size: 0.7rem;
    opacity: 0.65;
    display: block;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    color: #64748b;
}

.value {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #9333ea 0%, #3b82f6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 4px;
}

.play {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 28px;
    background: linear-gradient(135deg, 
        rgba(147, 51, 234, 0.1) 0%, 
        rgba(59, 130, 246, 0.1) 50%,
        rgba(236, 72, 153, 0.1) 100%);
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(255, 255, 255, 0.5);
}

.play::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(147, 51, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10px, -10px) scale(1.1); }
}

.statement {
    font-size: clamp(28px, 5.5vw, 56px);
    font-weight: 900;
    text-align: center;
    padding: 0 24px;
    line-height: 1.3;
    background: linear-gradient(135deg, #1e293b 0%, #475569 50%, #64748b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
    opacity: 1;
    transform: translateY(0) scale(1);
    border: none;
    background-color: transparent;
    cursor: default;
}

.statement.start-training-btn {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    color: #fff;
    padding: 20px 40px;
    border-radius: 24px;
    font-size: clamp(20px, 4vw, 32px);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(147, 51, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 800;
}

.statement.start-training-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(147, 51, 234, 0.5);
}

.statement.start-training-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.statement::before {
    content: '';
    position: absolute;
    inset: -10px;
    background: linear-gradient(135deg, 
        rgba(147, 51, 234, 0.1) 0%, 
        rgba(59, 130, 246, 0.1) 50%,
        rgba(236, 72, 153, 0.1) 100%);
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

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

.buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.action-btn {
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 24px 16px;
    font-size: 1.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.action-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;
}

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

.action-btn:active {
    transform: scale(0.96);
}

.action-btn.yes {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 
        0 8px 24px rgba(16, 185, 129, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.action-btn.yes:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 12px 32px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.action-btn.no {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 
        0 8px 24px rgba(245, 158, 11, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.action-btn.no:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 12px 32px rgba(245, 158, 11, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-bottom: 8px;
}

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

.start-btn {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(147, 51, 234, 0.4);
}

.stop-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.stop-btn.hidden {
    display: none;
}

.stop-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.info-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.info-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.reward-btn {
    flex: 1 1 100%;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%);
    color: #1e293b;
    border: 2px solid rgba(147, 51, 234, 0.2);
    padding: 14px 20px;
    border-radius: 20px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.reward-btn:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.25) 0%, rgba(59, 130, 246, 0.25) 100%);
    border-color: rgba(147, 51, 234, 0.4);
    transform: translateY(-2px);
}

.reward-timer {
    flex: 0 0 auto;
    font-weight: 700;
    color: #9333ea;
    padding: 6px 0;
    white-space: nowrap;
}

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

.best {
    font-size: 0.85rem;
    opacity: 0.7;
    white-space: nowrap;
    color: #64748b;
}

.status-row {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}


.hint-indicator {
    position: absolute;
    top: 18px;
    right: 18px;
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    color: #fbbf24;
    font-size: 1.6rem;
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.6));
    z-index: 10;
}

.hint-indicator.active {
    opacity: 1;
    transform: scale(1.3) rotate(360deg);
    animation: sparkle 0.6s ease;
}

@keyframes sparkle {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.6)); }
    50% { filter: drop-shadow(0 0 24px rgba(251, 191, 36, 1)); }
}

.hint-flash {
    animation: softFlash 0.4s ease 2;
}

@keyframes softFlash {
    0%, 100% { box-shadow: 0 0 0 rgba(147, 51, 234, 0); }
    50% { box-shadow: 0 0 0 8px rgba(147, 51, 234, 0.2); }
}

.hint-rotate .action-btn {
    transform: rotate(180deg);
}

.hint-bg {
    background: linear-gradient(135deg, 
        rgba(147, 51, 234, 0.2) 0%, 
        rgba(59, 130, 246, 0.2) 100%);
    transition: background 0.4s ease;
}

.end-screen {
    position: fixed;
    inset: 0;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.end-screen.hidden {
    display: none;
}

.end-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 32px;
    border-radius: 28px;
    text-align: center;
    width: min(400px, 90%);
    border: 2px solid rgba(147, 51, 234, 0.2);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    color: #1e293b;
}

.end-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #9333ea 0%, #3b82f6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.end-score, .end-streak {
    margin-bottom: 14px;
    font-size: 1.15rem;
    color: #475569;
    font-weight: 600;
}

.info-modal {
    position: fixed;
    inset: 0;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.info-modal.hidden {
    display: none;
}

.info-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 32px;
    border-radius: 28px;
    width: min(640px, 92%);
    max-height: 80vh;
    overflow: auto;
    border: 2px solid rgba(147, 51, 234, 0.2);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    color: #1e293b;
}

.info-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #9333ea 0%, #3b82f6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-text {
    font-size: 0.95rem;
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 16px;
    color: #475569;
}

.info-text p {
    margin-bottom: 12px;
}

.info-text strong {
    color: #1e293b;
    font-weight: 700;
}

@keyframes flash {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 255, 255, 0); }
    50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.15); }
}

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

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

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

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

@media (max-width: 600px) {
    .app {
        min-height: 100vh;
        border-radius: 0;
        padding: 16px;
    }
    
    .footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .start-btn, .stop-btn, .info-btn {
        width: 100%;
    }
    
    .neutral-btn {
        width: 100%;
        justify-content: center;
    }
}
