/* ---------- Tema ---------- */
:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --text: #0f172a;
  --muted: #5b6660;
  --line: #e3e7e1;
  --primary: #15803d;
  --primary-ink: #ffffff;
  --primary-soft: #e5f3e9;
  --accent: #b45309;
  --accent-soft: #fdf1e2;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --gold: #eab308;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.05);
  --tab-h: 60px;
  --top-h: 52px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121a2b; --surface-2: #1a2437; --text: #e5e7eb; --muted: #9aa5b1;
    --line: #243044; --primary: #22c55e; --primary-ink: #052e16; --primary-soft: #14321f;
    --accent: #f5a524; --accent-soft: #3a2e0c; --danger: #f87171; --danger-soft: #3b1515;
    --info: #60a5fa; --info-soft: #14233d; --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #121a2b; --surface-2: #1a2437; --text: #e5e7eb; --muted: #9aa5b1;
  --line: #243044; --primary: #22c55e; --primary-ink: #052e16; --primary-soft: #14321f;
  --accent: #f5a524; --accent-soft: #3a2e0c; --danger: #f87171; --danger-soft: #3b1515;
  --info: #60a5fa; --info-soft: #14233d; --shadow: 0 1px 2px rgba(0,0,0,.4);
  color-scheme: dark;
}

/* ---------- Temel ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.45 Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[hidden] { display: none !important; }

#app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .title { font-weight: 700; font-size: 17px; }
.topbar .sub { font-size: 12px; color: var(--muted); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center;
  font-size: 20px; color: var(--text);
}
.icon-btn:active { background: var(--surface-2); }

.view { flex: 1; padding: 14px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 20px); max-width: 640px; width: 100%; margin: 0 auto; }
body.no-tabs .view { padding-bottom: 24px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 11px; font-weight: 600;
}
.tabbar a .ic { font-size: 22px; line-height: 1; display: grid; place-items: center; }
.tabbar a .ic svg { width: 22px; height: 22px; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.brand { color: var(--primary); }
.tabbar a.active { color: var(--primary); }
.tabbar a .dot { position: absolute; margin-left: 22px; margin-top: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* ---------- Bileşenler ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card + .card { margin-top: 12px; }
.card-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; width: 100%;
}
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; width: auto; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:active:not(:disabled) { transform: translateY(1px); }

.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); outline: none;
}
.input:focus { border-color: var(--primary); }
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.chip.green { background: var(--primary-soft); color: var(--primary); }
.chip.amber { background: var(--accent-soft); color: var(--accent); }
.chip.red { background: var(--danger-soft); color: var(--danger); }
.chip.blue { background: var(--info-soft); color: var(--info); }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 18px; flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 32px; }
.avatar.sm { width: 26px; height: 26px; font-size: 13px; }

.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

.segmented { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; }
.segmented button { flex: 1; border: 0; background: transparent; border-radius: 10px; min-height: 36px; font-weight: 600; color: var(--muted); font-size: 14px; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.week-nav .wk { font-weight: 700; font-size: 16px; text-align: center; }
.week-nav .wk small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.week-nav button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 18px; }

.list { display: grid; gap: 10px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; }
.list-item:active { background: var(--surface-2); }

/* ---------- Maç kartı ---------- */
.match { padding: 12px; }
.match .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.match .teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.match .team { font-weight: 700; font-size: 15px; }
.match .team.away { text-align: right; }
.match .team small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.score-box { display: flex; align-items: center; gap: 4px; }
.stepper { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stepper button { width: 40px; height: 30px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; font-size: 16px; line-height: 1; }
.stepper button:active { background: var(--primary-soft); }
.stepper .val { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); text-align: center; font-size: 20px; font-weight: 800; padding: 0; }
.stepper .val.set { border-color: var(--primary); }
.stepper .val:focus { outline: none; border-color: var(--primary); }
.sep { font-weight: 800; font-size: 20px; color: var(--muted); }
.match.locked .stepper button { visibility: hidden; }
.match.locked .stepper .val { background: var(--surface-2); border-color: transparent; }
.result { text-align: center; font-size: 13px; margin-top: 6px; }
.result .fs { font-weight: 800; font-size: 18px; }
.pts { display: inline-block; min-width: 28px; padding: 2px 8px; border-radius: 8px; font-weight: 800; font-size: 13px; text-align: center; }
.pts.p0 { background: var(--surface-2); color: var(--muted); }
.pts.p1 { background: var(--info-soft); color: var(--info); }
.pts.p2 { background: var(--accent-soft); color: var(--accent); }
.pts.p3 { background: var(--primary-soft); color: var(--primary); }
.match .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.joker-btn { border: 1px dashed var(--line); background: transparent; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.joker-btn.on { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.others { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; display: grid; gap: 4px; }
.others .o { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.others .o .sc { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Kayıt durumu (maç kartı) */
.save-state { text-align: center; font-size: 12px; margin-top: 8px; min-height: 16px; color: var(--muted); transition: color .2s; }
.save-state[data-state="saved"] { color: var(--primary); font-weight: 600; }
.save-state[data-state="saving"] { color: var(--muted); font-style: italic; }
.save-state[data-state="incomplete"] { color: var(--accent); font-weight: 600; }
.save-state[data-state="error"] { color: var(--danger); font-weight: 600; }
.save-state[data-state="empty"] { color: var(--muted); opacity: .7; }

/* Alt onay çubuğu (sekme çubuğunun üstünde) */
.savebar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 19;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; max-width: 640px; margin: 0 auto;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(15,23,42,.08);
}
.savebar .btn.sm { min-height: 40px; white-space: nowrap; }
body.has-savebar .view { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 90px); }

.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }

/* ---------- Sıralama ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .rank { font-weight: 800; width: 32px; }
.table tr.me td { background: var(--primary-soft); }
.table tr.me td:first-child { border-radius: 10px 0 0 10px; }
.table tr.me td:last-child { border-radius: 0 10px 10px 0; }
.mv { font-size: 11px; font-weight: 700; margin-left: 2px; }
.mv.up { color: var(--primary); } .mv.down { color: var(--danger); } .mv.same { color: var(--muted); }
.crown { font-size: 14px; }
.total-pts { font-size: 17px; font-weight: 800; }

/* ---------- Sohbet ---------- */
.chat { display: flex; flex-direction: column; min-height: calc(100vh - var(--top-h) - var(--tab-h) - 120px); }
.chat .msgs { flex: 1; display: grid; gap: 8px; align-content: end; padding-bottom: 8px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 85%; }
.msg.me { margin-left: auto; flex-direction: row-reverse; }
.msg .bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.msg.me .bubble { background: var(--primary-soft); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msg .who { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.msg .time { font-size: 10px; color: var(--muted); margin-top: 2px; text-align: right; }
.composer { position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 10px 0; background: var(--bg); }
.composer .input { flex: 1; min-height: 44px; max-height: 120px; resize: none; }
.composer .btn { width: 48px; padding: 0; border-radius: 12px; }
.sys { text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- Rozetler ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.badge { text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); }
.badge .ic { font-size: 28px; }
.badge .nm { font-size: 11px; font-weight: 700; margin-top: 4px; }
.badge.off { opacity: .35; filter: grayscale(1); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { text-align: center; padding: 10px 4px; background: var(--surface-2); border-radius: 12px; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 11px; color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 48px; }
.spark i { flex: 1; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }

/* ---------- İkonlar: varsayılan 20px, bağlam büyütür ---------- */
svg.ico { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.row > svg.ico:last-child, .lcard .row > svg.ico { color: var(--muted); }

/* ---------- Pano (ana sayfa) ---------- */
.action { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: inherit; box-shadow: var(--shadow); }
.action > svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.action b { display: block; font-size: 16px; font-weight: 800; }
.action small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.action.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.action.primary small, .action.primary > svg { color: inherit; opacity: .9; }
.action.done { border-color: var(--primary-soft); }
.aicon { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--text); font-weight: 800; font-size: 20px; }
.aicon svg { width: 22px; height: 22px; }
.action.primary .aicon { background: rgba(255,255,255,.18); color: #fff; }
.aicon.green { background: var(--primary-soft); color: var(--primary); }
.aicon.amber { background: var(--accent-soft); color: var(--accent); }
.amber { color: var(--accent); } .green { color: var(--primary); }
.seg5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 8px 0 6px; }
.seg5 i { height: 6px; border-radius: 3px; background: var(--line); } .seg5 i.on { background: var(--primary); }
.lmark { border-radius: 12px; color: #fff; display: inline-grid; place-items: center; font-weight: 800; flex: none; letter-spacing: .3px; }
.lmark svg { width: 20px; height: 20px; }
.lmark.amber-soft { background: var(--accent-soft); color: var(--accent); }
.avatar.amber-soft { background: var(--accent-soft); color: var(--accent); } .avatar.green-soft { background: var(--primary-soft); color: var(--primary); }
.avatar svg { width: 20px; height: 20px; }
.lrow { padding: 8px 0; color: inherit; }
.lcard { color: inherit; display: block; }
.stat.ok { background: var(--primary-soft); } .stat.ok b { color: var(--primary); }
.stat.warn { background: var(--accent-soft); } .stat.warn b { color: var(--accent); }
.segmented a.segbtn { flex: 1; text-align: center; border-radius: 10px; min-height: 36px; line-height: 36px; font-weight: 600; color: var(--muted); font-size: 14px; }
.segmented a.segbtn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.bigicon { height: 28px; display: grid; place-items: center; font-size: 22px; font-weight: 800; } .bigicon svg { width: 26px; height: 26px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.topbar .title { font-weight: 800; letter-spacing: -.2px; }
.empty .big svg { width: 48px; height: 48px; }

/* ---------- Bilgi oyunu ---------- */
.gamebar { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 5; background: var(--bg); padding: 6px 0 10px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-align: center; box-shadow: var(--shadow); }
.pcard img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.pcard .pname { font-weight: 800; font-size: 17px; margin-top: 8px; }
.pcard .pmeta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pcard .pstat { margin-top: 8px; font-size: 14px; }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.statbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.statbtn span { font-size: 12px; color: var(--muted); } .statbtn b { font-size: 20px; }
.statbtn:active:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); }
.statbtn:disabled { opacity: .6; }
.duel { margin-top: 8px; }
.four { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pcard.pick { cursor: pointer; } .pcard.pick:active { border-color: var(--primary); }
.pcard.pick img { width: 72px; height: 72px; }

.gridt { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.gridt th { font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px; vertical-align: middle; line-height: 1.2; }
.gridt thead th { height: 44px; }
.gridt tbody th { width: 64px; text-align: center; }
.gridt tbody th img { width: 28px; height: 28px; display: block; margin: 0 auto 2px; object-fit: contain; }
.gridt tbody th span { display: block; font-size: 10px; }
.gcell { width: 100%; aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 2px; font-size: 22px; }
.gcell.ok { border: 2px solid var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 700; }
.gcell img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.gcell span { line-height: 1.1; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.minigrid { display: grid; grid-template-columns: repeat(3, 28px); gap: 4px; }
.minigrid span { width: 28px; height: 28px; border-radius: 6px; background: var(--surface-2); } .minigrid span.on { background: var(--primary); }

.toplist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.toplist li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); min-height: 40px; }
.toplist li.open { background: var(--surface); border: 1px solid var(--line); }
.toplist .rk { width: 22px; font-weight: 800; color: var(--muted); }
.toplist img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.psrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.psrow img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.psrow:active { background: var(--surface-2); }

/* ---------- Düello ---------- */
.dp { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 14px; border: 2px solid transparent; background: var(--surface); max-width: 42%; }
.dp.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dp.me b::after { content: ' (sen)'; font-weight: 500; color: var(--muted); font-size: 11px; }
.dp b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.gcell.mine { border-color: var(--primary); background: var(--primary-soft); }
.gcell.theirs { border-color: var(--danger); background: var(--danger-soft); }
.gcell.win { box-shadow: 0 0 0 3px var(--accent); }
.gcell .mark { position: absolute; top: 2px; right: 6px; font-size: 11px; font-weight: 800; color: var(--muted); }
.gcell { position: relative; }
.tile { padding: 12px 14px; }
.tile .btn.sm { min-height: 40px; }
.duel-cta { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 800; }
.duel-cta svg.ico { width: 16px; height: 16px; }
.duel-cta:active { filter: brightness(.95); }
.toplist li.mine { border-color: var(--primary); background: var(--primary-soft); }
.toplist li.theirs { border-color: var(--danger); background: var(--danger-soft); }
.pcard.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 0 auto 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn svg.ico { width: 18px; height: 18px; }

/* ---------- Yönetim: hafta ızgarası, mini çubuk grafik ---------- */
.wkgrid { display: grid; grid-template-columns: repeat(17, 1fr); gap: 3px; }
.wkgrid span { aspect-ratio: 1; border-radius: 4px; background: var(--surface-2); display: grid; place-items: center; font-size: 8px; color: var(--muted); }
.wkgrid span.full { background: var(--primary); color: #fff; } .wkgrid span.part { background: var(--accent); color: #fff; } .wkgrid span.miss { background: var(--danger-soft); color: var(--danger); } .wkgrid span.future { opacity: .5; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 56px; }
.bars i { flex: 1; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .9; position: relative; }
.bars i.amber { background: var(--accent); } .bars i.blue { background: var(--info); }
.bars i b { position: absolute; top: -14px; left: 0; right: 0; text-align: center; font-size: 9px; color: var(--muted); font-weight: 600; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; white-space: pre-wrap; word-break: break-all; }
.table.compact td, .table.compact th { padding: 6px 6px; font-size: 12px; }
details.err summary { cursor: pointer; }

/* ---------- Toast / Modal ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  z-index: 50; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast.err { background: var(--danger); color: #fff; }
body.has-savebar .toast { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 86px); }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal .sheet {
  width: 100%; max-width: 640px; max-height: 90vh; overflow: auto; background: var(--surface);
  border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  animation: up .2s ease-out;
}
.modal .sheet .handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Giriş ---------- */
.hero { text-align: center; padding: 40px 0 24px; }
.hero .logo { font-size: 64px; }
.hero h1 { font-size: 26px; margin-top: 8px; }
.hero p { color: var(--muted); margin-top: 8px; }
.gbtn { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.feature { display: flex; gap: 12px; align-items: flex-start; }
.feature .ic { font-size: 22px; width: 32px; text-align: center; }

.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 26px; font-weight: 800; letter-spacing: .25em; text-align: center; padding: 12px; background: var(--surface-2); border-radius: 12px; }
.code-input { text-transform: uppercase; letter-spacing: .2em; font-weight: 700; text-align: center; font-size: 20px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 10px; height: 72px; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.banner { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--info-soft); color: var(--info); font-size: 13px; font-weight: 600; }
.banner.warn { background: var(--accent-soft); color: var(--accent); }
.banner button { margin-left: auto; }

/* ---------- Takım seçimi ---------- */
.teampick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.tp { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 11px; font-weight: 700; color: var(--text); line-height: 1.1; text-align: center; }
.tp .tplogo { width: 32px; height: 32px; object-fit: contain; display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.tp.sel { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- TopKart: sen vs bot ---------- */
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
.vs .pcard { padding: 10px 6px; }
.vs .pcard img { width: 60px; height: 60px; }
.vs .pcard .pname { font-size: 14px; }
.vsmark { align-self: center; font-weight: 800; color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.hidden-card { background: var(--surface-2); border-style: dashed; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qmark { width: 60px; height: 60px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-size: 30px; font-weight: 800; color: var(--muted); }
.bigstat { font-size: 30px; font-weight: 800; line-height: 1.1; margin-top: 6px; }
.rulecard { padding: 10px 12px; margin-bottom: 10px; border-left: 3px solid var(--accent); line-height: 1.4; }
.dp { max-width: 44%; } .dp b { max-width: 120px; } .dp .small.ellipsis { max-width: 120px; }
.tp.wide { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 14px; padding: 12px; text-align: left; }
.tp.wide .tplogo.flag { width: 72px; height: 72px; font-size: 52px; line-height: 1; }

/* Yarışma alanları: seçim listesi + tahmin ekranı grup başlığı */
.comp-pick { display: flex; flex-direction: column; gap: 6px; }
.comp-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.comp-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.comp-opt .comp-flag { font-size: 20px; width: 28px; text-align: center; }
.comp-opt .comp-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); color: transparent; display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.comp-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.comp-opt.on .comp-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.comp-head { display: flex; align-items: baseline; justify-content: space-between; font-weight: 800; font-size: 14px; margin: 8px 2px 2px; color: var(--text); }
.comp-head small { font-weight: 600; color: var(--muted); font-size: 12px; }
.row.wrap { flex-wrap: wrap; }

/* Davet: WhatsApp tuşu ve yeni lig vurgusu */
.btn.wa { background: #25D366; color: #fff; border-color: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
.btn.wa:hover { filter: brightness(.95); }
.invite-fresh { box-shadow: 0 0 0 2px var(--primary, #16a34a); }
.comp-opt:active { transform: scale(.99); }
@media (hover: hover) { .comp-opt:hover { border-color: var(--primary); } }
