:root {
  --bg: #0b0118;
  --bg-2: #15042c;
  --panel: #1c0a35;
  --panel-2: #241042;
  --line: #341a57;
  --text: #f2ecff;
  --muted: #a08cc4;
  --accent: #00ff87;
  --accent-2: #04f5ff;
  --magenta: #e90052;
  --amber: #ffb800;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

/* Must beat the display:flex/grid rules below on .sheet and .alerts. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: radial-gradient(1100px 600px at 50% -10%, #2a0a52 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 16px 10px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: rgba(11, 1, 24, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-main { display: flex; align-items: center; gap: 14px; }
.brand h1 { font-size: 20px; }
.brand p { margin: 2px 0 0; font-size: 12px; }

.live-score { margin-left: auto; text-align: right; line-height: 1; }
.live-score-value {
  font-size: 40px; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.live-score-label { font-size: 11px; color: var(--muted); margin-top: 4px; }

.statstrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  text-align: center;
}
.stat b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.topbar-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

.pill {
  font-size: 11px; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.pill.is-live {
  background: rgba(0, 255, 135, .12);
  border-color: var(--accent); color: var(--accent);
}
.pill.is-live::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 6px; vertical-align: middle;
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .25; } }

.btn {
  font: inherit; font-size: 12px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 12px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }

/* ------------------------------------------------------------------ tabs */

.tabbar {
  display: flex; gap: 2px; margin: 12px -16px -10px;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }

.tabbtn {
  flex: 1; min-width: 76px;
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--muted); background: none; border: 0;
  border-bottom: 2px solid transparent;
  padding: 11px 6px 9px; cursor: pointer; white-space: nowrap;
}
.tabbtn:hover { color: var(--text); }
.tabbtn.is-on { color: var(--accent); border-bottom-color: var(--accent); }

.tabpanel { display: none; }
.tabpanel.is-on { display: block; animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* -------------------------------------------------------------- tooltips */

.tip {
  border-bottom: 1px dotted currentColor;
  cursor: help; outline: none;
}
.tip:hover, .tip:focus { color: var(--accent-2); }

/* A single fixed-position box, moved to whatever is hovered. An absolutely
   positioned tooltip per label still occupies layout while hidden, which
   widened the sheet and produced a stray horizontal scrollbar. */
.tipbox {
  position: fixed; z-index: 80;
  max-width: 260px;
  background: #2b1150; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 11px;
  font-size: 11.5px; font-weight: 400; line-height: 1.45;
  text-transform: none; letter-spacing: 0; text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
  pointer-events: none;
}

/* ---------------------------------------------------------------- layout */

main { max-width: 940px; margin: 0 auto; padding: 16px; }

.panel {
  background: linear-gradient(180deg, var(--panel) 0%, rgba(28, 10, 53, .55) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.panel-head h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---------------------------------------------------------------- alerts */

.alerts { display: grid; gap: 8px; margin-bottom: 16px; }
.alert {
  display: flex; gap: 10px; align-items: baseline;
  background: rgba(233, 0, 82, .1);
  border: 1px solid rgba(233, 0, 82, .45);
  border-left-width: 3px;
  border-radius: 10px; padding: 9px 12px; font-size: 13px;
}
.alert.warn { background: rgba(255, 184, 0, .09); border-color: rgba(255, 184, 0, .45); }
.alert b { flex-shrink: 0; }

/* ----------------------------------------------------------------- pitch */

.pitch {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  padding: 16px 6px 20px;
  /* Mown bands + a touch of floodlight falloff toward the corners. */
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.10), transparent 70%),
    repeating-linear-gradient(180deg, #1f8a45 0 42px, #1b7d3e 42px 84px);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .35);
}
.pitch-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.rows { position: relative; display: grid; gap: 14px; }
/* No wrapping: a row of five must stay one row or the formation reads wrong,
   so cards shrink to fit instead. */
.row { display: flex; justify-content: center; gap: 5px; }

.card {
  position: relative;
  flex: 0 1 84px; min-width: 0; padding: 0;
  background: none; border: 0;
  cursor: pointer;
  text-align: center;
  transition: transform .12s ease;
}
.card:hover { transform: translateY(-3px); }
.card.is-done { opacity: .9; }
.card.is-blank { opacity: .55; }

.shot {
  position: relative; display: block;
  height: 62px;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .5));
}
.photo { height: 62px; width: auto; max-width: 100%; object-fit: contain; }

.crest {
  position: absolute; left: 2px; bottom: 0;
  width: 19px; height: 19px; object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}

.pts {
  position: absolute; right: 0; bottom: -2px;
  min-width: 23px; height: 23px; padding: 0 4px;
  border-radius: 6px;
  background: var(--accent); color: #04120a;
  font-size: 13px; font-weight: 800; line-height: 23px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.card.is-playing .pts { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(0, 255, 135, .3); } }

.armband {
  position: absolute; left: 0; top: 0;
  width: 19px; height: 19px; border-radius: 50%;
  background: #fff; color: #12002e;
  font-size: 10px; font-weight: 800; line-height: 19px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.armband.vc { background: var(--accent-2); }

.flag {
  position: absolute; right: 1px; top: 0;
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .85);
}
.flag.i, .flag.s { background: var(--magenta); }
.flag.d { background: var(--amber); }
.flag.u, .flag.n { background: #8d8d8d; }

.plate {
  display: block; margin-top: 3px;
  background: #12002e; color: #fff;
  font-size: 11px; font-weight: 650;
  padding: 3px 2px; border-radius: 4px 4px 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sub {
  display: block;
  background: rgba(255, 255, 255, .93); color: #1a0a2e;
  font-size: 9.5px; font-weight: 600;
  padding: 2px; border-radius: 0 0 4px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sub .sc { color: #007a3d; font-weight: 800; }

.bench {
  display: flex; gap: 5px; justify-content: center;
  background: repeating-linear-gradient(180deg, #17692f 0 42px, #145d2a 42px 84px);
  border-radius: 10px; padding: 14px 8px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .35);
}

/* Phone: cards are already flex-shrunk, so scale the type down to match. */
@media (max-width: 430px) {
  main { padding: 12px; }
  .panel { padding: 10px; }
  .pitch { padding: 12px 4px 16px; }
  .shot, .photo { height: 54px; }
  .plate { font-size: 10px; }
  .sub { font-size: 9px; }
  .pts { min-width: 20px; height: 20px; line-height: 20px; font-size: 12px; }
  .crest { width: 16px; height: 16px; }
  .armband { width: 17px; height: 17px; line-height: 17px; font-size: 9px; }
  #updated { display: none; }
  .live-score-value { font-size: 34px; }
}

/* ------------------------------------------------------- pending bonus */

.bonus {
  position: absolute; right: 0; top: -3px;
  min-width: 17px; height: 17px; padding: 0 3px;
  border-radius: 5px;
  background: var(--amber); color: #2b1a00;
  font-size: 10px; font-weight: 800; line-height: 17px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

/* -------------------------------------------------------- fixture ticker */

.ticker-wrap { overflow-x: auto; }
.ticker { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 11.5px; }
.ticker th {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 600; padding-bottom: 2px;
}
.ticker th.tk-player, .ticker td.tk-player {
  text-align: left; white-space: nowrap;
  position: sticky; left: 0; background: var(--panel); z-index: 1;
  padding-right: 8px;
}
.ticker tr.dim { opacity: .55; }
.ticker td.tk {
  text-align: center; padding: 5px 4px; border-radius: 5px;
  font-weight: 600; min-width: 52px;
}
.ticker td.tk i { font-style: normal; opacity: .65; font-size: 9.5px; margin-left: 2px; }
.ticker td.blank { background: rgba(255, 255, 255, .04); color: var(--muted); }

/* Fixture difficulty, 1 easiest to 5 hardest. */
.fdr-1, .tk.fdr-1 { background: rgba(0, 255, 135, .30); color: #062; }
.fdr-2, .tk.fdr-2 { background: rgba(0, 255, 135, .18); color: #0a7; }
.fdr-3, .tk.fdr-3 { background: rgba(190, 180, 210, .18); color: #cfc4e4; }
.fdr-4, .tk.fdr-4 { background: rgba(233, 0, 82, .22); color: #ff8fb0; }
.fdr-5, .tk.fdr-5 { background: rgba(233, 0, 82, .42); color: #ffc2d3; }
.tk.fdr-1, .tk.fdr-2 { color: #eafff4; }

/* -------------------------------------------------------------- matches */

.gwblock { margin-bottom: 18px; }
.gwblock:last-child { margin-bottom: 0; }
.dayblock { margin-bottom: 12px; }
.daylabel {
  font-size: 11px; color: var(--muted); font-weight: 600;
  padding: 4px 2px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.match {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 5px;
}
.match.is-live { border-color: var(--accent); background: rgba(0, 255, 135, .07); }
.match.is-done { opacity: .78; }

.m-top {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 10px;
}
.m-team {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; min-width: 0;
}
.m-team.home { justify-content: flex-end; text-align: right; }
.crest-sm { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }

.m-score {
  text-align: center; min-width: 74px;
  font-variant-numeric: tabular-nums;
}
.m-score b { font-size: 17px; }
.m-score .ko { font-size: 13px; color: var(--muted); }
.m-score .mn { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.match.is-live .m-score .mn { color: var(--accent); }

.m-mine {
  display: flex; gap: 5px; flex-wrap: wrap;
  margin-top: 9px; padding-top: 8px;
  border-top: 1px solid var(--line);
}
.m-player {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 9px 2px 2px;
  font-size: 11.5px; font-weight: 600;
}
.m-player.bench { opacity: .55; }
.m-player .photo {
  width: 20px; height: 20px; border-radius: 50%;
  object-fit: cover; object-position: top center;
  background: linear-gradient(180deg, #2f8f4c, #1b7d3e);
}
.m-player .cap {
  background: #fff; color: #12002e; border-radius: 50%;
  width: 14px; height: 14px; font-size: 8px; line-height: 14px; text-align: center;
}
.m-player .cap.vc { background: var(--accent-2); }
.m-player .m-pts { color: var(--accent); font-variant-numeric: tabular-nums; }

@media (max-width: 480px) {
  .m-team { font-size: 12px; gap: 5px; }
  .m-score { min-width: 60px; }
}

/* --------------------------------------------------------- season chart */

.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: rgba(190, 170, 220, .45); }
.chart .bar-good { fill: var(--accent); }
.chart .grid { stroke: rgba(255, 255, 255, .09); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 9px; text-anchor: middle; }
.chart .avgline {
  fill: none; stroke: var(--amber); stroke-width: 1.8;
  stroke-dasharray: 4 3; stroke-linejoin: round;
}

.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 11px; color: var(--muted); }
.legend i.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend i.bar { background: rgba(190, 170, 220, .45); }
.legend i.bar-good { background: var(--accent); }
.legend i.line { background: var(--amber); height: 3px; border-radius: 1px; vertical-align: 2px; }

.rankrow { display: flex; gap: 6px; flex-wrap: wrap; }
.rankchip {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 9px; font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- chips */

.chipgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.chipcard {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.chipcard b { font-size: 13.5px; }
.chipstate { font-size: 11.5px; margin-top: 3px; }
.chipcard.ok { border-color: rgba(0, 255, 135, .45); }
.chipcard.ok .chipstate { color: var(--accent); }
.chipcard.active { border-color: var(--amber); background: rgba(255, 184, 0, .1); }
.chipcard.active .chipstate { color: var(--amber); }
.chipcard.used, .chipcard.expired { opacity: .5; }
.chipcard.used .chipstate, .chipcard.expired .chipstate { color: var(--muted); }

/* ------------------------------- captaincy / differentials / prices / £ */

.up { color: var(--accent); }
.down { color: var(--magenta); }

main h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text); margin: 0 0 8px; font-weight: 700;
}
main h4 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .split { grid-template-columns: 1fr; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.tile {
  position: relative;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 10px;
}
.tile-label {
  display: block; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 5px;
}
.tile-body { display: flex; align-items: center; gap: 8px; }
.tile-body b { font-size: 13.5px; }
.tile-foot { font-size: 11px; color: var(--muted); margin-top: 1px; }
.tile-pts {
  position: absolute; top: 9px; right: 10px;
  font-size: 18px; font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.empty-tile { color: var(--muted); font-size: 13px; }

.mini-photo {
  width: 30px; height: 30px; flex-shrink: 0;
  object-fit: cover; object-position: top center;
  border-radius: 7px; background: linear-gradient(180deg, #2f8f4c, #1b7d3e);
}

.rows-list { display: grid; gap: 3px; }
.rowline {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border-radius: 8px;
  padding: 5px 9px; font-size: 13px;
}
.rowline.dim { opacity: .55; }
.rowline.head {
  background: none; padding: 0 9px 2px;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted);
}
.rowline.head .rl-pts { font-weight: 400; }
.rowline.owned { box-shadow: inset 2px 0 0 var(--accent); }
.rl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-own { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rl-pts {
  min-width: 40px; text-align: right; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.owned-tag {
  font-size: 9px; text-transform: uppercase; letter-spacing: .05em;
  background: rgba(0, 255, 135, .16); color: var(--accent);
  border-radius: 3px; padding: 1px 5px; margin-left: 6px;
}

/* -------------------------------------------------------------- leagues */

.league { margin-bottom: 14px; }
.league:last-child { margin-bottom: 0; }
.league-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.league-rank { font-variant-numeric: tabular-nums; }
.tag {
  font-size: 9px; text-transform: uppercase; letter-spacing: .05em;
  background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px;
}

.table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
.table td { padding: 5px 6px; border-bottom: 1px solid rgba(52, 26, 87, .45); }
.table tr:last-child td { border-bottom: 0; }
.table td.r { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
.table tr.me { background: rgba(0, 255, 135, .09); }
.table tr.me td:first-child { box-shadow: inset 2px 0 0 var(--accent); }

/* ------------------------------------------------- inputs / search rows */

.input {
  font: inherit; font-size: 13px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 11px; width: 100%;
  outline: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--muted); }
.select { cursor: pointer; }

.searchrow { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 7px; margin-bottom: 12px; }
@media (max-width: 560px) { .searchrow { grid-template-columns: 1fr; } }

#newsSearch { margin-bottom: 10px; }

.rowline.pick { cursor: pointer; }
.rowline.pick:hover { background: var(--panel); box-shadow: inset 0 0 0 1px var(--accent-2); }
.rowline.picked { box-shadow: inset 0 0 0 1px var(--accent); background: rgba(0, 255, 135, .08); }
.rowline .flag { position: static; display: inline-block; margin-left: 6px; vertical-align: 0; }

.cmp-table th.cmp-head {
  text-align: center; padding: 4px 6px; font-size: 11px;
  color: var(--text); text-transform: none; letter-spacing: 0;
}
.cmp-table th.cmp-head .mini-photo { display: block; margin: 0 auto 3px; }
.cmp-table th.cmp-head i { display: block; font-style: normal; font-size: 10px; font-weight: 400; }
.cmp-table td.cmp {
  text-align: center; padding: 5px 6px; border-radius: 5px;
  background: var(--panel-2); font-variant-numeric: tabular-nums;
}
.cmp-table td.cmp.best { background: rgba(0, 255, 135, .16); color: var(--accent); font-weight: 700; }

/* ------------------------------------------------------------ dream team */

.dreamgrid { display: grid; gap: 6px; }
.dreamrow { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dreamcard {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 9px 5px 5px; font-size: 12px;
}
.dreamcard.mine { border-color: var(--accent); background: rgba(0, 255, 135, .1); }
.dreamcard b { font-variant-numeric: tabular-nums; color: var(--accent); }
.dreamname { font-weight: 600; }

/* ---------------------------------------------------------------- rivals */

.rival {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin-bottom: 10px;
}
.rival:last-child { margin-bottom: 0; }
.rival-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 9px; margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.rival-total { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rival .m-mine { border-top: 0; margin-top: 0; padding-top: 0; }
.rival .m-player.them { border-color: rgba(233, 0, 82, .4); }
.rival .m-player.us { border-color: rgba(0, 255, 135, .4); }
.rival h4 { margin-bottom: 6px; }

/* -------------------------------------------------------------- deadline */

.pill.deadline { border-color: var(--accent-2); color: var(--accent-2); }
.pill.deadline.urgent {
  border-color: var(--amber); color: var(--amber);
  background: rgba(255, 184, 0, .12);
}

/* ------------------------------------------------------------------ news */

.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab {
  font: inherit; font-size: 11.5px; color: var(--muted); cursor: pointer;
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px;
}
.tab.is-on { background: var(--panel-2); color: var(--accent); border-color: var(--accent); }

.news { display: grid; gap: 2px; }
.item {
  display: block; padding: 10px 2px; text-decoration: none; color: inherit;
  border-bottom: 1px solid rgba(52, 26, 87, .5);
}
.item:last-child { border-bottom: 0; }
.item:hover .item-title { color: var(--accent-2); }
.item-title { font-size: 13.5px; font-weight: 550; line-height: 1.4; }
.item-meta { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: rgba(0, 255, 135, .13); color: var(--accent);
  border-radius: 4px; padding: 1px 6px; font-weight: 600;
}
.chip.team { background: var(--panel-2); color: var(--muted); }
.chip.news { background: rgba(255, 184, 0, .16); color: var(--amber); }

.item.fresh { position: relative; padding-left: 12px; }
.item.fresh::before {
  content: ""; position: absolute; left: 0; top: 15px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.item.fresh .item-title { color: #fff; }
.empty { padding: 20px 2px; color: var(--muted); font-size: 13px; text-align: center; }

.foot { text-align: center; padding: 6px 0 20px; }

/* ----------------------------------------------------------------- sheet */

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 0, 12, .68); backdrop-filter: blur(3px); }
.sheet-body {
  position: relative; width: min(560px, 100%);
  max-height: 86vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px 16px 0 0; padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  animation: rise .18s ease;
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
@media (min-width: 620px) {
  .sheet { align-items: center; }
  .sheet-body { border-radius: 16px; }
}

.sheet-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: 0; color: var(--muted);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 0;
}
.sheet-close:hover { color: var(--text); }

.sheet h3 { font-size: 20px; line-height: 1.15; }
.sheet-sub { color: var(--muted); font-size: 13px; margin: 5px 0 0; }

.hero { display: flex; align-items: center; gap: 14px; margin: 0 30px 14px 0; }
.hero-photo {
  width: 84px; height: 84px; flex-shrink: 0;
  object-fit: cover; object-position: top center;
  border-radius: 12px;
  background: linear-gradient(180deg, #2f8f4c, #1b7d3e);
}
.hero-crest { width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 7px; margin: 12px 0; }
.kv div {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px; text-align: center;
}
.kv b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.kv span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

.sheet h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 18px 0 8px;
}

/* grid-auto-rows keeps rows to their content height - without it the grid
   stretches two rows across the whole sheet. */
.lines { display: grid; grid-auto-rows: min-content; gap: 4px; }
.line {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; padding: 6px 10px;
  background: var(--panel-2); border-radius: 7px;
}
.line b { font-variant-numeric: tabular-nums; flex-shrink: 0; }
.line.detail { align-items: flex-start; padding: 8px 10px; }
.line.detail > span:first-child { display: flex; flex-direction: column; gap: 1px; }
.line .why { font-size: 11px; color: var(--muted); line-height: 1.35; }
.line.total {
  background: none; border-top: 1px solid var(--line);
  border-radius: 0; margin-top: 2px; padding-top: 9px;
}
.line.total b:last-child { color: var(--accent); font-size: 15px; }

.sheet-tags { display: flex; gap: 5px; flex-wrap: wrap; margin: 7px 0 0; }
.tagpill {
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 2px 6px; color: var(--muted);
}
.tagpill.gold { background: rgba(255, 184, 0, .16); border-color: var(--amber); color: var(--amber); }

.gwbar {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; margin: 16px 0 0;
}
.gwbar-pts {
  position: relative;
  font-size: 30px; font-weight: 800; color: var(--accent);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.gwbar-pending {
  font-size: 13px; color: var(--amber); margin-left: 3px; vertical-align: super;
}
.gwbar > div:last-child { display: flex; flex-direction: column; gap: 2px; }

.notice.info {
  background: rgba(255, 184, 0, .1); border-color: rgba(255, 184, 0, .4);
}

.scoring { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 3px 12px; }
.scoreline {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12.5px; padding: 5px 9px;
  background: var(--panel-2); border-radius: 6px;
}
.scoreline b { font-variant-numeric: tabular-nums; }
.pos { color: var(--accent); }
.neg { color: var(--magenta); }

.fixstrip { display: flex; gap: 5px; flex-wrap: wrap; }
.fix {
  font-size: 11px; padding: 5px 8px; border-radius: 7px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.fix i { font-style: normal; color: var(--muted); }
.fdr-1, .fdr-2 { border-color: rgba(0, 255, 135, .5); }
.fdr-4 { border-color: rgba(255, 184, 0, .5); }
.fdr-5 { border-color: rgba(233, 0, 82, .6); }

.notice {
  font-size: 13px; padding: 10px 12px; border-radius: 9px;
  background: rgba(233, 0, 82, .1); border: 1px solid rgba(233, 0, 82, .4);
}
.notice.warn { background: rgba(255, 184, 0, .1); border-color: rgba(255, 184, 0, .4); }

.err {
  background: rgba(233, 0, 82, .12); border: 1px solid var(--magenta);
  border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px;
}
