/* Altın Oran ortak görünüm. Gündüz: kırık beyaz zemin, beyaz kartlar. Gece: simsiyah zemin, altın vurgular. */
:root {
  --bg: #f7f6f2; --card: #ffffff; --card-line: transparent; --soft: #f3f1ea; --line: #e6e3da;
  --ink: #141414; --ink2: #77746c; --ink3: #a9a59b;
  --gold: #a8790f; --brand: #141414;
  --profit: #16803c; --profit-bg: #e9f8ee;
  --warn: #b45309; --warn-bg: #fff3e0;
  --bad: #c0362c; --bad-bg: #fdecea;
  --link: #2563eb; --chip: #eceae3;
  --btn: #141414; --btn-ink: #ffffff;
  --bar: rgba(247, 246, 242, .82);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px rgba(0, 0, 0, .06);
}
:root[data-theme="dark"] {
  --bg: #070707; --card: #121212; --card-line: #262626; --soft: #1a1a1a; --line: #262626;
  --ink: #f5f5f5; --ink2: #8f8f8f; --ink3: #5c5c5c;
  --gold: #f0d58c; --brand: #f0d58c;
  --profit: #ffe7a3; --profit-bg: rgba(240, 213, 140, .14);
  --warn: #ffb340; --warn-bg: rgba(255, 159, 10, .14);
  --bad: #ff6b5e; --bad-bg: rgba(255, 69, 58, .14);
  --link: #6ea8ff; --chip: #1f1f1f;
  --btn: #f0d58c; --btn-ink: #111111;
  --bar: rgba(7, 7, 7, .8);
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070707; --card: #121212; --card-line: #262626; --soft: #1a1a1a; --line: #262626;
    --ink: #f5f5f5; --ink2: #8f8f8f; --ink3: #5c5c5c;
    --gold: #f0d58c; --brand: #f0d58c;
    --profit: #ffe7a3; --profit-bg: rgba(240, 213, 140, .14);
    --warn: #ffb340; --warn-bg: rgba(255, 159, 10, .14);
    --bad: #ff6b5e; --bad-bg: rgba(255, 69, 58, .14);
    --link: #6ea8ff; --chip: #1f1f1f;
    --btn: #f0d58c; --btn-ink: #111111;
    --bar: rgba(7, 7, 7, .8);
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; transition: background .25s, color .25s;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--link); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* Üst çubuk */
.bar {
  position: sticky; top: 0; z-index: 10; background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line); min-height: 55px;
  /* Ana ekrandan açılınca (iPhone) saat/çentik şeridinin altında kalmasın */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.bar-in { max-width: 640px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 8px; }
.wide .bar-in { max-width: 980px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: inherit; }
.brand img { display: block; width: 30px; height: 30px; border-radius: 8px; }
.brand span { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 20px; color: var(--brand); letter-spacing: .005em; }
.live { font-size: 12px; color: var(--ink2); display: flex; align-items: center; gap: 6px; white-space: nowrap; margin-right: 4px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; animation: pulse 2s ease-in-out infinite; }
.live.off i { background: var(--warn); box-shadow: none; animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink2); background: var(--chip); transition: transform .15s, color .15s; flex-shrink: 0; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.on { color: var(--gold); box-shadow: inset 0 0 0 1.5px var(--gold); }
.icon-btn:disabled svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sun { display: none; }
:root[data-theme="dark"] .sun { display: block; }
:root[data-theme="dark"] .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sun { display: block; }
  :root:not([data-theme="light"]) .moon { display: none; }
}

main { max-width: 640px; margin: 0 auto; padding: 4px 16px 64px; }
.wide main { max-width: 980px; }
h1 { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 22px 0 2px; }
h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.sub { color: var(--ink2); margin-bottom: 18px; font-size: 15px; }
.muted { color: var(--ink2); }
.small { font-size: 13px; }

/* Büyük kutular */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles.four { grid-template-columns: repeat(4, 1fr); }
.tile { background: var(--card); border: 1px solid var(--card-line); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.tile small { display: block; color: var(--ink2); font-size: 13px; }
.tile .big { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; color: var(--gold); }
.tile .big.plain { color: var(--ink); }
.tile .note { font-size: 12px; color: var(--ink2); margin-top: 2px; }
.tile label { display: block; color: var(--ink2); font-size: 13px; cursor: text; }
.money { display: flex; align-items: baseline; gap: 4px; }
.money input {
  font: inherit; font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; width: 4.5ch; max-width: 100%;
  border: 0; outline: 0; padding: 0; background: transparent; color: var(--ink); font-variant-numeric: tabular-nums;
}
.money input::placeholder { color: var(--ink3); }
.money span { font-size: 18px; font-weight: 700; color: var(--ink2); }
.tile:focus-within { box-shadow: var(--shadow), 0 0 0 2px var(--gold); }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
.hint { color: var(--ink2); font-size: 13px; margin: 8px 4px 0; }

/* Alt çizgili sekmeler */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 26px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { padding: 10px 0; font-weight: 600; font-size: 15px; color: var(--ink3); transition: color .2s; white-space: nowrap; }
.tabs button.active { color: var(--ink); box-shadow: inset 0 -2px var(--gold); }
.tabs .count { font-size: 13px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--chip); color: var(--ink2); }
.tabs .active .count { background: var(--gold); color: var(--bg); }

.banner { border-radius: 14px; padding: 12px 16px; font-size: 14px; margin-bottom: 16px; background: var(--warn-bg); color: var(--warn); }
.banner.err { font-weight: 600; margin-top: 16px; }
.banner.ok { background: var(--profit-bg); color: var(--profit); }

/* Kart */
.list { display: grid; gap: 16px; margin-bottom: 28px; }
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.list > .card + .card { margin-top: 0; }
.head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.meta { font-size: 13px; color: var(--ink2); }
.teams { font-size: 19px; font-weight: 800; letter-spacing: -.02em; margin: 3px 0 0; }
.iddaa { font-size: 13px; color: var(--ink2); margin-top: 2px; }
.pill { font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--profit-bg); color: var(--profit); display: inline-block; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.gray { background: var(--chip); color: var(--ink2); }
.pill.gold { background: var(--gold); color: var(--bg); }
.kind { font-size: 12px; color: var(--ink2); margin: 12px 0 8px; }

.bet { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--soft); border-radius: 14px; margin-bottom: 8px; }
.badge { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; letter-spacing: -.02em; }
.bet-main { flex: 1; min-width: 0; }
.bet-site { font-weight: 700; }
.bet-what { font-size: 13px; color: var(--ink2); }
.bet-what b { color: var(--gold); }
.bet-age { font-size: 12px; color: var(--ink3); margin-top: 1px; }
.bet-side { text-align: right; flex-shrink: 0; }
.stake { font-weight: 800; font-size: 18px; white-space: nowrap; }
.bet-side a { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; margin-top: 1px; }

.res { margin-top: 6px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.res small { display: block; color: var(--ink2); font-size: 12px; }
.res .gain { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--profit); white-space: nowrap; }
.res .why { font-size: 13px; color: var(--ink2); text-align: right; }
.res .why b { color: var(--ink); }
.res.plain { font-size: 14px; color: var(--ink2); display: block; }
.res.bad { display: block; color: var(--warn); font-size: 14px; font-weight: 600; }
.unused { font-size: 12px; color: var(--ink2); margin-top: 8px; }

.more { display: block; width: 100%; margin-top: 14px; padding: 11px; border-radius: 12px; background: var(--chip); color: var(--ink); font-size: 14px; font-weight: 600; }
.alt { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.empty { text-align: center; color: var(--ink2); padding: 44px 20px; }
.empty .big { font-size: 36px; margin-bottom: 10px; }

/* Açılır kart (site çiftleri) */
details.card { padding: 0; }
details.card summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; cursor: pointer; font-weight: 600; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: "›"; font-size: 22px; color: var(--ink3); transition: transform .2s; line-height: 1; }
details[open].card summary::after { transform: rotate(90deg); }
.pairs { padding: 0 18px 10px; }
.pair { display: grid; grid-template-columns: 1fr 80px 60px; gap: 8px; padding: 10px 0; font-size: 14px; border-top: 1px solid var(--line); }
.pair.head { font-size: 12px; color: var(--ink2); font-weight: 600; }
.pair .n { text-align: right; font-variant-numeric: tabular-nums; }
.pair .n.hit { color: var(--gold); font-weight: 700; }

.foot { color: var(--ink2); font-size: 12px; text-align: center; margin: 28px 16px 0; }

/* Form */
.section { margin-top: 26px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; margin: 0 4px 10px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > span { font-size: 14px; font-weight: 600; }
.field small { color: var(--ink2); font-size: 12px; }
.input {
  font: inherit; font-size: 16px; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--soft); color: var(--ink); outline: 0; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.input.short { max-width: 140px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px;
  background: var(--btn); color: var(--btn-ink); font-weight: 700; font-size: 15px; transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--chip); color: var(--ink); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Kanal seçimi */
.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: grid; place-items: center; gap: 4px; padding: 14px 6px; border-radius: 14px; background: var(--soft);
  border: 1.5px solid transparent; font-size: 14px; font-weight: 600; text-align: center; cursor: pointer; transition: border-color .15s;
}
.choice span i { font-style: normal; font-size: 20px; }
.choice input:checked + span { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--soft)); }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }

.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; background: var(--soft); border-radius: 14px; margin-bottom: 10px; }
.status-row b { display: block; }
.status-row .muted { font-size: 13px; }

.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: .04em; color: var(--gold); }

/* Tablo benzeri satırlar (yönetim) */
.rows { display: grid; }
.rowi { display: grid; grid-template-columns: 120px 140px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.rowi:first-child { border-top: 0; }
.rowi .t { color: var(--ink2); font-size: 13px; white-space: nowrap; }
.rowi .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.rowi .what { min-width: 0; overflow-wrap: anywhere; }
.rowi .err { color: var(--bad); font-size: 12px; margin-top: 2px; }
.user-card .stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink2); margin: 10px 0 0; }
.user-card .stats b { color: var(--ink); font-weight: 600; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; padding: 9px 12px; font-size: 14px; }

/* Giriş */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px 24px; }
.auth .logo { display: block; width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 14px; }
.auth h1 { font-family: Fraunces, Georgia, serif; font-weight: 600; text-align: center; font-size: 30px; margin: 0; color: var(--brand); letter-spacing: 0; }
.auth .sub { text-align: center; margin: 4px 0 22px; }

/* Bildirim (toast) */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 720px) {
  .tiles.four { grid-template-columns: 1fr 1fr; }
  .rowi { grid-template-columns: 1fr auto; gap: 2px 10px; }
  .rowi .t { grid-column: 1; }
  .rowi .who { grid-column: 1; }
  .rowi .what { grid-column: 1 / -1; }
  .rowi > :last-child { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
}
@media (max-width: 440px) {
  h1 { font-size: 30px; }
  .live .t { display: none; }
  .tile .big, .money input { font-size: 26px; }
  .bet { padding: 10px; gap: 10px; }
  .badge { width: 36px; height: 36px; font-size: 12px; }
  .res { flex-wrap: wrap; }
  .res .why { text-align: left; }
  .choices { grid-template-columns: 1fr 1fr; }
}
