/* Logo font: Altair Two BC — the @font-face comes from /fonts/logo.css (see public/fonts/README.md). */

:root {
  --green: #00703c;
  --green-dark: #00502a;
  --bg: #f3f5f4;
  --card: #ffffff;
  --text: #17201b;
  --muted: #66736b;
  --border: #dde3df;
  --win: #00703c;
  --loss: #c0392b;
  --live: #e67e22;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1512;
    --card: #18211c;
    --text: #e7ece9;
    --muted: #93a199;
    --border: #2a362f;
    --win: #2ecc71;
    --loss: #ff6b5b;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
[hidden] { display: none !important; }

.topbar {
  background: var(--green);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
}
.brand { font-weight: 800; font-size: 1.2rem; }
.topbar .link { color: #fff; }
#userbox { display: flex; gap: 12px; align-items: center; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 0 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.narrow { max-width: 380px; margin: 32px auto; }
.list { display: grid; gap: 10px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.error { color: var(--loss); min-height: 1.2em; margin: 4px 0; font-size: .9rem; }

label { display: block; margin-bottom: 12px; font-size: .9rem; color: var(--muted); }
label input {
  display: block; width: 100%; margin-top: 4px; padding: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.primary {
  background: var(--green); color: #fff; border: 0; border-radius: 8px;
  padding: 10px 16px; font-weight: 600; cursor: pointer;
}
.primary:hover { background: var(--green-dark); }
.primary:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; color: inherit; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600;
}
.tab.active { color: var(--green); border-bottom-color: var(--green); }
@media (prefers-color-scheme: dark) { .tab.active { color: var(--win); border-bottom-color: var(--win); } }

.small { font-size: .85rem; }
.big { font-size: 2.4rem; font-weight: 800; margin: 4px 0; }
.pos { color: var(--win); }
.neg { color: var(--loss); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
#nav { overflow-x: auto; scrollbar-width: none; }
#nav .tab { white-space: nowrap; }

.chip {
  background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 99px;
  padding: 4px 12px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums;
}
.chip.negative { background: var(--loss); }

/* Pager + swipeable game */
.pager { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pager-mid { flex: 1; text-align: center; line-height: 1.3; }
.arrow {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.arrow:disabled { opacity: .3; cursor: default; }
.viewport { overflow: hidden; touch-action: pan-y; }
#slide { transition: transform .15s ease-out; }
#slide.from-right { animation: from-right .22s ease-out; }
#slide.from-left { animation: from-left .22s ease-out; }
@keyframes from-right { from { transform: translateX(40px); opacity: 0; } }
@keyframes from-left { from { transform: translateX(-40px); opacity: 0; } }

.game-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.matchup { display: flex; align-items: center; gap: 8px; margin: 18px 0 14px; }
.team { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-weight: 700; }
.team img, .crest-gap { width: 56px; height: 56px; object-fit: contain; }
.team-name { overflow-wrap: anywhere; }
.score { font-size: 1.8rem; font-weight: 800; min-width: 96px; text-align: center; font-variant-numeric: tabular-nums; }
.badge { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; color: #fff; white-space: nowrap; }
.badge.W { background: var(--win); }
.badge.L { background: var(--loss); }
.badge.live { background: var(--live); }
.badge.open { background: var(--green); }
.pot { text-align: center; color: var(--muted); }
.pot b { color: var(--text); font-size: 1.15rem; }
.jackpot { color: var(--live); font-weight: 600; }
.banner { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; text-align: center; }
.banner.win { background: color-mix(in srgb, var(--win) 15%, transparent); }
.banner.roll { background: color-mix(in srgb, var(--live) 15%, transparent); }
.banner.muted { background: var(--bg); }
.game h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 4px; }

.bet-form { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; display: grid; gap: 10px; justify-items: center; }
.bet-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.bet-form .status { margin: 0; min-height: 1.2em; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 10px 16px; cursor: pointer; color: var(--muted); font-weight: 700; }
.seg button.on.win { background: var(--win); color: #fff; }
.seg button.on.loss { background: var(--loss); color: #fff; }
.bet-form input {
  width: 80px; padding: 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); text-align: center; font-size: 1.1rem;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.table th.num, .table td.num { text-align: right; }
.table tr:last-child td { border-bottom: 0; }
.table tr.mine td { background: color-mix(in srgb, var(--green) 9%, transparent); }
.table tr.winner td { background: color-mix(in srgb, var(--win) 18%, transparent); font-weight: 700; }

/* Admin */
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.admin-balance { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.admin-balance input {
  flex: 1; min-width: 110px; padding: 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.admin-buttons { display: flex; gap: 8px; }
.primary.danger { background: var(--loss); }
.primary.danger:hover { background: color-mix(in srgb, var(--loss) 80%, black); }
.admin-actions { display: flex; gap: 14px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.setting-label { font-weight: 600; margin-bottom: 8px; }
label.radio { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 1rem; margin-bottom: 8px; cursor: pointer; }
label.radio input { width: auto; margin-top: 4px; display: inline; }

/* Language switcher */
.topbar { gap: 10px; flex-wrap: wrap; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.lang { display: inline-flex; border: 1px solid rgba(255,255,255,.4); border-radius: 99px; overflow: hidden; }
.lang button {
  background: none; border: 0; color: #fff; padding: 3px 9px; font-size: .8rem; font-weight: 700;
  cursor: pointer; opacity: .75; white-space: nowrap;
}
.lang button.on { background: #fff; color: var(--green); opacity: 1; }

/* Group chip in the top bar */
.brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.group-chip {
  background: rgba(255,255,255,.15); color: #fff; border: 1px dashed rgba(255,255,255,.5); border-radius: 99px;
  padding: 2px 10px; font-size: .8rem; font-weight: 600; cursor: pointer; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Sign-up group choice */
#group-choice { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px 2px; margin: 0 0 12px; }
#auth .banner { margin: 0 0 12px; }

/* Group page */
.group-title { margin: 0; font-size: 1.2rem; }
.invite-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.invite-box code {
  font-size: 1.4rem; font-weight: 800; letter-spacing: .15em; padding: 6px 12px;
  background: var(--bg); border: 1px dashed var(--border); border-radius: 8px;
}
.invite-link { overflow-wrap: anywhere; }
.inline-form { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.inline-form input {
  flex: 1; min-width: 150px; padding: 9px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.group-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Chat */
.chat { margin-top: 16px; }
.chat h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.chat-list { max-height: 360px; overflow-y: auto; display: grid; gap: 8px; padding: 2px; }
.msg { background: var(--bg); border-radius: 10px; padding: 8px 10px; max-width: 88%; }
.msg.mine { background: color-mix(in srgb, var(--green) 14%, var(--bg)); justify-self: end; }
.msg-head { display: flex; gap: 8px; align-items: baseline; font-size: .85rem; }
.msg-del { margin-left: auto; color: var(--muted); text-decoration: none; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-form textarea {
  flex: 1; resize: vertical; min-height: 44px; padding: 9px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit;
}

/* Super admin */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat { padding: 12px; }
.stat-value { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }
.scroll-x .table td, .scroll-x .table th { white-space: nowrap; }
.table td.actions { display: flex; gap: 10px; }
.table tr.blocked td { opacity: .55; }
.danger-link { color: var(--loss); }

/* Group settings form */
.settings-form .setting-label { margin-top: 14px; }
.settings-form .setting-label:first-child { margin-top: 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text); font-size: 1rem; margin: 6px 0; }
.setting-row .setting-label { margin: 0; }
.euro-input { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.euro-input input {
  width: 96px; padding: 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); text-align: right; font: inherit; display: inline;
}
.indent { margin-left: 28px; }
.settings-save { display: flex; align-items: center; gap: 12px; margin-top: 14px; }

/* Rules page */
#view-rules h3 { font-size: .95rem; margin: 16px 0 6px; }
#view-rules h3:first-child { margin-top: 0; }
.table.summary td:first-child { width: 50%; }
.table.summary td { white-space: normal; }
ul.options { padding-left: 20px; margin: 4px 0; }
ul.options li { margin: 4px 0; }
ul.options li.current { font-weight: 600; }
ul.options .badge { font-size: .7rem; vertical-align: middle; }

/* ---------- Logo ---------- */
.logo {
  font-family: 'Altair Two BC', 'Arial Black', 'Helvetica Neue', system-ui, sans-serif;
  font-weight: 900; letter-spacing: .01em; color: inherit; text-decoration: none; line-height: 1;
  font-size: 1.6rem;
}
.logo span { opacity: .65; }
.top-login {
  background: #fff; color: var(--green); border: 0; border-radius: 99px; padding: 5px 14px;
  font-weight: 700; cursor: pointer;
}

/* ---------- Landing page ---------- */
main:has(#landing:not([hidden])) { max-width: 1080px; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; padding: 28px 0 8px; }
.hero-logo { font-size: clamp(2.8rem, 9vw, 4.6rem); color: var(--green); margin-bottom: 14px; }
@media (prefers-color-scheme: dark) { .hero-logo { color: var(--win); } }
.hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); line-height: 1.15; margin: 0 0 12px; }
.hero-sub { font-size: 1.08rem; color: var(--muted); margin: 0 0 20px; max-width: 34em; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.big-btn { padding: 13px 20px; font-size: 1.05rem; border-radius: 10px; }
.secondary {
  background: var(--card); color: var(--text); border: 2px solid var(--green); border-radius: 10px;
  font-weight: 700; cursor: pointer;
}
.secondary:hover { background: color-mix(in srgb, var(--green) 8%, var(--card)); }
.primary.wide { width: 100%; margin-top: 6px; }
.hero-games { display: grid; gap: 10px; }
.teaser { border-width: 2px; border-color: color-mix(in srgb, var(--green) 35%, var(--border)); }
.teaser-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.small-matchup { margin: 14px 0 10px; }
.small-matchup .team img, .small-matchup .crest-gap { width: 48px; height: 48px; }
.teaser-list { padding: 10px 16px; display: grid; gap: 6px; }
.teaser-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .95rem; }
.landing-h2 {
  font-size: 1.4rem; text-transform: none; letter-spacing: 0; color: var(--text); margin: 40px 0 14px;
}
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.step h3 { margin: 8px 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }
.step-n {
  width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; font-weight: 800;
}
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; }
.feature { display: flex; gap: 12px; align-items: flex-start; }
.feature-icon { font-size: 1.6rem; line-height: 1; }
.feature h3 { margin: 0 0 4px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
.cta-bottom { margin-top: 40px; text-align: center; padding: 28px 16px; }
.cta-bottom h2 { font-size: 1.4rem; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0 0 16px; }
.cta-bottom .hero-cta { justify-content: center; margin: 0; }
.landing-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 32px 0 16px; }
.landing-footer p { max-width: 40em; margin: 8px auto 0; }
.small-logo { font-size: 1.2rem; color: var(--text); }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 12px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .steps { grid-template-columns: 1fr; }
  .hero-cta .big-btn { flex: 1 1 100%; }
}

/* ---------- Log in / sign up pop-up ---------- */
#auth-dialog {
  border: 0; padding: 0; background: transparent; width: min(400px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
}
#auth-dialog::backdrop { background: rgba(0, 0, 0, .55); }
#auth-dialog #auth { position: relative; padding-top: 12px; }
.dialog-close {
  position: absolute; top: 6px; right: 8px; background: none; border: 0; font-size: 1.6rem; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 4px 8px;
}
@media (max-width: 420px) {
  .topbar .logo { font-size: 1.3rem; }
  .lang button { padding: 3px 7px; }
  .top-login { padding: 4px 10px; font-size: .9rem; }
}
