/* ===================================
   Higher Lower: Sueldos Argentina
   Mobile-first CSS
   =================================== */

/* CSS Variables */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-current: #1e3a5f;
    --bg-card-next: #2d1b4e;

    --color-green: #4ade80;
    --color-green-dark: #22c55e;
    --color-red: #f87171;
    --color-red-dark: #ef4444;
    --color-gold: #fbbf24;
    --color-purple: #a855f7;

    --color-text: #ffffff;
    --color-text-muted: #94a3b8;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-button: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--color-text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.4;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ===================================
   START SCREEN
   =================================== */
#screen-start {
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.start-content {
    text-align: center;
    max-width: 320px;
    width: 100%;
}

.logo {
    margin-bottom: 30px;
}

.logo-emoji {
    font-size: 80px;
    display: block;
    margin-bottom: 10px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo h1 {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--color-gold), var(--color-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-top: 5px;
}

.description {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 40px;
    line-height: 1.6;
}

.highscore-display {
    margin-top: 30px;
    padding: 15px 25px;
    background: var(--bg-card);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.trophy {
    font-size: 1.2em;
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
    font-family: var(--font-family);
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    touch-action: manipulation;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--color-green), var(--color-green-dark));
    color: var(--bg-primary);
    box-shadow: var(--shadow-button), 0 0 20px rgba(74, 222, 128, 0.3);
}

.btn-primary:hover {
    box-shadow: var(--shadow-button), 0 0 30px rgba(74, 222, 128, 0.5);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--color-text);
    border: 2px solid var(--color-text-muted);
}

.btn-large {
    padding: 18px 50px;
    font-size: 1.2rem;
    min-height: 60px;
    width: 100%;
    max-width: 280px;
}

/* ===================================
   GAME SCREEN
   =================================== */
#screen-game {
    background: var(--bg-primary);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.score-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-green);
}

.highscore-container {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    color: var(--color-gold);
}

/* Cards Container */
.cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 0;
    position: relative;
    overflow: hidden;
}

/* Card Base */
.card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 20px;
    position: relative;
    min-height: 200px;
    transition: all var(--transition-normal);
}

.card-current {
    background: linear-gradient(135deg, var(--bg-card-current), #0d2137);
    box-shadow: var(--shadow-card);
}

.card-next {
    background: linear-gradient(135deg, var(--bg-card-next), #1a0d2e);
    box-shadow: var(--shadow-card);
}

.card-emoji {
    font-size: 60px;
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-salary {
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-gold);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.card-salary.hidden {
    display: none;
}

.card-salary.revealing {
    display: block;
    animation: salaryReveal 0.3s ease-out;
}

@keyframes salaryReveal {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* VS Badge */
.vs-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: var(--bg-primary);
    border: 3px solid var(--color-text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    z-index: 10;
}

/* Guess Buttons */
.guess-buttons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.guess-buttons.hidden {
    display: none;
}

.btn-higher,
.btn-lower {
    flex: 1;
    flex-direction: column;
    padding: 15px 25px;
    min-height: 70px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 15px;
}

.btn-higher {
    background: linear-gradient(135deg, var(--color-green), var(--color-green-dark));
    color: var(--bg-primary);
}

.btn-lower {
    background: linear-gradient(135deg, var(--color-red), var(--color-red-dark));
    color: var(--bg-primary);
}

.btn-arrow {
    font-size: 1.5rem;
    line-height: 1;
}

/* Result Indicator */
.result-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: resultPop 0.4s ease-out;
    z-index: 20;
}

.result-indicator.hidden {
    display: none;
}

.result-indicator.correct {
    background: var(--color-green);
    box-shadow: 0 0 30px var(--color-green);
}

.result-indicator.wrong {
    background: var(--color-red);
    box-shadow: 0 0 30px var(--color-red);
}

@keyframes resultPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Card Animations */
.card-next.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.card-current.slide-out {
    animation: slideOut 0.4s ease-in forwards;
}

@keyframes slideOut {
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* ===================================
   GAME OVER SCREEN
   =================================== */
#screen-gameover {
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a0a1a 100%);
}

.gameover-content {
    text-align: center;
    max-width: 320px;
    width: 100%;
}

.gameover-emoji {
    font-size: 80px;
    margin-bottom: 20px;
}

.gameover-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 30px;
    color: var(--color-red);
    text-transform: uppercase;
    letter-spacing: 3px;
}

.final-score {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.final-label {
    font-size: 1rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.final-value {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--color-gold), var(--color-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-highscore {
    margin-bottom: 20px;
}

.new-record-badge {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--color-gold), #f59e0b);
    color: var(--bg-primary);
    font-weight: 700;
    border-radius: 30px;
    font-size: 1.1rem;
    animation: pulse 1s ease-in-out infinite;
}

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

.gameover-highscore {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 40px;
}

.gameover-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.gameover-buttons .btn-secondary {
    padding: 15px 30px;
    min-height: 50px;
}

/* ===================================
   UTILITIES
   =================================== */
.hidden {
    display: none !important;
}

/* ===================================
   TABLET & DESKTOP
   =================================== */
@media (min-width: 768px) {
    .cards-container {
        flex-direction: row;
        padding: 20px;
        gap: 20px;
        max-width: 900px;
        margin: 0 auto;
    }

    .card {
        min-height: 400px;
    }

    .card-emoji {
        font-size: 80px;
    }

    .card-title {
        font-size: 1.8rem;
    }

    .card-salary {
        font-size: 2.5rem;
    }

    .vs-badge {
        width: 60px;
        height: 60px;
        font-size: 1.1rem;
    }

    .btn-higher,
    .btn-lower {
        min-height: 80px;
        font-size: 1.1rem;
    }

    .logo h1 {
        font-size: 4rem;
    }

    .logo-emoji {
        font-size: 100px;
    }

    .gameover-title {
        font-size: 3rem;
    }

    .final-value {
        font-size: 6rem;
    }
}

/* Landscape mobile adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .cards-container {
        flex-direction: row;
        padding: 10px;
    }

    .card {
        min-height: auto;
        padding: 15px;
    }

    .card-emoji {
        font-size: 40px;
        margin-bottom: 5px;
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .card-salary {
        font-size: 1.5rem;
    }

    .guess-buttons {
        margin-top: 10px;
    }

    .btn-higher,
    .btn-lower {
        min-height: 50px;
        padding: 10px 15px;
    }

    .game-header {
        padding: 10px 15px;
    }

    .score-value {
        font-size: 1.5rem;
    }
}
