/* World Cup Market — modern minimal. Bold/thin Inter, ink-on-bone palette. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;500;700;900&display=swap');

:root {
  --bg:      #F4F3EF;   /* bone */
  --surface: #FFFFFF;
  --ink:     #0B0B0C;   /* near-black */
  --muted:   #8C8A85;
  --line:    #E6E4DE;
  --a:       #2D5BFF;   /* Team A — electric blue */
  --draw:    #9A9890;   /* Draw — neutral */
  --b:       #FF4D3D;   /* Team B — vermillion */
  --win:     #11A36B;   /* earnings green */
  --radius:  16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 300;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3, h4 { font-weight: 900; letter-spacing: -0.04em; margin: 0; }
h1 { font-size: 2.6rem; }
h3 { font-size: 1.4rem; }
.thin { font-weight: 200; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* ---- nav ---- */
.nav {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.1rem 2rem; border-bottom: 1px solid var(--line);
  background: var(--bg); position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 900; letter-spacing: -0.05em; font-size: 1.15rem; text-decoration: none; }
.nav a.link { text-decoration: none; color: var(--muted); font-weight: 500; font-size: .92rem; }
.nav a.link:hover { color: var(--ink); }
.nav .spacer { margin-left: auto; }
.nav .who { font-weight: 700; }

.wrap { max-width: 860px; margin: 0 auto; padding: 2.5rem 2rem 4rem; }

/* ---- cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem;
}
.card h4 { font-size: 1.05rem; margin-bottom: 1rem; }

.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .68rem; font-weight: 700; color: var(--muted); }

/* ---- forms ---- */
label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .35rem; color: var(--muted); }
input, select {
  width: 100%; padding: .7rem .85rem; font: inherit; font-weight: 400;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; outline: none;
}
input:focus, select:focus { border-color: var(--ink); }
.field { margin-bottom: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }

button, .btn {
  font: inherit; font-weight: 700; cursor: pointer;
  padding: .7rem 1.3rem; border-radius: 10px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; text-decoration: none; display: inline-block;
  transition: transform .06s ease, opacity .15s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); }
button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-link { background: none; border: none; color: var(--muted); padding: .5rem 0; }

/* ---- flash ---- */
.flash { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; font-size: .9rem; border: 1px solid var(--line); }
.flash.success { background: #E9F7F0; border-color: #BfE8D6; color: #0a6c47; }
.flash.danger  { background: #FDECEA; border-color: #F6C9C3; color: #b32218; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
td { padding: .75rem .6rem; border-bottom: 1px solid var(--line); font-weight: 400; }
tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---- badges / pills ---- */
.pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; border: 1px solid var(--line); }
.pill.live    { background: var(--ink); color: #fff; }
.pill.settled { background: var(--win); color: #fff; border-color: var(--win); }
.pill.locked  { background: #efeee9; color: var(--muted); }

.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tab { padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .85rem; color: var(--muted); background: var(--surface); }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- allocation grid (3 sides) ---- */
.match { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.match:last-child { border-bottom: none; }
.match .teams { font-weight: 700; font-size: 1.05rem; margin-bottom: .8rem; }
.sides { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.side label { display: flex; align-items: center; gap: .4rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.A { background: var(--a); } .dot.Draw { background: var(--draw); } .dot.B { background: var(--b); }
.side input { text-align: right; font-variant-numeric: tabular-nums; }

.allocbar {
  position: sticky; bottom: 0; margin-top: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.25rem;
}
.allocbar .total { font-weight: 900; font-size: 1.5rem; letter-spacing: -0.04em; }
.status { font-weight: 700; font-size: .85rem; }
.status.ok { color: var(--win); } .status.over { color: var(--b); } .status.warn { color: var(--muted); }

/* ---- market bars ---- */
.bar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; margin: .6rem 0 .4rem; background: #efeee9; }
.bar span { display: block; }
.bar .A { background: var(--a); } .bar .Draw { background: var(--draw); } .bar .B { background: var(--b); }
.legend { display: flex; gap: 1.25rem; font-size: .82rem; }
.legend .item { display: flex; align-items: center; gap: .4rem; }
.legend b { font-weight: 700; }
.win-tag { color: var(--win); font-weight: 800; }
.big { font-size: 2.2rem; font-weight: 900; letter-spacing: -0.04em; }

/* ---- copy button (hover to reveal) ---- */
.copy {
  margin-left: .6rem; padding: .15rem .55rem; font-size: .72rem; font-weight: 700;
  border-radius: 7px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s ease;
}
tr:hover .copy { opacity: 1; }
.copy:hover { color: var(--ink); border-color: var(--ink); transform: none; }
.copy.copied { background: var(--win); color: #fff; border-color: var(--win); opacity: 1; }

/* ---- historic / groups ---- */
.wrap.wide { max-width: 1080px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }
.gtable td, .gtable th { padding: .4rem .5rem; font-size: .9rem; }
.gtable .rank { color: var(--muted); width: 1.4rem; font-variant-numeric: tabular-nums; }
.gtable tr.pos1 td, .gtable tr.pos2 td { font-weight: 600; }
.gtable tr.pos1 .rank { color: var(--win); font-weight: 800; }
.gtable tr.pos2 .rank { color: var(--a); font-weight: 800; }
.gtable tr.pos3 .rank { color: var(--ink); }
.results { margin-top: .8rem; display: flex; flex-direction: column; gap: .15rem; }
.res { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center;
       text-decoration: none; font-size: .82rem; padding: .25rem .3rem; border-radius: 6px; }
.res:hover { background: var(--bg); }
.res .r { text-align: right; }
.res b { font-variant-numeric: tabular-nums; }

/* ---- knockout bracket ---- */
.bracket { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: stretch; }
.col { display: flex; flex-direction: column; justify-content: space-around; gap: .8rem; min-width: 190px; }
.col-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; color: var(--muted); margin-bottom: .3rem; }
.tie { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
       padding: .55rem .7rem; text-decoration: none; }
.tie:hover { border-color: var(--ink); }
.tie .row { display: flex; justify-content: space-between; gap: .5rem; font-size: .86rem; padding: .12rem 0; }
.tie .row.win { font-weight: 800; }
.tie .tm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tie .sc { font-variant-numeric: tabular-nums; color: var(--muted); }
.tie .row.win .sc { color: var(--win); }
.tie-meta { font-size: .66rem; color: var(--muted); margin-top: .3rem; }

/* ---- game detail ---- */
.scorecard { display: flex; align-items: center; justify-content: center; gap: 2rem; }
.scorecard .side { text-align: center; }
.scorecard .tm { font-weight: 800; font-size: 1.2rem; }
.scorecard .sc { font-size: 3rem; font-weight: 900; letter-spacing: -0.04em; }
.scorecard .vs { color: var(--muted); }

/* ---- admin score form ---- */
details { margin: .8rem 0; }
summary { cursor: pointer; padding: .5rem 0; font-size: .95rem; }
.scoreform { margin-top: .5rem; }
.scoreform td { padding: .25rem .4rem; border-bottom: 1px solid var(--line); font-size: .85rem; }
.scoreform .tname { font-weight: 500; }
.scoreform .tname.r { text-align: right; }
.scoreform input { width: 56px; padding: .3rem; text-align: center; }

/* ---- goals / scorers two columns ---- */
.goals { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.goals ul { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.goals ul li { padding: .2rem 0; }
.goals ul.r { text-align: right; }
.goals b { font-variant-numeric: tabular-nums; }

/* ---- live countdown header ---- */
.live-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .4rem; }
.live-head .eyebrow { margin: 0; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot.static { background: var(--muted); }       /* locked: calm, fixed */
.dot.live {                                       /* open: pulsing, morphing blob */
  background: var(--win);
  animation: live-pulse 2.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%   { transform: scale(.85); border-radius: 50%;           opacity: .75; box-shadow: 0 0 0 0 rgba(17,163,107,.45); }
  50%  { transform: scale(1.12); border-radius: 42% 58% 53% 47% / 55% 45% 55% 45%; opacity: 1; box-shadow: 0 0 0 7px rgba(17,163,107,0); }
  100% { transform: scale(.85); border-radius: 50%;           opacity: .75; box-shadow: 0 0 0 0 rgba(17,163,107,0); }
}
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }

/* ---- auth ---- */
.auth { max-width: 380px; margin: 5rem auto; }
.auth h1 { margin-bottom: 1.5rem; }
