:root {
    --primary-color: #0ea5e9;
    --secondary-color: #6366f1;
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: none;
}

.game-container {
    max-width: 500px;
    margin: 60px auto 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-icon-small {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.back-btn {
    padding: 8px 16px;
    background: #334155;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
}

.game-info {
    display: flex;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    padding: 12px;
    border-radius: 16px;
    margin-bottom: 15px;
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.info-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
}

.game-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    background: linear-gradient(to bottom, #0ea5e9 0%, #38bdf8 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.2);
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Screens */
.start-screen,
.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
}

.hidden {
    display: none !important;
}

.start-content,
.game-over-content {
    text-align: center;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 24px;
    width: 85%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.start-content p[data-i18n="flappy_subtitle"] {
    margin-bottom: 25px;
    color: var(--text-light);
    font-weight: 500;
}

.setup-group {
    margin-bottom: 20px;
    text-align: left;
}

.setup-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.setup-group input {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid #334155;
    border-radius: 12px;
    color: white;
    box-sizing: border-box;
}

.game-start-btn,
.restart-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.controls-hint {
    background: rgba(15, 23, 42, 0.4);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.record-box {
    margin: 15px 0;
    padding: 12px;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 12px;
}

.bottom-ad {
    margin-top: 15px;
    text-align: center;
}

@media (max-height: 750px) {
    .game-container {
        margin: 50px auto 10px;
    }
}