:root {
    color-scheme: dark;
    font-family: "Segoe UI", "Roboto", sans-serif;
    --bg: #0f172a;
    --panel: rgba(30, 41, 59, 0.85);
    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --danger: #f87171;
    --success: #4ade80;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(120% 120% at 50% 0%, #1d263d 0%, #0a0d1a 60%, #04060c 100%);
    color: #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px clamp(16px, 4vw, 48px);
}

.app {
    width: min(1200px, 100%);
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: clamp(20px, 3vw, 32px);
    background: rgba(6, 10, 20, 0.78);
    border-radius: 28px;
    box-shadow: 0 28px 60px rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(18px);
}

.app--cinema {
    width: min(1320px, 100%);
    background: radial-gradient(120% 140% at 50% 0%, #020617 0%, #020617 50%, #000000 100%);
}

.app--cinema .stage__playfield {
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8), 0 40px 80px rgba(0, 0, 0, 0.9);
}

.app--cinema .stage {
    grid-template-columns: minmax(0, 1fr);
}

.app--cinema .sidebar {
    display: none;
}

.app--cinema canvas {
    height: clamp(520px, 62vw, 720px);
}

.hud {
    display: grid;
    grid-template-columns: 2fr 1.5fr auto;
    gap: clamp(16px, 2vw, 28px);
    align-items: center;
}

.hud__title h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hud__subtitle {
    margin: 6px 0 0;
    color: #a5b4fc;
    font-size: clamp(13px, 1.6vw, 15px);
    letter-spacing: 0.03em;
}

.hud__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 18px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 18px;
    padding: 16px 20px;
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.35);
    font-size: 15px;
}

.hud__stats strong {
    color: #facc15;
    font-weight: 700;
}

.hud__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}

.hud__button {
    appearance: none;
    border: none;
    cursor: pointer;
    padding: 14px 28px;
    border-radius: 16px;
    background: linear-gradient(135deg, #34d399, #22c55e);
    color: #022c22;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hud__button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(52, 211, 153, 0.22);
}

.hud__button--ghost {
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
    padding-inline: 18px;
    font-size: 13px;
}

.hud__button--ghost:hover {
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.6);
    background: rgba(15, 23, 42, 0.95);
}

.hud__language {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.hud__language-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lang-btn {
    appearance: none;
    border: none;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lang-btn:hover {
    background: rgba(56, 189, 248, 0.32);
    transform: translateY(-1px);
}

.lang-btn--active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #0f172a;
    box-shadow: 0 14px 28px rgba(56, 189, 248, 0.18);
}

.hud__select {
    appearance: none;
    border: none;
    border-radius: 12px;
    padding: 10px 28px 10px 12px;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.hud__select:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--accent);
}

.hud__cities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.city-chip {
    font-size: 13px;
    padding-inline: 16px;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.4);
}

.city-chip:hover {
    background: rgba(30, 64, 175, 0.7);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.9);
}

.city-chip--active {
    background: linear-gradient(135deg, #38bdf8, #4f46e5);
    color: #0b1120;
    box-shadow: 0 14px 28px rgba(56, 189, 248, 0.18);
}

.stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: clamp(18px, 2vw, 32px);
    align-items: start;
}

.stage__playfield {
    position: relative;
    width: 100%;
    min-height: clamp(480px, 54vw, 640px);
    border-radius: 26px;
    overflow: hidden;
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.25);
}

.stage__advanced-hud {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    gap: 12px;
    padding: 8px 14px;
    background: linear-gradient(90deg, rgba(15,23,42,0.9), rgba(15,23,42,0.65));
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    backdrop-filter: blur(12px);
    pointer-events: none;
}

.advanced-hud__item {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 13px;
    color: var(--muted);
}

.advanced-hud__label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.advanced-hud__value {
    color: #e5e7eb;
    font-weight: 700;
}

.city-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: transparent;
    z-index: 0;
    opacity: 0.35;
}

canvas {
    position: relative;
    z-index: 1;
    width: 100%;
    height: clamp(480px, 54vw, 640px);
    display: block;
}

/* Fullscreen: sadece oyun alanı görünsün */
.stage__playfield:fullscreen {
    border-radius: 0;
}

.stage__playfield:fullscreen .help {
    display: none;
}

.stage__playfield:fullscreen canvas {
    width: 100vw;
    height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.player-stats {
    display: none;
}

.leaderboard,
.feed {
    background: rgba(6, 11, 25, 0.75);
    border-radius: 22px;
    padding: 18px 20px;
    box-shadow: inset 0 0 0 1px rgba(30, 64, 175, 0.35);
}

.leaderboard__title {
    margin: 0 0 12px;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
}

.leaderboard__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

.leaderboard__item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 14px;
border-radius: 14px;
background: rgba(15, 23, 42, 0.65);
box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.leaderboard__rank {
font-weight: 700;
color: #facc15;
margin-right: 10px;
}

.leaderboard__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard__score {
    font-weight: 600;
    color: #cbd5f5;
}

.leaderboard__item--player {
    background: rgba(56, 189, 248, 0.2);
    box-shadow: inset 0 0 0 1px var(--accent-strong);
}

.feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: clamp(320px, 48vw, 420px);
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.45;
}

.feed__entry {
    background: rgba(23, 37, 84, 0.55);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.15);
    color: #c7d2fe;
}

.help {
    text-align: center;
    color: #94a3b8;
    font-size: clamp(13px, 1.6vw, 15px);
    letter-spacing: 0.04em;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(10px);
    z-index: 100;
    padding: 24px;
}

.modal--hidden {
    display: none;
}

.modal__panel {
    background: rgba(15, 23, 42, 0.92);
    border-radius: 24px;
    padding: clamp(24px, 5vw, 36px);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: min(420px, 100%);
}

.modal__title {
    margin: 0;
    font-size: clamp(20px, 3vw, 28px);
    color: #e2e8f0;
}

.modal__label {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
}

.modal__input {
    padding: 12px 16px;
    border-radius: 14px;
    border: none;
    background: rgba(148, 163, 184, 0.18);
    color: var(--text);
    font-size: 15px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.32);
}

.modal__input:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--accent);
}

.modal__section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal__colors {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.color-chip {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-chip:hover {
    transform: translateY(-2px) scale(1.05);
}

.color-chip--active {
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.4);
    border-color: #fff;
}

.modal__start {
    align-self: flex-end;
}

@media (max-width: 960px) {
    .hud {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hud__actions {
        justify-content: flex-start;
    }

    .stage {
        grid-template-columns: 1fr;
    }

    canvas {
        height: clamp(360px, 65vw, 520px);
    }

    .sidebar {
        flex-direction: row;
        align-items: stretch;
    }

    .leaderboard,
    .feed {
        flex: 1;
        max-height: none;
    }

    .modal__panel {
        width: min(360px, 100%);
    }

    .modal__colors {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    .app {
        border-radius: 18px;
        gap: 18px;
    }

    .hud__stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    canvas {
        border-radius: 20px;
    }
}
