/* =====================================================================
   ui.css - Uygulama kabuğu, menüler, kartlar, tablolar, modallar
   ===================================================================== */

/* Uygulama kabugu: kesin yukseklikli flex sutun.
   ESKIDEN `min-height:100%` idi -> .app viewport'tan buyuk olabiliyor,
   body `overflow:hidden` ile kirpiyor ve #screens'in yukseklik kisiti
   olmadigi icin hicbir sey kaymiyordu. Telefonda ana menunun alt
   kirpilmasi bu yuzden oluyordu.
   SIMDI: .app = viewport yuksekligi, #screens = TEK kaydirma kabugu.
   --appbar-h: .appbar'in gercek yuksekligi (safe-area haric):
   safe-t + 10px ust + 40px icerik + 10px alt = 60px.
   padding-bottom: tabbar icin ayrilan yer. Tabbar gercek yuksekligi
   = 6px ust + (7+20+3+13+7) icerik + 6px alt = 62px; 84px bosa yer
   birakir, son icerik satiri tabbarin arkasinda kalmaz. */
.app {
  --appbar-h: 60px;
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(0, 229, 255, 0.13), transparent 62%),
    radial-gradient(900px 600px at 8% 108%, rgba(124, 77, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #070b14 0%, #05070d 60%, #04060b 100%);
  padding-bottom: calc(var(--safe-b) + 84px);
}
/* JS `$('#app').hidden = true/false` ile gosteriyor. `.app{display:flex}`
   UA'nin `[hidden]{display:none}` kuralini yendigi icin kabuk once de
   her zaman gorunurdu; loading ekrani maske ediyordu. */
.app[hidden] { display: none; }

.app::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px);
  opacity: 0.6;
  z-index: 0;
}
.app > * { position: relative; z-index: 1; }

/* --------------------------------------------------------------- header */
/* sticky -> relative: .app artik kaydirmayan bir flex kap, bu yuzden
   sticky burada zaten etkisizdi. .appbar #screens'in DISINDA oldugu icin
   kaydirma sirasinda baslik hiçbir zaman kaymaz; arkasindaki dolgu
   (gradient) bunu bultona benzer kesintisiz bir bant yapiyor. */
.appbar {
  position: relative;
  flex: 0 0 auto;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-t) + 10px) max(14px, 3vw) 10px;
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.96), rgba(7, 11, 20, 0.72) 70%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.appbar-back {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-line);
  font-size: 1.15rem;
  transition: transform 0.14s, background 0.18s;
}
.appbar-back:hover { transform: translateX(-3px); background: rgba(255, 255, 255, 0.1); }
.appbar-title { font-size: 1.15rem; letter-spacing: 0.1em; font-weight: 700; }
.appbar-sub { font-size: 0.72rem; color: var(--txt-2); letter-spacing: 0.1em; }
.appbar-spacer { flex: 1; }

.currency {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-line);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.85rem;
}
.currency .ic { font-size: 0.95rem; }
.currency.xp { color: var(--neon); }
.currency.coin { color: var(--gold); }
.currency.bump { animation: bump 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* --------------------------------------------------------------- layout */
.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 0 max(14px, 3vw); }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.mt { margin-top: var(--gap); }
.mb { margin-bottom: var(--gap); }
.section-title {
  font-family: var(--font);
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  color: var(--txt-2);
  text-transform: uppercase;
  margin: 22px 0 10px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--glass-line-strong), transparent); }

/* --------------------------------------------------------------- kartlar */
.card {
  position: relative;
  border-radius: var(--r-lg);
  padding: 18px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-2), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.card-title { font-size: 1.05rem; letter-spacing: 0.06em; margin-bottom: 4px; }
.card-desc { color: var(--txt-2); font-size: 0.85rem; line-height: 1.5; }
.card-click { cursor: pointer; transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.2s, border-color 0.2s; }
.card-click:hover { transform: translateY(-4px); border-color: rgba(0, 229, 255, 0.4); box-shadow: var(--sh-3), 0 0 30px rgba(0, 229, 255, 0.14); }
.card-click:active { transform: translateY(-1px) scale(0.995); }
.card-glow::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 130%;
  background: radial-gradient(60% 60% at 50% 40%, rgba(0, 229, 255, 0.18), transparent 70%);
  pointer-events: none;
}

/* ------------------------------------------------------------ ana ekran */
.hero {
  position: relative;
  min-height: 300px;
  border-radius: var(--r-xl);
  overflow: hidden;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-3);
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgba(4, 6, 12, 0.94) 6%, rgba(4, 6, 12, 0.55) 45%, rgba(4, 6, 12, 0.2));
}
.hero-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.3em; color: var(--neon);
  text-transform: uppercase; margin-bottom: 6px;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.5);
}
.hero h1 {
  font-size: clamp(1.6rem, 5.4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.hero p { color: var(--txt-1); font-size: 0.92rem; margin: 0 0 16px; max-width: 46ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* menü ızgarası */
.menu-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }
.menu-tile {
  position: relative;
  border-radius: var(--r-lg);
  padding: 16px 14px;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-1);
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.2s, border-color 0.2s;
}
.menu-tile::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 100% 0%, var(--tile-glow, rgba(0, 229, 255, 0.22)), transparent 62%);
  opacity: 0;
  transition: opacity 0.24s;
  pointer-events: none;
}
.menu-tile:hover { transform: translateY(-4px) scale(1.015); box-shadow: var(--sh-3); border-color: rgba(255, 255, 255, 0.2); }
.menu-tile:hover::after { opacity: 1; }
.menu-tile:active { transform: translateY(-1px) scale(0.99); }
.menu-tile .ic { font-size: 1.9rem; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5)); }
.menu-tile .t { font-family: var(--font); font-weight: 700; font-size: 0.98rem; letter-spacing: 0.07em; }
.menu-tile .s { font-size: 0.72rem; color: var(--txt-2); }
.menu-tile .badge {
  position: absolute; top: 10px; right: 10px;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: var(--red); color: #fff;
  font-size: 0.66rem; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 0 14px rgba(255, 61, 87, 0.6);
  animation: pulseGlow 1.6s infinite;
}

/* ------------------------------------------------------------ alt navigasyon */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  padding: 6px max(8px, 2vw) calc(var(--safe-b) + 6px);
  background: linear-gradient(0deg, rgba(6, 9, 16, 0.98), rgba(6, 9, 16, 0.85));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--glass-line);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px;
  border-radius: 14px;
  color: var(--txt-2);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  position: relative;
  transition: color 0.2s, background 0.2s, transform 0.14s;
}
.tab .ic { font-size: 1.25rem; transition: transform 0.22s cubic-bezier(0.2, 1.4, 0.4, 1); }
.tab.active { color: var(--neon); background: rgba(0, 229, 255, 0.09); }
.tab.active .ic { transform: translateY(-2px) scale(1.14); filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.6)); }
.tab:active { transform: scale(0.94); }
.tab .dot {
  position: absolute; top: 5px; right: 50%; margin-right: -18px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

/* --------------------------------------------------------------- listeler */
.list { display: flex; flex-direction: column; gap: 8px; }
/* #setKeys bir <dl class="list">. Tarayici varsayilani olarak dl'ye
   1em dikey, dt/dd'ye 40px sol kenar boslugu veriyordu. */
.list:is(dl, ul, ol) { list-style: none; margin: 0; padding: 0; }
/* dt/dd art arda gelip "ANAHTAR | DEGER" satirlari olusturur. */
dl.list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
}
dl.list > dt {
  min-width: 0;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-line);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--txt-2);
  word-break: break-word;
}
dl.list > dd {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.26);
  font-family: var(--font-num);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--neon);
  text-align: center;
  white-space: nowrap;
}
/* .row-item buton olarak kullanildiginda (data-go / aria-* ile) tam
   genislik alip sola yaslanmali. */
.row-item {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-line);
  transition: transform 0.14s, background 0.18s, border-color 0.18s;
  cursor: pointer;
}
.row-item:hover { transform: translateX(4px); background: rgba(255, 255, 255, 0.07); border-color: rgba(0, 229, 255, 0.3); }
.row-item .ic { font-size: 1.4rem; width: 34px; text-align: center; flex: 0 0 auto; }
.row-item .main { flex: 1; min-width: 0; }
.row-item .t { font-family: var(--font); font-weight: 700; letter-spacing: 0.04em; }
.row-item .s { font-size: 0.75rem; color: var(--txt-2); }
.row-item .end { text-align: right; font-size: 0.78rem; color: var(--txt-2); }
.row-item.locked { opacity: 0.45; }

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--txt-2);
  font-size: 0.88rem;
  border: 1px dashed var(--glass-line);
  border-radius: var(--r-md);
}
.empty .ic { font-size: 2.2rem; display: block; margin-bottom: 8px; opacity: 0.5; }

/* --------------------------------------------------------------- tablolar */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--glass-line); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.84rem; min-width: 520px; }
table.data th, table.data td { padding: 9px 10px; text-align: center; white-space: nowrap; }
table.data thead th {
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--txt-2);
  text-transform: uppercase;
  position: sticky; top: 0;
}
table.data tbody tr { border-top: 1px solid rgba(255, 255, 255, 0.05); transition: background 0.15s; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.045); }
table.data tbody tr.me { background: rgba(0, 229, 255, 0.1); box-shadow: inset 3px 0 0 var(--neon); }
table.data td.l, table.data th.l { text-align: left; }
table.data td.r, table.data th.r { text-align: right; }
table.data .num { font-family: var(--font-num); font-weight: 700; }
table.data .pos-1 { color: var(--gold); font-weight: 800; }
table.data .pos-2 { color: #cfd8dc; font-weight: 800; }
table.data .pos-3 { color: #d7a86e; font-weight: 800; }
table.data .zone-ucl { box-shadow: inset 0 -2px 0 #4caf50; }
table.data .zone-rel { box-shadow: inset 0 -2px 0 #ff9800; }
table.data .zone-releg { box-shadow: inset 0 -2px 0 #f44336; }

/* takım rozeti */
.team-chip { display: inline-flex; align-items: center; gap: 8px; }
.team-chip .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; box-shadow: 0 0 8px currentColor; }
.crest { display: block; width: 30px; height: 30px; flex: 0 0 auto; }
.crest.lg { width: 54px; height: 54px; }
.crest.xl { width: 84px; height: 84px; }

/* --------------------------------------------------------------- profil */
.profile-card {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--glass-line);
  box-shadow: var(--sh-3);
}
.profile-card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 120px;
  background:
    radial-gradient(600px 200px at 20% 0%, rgba(0, 229, 255, 0.25), transparent 70%),
    radial-gradient(400px 200px at 90% 10%, rgba(124, 77, 255, 0.28), transparent 70%);
}
.profile-inner { position: relative; }
.profile-top { display: flex; align-items: center; gap: 16px; margin-top: 40px; flex-wrap: wrap; }
.profile-top > div { min-width: 0; }
.profile-name { font-family: var(--font); font-size: clamp(1.15rem, 4.6vw, 1.5rem); font-weight: 800; letter-spacing: 0.04em; line-height: 1.2; overflow-wrap: anywhere; }
.avatar {
  width: 78px; height: 78px; border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--sh-2);
  overflow: hidden;
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.avatar canvas { width: 100%; height: 100%; }
.avatar.lg { width: 108px; height: 108px; border-radius: 30px; }
.profile-name { font-family: var(--font); font-size: 1.5rem; font-weight: 800; letter-spacing: 0.04em; }
.level-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  background: linear-gradient(135deg, var(--neon), var(--neon-2));
  color: #04121a; font-weight: 800; font-size: 0.74rem;
}
.xp-track { height: 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); overflow: hidden; margin-top: 8px; border: 1px solid var(--glass-line); }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--neon), var(--neon-2)); box-shadow: 0 0 14px rgba(0, 229, 255, 0.5); transition: width 0.5s cubic-bezier(0.2, 0.9, 0.3, 1); }
.stat-mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 10px; margin-top: 16px; }
.stat-mini {
  border-radius: var(--r-md);
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-line);
  text-align: center;
}
.stat-mini .v { font-family: var(--font-num); font-size: 1.4rem; font-weight: 800; line-height: 1; }
.stat-mini .l { font-size: 0.62rem; letter-spacing: 0.12em; color: var(--txt-2); text-transform: uppercase; margin-top: 3px; }

/* ilerleme çubukları (stat dağıtımı) */
.stat-bar-row { display: grid; grid-template-columns: 96px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 9px; }
.stat-bar-row .lbl { font-size: 0.74rem; color: var(--txt-1); letter-spacing: 0.04em; }
.stat-bar-row .track { height: 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); overflow: hidden; border: 1px solid var(--glass-line); position: relative; }
.stat-bar-row .fill { height: 100%; background: linear-gradient(90deg, var(--neon), var(--neon-2)); transition: width 0.4s; }
.stat-bar-row .val { font-family: var(--font-num); font-weight: 800; text-align: right; }
.plus-btn {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(0, 229, 255, 0.16);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: var(--neon);
  font-weight: 800;
  display: grid; place-items: center;
  transition: transform 0.12s, background 0.2s;
}
.plus-btn:hover { background: rgba(0, 229, 255, 0.3); }
.plus-btn:active { transform: scale(0.9); }
.plus-btn:disabled { opacity: 0.3; pointer-events: none; }

/* --------------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(3, 5, 10, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center;
  padding: 16px;
  animation: fadeIn 0.22s both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(480px, 94vw);
  max-height: 88vh; overflow: auto;
  border-radius: var(--r-lg);
  padding: 22px;
  animation: popIn 0.3s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.modal h3 { letter-spacing: 0.1em; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* ------------------------------------------------- kritik hata bandi
   JS bunu <body> sonuna enjekte eder:
   <div class="fatal-banner"><b>title</b><span>detail</span><button>action</button></div>
   z-90: .loading-screen (70) ve .game-stage (60) uzerinde, .modal (90)
   ile ayni katmanda. Tam genislik, appbar gibi sabit durur. */
.fatal-banner {
  position: fixed;
  top: calc(var(--safe-t) + 10px);
  left: 0;
  right: 0;
  z-index: 90;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px max(14px, 3vw) 15px;
  max-height: calc(100vh - var(--safe-t) - var(--safe-b) - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(30, 8, 14, 0.97);
  border: 1px solid var(--red);
  border-top-width: 0;
  box-shadow: var(--sh-3), 0 0 34px rgba(255, 61, 87, 0.3);
  color: #fff;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: slideUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.fatal-banner b {
  display: block;
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.25;
  color: #ff8a9a;
}
.fatal-banner span {
  display: block;
  width: 100%;
  font-family: var(--font-num);
  font-size: 0.76rem;
  line-height: 1.5;
  color: #ffd9de;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.fatal-banner button {
  align-self: flex-start;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--glass-line-strong);
  color: var(--txt-0);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.fatal-banner button:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(0, 229, 255, 0.55); }
.fatal-banner button:active { transform: scale(0.97); }
/* data-type="warn" sarı tonu; error varsayılan. */
.fatal-banner[data-type='warn'] {
  background: rgba(34, 24, 6, 0.97);
  border-color: var(--gold);
  box-shadow: var(--sh-3), 0 0 34px rgba(255, 202, 40, 0.26);
}
.fatal-banner[data-type='warn'] b { color: var(--gold); }
.fatal-banner[data-type='warn'] span { color: #ffe9b8; }


/* --------------------------------------------------------------- toast
   Konum: altta, tabbar'in (z-40) USTUNDE ve ondan uzak -> bottom
   84px(tabbar yuku) + 8px bosluk = 92px. z-80: appbar(30) ve
   tabbar(40) uzerinde, game-stage(60) uzerinde; modal(90) ve
   fatal-banner(90) ALTINDA kalir.
   pointer-events: yigin kaplari `none` -> aralarindaki bosluk sayfayi
   engellemez; her `.toast` ve `.toast-action` `auto` -> dokunulabilir. */
.toast-stack {
  position: fixed;
  bottom: calc(var(--safe-b) + 92px);
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  padding: 0 max(12px, 3vw);
}
.toast {
  pointer-events: auto;
  width: min(360px, 86vw);
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(14, 20, 32, 0.94);
  border: 1px solid var(--glass-line-strong);
  box-shadow: var(--sh-3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: slideIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  font-size: 0.86rem;
  line-height: 1.4;
}
.toast.out { animation: toastOut 0.28s forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast .ic { font-size: 1.15rem; line-height: 1.2; flex: 0 0 auto; }
.toast.error { border-color: rgba(255, 61, 87, 0.5); }
.toast.error .ic { color: var(--red); }
.toast.success { border-color: rgba(0, 230, 118, 0.4); }
.toast.success .ic { color: var(--green); }
.toast.info .ic { color: var(--neon); }
.toast.warn .ic { color: var(--orange); }

/* Hata/uyari ve JS'in isaretledigi `data-sticky` toast'lar:
   - asla kendiliginden kapanmaz (CSS'te otomatik gizleme animasyonu yok)
   - `.out` eklense bile tam gorunur kalir
   - tam opak, yuksek kontrast (arka plan sayfadan okunmaz) */
.toast.error,
.toast.warn,
.toast[data-sticky] {
  background: rgba(18, 11, 20, 0.99);
  border-color: rgba(255, 61, 87, 0.65);
  color: #fff;
  opacity: 1;
  animation: toastIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  animation-iteration-count: 1;
}
.toast.warn[data-sticky],
.toast.warn { border-color: rgba(255, 138, 61, 0.6); }
.toast.error span,
.toast.warn span,
.toast[data-sticky] span { color: #fff; word-break: break-word; overflow-wrap: anywhere; }
.toast.error.out,
.toast.warn.out,
.toast[data-sticky].out { animation: none; opacity: 1; transform: none; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* Toast icindeki aksiyon dugmesi (JS istege bagli ekler). */
.toast-action {
  pointer-events: auto;
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--glass-line-strong);
  color: var(--txt-0);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.toast-action:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(0, 229, 255, 0.5); }
.toast-action:active { transform: scale(0.96); }


/* --------------------------------------------------------------- takım seçimi */
.team-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
.team-card {
  position: relative;
  border-radius: var(--r-lg);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.24s, border-color 0.24s;
}
.team-card::before {
  content: '';
  position: absolute; inset: auto -30% -60% -30%; height: 130%;
  background: radial-gradient(60% 60% at 50% 100%, var(--tc, #1e88e5), transparent 68%);
  opacity: 0.4;
  transition: opacity 0.3s, transform 0.4s;
}
.team-card:hover { transform: translateY(-5px); box-shadow: var(--sh-3); border-color: var(--tc); }
.team-card:hover::before { opacity: 0.75; transform: translateY(-10%) scale(1.1); }
.team-card.selected { border-color: var(--tc); box-shadow: 0 0 0 2px var(--tc), 0 0 30px var(--tc); }
.team-card.selected::after {
  content: '✓';
  position: absolute; top: 8px; right: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--tc);
  color: #fff; font-weight: 800; font-size: 0.8rem;
  display: grid; place-items: center;
  animation: popIn 0.3s both;
}
.team-card canvas.crest { margin: 0 auto 6px; }
.team-card .tname { font-family: var(--font); font-weight: 700; font-size: 0.86rem; letter-spacing: 0.03em; }
.team-card .tcity { font-size: 0.68rem; color: var(--txt-2); }
.rating-strip { display: flex; flex-direction: column; gap: 3px; margin-top: 9px; }
.rating-strip .r { display: grid; grid-template-columns: 34px 1fr 18px; gap: 5px; align-items: center; font-size: 0.58rem; color: var(--txt-2); letter-spacing: 0.06em; }
.rating-strip .r .t { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.rating-strip .r .t i { display: block; height: 100%; background: var(--tc); }

/* --------------------------------------------------------------- görevler */
.mission-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-line);
  transition: border-color 0.2s, background 0.2s;
}
.mission-card.done { border-color: rgba(0, 230, 118, 0.45); background: rgba(0, 230, 118, 0.07); }
.mission-card.claimed { opacity: 0.55; }
.mission-ic {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: rgba(0, 229, 255, 0.14);
  border: 1px solid rgba(0, 229, 255, 0.3);
  flex: 0 0 auto;
}
.mission-card.done .mission-ic { background: rgba(0, 230, 118, 0.16); border-color: rgba(0, 230, 118, 0.4); }
.mission-body { flex: 1; min-width: 0; }
.mission-title { font-family: var(--font); font-weight: 700; font-size: 0.92rem; }
.mission-track { height: 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); overflow: hidden; margin-top: 6px; }
.mission-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--neon), var(--neon-2)); }
.mission-card.done .mission-track i { background: linear-gradient(90deg, #00e676, #aeea00); }
.mission-prog { font-family: var(--font-num); font-size: 0.74rem; color: var(--txt-2); margin-top: 3px; }
.mission-reward { display: flex; gap: 6px; margin-top: 5px; font-size: 0.72rem; color: var(--gold); flex-wrap: wrap; }

/* --------------------------------------------------------------- başarım */
.ach-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.ach-card {
  text-align: center;
  padding: 16px 12px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-line);
  transition: transform 0.18s, box-shadow 0.2s;
}
.ach-card.unlocked { background: linear-gradient(180deg, rgba(255, 202, 40, 0.14), rgba(255, 255, 255, 0.03)); border-color: rgba(255, 202, 40, 0.4); }
.ach-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.ach-icon {
  width: 54px; height: 54px; margin: 0 auto 8px;
  border-radius: 50%;
  display: grid; place-items: center; font-size: 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid var(--glass-line);
  filter: grayscale(1) opacity(0.5);
}
.ach-card.unlocked .ach-icon { filter: none; border-color: var(--gold); box-shadow: 0 0 20px rgba(255, 202, 40, 0.35); }
.ach-title { font-family: var(--font); font-weight: 700; font-size: 0.84rem; letter-spacing: 0.05em; }
.ach-desc { font-size: 0.7rem; color: var(--txt-2); margin-top: 3px; line-height: 1.4; }
.ach-prog { margin-top: 7px; }

/* --------------------------------------------------------------- shop */
.shop-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.shop-tab {
  padding: 8px 15px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-line);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  transition: background 0.2s, color 0.2s;
}
.shop-tab.active { background: linear-gradient(135deg, var(--neon), var(--neon-2)); color: #04121a; border-color: transparent; }
.item-card {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.035);
  display: flex; flex-direction: column;
  transition: transform 0.18s, box-shadow 0.2s, border-color 0.2s;
}
.item-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.item-card.owned { border-color: rgba(0, 230, 118, 0.4); }
.item-card.equipped { border-color: var(--neon); box-shadow: 0 0 20px rgba(0, 229, 255, 0.24); }
.item-preview {
  height: 92px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.1), transparent 70%);
  border-bottom: 1px solid var(--glass-line);
  font-size: 2.1rem;
}
.item-body { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.item-name { font-family: var(--font); font-weight: 700; font-size: 0.86rem; }
.item-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-num); font-weight: 800; color: var(--gold); font-size: 0.86rem; }

/* --------------------------------------------------------------- ayarlar */
.setting-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .lbl { flex: 1 1 auto; min-width: 0; font-size: 0.88rem; }
.setting-row .desc { font-size: 0.72rem; color: var(--txt-2); margin-top: 2px; }
.setting-row .lbl label { color: var(--txt-0); cursor: pointer; }
/* theme.css'teki global `select { width:100% }` bu satirda .lbl'i (flex:1)
   sifira daraltiyordu. Sizma sadece icerik kadar olmali. */
.setting-row select {
  width: auto;
  min-width: 170px;
  flex: 0 0 auto;
  max-width: 60%;
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.setting-row input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 150px; height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  padding: 0; border: none;
}
.setting-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.7);
  cursor: pointer;
}
.setting-row input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border: none; border-radius: 50%;
  background: var(--neon); cursor: pointer;
}
.switch {
  position: relative; width: 46px; height: 26px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--glass-line);
  transition: background 0.24s;
  flex: 0 0 auto;
  padding: 0;
  cursor: pointer;
}
/* Gorsel 26px ama dokunma alani 44px: saydam uzer katman. */
.switch::before { content: ''; position: absolute; inset: -9px 0; }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  transition: transform 0.24s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.switch.on { background: linear-gradient(135deg, var(--neon), var(--neon-2)); }
.switch.on::after { transform: translateX(20px); }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--glass-line); gap: 3px; flex-wrap: wrap; }
.seg button { padding: 7px 14px; border-radius: 9px; font-size: 0.8rem; font-weight: 700; color: var(--txt-2); transition: background 0.2s, color 0.2s; }
.seg button.active { background: linear-gradient(135deg, var(--neon), var(--neon-2)); color: #04121a; }

/* ------------------------------------------------- uygulama ici ilerleme
   `.bar` / `.bar-fill` game.css icinde GLOBAL tanimli (HUD icin yazildi)
   ve app.html'deki kariyer XP cubugu da ayni siniflari kullaniyor.
   `.app` kapsayicisi yuzden asagidaki kurallar SADECE uygulama
   kabugunu etkiler: #gameStage, .app'in kardesidir (cocugu degil),
   dolayisiyla HUD cubuklari hic degismez. */
.app .bar { height: 10px; }
.app .bar-fill { transition: width 0.45s cubic-bezier(0.2, 0.9, 0.3, 1); }
.app .stat-rows { margin-top: 10px; }

/* --------------------------------------------------------------- giriş */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px 16px calc(var(--safe-b) + 24px); }
.auth-card { width: min(430px, 94vw); border-radius: var(--r-xl); padding: 26px; }
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-logo .ball {
  width: 74px; height: 74px; margin: 0 auto 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, #cfd8dc 45%, #78909c);
  box-shadow: 0 0 34px rgba(0, 229, 255, 0.45), inset 0 -8px 18px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: floatY 3s ease-in-out infinite;
}
.auth-logo h1 { font-size: 1.7rem; letter-spacing: 0.06em; }
.auth-logo p { color: var(--txt-2); font-size: 0.8rem; margin: 4px 0 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.74rem; letter-spacing: 0.1em; color: var(--txt-2); margin-bottom: 6px; text-transform: uppercase; }
.field-err { color: var(--red); font-size: 0.76rem; margin-top: 5px; }
.field-err:empty { display: none; }
.field input {
  width: 100%; min-height: 46px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--glass-line);
  color: var(--txt); font: inherit; font-size: 0.94rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input::placeholder { color: var(--txt-2); }
.field input:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.16);
}
.field input:disabled { opacity: 0.55; }
.field input[aria-invalid="true"] { border-color: var(--red); }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); }
.auth-tabs button { flex: 1; padding: 10px; border-radius: 11px; font-weight: 700; font-size: 0.86rem; color: var(--txt-2); transition: all 0.2s; }
.auth-tabs button.active { background: rgba(0, 229, 255, 0.14); color: var(--neon); box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.35); }
/* Giriş ekranı uygulama kabuğunun üstünde tam ekran durur. */
#authScreen { position: fixed; inset: 0; z-index: 90; overflow-y: auto; background: rgba(3, 6, 12, 0.86); backdrop-filter: blur(10px); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* --------------------------------------------------------------- landing */
.landing { position: relative; overflow-x: hidden; }
.landing-hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: flex; align-items: center;
  padding: 60px max(18px, 5vw) 40px;
  isolation: isolate;
  overflow: hidden;
}
.landing-bg { position: absolute; inset: -6%; z-index: -3; }
.landing-glow {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(700px 420px at 22% 26%, rgba(0, 229, 255, 0.2), transparent 65%),
    radial-gradient(600px 400px at 82% 68%, rgba(124, 77, 255, 0.24), transparent 65%),
    linear-gradient(0deg, rgba(4, 6, 12, 0.96) 8%, rgba(4, 6, 12, 0.3) 55%, rgba(4, 6, 12, 0.85));
}
.landing-inner { width: min(1180px, 100%); margin: 0 auto; display: grid; gap: 30px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .landing-inner { grid-template-columns: 1.05fr 0.95fr; } }
.landing h1 {
  font-size: clamp(2.1rem, 6.4vw, 4.2rem);
  line-height: 1.03;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.landing .lead { font-size: clamp(0.95rem, 2.2vw, 1.12rem); color: var(--txt-1); line-height: 1.6; max-width: 52ch; margin: 0 0 24px; }
.landing-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.landing-stats { display: flex; gap: 26px; margin-top: 30px; flex-wrap: wrap; }
.landing-stats .s .v { font-family: var(--font-num); font-size: 1.7rem; font-weight: 800; }
.landing-stats .s .l { font-size: 0.68rem; letter-spacing: 0.16em; color: var(--txt-2); text-transform: uppercase; }
.hero-visual { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.hero-visual .ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.09); }
.hero-visual .ring.r1 { inset: 8%; animation: spinSlow 22s linear infinite; border-style: dashed; }
.hero-visual .ring.r2 { inset: 20%; animation: spinSlow 15s linear infinite reverse; }
.hero-visual .player-hero, .hero-visual .ball-hero { position: absolute; will-change: transform; }
.feature-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature {
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  transition: transform 0.2s, box-shadow 0.24s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.feature .ic { font-size: 1.7rem; }
.feature h4 { margin: 8px 0 5px; font-size: 1rem; letter-spacing: 0.06em; }
.feature p { margin: 0; color: var(--txt-2); font-size: 0.84rem; line-height: 1.55; }
.site-foot { padding: 30px max(18px, 5vw) 50px; color: var(--txt-3); font-size: 0.78rem; text-align: center; line-height: 1.7; }

/* --------------------------------------------------------------- yardım */
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 0.86rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--txt-2); }
.kv .v { font-family: var(--font-num); font-weight: 700; }
.scroll-y { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fade-in { animation: fadeIn 0.3s both; }

/* ============================== TEK KAYDIRMA KABUGU ======================
   #screens uygulamanin kaydirma kabugudur. `.scroll-y` sinifi (0,1,0) bu
   kurali (1,0,0) yenemez, ama yine de tekrar yaziyoruz ki kural tek
   yerde okunsun.
   - flex:1 + min-height:0  -> .app'in kalan yuksekligini alir, kendisi
     buyuyup .app'i tasirmaz.
   - overscroll-behavior:contain -> dokunma hareketi tarayiciyi geri
     sayfaya cekmez.
   - scroll-padding-top -> anchor/scrollIntoView hedefi basligin altinda
     kalir (hybrid durumda da).
   .app'in padding-bottom'u #screens'in DISINDA oldugu icin tabbar bu
   yuvayi hicbir zaman kaplamaz. */
#screens {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-top: var(--appbar-h);
  scroll-padding-bottom: 16px;
}


/* =====================================================================
   GORSEL SISTEM - stadyum onizleme, arma, buton polish
   ===================================================================== */

/* --- stadyum secim kartlari (tema onizleme canvas'i ile) ----------- */
.stadium-card {
  padding: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stadium-card .tname { margin-top: 2px; }
.stadium-card .tcity { font-size: 0.7rem; }

.stadium-prev {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 -14px 20px -12px rgba(0, 0, 0, 0.8);
  filter: saturate(0.92) brightness(0.94);
  transition: filter 0.24s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.team-card:hover .stadium-prev,
.team-card.selected .stadium-prev {
  filter: saturate(1.12) brightness(1.04);
}
.team-card:hover .stadium-prev { transform: scale(1.02); }

/* secili stadyum: tema rengiyle isik halkasi + parlak kenar */
.stadium-card.selected {
  border-color: var(--tc);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--tc) 55%, transparent),
    0 8px 26px -8px color-mix(in srgb, var(--tc) 60%, transparent),
    var(--sh-2);
}
.stadium-card.selected::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 62%, color-mix(in srgb, var(--tc) 22%, transparent));
  opacity: 0.9;
}

/* --- takim armalari ------------------------------------------------- */
.crest-badge {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.28));
  border: 1px solid var(--glass-line);
  overflow: hidden;
}
.crest-badge canvas { display: block; width: 100%; height: 100%; }

/* kart icinde arma gosteren yardimci */
.team-card .crest-badge {
  width: 54px;
  height: 54px;
  margin: 2px auto 6px;
}

/* --- buton hareketi: basma geri bildirimi --------------------------- */
.btn,
.menu-tile,
.team-card,
.seg button,
.tab {
  will-change: transform;
}
.btn {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.14s cubic-bezier(0.2, 0.9, 0.3, 1.2),
    box-shadow 0.2s ease,
    filter 0.2s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(0.985); filter: brightness(0.96); }
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  filter: grayscale(0.6);
  pointer-events: none;
}
/* basma halkasi */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--bx, 50%) var(--by, 50%), rgba(255, 255, 255, 0.28), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.btn.is-pressing::after { opacity: 1; transition: opacity 0.05s ease; }

/* kart giris animasyonu (kademeli) */
.screen.fade-in .team-card,
.screen.fade-in .menu-tile {
  animation: cardRise 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}
.screen.fade-in .team-card:nth-child(2) { animation-delay: 0.05s; }
.screen.fade-in .team-card:nth-child(3) { animation-delay: 0.1s; }
.screen.fade-in .team-card:nth-child(4) { animation-delay: 0.15s; }
.screen.fade-in .team-card:nth-child(5) { animation-delay: 0.2s; }
@keyframes cardRise {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* =====================================================================
   DUYARLI DUZEN - dort gorsunum modu
   ===================================================================== */

/* 1) Telefon dikey: saha gorsunur ama dar; uyari kapatilir */
@media (max-width: 560px) and (orientation: portrait) {
  .appbar { padding: 8px 12px; }
  .appbar-title { font-size: 0.95rem; }
  .card { padding: 14px; }
  .grid-3 { gap: 8px; }
  .team-card { padding: 8px 6px; }
  .stadium-card { padding: 0 0 8px; }
  .stadium-card .tcity { display: none; }
  .team-card .crest-badge { width: 44px; height: 44px; }
  .menu-tile { padding: 12px 12px; }
}

/* 2) Telefon yatay: yukseklik kisitli, her sey tek satirda */
@media (max-height: 500px) and (orientation: landscape) {
  /* --appbar-h #screens'in scroll-padding-top degerinde kullaniliyor ve
     ozel ozellikler yalnizca ASAGA inherit edilir; .appbar ile
     #screens kardes oldugu icin degerin .app uzerinde tanimli olmasi
     sart. Yatayda appbar 6 + 40 + 10 = 56px. */
  .app { --appbar-h: 56px; }
  .appbar { padding: 6px 10px; --appbar-h: 56px; }
  .card { padding: 12px 14px; }
  .card-title { font-size: 0.95rem; }
  .stadium-prev { max-height: 64px; object-fit: cover; }
  .stadium-card .tcity { display: none; }
  .screen.fade-in .team-card { animation-duration: 0.24s; }
}

/* 3) Tablet: iki sutun, daha geniz dokunma hedefleri */
@media (min-width: 700px) and (max-width: 1024px) {
  .grid-3 { gap: 14px; }
  .team-card { padding: 16px 12px; }
  .stadium-prev { max-height: 120px; object-fit: cover; }
  .team-card .crest-badge { width: 64px; height: 64px; }
}

/* 4) Masaustu: genis ekran */
@media (min-width: 1280px) {
  .wrap { max-width: 1120px; }
  .grid-3 { gap: 18px; }
  .stadium-prev { max-height: 150px; object-fit: cover; }
}

/* ince/hizli cihazlarda animasyonlari kisalt */
@media (prefers-reduced-motion: reduce) {
  .screen.fade-in .team-card,
  .screen.fade-in .menu-tile { animation: none; }
  .btn, .card-click, .team-card, .menu-tile { transition-duration: 0.01ms; }
}

/* =====================================================================
   KAYDIRMA / YERLESIM SABITLEMELERI
   ===================================================================== */

/* 5) Cok kisa ekranlar (yatay telefon ~320-380px): belge kaydirmasi acilir.
   Cift kaydirma cubugu olusmamasi icin #screens `overflow:visible` olur
   ve .app kendi yuksekligini birakir -> SADECE document kayar.
   .appbar burada sticky'ye geri doner, cunku kaydiran blok degistirdi. */
@media (max-height: 380px) {
  html, body {
    overflow-y: auto;
    overscroll-behavior: auto;
    touch-action: auto;
  }
  .app { height: auto; min-height: 100%; }
  .appbar { position: sticky; top: 0; }
  #screens {
    overflow: visible;
    overscroll-behavior: auto;
    flex: 0 0 auto;
    min-height: 0;
  }
}

/* 6) Alti kisik gorunum: tabbar yuksekligi ekranin ~%20'sini asmamali.
   Sikistirilmis hali: 4 + (4+17+3+12+4) + 4 = 48px. 480px yukseklikte
   %10 -> guvenli. .app'in 84px'lik padding-bottom'u fazlalik olur. */
@media (max-height: 480px) {
  .tabbar { padding: 4px max(6px, 1.5vw) calc(var(--safe-b) + 4px); }
  .tab { padding: 4px 2px; gap: 2px; font-size: 0.6rem; }
  .tab .ic { font-size: 1.1rem; }
  .tab .dot { top: 3px; }
  .toast-stack { bottom: calc(var(--safe-b) + 58px); }
}

/* 7) Kaba isaretci (dokunmatik): en az 44px dokunma hedefi.
   .tab dikey flex -> ana eksen dikey, yani min-height. */
@media (pointer: coarse) {
  .tab { min-height: 44px; }
  .appbar-back { min-width: 44px; min-height: 44px; }
  .shop-tab { min-height: 40px; }
  .seg button { min-height: 40px; }
  .plus-btn { width: 36px; height: 36px; }
  .toast-action, .fatal-banner button { min-height: 44px; }
  .hero-actions .btn, .card .btn-block { min-height: 44px; }
  /* Kaydirma cubugu: 6px gorsel track, 30px dokunma alani. */
  .setting-row input[type=range] { height: 30px; background: transparent; }
  .setting-row input[type=range]::-webkit-slider-runnable-track {
    height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.16);
  }
  .setting-row input[type=range]::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -9px; }
  .setting-row input[type=range]::-moz-range-track {
    height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.16);
  }
  .setting-row input[type=range]::-moz-range-progress {
    height: 6px; border-radius: 999px; background: var(--neon);
  }
  .setting-row input[type=range]::-moz-range-thumb { width: 24px; height: 24px; }
}

/* 8) Dar ekranlar (320px): ayar satirlari ikiye kirilir, kontrol kendi
   satirina tam genislikle gecer -> yatay tasma olmaz. */
@media (max-width: 420px) {
  .setting-row { flex-wrap: wrap; gap: 8px 12px; }
  .setting-row .lbl { flex: 1 1 100%; }
  .setting-row select,
  .setting-row input[type=range] { width: 100%; max-width: none; min-width: 0; flex: 1 1 100%; }
  .setting-row .switch, .setting-row .btn { align-self: flex-start; }
  dl.list { grid-template-columns: 1fr; gap: 4px; }
  dl.list > dd { text-align: left; }
  .stat-mini-grid { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
  .toast { width: 100%; }
  .fatal-banner b { font-size: 0.9rem; }
}

/* ======================================================================
   MOBİL: bildirimler (toast)
   Alttaki sekme çubuğunun/ana sayfa kartlarının üstüne binmesin diye
   telefonlarda üst-ortaya, küçük ve tek sütun olarak alınır.
   ====================================================================== */
@media (pointer: coarse), (max-width: 700px) {
  .toast-stack {
    top: calc(var(--safe-t, 0px) + 58px);
    bottom: auto;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
  }
  .toast {
    width: min(420px, 100%);
    padding: 8px 12px;
    font-size: 0.78rem;
    line-height: 1.3;
    border-radius: 12px;
  }
  .toast .ic { font-size: 1rem; }
}
/* Maç sırasında bildirim sahayı/HUD'u kapatmasın (sadece hata kalsın) */
@media (pointer: coarse) {
  body.rhenx-game-active .toast-stack { top: calc(var(--safe-t, 0px) + 74px); }
  body.rhenx-game-active .toast:not(.error) { display: none; }
}