:root {
  --bg: #f6f7f9;
  --fg: #1d2330;
  --muted: #6b7280;
  --card: #ffffff;
  --line: #e3e6eb;
  --accent: #1f7a4d;
  --danger: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--fg); }
a { color: var(--accent); }
.muted { color: var(--muted); }
.error { color: var(--danger); }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--fg); }
.topbar nav { display: flex; gap: 16px; align-items: center; }

.card { max-width: 420px; margin: 48px auto; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.card.wide { max-width: 760px; }
h1 { font-size: 22px; margin-top: 0; }
h2 { font-size: 17px; margin-top: 0; }

label { display: block; margin-bottom: 4px; font-weight: 600; }
input[type=email] { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
button { margin-top: 12px; padding: 9px 14px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
button.link { margin: 0; padding: 0; background: none; color: var(--accent); }
button.link.danger { color: var(--danger); }
form.inline { display: inline; }
form.row { display: flex; gap: 10px; align-items: center; margin: 16px 0; }
form.row button { margin-top: 0; }
label.check { display: flex; gap: 4px; margin: 0; font-weight: 400; white-space: nowrap; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; padding: 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tab { padding: 8px 14px; border-radius: 6px; text-decoration: none; color: var(--fg); }
.tab.active { background: var(--card); border: 1px solid var(--line); font-weight: 600; }
.tab.disabled { color: var(--muted); }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding: 12px; }
  .card { margin: 24px 16px; }
}

/* Dashboard */
.statusbar { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
/* Ana sayfa: sekmeler solda, seçim kutuları sağda (dar ekranda alt satıra iner) */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.toolbar .tabs, .toolbar .filters { margin-bottom: 0; }
.toolbar .filters { justify-content: flex-end; align-items: center; }
.toolbar .tab { white-space: nowrap; }
@media (max-width: 760px) {
  .toolbar .filters { justify-content: flex-start; }
  .toolbar .tab { padding: 6px 9px; font-size: 14px; }
}
.filters select { max-width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--card); }
.filters button { margin-top: 0; }
.scroll { overflow-x: auto; }
table.odds td, table.odds th { vertical-align: top; }
.num { text-align: right; }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }
.note { margin-bottom: 0; }
.pos { color: var(--accent); font-weight: 600; }
.neg { color: var(--muted); }
tr.candidate { background: #eaf6ef; }
.tag { display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 11px; }
table.board td { border-bottom: 0; padding: 4px 2px; }
.warn-icon { color: #b54708; cursor: help; }
.tag.warn { background: #b54708; }
h2.group { font-size: 15px; margin: 16px 0 6px; }
h2.group:first-child { margin-top: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; font-size: 13px; }
.pills a { padding: 2px 8px; border-radius: 10px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); }
.pills a.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.page { max-width: 1000px; margin: 0 auto; padding: 20px; }
.page .panel { margin-bottom: 16px; }

svg.chart { width: 100%; height: auto; font-size: 11px; fill: var(--muted); }
svg.chart line.ref { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 3; }
.ok { color: var(--accent); }
.page.wide { max-width: 1200px; }
.prose li { margin-bottom: 6px; }
.example { background: var(--bg); padding: 10px 12px; border-radius: 6px; }
table.kv th { width: 220px; font-weight: 600; }
input[type=text] { padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
input.short { width: 110px; }
form.row.wrap { flex-wrap: wrap; }
form.row select { padding: 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--card); }
button.secondary { background: var(--card); color: var(--fg); border: 1px solid var(--line); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.topbar nav a { text-decoration: none; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 6px; }
  .topbar nav { flex-wrap: wrap; gap: 10px; font-size: 14px; }
  .page { padding: 12px; }
}
.combos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; }
.combo { border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; overflow-x: auto; }
.combo h3 { margin: 0 0 6px; font-size: 15px; }
.combo tfoot td { border-bottom: 0; font-weight: 600; }
.verdict { padding: 8px 10px; border-radius: 6px; margin: 0 0 8px; }
.verdict.candidate { background: #eaf6ef; color: var(--accent); font-weight: 600; }
.verdict.small { background: #fff6e5; color: #93540a; }
.verdict.none { background: var(--bg); color: var(--muted); }
.best-cell { background: #d9f0e3; color: #14532d; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.fair-row td { color: var(--muted); font-style: italic; background: var(--bg); }
.legend { margin: 0 0 10px; padding-left: 18px; }
.legend li { margin-bottom: 2px; }
th.center { text-align: center; }
@media (max-width: 760px) { .combos { grid-template-columns: 1fr; } }

/* Açıklama kutuları (tip.js) */
[data-tip] { cursor: help; }
.tip { border-bottom: 1px dotted var(--muted); }
.tipbox { position: fixed; z-index: 100; max-width: 300px; padding: 9px 11px; border-radius: 8px;
  background: #1d2330; color: #fff; font-size: 12.5px; line-height: 1.5; white-space: pre-line;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); pointer-events: none; }
.howto { background: #f0f7f3; border: 1px solid #cfe7da; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.howto p { margin: 4px 0; }
.sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.chance-row td { background: #f6f8fb; }
.summary-row td { background: var(--bg); font-weight: 600; }
details.more summary { cursor: pointer; font-weight: 600; }
.help { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); font-weight: 700; font-size: 13px; }
.payout { font-weight: 700; }
.payout.candidate { color: var(--accent); }
.payout.small { color: #93540a; }
.payout.none { color: var(--muted); font-weight: 600; }
details.howto summary { cursor: pointer; }
.tipchart { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .18); white-space: normal; }
.tipchart-title { font-weight: 600; margin-bottom: 2px; }
.tipchart svg { display: block; font-size: 10px; fill: #cbd2dc; }
.tipchart svg line.axis { stroke: rgba(255, 255, 255, .25); }
.tipchart-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.tipchart-legend span { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.tipbox { max-width: 310px; }
.tipchart svg line.grid { stroke: rgba(255, 255, 255, .10); }
.tipchart svg line.ref { stroke: #facc15; stroke-width: 1; stroke-dasharray: 3 3; opacity: .8; }
.tipchart-legend.main { font-weight: 700; }
.tipchart-legend.ref span { background: none; border-top: 2px dashed #facc15; height: 0; }
.tipbox { max-width: 340px; }
.tag.gone { background: var(--bg); color: var(--muted); border: 1px dashed var(--muted); }
.best-so-far { color: #93540a; font-weight: 600; }

/* Sıralama: sağ üstte ☰ ile açılıp kapanan panel */
.statusbar { position: relative; align-items: center; }
.layout.single { grid-template-columns: minmax(0, 1fr); }
.board-drawer { margin-left: auto; }
.board-drawer summary.burger { list-style: none; cursor: pointer; padding: 5px 12px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--card); font-weight: 600; white-space: nowrap; user-select: none; }
.board-drawer summary.burger::-webkit-details-marker { display: none; }
.board-drawer[open] summary.burger { background: var(--accent); color: #fff; border-color: var(--accent); }
.board-drawer .drawer { position: absolute; right: 16px; top: calc(100% + 6px); z-index: 50; width: 300px;
  max-height: 70vh; overflow-y: auto; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
@media (max-width: 760px) {
  .board-drawer .drawer { right: 12px; left: 12px; width: auto; }
  .board-drawer summary.burger span { display: none; }
}

/* Kullanıcı menüsü: ada gelince / dokununca açılır */
.usermenu { position: relative; cursor: pointer; outline: none; }
.usermenu-name { color: var(--accent); font-weight: 600; padding: 4px 0; }
.usermenu-list { display: none; position: absolute; right: 0; top: 100%; z-index: 60; min-width: 150px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.usermenu:hover .usermenu-list, .usermenu:focus-within .usermenu-list { display: block; }
.usermenu-list a, .usermenu-list button { display: block; width: 100%; padding: 7px 10px; border-radius: 6px;
  text-align: left; color: var(--fg); text-decoration: none; font: inherit; }
.usermenu-list a:hover, .usermenu-list button:hover { background: var(--bg); }
.usermenu-list form { margin: 0; }
.admin-credits { margin-left: auto; align-self: center; font-size: 13px; color: var(--muted); }

/* Yönetim: botlar */
.bot-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.bot-type { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; }
.bot-type h3 { margin: 0 0 6px; font-size: 15px; }
.bot-type p { margin: 0 0 8px; }
.bot-type .button-link { margin-top: auto; align-self: flex-start; }
.bot-rule { margin: 0 0 6px; }
.button-link { display: inline-block; padding: 7px 12px; border-radius: 6px; background: var(--accent); color: #fff; text-decoration: none; }
table.kv select { padding: 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--card); }
table.kv .sub { white-space: normal; margin-top: 2px; }
label.check + button { display: block; }
.button-link.secondary { background: var(--card); color: var(--fg); border: 1px solid var(--line); }

/* Oyuncunun site listesi (Settings → Sites, docs/USER_SITES_PLAN.md) */
.site-picker fieldset { border: 0; margin: 0 0 12px; padding: 0; }
.site-picker legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.site-picker legend .muted { font-weight: 400; }
.site-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
label.site-option { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-weight: 400; }
label.site-option input { margin-top: 4px; }
label.site-option .sub { white-space: normal; }
label.site-option.off { opacity: .5; }
.site-picker .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.site-picker .actions button { margin-top: 0; }
tr.other-sites td { color: var(--muted); font-size: 13px; padding-top: 14px; }
tr.not-mine td { opacity: .6; }

/* Yönetim: elle skor */
input.goals { width: 4.5em; }
