/* ========================================
   SHARED BASE STYLES
   Reset, Variables, Fonts, Common Layout
   ======================================== */

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

:root {
    --primary-pink: #ff6b9d;
    --dark-pink: #c44569;
    --light-pink: #ffb8d0;
    --bg-dark: #1a1a2e;
    --bg-darker: #0f0f1a;
    --text-white: #ffffff;
    --pixel-yellow: #f9ca24;
    --pixel-green: #6ab04c;
    --pixel-red: #eb4d4b;
    --pixel-blue: #4834d4;
    --pixel-purple: #9b59b6;
    --shake-intensity: 5px;
}

@font-face {
    font-family: 'PixelFont';
    src: local('Press Start 2P');
}

body {
    font-family: 'Press Start 2P', cursive;
    background: var(--bg-darker);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#game-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    max-height: 900px;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(255, 107, 157, 0.3);
}

@media (min-width: 768px) {
    #game-container {
        height: 90vh;
        border-radius: 20px;
        border: 4px solid var(--primary-pink);
    }
}

/* ========================================
   SCREENS (Base)
   ======================================== */

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: var(--bg-dark);
    z-index: 5;
    overflow: hidden;
}

.screen.active {
    display: flex;
    z-index: 10;
}

/* ========================================
   DIALOGUE BOX (Base)
   ======================================== */

#dialogue-box {
    position: relative;
    z-index: 10;
    width: 100%;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.95) 0%, rgba(15, 15, 26, 0.98) 100%);
    border-top: 4px solid var(--primary-pink);
    padding: 20px;
    min-height: 160px;
}

#speaker-name {
    font-size: 12px;
    color: var(--pixel-yellow);
    margin-bottom: 10px;
    text-transform: uppercase;
}

#dialogue-text {
    font-size: 11px;
    color: var(--text-white);
    line-height: 1.8;
    min-height: 60px;
}

#dialogue-continue {
    position: absolute;
    bottom: 15px;
    right: 20px;
    color: var(--primary-pink);
    font-size: 14px;
}

/* ========================================
   AUDIO BUTTON
   ======================================== */

#audio-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid var(--primary-pink);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

#audio-toggle.muted {
    opacity: 0.5;
}

#audio-toggle::after {
    content: '\1F50A';
    font-size: 20px;
}

#audio-toggle.muted::after {
    content: '\1F507';
}

/* ========================================
   COMMON ANIMATIONS
   ======================================== */

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

.blink {
    animation: blink 1s step-end infinite;
}
