/* ========================================
   Sorry What, Andy's Edition - Styles
   80's Disco Theme
   ======================================== */

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    background: linear-gradient(135deg, #8B00FF 0%, #FF00FF 100%);
    color: #FFFFFF;
    position: relative;
    min-height: 100vh;
}

/* ========================================
   Background Decoration
   ======================================== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 255, 0.03) 2px, rgba(0, 255, 255, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255, 20, 147, 0.03) 2px, rgba(255, 20, 147, 0.03) 4px);
    pointer-events: none;
    z-index: 0;
    animation: bgPulse 4s ease-in-out infinite;
}

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

/* ========================================
   Container & Layout
   ======================================== */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ========================================
   Back Button
   ======================================== */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 12px;
    color: #A0E7FF;
    text-shadow: 0 0 5px #A0E7FF;
    text-decoration: none;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #A0E7FF;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 10;
}

.back-btn:hover {
    background: rgba(160, 231, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(160, 231, 255, 0.6);
}

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

/* ========================================
   Header
   ======================================== */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    font-size: 28px;
    color: #FFFFFF;
    text-shadow:
        0 0 5px #FF00FF,
        0 0 15px #FF00FF;
    margin-bottom: 10px;
    animation: titleGlow 2s ease-in-out infinite;
}

.subtitle {
    font-size: 16px;
    color: #A0E7FF;
    text-shadow: 0 0 8px #A0E7FF;
    animation: subtitleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow:
            0 0 5px #FF00FF,
            0 0 15px #FF00FF;
    }
    50% {
        text-shadow:
            0 0 8px #FF00FF,
            0 0 20px #FF00FF;
    }
}

@keyframes subtitleGlow {
    0%, 100% {
        text-shadow: 0 0 8px #A0E7FF;
    }
    50% {
        text-shadow:
            0 0 10px #A0E7FF,
            0 0 18px #A0E7FF;
    }
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

/* ========================================
   Word Boxes
   ======================================== */
.word-box {
    width: 90%;
    height: 180px;
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid #FF1493;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-shadow:
        0 0 20px rgba(255, 20, 147, 0.5),
        inset 0 0 20px rgba(255, 20, 147, 0.1);
    animation: boxGlow 2.5s ease-in-out infinite;
    transition: all 0.3s ease;
}

#word-box-1 {
    border-color: #A0E7FF;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.5),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    animation-delay: 0s;
}

#word-box-2 {
    border-color: #39FF14;
    box-shadow:
        0 0 20px rgba(57, 255, 20, 0.5),
        inset 0 0 20px rgba(57, 255, 20, 0.1);
    animation-delay: 0.5s;
}

@keyframes boxGlow {
    0%, 100% {
        box-shadow:
            0 0 20px currentColor,
            inset 0 0 20px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow:
            0 0 30px currentColor,
            0 0 40px currentColor,
            inset 0 0 30px rgba(255, 255, 255, 0.2);
    }
}

.word {
    font-size: 30px;
    font-weight: bold;
    color: #FFFFFF;
    text-align: center;
    text-transform: uppercase;
    text-shadow:
        0 0 5px #FFFFFF,
        0 0 12px #FF00FF;
    word-wrap: break-word;
    max-width: 100%;
    line-height: 1.3;
    transition: all 0.3s ease;
}

/* Word animation classes */
.word.fade-out {
    animation: fadeOutWord 200ms ease-out forwards;
}

.word.fade-in {
    animation: fadeInWord 300ms ease-out forwards;
}

@keyframes fadeOutWord {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes fadeInWord {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* ========================================
   Action Buttons
   ======================================== */
.button-group {
    width: 90%;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    flex: 1;
    height: 70px;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #000000;
    border: 4px solid #FFFFFF;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.1s ease;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    min-height: 48px;
}

.correct-btn {
    background: linear-gradient(135deg, #39FF14 0%, #00FF00 100%);
    box-shadow:
        0 0 20px rgba(57, 255, 20, 0.6),
        0 0 30px rgba(0, 255, 0, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
}

.correct-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 30px rgba(57, 255, 20, 0.8),
        0 0 40px rgba(0, 255, 0, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.4);
}

.correct-btn:active {
    transform: scale(0.95);
    box-shadow:
        0 0 40px rgba(57, 255, 20, 1),
        0 0 50px rgba(0, 255, 0, 0.8),
        inset 0 0 40px rgba(255, 255, 255, 0.5);
}

.skip-btn {
    background: linear-gradient(135deg, #FF1493 0%, #FF00FF 100%);
    box-shadow:
        0 0 20px rgba(255, 20, 147, 0.6),
        0 0 30px rgba(255, 0, 255, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
}

.skip-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 30px rgba(255, 20, 147, 0.8),
        0 0 40px rgba(255, 0, 255, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.4);
}

.skip-btn:active {
    transform: scale(0.95);
    box-shadow:
        0 0 40px rgba(255, 20, 147, 1),
        0 0 50px rgba(255, 0, 255, 0.8),
        inset 0 0 40px rgba(255, 255, 255, 0.5);
}

.action-btn.pulse {
    animation: buttonPulse 200ms ease-out;
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* ========================================
   Counters
   ======================================== */
.counters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.counter {
    font-size: 14px;
    color: #A0E7FF;
    text-shadow: 0 0 5px #A0E7FF;
    display: flex;
    gap: 8px;
    align-items: center;
}

.counter-value {
    font-size: 18px;
    color: #FFFF00;
    text-shadow: 0 0 5px #FFFF00;
}

/* ========================================
   Timer Display
   ======================================== */
.timer-display {
    font-size: 24px;
    color: #FFFF00;
    text-shadow: 0 0 10px #FFFF00;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid #FFFF00;
    border-radius: 10px;
    box-shadow:
        0 0 20px rgba(255, 255, 0, 0.5),
        inset 0 0 20px rgba(255, 255, 0, 0.1);
}

.timer-label {
    font-size: 16px;
    color: #A0E7FF;
    text-shadow: 0 0 5px #A0E7FF;
}

.timer-value {
    font-size: 32px;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

.timer-display.warning {
    border-color: #FF1493;
    box-shadow:
        0 0 20px rgba(255, 20, 147, 0.8),
        inset 0 0 20px rgba(255, 20, 147, 0.2);
    animation: timerPulse 0.5s ease-in-out infinite;
}

.timer-display.warning .timer-value {
    color: #FF1493;
    text-shadow: 0 0 10px #FF1493;
}

@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ========================================
   Reset Button
   ======================================== */
.reset-btn {
    width: 80%;
    height: 60px;
    margin-top: 20px;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #000000;
    background: linear-gradient(135deg, #00FFFF 0%, #A0E7FF 100%);
    border: 4px solid #FFFFFF;
    border-radius: 15px;
    cursor: pointer;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.6),
        0 0 30px rgba(160, 231, 255, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    transition: all 0.1s ease;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    min-height: 48px;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.8),
        0 0 40px rgba(160, 231, 255, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.4);
}

.reset-btn:active {
    transform: scale(0.95);
    box-shadow:
        0 0 40px rgba(0, 255, 255, 1),
        0 0 50px rgba(160, 231, 255, 0.8),
        inset 0 0 40px rgba(255, 255, 255, 0.5);
}

.reset-btn.pulse {
    animation: buttonPulse 200ms ease-out;
}
/* ========================================
   Responsive Design
   ======================================== */

/* Tablet (768px+) */
@media (min-width: 768px) {
    .title {
        font-size: 32px;
    }

    .subtitle {
        font-size: 18px;
    }

    .word {
        font-size: 40px;
    }

    .word-box {
        height: 200px;
    }

    .action-btn {
        font-size: 24px;
        height: 80px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .container {
        max-width: 600px;
        margin: 0 auto;
    }

    .title {
        font-size: 36px;
    }

    .subtitle {
        font-size: 20px;
    }

    .word {
        font-size: 44px;
    }

    .main-content {
        gap: 30px;
    }

    .header {
        margin-bottom: 40px;
    }
}

/* iPhone and medium mobile devices (361px to 767px) */
@media (min-width: 361px) and (max-width: 767px) {
    .word {
        font-size: 26px;
    }
}

/* Small devices (adjust for very small screens) */
@media (max-width: 360px) {
    .title {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

    .word {
        font-size: 24px;
    }

    .word-box {
        height: 150px;
    }

    .action-btn {
        font-size: 18px;
        height: 60px;
    }
}

/* ========================================
   Accessibility
   ======================================== */
.action-btn:focus,
.icon-btn:focus {
    outline: 3px solid #FFFFFF;
    outline-offset: 4px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   Loading State
   ======================================== */
.loading {
    pointer-events: none;
    opacity: 0.6;
}
