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

:root {
    --primary: #ff6b6b;
    --primary-dark: #ee5a6f;
    --secondary: #feca57;
    --accent: #ff9ff3;
    --success: #48dbfb;
    --danger: #ff6b9d;
    --warning: #ffc107;
    --bg: #0a0e27;
    --bg-card: #1a1f3a;
    --bg-input: #252b4a;
    --text: #ffffff;
    --text-muted: #a8b2d1;
    --border: #2d3555;
    --shadow: rgba(0, 0, 0, 0.5);
    --glow: rgba(255, 107, 107, 0.3);
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 107, 107, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(254, 202, 87, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 159, 243, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.container {
    width: 100%;
    max-width: 650px;
    position: relative;
    z-index: 1;
}

.game-card {
    background: linear-gradient(145deg, rgba(26, 31, 58, 0.95) 0%, rgba(37, 43, 74, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 50px 45px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5),
                0 0 60px var(--glow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 107, 107, 0.03), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #ff9ff3 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 3s ease infinite;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 0 40px rgba(255, 107, 107, 0.3);
    position: relative;
}

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

h1::after {
    content: '🔥';
    position: absolute;
    font-size: 2.5rem;
    animation: bounce 2s ease infinite;
    filter: drop-shadow(0 0 10px rgba(255, 107, 107, 0.5));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(-10deg); }
    75% { transform: translateY(-10px) rotate(10deg); }
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome {
    text-align: center;
    margin-bottom: 40px;
}

.welcome h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #a8b2d1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.welcome p {
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.welcome .small {
    font-size: 1rem;
    margin-top: 15px;
    color: var(--secondary);
    font-weight: 500;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

input[type="text"],
input[type="number"] {
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 18px 20px;
    font-size: 1.1rem;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    font-weight: 500;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15),
                0 0 20px rgba(255, 107, 107, 0.2);
    transform: translateY(-2px);
    background: rgba(37, 43, 74, 0.8);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder {
    color: var(--text-muted);
}

.btn {
    padding: 18px 35px;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 2px solid var(--border);
    margin-top: 25px;
    width: 100%;
}

.btn-secondary:hover {
    background: var(--border);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.2);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.player-info {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.attempts-counter {
    background: linear-gradient(135deg, var(--bg-input) 0%, var(--border) 100%);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.guess-area {
    display: flex;
    gap: 15px;
    margin-bottom: 35px;
}

.guess-area input {
    flex: 1;
}

.message-area {
    min-height: 80px;
    margin-bottom: 25px;
}

.message {
    padding: 20px 25px;
    border-radius: 15px;
    margin-bottom: 15px;
    animation: messagePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 500;
}

@keyframes messagePop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.message.success {
    background: linear-gradient(135deg, rgba(72, 219, 251, 0.2) 0%, rgba(72, 219, 251, 0.1) 100%);
    border: 2px solid var(--success);
    color: var(--success);
    font-weight: 700;
    text-align: center;
    font-size: 1.2rem;
    box-shadow: 0 0 30px rgba(72, 219, 251, 0.3);
}

.message.error {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.2) 0%, rgba(255, 107, 157, 0.1) 100%);
    border: 2px solid var(--danger);
    color: var(--danger);
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.2);
}

.message.info {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2) 0%, rgba(255, 107, 107, 0.1) 100%);
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.2);
}

.roast-area {
    min-height: 100px;
    margin-bottom: 25px;
}

.roast {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25) 0%, rgba(255, 107, 157, 0.25) 100%);
    border: 2px solid var(--warning);
    border-radius: 20px;
    padding: 25px;
    color: var(--text);
    font-size: 1.2rem;
    text-align: center;
    font-weight: 600;
    animation: roastBurn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(255, 193, 7, 0.4),
                inset 0 0 30px rgba(255, 107, 157, 0.1);
    position: relative;
    overflow: hidden;
}

.roast::before {
    content: '🔥';
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 3rem;
    opacity: 0.3;
    animation: flicker 2s ease infinite;
}

.roast::after {
    content: '🔥';
    position: absolute;
    bottom: -10px;
    right: -10px;
    font-size: 3rem;
    opacity: 0.3;
    animation: flicker 2s ease infinite 1s;
}

@keyframes flicker {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

@keyframes roastBurn {
    0% {
        opacity: 0;
        transform: scale(0.7) rotate(-5deg);
        filter: blur(5px);
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0);
    }
}

.hint {
    text-align: center;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    margin-top: 10px;
}

.hint.too-low {
    color: #48dbfb;
    background: rgba(72, 219, 251, 0.1);
    border: 1px solid rgba(72, 219, 251, 0.3);
}

.hint.too-high {
    color: #ff6b9d;
    background: rgba(255, 107, 157, 0.1);
    border: 1px solid rgba(255, 107, 157, 0.3);
}

/* Progress indicator */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 15px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer:hover {
    opacity: 1;
}

.footer-brand {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 15px;
    }

    .game-card {
        padding: 25px 20px;
        border-radius: 20px;
    }

    header {
        margin-bottom: 30px;
    }

    h1 {
        font-size: 2.2rem;
        letter-spacing: -0.5px;
    }

    h1::after {
        font-size: 1.5rem;
        top: -5px;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .welcome {
        margin-bottom: 30px;
    }

    .welcome h2 {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }

    .welcome p {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .welcome .small {
        font-size: 0.9rem;
        margin-top: 12px;
    }

    .input-group {
        gap: 15px;
    }

    input[type="text"],
    input[type="number"] {
        padding: 16px 18px;
        font-size: 1rem;
        border-radius: 12px;
    }

    .btn {
        padding: 16px 25px;
        font-size: 1rem;
        letter-spacing: 1px;
        border-radius: 12px;
    }

    .game-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        margin-bottom: 25px;
        padding-bottom: 15px;
    }

    .player-info {
        font-size: 1.1rem;
    }

    .attempts-counter {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .guess-area {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 25px;
    }

    .progress-bar {
        margin-top: 15px;
        height: 5px;
    }

    .message-area {
        min-height: 60px;
        margin-bottom: 20px;
    }

    .message {
        padding: 15px 18px;
        font-size: 0.95rem;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .message.success {
        font-size: 1rem;
    }

    .roast-area {
        min-height: 80px;
        margin-bottom: 20px;
    }

    .roast {
        padding: 18px 20px;
        font-size: 1rem;
        border-radius: 15px;
        line-height: 1.5;
    }

    .roast::before,
    .roast::after {
        font-size: 2rem;
    }

    .hint {
        padding: 12px;
        font-size: 0.9rem;
        margin-top: 8px;
    }

    .btn-secondary {
        margin-top: 20px;
        padding: 16px;
    }

    .footer {
        bottom: 0;
        font-size: 0.75rem;
        padding: 12px 15px;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .game-card {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.9rem;
    }

    .welcome h2 {
        font-size: 1.4rem;
    }

    .roast {
        font-size: 0.95rem;
        padding: 15px 18px;
    }

    .footer {
        font-size: 0.7rem;
        padding: 10px 15px;
    }
}
