:root {
  --ink: #0d1320;
  --paper: #f4f5f7;
  --muted: #8a94a6;
  --accent: #e63946;
  --accent-dark: #a51d29;
  --gold: #f4c24a;
  --gold-dark: #b8860b;
  --panel: rgba(12, 17, 28, 0.88);
  --panel-line: rgba(255, 255, 255, 0.1);
  --card: rgba(255, 255, 255, 0.06);
  --font: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #0d1320;
  font-family: var(--font);
  color: var(--paper);
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  letter-spacing: 0.3px;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
/* Seviye/harita geçişinde sahne kısa süre kararır (donma yerine yumuşak geçiş) */
#fade { position: fixed; inset: 0; background: #05070c; opacity: 0; pointer-events: none; transition: opacity 0.16s ease; }
#fade.on { opacity: 1; }
.hidden { display: none !important; }

/* ---------- Ortak parçalar ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(8, 12, 20, 0.62); color: #fff;
  padding: 4px 14px; border-radius: 6px;
  font-weight: 700; font-size: 21px; line-height: 1.2;
  border: 1px solid var(--panel-line);
  backdrop-filter: blur(6px);
}
.pill.big { font-size: 24px; padding: 6px 16px; }
.coin-ico {
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6cf, var(--gold) 45%, var(--gold-dark));
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.18);
  display: inline-block; flex: none;
}
/* Yumuşak, basılabilir butonlar: alttaki "kenar" gölgesi basınca kaybolur, buton içeri gömülür */
.btn, .icon-btn {
  --edge: rgba(0, 0, 0, 0.42);
  --lift: 5px;
  font: inherit; color: #fff; cursor: pointer;
  border: 0; outline: none;
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.09) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12),
    0 var(--lift) 0 var(--edge),
    0 calc(var(--lift) + 8px) 22px rgba(0, 0, 0, 0.28);
  transform: translateY(0);
  transition:
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.2s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: manipulation;
}
.btn {
  font-weight: 700; font-size: 20px; letter-spacing: 1.2px; text-transform: uppercase;
  border-radius: 18px; padding: 13px 24px;
}
.btn:hover, .icon-btn:hover { filter: brightness(1.08); }
.btn:focus-visible, .icon-btn:focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55), 0 var(--lift) 0 var(--edge); }
/* Basılı an: kenar gölgesi kapanır, buton aşağı iner ve hafifçe küçülür */
.btn:active, .btn.is-pressed, .icon-btn:active, .icon-btn.is-pressed {
  transform: translateY(calc(var(--lift) - 1px)) scale(0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 3px 8px rgba(0, 0, 0, 0.22),
    0 1px 0 var(--edge),
    0 3px 8px rgba(0, 0, 0, 0.22);
  filter: brightness(0.96);
  transition-duration: 0.06s;
}
.btn.primary {
  --edge: #a51d29;
  background: linear-gradient(180deg, #ff737c 0%, #ec4452 52%, #d42f3d 100%);
  text-shadow: 0 1px 2px rgba(120, 10, 20, 0.35);
}
.btn.primary:not(:disabled):not(:active):not(.is-pressed) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12),
    0 var(--lift) 0 var(--edge),
    0 calc(var(--lift) + 10px) 26px rgba(230, 57, 70, 0.38);
}
.btn.huge {
  --lift: 7px;
  font-size: 32px; font-style: italic; font-weight: 800; letter-spacing: 1.5px;
  padding: 15px 70px; border-radius: 26px;
}
.btn:disabled {
  opacity: 0.4; cursor: default; filter: grayscale(0.4);
  transform: translateY(calc(var(--lift) - 2px));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 0 var(--edge);
}
.icon-btn {
  --lift: 4px;
  font-size: 18px; width: 46px; height: 46px; border-radius: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(40, 48, 66, 0.82) 0%, rgba(14, 19, 30, 0.82) 100%);
}

/* ---------- Ekranlar ---------- */
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}
#menu {
  justify-content: space-between; pointer-events: none;
  /* Canlı sahne vitrini: ortası açık kalsın (karakter ve manzara), üst ve alt okunaklı olsun */
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.5) 0%, rgba(8, 12, 20, 0) 22%, rgba(8, 12, 20, 0) 58%, rgba(8, 12, 20, 0.78) 100%);
}
#menu .spacer { pointer-events: none; }
#menu > * { pointer-events: auto; }
.menu-top { width: 100%; display: flex; justify-content: space-between; align-items: center; }
/* ---------- Ana menü: parlak, tıknaz oyun stili ---------- */
.spacer { flex: 1; }
.logo { margin-top: 2vh; display: flex; flex-direction: column; align-items: center; line-height: 0.88; font-weight: 800; font-style: italic; text-align: center; }
.logo-top, .logo-bot { font-size: clamp(38px, 10vw, 74px); letter-spacing: 1px; }
#menu .logo { pointer-events: none; }
.logo-top {
  color: #fff; -webkit-text-stroke: 3px #1a0a12; paint-order: stroke fill;
  text-shadow: 0 6px 0 #c62835, 0 9px 0 #1a0a12, 0 18px 26px rgba(0, 0, 0, 0.45);
  animation: logoBob 3.2s ease-in-out infinite;
}
.logo-bot {
  background: linear-gradient(#fff3a0 0%, #ffd04a 45%, #ff8a1f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 3px #1a0a12; paint-order: stroke fill;
  filter: drop-shadow(0 5px 0 #a8380b) drop-shadow(0 12px 16px rgba(0, 0, 0, 0.45));
  animation: logoBob 3.2s ease-in-out 0.25s infinite;
}
@keyframes logoBob { 50% { transform: translateY(-4px) rotate(-1deg); } }
.logo-sub {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-top: 16px; padding: 5px 16px; border-radius: 999px; font-style: normal; font-weight: 700;
  background: rgba(10, 14, 24, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: clamp(13px, 3.4vw, 17px); letter-spacing: 0.4px; color: #fff; line-height: 1.3;
}
.logo-sub i { width: 6px; height: 6px; border-radius: 50%; background: #ffd04a; box-shadow: 0 0 6px #ffd04a; }
.menu-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }

/* Vitrin karakter seçici: karakterin ayaklarının hemen altında, cam görünümlü */
.char-switch {
  display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 999px;
  background: rgba(10, 14, 24, 0.45); border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.cs-arrow {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.14); transition: transform 0.08s, background 0.15s;
}
.cs-arrow:hover { background: rgba(255, 255, 255, 0.24); }
.cs-arrow:active { transform: scale(0.92); }
.cs-arrow svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cs-name { min-width: 104px; text-align: center; line-height: 1.05; }
.cs-name b { display: block; font-size: 20px; font-weight: 800; font-style: italic; letter-spacing: 0.5px; }
.cs-name small { font-size: 11px; color: rgba(255, 255, 255, 0.7); letter-spacing: 1px; text-transform: uppercase; }

/* Seviye kartı */
.level-card {
  display: flex; align-items: center; gap: 10px; width: min(440px, 100%); padding: 8px; border-radius: 22px;
  background: linear-gradient(rgba(40, 46, 70, 0.82), rgba(14, 18, 30, 0.88));
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lv-thumb {
  position: relative; flex: none; width: 70px; height: 70px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  background: linear-gradient(160deg, #ff9a5a, #6b3cc9); border: 3px solid #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}
.lv-thumb.night { background: linear-gradient(160deg, #1d2a5a, #05070f); }
.lv-thumb.rain { background: linear-gradient(160deg, #8a98a8, #3a4552); }
.lv-thumb.nightRain { background: linear-gradient(160deg, #2a3242, #07090e); }
.lv-badge {
  position: absolute; left: -8px; top: -9px; min-width: 28px; height: 26px; padding: 0 6px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; font-style: italic;
  color: #5a3500; background: linear-gradient(#ffe37a, #ffb31f); border: 2px solid #1a0a12;
}
.lv-info { flex: 1; min-width: 0; text-align: left; }
.lv-name { font-size: 24px; font-weight: 800; font-style: italic; text-transform: uppercase; line-height: 1; }
.lv-theme { font-size: 15px; color: rgba(255, 255, 255, 0.8); margin-top: 3px; }
.lv-best { font-size: 13px; color: #ffe37a; margin-top: 2px; font-weight: 700; }
.lv-arrow {
  flex: none; width: 40px; height: 70px; border-radius: 14px; cursor: pointer; border: 2px solid #1a0a12;
  background: linear-gradient(#ff6b6b, #c62835); box-shadow: 0 4px 0 #1a0a12;
  display: flex; align-items: center; justify-content: center; transition: transform 0.08s, box-shadow 0.08s;
}
.lv-arrow svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.lv-arrow:active { transform: translateY(3px); box-shadow: 0 1px 0 #1a0a12; }
.lv-arrow:disabled { filter: grayscale(1) brightness(0.8); opacity: 0.4; cursor: default; transform: none; }

/* YARIŞ butonu: altın, nabız gibi atan, üstünden ışık geçen */
.play-btn {
  position: relative; overflow: hidden; cursor: pointer; color: #fff; font: inherit; font-weight: 800; font-style: italic;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-width: min(320px, 100%); font-size: 36px; letter-spacing: 1px; padding: 8px 40px 10px;
  border: 4px solid #1a0a12; border-radius: 24px;
  background: linear-gradient(#ffe066 0%, #ffbf1f 45%, #ff8a1f 100%);
  box-shadow: 0 7px 0 #1a0a12, 0 14px 26px rgba(120, 50, 0, 0.4);
  text-shadow: 0 3px 0 rgba(150, 60, 0, 0.6);
  animation: playPulse 2.4s ease-in-out infinite;
}
.play-btn::before {
  content: ''; position: absolute; left: 8px; right: 8px; top: 3px; height: 42%; border-radius: 16px 16px 40% 40% / 16px 16px 18px 18px;
  background: linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.08)); pointer-events: none;
}
.play-btn::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; width: 30%; left: -40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: skewX(-20deg); animation: shine 3.6s ease-in-out infinite; pointer-events: none;
}
.play-btn > * { position: relative; }
.play-btn:active { box-shadow: 0 2px 0 #1a0a12; transform: translateY(5px); animation: none; }
.play-ico { width: 30px; height: 30px; fill: #fff; filter: drop-shadow(0 3px 0 rgba(150, 60, 0, 0.6)); }
@keyframes playPulse { 50% { transform: scale(1.035); } }
@keyframes shine { 0%, 55% { left: -40%; } 85%, 100% { left: 130%; } }

/* Renkli ikon kartları */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(440px, 100%); }
.tile {
  position: relative; overflow: hidden; cursor: pointer; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 10px 4px 8px; border-radius: 18px; border: 3px solid #1a0a12;
  font: inherit; font-weight: 800; font-size: 16px; letter-spacing: 0.6px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  box-shadow: 0 5px 0 #1a0a12, 0 10px 18px rgba(0, 0, 0, 0.3); transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.tile::before {
  content: ''; position: absolute; left: 5px; right: 5px; top: 3px; height: 40%; border-radius: 12px 12px 40% 40% / 12px 12px 16px 16px;
  background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.05)); pointer-events: none;
}
.tile > * { position: relative; }
.tile svg { width: 34px; height: 34px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.28)); }
.tile svg .f { fill: #fff; }
.tile:hover { filter: brightness(1.08); transform: translateY(-2px); }
.tile:active, .tile.is-pressed { transform: translateY(4px); box-shadow: 0 1px 0 #1a0a12; }
.tile-sub { font-style: normal; font-size: 12px; font-weight: 700; opacity: 0.85; }
.tile-face { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 2px solid #fff; background: #e9eaec; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.tile-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Vitrinde sahne görünsün diye alt kutular yatay ve ince */
.tiles.mini .tile { flex-direction: row; gap: 8px; padding: 7px 8px; font-size: 14px; border-radius: 15px; }
.tiles.mini .tile svg { width: 24px; height: 24px; }
.tiles.mini .tile-face { width: 28px; height: 28px; }
.tiles.mini .tile-sub { font-size: 11px; }
#menu .level-card { padding: 6px; border-radius: 18px; }
#menu .lv-thumb { width: 54px; height: 54px; font-size: 28px; border-radius: 13px; }
#menu .lv-arrow { height: 54px; width: 36px; }
#menu .lv-name { font-size: 20px; }
#menu .lv-theme { font-size: 13px; }
#menu .play-btn { font-size: 32px; padding: 6px 36px 8px; }
.t-green { background: linear-gradient(#7bf09a, #22ad4b); }
.t-purple { background: linear-gradient(#c3a0ff, #7b4fe0); }
.icon-btn.round { border-radius: 50%; }
.row { display: flex; gap: 10px; }

.panel-screen { justify-content: center; background: rgba(5, 8, 14, 0.55); backdrop-filter: blur(4px); }
.panel {
  width: min(440px, 100%); max-height: 100%; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 10px; padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; gap: 12px;
}
.panel.small { width: min(320px, 100%); text-align: center; }
.panel h2 { margin: 0; font-size: 30px; font-style: italic; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }

/* Geliştirme kartları */
.upgrade-list { display: flex; flex-direction: column; gap: 8px; }
.upgrade {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--panel-line); border-radius: 16px; padding: 12px;
}
.upgrade .ico { font-size: 24px; text-align: center; filter: grayscale(0.3); }
.upgrade .name { font-weight: 700; font-size: 21px; line-height: 1; text-transform: uppercase; letter-spacing: 1px; }
.upgrade .desc { font-size: 15px; color: var(--muted); }
.pips { display: flex; gap: 3px; margin-top: 6px; }
.pips i { width: 14px; height: 6px; border-radius: 1px; background: rgba(255, 255, 255, 0.12); transform: skewX(-12deg); }
.pips i.on { background: var(--accent); }
.upgrade .btn { --lift: 4px; font-size: 18px; padding: 9px 14px; border-radius: 14px; display: flex; align-items: center; gap: 6px; }

/* ---------- Menü profil rozeti ---------- */
.menu-top-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.profile-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 46vw; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 17px; font-weight: 800; font-style: italic; color: #fff;
  background: rgba(10, 14, 24, 0.5); border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform 0.08s;
}
.profile-chip:active { transform: scale(0.95); }
.profile-chip #pf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-ico { font-style: normal; font-size: 15px; }
.pf-edit { font-style: normal; font-size: 13px; opacity: 0.7; }

/* ---------- İsim seçme ekranı ---------- */
#name { justify-content: center; background: rgba(5, 8, 14, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.name-card {
  width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 18px 18px;
  border-radius: 24px; background: linear-gradient(rgba(40, 46, 70, 0.9), rgba(14, 18, 30, 0.94));
  border: 2px solid rgba(255, 255, 255, 0.3); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.name-logo { display: flex; flex-direction: column; align-items: center; line-height: 0.9; font-weight: 800; font-style: italic; margin-bottom: 6px; }
.name-logo .logo-top, .name-logo .logo-bot { font-size: 40px; animation: none; }
.name-q { font-size: 24px; font-weight: 800; font-style: italic; }
.name-hint { margin: -6px 0 2px; font-size: 14px; color: rgba(255, 255, 255, 0.7); text-align: center; }
#name-input {
  width: 100%; padding: 12px 14px; border-radius: 14px; font: inherit; font-size: 22px; font-weight: 700; text-align: center; color: #fff;
  background: rgba(0, 0, 0, 0.35); border: 2px solid rgba(255, 255, 255, 0.25); outline: none;
}
#name-input:focus { border-color: #ffd04a; box-shadow: 0 0 0 3px rgba(255, 208, 74, 0.25); }
#name-input.bad { border-color: #ff6b6b; }
.name-err { min-height: 18px; font-size: 14px; font-weight: 700; color: #ff8a8a; }
.name-cancel { background: none; border: 0; color: rgba(255, 255, 255, 0.7); font: inherit; font-size: 15px; cursor: pointer; padding: 4px 10px; }

/* ---------- Karakter seçimi: 3D vitrin üstünde ---------- */
#chars {
  justify-content: space-between; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.55) 0%, rgba(8, 12, 20, 0) 18%, rgba(8, 12, 20, 0) 48%, rgba(8, 12, 20, 0.85) 100%);
}
#chars > * { pointer-events: auto; }
#chars .spacer { pointer-events: none; }
.cs-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cs-title { font-size: 24px; font-weight: 800; font-style: italic; letter-spacing: 2px; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.ico-stroke { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cs-bottom { width: min(520px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cs-info { display: flex; align-items: center; gap: 12px; align-self: flex-start; padding-left: 4px; }
.cs-num {
  min-width: 52px; height: 52px; padding: 0 6px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: #f5f5f2; color: #111; font-size: 28px; font-weight: 800; font-style: italic; border-top: 6px solid var(--c, #e63946);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.cs-big { font-size: clamp(34px, 9vw, 46px); font-weight: 800; font-style: italic; line-height: 0.95; letter-spacing: 1px; text-transform: uppercase; text-shadow: 0 3px 12px rgba(0, 0, 0, 0.5); }
.cs-line { font-size: 15px; color: rgba(255, 255, 255, 0.8); margin-top: 3px; }
.cs-action {
  --lift: 5px; position: relative; overflow: hidden; cursor: pointer; width: min(320px, 100%); padding: 11px 20px;
  font: inherit; font-size: 22px; font-weight: 800; font-style: italic; letter-spacing: 1px; color: #fff;
  border: 3px solid #1a0a12; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(#ffe066 0%, #ffbf1f 45%, #ff8a1f 100%); box-shadow: 0 5px 0 #1a0a12, 0 12px 22px rgba(0, 0, 0, 0.35);
  text-shadow: 0 2px 0 rgba(150, 60, 0, 0.55); transition: transform 0.08s, box-shadow 0.08s;
}
.cs-action:active { transform: translateY(4px); box-shadow: 0 1px 0 #1a0a12; }
.cs-action.done { background: linear-gradient(#7bf09a, #22ad4b); text-shadow: 0 2px 0 rgba(0, 80, 30, 0.5); }
.cs-action.buy { background: linear-gradient(#c3a0ff, #7b4fe0); text-shadow: 0 2px 0 rgba(40, 10, 90, 0.5); }
.cs-action.poor { background: linear-gradient(#59606e, #363b46); color: rgba(255, 255, 255, 0.75); text-shadow: none; }
.cs-action small { font-size: 13px; font-style: normal; font-weight: 700; opacity: 0.85; }
.char-strip {
  width: 100%; display: flex; gap: 10px; overflow-x: auto; padding: 6px 4px 10px; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.char-strip::-webkit-scrollbar { display: none; }
.ccard {
  flex: none; width: 84px; scroll-snap-align: center; cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 7px; border-radius: 18px;
  background: rgba(14, 18, 30, 0.6); border: 2px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.15s, background 0.15s;
  touch-action: manipulation;
}
.ccard:active { transform: scale(0.94); }
.ccard.preview { border-color: #ffd04a; background: rgba(60, 46, 14, 0.7); transform: translateY(-4px); }
.ccard .face { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; position: relative; background: #e9eaec; box-shadow: 0 0 0 3px var(--c); }
.ccard .face img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ccard.locked .face img { filter: grayscale(0.85) brightness(0.55); }
.ccard .lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.ccard .nm { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.ccard .st { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 3px; }
.ccard.inuse .st { color: #7bf09a; }
.ccard .st .coin-ico { width: 12px; height: 12px; }

/* Karakter kartları (eski panel stili, artık kullanılmıyor) */
.char-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.char {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--panel-line); border-radius: 16px; padding: 10px 6px;
  text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  touch-action: manipulation;
}
.char:active, .char.is-pressed { transform: translateY(3px) scale(0.97); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25), 0 1px 0 rgba(0, 0, 0, 0.35); transition-duration: 0.06s; }
.char.selected { border-color: var(--accent); background: linear-gradient(180deg, rgba(230, 57, 70, 0.24), rgba(230, 57, 70, 0.1)); }
.char .avatar {
  width: 76px; height: 76px; border-radius: 18px; position: relative; overflow: hidden;
  background: #e9eaec; box-shadow: 0 0 0 3px var(--c1), 0 4px 10px rgba(0, 0, 0, 0.35);
}
.char .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.char .avatar span {
  position: absolute; right: 3px; bottom: 3px;
  background: #f5f5f2; color: #111; font-weight: 800; font-style: italic; font-size: 14px; line-height: 1.1;
  min-width: 24px; padding: 0 4px; border-radius: 6px; border-top: 3px solid var(--c1); text-align: center;
}
.char .cname { font-weight: 700; font-size: 19px; text-transform: uppercase; letter-spacing: 1px; }
.char .gender { font-size: 15px; color: var(--muted); font-weight: 600; }
.char .cost { font-size: 15px; display: flex; align-items: center; gap: 4px; color: var(--muted); }
.char.locked .avatar { filter: grayscale(0.7) brightness(0.7); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
.hud-top {
  position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 66px;
  display: flex; align-items: center; gap: 10px;
}
.pill.pos {
  font-size: 30px; font-style: italic; font-weight: 800; padding: 0 14px;
  background: var(--accent); border-color: transparent; transform: skewX(-8deg);
}
.progress { flex: 1; height: 6px; border-radius: 3px; background: rgba(8, 12, 20, 0.5); position: relative; border: 1px solid var(--panel-line); }
#progress-track { position: absolute; inset: 0; }
.dot {
  position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 2px solid rgba(255, 255, 255, 0.9);
}
.dot.me { width: 16px; height: 16px; z-index: 2; border-width: 3px; border-color: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3); }
.progress::after {
  content: ''; position: absolute; right: -4px; top: -7px; width: 8px; height: 18px; border-radius: 1px;
  background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 8px 8px;
}
.hud-level {
  position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 46px); left: 14px;
  color: #fff; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 15px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
#btn-pause { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; pointer-events: auto; }
.hud-bottom { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); right: 18px; }
.speed {
  color: #fff; font-weight: 800; font-style: italic; font-size: 54px; line-height: 0.9; text-align: right;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.speed small { font-size: 16px; margin-left: 4px; opacity: 0.85; font-weight: 600; letter-spacing: 1px; }
.hint {
  position: absolute; bottom: max(96px, calc(env(safe-area-inset-bottom) + 86px)); left: 50%; transform: translateX(-50%);
  color: #fff; background: rgba(8, 12, 20, 0.6); padding: 6px 14px; border-radius: 4px;
  font-weight: 600; white-space: nowrap; font-size: 16px; letter-spacing: 0.5px; transition: opacity 0.6s;
}

.countdown {
  position: fixed; left: 50%; top: 36%; transform: translate(-50%, -50%);
  font-size: 150px; font-weight: 800; font-style: italic; color: #fff; pointer-events: none;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}
.countdown.pop { animation: pop 0.5s ease-out; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

#toasts { position: fixed; left: 0; right: 0; top: 28%; display: flex; flex-direction: column; align-items: center; pointer-events: none; gap: 6px; }
.toast {
  font-size: 32px; font-weight: 800; font-style: italic; color: #fff; letter-spacing: 1px;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.6);
  animation: toast 1.2s ease-out forwards;
}
.toast.gold { color: var(--gold); }
.toast.red { color: #ff5a5f; }
@keyframes toast {
  0% { transform: translateX(-20px); opacity: 0; }
  15% { transform: translateX(0); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-24px); opacity: 0; }
}

#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
/* Rakip isim etiketi: küçük, yarı saydam koyu zemin, takım rengi sadece ince bir çizgi */
.label {
  position: absolute; transform: translate(-50%, -100%);
  font-size: 10.5px; font-weight: 700; color: rgba(255, 255, 255, 0.92); line-height: 1.35;
  padding: 0 5px; border-radius: 4px; white-space: nowrap; letter-spacing: 0.8px; text-transform: uppercase;
  background: rgba(10, 14, 22, 0.42); border-bottom: 2px solid var(--c, #fff);
  transition: opacity 0.15s;
}

/* ---------- Sonuçlar ---------- */
.results-panel { position: relative; overflow-x: hidden; gap: 8px; padding: 14px 16px; animation: panelIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.results-panel .btn { padding: 10px 20px; }
@keyframes panelIn { from { transform: translateY(40px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
.res-head { display: flex; align-items: center; justify-content: center; gap: 14px; }
.res-place {
  font-size: 62px; font-weight: 800; font-style: italic; line-height: 0.9; color: var(--accent);
  text-shadow: 0 6px 24px rgba(230, 57, 70, 0.35);
}
.res-place.p1 { color: #f4c24a; text-shadow: 0 6px 26px rgba(244, 194, 74, 0.45); }
.res-place.p2 { color: #d7dde6; text-shadow: 0 6px 26px rgba(215, 221, 230, 0.35); }
.res-place.p3 { color: #d9935b; text-shadow: 0 6px 26px rgba(217, 147, 91, 0.35); }
.res-title { font-size: 26px; font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: 1.5px; line-height: 1; }
.res-sub { font-size: 15px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }

/* Kürsü: 2. - 1. - 3. */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin-top: 2px; }
.podium .col { display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: 0; animation: rise 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards; }
.podium .col.c1 { animation-delay: 0.35s; }
.podium .col.c2 { animation-delay: 0.15s; }
.podium .col.c3 { animation-delay: 0.25s; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.podium .face {
  width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: #e9eaec; position: relative;
  box-shadow: 0 0 0 3px var(--c), 0 6px 14px rgba(0, 0, 0, 0.4);
}
.podium .c1 .face { width: 60px; height: 60px; }
.podium .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.podium .me .face { box-shadow: 0 0 0 3px var(--c), 0 0 0 6px #fff, 0 6px 14px rgba(0, 0, 0, 0.4); }
.podium .pname { font-weight: 800; font-size: 17px; text-transform: uppercase; letter-spacing: 0.5px; line-height: 1; }
.podium .ptime { font-size: 14px; color: var(--muted); line-height: 1; }
.podium .block {
  width: 100%; border-radius: 12px 12px 4px 4px; display: flex; align-items: flex-start; justify-content: center;
  font-size: 30px; font-weight: 800; font-style: italic; color: rgba(0, 0, 0, 0.55); padding-top: 4px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 6px 14px rgba(0, 0, 0, 0.3);
}
.podium .c1 .block { height: 56px; background: linear-gradient(180deg, #ffe08a, #e2a91f); }
.podium .c2 .block { height: 42px; background: linear-gradient(180deg, #f1f4f8, #aeb7c4); }
.podium .c3 .block { height: 32px; background: linear-gradient(180deg, #f0b98a, #b87342); }
.podium .block { font-size: 24px; }
.podium .crown { font-size: 20px; line-height: 1; margin-bottom: -2px; }

/* 4-6. sıralar */
.res-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.res-list li {
  display: grid; grid-template-columns: 24px 32px 1fr auto; gap: 10px; align-items: center;
  background: var(--card); border-radius: 12px; padding: 3px 12px 3px 10px; font-weight: 600; font-size: 16px;
  opacity: 0; animation: rowIn 0.4s ease-out forwards;
}
@keyframes rowIn { from { transform: translateX(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.res-list li .rank { font-weight: 800; font-style: italic; color: var(--muted); }
.res-list li .mini { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--c); background: #e9eaec; }
.res-list li .mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-list li .gap { color: var(--muted); font-variant-numeric: tabular-nums; }
.res-list li.me { background: linear-gradient(90deg, rgba(230, 57, 70, 0.35), rgba(230, 57, 70, 0.12)); }
.res-list li.me .rank, .res-list li.me .gap { color: #fff; }

/* Süre ve rekor */
.res-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative; }
.res-stats .stat { background: var(--card); border-radius: 12px; padding: 5px 12px; display: flex; flex-direction: column; }
.res-stats small { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.res-stats b { font-size: 21px; font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; line-height: 1.1; }
.record {
  position: absolute; right: 8px; top: -10px; background: var(--gold); color: #1b1300; font-weight: 800; font-size: 13px;
  padding: 2px 9px; border-radius: 999px; letter-spacing: 1px; transform: rotate(4deg);
  animation: pulse 1s ease-in-out infinite alternate;
}
@keyframes pulse { from { transform: rotate(4deg) scale(1); } to { transform: rotate(4deg) scale(1.08); } }

/* Ödül */
.res-reward {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(90deg, rgba(244, 194, 74, 0.16), rgba(244, 194, 74, 0.05));
  border: 1px solid rgba(244, 194, 74, 0.3); border-radius: 14px; padding: 6px 12px;
}
.res-reward .chips { display: flex; flex-direction: column; gap: 3px; font-size: 15px; color: rgba(255, 255, 255, 0.85); }
.res-reward .chip { display: flex; align-items: center; gap: 6px; }
.res-reward .chip .coin-ico { width: 14px; height: 14px; }
.res-reward .total { font-size: 32px; font-weight: 800; font-style: italic; display: flex; align-items: center; gap: 8px; color: var(--gold); }
.res-reward .total .coin-ico { width: 26px; height: 26px; }

/* Konfeti (ilk 3) */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; opacity: 0.9;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(720px) rotate(720deg); opacity: 0.2; } }

/* ---------- Yükleme ---------- */
.loading { justify-content: center; gap: 18px; background: radial-gradient(ellipse at 50% 40%, #1b2740, #0b0f18 70%); }
.loading-logo { font-size: 54px; font-weight: 800; font-style: italic; letter-spacing: 1px; }
.loading-logo span { color: var(--accent); }
.loading-track { width: min(320px, 80vw); height: 4px; background: rgba(255, 255, 255, 0.12); border-radius: 2px; overflow: hidden; }
#loading-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
#loading-text { font-size: 18px; color: var(--muted); letter-spacing: 1px; }

/* Yeni harita açıldı / final şeridi */
.res-unlock {
  margin: 6px 0 2px; padding: 8px 12px; border-radius: 14px; text-align: center; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(135deg, rgba(255, 196, 61, 0.22), rgba(92, 225, 230, 0.18)); border: 1px solid rgba(255, 214, 120, 0.45);
  color: #fff3d0; font-size: 15px; animation: rise 0.6s 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.res-unlock small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
