/* UCL Tahmin Ligi — mobil öncelikli, beyaz-mavi açık tema. */
:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e4e7ec;
  --border-strong: #cfd5de;
  --text: #11151c;
  --muted: #5d6675;
  --brand: #2a55c9;
  --brand-2: #2349b0;
  --brand-soft: #ebf0fc;
  --gold: #a67a1f;
  --silver: #8a93a3;
  --bronze: #a8693d;
  --ok: #1d7a4f;
  --ok-soft: #e5f3ec;
  --warn: #8f6200;
  --warn-soft: #fbf1db;
  --bad: #b3261e;
  --bad-soft: #fbeceb;
  --radius: 14px;
  --tap: 44px;
}

* { box-sizing: border-box; }
html, body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 14px calc(84px + env(safe-area-inset-bottom)); }

/* ---------------------------------------------------------------- header */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.top-inner { max-width: 720px; margin: 0 auto; padding: 10px 14px; display: flex; align-items: center; gap: 6px; }
.logo { display: flex; align-items: baseline; gap: 7px; }
.logo .mark { width: 22px; height: 22px; color: var(--brand); stroke-width: 1.7; align-self: center; }
.logo b { font-size: 16px; font-weight: 700; letter-spacing: -.015em; white-space: nowrap; }
.logo .season { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.spacer { flex: 1; }
.whoami {
  display: flex; align-items: center; gap: 7px; margin: 0 2px;
  border-radius: 10px; padding: 3px 10px 3px 3px;
  background: var(--surface-2); font-size: 13px; font-weight: 600; min-width: 0;
}
.whoami > span:last-child { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: #fff; background: var(--brand);
}
.icon-btn {
  min-width: 36px; height: 36px; border-radius: 10px; border: 0; padding: 0 7px;
  background: transparent; color: var(--muted); display: grid; place-items: center;
  transition: background-color .15s, color .15s, transform .1s;
}
.icon-btn.has-alert { position: relative; color: var(--danger, #c0392b); }
.icon-btn.has-alert::after { content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:active:not(:disabled) { transform: scale(.96); }
.icon-btn.boxed { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* Tek ikon seti: aynı çizgi kalınlığı, rengini currentColor'dan alır. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.i.sm { width: 15px; height: 15px; stroke-width: 2; }

/* ------------------------------------------------------------------ tabs */
nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 2px 8px env(safe-area-inset-bottom);
}
.tabs-inner { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tab {
  position: relative; min-height: 54px; border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px; font-weight: 500;
}
.tab .i { width: 22px; height: 22px; }
.tab[aria-selected="true"] { color: var(--brand); font-weight: 600; }
.tab[aria-selected="true"]::before {
  content: ''; position: absolute; top: -3px; left: 32%; right: 32%;
  height: 2px; border-radius: 0 0 2px 2px; background: var(--brand);
}

/* ---------------------------------------------------------------- shared */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.muted { color: var(--muted); }
.note { font-size: 12.5px; color: var(--muted); margin: 12px 2px 0; }
.stack { display: grid; gap: 10px; }
h2.section { font-size: 13px; font-weight: 600; color: var(--muted); margin: 22px 2px 8px; }
h2.section.flush { margin: 0; }
.btn {
  min-height: var(--tap); padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { border-color: transparent; background: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.icon { min-height: 36px; min-width: 36px; padding: 0 8px; border-radius: 9px; }
.tag {
  margin-left: 6px; font-size: 10.5px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); padding: 1px 6px; border-radius: 5px; vertical-align: 1px;
}

/* ----------------------------------------------------------------- login */
.login-wrap { max-width: 400px; margin: 0 auto; padding: 10dvh 20px 40px; }
.login-hero { margin-bottom: 28px; }
.mark-lg { width: 40px; height: 40px; color: var(--brand); stroke-width: 1.5; }
.login-hero h1 { font-size: 30px; font-weight: 700; margin: 14px 0 4px; letter-spacing: -.025em; line-height: 1.1; }
.login-hero p { margin: 0; }
.field-label { font-size: 13px; font-weight: 600; }
.login-note { font-size: 13px; color: var(--muted); margin: 18px 0 0; line-height: 1.5; text-wrap: pretty; }
.alert {
  border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-weight: 500;
  border: 1px solid #f1c9c6; background: var(--bad-soft); color: var(--bad);
}
.alert.ok { border-color: #bfe0ce; background: var(--ok-soft); color: var(--ok); }

/* ------------------------------------------------------------ lig seçici */
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 14px 0 0;
  padding: 3px; border-radius: 12px; background: var(--surface-2);
}
.seg.three { grid-template-columns: 1fr 1fr 1fr; }
.seg button {
  min-height: 38px; border: 0; border-radius: 9px; background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(17, 21, 28, .08); }
.seg button:active { transform: scale(.98); }
.md-nav .title small.league { color: var(--brand); }

/* -------------------------------------------------------------- matchday */
.md-nav { display: flex; align-items: center; gap: 8px; margin: 18px 0 2px; }
.md-nav .title { flex: 1; text-align: center; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.md-nav .title small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }

.daygroup { margin-top: 18px; }
.dayhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 8px; }
.dayhead h3 { margin: 0; font-size: 14px; font-weight: 600; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 12px; font-weight: 600; padding: 3px 8px 3px 6px; border-radius: 7px;
  background: var(--surface-2); color: var(--muted);
}
.chip.open { background: var(--brand-soft); color: var(--brand); }
.chip.live { background: var(--ok-soft); color: var(--ok); }

.savebar {
  position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 15; margin-top: 16px;
  display: flex; gap: 9px; align-items: center;
  padding: 8px 8px 8px 14px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); box-shadow: 0 6px 20px rgba(17, 21, 28, .10);
}
.savebar .info { flex: 1; font-size: 13px; font-weight: 600; }

/* ------------------------------------------------------------- standings */
.podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 8px; align-items: end; margin-bottom: 14px; }
.pod {
  text-align: center; border-radius: var(--radius); padding: 12px 6px 12px;
  border: 1px solid var(--border); border-top: 3px solid var(--border-strong); background: var(--surface);
}
.pod.empty-slot { visibility: hidden; }
.pod.p1 { padding-block: 18px 16px; background: #fcf8ee; }
.pod.r1 { border-top-color: var(--gold); }
.pod.r2 { border-top-color: var(--silver); }
.pod.r3 { border-top-color: var(--bronze); }
/* Sıra, rozet kutusu yerine tipografik numara: "1." */
/* Madalya rengi şeritte; numara koyu kalır (altın yazı beyazda ~3.7:1, okunmuyor). */
.pod-rank {
  font-size: 15px; font-weight: 700; line-height: 1; margin-bottom: 6px;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.pod .pts { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.pod .pts small { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.pod .nm { font-size: 12.5px; font-weight: 600; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#rankList { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
#rankList:empty { border: 0; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.rank-row:last-child { border-bottom: 0; }
.rank-row.me { background: var(--brand-soft); }
.rank-no { width: 22px; text-align: center; font-weight: 700; font-size: 15px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.rank-no.r1, .rank-no.r2, .rank-no.r3 { color: var(--text); }
.rank-main { flex: 1; min-width: 0; }
.rank-main .nm { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-main .sub { font-size: 12px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.rank-pts { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; text-align: right; }
.rank-pts small { font-size: 11px; color: var(--muted); font-weight: 500; display: block; margin-top: -2px; letter-spacing: 0; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 2px 0; }
.legend.legend-top { margin: 2px 2px 10px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend b { color: var(--text); font-weight: 600; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--border-strong); }
.sw.exact { background: var(--ok); }
.sw.diff { background: var(--brand); }
.sw.outcome { background: #d9a53c; }

/* ------------------------------------------------------------------ misc */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.skeleton { height: 78px; border-radius: var(--radius); background: var(--surface-2); margin-bottom: 10px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .55 } 50% { opacity: 1 } }
.hidden { display: none !important; }

dialog {
  border: 0; background: var(--surface); color: var(--text);
  border-radius: 18px; padding: 20px; max-width: 380px; width: calc(100% - 32px);
  box-shadow: 0 24px 60px rgba(17, 21, 28, .22);
}
dialog::backdrop { background: rgba(17, 21, 28, .42); }
dialog h3 { margin: 0 0 10px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
dialog .alert { margin-bottom: 12px; }
dialog h2.section.flush { margin: 4px 0 8px; }
.dlg-text { font-size: 14px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.dlg-actions { display: grid; gap: 8px; margin-top: 14px; }
.dlg-close { margin-top: 18px; }
dialog input[type="text"], dialog input[type="number"] {
  width: 100%; min-height: var(--tap); padding: 0 12px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface);
}
.admin-match { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.admin-match .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
dialog input.admin-num { width: 44px; min-height: 36px; padding: 0; text-align: center; font-size: 16px; font-weight: 600; }

/* Yönetici duyurusu */
dialog textarea {
  width: 100%; padding: 10px 12px; border-radius: 11px; font: inherit; font-size: 15px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); resize: vertical;
}
.muted.sm { font-size: 12.5px; margin: 0 0 8px; line-height: 1.45; }
.btn.ghost { background: transparent; color: var(--muted); }
.ann-bar {
  display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 2px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 13.5px;
}
.ann-bar .i { flex: none; margin-top: 1px; color: var(--brand); }
.ann-bar span { font-weight: 600; }
.ann-bar small { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); margin: 2px 0 4px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.push-box {
  display: flex; gap: 10px; align-items: center; margin: 12px 0 4px; padding: 12px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
}
.push-text { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.push-box .btn { width: auto; flex: none; min-height: 38px; padding: 0 14px; font-size: 13.5px; }

/* Eksik tahmin uyarısı (kilide 1 saat kala) */
.warn-banner {
  display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; padding: 10px 12px;
  border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; font-weight: 600;
  border: 1px solid #ecd9a8;
}
.warn-banner .i { flex: none; }
.warn-banner b { color: var(--text); }

/* Hafta özeti */
.notice-kicker.ok { color: var(--ok); }
.notice-kicker.ok::before { background: var(--ok); }
.week-list { display: grid; gap: 4px; margin: 0 0 12px; }
.week-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.week-row.me { background: var(--brand-soft); }
.week-row .rk { width: 18px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-row .nm { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-row .pt { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand); }
.week-row.top .pt { color: var(--gold); }
.week-me { font-size: 13.5px; color: var(--muted); margin: 0 0 4px; }

/* Sıralamada kişi satırı açılır: hafta hafta puan */
.rank-row { cursor: pointer; }
.rank-row .i.chev { color: var(--muted); transition: transform .2s; }
.rank-row[aria-expanded="true"] .i.chev { transform: rotate(180deg); }
.rank-weeks {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 0 14px 12px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.rank-weeks[hidden] { display: none; }
.wk { border: 1px solid var(--border); border-radius: 9px; padding: 6px 4px; text-align: center; }
.wk small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.wk b { font-size: 15px; font-variant-numeric: tabular-nums; }
.wk.win { border-color: #e7d3a4; background: #fcf8ee; }
.wk.win b { color: var(--gold); }
.wk.none b { color: var(--border-strong); }
.wk-legend { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }

/* Geçmiş haftalar */
.history-league { margin-top: 20px; }
.history-league > h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 2px 2px; }
.history-league > p.note { margin: 2px 2px 10px; }
.history-league .md-nav { margin: 6px 0 8px; }
.history-league .matrix-scroll { max-height: none; }
.matrix tfoot td, .matrix tfoot th {
  border-top: 1px solid var(--border-strong); border-bottom: 0; background: var(--surface-2);
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.matrix tfoot .sticky-col { background: var(--surface-2); font-size: 11.5px; color: var(--muted); }
.matrix tfoot td.best { color: var(--gold); }

/* Yenilikler */
.release-list { margin: 0 0 6px; padding: 0; list-style: none; display: grid; gap: 9px; }
.release-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--muted); }
.release-list li b { color: var(--text); font-weight: 600; }
.release-list .step-icon { width: 28px; height: 28px; }

/* Tek seferlik bildirim */
.notice-kicker {
  margin: 0 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--bad); display: inline-flex; align-items: center; gap: 6px;
}
.notice-kicker::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.notice-steps { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 10px; }
.notice-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--muted); }
.notice-steps b { color: var(--text); font-weight: 600; }
.step-icon {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text);
}
.step-icon .i { width: 17px; height: 17px; }
.step-icon .jk { color: var(--gold); fill: currentColor; }
.notice-example {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px;
}
.notice-example > div {
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 6px; text-align: center;
  display: grid; gap: 2px;
}
.notice-example > div > b { font-size: 11px; color: var(--muted); font-weight: 600; }
.notice-example span { font-size: 14px; font-variant-numeric: tabular-nums; }
.notice-example span b { font-size: 16px; color: var(--brand); }
.notice-example .neg { color: var(--bad); }
.dlg-text.small { font-size: 12.5px; }

/* Kurallar */
.rules h3 { font-size: 14px; font-weight: 600; margin: 18px 0 4px; }
.rules h3:first-child { margin-top: 0; }
.rules p { margin: 0; color: var(--muted); line-height: 1.55; max-width: 62ch; text-wrap: pretty; }
.rules p b { color: var(--text); font-weight: 600; }
.points { margin: 6px 0 0; display: grid; gap: 7px; }
.points div { display: flex; gap: 12px; align-items: baseline; }
.points dt { min-width: 18px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.points dd { margin: 0; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ------------------------------------------------- isim / kurtarma girişi */
.name-input {
  width: 100%; min-height: var(--tap); padding: 0 14px; font-size: 16px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 13px;
}
.name-input.code { text-align: center; letter-spacing: .18em; font-weight: 600; text-transform: uppercase; }
.code-badge {
  margin-top: 6px; text-align: center; font-size: 27px; font-weight: 700; letter-spacing: .12em;
  padding: 16px 10px; border-radius: 14px; color: var(--brand);
  background: var(--brand-soft); border: 1px solid #c9d6f5;
  font-variant-numeric: tabular-nums; user-select: all;
}
.admin-user {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px;
  border-radius: 11px; background: var(--surface-2); font-size: 13px;
}
.admin-user .nm { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user .cnt { font-size: 11px; color: var(--muted); font-weight: 700; }

/* ---------------------------------------- tahmin sayfasındaki sıralama satırı */
.mini-line {
  width: 100%; margin-top: 12px; padding: 10px 12px; min-height: 44px;
  display: flex; align-items: center; gap: 8px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  font-size: 13px; color: var(--text);
}
.mini-line .mini-lbl { font-weight: 700; white-space: nowrap; }
.mini-line .mini-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.mini-line .mini-text b { color: var(--text); font-weight: 600; }
.mini-line .i { color: var(--muted); }
.whoami { border: 0; cursor: pointer; }

/* Kilit sayacı hafta başlığının altında */
.md-nav .title small.lockin { color: var(--brand); font-weight: 600; }
.md-nav .title small.lockin .i { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }

/* Sıralama: dönem seçici lig seçicinin hemen altında, daha küçük */
#periodSeg { margin-top: 6px; }
#periodSeg button { min-height: 34px; font-size: 13px; }
#periodNav { margin: 10px 0 2px; }

/* Sıralama: sıra değişimi ve hafta birincisi rozeti */
.rank-delta { font-size: 11px; font-weight: 700; margin-left: 6px; font-variant-numeric: tabular-nums; }
.rank-delta.up { color: var(--ok); }
.rank-delta.down { color: var(--bad); }
.rank-delta.same { color: var(--border-strong); }
.win-badge {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 6px;
  border-radius: 6px; background: #fcf8ee; color: var(--gold); font-size: 11px; font-weight: 700; vertical-align: 1px;
}
.win-badge .i { width: 12px; height: 12px; stroke-width: 2.2; }
.rank-main .nm button {
  border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.rank-main .nm button:hover { text-decoration: underline; }
.matrix thead th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: block; margin: 0 auto; }

/* Profil */
.back-btn {
  display: inline-flex; align-items: center; gap: 4px; margin: 12px 0 4px -6px; padding: 6px 10px 6px 4px;
  border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 14px; border-radius: 9px;
}
.profile-head { display: flex; align-items: center; gap: 12px; margin: 8px 2px 14px; }
.profile-head .avatar { width: 48px; height: 48px; border-radius: 14px; font-size: 18px; }
.profile-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.profile-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.profile-league { margin-top: 18px; }
.profile-league > h3 { font-size: 15px; font-weight: 700; margin: 0 2px 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 8px 4px; text-align: center; background: var(--surface); }
.stat b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.stat.gold b { color: var(--gold); }
.profile-week { margin-top: 10px; }
.profile-week h4 { margin: 0 2px 6px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; }
.profile-week h4 span { color: var(--muted); font-weight: 500; }
.prow { grid-template-columns: 34px 1fr auto 1fr auto; }
.prow .mscore.mine { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
.prow .mscore.hidden-pred { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border-strong); }
.prow .mscore .i { width: 12px; height: 12px; }
.prow .mres { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------ tahmin sayfasındaki sıralama */
.mini-table {
  margin-top: 14px; padding: 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
}
.mini-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mini-more {
  border: 0; background: none; color: var(--brand); font-size: 13px; font-weight: 600;
  padding: 6px 0 6px 6px; min-height: 32px; display: inline-flex; align-items: center; gap: 2px;
}
.mini-rows { display: grid; }
.mini-row {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px;
  padding: 8px 6px; border-bottom: 1px solid var(--border);
}
.mini-row:last-child { border-bottom: 0; }
.mini-row.me { background: var(--brand-soft); border-radius: 8px; border-bottom-color: transparent; }
.mini-row .rk { width: 18px; text-align: center; font-weight: 700; color: var(--muted); flex: none; }
.mini-row .nm { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .ex { font-size: 11px; color: var(--muted); font-weight: 700; }
.mini-row .pt { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.mini-empty { font-size: 12.5px; color: var(--muted); text-align: center; padding: 6px 0; }

/* -------------------------------------------- sıkışık maç satırı (tablo) */
.mrows {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; margin-bottom: 10px;
}
.mrow {
  display: grid; grid-template-columns: 30px 1fr auto 1fr auto;
  align-items: center; gap: 4px; padding: 9px 8px;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.mrow:last-child { border-bottom: 0; }
.mtime { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.mteam { display: flex; align-items: center; gap: 5px; min-width: 0; }
.mteam.a { flex-direction: row-reverse; }
.mteam img { width: 17px; height: 17px; object-fit: contain; flex: none; }
.mname { font-weight: 700; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mscore {
  font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 7px;
  background: var(--brand); color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.mscore.pending { background: var(--surface-2); color: var(--muted); }
.mscore.live { background: var(--ok); }
.mscore.postponed { background: var(--warn-soft); color: var(--warn); font-size: 11px; }
.mpts {
  font-size: 10.5px; font-weight: 600; padding: 3px 7px; border-radius: 7px;
  white-space: nowrap; background: var(--surface-2); color: var(--muted);
}
.mpts.exact { background: var(--ok); color: #fff; }
.mpts.diff { background: var(--brand); color: #fff; }
.mpts.outcome { background: var(--warn-soft); color: var(--warn); }
.mpts.miss { background: var(--surface-2); color: var(--muted); }
.mpts.none { opacity: .6; font-weight: 700; }

/* --------------------------------------------------- tahmin tablosu (matris) */
.matrix-wrap { margin-bottom: 8px; }
/* Tablo kendi kutusunda iki yönde kayar; böylece isim satırı (üst) ve maç
   sütunu (sol) dondurulmuş kalır. Sayfa kaydırmasına bağlı sticky, yatay
   overflow'lu bir kabın içinde çalışmadığı için bu şart. */
.matrix-scroll {
  overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  max-height: calc(100dvh - 230px);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.matrix { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12px; }
.matrix th, .matrix td { padding: 6px 5px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.matrix thead th {
  position: sticky; top: 0; z-index: 3; background: var(--surface-2); font-size: 11px;
  font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 1px 0 var(--border-strong);
}
.matrix thead th .avatar { width: 22px; height: 22px; font-size: 9px; margin: 0 auto 3px; }
.matrix thead th.me { color: var(--brand); }
.matrix .thname { display: block; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
/* Maç ve Skor sütunları birlikte sola yapışır. Skor sütununun `left` değeri
   maç sütununun genişliğine eşit olmalı; bu yüzden genişlik sabit. */
.matrix { --mx-col: 104px; }
.matrix .sticky-col {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  text-align: left; width: var(--mx-col); min-width: var(--mx-col); max-width: var(--mx-col);
}
/* Sol üst köşe hem üste hem sola yapışır; ikisinin de üstünde kalmalı. */
.matrix thead .sticky-col { background: var(--surface-2); z-index: 5; top: 0; left: 0; }
.matrix tbody .sticky-col { font-weight: 700; font-size: 11.5px; z-index: 2; }
.mx-home, .mx-away { display: block; overflow: hidden; text-overflow: ellipsis; }
.mx-vs { display: none; }
.mx-away { color: var(--muted); }
.matrix .res-col {
  position: sticky; left: var(--mx-col); z-index: 2; background: var(--surface);
  font-weight: 700; color: var(--muted);
  border-right: 1px solid var(--border-strong);
  box-shadow: 3px 0 6px -4px rgba(16, 32, 63, .25);
}
.matrix thead .res-col { background: var(--surface-2); z-index: 5; top: 0; }
.matrix .res-col.has { color: var(--brand); }
.matrix td.me { background: var(--brand-soft); }
.mx-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; font-weight: 600; }
.mx-cell i { font-style: normal; font-size: 9.5px; font-weight: 600; padding: 1px 5px; border-radius: 999px; }
.mx-cell.exact i { background: var(--ok); color: #fff; }
.mx-cell.diff i { background: var(--brand); color: #fff; }
.mx-cell.outcome i { background: var(--warn-soft); color: var(--warn); }
.mx-cell.miss { opacity: .6; }
.mx-cell.miss i { background: var(--surface-2); color: var(--muted); }
.mx-none { color: var(--border-strong); font-weight: 600; }
.matrix-empty, .matrix-hint { font-size: 12px; color: var(--muted); text-align: center; margin: 8px 0 0; }
.matrix-empty { padding: 18px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius); margin: 0; }

/* ------------------------------------------------------- geçmiş maçlar */
.past-toggle {
  width: 100%; min-height: 48px; margin-top: 12px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; text-align: left;
  transition: background-color .15s;
}
.past-toggle:hover { background: var(--surface-2); }
.past-toggle .i { color: var(--muted); transition: transform .2s ease; }
.past-toggle[aria-expanded="true"] .i { transform: rotate(180deg); }
.past-toggle .count { margin-left: 6px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.past-panel { margin-top: 4px; }
.past-panel .daygroup { margin-top: 12px; }
.past-panel .matrix-wrap { margin-top: 10px; }
.mini-gap { text-align: center; color: var(--border-strong); font-weight: 700; line-height: 1; padding: 2px 0; }

/* ------------------------------------------- açık maç satırı (skor girişi) */
/* Sonuç satırıyla aynı ızgara (.mrow): ortadaki skor rozeti yerine iki kutu,
   sağdaki durum hapı yerine kaydet hapı. */
.mgoals { display: inline-flex; align-items: center; gap: 3px; }
.mgoals .dash { color: var(--muted); font-weight: 600; font-size: 12px; }
/* 16px altı yazı, iOS Safari'de kutuya dokununca sayfayı yakınlaştırıyor. */
.mgoal {
  width: 26px; height: 30px; padding: 0; text-align: center;
  font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
  border: 1.5px solid var(--border-strong); border-radius: 7px;
  background: var(--surface); color: var(--brand);
}
.mgoal::placeholder { color: var(--border-strong); font-weight: 700; }
.mgoal:focus-visible, .mgoal:focus {
  outline: none; border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(42, 85, 201, .18);
}
.save-pill {
  border: 0; min-height: 28px; min-width: 46px; padding: 3px 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s, transform .1s;
}
.save-pill:active:not(:disabled) { transform: scale(.96); }
.save-pill .i { width: 14px; height: 14px; stroke-width: 2.4; }
.save-pill.is-ready { background: var(--brand); color: #fff; }
.save-pill.is-saved { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px #bfe0ce; font-size: 12px; }
.save-pill.is-idle { background: transparent; color: var(--border-strong); box-shadow: inset 0 0 0 1px var(--border-strong); cursor: default; }
.save-pill.is-error { background: var(--bad-soft); color: var(--bad); }

/* Açık maçta başkasının gizli tahmini: kilit. */
.mx-cell.masked { color: var(--border-strong); }
.mx-cell.masked .i { width: 14px; height: 14px; stroke-width: 2; }

/* Açık maçlarda tahmin hücresi: puan yok, sadece skor. */
.mx-cell.open b { color: var(--brand); }

/* --------------------------------------------------- joker ve 4 büyükler */
/* Saat sütunu iki satır: üstte saat, altta işaretler (joker yıldızı, ×2). */
.mtime { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; line-height: 1.1; }
.mmarks { display: inline-flex; align-items: center; gap: 2px; min-height: 13px; }
.jk { width: 13px; height: 13px; color: var(--border-strong); stroke-width: 2; }
.jk.on { color: var(--gold); fill: currentColor; }
.x2 { font-size: 9.5px; font-weight: 700; color: var(--brand); letter-spacing: -.02em; }
button.mtime {
  border: 0; background: transparent; padding: 6px 2px; margin: -6px 0 -6px -2px;
  color: var(--muted); font-size: 10.5px; font-weight: 700; border-radius: 7px;
}
button.mtime:active { background: var(--surface-2); }
.legend .jk { width: 12px; height: 12px; }
.legend small { color: var(--muted); font-size: 11px; }
.mx-cell .jk { width: 11px; height: 11px; }
.mx-x2 { display: block; font-size: 9.5px; font-weight: 700; color: var(--brand); line-height: 1; margin-top: 2px; }
.mx-cell b { display: inline-flex; align-items: center; gap: 2px; }

/* ---------------------------------------------------------- yatay ekran */
/* Telefon yan çevrildiğinde yükseklik 400px civarına iner: alt bar tek satır,
   tablo ekranın çoğunu kullanır, çentik için yan boşluklar korunur. */
@media (orientation: landscape) and (max-height: 520px) {
  nav.tabs { padding: 0 max(8px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-right)); }
  .tab { min-height: 42px; flex-direction: row; gap: 7px; font-size: 12px; }
  .tab .i { width: 18px; height: 18px; }
  .tab[aria-selected="true"]::before { top: 0; left: 36%; right: 36%; }
  .wrap { padding: 0 max(14px, env(safe-area-inset-left)) calc(54px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right)); }
  .top-inner { padding: 6px max(14px, env(safe-area-inset-left)) 6px max(14px, env(safe-area-inset-right)); }
  .seg, .md-nav { margin-top: 8px; }
  .matrix-scroll { max-height: calc(100dvh - 118px); }
  .mini-table { padding: 8px 12px; }
  .mini-table .mini-row { padding: 5px 6px; }
}
/* Tablet ve masaüstünde tablo daha rahat: sütunlar genişler. */
@media (min-width: 700px) {
  .matrix th, .matrix td { padding: 8px 10px; }
  .matrix { --mx-col: 150px; }
}
