/* ==========================================================================
   GeoStrand: Enlemden Kaçış — Arayüz Stilleri
   Konsept: "Saha keşif çantası". Koyu harita mürekkebi paneller, açık renkli
   saha defteri (Pad), topoğrafik eş yükselti çizgileri ve kurtarma işaret
   fişeği turuncusu (yalnızca ana eylemlerde).
   Tema değiştirmek için yalnızca :root değişkenlerini düzenleyin.
   ========================================================================== */
:root {
  /* Güvenli alanlar (çentik, Android gezinme çubuğu). iOS ve yeni tarayıcılar env() verir;
     Android uygulamasında Capacitor aynı değerleri --safe-area-inset-* değişkenleriyle verir. */
  --sat: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --sab: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  --sal: max(env(safe-area-inset-left, 0px), var(--safe-area-inset-left, 0px));
  --sar: max(env(safe-area-inset-right, 0px), var(--safe-area-inset-right, 0px));

  /* Renkler */
  --ink: #0f2a2e;            /* panel tabanı: harita mürekkebi */
  --ink-2: #173b40;
  --ink-line: rgba(127, 181, 154, 0.28);
  --paper: #dce6dd;          /* Pad: saha defteri kâğıdı */
  --paper-2: #c9d8cc;
  --paper-ink: #12302f;
  --contour: #7fb59a;        /* eş yükselti çizgileri */
  --flare: #ff8a3d;          /* kurtarma işaret fişeği: ana eylemler */
  --flare-deep: #c85f1c;
  --sea: #4fb0d6;
  --text: #eaf2ec;
  --muted: #9db8ae;
  --hp: #ef5b5b;
  --water: #4fb0d6;
  --temp: #f5a742;
  --ok: #3fae6a;
  --bad: #d9473f;

  /* Yazı */
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;

  /* Biçim */
  --r-panel: 16px;
  --r-ctl: 10px;
  --gap: 14px;
  --edge: 14px;
  /* Kenar boşlukları: çentikli telefonlarda güvenli alan kadar içeride */
  --et: max(var(--edge), var(--sat));
  --eb: max(var(--edge), var(--sab));
  --el: max(var(--edge), var(--sal));
  --er: max(var(--edge), var(--sar));

  /* Topoğrafik desen (başlık ekranı, Pad başlığı, menü) */
  --contours:
    repeating-radial-gradient(circle at 18% 30%, transparent 0 26px, rgba(127, 181, 154, 0.13) 26px 27.5px),
    repeating-radial-gradient(circle at 84% 76%, transparent 0 34px, rgba(127, 181, 154, 0.09) 34px 35.5px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior: none;            /* telefonda "çekip yenile" ve lastik efekti olmasın */
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  background: #08181b;
  color: var(--text);
  font: 16px/1.5 var(--body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--flare); outline-offset: 2px; }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-bottom-width: 2px;
  border-radius: 5px;
  font: 700 0.72em/1.5 var(--body);
  text-align: center;
  opacity: 0.85;
}

#game-container {
  position: fixed; inset: 0;
  touch-action: none;                   /* kaydırma oyunu yürütür, sayfayı değil */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button, label, .slot-btn, .act { touch-action: manipulation; } /* çift dokunuşla yakınlaştırma yok */
#hud, .hotbar, .actions { -webkit-user-select: none; user-select: none; }

/* Cihaza göre metin: klavye ya da dokunmatik (body.touch → Device.js) */
.touch-only { display: none; }
body.touch .touch-only { display: inline; }
body.touch .kb-only { display: none; }
body.touch .act kbd, body.touch .slot-btn kbd, body.touch .btn-signal kbd { display: none; }
body.no-fullscreen #act-full, body.no-fullscreen #hub-full, body.no-fullscreen #menu-full { display: none; }
#game-container canvas { display: block; }
/* ==================================================================== HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.panel {
  position: absolute;
  background: rgba(15, 42, 46, 0.86);
  border: 1px solid var(--ink-line);
  border-radius: var(--r-panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  /* backdrop-filter (arka planı bulanıklaştırma) bilerek YOK: oyun her karede yeniden
     çizildiği için tarayıcı her panelin arkasını her karede yeniden bulanıklaştırıyordu;
     panel zaten %86 opak olduğundan fark görünmüyor ama kasma yapıyordu. */
}

/* --- Hayatta kalma göstergeleri --- */
.vitals { top: var(--et); left: var(--el); width: 290px; padding: 12px 14px 12px; }
.region { font: 800 15px/1.2 var(--display); color: var(--contour); margin-bottom: 8px; }
.meter { display: grid; grid-template-columns: 20px 34px 1fr 46px; align-items: center; gap: 8px; margin: 6px 0; }
.meter-icon { font-size: 15px; }
.meter-name { font-size: 14px; font-weight: 700; }
.meter-track { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.meter-fill { height: 100%; width: 100%; border-radius: 5px; transition: width 0.2s linear; }
.meter-fill.hp { background: var(--hp); }
.meter-fill.water { background: var(--water); }
.meter-fill.temp { background: var(--temp); }
.meter-value { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.meter.critical .meter-value { color: #ff9d97; font-weight: 700; }
.meter.critical .meter-track { animation: critical 0.8s ease-in-out infinite alternate; }
@keyframes critical { to { box-shadow: 0 0 0 3px rgba(239, 91, 91, 0.6); } }
/* Ceza: su ve ısı barları akan çizgili */
#hud.penalized .meter-fill.water,
#hud.penalized .meter-fill.temp {
  background-image: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.3) 0 5px, transparent 5px 10px);
  background-size: 14px 14px;
  animation: stripes 0.6s linear infinite;
}
@keyframes stripes { to { background-position: 14px 0; } }
.penalty {
  margin-top: 10px; padding: 6px 10px; border-radius: var(--r-ctl);
  background: rgba(217, 71, 63, 0.2); border: 1px solid rgba(217, 71, 63, 0.6);
  font-size: 13px; color: #ffc2bd; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  white-space: nowrap;
}
.penalty b { font-variant-numeric: tabular-nums; }
.penalty i { font-style: normal; }
.penalty b::after { content: ' sn'; font-weight: 400; }

/* --- Görev göstergesi: "şimdi ne yapmalıyım?" --- */
.objective {
  top: var(--et); left: 50%; transform: translateX(-50%);
  padding: 10px 18px; text-align: center; min-width: 340px; max-width: min(520px, 46vw);
}
.obj-title { font: 800 17px/1.2 var(--display); }
.obj-items { list-style: none; display: flex; justify-content: center; gap: 6px; margin: 8px 0 6px; padding: 0; }
.obj-items li {
  display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 6px; border-radius: 999px;
  font-size: 13px; border: 1px dashed var(--ink-line); color: var(--muted);
}
.obj-items .tick { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; }
.obj-items li.done { border-style: solid; border-color: var(--contour); color: var(--text); background: rgba(127, 181, 154, 0.15); }
.obj-items li.done .tick { background: var(--contour); border-color: var(--contour); position: relative; }
.obj-items li.done .tick::after { content: '✓'; position: absolute; inset: -3px 0 0 2px; font-size: 11px; color: var(--ink); font-weight: 700; }
.obj-hint { font-size: 13px; color: var(--muted); }
.objective.ready { border-color: var(--flare); }
.objective.ready .obj-title { color: var(--flare); }
.objective.ready .obj-items { display: none; }
.objective.solved { border-color: var(--contour); }

/* --- Saat ve pusula --- */
.clock { top: var(--et); right: var(--er); display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; }
.clock-text { text-align: right; }
.clock-time { font: 800 22px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.clock-phase { font-size: 13px; color: var(--muted); }
.compass { width: 44px; height: 44px; }
.c-ring { fill: rgba(255, 255, 255, 0.05); stroke: var(--ink-line); }
.c-north { fill: var(--bad); }
.c-south { fill: var(--muted); opacity: 0.6; }
.c-k { fill: var(--text); font: 800 6px var(--body); text-anchor: middle; }

/* --- Çanta --- */
.hotbar { position: absolute; left: var(--el); bottom: var(--eb); display: flex; gap: 8px; align-items: stretch; pointer-events: auto; }
.slot-btn {
  position: relative; width: 64px; height: 64px; border-radius: 14px; cursor: pointer;
  background: rgba(15, 42, 46, 0.88); border: 1px solid var(--ink-line);
  display: grid; place-items: center;
}
.slot-btn:hover { border-color: var(--contour); }
.slot-btn:active { transform: translateY(1px); }
.slot-btn kbd { position: absolute; top: 4px; left: 5px; font-size: 10px; color: var(--muted); }
.slot-emoji { font-size: 26px; }
.slot-count {
  position: absolute; right: 5px; bottom: 3px; font: 800 15px var(--display);
  font-variant-numeric: tabular-nums;
}
.slot-btn.empty .slot-emoji { opacity: 0.35; filter: grayscale(1); }
.rescued {
  display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 6px; align-content: center;
  padding: 6px 14px; border-radius: 14px; background: rgba(15, 42, 46, 0.88); border: 1px solid var(--ink-line);
}
.rescued span { grid-row: span 2; font-size: 22px; align-self: center; }
.rescued b { font: 800 20px/1 var(--display); color: var(--flare); }
.rescued small { color: var(--muted); font-size: 12px; }

/* --- Eylem çubuğu --- */
.actions { position: absolute; right: var(--er); bottom: var(--eb); display: flex; gap: 6px; pointer-events: auto; }
.act {
  display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--ink-line); background: rgba(15, 42, 46, 0.88);
  font-weight: 700; font-size: 14px;
}
.act span { font-size: 17px; }
.act kbd { font-size: 10px; color: var(--muted); }
.act:hover { border-color: var(--contour); }
.act.primary { background: var(--flare); color: #2a1404; border-color: var(--flare); }
.act.primary kbd { color: #2a1404; }
.act.off { opacity: 0.6; }

/* --- Ekran kenarı uyarıları (değerler HUD.js'ten gelir) --- */
/* --- Hayati durum efektleri (değerler HUD.js → body üzerindeki CSS değişkenleri, 0–1) ---
   --hurt : can 60'ın altında → ekran kararır, renk solar, kenarlar koyu kırmızı
   --dry  : su 35'in altında  → sıcak, kavruk sarı-turuncu kenarlar + sepya
   --cold : ısı 35'in altında → buz mavisi kırağı kenarlar + soğuk ton        */
body { --hurt: 0; --dry: 0; --cold: 0; --beat: 1.2s; }
#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background:
    radial-gradient(ellipse 75% 70% at 50% 50%, transparent calc(62% - 40% * var(--hurt)), rgba(45, 0, 4, calc(0.94 * var(--hurt))) 100%),
    radial-gradient(ellipse 80% 75% at 50% 50%, transparent calc(70% - 26% * var(--dry)), rgba(214, 120, 24, calc(0.62 * var(--dry))) 100%),
    linear-gradient(rgba(20, 0, 0, calc(0.5 * var(--hurt))), rgba(20, 0, 0, calc(0.5 * var(--hurt))));
  transition: opacity 0.4s;
}
/* Kırağı: kenarlardan içe doğru beyaz-mavi buz + soğuk renk örtüsü */
#vignette .fx-frost {
  position: absolute; inset: 0; opacity: var(--cold);
  background:
    radial-gradient(ellipse 80% 75% at 50% 50%, transparent 48%, rgba(205, 232, 255, 0.55) 80%, rgba(240, 250, 255, 0.92) 100%),
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.5) 0 6%, transparent 14%),
    radial-gradient(circle at 92% 88%, rgba(255, 255, 255, 0.5) 0 6%, transparent 14%),
    rgba(70, 140, 230, 0.16);
}
/* Kalp atışı: can azaldıkça hızlanır (--beat) */
#vignette.beat { animation: heartbeat var(--beat) ease-in-out infinite; }
@keyframes heartbeat {
  0%, 100% { opacity: 0.78; }
  14% { opacity: 1; }
  28% { opacity: 0.82; }
  42% { opacity: 1; }
}
/* Etki yokken katman hiç çizilmez (tam ekran saydam bir katmanı her karede birleştirmek de maliyetli) */
body:not(.fx-on) #vignette { display: none; }
/* NOT: Eskiden burada oyun görüntüsüne CSS "filter" (solma/sepya) uygulanıyordu. Tarayıcı bu
   filtreyi her karede tüm oyun ekranına yeniden uyguluyordu; su ya da ısı azalınca (özellikle
   sağanak, tipi, kum fırtınasında) oyun belirgin kasıyordu. Aynı his artık #vignette içindeki
   hafif renk örtüleriyle veriliyor (aşağıda ::after). */
#vignette::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(150, 105, 45, calc(0.16 * var(--dry)));
}

/* --- Ekran dışı ipucu okları --- */
#indicators { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
.indicator {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  display: grid; place-items: center; border-radius: 50%;
  background: #ffd23f; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  font-size: 20px;
}
.indicator i {
  position: absolute; inset: -9px; pointer-events: none;
  transform: rotate(var(--angle, 0rad));
}
.indicator i::after {
  content: ''; position: absolute; right: -2px; top: 50%; margin-top: -7px;
  border-left: 11px solid #ffd23f; border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}

/* --- Bildirimler --- */
/* Alt ortada, çanta ile eylem çubuğunun arasında: Pad ve görev göstergesiyle çakışmaz */
#toasts {
  position: fixed; bottom: calc(var(--eb) + 6px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; gap: 6px; align-items: center;
  z-index: 25; pointer-events: none; width: min(520px, 90vw); /* açık pencerelerin (30+) arkasında kalır */
}
.toast {
  text-align: center; padding: 8px 16px; border-radius: 999px; font-size: 15px; font-weight: 700;
  background: var(--ink); border: 1px solid var(--ink-line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); transition: opacity 0.5s, transform 0.5s;
}
.toast-success { border-color: var(--contour); }
.toast-danger { border-color: var(--bad); background: #3b1715; }
.toast.fade { opacity: 0; transform: translateY(6px); }

/* ================================================================ OVERLAY */
.overlay {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(4, 14, 16, 0.6);
  display: grid; place-items: center; padding: 16px;
}

/* Saha gözlemi ve haftalık keşif */
.expedition-dialog {
  width: min(490px, calc(100% - 28px));
  max-height: calc(100dvh - max(12px, var(--sat)) - max(12px, var(--sab)));
  overflow: auto; overscroll-behavior: contain; margin: auto;
  padding: clamp(15px, 4vw, 25px); color: var(--text);
  border: 1px solid #719990; border-radius: 20px;
  background: linear-gradient(145deg, #234340, #102a30 78%);
  box-shadow: 0 22px 70px #020c0cb3;
}
.expedition-dialog::backdrop { background: #051416cb; }
.expedition-dialog h2 { margin: 0; font: 800 clamp(22px, 5.5vw, 32px)/1.12 var(--display); }
.expedition-dialog p { margin: 10px 0; line-height: 1.4; }
.expedition-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.expedition-actions button { min-height: 44px; box-shadow: none; }
.expedition-actions .btn-signal { width: auto; }
.expedition-actions .btn-signal:disabled { opacity: .55; cursor: default; }
.field-compass { display: flex; justify-content: space-between; margin: 14px 12px 0; color: #b7e0d3; font-size: 13px; font-weight: 700; }
.field-ruler { --shadow: 0%; position: relative; padding: 0 12px; height: 61px; }
.field-ruler input {
  position: absolute; inset: 0 0 auto; width: 100%; height: 60px; margin: 0;
  appearance: none; background: transparent; cursor: ew-resize; touch-action: pan-y;
}
.field-ruler input::-webkit-slider-runnable-track { height: 28px; background: transparent; }
.field-ruler input::-moz-range-track { height: 28px; background: transparent; }
.field-ruler input::-webkit-slider-thumb {
  appearance: none; width: 24px; height: 36px; margin-top: -4px; border-radius: 6px;
  border: 3px solid #fff4d4; background: #b85427;
}
.field-ruler input::-moz-range-thumb {
  width: 18px; height: 30px; border-radius: 6px; border: 3px solid #fff4d4; background: #b85427;
}
.field-axis {
  position: absolute; inset: 17px 0 auto; height: 28px; border-radius: 7px; background:
    repeating-linear-gradient(90deg, #755f442f 0 1px, transparent 1px 10%) #e8daba;
}
.field-shadow {
  position: absolute; inset: 24px 12px auto; height: 14px;
  background: linear-gradient(to right, #3b4040 var(--shadow), transparent var(--shadow));
}
.field-ruler[dir="rtl"] .field-shadow { background: linear-gradient(to left, #3b4040 var(--shadow), transparent var(--shadow)); }
.expedition-dialog .field-hint { margin: 0; color: #bdd5ca; font-size: 13px; }
.field-measure { display: block; min-height: 1.45em; color: #ffdd90; font-weight: 700; font-variant-numeric: tabular-nums; }
.field-measure.aligned { color: #c5f1b2; }
.field-leaf-sample, .field-soil {
  display: grid; place-items: center; height: 104px; margin: 10px 0;
  border: 1px solid #b9b98d; border-radius: 13px; background: #e0dfbb;
}
.field-leaf {
  width: 76px; height: 52px;
  background: linear-gradient(33deg, transparent 47%, #d8e7ae 49% 51%, transparent 53%), linear-gradient(140deg,#589945,#244e31);
  border-radius: 2% 68% 7% 66%; transform: rotate(-22deg); box-shadow: 0 7px 12px #263c2c3b;
}
.field-leaf.acacia { clip-path: polygon(0 47%, 20% 45%, 10% 16%, 25% 12%, 35% 39%, 45% 8%, 62% 6%, 55% 39%, 87% 4%, 100% 20%, 72% 52%, 99% 72%, 91% 86%, 60% 67%, 56% 97%, 44% 100%, 41% 67%, 15% 80%, 10% 69%, 26% 60%, 0 58%); }
.field-leaf.palm { width: 100px; height: 76px; clip-path: polygon(0 95%, 35% 56%, 16% 20%, 42% 49%, 42% 6%, 52% 46%, 65% 0, 64% 45%, 93% 9%, 75% 51%, 100% 35%, 79% 61%, 100% 65%, 69% 72%, 89% 93%, 57% 76%, 4% 100%); }
.field-leaf.cactus { width: 55px; height: 78px; border: 2px dashed #91814d; border-radius: 42%; background: repeating-linear-gradient(90deg,#32643c 0 7px,#69934e 7px 9px); }
.field-leaf.olive { width: 86px; height: 23px; border-radius: 90% 2% 90% 7%; }
.field-leaf.conifer { width: 86px; clip-path: polygon(0 86%, 25% 65%, 8% 30%, 36% 53%, 26% 18%, 49% 43%, 48% 9%, 61% 36%, 65% 3%, 74% 29%, 100% 1%, 86% 41%, 100% 50%, 68% 57%, 87% 73%, 54% 70%, 64% 87%, 38% 75%, 0 100%); }
.field-leaf.shrub { height: 30px; width: 92px; transform: none; border-radius: 65% 70% 25% 21%; box-shadow: 13px -8px 0 -5px #587e40,-13px -10px 0 -3px #668849; }
.field-soil {
  height: 86px; border-color: #c6ab83;
  background-image: radial-gradient(circle at 20% 36%, #f0d8b074 0 2px, transparent 3px),
    radial-gradient(circle at 72% 57%, #1d170c62 0 3px, transparent 4px);
  background-size: 18px 19px, 33px 26px;
}
.field-soil.collected { outline: 2px solid #a8d499; outline-offset: 3px; }
.field-sample, .field-choices button { min-height: 44px; }
.field-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.field-choices button { padding: 6px 9px; }
.field-choices button[aria-pressed="true"] { background: #386355; border-color: #a6d0b6; }
.weekly-date { color: #aad4c1; font-weight: 700; font-size: 13px; }
.weekly-stages { display: grid; gap: 7px; padding-left: 23px; }
.weekly-stages li { padding: 8px 10px; background: #102c2e; border: 1px solid #5a8377; border-radius: 9px; }
.weekly-stages span { display: block; color: #c0dbd0; font-size: 13px; }
.quest-line { font-size: 13px; line-height: 1.25; margin-top: 5px; color: #b7e6e6; }
.quest-line b { padding-left: 4px; color: #ffdd90; font-variant-numeric: tabular-nums; white-space: nowrap; }
.indicator.station-indicator, .indicator.station-indicator i { background: #8bd2d5; }
.rescue-status {
  position: fixed; z-index: 26; bottom: calc(var(--sab) + 100px); left: 50%; translate: -50% 0;
  width: max-content; max-width: calc(100% - 28px); margin: 0; padding: 7px 12px;
  color: #fff0c6; background: #122d30ea; border: 1px solid #e4b769;
  text-align: center; font-weight: 700; border-radius: 14px; pointer-events: none;
}

/* Bölge ödülü */
.region-reward {
  width: min(440px, calc(100% - 28px)); max-height: calc(100dvh - max(20px, var(--sat)) - max(20px, var(--sab)));
  box-sizing: border-box; overflow: auto; overscroll-behavior: contain; margin: auto;
  padding: clamp(16px, 4vw, 30px); color: #f5faff; text-align: center;
  border: 1px solid #72a39a; border-radius: 24px;
  background: radial-gradient(ellipse at 50% 0%, #2b5146, #122e32 70%);
  box-shadow: 0 25px 100px #080f10b3; animation: reward-enter .26s ease-out;
}
.region-reward::backdrop { background: #051416c9; }
.region-reward.perfect {
  border-color: #d3a652;
  background: radial-gradient(ellipse at 50% 0%, #5b5230, #1a3436 66%);
  box-shadow: 0 24px 90px #080f10c9, 0 0 46px #e6b45829;
}
#region-reward-rating { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; }
.region-reward-stars {
  display: flex; align-items: center; justify-content: center; gap: 7px; margin-bottom: 9px;
  color: #889392; font: 700 clamp(34px, 11vw, 56px)/1 var(--body);
}
.region-reward-stars .earned { color: #ffda72; text-shadow: 0 0 18px #ffbf5680; animation: reward-star .33s cubic-bezier(.22, .8, .27, 1.24) both; }
.region-reward-stars span:nth-child(2) { font-size: 1.22em; animation-delay: .13s; }
.region-reward-stars span:nth-child(3) { animation-delay: .26s; }
.region-reward h2 { margin: 0; font: 800 clamp(25px, 6vw, 36px)/1.08 var(--display); }
#region-reward-place { margin: 6px 0 0; color: #c9ded4; overflow-wrap: anywhere; }
.region-reward-summary { display: flex; justify-content: center; gap: 9px; margin: 17px 0; }
.region-reward-summary p {
  min-width: 0; flex: 1; margin: 0; padding: 9px; background: #082427a8;
  border: 1px solid #789e935c; border-radius: 12px; line-height: 1.2;
}
.region-reward-summary p[hidden] { display: none; }
.region-reward-summary strong { display: block; font: 800 24px/1.1 var(--display); margin-bottom: 3px; overflow-wrap: anywhere; }
.region-reward-summary span { color: #cce0d6; font-size: 13px; }
.region-reward-summary .region-reward-coins { border-color: #dcaf5e8c; }
.region-reward-coins strong { color: #ffdb79; }
.region-reward-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.region-reward-actions button { min-height: 44px; min-width: 0; padding: 8px; font-size: 14px; box-shadow: none; }
.region-reward-actions .btn-ghost { border-color: #6c9188; }
@keyframes reward-enter { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes reward-star { from { opacity: .35; transform: scale(.62); } }
@media (max-height: 410px) {
  .region-reward-stars { font-size: 36px; margin-bottom: 6px; }
  .region-reward-summary { margin: 10px 0; }
}

/* ======================================================= COĞRAFYACI PAD'İ */
.pad {
  width: min(940px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--paper-ink);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 8px rgba(15, 42, 46, 0.9);
  animation: rise 0.18s ease-out;
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.pad-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: var(--contours), var(--ink); color: var(--text);
}
.pad-logo { font-size: 22px; }
.pad-header h2 { margin: 0; font: 800 19px/1.2 var(--display); }
.pad-location { margin-left: auto; font-weight: 700; color: var(--contour); }
.pad-close {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--ink-line); background: rgba(255, 255, 255, 0.06); font-size: 15px;
}
.pad-close:hover { background: rgba(255, 255, 255, 0.15); }
.pad-body { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 18px 20px 20px; overflow-y: auto; }
.pad-col h3 { margin: 0 0 10px; font: 800 16px/1.2 var(--display); display: flex; align-items: center; gap: 8px; }
.pad-col h3 .count { font: 700 13px var(--body); padding: 1px 9px; border-radius: 999px; background: var(--paper-ink); color: var(--paper); }

/* Gözlem kartları */
.slots { display: grid; gap: 8px; margin-bottom: 12px; }
.slot {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 12px;
  background: #eef3ee; border: 1.5px solid #b7c9bc;
}
.slot-icon { font-size: 26px; text-align: center; }
.slot-title { font-weight: 700; }
.slot.empty { background: transparent; border-style: dashed; color: #557067; }
.slot.empty .slot-icon { filter: grayscale(1); opacity: 0.5; }
.slot-missing { font-size: 14px; }
.slot.fresh { border-color: var(--flare); box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.25); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 2px; }
.tag { font-size: 13px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--paper-ink); color: var(--paper); }
.slot-text { margin: 0; font-size: 14px; color: #36544e; }
.slot-diagram:empty { display: none; }
.slot-diagram svg { display: block; }
.d-ring { fill: #e8d6a5; stroke: #b7a274; }
.d-n { fill: var(--bad); font: 700 10px var(--body); text-anchor: middle; }
.d-s { fill: #5b4f35; font: 700 10px var(--body); text-anchor: middle; }
.d-shadow { stroke: #3a2f1c; stroke-width: 6; stroke-linecap: round; }
.d-head { fill: #3a2f1c; }
.d-stick { fill: var(--flare); stroke: #fff; stroke-width: 1.5; }

.pad-hint { font-size: 14px; border-radius: 12px; padding: 8px 12px; background: #e9efe9; border: 1px solid #b7c9bc; }
.pad-hint summary { cursor: pointer; font-weight: 700; }
.hint-rules { margin: 8px 0; }
.ruler { display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.ruler-row { display: grid; grid-template-columns: 72px repeat(8, 1fr); text-align: center; font-size: 13px; }
.ruler-row span { padding: 3px 0; background: #dbe5dc; }
.ruler-row span:first-child { text-align: left; background: none; font-weight: 700; color: #557067; }
.ruler-row.lat span:not(:first-child) { background: var(--paper-ink); color: var(--paper); font-weight: 700; }

/* Form */
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { display: flex; align-items: center; gap: 8px; width: 100%; font-weight: 700; margin-bottom: 6px; padding: 0; }
.step {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper-ink); color: var(--paper); font-size: 12px;
}
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label, .climate-option { position: relative; cursor: pointer; }
.seg input, .climate-option input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .climate-option span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px; border-radius: var(--r-ctl); font-weight: 700;
  background: #eef3ee; border: 1.5px solid #b7c9bc;
  transition: border-color 0.12s, background 0.12s;
}
.seg span:hover, .climate-option span:hover { border-color: var(--paper-ink); }
.climate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.climate-option span { flex-direction: column; gap: 0; font-size: 14px; padding: 7px 4px; }
.climate-option i { font-style: normal; font-size: 22px; }
.seg input:checked + span, .climate-option input:checked + span {
  background: var(--paper-ink); color: var(--paper); border-color: var(--paper-ink);
}
.seg input:focus-visible + span, .climate-option input:focus-visible + span { outline: 3px solid var(--flare); outline-offset: 2px; }
input:disabled + span { opacity: 0.5; cursor: not-allowed; }
.lat-row { display: flex; align-items: center; gap: 10px; }
.lat-row input { flex: 1; accent-color: var(--flare-deep); height: 24px; }
.lat-end { font-size: 12px; color: #557067; white-space: nowrap; }
#pad-lat-out { margin-left: auto; font: 800 24px/1 var(--display); color: var(--flare-deep); }

/* Sonuç */
.pad-result { margin-top: 14px; padding: 12px 14px; border-radius: 12px; animation: rise 0.2s ease-out; }
.res-head { font: 800 17px/1.2 var(--display); display: flex; align-items: center; gap: 8px; }
.res-head small { margin-left: auto; font: 700 14px var(--body); opacity: 0.7; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.badge { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.badge.ok { background: #cfe9d6; color: #1d5b33; }
.badge.bad { background: #f6d0cc; color: #8a221b; }
.res-hint { margin: 4px 0 0; }
.res-sub { margin: 6px 0 0; font-size: 13px; color: #8a221b; }
.pad-result .reveal { margin: 6px 0 0; font-size: 16px; font-weight: 700; }
.pad-result .summary { margin: 0; font-size: 14px; color: #36544e; }
.pad-result .btn-signal { margin-top: 12px; }
.pad-result.success { background: #e3f2e6; border: 1.5px solid var(--ok); }
.pad-result.fail { background: #fbe6e3; border: 1.5px solid var(--bad); }
.pad-result.warn { background: #fdf0de; border: 1.5px solid #d9902c; }

/* ================================================================ DÜĞMELER */
.btn-signal {
  width: 100%; padding: 13px 18px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--flare); color: #2a1404; font: 800 17px/1.2 var(--display);
  box-shadow: 0 4px 0 var(--flare-deep); transition: transform 0.06s, box-shadow 0.06s, filter 0.1s;
}
.btn-signal:hover { filter: brightness(1.06); }
.btn-signal:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--flare-deep); }
.btn-signal:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-signal kbd { margin-left: 6px; }
.btn-ghost {
  padding: 11px 16px; border-radius: 12px; cursor: pointer; font-weight: 700;
  background: transparent; border: 1.5px solid var(--ink-line); color: var(--text);
}
.btn-ghost:hover { border-color: var(--contour); background: rgba(127, 181, 154, 0.08); }
.btn-ghost.danger.confirm { border-color: var(--bad); color: #ffb3ad; }

/* ================================================================ MENÜ */
.menu {
  width: min(460px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 24px; border-radius: 20px;
  background: var(--contours), var(--ink); border: 1px solid var(--ink-line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); animation: rise 0.18s ease-out;
}
.menu h2 { margin: 0 0 16px; font: 800 26px/1.1 var(--display); }
.menu-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ink-line); }
.menu-section h3, .menu-section summary { margin: 0 0 8px; font: 800 16px var(--display); cursor: default; }
.menu-section summary { cursor: pointer; }
.slider { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 10px; margin: 8px 0; font-size: 15px; }
.slider input { accent-color: var(--flare); }
.slider output { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 8px 0; font-size: 15px; }
.keys dt { text-align: right; }
.keys dd { margin: 0; color: var(--muted); }
.help p { font-size: 14px; color: var(--muted); }
.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }

/* ================================================================ UÇUŞ */
#travel {
  position: fixed; inset: 0; z-index: 45; display: grid; place-content: center; justify-items: center;
  background: var(--contours), rgba(8, 24, 27, 0.94); animation: fadein 0.3s ease-out;
}
#travel p { font: 800 20px var(--display); margin: 18px 0 0; }
.travel-route { position: relative; width: min(420px, 70vw); height: 40px; border-bottom: 2px dashed var(--contour); }
.travel-plane { position: absolute; left: 0; bottom: -14px; font-size: 32px; animation: fly 1.3s ease-in-out forwards; }
@keyframes fly { to { left: calc(100% - 36px); } }
@keyframes fadein { from { opacity: 0; } }

/* =========================================================== BAŞLANGIÇ */
.screen { position: fixed; inset: 0; z-index: 50; }
.intro {
  overflow: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
  padding: max(8px, var(--sat)) max(16px, var(--sar))
           max(18px, var(--sab)) max(16px, var(--sal));
  background: var(--contours), radial-gradient(ellipse at 17% 43%, #193c40, #0c2227 57%, #071518 100%);
}
.intro::-webkit-scrollbar { display: none; }
.intro-shell {
  width: min(1160px, 100%);
  min-height: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}
.intro-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 8px 12px;
  border-bottom: 1px solid #6087815c;
}
.intro-logo { flex: none; border-radius: 11px; }
.intro-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-left: auto; }
.intro-nav button {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 48px; padding: 5px 13px; background: #193538; font-size: 15px;
}
.intro-nav button:hover { background: #23494b; }
.intro-nav .intro-profile { border-color: #719e89; background: #244440; padding-inline: 7px 13px; }
.intro-profile canvas {
  flex: none; width: 27px; height: 34px; border-radius: 9px;
  background: #d4e5d2; image-rendering: pixelated;
}
.intro-layout {
  flex: 1;
  padding-block: clamp(18px, 3vh, 42px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  align-content: center;
  gap: clamp(16px, 3vh, 32px) clamp(26px, 5vw, 65px);
}
.intro-brand, .intro-modes { min-width: 0; }
.intro .wordmark {
  margin: 0 0 16px;
  color: var(--text);
  font: 800 clamp(37px, 6.8vw, 90px)/.97 var(--display);
  letter-spacing: -.049em;
}
.intro .subtitle { margin: 0 0 5px; color: #9ecab4; font: 700 clamp(17px, 2.8vw, 25px)/1.2 var(--display); }
.intro .lead { max-width: 38ch; margin: 0; color: #c9dcd3; font-size: clamp(15px, 1.65vw, 18px); line-height: 1.5; }
.intro .globe { display: block; width: min(90%, 392px, 38vh); margin: 7px auto 0; overflow: visible; }
.intro-modes {
  display: grid;
  gap: 10px;
  padding: clamp(12px, 2.2vw, 24px);
  border: 1px solid #4b6c69;
  border-radius: 22px;
  background: linear-gradient(145deg, #19373a, #10272b 88%);
  box-shadow: 0 14px 50px #04131691;
}
.intro-modes button { min-height: 52px; min-width: 0; line-height: 1.2; }
.intro-modes .intro-start {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 68px; padding: 10px 16px; text-align: left; box-shadow: none;
  color: #241408;
}
.intro-modes h2 { margin: 0 0 2px; color: #deeee6; font: 800 18px/1.2 var(--display); }
.intro-start b { display: block; font: 800 clamp(19px, 2vw, 24px)/1.12 var(--display); }
.intro-start small { display: block; margin-top: 4px; font: 700 13px/1.25 var(--body); color: #51290f; }
.intro-arrow { color: inherit; font-size: 25px; font-weight: 700; }
.intro-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.intro-secondary button {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  padding: 8px 11px; font-size: 15px; line-height: 1.2; text-align: left;
  border-radius: 11px; background: #1c3d41; border-color: #577776;
}
.intro-secondary b, .intro-secondary small { display: block; }
.intro-secondary small { margin-top: 3px; color: #cce1db; font-size: 12px; font-weight: 400; }
.intro-secondary button:hover { background: #275154; }
.intro-secondary #btn-race { background: #1d6671; border-color: #65aeb5; }
.intro-secondary #btn-race:hover { background: #277885; }
.intro-modes .btn-daily { max-width: none; width: 100%; min-height: 56px; padding: 8px 10px; }
.intro-modes .bd-text b { font-size: 15px; }
.intro-modes .bd-text small { color: #c9dcd3; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.intro-modes .bd-icon { font-size: 20px; }
.intro-modes .bd-streak { padding: 4px 6px; font-size: 13px; }
.intro-modes .net-msg { margin: 0; }
.intro-modes .intro-weekly {
  display: flex; align-items: center; gap: 10px; padding: 7px 11px; text-align: left;
  background: #253e37; border-color: #7d9970; border-radius: 11px; font-size: 15px;
}
.intro-weekly:hover { background: #365747; }
.intro-weekly b, .intro-weekly small { display: block; }
.intro-weekly small { margin-top: 3px; color: #d4e1c6; font-size: 12px; font-weight: 400; }
.intro-steps {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin: 0; padding: 0; list-style: none;
}
.intro-steps li {
  display: flex; align-items: center; gap: 11px; min-width: 0; padding: 12px 14px;
  border: 1px solid #43625f; border-radius: 13px; background: #112b2eea;
}
.intro-steps li > span { font-size: 20px; line-height: 1; }
.intro-steps b, .intro-steps small { display: block; }
.intro-steps b { font: 800 15px/1.25 var(--display); }
.intro-steps small { margin-top: 3px; color: #bcd5ca; font-size: 13px; line-height: 1.32; }
.fine { font-size: 14px; color: var(--muted); margin-top: 14px; }

@media (max-width: 700px) {
  .intro-shell { width: min(480px, 100%); }
  .intro-layout { flex: none; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-block: 28px 15px; }
  .intro .wordmark { font-size: clamp(38px, 12vw, 64px); margin-bottom: 10px; }
  .intro .globe { display: none; }
  .intro-modes { border-radius: 17px; }
  .intro-steps { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .intro-steps li { padding: 8px 12px; }
}
@media (max-width: 440px) {
  .intro-bar { gap: 0; }
  .intro-logo { display: none; }
  .intro-nav { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .intro-nav button { padding-inline: 4px; gap: 4px; font-size: 14px; }
  .intro-nav .intro-profile { padding-inline: 4px; }
  .intro-profile canvas { width: 22px; height: 28px; }
  .intro-secondary button { padding-inline: 6px; gap: 5px; font-size: 14px; }
  .intro-secondary small { font-size: 11px; }
}
@media (orientation: landscape) and (max-height: 520px) and (min-width: 600px) {
  .intro-shell { width: min(1080px, 100%); }
  .intro-layout { grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); align-items: center; gap: 20px; padding-block: 15px; }
  .intro .wordmark { font-size: clamp(34px, 6vw, 68px); }
  .intro .globe { display: none; }
  .intro-modes { padding: 12px; gap: 7px; }
  .intro-modes .intro-start { min-height: 60px; }
  .intro-modes .btn-daily, .intro-secondary button { min-height: 44px; }
  .intro-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .intro-steps li { padding: 7px 9px; gap: 7px; }
  .intro-steps small { font-size: 12px; }
}

/* Dünya illüstrasyonu */
.g-sea { fill: #10373c; }
.g-rim { fill: none; stroke: var(--contour); stroke-width: 2; }
.g-meridians ellipse, .g-meridians line { fill: none; stroke: rgba(127, 181, 154, 0.25); stroke-width: 1; }
.g-lats line { stroke: rgba(127, 181, 154, 0.35); stroke-width: 1; stroke-dasharray: 3 5; }
.g-lat-labels text { fill: var(--muted); font: 700 12px var(--body); }
.g-equator { stroke: var(--flare); stroke-width: 1.5; }
.g-label { fill: var(--flare); font: 700 12px var(--body); text-anchor: end; }
.g-land { fill: rgba(127, 181, 154, 0.35); }
.g-meridians { animation: drift 16s linear infinite alternate; transform-origin: 200px 200px; }
@keyframes drift { to { transform: translateX(30px); } }
.g-signal .dot { fill: var(--flare); }
.g-signal .q { fill: #2a1404; font: 800 10px var(--display); text-anchor: middle; }
.g-signal .pulse { fill: none; stroke: var(--flare); stroke-width: 2; animation: ping 2.2s ease-out infinite; transform-origin: 0 0; }
.g-signal .pulse.delay { animation-delay: 1.1s; }
@keyframes ping { from { transform: scale(1); opacity: 1; } to { transform: scale(4); opacity: 0; } }

/* =========================================================== OYUN SONU */
.gameover { display: grid; place-items: center; background: rgba(20, 6, 6, 0.82); padding: 16px; }
.gameover-card { width: min(440px, 100%); text-align: center; }
.gameover-card h1 { font: 800 44px/1.05 var(--display); margin: 0 0 12px; }
#gameover-stats { font-size: 18px; }

/* =========================================================== DAR EKRAN */
@media (max-width: 900px) {
  .objective { min-width: 0; padding: 8px 14px; }
  .objective .obj-items, .objective .obj-hint { display: none; }
  .obj-title { font-size: 15px; }
  #toasts { bottom: 96px; }
  .pad-body { grid-template-columns: 1fr; }
  .act kbd, .slot-btn kbd { display: none; }
  .vitals { width: 262px; }
}

/* =========================================================== AZ HAREKET */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ==========================================================================
   v4 EKLEMELERİ: kâşif, hava, açılım afişi, karakter oluşturucu, rehber
   ========================================================================== */

/* --- Kâşif başlığı (HUD sol üst) --- */
.hero-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
#hud-portrait {
  width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #2b5a5c, #12312f);
  border: 2px solid var(--contour);
}
.hero-name { font: 800 16px/1.1 var(--display); }
.hero-head .region { margin: 2px 0 0; font: 700 12px/1.2 var(--body); color: var(--contour); }

/* --- Hava kartı (sağ üst, saatin altı) --- */
.weather-chip {
  top: calc(var(--et) + 76px); right: var(--er);
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  padding: 7px 12px; font-size: 13px; border-color: rgba(255, 138, 61, 0.55);
}
.weather-chip b { font-weight: 700; }
.weather-chip span { color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- Puan kutusu --- */
.rescued.score b { color: #ffd23f; }

/* --- Yeni kademe afişi --- */
#unlock {
  position: fixed; top: 22%; left: 50%; transform: translateX(-50%);
  z-index: 42; display: flex; align-items: center; gap: 14px;
  max-width: min(520px, 90vw); padding: 16px 22px; border-radius: 18px;
  background: var(--contours), var(--ink); border: 2px solid var(--flare);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); pointer-events: none;
  animation: unlockIn 0.45s cubic-bezier(.2, 1.4, .4, 1);
}
#unlock.leave { opacity: 0; transform: translate(-50%, -10px); transition: opacity 0.5s, transform 0.5s; }
#unlock .unlock-icon { font-size: 40px; }
#unlock b { font: 800 20px/1.15 var(--display); color: var(--flare); }
#unlock p { margin: 4px 0 0; color: var(--text); }
@keyframes unlockIn { from { opacity: 0; transform: translate(-50%, 16px) scale(0.92); } }

/* --- Pad eklemeleri --- */
.pad-guide {
  height: 36px; padding: 0 12px; border-radius: 10px; cursor: pointer; font-weight: 700;
  border: 1px solid var(--ink-line); background: rgba(255, 255, 255, 0.06);
}
.pad-guide:hover { background: rgba(255, 255, 255, 0.15); }
.climate-grid.three { grid-template-columns: repeat(3, 1fr); }
fieldset[data-field] { animation: rise 0.25s ease-out; }
.stars { margin-left: auto; color: #e0a400; font-size: 20px; letter-spacing: 1px; }
.pad-result .points { margin: 6px 0 0; font-weight: 700; color: #1d5b33; }

/* --- Başlık ekranı eylemleri --- */
.btn-ghost.icon { width: 48px; padding-inline: 0; font-size: 18px; }
.new-best { color: #ffd23f; font-weight: 700; }

/* ==================================================== KARAKTER OLUŞTURUCU */
.creator {
  width: min(860px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
  display: grid; grid-template-columns: 260px 1fr; gap: 26px; padding: 24px;
  border-radius: 22px; background: var(--contours), var(--ink); border: 1px solid var(--ink-line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); animation: rise 0.2s ease-out;
}
.creator-stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border-radius: 18px; padding: 16px;
  /* Ayak altında çimenli bir zemin elipsi */
  background: radial-gradient(ellipse 42% 9% at 50% 72%, #7d8c47 0 70%, transparent 72%), #17383b;
}
#creator-preview { width: 216px; height: 264px; }
.stage-controls { display: flex; gap: 10px; }
.round {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 18px;
  border: 1.5px solid var(--ink-line); background: rgba(255, 255, 255, 0.06);
}
.round:hover { border-color: var(--contour); }
.creator-form h2 { margin: 0 0 14px; font: 800 28px/1.1 var(--display); }
.name-field { display: grid; gap: 4px; margin-bottom: 12px; font-weight: 700; }
.name-field input {
  font: 700 18px var(--body); color: var(--text); padding: 9px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.07); border: 1.5px solid var(--ink-line);
}
.name-field input:focus { border-color: var(--flare); outline: none; }
.opt-row { border: 0; padding: 0; margin: 0 0 10px; }
.opt-row legend { font-weight: 700; font-size: 14px; color: var(--muted); margin-bottom: 5px; }
.opt-list { display: flex; flex-wrap: wrap; gap: 7px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.swatch {
  display: block; width: 32px; height: 32px; border-radius: 50%;
  background: var(--c); border: 3px solid transparent; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.25);
}
.opt input:checked + .swatch { border-color: var(--ink); box-shadow: 0 0 0 3px var(--flare); }
.chip {
  display: block; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px;
  border: 1.5px solid var(--ink-line); background: rgba(255, 255, 255, 0.05);
}
.opt input:checked + .chip { background: var(--flare); color: #2a1404; border-color: var(--flare); }
.opt input:focus-visible + .swatch, .opt input:focus-visible + .chip { outline: 3px solid var(--sea); outline-offset: 2px; }
.creator-actions { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; margin-top: 16px; }

/* ================================================================ REHBER */
.guide {
  width: min(980px, 100%); height: min(760px, calc(100vh - 32px)); height: min(760px, calc(100dvh - 32px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); color: var(--paper-ink); border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 8px rgba(15, 42, 46, 0.9);
  animation: rise 0.18s ease-out;
}
#guide { z-index: 60; }   /* başlık ekranının (50) da üstünde */
#creator { z-index: 62; }
.guide-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: var(--contours), var(--ink); color: var(--text); }
.guide-header h2 { margin: 0; font: 800 20px var(--display); }
.guide-tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1.5px solid #b7c9bc; overflow-x: auto; }
.tab {
  padding: 9px 14px; border: 0; border-radius: 10px 10px 0 0; cursor: pointer; white-space: nowrap;
  background: transparent; font-weight: 700; color: #557067;
}
.tab[aria-selected="true"] { background: var(--paper-ink); color: var(--paper); }
.guide-body { padding: 18px 22px 26px; overflow-y: auto; line-height: 1.55; }
.guide-body h3 { font: 800 18px var(--display); margin: 22px 0 6px; }
.guide-body p { margin: 0 0 8px; max-width: 72ch; }
.lead-sm { font-size: 16px; color: #36544e; }
.guide-steps { padding-left: 22px; margin: 0; display: grid; gap: 6px; }
.table-wrap { overflow-x: auto; }
.guide-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.guide-table th, .guide-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid #b7c9bc; vertical-align: top; }
.guide-table thead th { color: #557067; font-size: 13px; }
.guide-body .keys dd { color: #36544e; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.info-card { background: #eef3ee; border: 1.5px solid #b7c9bc; border-radius: 14px; padding: 14px 16px; }
.info-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font: 800 18px var(--display); }
.info-card .ic { font-size: 24px; }
.info-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 8px 0 0; font-size: 14px; }
.info-card dt { font-weight: 700; white-space: nowrap; }
.info-card dd { margin: 0; color: #36544e; }
.info-card ul { margin: 6px 0; padding-left: 18px; font-size: 14px; }
.info-card .ex { font-size: 14px; color: #557067; margin: 4px 0 0; }
.compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.compare div { display: grid; text-align: center; padding: 10px; border-radius: 12px; background: var(--paper-ink); color: var(--paper); }
.compare b { font: 800 18px var(--display); }
.compare span { font-size: 14px; opacity: 0.85; }

@media (max-width: 900px) {
  .creator { grid-template-columns: 1fr; }
  .creator-stage { padding: 8px; }
  #creator-preview { width: 144px; height: 176px; }
  .weather-chip { top: calc(var(--et) + 70px); }
}

/* ==========================================================================
   v6 TELEFON & TABLET: dokunmatik kontroller, hayati uyarılar, Pad alt şeridi,
   küçük ekran düzenleri
   ========================================================================== */

/* --- Sanal joystick (TouchControls.js konumlandırır) --- */
#joystick {
  position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 9;
  pointer-events: none; opacity: 0; transition: opacity 0.12s;
}
#joystick.on { opacity: 1; }
#joystick::before {
  content: ''; position: absolute; left: -56px; top: -56px; width: 112px; height: 112px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.55); background: rgba(15, 42, 46, 0.35);
}
#joystick .knob {
  position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 138, 61, 0.92); border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* --- Büyük "İncele" düğmesi (yalnız dokunmatikte, yakında nesne varken) --- */
.act-interact {
  display: none; position: absolute; right: var(--er); bottom: calc(var(--eb) + 58px);
  width: 86px; height: 86px; border-radius: 50%; pointer-events: auto; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background: var(--flare); color: #2a1404; border: 3px solid #ffd7b5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(255, 138, 61, 0.25);
  font: 800 12px/1.1 var(--display);
}
.act-interact:active { transform: scale(0.94); }
body.touch .act-interact.show { display: flex; animation: pop 0.2s ease-out; }
.ai-icon { font-size: 28px; line-height: 1; }
.ai-label { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

/* --- Hayati uyarı (ortada): ne kötü gidiyor + ne yapmalı --- */
#hud { --alert-top: calc(var(--et) + 112px); }
.vital-alert {
  position: absolute; left: 50%; top: var(--alert-top); transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 28px)); padding: 9px 18px; border-radius: 999px;
  pointer-events: auto; cursor: default; text-align: center;
  font: 700 15px/1.3 var(--body); color: var(--text);
  background: rgba(15, 42, 46, 0.94); border: 2px solid var(--muted);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  animation: alertPulse 0.9s ease-in-out infinite alternate;
}
.vital-alert.usable { cursor: pointer; }
.vital-alert.hurt { background: #3b1012; border-color: var(--hp); }
.vital-alert.dry { background: #3d2707; border-color: #f0a43a; }
.vital-alert.cold { background: #0f2d48; border-color: #8fd0ff; }
@keyframes alertPulse { to { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45), 0 0 0 5px rgba(255, 255, 255, 0.12); } }

/* Önerilen eşya parlar */
.slot-btn.suggest { border: 2px solid #ffd23f; animation: suggest 0.8s ease-in-out infinite alternate; }
@keyframes suggest { to { box-shadow: 0 0 0 5px rgba(255, 210, 63, 0.4), 0 0 22px rgba(255, 210, 63, 0.55); } }

/* --- Pad: kaydırılan gövde + her zaman görünen alt şerit --- */
.pad-body { flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.pad-footer {
  display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  background: var(--paper-2); border-top: 1.5px solid #b7c9bc;
}
.pad-footer .pad-result { flex: 1; min-width: 0; margin: 0; padding: 8px 14px; }
.pad-footer #pad-submit { width: auto; flex: 0 0 auto; min-width: 270px; margin-left: auto; }
.pad-footer .pad-result.hidden + #pad-submit { flex: 1; }
.pad-result .res-head small { font-size: 13px; }
.pad-result .badges { margin: 6px 0 0; align-items: center; }
.res-tip { font-size: 14px; color: #8a221b; font-weight: 700; }
.pad-result.success { display: flex; align-items: center; gap: 16px; }
.pad-result.success .res-main { flex: 1; min-width: 0; }
.pad-result.success #pad-next { width: auto; flex: 0 0 auto; margin: 0; padding-inline: 24px; }
.pad-result.shake { animation: shake 0.4s ease-in-out; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* Her soru kendi yerinde: ✔ doğru (yeşil) · ✘ yanlış (kırmızı) · ✋ boş (turuncu) */
#pad-form fieldset { margin-bottom: 20px; border-radius: 10px; transition: box-shadow 0.2s; }
/* Başlık (legend) normal bir satır gibi davranır: tarayıcı onu çerçevenin üst çizgisine
   oturtmaz → doğru/yanlış renkli zemin gelince başlık yukarı kayıp kesilmez, yerinde kalır */
#pad-form fieldset > legend { float: left; }
#pad-form fieldset > legend ~ * { clear: both; }
fieldset[data-field] { animation: none; }
fieldset[data-field="landform"], fieldset[data-field="continent"] { animation: rise 0.25s ease-out; }
fieldset.is-ok { box-shadow: 0 0 0 6px #e3f2e6, 0 0 0 8px var(--ok); background: #e3f2e6; }
fieldset.is-bad { box-shadow: 0 0 0 6px #fbe6e3, 0 0 0 8px var(--bad); background: #fbe6e3; }
fieldset.is-missing { box-shadow: 0 0 0 6px #fdf0de, 0 0 0 8px #d9902c; background: #fdf0de; }
.field-mark {
  padding: 1px 9px; border-radius: 999px; font-size: 13px; white-space: nowrap;
}
legend .field-mark { margin-left: auto; }
#pad-lat-out ~ .field-mark { margin-left: 8px; }
.is-ok .field-mark { background: var(--ok); color: #fff; }
.is-bad .field-mark { background: var(--bad); color: #fff; }
.is-missing .field-mark { background: #d9902c; color: #fff; }
.field-note { margin: -2px 0 8px; font-size: 14px; font-weight: 700; color: #8a221b; }
.is-missing .field-note { color: #8a5a10; }

/* ===================================================== TABLET (≤ 900 px) */
@media (max-width: 900px) {
  #hud { --alert-top: calc(var(--et) + 64px); }
  .pad-footer #pad-submit { min-width: 220px; }
}

/* ============================================ TELEFON DİKEY (≤ 600 px genişlik) */
@media (max-width: 600px) {
  :root { --edge: 10px; }
  #hud { --alert-top: calc(var(--et) + 158px); }

  /* Sol üst: kompakt göstergeler (ad küçük, bar adları gizli: simgeler yeter) */
  .vitals { width: min(58vw, 230px); padding: 8px 10px; border-radius: 14px; }
  .hero-head { gap: 8px; margin-bottom: 4px; }
  #hud-portrait { width: 30px; height: 30px; }
  .hero-name { font-size: 14px; }
  .hero-head .region { font-size: 11px; }
  .meter { grid-template-columns: 18px 1fr 38px; gap: 6px; margin: 4px 0; }
  .meter-name { display: none; }
  .meter-icon { font-size: 13px; }
  .meter-track { height: 9px; }
  .meter-value { font-size: 12px; }
  .penalty { margin-top: 6px; padding: 4px 8px; font-size: 12px; }

  /* Sağ üst: saat */
  .clock { padding: 6px 8px 6px 10px; gap: 8px; border-radius: 14px; }
  .clock-time { font-size: 17px; }
  .clock-phase { font-size: 11px; }
  .compass { width: 32px; height: 32px; }
  .weather-chip { top: calc(var(--et) + 58px); font-size: 12px; padding: 5px 9px; max-width: 36vw; }

  /* Görev: üst sıranın altında, tam genişlikte tek satır */
  .objective {
    top: calc(var(--et) + 112px); left: var(--el); right: var(--er); transform: none;
    max-width: none; padding: 7px 12px; border-radius: 14px;
  }
  .obj-title { font-size: 14px; }
  .objective .obj-hint { display: block; font-size: 12px; }

  /* Alt: çanta solda, Pad + menü sağda (ses ve tam ekran menüde) */
  .slot-btn { width: 54px; height: 54px; border-radius: 12px; }
  .slot-emoji { font-size: 23px; }
  .hotbar { gap: 6px; }
  .rescued:not(.score) { display: none; }
  .rescued { padding: 4px 10px; border-radius: 12px; }
  .rescued span { font-size: 18px; }
  .rescued b { font-size: 16px; }
  .rescued small { font-size: 11px; }
  #act-mute, #act-full { display: none; }
  .act { height: 54px; padding: 0 14px; border-radius: 12px; font-size: 15px; }
  .act span { font-size: 20px; }
  .act-interact { bottom: calc(var(--eb) + 66px); width: 80px; height: 80px; }

  #toasts { bottom: calc(var(--eb) + 66px); width: calc(100vw - 120px); left: calc(50% - 44px); }
  .toast { font-size: 13px; padding: 6px 12px; border-radius: 14px; }
  .vital-alert { font-size: 13px; padding: 7px 12px; border-radius: 16px; }
  .indicator { width: 38px; height: 38px; margin: -19px 0 0 -19px; font-size: 17px; }
  #unlock { top: 30%; padding: 12px 16px; }
  #unlock .unlock-icon { font-size: 30px; }
  #unlock b { font-size: 17px; }
}

/* ========================================== TELEFON YATAY (≤ 520 px yükseklik) */
@media (max-height: 520px) {
  :root { --edge: 10px; }
  #hud { --alert-top: calc(var(--et) + 48px); }
  .vitals { width: 220px; padding: 7px 10px; border-radius: 14px; }
  .hero-head { margin-bottom: 2px; gap: 8px; }
  #hud-portrait { width: 26px; height: 26px; }
  .hero-name { font-size: 13px; }
  .hero-head .region { font-size: 11px; }
  .meter { grid-template-columns: 18px 1fr 38px; gap: 6px; margin: 3px 0; }
  .meter-name { display: none; }
  .meter-track { height: 8px; }
  .meter-value { font-size: 12px; }
  .penalty { margin-top: 4px; padding: 3px 8px; font-size: 12px; }
  .clock { padding: 5px 8px 5px 10px; gap: 8px; }
  .clock-time { font-size: 16px; }
  .clock-phase { font-size: 11px; }
  .compass { width: 30px; height: 30px; }
  .weather-chip { top: calc(var(--et) + 50px); font-size: 12px; padding: 4px 9px; }
  .objective { padding: 6px 12px; min-width: 0; max-width: calc(100vw - 500px); }
  .objective .obj-items, .objective .obj-hint { display: none; }
  .obj-title { font-size: 14px; }
  .slot-btn { width: 52px; height: 52px; }
  .slot-emoji { font-size: 22px; }
  .rescued:not(.score) { display: none; }
  .act { height: 50px; }
  .act-interact { bottom: calc(var(--eb) + 60px); width: 78px; height: 78px; }
  #toasts { bottom: calc(var(--eb) + 4px); width: min(380px, 46vw); }
  .toast { font-size: 13px; padding: 5px 12px; }
  .vital-alert { font-size: 13px; padding: 6px 14px; max-width: 52vw; }
  #unlock { top: 24%; }
}
/* Yatay telefonda ses / tam ekran düğmelerine de yer var ama sıkışmasın */
@media (max-height: 520px) and (max-width: 760px) {
  #act-mute { display: none; }
}

/* ============================== PENCERELER: telefonda tam ekran sayfa gibi */
@media (max-width: 600px), (max-height: 520px) {
  .overlay { padding: 0; }
  .pad, .menu, .creator, .guide {
    width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0;
    box-shadow: none; animation: none;
  }
  .pad-header, .guide-header { padding: 8px 12px; padding-top: max(8px, var(--sat)); gap: 8px; }
  .pad-header h2 { font-size: 16px; }
  .pad-logo { display: none; }
  .pad-guide { padding: 0 10px; }
  .pad-body { padding: 14px 14px 18px; gap: 16px; }
  .pad-footer {
    flex-wrap: wrap; gap: 8px; padding: 8px 12px;
    padding-bottom: max(8px, var(--sab));
  }
  .pad-footer .pad-result { flex-basis: 100%; padding: 7px 12px; }
  .pad-footer #pad-submit { flex: 1; min-width: 0; padding-block: 12px; }
  .pad-result .res-head { font-size: 16px; flex-wrap: wrap; }
  .pad-result .res-head small { margin-left: 0; flex-basis: 100%; font-size: 12px; }
  .pad-result.success { flex-direction: column; align-items: stretch; max-height: 58dvh; overflow-y: auto; }
  .pad-result.success #pad-next { width: 100%; }
  .pad-result .summary { font-size: 13px; }
  .slot { padding: 8px 10px; grid-template-columns: 32px 1fr auto; }
  .slot-icon { font-size: 22px; }
  .climate-option span { font-size: 13px; }
  .climate-option i { font-size: 20px; }
  .seg span { padding: 11px 8px; }
  .lat-row input { height: 34px; }

  .menu { padding: 18px; padding-top: max(18px, var(--sat)); overflow-y: auto; }
  .slider { grid-template-columns: 110px 1fr 34px; }
  .creator { padding: 14px; gap: 12px; overflow-y: auto; align-content: start; }
  .creator-form h2 { font-size: 22px; }
  .creator-actions { position: sticky; bottom: 0; padding: 8px 0 max(4px, var(--sab)); background: var(--ink); }
  .guide-body { padding: 14px 14px 22px; }
  .cards { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
}
/* Yatay telefonda Pad iki sütun kalsın (genişlik bol, yükseklik az) */
@media (max-height: 520px) and (min-width: 700px) {
  .pad-body { grid-template-columns: 1fr 1fr; }
  .pad-footer { flex-wrap: nowrap; }
  .pad-footer .pad-result { flex-basis: auto; }
  .pad-footer #pad-submit { flex: 0 0 auto; min-width: 220px; }
  .pad-footer .pad-result.hidden + #pad-submit { flex: 1; }
  .pad-result.success { flex-direction: row; align-items: center; max-height: 48dvh; }
  .pad-result.success #pad-next { width: auto; }
  .creator { grid-template-columns: 200px 1fr; }
}

/* ==========================================================================
   v7: ana menüye dönüş, sandık ganimeti, açılış animasyonu
   ========================================================================== */
.menu-home { width: 100%; margin-top: 8px; }
.gameover-actions { display: grid; gap: 10px; margin-top: 8px; }

/* --- Sandık ganimeti: ortada kart + çantaya uçan simge --- */
#loot { position: fixed; inset: 0; z-index: 24; display: grid; place-items: center; pointer-events: none; }
.loot-card {
  position: relative; display: grid; justify-items: center; gap: 2px; text-align: center;
  min-width: 230px; padding: 20px 28px 18px; border-radius: 22px; isolation: isolate; overflow: hidden;
  background: var(--contours), var(--ink); border: 2px solid #ffd23f;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(255, 210, 63, 0.15);
  animation: lootIn 0.5s cubic-bezier(.2, 1.5, .4, 1);
}
.loot-water .loot-card { border-color: #8fd8ff; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(79, 176, 214, 0.2); }
.loot-heat .loot-card { border-color: #ffb15c; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(255, 138, 61, 0.2); }
.loot-rays {
  position: absolute; left: 50%; top: 52px; width: 220px; height: 220px; margin: -110px 0 0 -110px; z-index: -1;
  background: repeating-conic-gradient(rgba(255, 230, 150, 0.32) 0deg 10deg, transparent 10deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%);
  border-radius: 50%; animation: spin 6s linear infinite;
}
.loot-icon { display: block; font-size: 64px; line-height: 1.15; text-shadow: 0 6px 14px rgba(0, 0, 0, 0.45); animation: lootBob 1s ease-in-out infinite alternate; }
.loot-card small { color: var(--muted); font-weight: 700; margin-top: 4px; }
.loot-card b { font: 800 26px/1.15 var(--display); }
.loot-effect { font-weight: 700; color: #ffd23f; }
.loot-water .loot-effect { color: #8fd8ff; }
.loot-heat .loot-effect { color: #ffb15c; }
.loot-how { font-size: 13px; color: var(--muted); margin-top: 4px; }
#loot.leave .loot-card { opacity: 0; transform: scale(0.85); transition: opacity 0.4s, transform 0.4s; }
#loot.leave .loot-icon { visibility: hidden; }
.loot-fly {
  position: fixed; z-index: 26; margin: -36px 0 0 -36px; width: 72px; height: 72px;
  display: grid; place-items: center; font-size: 60px; pointer-events: none;
  transition: transform 0.6s cubic-bezier(.5, -0.3, .7, 1); text-shadow: 0 6px 10px rgba(0, 0, 0, 0.5);
}
.slot-btn.bump { animation: bump 0.45s cubic-bezier(.2, 1.6, .4, 1); border-color: #ffd23f; }
@keyframes lootIn { from { transform: scale(0.3) rotate(-6deg); opacity: 0; } }
@keyframes lootBob { to { transform: translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bump { 40% { transform: scale(1.3); } }
@media (max-width: 600px), (max-height: 520px) {
  .loot-card { min-width: 200px; padding: 14px 20px; }
  .loot-icon { font-size: 50px; }
  .loot-card b { font-size: 21px; }
}

/* ==================================================== AÇILIŞ ANİMASYONU */
.cutscene {
  position: fixed; inset: 0; z-index: 70; overflow: hidden; cursor: pointer;
  background: #04090b; color: #eaf2ec; -webkit-user-select: none; user-select: none;
  animation: fadein 0.6s ease-out;
}
.cutscene.see-through { background: transparent; }
.cutscene.fade-out { opacity: 0; transition: opacity 0.45s; pointer-events: none; }
.cutscene.shake .cs-stage { animation: csShake 0.09s linear infinite; }
@keyframes csShake {
  0% { transform: translate(6px, -4px); } 25% { transform: translate(-7px, 5px); }
  50% { transform: translate(5px, 6px); } 75% { transform: translate(-5px, -6px); } 100% { transform: translate(0, 0); }
}
.cs-stage { position: absolute; inset: 0; }
.cs-stage > div { position: absolute; inset: 0; animation: fadein 0.5s ease-out; }

/* Sinema şeritleri (son sahnede açılır) */
.cs-bar { position: absolute; left: 0; right: 0; height: 7vh; background: #000; z-index: 3; transition: transform 1s ease-in-out; }
.cs-bar.top { top: 0; }
.cs-bar.bottom { bottom: 0; }
.cutscene.open-bars .cs-bar.top { transform: translateY(-100%); }
.cutscene.open-bars .cs-bar.bottom { transform: translateY(100%); }

/* Statik cızırtı + tarama çizgileri */
.cs-static {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0.06; mix-blend-mode: screen;
  background-size: 128px 128px; animation: noise 0.18s steps(3) infinite;
}
.cs-static::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.25) 0 1px, transparent 1px 3px);
}
.cs-static.burst { animation: noise 0.18s steps(3) infinite, burst 0.7s ease-out; }
.cutscene.see-through .cs-static { opacity: 0.03; }
@keyframes noise { 33% { background-position: 37px 61px; } 66% { background-position: -53px 19px; } }
@keyframes burst { 0%, 30% { opacity: 0.22; } 100% { opacity: 0.06; } }

/* Üst bilgiler */
.cs-chip {
  position: absolute; top: calc(7vh + 12px); left: max(16px, var(--sal)); z-index: 4;
  padding: 4px 12px; border-radius: 999px; font: 700 12px var(--body); letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.2); color: var(--contour);
}
.cs-skip {
  position: absolute; top: calc(7vh + 8px); right: max(16px, var(--sar)); z-index: 4; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.3);
}
.cs-skip:hover { background: rgba(255, 255, 255, 0.15); }
.cs-skip kbd { font-size: 10px; margin-left: 4px; }
.cutscene.open-bars .cs-chip { top: max(14px, var(--sat)); }
.cutscene.open-bars .cs-skip { top: max(10px, var(--sat)); }

/* Altyazı (daktilo) */
.cs-sub {
  position: absolute; left: 50%; bottom: calc(7vh + 18px); z-index: 4; transform: translate(-50%, 10px);
  width: min(860px, calc(100vw - 32px)); padding: 16px 22px 14px; border-radius: 16px;
  background: rgba(4, 12, 14, 0.82); border: 1px solid rgba(127, 181, 154, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  opacity: 0; transition: opacity 0.35s, transform 0.35s;
}
.cs-sub.show { opacity: 1; transform: translate(-50%, 0); }
.cs-sub.error { border-color: rgba(255, 90, 80, 0.6); }
.cs-sub.error .cs-text { color: #ffd2cc; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 0.02em; }
.cs-speaker { display: inline-block; margin-bottom: 4px; font: 800 14px var(--display); color: var(--flare); }
.cs-text { margin: 0; min-height: 2.9em; font: 600 clamp(16px, 2.1vw, 21px)/1.45 var(--body); }
.cs-text::after { content: '▌'; color: var(--flare); animation: blink 0.8s steps(1) infinite; margin-left: 2px; }
.cs-next { display: block; text-align: right; font-size: 13px; color: var(--muted); opacity: 0; transition: opacity 0.3s; }
.cs-next.show { opacity: 1; animation: blink 1.4s ease-in-out infinite; }
.cs-start { margin-top: 12px; font-size: clamp(15px, 2vw, 19px); letter-spacing: 0.04em; animation: startPulse 1.2s ease-in-out infinite alternate; }
.cutscene.open-bars .cs-sub { bottom: max(18px, var(--sab)); }
@keyframes blink { 50% { opacity: 0.25; } }
@keyframes startPulse { to { box-shadow: 0 4px 0 var(--flare-deep), 0 0 0 8px rgba(255, 138, 61, 0.28); } }

/* ---------------------------------------------- Sahne 1: laboratuvar */
.cutscene .cs-lab { background: linear-gradient(#0b1a24, #061016 70%, #03080b); }
.cutscene .lab-wall {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 119px, rgba(127, 181, 154, 0.06) 119px 120px),
    linear-gradient(180deg, transparent 72%, rgba(79, 176, 214, 0.08) 72% 72.4%, transparent 72.4%);
}
.cutscene .lab-window {
  position: absolute; left: 50%; top: 10vh; transform: translateX(-50%);
  width: min(78vw, 112vh); aspect-ratio: 16 / 8.5; border-radius: 26px; overflow: hidden;
  box-shadow: 0 0 0 10px #1a2c33, 0 0 0 13px #0c181d, 0 30px 80px rgba(0, 0, 0, 0.7);
}
.cutscene .space { position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 20%, #10224a 0%, #050a1c 60%, #02040c 100%); }
.cutscene .stars {
  position: absolute; inset: 0; opacity: 0.9;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 33% 64%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 57% 18%, #cfe 50%, transparent 51%), radial-gradient(1px 1px at 72% 44%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 12%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 44% 38%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 80%, #bdf 50%, transparent 51%), radial-gradient(1px 1px at 94% 70%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 82%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 5% 55%, #fff 50%, transparent 51%);
  animation: twinkle 3s ease-in-out infinite alternate;
}
@keyframes twinkle { to { opacity: 0.55; } }
.cutscene .sun {
  position: absolute; left: 4%; top: 8%; width: 16%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fff7d0 0%, #ffd23f 35%, #ff8a3d 60%, rgba(255, 138, 61, 0) 72%);
  box-shadow: 0 0 80px 30px rgba(255, 150, 60, 0.55); animation: sunBoil 1.2s ease-in-out infinite alternate;
}
@keyframes sunBoil { to { transform: scale(1.08); box-shadow: 0 0 120px 50px rgba(255, 120, 40, 0.7); } }
.cutscene .flare {
  position: absolute; left: 12%; top: 23%; width: 12%; aspect-ratio: 1; margin: -6% 0 0 -6%; border-radius: 50%;
  border: 6px solid rgba(255, 170, 60, 0.85); box-shadow: 0 0 30px rgba(255, 140, 40, 0.8), inset 0 0 30px rgba(255, 140, 40, 0.6);
  opacity: 0; animation: flare 2.4s ease-out infinite;
}
.cutscene .flare.f2 { animation-delay: 0.8s; }
.cutscene .flare.f3 { animation-delay: 1.6s; }
@keyframes flare { 0% { transform: scale(0.4); opacity: 0.95; } 100% { transform: scale(9); opacity: 0; } }
.cutscene .earth {
  position: absolute; left: -10%; right: -10%; top: 78%; height: 120%; border-radius: 50%;
  background:
    radial-gradient(ellipse 30% 14% at 30% 10%, rgba(80, 140, 70, 0.9), transparent 70%),
    radial-gradient(ellipse 22% 10% at 70% 14%, rgba(150, 130, 80, 0.8), transparent 70%),
    radial-gradient(ellipse at 50% 0%, #2f7fc0, #123a6b 40%, #071a33 70%);
  box-shadow: 0 -10px 40px 6px rgba(120, 200, 255, 0.55), inset 0 10px 30px rgba(200, 240, 255, 0.35);
}
.cutscene .sat { position: absolute; left: 50%; top: 30%; width: 34%; transform: rotate(-8deg); animation: satFloat 4s ease-in-out infinite alternate; }
.cutscene .sat svg { display: block; width: 100%; overflow: visible; }
.cutscene .sat .panel { fill: #24508f; stroke: #9cc3ff; stroke-width: 1.5; }
.cutscene .sat .grid { stroke: rgba(180, 210, 255, 0.5); stroke-width: 1; }
.cutscene .sat .strut { fill: #9aa7b0; }
.cutscene .sat .body { fill: #d9b45a; stroke: #7a5d20; stroke-width: 2; }
.cutscene .sat .body-band { fill: #b08a35; }
.cutscene .sat .lamp { fill: #7dffb0; }
.cutscene .sat .ant { stroke: #c9d4da; stroke-width: 2.5; }
.cutscene .sat .dish { fill: #e6edf0; stroke: #8a979e; stroke-width: 1.5; }
.cutscene .sat-label { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); font: 800 clamp(10px, 1.2vw, 14px) var(--display); letter-spacing: 0.2em; color: #9cc3ff; white-space: nowrap; }
@keyframes satFloat { to { transform: rotate(-5deg) translateY(-6px); } }
.cutscene .sat .sparks {
  position: absolute; left: 40%; top: 30%; width: 20%; aspect-ratio: 1; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff 0 10%, #ffd23f 20%, rgba(255, 90, 40, 0.7) 45%, transparent 70%);
}
.cutscene .cs-lab.hit .sat { animation: satHit 0.12s linear infinite; }
.cutscene .cs-lab.hit .sat .lamp { fill: #ff3b30; }
.cutscene .cs-lab.hit .sat .panel { animation: panelDie 0.5s steps(2) infinite; }
.cutscene .cs-lab.hit .sat .sparks { animation: sparks 0.6s ease-out infinite; }
.cutscene .cs-lab.hit .sat-label { color: #ff6b5e; }
@keyframes satHit { 0% { transform: rotate(-10deg) translate(2px, -1px); } 50% { transform: rotate(-6deg) translate(-3px, 2px); } 100% { transform: rotate(-9deg); } }
@keyframes panelDie { 50% { fill: #0d1b30; } }
@keyframes sparks { 0% { transform: scale(0.3); opacity: 1; } 100% { transform: scale(2.6); opacity: 0; } }
.cutscene .window-frame { position: absolute; inset: 0; border-radius: 26px; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.12), inset 0 0 60px rgba(0, 0, 0, 0.6); background: linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0 18%, transparent 18% 100%); }
.cutscene .lab-consoles {
  position: absolute; left: 50%; transform: translateX(-50%); top: calc(10vh + min(78vw, 112vh) * 8.5 / 16 + 3vh);
  width: min(78vw, 112vh); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4vw;
}
.cutscene .mon {
  display: grid; gap: 4px; align-content: start; padding: 10px 12px; border-radius: 10px; min-height: 84px;
  background: #07161a; border: 2px solid #1d3a40; box-shadow: inset 0 0 20px rgba(79, 176, 214, 0.12);
  font: 700 clamp(9px, 1vw, 12px) ui-monospace, Consolas, monospace; color: #7fe0c0;
}
.cutscene .mon b { color: #9db8ae; letter-spacing: 0.06em; }
.cutscene .mon svg { width: 100%; height: 34px; }
.cutscene .mon .graph { fill: none; stroke: #ff5a4f; stroke-width: 2; stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw 2.4s ease-out forwards; }
.cutscene .mon .val { color: #7fe0c0; }
.cutscene .mon .bad { color: #ff6b5e; }
.cutscene .mon .big { font: 800 clamp(20px, 3vw, 34px) var(--display); color: #ffb15c; }
.cutscene .mon .bar { height: 8px; border-radius: 4px; background: #1d3a40; overflow: hidden; }
.cutscene .mon .bar i { display: block; height: 100%; width: 40%; background: #ff5a4f; animation: overload 1.4s ease-in forwards; }
.cutscene .blink { animation: blink 0.7s steps(1) infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes overload { to { width: 100%; } }
.cutscene .beacon {
  position: absolute; top: 0; width: 46vmin; height: 46vmin; z-index: 1; opacity: 0.9;
  background: conic-gradient(from 0deg, rgba(255, 40, 30, 0.55) 0 30deg, transparent 30deg 180deg, rgba(255, 40, 30, 0.55) 180deg 210deg, transparent 210deg);
  border-radius: 50%; -webkit-mask: radial-gradient(circle, #000 0 60%, transparent 70%); mask: radial-gradient(circle, #000 0 60%, transparent 70%);
  animation: spin 1.6s linear infinite;
}
.cutscene .beacon.l { left: -23vmin; top: -23vmin; }
.cutscene .beacon.r { right: -23vmin; top: -23vmin; animation-direction: reverse; }
.cutscene .alarm-wash { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(200, 20, 20, 0.5)); animation: alarm 1s ease-in-out infinite; }
@keyframes alarm { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.85; } }

/* ---------------------------------------------- Sahne 2: ışınlanma */
.cutscene .cs-tele { background: radial-gradient(ellipse at 50% 60%, #0d3340 0%, #061318 55%, #020709 100%); }
.cutscene .tele-bg {
  position: absolute; left: -20%; right: -20%; bottom: 0; height: 40%;
  background: repeating-linear-gradient(90deg, rgba(79, 216, 255, 0.18) 0 2px, transparent 2px 60px),
              repeating-linear-gradient(0deg, rgba(79, 216, 255, 0.18) 0 2px, transparent 2px 40px);
  transform: perspective(400px) rotateX(60deg); transform-origin: bottom;
  -webkit-mask: linear-gradient(transparent, #000 60%); mask: linear-gradient(transparent, #000 60%);
}
.cutscene .tele-wrap {
  position: absolute; inset: 7vh 0; display: flex; align-items: center; justify-content: center; gap: 5vw;
  padding: 2vh 4vw 18vh;
}
.cutscene .capsule { position: relative; width: min(24vw, 30vh); height: min(54vh, 64vw); flex-shrink: 0; }
.cutscene .cap-glass {
  position: absolute; inset: 6% 6% 9%; border-radius: 999px / 22%;
  background: linear-gradient(90deg, rgba(150, 230, 255, 0.28), rgba(150, 230, 255, 0.05) 30%, rgba(150, 230, 255, 0.05) 70%, rgba(150, 230, 255, 0.3));
  border: 2px solid rgba(160, 235, 255, 0.6); box-shadow: inset 0 0 40px rgba(79, 216, 255, 0.35), 0 0 30px rgba(79, 216, 255, 0.3);
}
.cutscene .cap-top, .cutscene .cap-base {
  position: absolute; left: 0; right: 0; height: 9%; border-radius: 50%;
  background: linear-gradient(#5d7079, #22333a); border: 2px solid #8fa5ad;
}
.cutscene .cap-top { top: 0; }
.cutscene .cap-base { bottom: 0; box-shadow: 0 0 40px 8px rgba(79, 216, 255, 0.5); }
.cutscene .cap-glow { position: absolute; inset: 10% 15% 12%; border-radius: 50%; background: radial-gradient(ellipse, rgba(120, 230, 255, 0.55), transparent 70%); animation: glow 1.2s ease-in-out infinite alternate; }
@keyframes glow { to { opacity: 0.5; transform: scale(0.92); } }
.cutscene .cap-hero {
  position: absolute; left: 50%; bottom: 11%; transform: translateX(-50%);
  height: 48%; aspect-ratio: 36 / 44; image-rendering: pixelated; image-rendering: crisp-edges;
  filter: drop-shadow(0 0 10px rgba(120, 230, 255, 0.7));
}
.cutscene .ring {
  position: absolute; left: 4%; right: 4%; height: 10%; bottom: 8%; border-radius: 50%;
  border: 3px solid rgba(140, 240, 255, 0.85); box-shadow: 0 0 16px rgba(79, 216, 255, 0.8);
  animation: ringUp 1.8s linear infinite; opacity: 0;
}
.cutscene .ring.r2 { animation-delay: 0.6s; }
.cutscene .ring.r3 { animation-delay: 1.2s; }
@keyframes ringUp { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-780%); opacity: 0; } }
.cutscene .cs-tele.overload .ring { animation-duration: 0.55s; border-color: #fff; }
.cutscene .cs-tele.overload .capsule { animation: csShake 0.12s linear infinite; }
.cutscene .cs-tele.overload .cap-glow { background: radial-gradient(ellipse, rgba(255, 255, 255, 0.85), rgba(120, 230, 255, 0.4) 50%, transparent 70%); }
.cutscene .coords {
  width: min(38vw, 420px); padding: 16px 18px; border-radius: 14px; background: #031012;
  border: 2px solid #1d5560; box-shadow: 0 0 30px rgba(79, 216, 255, 0.2), inset 0 0 30px rgba(79, 216, 255, 0.08);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
.cutscene .lcd-title { font-size: clamp(9px, 1vw, 12px); letter-spacing: 0.1em; color: #6fb7c4; margin-bottom: 8px; }
.cutscene .lcd { font: 700 clamp(26px, 4.2vw, 50px)/1.15 ui-monospace, Consolas, monospace; color: #6dfcff; text-shadow: 0 0 12px rgba(109, 252, 255, 0.8); }
.cutscene .lcd-log { list-style: none; margin: 10px 0 0; padding: 0; font-size: clamp(11px, 1.2vw, 14px); color: #a9d6dc; display: grid; gap: 3px; min-height: 6em; }
.cutscene .lcd-log li { animation: fadein 0.2s; }
.cutscene .lcd-log .bad { color: #ff6b5e; }
.cutscene .cs-tele.overload .lcd { color: #ff8b80; text-shadow: 0 0 12px rgba(255, 90, 80, 0.9); }
.cutscene .flash { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, #fff 0 30%, #bff4ff 55%, #5fd0ff 100%); }
.cutscene .cs-tele.boom .flash { animation: flashIn 0.35s ease-in forwards; }
@keyframes flashIn { to { opacity: 1; } }

/* ---------------------------------------------- Sahne 3: uyanış */
.cutscene .cs-wake { background: transparent; }
.cutscene .lid { position: absolute; left: -10%; right: -10%; height: 62%; background: #000; z-index: 1; }
.cutscene .lid.top { top: 0; border-radius: 0 0 50% 50% / 0 0 40% 40%; animation: lidTop 2.2s ease-in-out forwards; }
.cutscene .lid.bottom { bottom: 0; border-radius: 50% 50% 0 0 / 40% 40% 0 0; animation: lidBottom 2.2s ease-in-out forwards; }
@keyframes lidTop { 0% { transform: translateY(0); } 30% { transform: translateY(-38%); } 45% { transform: translateY(-8%); } 100% { transform: translateY(-110%); } }
@keyframes lidBottom { 0% { transform: translateY(0); } 30% { transform: translateY(38%); } 45% { transform: translateY(8%); } 100% { transform: translateY(110%); } }
body.cine-blur #game-container { filter: blur(9px) brightness(0.7); }
body.cine #game-container { transition: filter 1.6s ease-out; }
.cutscene .wind { position: absolute; inset: 0; overflow: hidden; }
.cutscene .wind i {
  position: absolute; left: -30%; height: 2px; width: 26%; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: gust 1.4s linear infinite;
}
.cutscene .wind i:nth-child(1) { top: 12%; animation-delay: 0s; } .wind i:nth-child(2) { top: 20%; animation-delay: 0.5s; width: 18%; }
.cutscene .wind i:nth-child(3) { top: 28%; animation-delay: 0.9s; } .wind i:nth-child(4) { top: 35%; animation-delay: 0.2s; width: 34%; }
.cutscene .wind i:nth-child(5) { top: 43%; animation-delay: 1.1s; } .wind i:nth-child(6) { top: 51%; animation-delay: 0.7s; width: 20%; }
.cutscene .wind i:nth-child(7) { top: 58%; animation-delay: 0.3s; } .wind i:nth-child(8) { top: 64%; animation-delay: 1.3s; width: 30%; }
.cutscene .wind i:nth-child(9) { top: 70%; animation-delay: 0.6s; } .wind i:nth-child(10) { top: 77%; animation-delay: 0.1s; width: 16%; }
.cutscene .wind i:nth-child(11) { top: 83%; animation-delay: 1s; } .wind i:nth-child(12) { top: 8%; animation-delay: 0.8s; width: 22%; }
.cutscene .wind i:nth-child(13) { top: 47%; animation-delay: 1.25s; width: 28%; } .wind i:nth-child(14) { top: 88%; animation-delay: 0.45s; }
@keyframes gust { to { transform: translateX(560%); } }
.cutscene .radio-chip {
  position: absolute; left: 50%; top: calc(7vh + 54px); transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: rgba(30, 6, 6, 0.85); border: 1.5px solid #ff6b5e; color: #ffc2bd; font-weight: 700;
  opacity: 0; animation: fadein 0.4s 2.5s forwards, blink 1s 3s steps(1) infinite;
}
.cutscene .radio-chip .radio-ico { font-size: 18px; }
.cutscene .radio-bars { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.cutscene .radio-bars i { width: 4px; background: rgba(255, 255, 255, 0.25); border-radius: 1px; }
.cutscene .radio-bars i:nth-child(1) { height: 30%; background: #ff6b5e; } .radio-bars i:nth-child(2) { height: 55%; }
.cutscene .radio-bars i:nth-child(3) { height: 78%; } .radio-bars i:nth-child(4) { height: 100%; }
@keyframes fadein2 { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------- Sahne 4: HUD sırayla gelir */
body.cine #indicators, body.cine .vital-alert, body.cine .act-interact, body.cine #toasts { visibility: hidden; }
#hud .vitals, #hud .clock, #hud .objective, #hud .hotbar, #hud .actions, #hud .weather-chip {
  transition: opacity 0.55s ease-out, translate 0.65s cubic-bezier(.2, 1.4, .4, 1);
}
body.cine #hud .vitals { opacity: 0; translate: -60px 0; }
body.cine #hud .clock, body.cine #hud .weather-chip { opacity: 0; translate: 60px 0; }
body.cine #hud .objective { opacity: 0; translate: 0 -40px; }
body.cine #hud .hotbar { opacity: 0; translate: -60px 0; }
body.cine #hud .actions { opacity: 0; translate: 0 60px; }
body.cine.cine-hud #hud .vitals { opacity: 1; translate: 0 0; transition-delay: 0s; }
body.cine.cine-hud #hud .clock, body.cine.cine-hud #hud .weather-chip { opacity: 1; translate: 0 0; transition-delay: 0.3s; }
body.cine.cine-hud #hud .objective { opacity: 1; translate: 0 0; transition-delay: 0.6s; }
body.cine.cine-hud #hud .hotbar { opacity: 1; translate: 0 0; transition-delay: 0.9s; }
body.cine.cine-hud #hud .actions { opacity: 1; translate: 0 0; transition-delay: 1.2s; }
body.cine.cine-hud #act-pad { animation: padCall 0.9s 1.8s ease-in-out 3; }
@keyframes padCall { 50% { box-shadow: 0 0 0 8px rgba(255, 138, 61, 0.45); transform: scale(1.08); } }
/* Son sahnede altyazı ortada dursun (HUD ile çakışmasın) */
/* Son sahne: altyazı kâşifin altında (ortadaki kâşifi ve HUD'ı kapatmasın), Geç düğmesi gerekmez */
.cutscene[data-scene="start"] .cs-sub { bottom: auto; top: 60%; width: min(620px, calc(100vw - 32px)); text-align: center; }
.cutscene[data-scene="start"] .cs-chip, .cutscene[data-scene="start"] .cs-skip { display: none; }

/* ---------------------------------------------- Telefon */
@media (orientation: portrait) and (max-width: 700px) {
  .cutscene .lab-window { top: 13vh; width: 92vw; aspect-ratio: 4 / 5; }
  .cutscene .sat { left: 30%; top: 32%; width: 62%; }
  .cutscene .sun { width: 30%; }
  .cutscene .flare { width: 20%; left: 18%; top: 20%; }
  .cutscene .earth { top: 82%; left: -40%; right: -40%; }
  .cutscene .lab-consoles { top: calc(13vh + 92vw * 1.25 + 2vh); width: 92vw; gap: 6px; }
  .cutscene .mon { min-height: 70px; padding: 6px 8px; }
  .cutscene .mon svg { height: 22px; }
  .cutscene .tele-wrap { flex-direction: column-reverse; gap: 3vh; padding: 4vh 4vw 22vh; justify-content: flex-end; }
  .cutscene .capsule { width: 40vw; height: 40vh; }
  .cutscene .coords { width: 92vw; padding: 10px 12px; }
  .cutscene .lcd { font-size: 30px; }
  .cutscene .lcd-log { min-height: 0; font-size: 11px; }
  .cs-sub { padding: 12px 14px; }
  .cs-chip { font-size: 10px; }
}
@media (max-height: 520px) {
  .cs-bar { height: 4vh; }
  .cutscene .lab-window { top: 7vh; width: 60vw; }
  .cutscene .lab-consoles { display: none; }
  .cutscene .tele-wrap { padding: 0 4vw 26vh; }
  .cutscene .capsule { height: 56vh; width: 22vh; }
  .cutscene .lcd { font-size: 26px; }
  .cutscene .lcd-log { min-height: 0; }
  .cs-sub { padding: 10px 16px; bottom: calc(4vh + 8px); }
  .cs-text { min-height: 0; font-size: 15px; }
  .cs-chip { top: calc(4vh + 8px); }
  .cs-skip { top: calc(4vh + 4px); padding: 6px 12px; }
}
@media (max-height: 520px) {
  /* Yatay telefon: son sahnede yazı, çanta ile düğmelerin arasında altta dursun */
  .cutscene[data-scene="start"] .cs-sub { top: auto; bottom: max(8px, var(--sab)); width: min(400px, 44vw); padding: 8px 12px; }
  .cutscene[data-scene="start"] .cs-text { font-size: 13px; }
  .cutscene[data-scene="start"] .cs-start { margin-top: 6px; padding-block: 9px; font-size: 14px; }
}

/* ==========================================================================
   v7.1 düzeltmeleri
   ========================================================================== */
/* Rehber: uzun sekmelerde (Nasıl oynanır, İklimler) gövde, sekme satırını
   sıkıştırıp kesiyordu → başlık ve sekmeler asla küçülmez, yalnız gövde kayar */
.guide-header, .guide-tabs { flex-shrink: 0; }
.guide-tabs { overflow-y: hidden; scrollbar-width: none; }
.guide-tabs::-webkit-scrollbar { display: none; }
.guide-body { flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
/* Pad ve menü için de aynı güvence */
.pad-header, .pad-footer { flex-shrink: 0; }

/* Yazılar fareyle seçilemesin (oyun arayüzü gibi davransın);
   yalnızca yazı yazılan alanlar (kâşif adı) seçilebilir kalır */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input[type="text"], textarea { -webkit-user-select: text; user-select: text; }
img, svg, canvas { -webkit-user-drag: none; }

/* ==========================================================================
   v8 ÇEVRİM İÇİ YARIŞ: lobi, hızlı eşleşme, yarış ekranı, sıralama, kürsü
   ========================================================================== */
.btn-signal.alt { background: #2f8f9a; color: #fff; box-shadow: 0 4px 0 #1d5d64; }
.btn-signal.alt:active { box-shadow: 0 1px 0 #1d5d64; }
#btn-race.pulse { animation: startPulse 1.1s ease-in-out infinite alternate; }
.net-msg { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: rgba(217, 71, 63, 0.18); border: 1px solid rgba(217, 71, 63, 0.5); color: #ffd2cc; font-size: 14px; max-width: 36em; }
.link-btn { display: block; padding: 0; border: 0; background: none; color: var(--contour); font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: underline; }

/* --- Lobi --- */
#lobby { z-index: 55; }
.lobby {
  width: min(720px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--contours), var(--ink); border: 1px solid var(--ink-line); border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); animation: rise 0.18s ease-out;
}
.lobby .guide-header { background: transparent; border-bottom: 1px solid var(--ink-line); }
.lobby-body { padding: 18px 22px 22px; overflow-y: auto; min-height: 0; }
.lobby-status, .lobby-error { margin: 14px 22px 0; padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.lobby-status { background: rgba(127, 181, 154, 0.15); color: #c6ead6; }
.lobby-status.warn { background: rgba(240, 164, 58, 0.18); color: #ffd9a8; }
.lobby-error { background: rgba(217, 71, 63, 0.2); color: #ffc2bd; }
.lobby-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lobby-hero { display: flex; align-items: center; gap: 12px; }
.lobby-hero canvas { border-radius: 50%; background: #17383b; border: 2px solid var(--contour); }
.lobby-hero b { display: block; font: 800 18px var(--display); }
.lobby-online { margin: 0; font-size: 13px; color: var(--contour); font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(127, 181, 154, 0.12); }
.choice { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--ink-line); display: grid; gap: 8px; align-content: start; }
.choice h3 { margin: 0; font: 800 18px var(--display); }
.choice p { margin: 0; color: var(--muted); font-size: 14px; }
.choice .btn-ghost { width: 100%; }
.quick-choice { grid-template-columns: 1fr auto; align-items: center; gap: 16px; border-color: rgba(255, 138, 61, 0.55); background: rgba(255, 138, 61, 0.08); margin-bottom: 12px; }
.quick-choice .btn-signal { width: auto; padding-inline: 26px; }
.lobby-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.code-row { display: flex; gap: 8px; }
.code-row input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; color: var(--text);
  background: rgba(255, 255, 255, 0.07); border: 1.5px solid var(--ink-line); font: 700 16px var(--body);
}
.code-row input:focus { border-color: var(--flare); outline: none; }
#lobby-code { letter-spacing: 0.3em; text-transform: uppercase; font: 800 20px var(--display); text-align: center; }
.code-row .btn-ghost { width: auto; flex-shrink: 0; }
.lobby-how { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.room-code-row { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: end; }
.label { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.room-code { font: 800 46px/1 var(--display); letter-spacing: 0.14em; color: var(--flare); }
#lobby-link { font: 400 14px var(--body); }
#lobby-room h3 { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; font: 800 17px var(--display); }
#lobby-room h3 .count { font: 700 13px var(--body); padding: 1px 9px; border-radius: 999px; background: rgba(127, 181, 154, 0.2); color: var(--contour); }
.lobby-players { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.lobby-players li {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--ink-line); font-weight: 700; animation: pop 0.25s ease-out;
}
.lobby-players li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-players li.me { border-color: var(--flare); }
.lobby-players li.off { opacity: 0.45; }
.lobby-players canvas { width: 40px; height: 40px; border-radius: 50%; background: #17383b; flex-shrink: 0; }
.lobby-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.lobby-settings .wide { grid-column: span 2; }
.lobby-settings label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.lobby-settings select {
  padding: 9px 10px; border-radius: 10px; font: 700 15px var(--body); color: var(--text);
  background: #17383b; border: 1.5px solid var(--ink-line);
}
.lobby-settings select:disabled { opacity: 0.7; }
.lobby-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.lobby-actions .btn-signal { width: auto; margin-left: auto; padding-inline: 28px; }
.lobby-wait { margin: 0 0 0 auto; color: var(--muted); }

/* Hızlı eşleşme: radar */
.quick-wait { text-align: center; padding: 6px 0 16px; }
.quick-wait h3 { margin: 12px 0 4px; font: 800 22px var(--display); }
.quick-wait p { margin: 0; color: var(--muted); min-height: 1.5em; }
.radar { position: relative; width: 110px; height: 110px; margin: 0 auto; display: grid; place-items: center; }
.radar span { font-size: 54px; position: relative; z-index: 1; animation: spinSlow 8s linear infinite; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--contour); opacity: 0; animation: ping 2.4s ease-out infinite; transform-origin: center; }
.radar i + i { animation-delay: 1.2s; }
@keyframes spinSlow { to { transform: rotate(360deg); } }

/* --- Yarış ekranı --- */
body.race-mode .vitals, body.race-mode .hotbar { display: none; }
body.race-mode .weather-chip { display: none; }
#race-hud { position: fixed; inset: 0; pointer-events: none; z-index: 11; }
.race-status { top: var(--et); left: var(--el); width: 210px; padding: 10px 16px; }
.race-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 700; }
#race-code { color: var(--flare); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-timer { font: 800 44px/1.05 var(--display); font-variant-numeric: tabular-nums; margin-top: 2px; }
.race-timer.low { color: var(--bad); animation: critical 0.6s ease-in-out infinite alternate; }
.race-board-panel {
  top: calc(var(--et) + 76px); right: var(--er); width: 250px; padding: 10px 12px;
  max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); overflow-y: auto; pointer-events: auto;
}
.race-board-panel h3 { margin: 0 0 6px; font: 800 15px var(--display); }
.race-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.race-board li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 36px; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; font-size: 14px; }
.race-board li.me { background: rgba(255, 138, 61, 0.18); }
.race-board li.off { opacity: 0.45; }
.race-board .pos { color: var(--muted); font-weight: 700; }
.race-board .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.race-board .st { font-size: 12px; color: var(--muted); white-space: nowrap; }
.race-board .st.ok { font-size: 16px; }
.race-board b { text-align: right; font-variant-numeric: tabular-nums; color: #ffd23f; }

/* Geri sayım */
#race-countdown {
  position: fixed; inset: 0; z-index: 44; display: grid; place-content: center; text-align: center; pointer-events: none;
  background: radial-gradient(circle, rgba(8, 24, 27, 0.55), rgba(8, 24, 27, 0.15) 60%);
}
#race-countdown-num { font: 800 clamp(90px, 16vw, 180px)/1 var(--display); color: var(--flare); text-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
#race-countdown-sub { font: 700 20px var(--body); margin: 8px 0 0; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }

/* Tur sonu ve kürsü */
#race-round-end, #race-final { z-index: 46; }
.race-card {
  width: min(620px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 22px 24px; border-radius: 20px; background: var(--contours), var(--ink);
  border: 1px solid var(--ink-line); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); animation: rise 0.2s ease-out;
}
.race-kicker { margin: 0; color: var(--contour); font-weight: 700; }
.race-card h2 { margin: 4px 0 10px; font: 800 30px/1.1 var(--display); }
.race-card .badge.ok { background: rgba(127, 181, 154, 0.2); color: #c6ead6; border: 0; }
.race-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 15px; }
.race-table td { padding: 7px 8px; border-bottom: 1px solid var(--ink-line); }
.race-table tr.me td { background: rgba(255, 138, 61, 0.14); }
.race-table td.pts { text-align: right; font-weight: 700; color: #ffd23f; }
.race-next { margin: 14px 0 0; color: var(--muted); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; margin: 14px 0 16px; }
.podium-slot { display: grid; justify-items: center; gap: 2px; text-align: center; min-width: 0; }
.podium-slot b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-slot canvas { width: 64px; height: 64px; border-radius: 50%; background: #17383b; border: 2px solid var(--contour); }
.podium-slot span { color: var(--muted); font-size: 13px; }
.podium-step { width: 100%; margin-top: 6px; display: grid; place-items: center; font-size: 28px; border-radius: 10px 10px 0 0; background: rgba(127, 181, 154, 0.18); }
.p1 .podium-step { height: 90px; background: rgba(255, 210, 63, 0.25); }
.p2 .podium-step { height: 64px; }
.p3 .podium-step { height: 46px; }
.race-final-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; max-height: 30vh; overflow-y: auto; }
.race-final-list li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.race-final-list li.me { background: rgba(255, 138, 61, 0.18); }
.race-final-list .pos { color: var(--muted); font-weight: 700; }
.race-final-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-final-list b { color: #ffd23f; }
.race-actions { display: flex; gap: 8px; margin-top: 18px; align-items: center; flex-wrap: wrap; }
.race-actions .btn-signal { width: auto; padding-inline: 24px; }
.race-wait { margin: 0; color: var(--muted); flex: 1; }

/* --- Telefon: lobi ve yarış --- */
@media (max-width: 600px), (max-height: 520px) {
  .lobby { width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; animation: none; }
  .lobby .guide-header { padding-top: max(8px, var(--sat)); }
  .lobby-body { padding: 14px 14px max(18px, var(--sab)); }
  .lobby-choices, .room-code-row, .lobby-settings { grid-template-columns: 1fr; }
  .lobby-settings .wide { grid-column: auto; }
  .quick-choice { grid-template-columns: 1fr; }
  .quick-choice .btn-signal { width: 100%; }
  .room-code { font-size: 40px; }
  .race-card { padding: 16px; }
  .race-card h2 { font-size: 24px; }
  .race-table { font-size: 13px; }
  .race-table td { padding: 6px 5px; }
  .race-actions .btn-signal, .race-actions .btn-ghost { flex: 1 1 auto; }
}
@media (max-height: 520px) and (min-width: 700px) {
  .lobby-choices, .room-code-row { grid-template-columns: 1fr 1fr; }
  .quick-choice { grid-template-columns: 1fr auto; }
  .quick-choice .btn-signal { width: auto; }
}
@media (max-width: 600px) {
  .race-status { width: auto; min-width: 140px; padding: 7px 12px; border-radius: 14px; }
  .race-timer { font-size: 30px; }
  .race-meta { font-size: 11px; }
  /* Sıralama: kapalıyken ilk 3 + kendin; dokununca tamamı */
  .race-board-panel { top: calc(var(--et) + 166px); width: min(48vw, 200px); padding: 6px 8px; max-height: 32vh; border-radius: 12px; }
  .race-board-panel h3 { font-size: 12px; margin-bottom: 3px; }
  .race-board-panel h3::after { content: ' ▾'; color: var(--muted); }
  .race-board li { grid-template-columns: 14px minmax(0, 1fr) auto 28px; gap: 4px; padding: 2px 4px; font-size: 12px; }
  .race-board .st { font-size: 10px; }
  .race-board-panel:not(.expanded) .race-board li:nth-child(n+4):not(.me) { display: none; }
  #race-countdown-sub { font-size: 15px; padding: 0 16px; }
  body.race-mode .objective { top: calc(var(--et) + 66px); }
}
@media (max-height: 520px) {
  .race-status { width: 170px; padding: 5px 12px; }
  .race-timer { font-size: 26px; }
  .race-board-panel { top: calc(var(--et) + 54px); width: 210px; max-height: calc(100dvh - 130px); padding: 6px 8px; }
  .race-board li { font-size: 12px; padding: 2px 4px; }
}
@media (max-width: 600px) {
  .race-wait { flex-basis: 100%; text-align: center; }
}

/* ==========================================================================
   v9: oyuncu gizle / şikâyet menüsü, mobil uygulama
   ========================================================================== */
.tappable { cursor: pointer; }
.race-board li.tappable:hover, .lobby-players li.tappable:hover { background: rgba(255, 255, 255, 0.08); }
.mod-pop {
  position: fixed; z-index: 90; width: 230px; display: grid; gap: 6px; padding: 10px;
  background: var(--ink); border: 1px solid var(--ink-line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); animation: pop 0.15s ease-out;
}
.mod-pop b { font: 800 14px var(--display); padding: 0 4px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-pop button {
  text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 14px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--ink-line); color: var(--text);
}
.mod-pop button:hover { border-color: var(--contour); }
.name-tip { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--muted); }
.guide-body a { color: var(--flare-deep); font-weight: 700; }

/* Dar telefonda Pad başlığı tek satır: başlık kısalır, Rehber düğmesi yalnız simge */
.pad-header h2, .pad-location { white-space: nowrap; }
.pad-header h2 { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 420px) {
  .pad-header h2 { font-size: 15px; }
  .pad-location { font-size: 13px; }
  .pad-guide-text { display: none; }
  .pad-guide { width: 36px; padding: 0; flex-shrink: 0; }
  .pad-close { flex-shrink: 0; }
}

/* ==========================================================================
   v10 · KURTULUŞ HARİTASI · ROZETLER · GÜNLÜK MEYDAN OKUMA
   ========================================================================== */

/* --- Dünya haritası (RouteMap.js) --- */
.routemap { display: block; width: 100%; height: auto; border-radius: 12px; overflow: hidden; }
.rm-land { fill: #6f9a72; stroke: #a8c9a3; stroke-width: 0.6; stroke-linejoin: round; }
.rm-par { stroke: rgba(234, 242, 236, 0.28); stroke-width: 1; stroke-dasharray: 4 6; }
.rm-par.equator { stroke: rgba(255, 210, 63, 0.75); stroke-dasharray: none; stroke-width: 1.4; }
.rm-par-label { fill: rgba(234, 242, 236, 0.7); font: 700 13px var(--body); paint-order: stroke; stroke: rgba(10, 30, 34, 0.7); stroke-width: 3px; }
.rm-par-label.equator { fill: #ffd23f; }
.rm-arc { fill: none; stroke: #ffd23f; stroke-width: 2.4; stroke-dasharray: 7 6; stroke-linecap: round; opacity: 0.85; }
.rm-arc.new { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: rmDraw 0.9s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes rmDraw { to { stroke-dashoffset: 0; } }
.rm-pin path { fill: var(--c, var(--flare)); stroke: #10292c; stroke-width: 1.6; }
.rm-pin text { fill: #fff; font: 800 11px var(--display); text-anchor: middle; paint-order: stroke; stroke: rgba(0, 0, 0, 0.35); stroke-width: 2px; }
.rm-flag.last .rm-pin path { stroke: #fff; stroke-width: 2.2; }
.rm-ring { fill: none; stroke: #fff; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: rmRing 1.6s ease-out infinite; }
@keyframes rmRing { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.6); opacity: 0; } }
.rm-flag.new .rm-pin { transform-box: fill-box; transform-origin: 50% 100%; animation: rmDrop 0.55s cubic-bezier(.3, 1.6, .5, 1) 0.85s both; }
@keyframes rmDrop { from { transform: translateY(-40px) scale(0.4); opacity: 0; } }
.rm-spark { fill: #fff6c8; filter: drop-shadow(0 0 6px #ffd23f); }
.rm-heli text { font-size: 26px; text-anchor: middle; }
.rm-heli { animation: rmHeli 1.6s ease-in both; }
@keyframes rmHeli { 0% { opacity: 0; transform: translateY(6px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-46px) translateX(30px); } }
.rm-empty { margin: 0; color: var(--muted); font-size: 14px; }
.rm-legend { margin: 10px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; counter-reset: rm; }
.rm-legend li { counter-increment: rm; display: grid; grid-template-columns: 22px 1fr auto; column-gap: 8px; align-items: center; font-size: 13px; }
.rm-legend li::before { content: counter(rm); grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font: 800 11px var(--display); }
.rm-legend small { color: var(--muted); }
.rm-stars { grid-row: span 2; font-size: 11px; }

/* --- Uçuş perdesi: harita kartı --- */
#travel { cursor: pointer; padding: 16px; display: flex; align-items: center; justify-content: center; }
.travel-card { width: min(900px, calc(100vw - 32px)); text-align: center; animation: rise 0.3s ease-out; }
.travel-kicker { margin: 0; color: var(--contour); font: 800 15px var(--display); letter-spacing: 0.02em; }
#travel .travel-place { margin: 4px 0 2px; font: 800 clamp(24px, 4vw, 38px)/1.1 var(--display); color: var(--text); }
#travel .travel-meta { margin: 0 0 12px; font: 600 15px var(--body); color: var(--muted); }
.travel-map { border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--ink-line); overflow: hidden; }
#travel .travel-next { margin: 14px 0 6px; font: 800 18px var(--display); color: var(--text); opacity: 0; animation: fadeUp 0.4s ease-out 1.4s forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.travel-skip { margin: 0 auto; font-size: 14px; }
@media (max-height: 520px) {
  .travel-card { width: min(640px, calc(100vw - 32px), calc((100dvh - 150px) * 2.54)); }
  #travel .travel-place { font-size: 22px; }
  #travel .travel-next { margin-top: 6px; font-size: 15px; }
  #travel .travel-meta { margin-bottom: 6px; }
}

/* --- Oyun sonu ve menüde rota --- */
.gameover-card { width: min(620px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; }
.gameover-route { margin: 10px 0 14px; }
.gameover-route h3, .menu-route h3 { margin: 0 0 6px; font: 800 15px var(--display); color: var(--contour); text-align: left; }
.rm-pin { transform: scale(1.5); transform-box: fill-box; transform-origin: 50% 100%; }
.routemap.compact .rm-pin { transform: scale(2); }
.rm-flag.new .rm-pin { animation-name: rmDrop15; }
@keyframes rmDrop15 { from { transform: translateY(-40px) scale(0.6); opacity: 0; } to { transform: scale(1.5); } }
.menu-route { margin: 0 0 14px; }
.menu-route .routemap { box-shadow: 0 0 0 1px var(--ink-line); }

/* --- Başlık ekranı: günlük meydan okuma + rozet düğmeleri --- */
.btn-daily {
  display: flex; align-items: center; gap: 10px; flex: 1 1 100%; max-width: 460px;
  padding: 9px 14px; border-radius: 14px; cursor: pointer; text-align: left; color: var(--text);
  background: linear-gradient(135deg, rgba(255, 210, 63, 0.16), rgba(255, 138, 61, 0.12));
  border: 1.5px solid rgba(255, 210, 63, 0.55); transition: transform 0.08s, border-color 0.15s, background 0.15s;
}
.btn-daily:hover { border-color: #ffd23f; background: linear-gradient(135deg, rgba(255, 210, 63, 0.24), rgba(255, 138, 61, 0.18)); }
.btn-daily:active { transform: translateY(2px); }
.btn-daily.done { border-color: var(--ink-line); background: rgba(127, 181, 154, 0.08); }
.bd-icon { font-size: 26px; }
.bd-text { display: grid; flex: 1; min-width: 0; }
.bd-text b { font: 800 17px var(--display); }
.bd-text small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-streak { padding: 4px 10px; border-radius: 999px; background: rgba(255, 138, 61, 0.2); color: #ffc79f; font: 800 15px var(--display); white-space: nowrap; }
.bt-count { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: rgba(127, 181, 154, 0.18); font-size: 12px; color: var(--contour); }

/* --- Rozet bildirimi --- */
#trophy-toast {
  position: fixed; z-index: 95; top: calc(var(--et) + 64px); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; min-width: min(380px, calc(100vw - 32px)); max-width: calc(100vw - 32px);
  padding: 10px 18px 10px 10px; border-radius: 16px; pointer-events: none;
  background: var(--contours), var(--ink); color: var(--text); border: 2px solid var(--tc, #ffd23f);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55), 0 0 30px color-mix(in srgb, var(--tc, #ffd23f) 35%, transparent);
  animation: ttIn 0.5s cubic-bezier(.2, 1.5, .4, 1);
}
#trophy-toast.hidden { display: none; }
#trophy-toast.leave { animation: ttOut 0.45s ease-in forwards; }
@keyframes ttIn { from { transform: translate(-50%, -30px) scale(0.85); opacity: 0; } }
@keyframes ttOut { to { transform: translate(-50%, -24px); opacity: 0; } }
.tt-medal, .tr-medal {
  position: relative; flex: 0 0 auto; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--tl, #fff3b0), var(--tc, #ffd23f) 55%, var(--td, #b98a10));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 3px 8px rgba(0, 0, 0, 0.35);
}
.tt-medal span, .tr-medal span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(15, 42, 46, 0.88); }
.tt-medal { animation: ttSpin 0.9s ease-out; }
@keyframes ttSpin { from { transform: rotateY(180deg) scale(0.6); } }
.tt-text { display: grid; }
.tt-text small { color: var(--tc, #ffd23f); font: 800 12px var(--display); text-transform: uppercase; letter-spacing: 0.06em; }
.tt-text b { font: 800 19px var(--display); }
.tt-text span { color: var(--muted); font-size: 13px; }
.tier-bronze { --tc: #d08a4e; --tl: #f6c9a0; --td: #8a5228; }
.tier-silver { --tc: #c4ced6; --tl: #ffffff; --td: #7c8a95; }
.tier-gold { --tc: #ffd23f; --tl: #fff3b0; --td: #b98a10; }
.tier-locked { --tc: #50686a; --tl: #6f8587; --td: #2e4244; }

/* --- Rozet vitrini --- */
#trophies { z-index: 61; }
.trophies {
  width: min(980px, 100%); height: min(780px, calc(100dvh - 32px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); color: var(--paper-ink); border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 8px rgba(15, 42, 46, 0.9); animation: rise 0.18s ease-out;
}
.trophies .guide-header { flex-shrink: 0; }
.tr-summary { flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 20px; border-bottom: 1.5px solid #b7c9bc; }
.tr-sum-text { font-size: 15px; }
.tr-sum-text b { font: 800 18px var(--display); }
.tr-bar { flex: 1 1 160px; height: 10px; border-radius: 999px; background: #b9cbbd; overflow: hidden; }
.tr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #d08a4e, #ffd23f); border-radius: inherit; transition: width 0.5s; }
.tr-legend { display: flex; gap: 10px; font-size: 12px; font-weight: 700; }
.tr-legend span { color: var(--td); }
.tr-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 20px 22px; overscroll-behavior: contain; }
.tr-cat h3 { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; font: 800 18px var(--display); }
.tr-cat h3 span { margin-left: auto; font: 700 13px var(--body); color: #557067; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.tr-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; background: #eef3ee; border: 1.5px solid #b7c9bc; }
.tr-card.on { background: #f7faf6; border-color: var(--tc); box-shadow: 0 2px 0 color-mix(in srgb, var(--tc) 55%, transparent); }
.tr-card.off .tr-medal { filter: grayscale(1); opacity: 0.55; }
.tr-card .tr-medal { width: 48px; height: 48px; }
.tr-card .tr-medal span { width: 36px; height: 36px; font-size: 19px; }
.tr-info { flex: 1; min-width: 0; }
.tr-info b { font: 800 16px var(--display); }
.tr-info p { margin: 2px 0 6px; font-size: 13px; color: #36544e; line-height: 1.35; }
.tr-card.secret p { font-style: italic; }
.tr-pips { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: 2px; }
.tr-pips i { width: 10px; height: 10px; border-radius: 50%; background: #c3d1c6; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.tr-pips i.bronze { background: #d08a4e; }
.tr-pips i.silver { background: #c4ced6; }
.tr-pips i.gold { background: #ffd23f; }
.tr-prog { display: block; height: 7px; border-radius: 999px; background: #c9d6cc; overflow: hidden; }
.tr-prog i { display: block; height: 100%; border-radius: inherit; background: var(--flare); }
.tr-num { display: block; margin-top: 3px; font-size: 12px; font-weight: 700; color: #557067; }
.tr-num.done { color: #2d7a4a; }

/* --- Günlük sonuç kartı --- */
#daily-result { z-index: 52; }
.daily-card {
  width: min(900px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--contours), var(--ink); color: var(--text); border-radius: 20px; border: 1px solid var(--ink-line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6); animation: rise 0.25s ease-out;
}
.daily-card .guide-header { flex-shrink: 0; gap: 10px; }
.daily-card .guide-header h2 { font-size: 18px; }
.dc-tag { padding: 3px 10px; border-radius: 999px; font: 800 12px var(--display); white-space: nowrap; }
.dc-tag.ranked { background: rgba(63, 174, 106, 0.25); color: #a6e6bd; }
.dc-tag.practice { background: rgba(255, 210, 63, 0.18); color: #ffe08a; }
.dc-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 20px; }
.dc-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.dc-title { margin: 0 0 10px; font: 800 26px/1.1 var(--display); }
.dc-cells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.dc-cells li { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: rgba(127, 181, 154, 0.08); border: 1.5px solid var(--ink-line); text-align: center; min-width: 0; }
.dc-cells li.s3 { border-color: #3fae6a; background: rgba(63, 174, 106, 0.18); }
.dc-cells li.s2 { border-color: #d6b23a; background: rgba(214, 178, 58, 0.16); }
.dc-cells li.s1 { border-color: #d97c3a; background: rgba(217, 124, 58, 0.16); }
.dc-cells li.dead { border-color: var(--bad); background: rgba(217, 71, 63, 0.16); }
.dc-n { font: 800 13px var(--display); color: var(--muted); }
.dc-st { font-size: 13px; letter-spacing: -2px; min-height: 18px; }
.dc-cells small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dc-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-stats span { display: grid; justify-items: center; flex: 1 1 64px; padding: 6px 8px; border-radius: 12px; background: rgba(127, 181, 154, 0.08); }
.dc-stats b { font: 800 18px var(--display); }
.dc-stats small { font-size: 11px; color: var(--muted); }
.dc-stats .streak b { color: #ffc79f; }
.dc-map .routemap { box-shadow: 0 0 0 1px var(--ink-line); }
.dc-board { margin-top: 16px; }
.dc-board h4 { margin: 0 0 8px; font: 800 16px var(--display); color: var(--contour); }
.dc-board-list ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.dc-board-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 44px 52px 70px; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: rgba(127, 181, 154, 0.07); font-size: 14px; }
.dc-board-list li.me { background: rgba(255, 138, 61, 0.2); outline: 1.5px solid var(--flare); }
.dc-board-list .pos { font: 800 15px var(--display); text-align: center; }
.dc-board-list .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.dc-board-list .sv, .dc-board-list .tm { color: var(--muted); font-size: 13px; text-align: right; }
.dc-board-list b { text-align: right; font: 800 15px var(--display); }
.dc-board-list .me-row { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--ink-line); }
.dc-count, .dc-wait, .dc-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.dc-note { padding: 8px 12px; border-radius: 10px; background: rgba(255, 210, 63, 0.1); color: #ffe7a6; }
.dc-actions { flex-shrink: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--ink-line); background: rgba(8, 24, 27, 0.4); }
.dc-actions .btn-signal { width: auto; padding-inline: 24px; }
@media (max-width: 700px) {
  .dc-top { grid-template-columns: 1fr; }
  .dc-title { font-size: 21px; }
  .dc-body { padding: 12px 14px; }
  .dc-actions { flex-wrap: wrap; padding: 10px 14px; }
  .dc-actions > * { flex: 1 1 40%; }
  .dc-actions .btn-signal { flex-basis: 100%; }
  .dc-board-list li { grid-template-columns: 28px minmax(0, 1fr) 36px 60px; }
  .dc-board-list .tm { display: none; }
  .tr-grid { grid-template-columns: 1fr; }
  .tr-summary, .tr-body { padding-inline: 14px; }
  .daily-card .guide-header h2 { font-size: 15px; }
}

.daily-card:focus { outline: none; }
@media (max-width: 600px) {
  .rm-par-label { display: none; }
  .dc-actions .btn-ghost { white-space: nowrap; font-size: 14px; padding-inline: 8px; }
}

/* Non-modal learning guidance stays above the action bar and inside safe areas. */
.learning-coach {
  position: fixed; z-index: 45;
  left: max(12px, env(safe-area-inset-left));
  bottom: calc(86px + env(safe-area-inset-bottom));
  width: min(440px, calc(100vw - 24px));
  padding: 14px; border: 1px solid var(--sea);
  border-radius: 12px; background: var(--paper); color: var(--paper-ink);
  font-size: 14px; line-height: 1.5;
}
.learning-coach[hidden] { display: none; }
.learning-coach p { margin: 6px 0 10px; }
.learning-coach button { font-size: 13px; padding: 7px 10px; }
@media (max-width: 600px), (max-height: 550px) {
  .learning-coach { font-size: 12px; padding: 10px; max-height: 32vh; overflow-y: auto; }
}

/* Keep learning actions legible on the light instruction panel. */
.learning-coach .btn-ghost {
  color: var(--paper-ink);
  border-color: var(--paper-ink);
  background: transparent;
}
.learning-coach .btn-ghost:hover,
.learning-coach .btn-ghost:focus-visible {
  color: var(--paper);
  background: var(--paper-ink);
}


/* HUD panels participate in layout instead of relying on fixed top offsets.
   The middle track is the only space the learning card may occupy. */
#hud {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(6px, 1vw, 12px);
  padding: var(--et) var(--er) var(--eb) var(--el);
  height: 100%;
  height: 100dvh;
  box-sizing: border-box;
}
.hud-top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 290px) minmax(0, 520px) minmax(0, 180px);
  grid-template-areas: "vitals objective status";
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}
#hud .hud-top .panel {
  position: static;
  inset: auto;
  transform: none;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
#hud .vitals { grid-area: vitals; }
#hud .objective {
  grid-area: objective;
  width: min(520px, 100%);
  justify-self: center;
  overflow-wrap: anywhere;
}
.hud-status {
  grid-area: status;
  min-width: 0;
  display: grid;
  gap: 6px;
}
#hud .clock { justify-content: flex-end; }
#hud .clock-text { min-width: 0; }
#hud .clock-phase, #hud .weather-chip { overflow-wrap: anywhere; white-space: normal; }
#hud .obj-items { flex-wrap: wrap; }
#hud .hero-head > div { min-width: 0; }
#hud .hero-name { overflow-wrap: anywhere; }
#hud .meter { grid-template-columns: 20px 34px minmax(0, 1fr) 46px; }
#hud .meter-track { min-width: 0; }
#hud .penalty { white-space: normal; }

.hud-bottom {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}
#hud .hud-bottom .hotbar, #hud .hud-bottom .actions {
  position: static;
  inset: auto;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}
#hud .hud-bottom .actions { justify-self: end; justify-content: flex-end; }
#hud .hud-bottom .hotbar { justify-self: start; }
#hud .hud-bottom .slot-btn, #hud .hud-bottom .act { flex-shrink: 0; }

.hud-guidance {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  width: min(440px, 100%);
  pointer-events: none;
}
#hud .learning-coach {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  pointer-events: auto;
}
#hud .learning-coach[hidden] { display: none; }
#hud .learning-coach > div { grid-column: 1 / -1; min-height: 0; overflow-y: auto; }
#hud .learning-coach p { margin-bottom: 0; }
#hud .learning-coach button { min-width: 0; min-height: 36px; white-space: normal; }
#hud .learning-coach .btn-ghost { color: var(--paper-ink); border-color: var(--paper-ink); }
#hud .learning-coach .btn-ghost:hover,
#hud .learning-coach .btn-ghost:focus-visible { color: var(--paper); background: var(--paper-ink); }
#hud .vital-alert { top: calc(var(--hud-top-end, 180px) + 8px); }

/* The race timer occupies the same first-row slot as single-player vitals.
   Its measured height also reserves space when labels or fonts wrap. */
body.race-mode .hud-top::before {
  content: "";
  grid-area: vitals;
  height: var(--race-head-height, 100px);
}
body.race-mode .hud-bottom { grid-template-columns: 1fr; }
body.race-mode .race-status { width: min(210px, 52vw); box-sizing: border-box; }
body.race-mode .race-board-panel {
  top: calc(var(--hud-top-end, 180px) + 8px);
  max-height: max(0px, calc(var(--hud-bottom-start, 80dvh) - var(--hud-top-end, 180px) - 16px));
  width: min(250px, 44vw);
  box-sizing: border-box;
}

@media (max-width: 899px) {
  .hud-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 180px);
    grid-template-areas: "vitals status" "objective objective";
    gap: 8px;
  }
  #hud .vitals { width: min(290px, 100%); box-sizing: border-box; }
  #hud .objective .obj-hint { display: block; }
  #hud .hud-status { justify-self: end; width: min(180px, 100%); }
}
@media (max-width: 600px), (max-height: 520px) {
  #hud .meter { grid-template-columns: 18px minmax(0, 1fr) 38px; }
  #hud .meter-name { display: none; }
  #hud .hud-top { column-gap: 8px; }
  #hud .hud-status { width: min(150px, 100%); }
  #hud .vitals { width: min(230px, 100%); }
  #hud .learning-coach { padding: 10px; font-size: 12px; gap: 6px; }
}
@media (max-width: 420px) {
  .hud-top { grid-template-columns: minmax(0, 1fr) minmax(0, 120px); }
  #hud .vitals { padding: 7px 8px; }
  #hud .clock { padding: 6px; gap: 4px; }
  #hud .compass { width: 26px; height: 26px; flex-shrink: 0; }
  #hud .hud-bottom { gap: 6px; }
  #hud .hud-bottom .slot-btn { width: 44px; height: 44px; }
  #hud .hud-bottom .act { height: 44px; padding-inline: 10px; font-size: 14px; }
  #hud .rescued { padding-inline: 6px; }
}
@media (max-width: 360px) {
  #hud .hud-bottom .rescued { display: none; }
}
@media (max-height: 520px) and (min-width: 700px) {
  .hud-top {
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr) minmax(0, 150px);
    grid-template-areas: "vitals objective status";
  }
  #hud .objective .obj-hint { display: none; }
}


/* Compact tablet HUD. Keep the map visible in both orientations. */
@media (min-width: 601px) and (max-width: 1100px),
       (min-width: 601px) and (pointer: coarse),
       (min-width: 601px) and (hover: none) {
  #hud .vitals { width: min(250px, 100%); padding: 8px 10px; border-radius: 13px; }
  #hud .hero-head { gap: 8px; margin-bottom: 4px; }
  #hud #hud-portrait { width: 30px; height: 30px; }
  #hud .hero-name { font-size: 14px; }
  #hud .hero-head .region { font-size: 11px; margin-bottom: 0; line-height: 1.25; }
  #hud .meter { grid-template-columns: 16px 24px minmax(0, 1fr) 38px; gap: 5px; margin: 4px 0; }
  #hud .meter-name, #hud .meter-icon, #hud .meter-value { font-size: 12px; }
  #hud .meter-name { display: inline; }
  #hud .meter-track { height: 8px; }
  #hud .penalty { margin-top: 6px; padding: 4px 6px; font-size: 11px; gap: 4px; }
  #hud .objective { width: min(430px, 100%); padding: 8px 10px; border-radius: 13px; }
  #hud .obj-title { font-size: 14px; }
  #hud .obj-items { gap: 4px; margin: 6px 0 4px; }
  #hud .obj-items li { font-size: 12px; gap: 4px; padding: 2px 6px; }
  #hud .obj-hint { font-size: 12px; line-height: 1.35; }
  #hud .hud-status { width: min(150px, 100%); justify-self: end; }
  #hud .clock { padding: 7px 8px; gap: 7px; border-radius: 13px; }
  #hud .clock-time { font-size: 19px; }
  #hud .clock-phase { font-size: 11px; line-height: 1.25; }
  #hud .compass { width: 30px; height: 30px; flex-shrink: 0; }
  #hud .hud-bottom .slot-btn { width: 48px; height: 48px; border-radius: 12px; }
  #hud .slot-emoji { font-size: 23px; }
  #hud .rescued { padding: 5px 9px; border-radius: 12px; }
  #hud .rescued span { font-size: 21px; }
  #hud .rescued b { font-size: 17px; }
  #hud .rescued small { font-size: 11px; }
  #hud .hud-bottom .act { height: 48px; padding: 0 11px; font-size: 14px; border-radius: 12px; }
  #hud .act span { font-size: 20px; }
  #hud .weather-chip { padding: 5px 8px; font-size: 11px; }
  #hud .learning-coach { padding: 10px; font-size: 12px; }
}
/* Wide tablets keep all three panels in one short row. */
@media (min-width: 900px) and (max-width: 1100px),
       (min-width: 900px) and (pointer: coarse),
       (min-width: 900px) and (hover: none) {
  #hud .hud-top {
    grid-template-columns: minmax(0, 250px) minmax(0, 430px) minmax(0, 150px);
    grid-template-areas: "vitals objective status";
    gap: 8px;
  }
}
/* Preserve the narrow-screen 2-row layout and its measured overlap protection. */
@media (min-width: 601px) and (max-width: 899px) and (min-height: 521px) {
  #hud .hud-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 150px);
    grid-template-areas: "vitals status" "objective objective";
  }
}

/* Profile and settings: safe-area aware dialog with intrinsic scrolling. */
#player-hub { z-index: 61; padding: max(12px, var(--sat)) max(12px, var(--sar)) max(12px, var(--sab)) max(12px, var(--sal)); }
.player-hub-card { width: min(560px, 100%); max-height: 100%; overflow-y: auto; overscroll-behavior: contain; background: #102e33; color: #edf5ef; border: 1px solid #497278; border-radius: 22px; padding: clamp(16px, 4vw, 28px); box-shadow: 0 20px 80px #0008; }
.hub-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hub-header h2 { margin: 0; font: 800 clamp(22px, 5vw, 30px)/1.15 var(--display); }
.hub-header button { flex-shrink: 0; min-width: 44px; min-height: 44px; }
.hub-identity { display: flex; align-items: center; gap: 20px; }
.hub-identity canvas { width: 90px; height: 120px; flex-shrink: 0; image-rendering: pixelated; background: #dce8d4; border-radius: 18px; }
.hub-identity h3 { margin: 0 0 8px; overflow-wrap: anywhere; }
.hub-identity p, .hub-note { font-size: 14px; opacity: .78; line-height: 1.5; }
.hub-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.hub-stats > * {
  min-width: 0; background: #ffffff0b; border: 1px solid #ffffff25; border-radius: 12px;
  padding: 10px 8px; margin: 0; text-align: center; font-size: 14px; color: inherit; overflow-wrap: anywhere;
}
.hub-stats strong { display: block; margin-top: 3px; color: #f0f7ee; font-size: 21px; }
.hub-stats .hub-coins { background: #ffd35d13; border-color: #cca95575; }
.hub-stats .hub-coins strong { color: #ffdb79; }
.hub-stats button { min-height: 54px; border-color: #72968c; font-weight: 700; cursor: pointer; }
.hub-stats button:hover { background: #285256; }
.hub-badge-icons { min-height: 19px; font-size: 15px; }
.hub-badge-icons:empty { display: none; }
.hub-settings-actions { display: grid; gap: 8px; margin-top: 16px; }
.hub-settings-actions button { min-height: 44px; }
.hub-quest { margin: 12px 0; padding: 10px; border: 1px solid #74b4b4; border-radius: 12px; background: #153d42; }
.hub-quest h3 { margin: 0; font-size: 17px; }
.hub-quest p { margin: 6px 0; color: #cfe7df; }
.hub-quest button { min-height: 44px; }
.journal-cards { display: grid; gap: 7px; margin: 12px 0; }
.journal-cards details { background: #193d40; border: 1px solid #577a74; border-radius: 10px; padding: 0 10px; }
.journal-cards summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 700; }
.journal-cards ul { margin: 2px 0 12px; padding-left: 22px; color: #c5ded1; font-size: 14px; }
#hub-journal-back { min-height: 44px; }
#hub-speech { font-size: clamp(17px, 4vw, 20px); line-height: 1.65; }
.hub-tip { padding: 14px; border-left: 3px solid #8bd2d5; background: #8bd2d510; line-height: 1.6; }
.shadow-guide { border: 2px solid #df9b35; background: #f6e7bb; color: #19373a; border-radius: 14px; padding: 12px; margin-block: 16px; }
.shadow-guide summary { font-size: 17px; font-weight: 800; color: #70410a; min-height: 44px; cursor: pointer; }
.shadow-steps { padding-left: 22px; line-height: 1.6; margin-block: 10px; }
.shadow-calculator { display: grid; gap: 8px; border-radius: 10px; padding: 12px; background: #fff8; }
.shadow-calculator label { font-weight: 700; }
.shadow-calculator input { width: 100%; min-width: 0; min-height: 44px; padding: 10px; border: 1px solid #8b7856; border-radius: 8px; background: #fffef7; color: #19373a; font-size: 18px; }
.shadow-calculator output { font-size: 17px; font-weight: 800; color: #295c42; }
.shadow-guide .ruler { overflow-x: auto; }
@media (max-width: 380px) {
  .hub-slider { grid-template-columns: 76px minmax(0, 1fr) 38px; gap: 6px; font-size: 14px; }
  .hub-stats strong { font-size: 16px; }
}

.shadow-help { margin: 0; font-size: 13px; line-height: 1.5; }
#shadow-load { min-height: 44px; white-space: normal; color: #19373a; border-color: #8b7856; background: #fff8; font-size: 13px; }
#shadow-load:disabled { opacity: .6; cursor: default; }

/* Explorer Market: navigation stays visible while the catalog scrolls. */
#player-hub.hub-shop-open {
  --shop-gutter: clamp(12px, 4vw, 42px);
  --shop-left: max(var(--shop-gutter), var(--sal), calc((100% - 1280px) / 2));
  --shop-right: max(var(--shop-gutter), var(--sar), calc((100% - 1280px) / 2));
  display: block;
  padding: 0;
}
.hub-shop-open .player-hub-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #0b2025;
}
.hub-shop-open .hub-header {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: clamp(8px, 2vw, 18px);
  padding: max(16px, var(--sat)) var(--shop-right) 10px var(--shop-left);
  margin: 0;
  background: radial-gradient(ellipse at top left, #254848, #122d33 66%);
}
.hub-shop-open .hub-header h2 {
  font-size: clamp(22px, 4vw, 36px);
  letter-spacing: -.025em;
}
.hub-shop-open #hub-shop { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hub-shop-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hub-shop-links button { min-height: 44px; }

.shop-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #9a794d;
  border-radius: 12px;
  background: #332c24;
  color: #ffdfa4;
  white-space: nowrap;
}
.shop-balance div { display: grid; line-height: 1.12; }
.shop-balance div span { color: #e4cdac; font-size: 11px; }
.shop-balance b { font: 800 20px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.shop-coin-icon { font-size: 20px; }
.shop-nav {
  flex: none;
  min-width: 0;
  padding-inline: var(--shop-left) var(--shop-right);
  padding-bottom: 12px;
  border-bottom: 1px solid #304a4c;
  background: #122d33;
}
.shop-views { display: flex; gap: 14px; margin-bottom: 10px; border-bottom: 1px solid #355259; }
.shop-views button {
  padding: 7px 10px;
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #bad2cb;
  cursor: pointer;
  font-weight: 700;
}
.shop-views button:hover { color: #f4f6ee; }
.shop-views button[aria-pressed="true"] { border-bottom-color: #e2b470; color: #ffe4b7; }
.shop-categories { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.shop-categories button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 48px;
  padding: 6px;
  border: 1px solid #3b5960;
  border-radius: 10px;
  background: #19373d;
  color: #dcece4;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}
.shop-categories button:hover { border-color: #8eb5ad; }
.shop-categories button[aria-pressed="true"] { background: #c2ded2; border-color: #e2f0db; color: #152f2f; }
.shop-category-icon { font-size: 17px; flex-shrink: 0; }

.shop-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #627f7b #0b2025;
  scrollbar-width: thin;
  padding: clamp(14px, 3vw, 28px) var(--shop-right) max(20px, var(--sab)) var(--shop-left);
}
.shop-list-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.shop-list-heading h3 { margin: 0; color: #edf6ef; font: 800 clamp(19px, 3vw, 26px)/1.2 var(--display); }
.shop-count, .shop-earn { color: #afc8c1; font-size: 13px; }
.shop-earn { margin: 5px 0 0; }
.shop-status {
  flex: none;
  margin: 0;
  padding: 8px var(--shop-right) max(8px, var(--sab)) var(--shop-left);
  background: #242e28;
  color: #ffdf9c;
  border-top: 1px solid #646246;
  font-size: 14px;
}
.shop-status:empty { padding: 0; border: 0; }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 205px), 1fr));
  gap: clamp(9px, 1.7vw, 18px);
  margin-top: 14px;
}
.shop-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid #344f52;
  border-radius: 15px;
  overflow: hidden;
  background: #142f34;
}
.shop-item.shop-equipped { border-color: #8ebda1; }
.shop-preview {
  display: grid;
  place-items: center;
  min-height: 148px;
  padding: 10px 0;
  border-bottom: 1px solid #53736a56;
  background:
    repeating-linear-gradient(90deg, transparent 0 23px, #d5ede611 24px 25px),
    repeating-linear-gradient(0deg, transparent 0 23px, #d5ede611 24px 25px),
    radial-gradient(ellipse at 50% 30%, var(--item-color), #153739 87%);
}
.shop-preview canvas { width: 99px; height: 121px; image-rendering: pixelated; }
.shop-preview-pad > span:first-child {
  display: grid;
  place-items: center;
  width: 62px;
  height: 88px;
  border: 2px solid #e8d2ae;
  border-left: 6px solid #eee0ba;
  border-radius: 7px;
  background: var(--item-color);
  box-shadow: 3px 4px 0 #111a17;
  font-size: 26px;
  transform: rotate(-8deg);
}
.shop-item-body { display: flex; flex-direction: column; flex: 1; padding: 12px; }
.shop-item h4 { margin: 0; font: 800 17px/1.2 var(--display); }
.shop-item p { margin: 5px 0 12px; color: #bdcfc9; font-size: 13px; line-height: 1.4; }
.shop-item-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.shop-price { color: #ffdb96; font-size: 14px; font-weight: 700; white-space: nowrap; }
.shop-equipped .shop-price { color: #b6e9c8; }
.shop-action {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #e2b470;
  color: #252618;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}
.shop-action:hover:not(:disabled) { background: #f2cd91; }
.shop-action[data-action="equip"] { background: #a7cfbd; color: #18312b; }
.shop-action[data-action="equip"]:hover:not(:disabled) { background: #c1e5d4; }
.shop-action:disabled { border-color: #38565b; background: #19363c; color: #c0d0c9; cursor: default; }
.shop-empty { grid-column: 1 / -1; text-align: center; padding: clamp(16px, 4vw, 40px); border: 1px dashed #456065; border-radius: 14px; color: #c4d7d0; }
.shop-empty > span { font-size: 28px; }
.shop-empty h4 { margin: 5px 0; color: #f2f7f0; }
.shop-empty p { margin: 0 0 14px; }

@media (max-width: 699px) {
  .shop-categories { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .shop-categories button { min-height: 44px; font-size: 12px; gap: 4px; }
  .shop-category-icon { font-size: 15px; }
}
@media (max-width: 480px) {
  .hub-shop-open .hub-header { padding-top: max(10px, var(--sat)); }
  .shop-balance { gap: 4px; padding-inline: 6px; }
  .shop-coin-icon { font-size: 15px; }
  .shop-views { gap: 8px; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-preview { min-height: 112px; }
  .shop-preview canvas { width: 72px; height: 88px; }
  .shop-item-body { padding: 9px; }
  .shop-item h4 { font-size: 15px; }
  .shop-item-footer { align-items: stretch; flex-direction: column; }
}
@media (max-height: 500px) and (min-width: 540px) {
  .hub-shop-open .hub-header { padding-top: max(6px, var(--sat)); padding-bottom: 3px; }
  .hub-shop-open .hub-header h2 { font-size: 23px; }
  .shop-views { margin-bottom: 5px; }
  .shop-nav { padding-bottom: 6px; }
  .shop-categories { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .shop-categories button { min-height: 44px; }
  .shop-scroll { padding-top: 10px; }
  .shop-preview { min-height: 112px; }
  .shop-preview canvas { width: 72px; height: 88px; }
}
.pad-result .shop-quest-reward {
  width: fit-content; max-width: 100%; border: 1px solid #97732e; border-radius: 8px;
  padding: 5px 9px; margin: 6px 0 0; color: #583604; background: #ffedbb; font-weight: 700;
}
#pad[data-cover="dune-pad"] .pad-header { background: linear-gradient(120deg, #5d2b19, #984d27); color: #fff1d2; }
#pad[data-cover="aurora-pad"] .pad-header { background: linear-gradient(120deg, #40265d, #145e5e); color: #f5eeff; }
#pad[data-cover="dune-pad"] .pad-location,
#pad[data-cover="aurora-pad"] .pad-location { color: inherit; }

.creator-shop-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.shop-preview-pad[data-cover="atlas-pad"] > span:first-child,
#pad[data-cover="atlas-pad"] .pad-header {
  background-color: #284e78;
  background-image: repeating-linear-gradient(0deg, transparent 0 11px, #8cd0e64a 12px 13px),
    repeating-linear-gradient(90deg, transparent 0 17px, #8cd0e64a 18px 19px);
  color: #eaf9ff;
}
#pad[data-cover="atlas-pad"] .pad-location { color: inherit; }
