/* HistoryGuessr web — stil.
 *
 * Renkler, tipografi ve ölçüler uygulamanın tasarım sisteminden geliyor
 * (`DesignSystem/Theme.swift`, `docs/03-TASARIM.md`): koyu mürekkep zemin,
 * parşömen metin, kehribar vurgu, nane ve mercan yalnızca sonuç ekranlarında
 * kehribarın **yerine**.
 *
 * **Düzen web için kurgulandı, telefondan büyütülmedi.** İlk sürümde ekranlar
 * 560 px'lik bir sütuna sıkıştırılmıştı: telefon tasarımının masaüstünde
 * dolaşan hâli. Fotoğraf küçük kalıyordu, harita küçük kalıyordu, ekranın üçte
 * ikisi boştu. Şimdi oyun ekranı görünen alanın tamamını kullanıyor ve iki
 * panele bölünüyor — fotoğraf ile harita ekranı paylaşıyor, ikisi de büyük.
 *
 * Kural uygulamadakiyle aynı: bir ekranda tek aksan rengi bulunur.
 */

:root {
  --ink900: #07090D;
  --ink800: #0F141E;
  --surface1: #151B26;
  --surface2: #1E2636;
  --surface3: #28324A;

  --parchment: #F5EEE0;
  --muted: #8E9AB2;
  --faint: #5D6A83;

  --accent: #E9A94A;
  --accent-hi: #F0B75C;
  --accent-low: #E09A34;
  --accent-deep: #B87A22;
  --on-accent: #160F04;

  --mint: #4FBFA8;
  --coral: #E4674C;

  --hairline: rgba(245, 238, 224, 0.10);
  --hairline-soft: rgba(245, 238, 224, 0.06);

  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans: ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r8: 8px; --r12: 12px; --r16: 16px; --r20: 20px;

  --hud: 62px;
  --gap: 14px;
  --edge: 18px;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background:
    radial-gradient(760px 460px at 50% -170px, rgba(233, 169, 74, 0.13), transparent 70%),
    linear-gradient(180deg, #141B27 0%, #0C1017 46%, #0A0D13 100%);
  background-attachment: fixed;
  color: var(--parchment);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* --- Ekran kabuğu ---------------------------------------------------------
   İki ekran türü var ve bilinçli olarak farklı davranıyorlar:
   `.view-narrow` okunacak ekranlar (menü, sonuç, istatistik) — ortalanmış,
   sınırlı genişlikte, uzun satır yorucu olmasın. `.view-full` oynanacak
   ekranlar — görünen alanın tamamı, çünkü orada asıl içerik fotoğraf ve
   harita ve ikisi de büyük olmalı. */

#app { width: 100%; }

.view { display: none; }

.view-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--edge) 48px;
}
.view-narrow.active { display: block; animation: fade 0.24s ease-out; }

.view-full.active {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 var(--edge) var(--edge);
  animation: fade 0.24s ease-out;
}

/* Masaüstünde oyun ekranı kaydırılmıyor: her şey bir ekrana sığıyor. */
@media (min-width: 900px) {
  .view-full.active { height: 100dvh; overflow: hidden; }
}

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- Tipografi ------------------------------------------------------------ */

h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }
h1 { font-size: 32px; letter-spacing: 0.4px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

.mono { font-family: var(--mono); }
.label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--faint);
  text-transform: uppercase;
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { text-align: center; }

/* --- Kart ----------------------------------------------------------------- */

.card {
  background: var(--surface1);
  border: 1px solid var(--hairline);
  border-radius: var(--r20);
  padding: 16px;
}
.card + .card { margin-top: 12px; }

/* --- Butonlar ------------------------------------------------------------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r16);
  font-size: 17px;
  font-weight: 700;
  color: var(--on-accent);
  background: linear-gradient(180deg, var(--accent-hi), var(--accent-low));
  box-shadow: 0 10px 22px rgba(233, 169, 74, 0.18);
  transition: transform 0.14s ease, filter 0.14s ease;
}
.btn:active { transform: scale(0.98); filter: brightness(0.94); }
.btn:disabled { opacity: 0.38; box-shadow: none; cursor: not-allowed; transform: none; }

/* Oyun ekranının ana eylemi — kararın verildiği düğme, iri olmalı. */
.btn-lg { min-height: 58px; font-size: 18px; }

.btn.secondary {
  color: var(--parchment);
  background: var(--surface2);
  border: 1px solid var(--hairline);
  box-shadow: none;
  font-weight: 600;
}
.btn.ghost {
  color: var(--muted);
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 46px;
  font-size: 15px;
  font-weight: 600;
}
.btn.mint { color: #062018; background: var(--mint); box-shadow: 0 10px 22px rgba(79, 191, 168, 0.18); }
.btn.small { min-height: 42px; font-size: 14px; padding: 0 14px; width: auto; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  flex: none;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface2);
  color: var(--parchment);
  font-size: 18px;
  line-height: 1;
  transition: background 0.14s ease;
}
.icon-btn:hover { background: var(--surface3); }

.row { display: flex; gap: 10px; align-items: center; }
.spacer { flex: 1; }

/* --- Rozetler ------------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(30, 38, 54, 0.72);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--parchment);
  white-space: nowrap;
}
.pill.accent { color: var(--accent); border-color: rgba(233, 169, 74, 0.4); background: rgba(233, 169, 74, 0.12); }
.pill.mint { color: var(--mint); border-color: rgba(79, 191, 168, 0.4); background: rgba(79, 191, 168, 0.12); }
.pill.coral { color: var(--coral); border-color: rgba(228, 103, 76, 0.4); background: rgba(228, 103, 76, 0.12); }

/* --- Menü ----------------------------------------------------------------- */

.menu-top { display: flex; align-items: center; gap: 10px; padding: 22px 0 14px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 50px; height: 50px; border-radius: 12px; }
.brand .name { font-family: var(--serif); font-size: 22px; }
.brand .sub { font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px; color: var(--faint); }

.level-card { display: flex; align-items: center; gap: 14px; }
.level-ring {
  --p: 0;
  width: 52px; height: 52px; flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(245, 238, 224, 0.10) 0);
  display: grid;
  place-items: center;
}
.level-ring span {
  width: 41px; height: 41px;
  border-radius: 50%;
  background: var(--surface1);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 15px; font-weight: 700;
}

.tiles { display: grid; gap: 12px; margin-top: 14px; }

.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px;
  text-align: left;
  border: 1px solid var(--hairline);
  border-radius: var(--r20);
  background: var(--surface1);
  color: var(--parchment);
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.tile:hover:not(:disabled) { border-color: rgba(233, 169, 74, 0.35); background: #18202D; }
.tile:active { transform: scale(0.99); }
.tile:disabled { opacity: 0.5; cursor: not-allowed; }
.tile .glyph {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 13px;
  font-size: 22px;
  background: rgba(233, 169, 74, 0.13);
}
.tile.mint .glyph { background: rgba(79, 191, 168, 0.13); }
.tile .t { font-family: var(--serif); font-size: 18px; }
.tile .s { font-size: 13px; color: var(--muted); }
.tile .trail { margin-left: auto; text-align: right; }

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

/* --- Üst bar (oyun ve tur sonucu) ----------------------------------------- */

.hud {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--hud);
  flex: none;
}
.hud .who { min-width: 0; }
.hud .who .t { font-family: var(--serif); font-size: 17px; line-height: 1.2; }
.hud .who .s { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.rr-total {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}
.rr-total.mint { color: var(--mint); }
.rr-total.coral { color: var(--coral); }
.rr-total.accent { color: var(--accent); }

/* --- Oyun ekranı: iki panel ------------------------------------------------ */

/* Dar ekranda dikey akış: fotoğraf üstte, harita altta, ikisi de kendi taban
   yüksekliğini koruyor. Fotoğrafa görünen alanın üçte biri veriliyor —
   fazlası haritayı, azı kareyi okunmaz yapıyor. Toplam sığmazsa sayfa
   kayıyor; küçültmek yerine kaydırmak doğru olan, ikisi de büyük kalmalı. */
.play-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: var(--gap);
  grid-template-rows: minmax(210px, 34dvh) auto;
}

@media (min-width: 900px) {
  /* Fotoğraf bir tık geniş: kareler çoğunlukla yatay ve "contain" ile
     sığdırıldığında yatayda daha çok yer istiyorlar. */
  .play-grid { grid-template-columns: 1.08fr 1fr; grid-template-rows: 1fr; }
}

.panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; }

/* --- Fotoğraf -------------------------------------------------------------- */

.frame {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: var(--r20);
  overflow: hidden;
  background: #0B0F16;
  border: 1px solid var(--hairline);
}

/* Fotoğrafın **kendisinin** bulanık, koyulaştırılmış büyütmesi zemin oluyor.
 *
 * Kareler her orandan geliyor: 3:2 bir fotoğraf neredeyse kare bir panelde
 * "contain" ile sığdırılınca üstte ve altta geniş bir boşluk kalıyor ve ekran
 * yarım görünüyor. Kırpmak (`cover`) çözüm değil — oyun kenardaki ayrıntıya
 * bakarak oynanıyor, kırpmak oyuncudan ipucu saklamak olurdu. Bulanık zemin
 * boşluğu kareye ait bir şeyle dolduruyor: fotoğraf hâlâ tam görünüyor ama
 * panel bütün duruyor.
 *
 * `brightness` düşük tutuldu: zemin fotoğrafın kendisiyle yarışmamalı. */
.frame::before {
  content: "";
  position: absolute;
  inset: -8%;
  background-image: var(--bg, none);
  background-size: cover;
  background-position: center;
  filter: blur(34px) brightness(0.34) saturate(0.75);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.frame.loaded::before { opacity: 1; }
.frame > * { position: relative; }
.frame img {
  width: 100%;
  height: 100%;
  /* `cover` değil `contain`: oyun fotoğrafın kenarındaki ayrıntıya bakarak
     oynanıyor, kırpmak oyuncudan ipucu saklamak olurdu. */
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.frame-loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--faint);
  font-family: var(--mono); font-size: 12px;
}
.archive-no {
  position: absolute; left: 12px; bottom: 12px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 1.3px;
  color: rgba(245, 238, 224, 0.75);
  background: rgba(7, 9, 13, 0.6);
  padding: 4px 9px; border-radius: 6px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.frame-zoom {
  position: absolute; right: 12px; bottom: 12px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: rgba(7, 9, 13, 0.62);
  backdrop-filter: blur(6px);
  color: var(--parchment);
  font-size: 15px;
}
.frame-zoom:hover { background: rgba(7, 9, 13, 0.85); }

/* --- İpuçları ------------------------------------------------------------- */

.hint-row { display: flex; gap: 10px; flex: none; }
.hint {
  flex: 1;
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r12);
  background: var(--surface2);
  color: var(--parchment);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.hint:hover:not(:disabled) { background: var(--surface3); }
.hint:disabled { opacity: 0.42; cursor: not-allowed; }
.hint .n { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hint.used { border-color: rgba(79, 191, 168, 0.45); color: var(--mint); }

.hint-note {
  margin-top: 8px;
  padding: 10px 13px;
  border-radius: var(--r12);
  background: rgba(79, 191, 168, 0.10);
  border: 1px solid rgba(79, 191, 168, 0.35);
  color: var(--mint);
  font-size: 13px;
  font-weight: 600;
}

/* --- Harita --------------------------------------------------------------- */

.map-wrap {
  position: relative;
  flex: 1;
  /* Dar ekranda harita ezilmesin: iğne koymak dokunma hassasiyeti istiyor ve
     300 px'in altında dünya haritasında ülke seçmek zorlaşıyor. */
  min-height: 300px;
  border-radius: var(--r20);
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--surface1);
}
@media (min-width: 900px) { .map-wrap { min-height: 0; } }
.map-canvas { position: absolute; inset: 0; }

.map-hint {
  position: absolute;
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(7, 9, 13, 0.8);
  border: 1px solid var(--hairline);
  font-size: 13px;
  font-weight: 600;
  color: var(--parchment);
  pointer-events: none;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

/* Harita kurulamadığında görünen kart. Oyunun geri kalanı çalışmaya devam
   ediyor, o yüzden bu bir hata ekranı değil bir kurulum notu. */
.map-missing { padding: 22px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.map-missing strong { display: block; color: var(--parchment); font-size: 16px; margin-bottom: 6px; }
.map-missing code {
  font-family: var(--mono); font-size: 11px;
  background: var(--surface2); padding: 3px 7px; border-radius: 5px;
  color: var(--accent);
}

/* --- Tahmin çubuğu (yıl + gönder) ------------------------------------------ */

.guess-bar {
  flex: none;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r20);
  background: var(--surface1);
  border: 1px solid var(--hairline);
}

@media (min-width: 640px) {
  /* Yıl solda, düğme sağda: iki karar yan yana ve düğme her zaman aynı yerde. */
  .guess-bar { grid-template-columns: 1fr 190px; align-items: end; }
}

.year-head { display: flex; align-items: baseline; gap: 10px; }
.year-value {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--accent);
  line-height: 1;
  margin-left: auto;
}

.year-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }

.year-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 34px;
  background: transparent;
}
.year-slider::-webkit-slider-runnable-track {
  height: 7px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-hi));
}
.year-slider::-moz-range-track { height: 7px; border-radius: 4px; background: var(--surface3); }
.year-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--parchment);
  border: 3px solid var(--accent);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}
.year-slider::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--parchment); border: 3px solid var(--accent);
}

.year-scale {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; color: var(--faint);
}

/* --- Tur sonucu ----------------------------------------------------------- */

.round-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: var(--gap);
  grid-template-rows: minmax(260px, 46vh) auto;
}

@media (min-width: 900px) {
  /* Haritaya daha çok yer: turun hikâyesi orada — iki iğne ve aralarındaki
     mesafe. Sağdaki sütun onu okuyan metin. */
  .round-grid { grid-template-columns: 1.2fr 1fr; grid-template-rows: 1fr; }
}

.round-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.round-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.round-scroll .card:first-child { margin-top: 0; }

.bar-block + .bar-block { margin-top: 14px; }
.bar-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.bar-head .v { font-family: var(--mono); font-weight: 700; }
.bar { height: 9px; border-radius: 5px; background: rgba(245, 238, 224, 0.08); overflow: hidden; }
.bar i {
  display: block; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-hi));
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bar i.mint { background: linear-gradient(90deg, rgba(79,191,168,0.55), var(--mint)); }
.bar-note { font-size: 11px; color: var(--faint); margin-top: 5px; font-family: var(--mono); }

.caption { font-size: 14px; color: var(--muted); }
.caption-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r12);
  margin-bottom: 12px;
  border: 1px solid var(--hairline-soft);
}
.caption .title { font-family: var(--serif); font-size: 19px; color: var(--parchment); margin-bottom: 3px; }
.caption .credit { font-size: 11px; color: var(--faint); margin-top: 10px; }
.caption a { color: var(--faint); }

/* --- Oyun sonu ------------------------------------------------------------ */

.total {
  font-family: var(--mono);
  font-size: 66px; font-weight: 800; letter-spacing: -2.5px; line-height: 1;
  text-align: center;
}

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  padding: 14px 8px;
  border-radius: var(--r12);
  background: var(--surface1);
  border: 1px solid var(--hairline-soft);
  text-align: center;
}
.stat .v { font-family: var(--mono); font-size: 19px; font-weight: 700; }
.stat .k { font-size: 11px; color: var(--faint); margin-top: 3px; }

.round-list { display: grid; gap: 8px; }
.round-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  border-radius: var(--r12);
  background: #141A25;
  border: 1px solid var(--hairline-soft);
}
.round-row img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.round-row .t { font-family: var(--serif); font-size: 15px; }
.round-row .s { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.round-row .p { margin-left: auto; font-family: var(--mono); font-size: 16px; font-weight: 700; }

/* --- Kazanç ---------------------------------------------------------------- */

.earn { border-color: rgba(233, 169, 74, 0.28); background: rgba(233, 169, 74, 0.06); }
.earn-line { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; }
.earn-line .a { margin-left: auto; font-family: var(--mono); font-weight: 700; color: var(--accent); }
.earn-total {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--hairline);
  font-weight: 700;
}
.earn-total .a { margin-left: auto; font-family: var(--mono); color: var(--accent); font-size: 19px; }

/* --- Günlük ödül ---------------------------------------------------------- */

.cycle { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cycle .day {
  padding: 12px 6px; border-radius: var(--r12);
  border: 1px solid var(--hairline); background: var(--surface1);
  text-align: center;
}
.cycle .day.today { border-color: var(--accent); background: rgba(233, 169, 74, 0.12); }
.cycle .day.done { opacity: 0.45; }
.cycle .day.big { grid-column: span 4; }
.cycle .day .d { font-family: var(--mono); font-size: 9px; color: var(--faint); letter-spacing: 1px; }
.cycle .day .v { font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--accent); }
.cycle .day .h { font-size: 11px; color: var(--mint); }

/* --- Mağaza --------------------------------------------------------------- */

.shop-item { display: flex; align-items: center; gap: 13px; }
.shop-item .glyph {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 13px; background: rgba(233, 169, 74, 0.13); font-size: 21px;
}
.shop-item .t { font-size: 16px; font-weight: 600; }
.shop-item .s { font-size: 13px; color: var(--muted); }

/* --- Koleksiyon ----------------------------------------------------------- */

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.archive-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r12);
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--hairline-soft);
}
.archive-cell img { width: 100%; height: 100%; object-fit: cover; }
.archive-cell.locked { display: grid; place-items: center; color: var(--faint); font-size: 20px; }
.archive-cell .badge {
  position: absolute; right: 5px; top: 5px;
  font-family: var(--mono); font-size: 9px; font-weight: 800;
  background: var(--accent); color: var(--on-accent);
  padding: 2px 5px; border-radius: 4px;
}

/* --- Lobi (canlı 1v1) ------------------------------------------------------ */

/* Kesik kenarlık: kart "gönderilecek bir şey" gibi dursun — uygulamadaki
   davet kartıyla aynı dil. */
.lobby-card {
  padding: 20px;
  border-radius: var(--r20);
  background: linear-gradient(180deg, rgba(79,191,168,0.10), rgba(79,191,168,0.02));
  border: 1px dashed rgba(79, 191, 168, 0.42);
  text-align: center;
}

.lobby-code {
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 9px;
  color: var(--accent);
  padding: 12px 0 4px;
  /* Kod elle de okunabilmeli: bağlantı sohbet uygulamasında kırpılabiliyor. */
  user-select: all;
}

.link-box {
  font-size: 12px;
  color: var(--muted);
  background: #141A25;
  border: 1px solid var(--hairline);
  border-radius: var(--r12);
  padding: 10px;
  word-break: break-all;
  user-select: all;
}

.waiting-row {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 14px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.waiting-row .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mint);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.25; } 50% { opacity: 1; } }

.text-field {
  width: 100%;
  height: 52px;
  margin-top: 12px;
  padding: 0 14px;
  border-radius: var(--r12);
  border: 1px solid var(--hairline);
  background: #141A25;
  color: var(--parchment);
  font-family: var(--sans);
  font-size: 17px;
}
.text-field:focus { outline: none; border-color: var(--accent); }
.text-field.code {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 6px;
  text-align: center;
  text-transform: uppercase;
}

/* --- Düello göstergeleri --------------------------------------------------- */

.duel-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: var(--gap);
  border-radius: var(--r16);
  background: var(--surface1);
  border: 1px solid var(--hairline);
}
.duel-bar .side { flex: 1; min-width: 0; position: relative; }
.duel-bar .who-row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; margin-bottom: 5px;
}
.duel-bar .nick {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted);
}
.duel-bar .who-row .mono { margin-left: auto; font-weight: 700; }
.duel-bar .bar { height: 7px; border-radius: 4px; background: rgba(245,238,224,0.08); overflow: hidden; }
.duel-bar .bar i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-hi));
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.duel-bar .bar i.mint { background: linear-gradient(90deg, rgba(79,191,168,0.55), var(--mint)); }
.duel-bar .vs { font-family: var(--serif); font-size: 13px; color: var(--faint); flex: none; }
.duel-bar .tag {
  position: absolute; right: 0; top: -2px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
}
.duel-bar .tag.mint { color: var(--mint); }

/* Sayaç. Son 10 saniyede mercana dönüyor — uygulamadaki `Countdown.isUrgent`. */
.timer {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--parchment);
  font-variant-numeric: tabular-nums;
}
.timer.urgent { color: var(--coral); animation: beat 1s ease-in-out infinite; }
@keyframes beat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.09); } }

/* --- Büyüteç -------------------------------------------------------------- */

.lightbox {
  position: fixed; inset: 0;
  z-index: 50;
  display: none;
  background: rgba(4, 6, 9, 0.94);
}
.lightbox.open { display: block; animation: fade 0.2s ease-out; }
.lightbox-scroll {
  width: 100%; height: 100%;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 20px;
}
/* Gerçek boyut: sığdırmıyoruz, oyuncu kaydırarak ayrıntıya bakabilsin. */
.lightbox-scroll img { max-width: none; width: auto; height: auto; border-radius: 6px; }
.lightbox-close { position: fixed; right: 18px; top: 18px; z-index: 51; }

/* --- Kaplama (modal) ------------------------------------------------------ */

.sheet-backdrop {
  position: fixed; inset: 0;
  z-index: 40;
  display: none;
  background: rgba(5, 7, 11, 0.72);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 24px 16px;
}
.sheet-backdrop.open { display: block; animation: fade 0.2s ease-out; }
.sheet {
  width: 100%; max-width: 520px; margin: 0 auto;
  background: var(--ink800);
  border: 1px solid var(--hairline);
  border-radius: 28px;
  padding: 22px;
}
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }

/* --- Diğer ---------------------------------------------------------------- */

.lives { display: flex; gap: 5px; }
.lives i { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.lives i.gone { background: rgba(245, 238, 224, 0.14); }

.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(12px);
  z-index: 60;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--hairline);
  font-size: 15px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

.share-grid {
  font-family: var(--mono); font-size: 15px; line-height: 1.45;
  white-space: pre-wrap;
  background: #141A25;
  border: 1px solid var(--hairline);
  border-radius: var(--r12);
  padding: 14px;
}

.footer-links { margin-top: 30px; text-align: center; font-size: 13px; color: var(--faint); }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
