/* WC 2026 Tippspiel — NeuroNation design system (SPEC §11).
   Mint/teal palette, Inter, rounded cards, pill buttons. Mobile-first, responsive. */

:root {
  /* NeuroNation tokens */
  --mint: #8fd8c7;
  --mint-2: #7bccb8;
  --mint-soft: #e9f6f2;
  --mint-line: #cfe9e1;
  --teal: #2f9e89;
  --teal-deep: #1d7a69;
  --btn-ink: #0e3a31;

  --gold: #d9a441; --gold-soft: #f7efdc;
  --silver: #94a4ad; --silver-soft: #eef1f3;
  --bronze: #bd7e51; --bronze-soft: #f4ece3;
  --slate: #5f7e92;

  /* Mapped semantic tokens (used across the app) */
  --color-primary: var(--mint);
  --color-primary-hover: var(--mint-2);
  --color-primary-soft: var(--mint-soft);
  --color-bg: #ffffff;
  --color-bg-subtle: #f7fbfa;
  --color-border: #e7edeb;
  --color-border-strong: #dbe5e1;
  --color-text: #16201d;
  --color-text-muted: #586863;
  --color-muted: #8a9893;
  --color-success: #2e9e5b; --color-success-soft: #e6f4ec;
  --color-danger: #d2453d; --color-danger-soft: #fbe9e8;
  --color-warning: #c98a00;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 3px rgba(20,60,48,.05), 0 1px 2px rgba(20,60,48,.04);
  --shadow: 0 8px 26px -14px rgba(20,60,48,.22);
  --shadow-lg: 0 22px 48px -26px rgba(20,60,48,.30);
  --maxw: 1140px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -.005em;
  color: var(--color-text);
  background: var(--color-bg-subtle);
  background-image: radial-gradient(820px 420px at 92% -10%, rgba(143,216,199,.20), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.main { padding: 30px 28px 70px; min-height: 60vh; }
@media (max-width: 600px) { .container, .main { padding-left: 16px; padding-right: 16px; } }

h1 { font-size: clamp(23px, 3.4vw, 30px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 32px 0 14px; }
h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.muted { color: var(--color-muted); }
.lead { color: var(--color-text-muted); margin-top: 0; font-weight: 500; }
a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Nav ---- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--color-border); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 22px; padding: 12px 28px; }
.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; }
.brand:hover { text-decoration: none; }
.crest { position: relative; width: 38px; height: 38px; border-radius: 50%; background: var(--mint); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.crest img { width: 100%; height: 100%; object-fit: cover; }
.crest-fallback { display: none; color: var(--btn-ink); font-weight: 800; font-size: 18px; }
.brand-text b { display: block; font-weight: 700; font-size: 15px; line-height: 1.1; color: var(--color-text); }
.brand-text span { display: block; font-size: 10.5px; color: var(--color-muted); font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.nav-links { display: flex; gap: 2px; }
.nav-links a { color: var(--color-text-muted); font-size: 13.5px; font-weight: 600; padding: 8px 13px; border-radius: 999px; transition: .18s; }
.nav-links a:hover { background: var(--mint-soft); text-decoration: none; }
.nav-links a.active { color: var(--teal-deep); background: var(--mint-soft); }
.user { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; padding: 6px 6px 6px 14px; border: 1px solid var(--color-border); border-radius: 999px; background: #fff; }
.user .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); flex-shrink: 0; }
.user-logout { font: inherit; color: var(--color-muted); border: none; cursor: pointer; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--mint-soft); }
.user-logout:hover { color: var(--teal-deep); }
.nav-toggle, .nav-burger { display: none; }

/* ---- Cards ---- */
.card { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; margin-bottom: 16px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3,1fr); } }

/* ---- Buttons (mint pills) ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 11px 22px; border: 1.5px solid transparent; border-radius: 999px; font-family: var(--font); font-size: 14px; font-weight: 700; cursor: pointer; background: var(--mint); color: var(--btn-ink); transition: background-color .18s, box-shadow .18s, color .18s, border-color .18s; }
.btn:hover { background: var(--mint-2); box-shadow: var(--shadow); text-decoration: none; }
.btn-sm { min-height: 38px; padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-secondary { background: #fff; color: var(--teal-deep); border-color: var(--mint); }
.btn-secondary:hover { background: var(--mint); color: var(--btn-ink); }
.btn-ghost { background: #fff; color: var(--color-text); border-color: var(--color-border); }
.btn-ghost:hover { background: var(--color-bg-subtle); box-shadow: none; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #b23a33; }

/* ---- Forms ---- */
label { font-weight: 600; display: block; margin-bottom: 6px; font-size: 13.5px; }
input, select { width: 100%; font-size: 16px; font-family: inherit; padding: 11px 13px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fff; color: var(--color-text); }
input:focus, select:focus { outline: 2px solid var(--mint); outline-offset: 1px; border-color: var(--mint); }
.field { margin-bottom: 14px; }
.form-narrow { max-width: 420px; }

/* ---- Auth pages (login / register) ---- */
.auth { max-width: 430px; margin: 7vh auto 0; }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 18px; }
.auth-brand .crest { width: 54px; height: 54px; }
.auth-brand .crest-fallback { font-size: 26px; }
.auth-brand .brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.auth-brand .brand-tag { font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--color-muted); }
.auth .card { box-shadow: var(--shadow-lg); border-radius: 24px; padding: 28px; }
.auth .card h1 { font-size: 22px; }
.auth-alt { text-align: center; margin-top: 16px; color: var(--color-muted); }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 600px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.alert-error { background: var(--color-danger-soft); color: var(--color-danger); }
.alert-success { background: var(--color-success-soft); color: var(--color-success); }
.alert-info { background: var(--mint-soft); color: var(--teal-deep); }

/* ---- Chips ---- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .3px; padding: 5px 11px; border-radius: 999px; background: var(--color-bg-subtle); color: var(--color-muted); text-transform: uppercase; }
.chip-predicted { background: var(--mint-soft); color: var(--teal-deep); }
.chip-locked { background: #eceff0; color: var(--color-muted); }
.chip-notpred { background: #fff4e0; color: var(--color-warning); }
.chip-success { background: var(--color-success-soft); color: var(--color-success); }
.chip-danger { background: var(--color-danger-soft); color: var(--color-danger); }
.chip-premium { background: var(--gold-soft); color: #9c7320; }

/* ---- Hero + prizes (dashboard) ---- */
.hero { position: relative; overflow: hidden; border-radius: 28px; background: #fff; border: 1px solid var(--color-border); box-shadow: var(--shadow-lg); padding: 34px 32px 28px; margin-bottom: 18px; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(460px 220px at 90% -25%, var(--mint-soft), transparent 60%); }
.hero > * { position: relative; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--teal-deep); background: var(--mint-soft); border: 1px solid var(--mint-line); padding: 6px 14px; border-radius: 999px; }
.hero h1 { font-size: clamp(25px, 4vw, 36px); line-height: 1.12; margin: 16px 0 9px; }
.hero h1 em { color: var(--teal); font-style: normal; }
.hero-sub { color: var(--color-text-muted); font-size: 15px; max-width: 570px; font-weight: 500; }
.prizes { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 24px; }
.prize { position: relative; border-radius: var(--radius); padding: 20px; background: #fff; border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.prize:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.prize::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; }
.prize.gold::before { background: linear-gradient(90deg, var(--gold), #ecc878); }
.prize.silver::before { background: linear-gradient(90deg, var(--silver), #c2ccd2); }
.prize.bronze::before { background: linear-gradient(90deg, var(--bronze), #d6a079); }
.prize-head { display: flex; align-items: center; gap: 11px; margin: 4px 0 12px; }
.medal { font-size: 26px; line-height: 1; }
.rankpill { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; }
.gold .rankpill { background: var(--gold-soft); color: #9c7320; }
.silver .rankpill { background: var(--silver-soft); color: #5d6c74; }
.bronze .rankpill { background: var(--bronze-soft); color: #945e36; }
.prize h3 { font-size: 16px; margin-bottom: 5px; }
.prize p { font-size: 13.5px; color: var(--color-text-muted); font-weight: 500; }
.hero-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); font-size: 13px; color: var(--color-muted); font-weight: 500; }
.bonus { display: inline-flex; align-items: center; gap: 8px; background: var(--mint-soft); border: 1px solid var(--mint-line); color: var(--teal-deep); padding: 7px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } }
.stat { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 20px; background: #fff; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 16px; }
.stat .ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 23px; flex-shrink: 0; background: var(--mint-soft); }
.stat.rank .ic { background: var(--gold-soft); }
.stat.todo .ic { background: #eef3f6; }
.stat .big { font-size: 32px; font-weight: 800; line-height: .95; letter-spacing: -.03em; color: var(--teal); }
.stat.rank .big { color: var(--gold); }
.stat.todo .big { color: var(--slate); }
.stat .label, .stat .lbl { font-size: 12.5px; color: var(--color-muted); font-weight: 600; margin-top: 5px; }

/* ---- Match rows ---- */
.match { border: 1px solid var(--color-border); border-radius: var(--radius); background: #fff; padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; }
.match:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--color-border-strong); }
.match-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.match-time { font-size: 12.5px; color: var(--color-muted); font-weight: 500; }
.match-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.team { font-weight: 700; letter-spacing: -.01em; }
.team-a { text-align: right; }
.team-b { text-align: left; }
.vs { color: #b3c1bc; font-weight: 700; font-size: 12px; letter-spacing: 1px; }
.team .fi, .match-teams .fi { border-radius: 4px; vertical-align: -2px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.team-a .fi, .team-b .fi { margin: 0 5px; }

.score-inputs { display: inline-flex; align-items: center; gap: 8px; }
.score-inputs input { width: 56px; text-align: center; font-size: 1.25rem; font-weight: 700; padding: 10px 6px; }
.score-dash { font-weight: 700; color: var(--color-muted); }
.score-final { font-size: 1.5rem; font-weight: 800; color: var(--teal); }
.save-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.countdown { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--teal-deep); background: var(--mint-soft); padding: 3px 10px; border-radius: 999px; }
.countdown.soon { color: var(--color-danger); background: var(--color-danger-soft); }

/* ---- Tabs / filter ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs a { padding: 8px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--color-border); color: var(--color-text); font-weight: 600; font-size: 13.5px; }
.tabs a.active { background: var(--mint); color: var(--btn-ink); border-color: var(--mint); }
.tabs a:hover { text-decoration: none; background: var(--mint-soft); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-bar .field { margin-bottom: 0; flex: 1; min-width: 130px; }
.filter-bar .filter-actions { display: flex; gap: 8px; flex: 0 0 auto; }
@media (max-width: 600px) { .filter-bar .field { min-width: 45%; } }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
table.data th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--color-muted); font-weight: 700; }
table.data tr.me { background: var(--mint-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { font-weight: 800; }

@media (max-width: 600px) {
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive thead { display: none; }
  table.responsive tr { border: 1px solid var(--color-border); border-radius: var(--radius); margin-bottom: 12px; padding: 6px 14px; background: #fff; box-shadow: var(--shadow-sm); }
  table.responsive tr.me { background: var(--mint-soft); }
  table.responsive td { display: flex; justify-content: space-between; align-items: center; border: none; border-bottom: 1px solid var(--color-bg-subtle); padding: 8px 0; text-align: right; white-space: normal; }
  table.responsive td:last-child { border-bottom: none; }
  table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--color-muted); text-align: left; margin-right: 12px; font-size: .85rem; }
}

.empty { text-align: center; color: var(--color-muted); padding: 32px 0; }
.site-footer { color: var(--color-muted); font-size: .82rem; padding: 24px 28px 40px; text-align: center; }
.inline-form { display: inline; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- Mobile nav ---- */
@media (max-width: 860px) {
  .nav-burger { display: flex; flex-direction: column; gap: 5px; width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; border-radius: var(--radius-sm); order: 3; }
  .nav-burger span { width: 22px; height: 2px; background: var(--color-text); border-radius: 2px; }
  .nav-inner { flex-wrap: wrap; position: relative; }
  .nav-links { display: none; order: 4; flex-direction: column; align-items: stretch; gap: 2px; width: 100%; padding-top: 10px; }
  .nav-links a { padding: 12px 14px; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .user .user-name { display: none; }
}
@media (max-width: 420px) { .brand-text span { display: none; } }
