/* Konsül Baronları */
:root {
  --ink: #0b1c2b;
  --ink-2: #102a3e;
  --ink-3: #18394f;
  --line: #2a536d;
  --paper: #e6edf0;
  --paper-2: #cfdadf;
  --paper-3: #b4c4cc;
  --paper-ink: #10222f;
  --paper-mute: #54697a;
  --text: #e9f1f5;
  --mute: #93abbb;
  --cini: #3ac0b3;
  --cini-ink: #05322e;
  --seal: #c63a2e;
  --seal-dark: #8f2219;
  --brass: #dcb45c;
  --good: #1f8a5c;
  --warn: #e7a23a;
  --bad: #d4574b;
  --radius: 4px;
  --font: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --gutter: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  font-variation-settings: "wdth" 100;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--cini); }
h1, h2, h3, h4 { font-family: var(--font); font-variation-settings: "wdth" 78; font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(38px, 11vw, 68px); }
h2 { font-size: clamp(26px, 6.5vw, 36px); }
h3 { font-size: 21px; }
p { margin: 0 0 12px; }
:focus-visible { outline: 3px solid var(--cini); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }
main.wrap { padding-bottom: calc(96px + var(--safe-b)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrapx { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.mute { color: var(--mute); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* Üst bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(11, 28, 43, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ink-3); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { font-variation-settings: "wdth" 76; font-weight: 800; font-size: 22px; letter-spacing: -0.01em; white-space: nowrap; }

/* Düğmeler */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--radius);
  background: var(--cini); color: var(--cini-ink); font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .15s ease;
}
.btn:hover { background: #55d1c5; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--ink-2); }
.btn.danger { background: transparent; color: #ff9b90; box-shadow: inset 0 0 0 1.5px #6e2d29; }
.btn.danger:hover { background: #2a1513; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--cini); text-decoration: underline; cursor: pointer; }

/* Form */
.field { display: block; }
.field > span { display: block; font-size: 14px; color: var(--mute); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--ink-2); color: var(--text);
}
.field input::placeholder { color: #5f7c8f; }
.field input:focus { border-color: var(--cini); outline: none; box-shadow: 0 0 0 3px rgba(58, 192, 179, .25); }
.panel { background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--radius); padding: 18px; }
.panel h3 { margin-bottom: 10px; }
.notice { padding: 12px 14px; border-radius: var(--radius); background: #3a2a10; color: #f6d9a4; font-size: 15px; }
.notice.bad { background: #3a1714; color: #ffc3bb; }
.empty { padding: 28px 16px; text-align: center; color: var(--mute); }
.empty b { display: block; color: var(--text); font-size: 20px; font-variation-settings: "wdth" 80; margin-bottom: 4px; }

/* Karşılama */
.hero { padding: 34px 0 10px; display: grid; gap: 26px; }
.hero h1 { max-width: 12ch; }
.hero p.lead { font-size: 19px; max-width: 34ch; color: #c6d8e2; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; }
.demo { position: relative; background: var(--paper); color: var(--paper-ink); border-radius: var(--radius); padding: 18px 18px 16px; max-width: 460px; }
.demo::before, .sheet::before { content: ""; position: absolute; left: 0; right: 0; top: -7px; height: 7px; background: var(--paper);
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
          mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%; }
.demo .teams { font-variation-settings: "wdth" 78; font-weight: 800; font-size: 28px; line-height: 1.05; }
.demo .meta { color: var(--paper-mute); font-size: 14px; margin-bottom: 10px; }
.demo .sealbox { margin-top: 14px; min-height: 126px; display: flex; align-items: center; justify-content: center; position: relative; }
.demo .guesses { display: grid; gap: 6px; width: 100%; }

/* Mühür */
.sealwrap { position: relative; width: 92px; height: 92px; flex: none; }
.sealwrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sealwrap .half-l { clip-path: inset(0 50% 0 0); }
.sealwrap .half-r { clip-path: inset(0 0 0 50%); }
.sealwrap.broken .half-l { animation: crackL .7s cubic-bezier(.4, 1.4, .5, 1) forwards; }
.sealwrap.broken .half-r { animation: crackR .7s cubic-bezier(.4, 1.4, .5, 1) forwards; }
@keyframes crackL { to { transform: translate(-30px, 22px) rotate(-26deg); opacity: 0; } }
@keyframes crackR { to { transform: translate(30px, 30px) rotate(24deg); opacity: 0; } }
.reveal { animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.steps { counter-reset: s; display: grid; gap: 14px; padding: 0; margin: 14px 0 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(s); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-3); font-weight: 800; font-variation-settings: "wdth" 80; font-size: 20px; }
.steps b { display: block; font-size: 18px; }
.section { margin-top: 44px; }
.section > h2 { margin-bottom: 14px; }

.rules { width: 100%; border-collapse: collapse; background: var(--ink-2); border-radius: var(--radius); overflow: hidden; }
.rules th, .rules td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--ink-3); vertical-align: top; }
.rules th { font-weight: 600; color: var(--mute); font-size: 14px; }
.rules td.n { font-variation-settings: "wdth" 80; font-weight: 800; font-size: 22px; text-align: center; white-space: nowrap; }
.rules tr:last-child td { border-bottom: 0; }

/* Hafta seçici */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chip {
  display: inline-flex; align-items: center; text-decoration: none;
  flex: none; min-height: 40px; padding: 0 14px; border-radius: 20px; cursor: pointer;
  border: 1.5px solid var(--line); background: transparent; color: var(--text); font-weight: 600; white-space: nowrap;
}
.chip[aria-pressed="true"], .chip.on { background: var(--text); color: var(--ink); border-color: var(--text); }
.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--seal); margin-right: 7px; }

/* Fikstür kâğıdı */
.sheet { position: relative; background: var(--paper); color: var(--paper-ink); border-radius: var(--radius); margin-top: 8px; }
.sheet-head { padding: 16px 16px 12px; }
.sheet-head h2 { font-size: 30px; }
.sheet-head .sub { color: var(--paper-mute); font-size: 15px; margin-top: 4px; }
.sheet-head .alert { display: inline-block; margin-top: 8px; padding: 4px 10px; background: var(--seal); color: #fff; border-radius: 3px; font-weight: 700; font-size: 14px; }
.sheet-head .ok { display: inline-block; margin-top: 8px; padding: 4px 10px; background: #cfe9dc; color: #0c4a2f; border-radius: 3px; font-weight: 700; font-size: 14px; }
.baron { display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 10px 12px; background: #f3e6c4; color: #4a3708; border-radius: 3px; font-weight: 600; }
.baron svg { width: 26px; height: 26px; flex: none; }

.match { position: relative; display: grid; grid-template-columns: 62px 1fr; gap: 6px 12px; padding: 16px 16px 16px 14px; border-top: 2px dashed var(--paper-3); }
.match.missing { box-shadow: inset 5px 0 0 var(--seal); }
.match .when { font-variation-settings: "wdth" 78; font-weight: 800; line-height: 1.05; }
.match .when .t { font-size: 24px; display: block; }
.match .when .d { font-size: 14px; font-weight: 600; color: var(--paper-mute); display: block; margin-top: 2px; font-variation-settings: "wdth" 90; }
.match .body { min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { padding: 2px 8px; border-radius: 3px; font-size: 13px; font-weight: 600; background: var(--paper-2); color: var(--paper-ink); }
.tag.big { background: var(--paper-ink); color: var(--paper); }
.tag.miss { background: var(--seal); color: #fff; }
.tag.live { background: var(--warn); color: #3a2503; }
.tag.cancel { background: var(--paper-3); }
.fx { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; }
.team { font-variation-settings: "wdth" 80; font-weight: 800; font-size: 22px; line-height: 1.1; overflow-wrap: anywhere; }
.score { display: flex; align-items: center; justify-content: flex-end; }
.score input {
  width: 54px; height: 50px; text-align: center; border-radius: var(--radius);
  border: 2px solid var(--paper-ink); background: #fff; color: var(--paper-ink);
  font-variation-settings: "wdth" 80; font-weight: 800; font-size: 28px; padding: 0; -moz-appearance: textfield;
}
.score input::-webkit-outer-spin-button, .score input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score input:focus { outline: 3px solid var(--cini); outline-offset: 1px; }
.score .final { min-width: 54px; height: 50px; display: grid; place-items: center; background: var(--paper-ink); color: var(--paper); border-radius: var(--radius); font-variation-settings: "wdth" 80; font-weight: 800; font-size: 28px; }
.pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.pick button {
  min-height: 44px; border-radius: var(--radius); border: 2px solid var(--paper-ink); background: transparent;
  color: var(--paper-ink); font-weight: 700; cursor: pointer; padding: 0 4px; font-size: 15px;
}
.pick button[aria-pressed="true"] { background: var(--paper-ink); color: var(--paper); }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; min-height: 36px; }
.foot .left { color: var(--paper-mute); font-size: 14px; }
.foot .left.urgent { color: var(--seal-dark); font-weight: 700; }
.foot .saved { color: var(--good); font-weight: 700; font-size: 14px; }
.match .btn { background: var(--paper-ink); color: var(--paper); }
.match .btn:hover { background: #1d3b50; }
.match .btn.ghost { background: transparent; color: var(--paper-ink); box-shadow: inset 0 0 0 1.5px var(--paper-3); }
.mine { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.mine .pts { font-weight: 800; padding: 3px 9px; border-radius: 3px; background: var(--paper-2); }
.mine .pts.hit { background: #cfe9dc; color: #0c4a2f; }
.mine .pts.exact { background: var(--brass); color: #3b2a04; }
.lockbox { margin-top: 10px; display: flex; align-items: center; gap: 12px; }
.lockbox .sealwrap { width: 54px; height: 54px; }
.guesslist { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.g { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 9px; border-radius: 3px; background: var(--paper-2); font-size: 15px; }
.g b { font-variation-settings: "wdth" 80; font-weight: 800; font-size: 17px; }
.g.me { box-shadow: inset 0 0 0 2px var(--paper-ink); }
.g.none { background: transparent; color: var(--paper-mute); box-shadow: inset 0 0 0 1.5px var(--paper-3); }
.g .p { font-weight: 800; }
.g.hit { background: #cfe9dc; }
.g.exact { background: var(--brass); }

/* Alt gezinme */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(11, 28, 43, .97); border-top: 1px solid var(--ink-3); padding-bottom: var(--safe-b); }
.tabs .wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding-top: 6px; padding-bottom: 6px; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: var(--radius); text-decoration: none; color: var(--mute); font-weight: 600; font-size: 14px; }
.tabs a[aria-current="page"] { color: var(--text); background: var(--ink-2); }
.tabs svg { width: 22px; height: 22px; }
.lobbyhead { padding: 18px 0 6px; }
.lobbyhead h1 { font-size: clamp(30px, 8vw, 44px); }
.code { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 5px 6px 5px 12px; border-radius: var(--radius); background: var(--ink-2); font-variation-settings: "wdth" 85; font-weight: 800; font-size: 18px; letter-spacing: .08em; }

/* Puan tablosu */
.tablewrap { overflow-x: auto; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--ink-3); -webkit-overflow-scrolling: touch; }
table.board { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 100%; }
.board th, .board td { padding: 11px 10px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--ink-3); }
.board th { font-weight: 600; color: var(--mute); font-size: 13px; background: var(--ink-2); }
.board td.who, .board th.who { text-align: left; position: sticky; left: 0; background: var(--ink-2); z-index: 2; min-width: 148px; box-shadow: 1px 0 0 var(--ink-3); }
.board td.who { font-weight: 700; }
.board td.who .rk { display: inline-block; width: 24px; color: var(--mute); font-variant-numeric: tabular-nums; }
.board td.tot { font-variation-settings: "wdth" 80; font-weight: 800; font-size: 22px; }
.board tr.me td { background: #16384f; }
.board tr.me td.who { background: #16384f; }
.board tbody tr:last-child td { border-bottom: 0; }
.board td.cell { color: #cfe0ea; font-variant-numeric: tabular-nums; }
.board td.cell.top { color: var(--brass); font-weight: 800; }
.board td.cell.zero { color: #4f6e82; }
.crown { width: 17px; height: 17px; vertical-align: -3px; color: var(--brass); margin-left: 4px; }
.sum { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--mute); margin-top: 8px; }
.barons { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #2b2411; color: #f7e6b4; border-radius: var(--radius); margin: 12px 0; }
.barons svg { width: 34px; height: 34px; flex: none; color: var(--brass); }
.barons b { font-variation-settings: "wdth" 80; font-size: 20px; }

/* Üyeler */
.members { list-style: none; margin: 0; padding: 0; }
.members li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--ink-3); }
.members li:last-child { border-bottom: 0; }
.members .nm { flex: 1 1 auto; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 3px; background: var(--brass); color: #3b2a04; }

.lobbies { list-style: none; margin: 0; padding: 0; }
.lobbies a { display: flex; align-items: center; gap: 12px; padding: 16px 4px; border-bottom: 1px solid var(--ink-3); text-decoration: none; color: var(--text); }
.lobbies .nm { font-variation-settings: "wdth" 80; font-weight: 800; font-size: 24px; line-height: 1.1; }
.lobbies .chev { margin-left: auto; color: var(--mute); }

#toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
#toast div { pointer-events: auto; padding: 12px 14px; border-radius: var(--radius); background: var(--text); color: var(--ink); font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); animation: rise .25s ease both; }
#toast div.bad { background: #ffd9d4; color: #5a130c; }

.loading { padding: 60px 0; text-align: center; color: var(--mute); }
.spin { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink-3); border-top-color: var(--cini); animation: sp .8s linear infinite; vertical-align: middle; margin-right: 10px; }
@keyframes sp { to { transform: rotate(360deg); } }
footer.site { padding: 28px var(--gutter) 40px; color: var(--mute); font-size: 14px; text-align: center; }

@media (min-width: 720px) {
  .hero { grid-template-columns: 1.1fr .9fr; align-items: center; padding-top: 56px; }
  .match { grid-template-columns: 82px 1fr; padding: 18px 22px 18px 18px; }
  .team { font-size: 26px; }
  .tabs .wrap { max-width: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 440px) {
  .brand b { font-size: 18px; }
  .brand svg { width: 28px; height: 28px; }
  .top .wrap { gap: 8px; }
  .top .btn.sm { padding: 0 10px; font-size: 13px; }
}
