/* Markas — dashboard tim agent. Dunia: susunan pemain di hari pertandingan. */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/barlow-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/barlow-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/barlow-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/barlow-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/barlow-condensed-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/barlow-condensed-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --ground: #E9EFE8;
  --surface: #FFFFFF;
  --surface-2: #F3F7F1;
  --ink: #0E1D16;
  --ink-2: #3F5247;
  --ink-3: #5E7065;
  --line: #D3DDD4;
  --line-strong: #B6C6B9;

  --pitch: #0B3D2E;
  --pitch-2: #114B39;
  --pitch-3: #186049;
  --pitch-ink: #ECF5EF;
  --pitch-ink-2: #B5D2C1;
  --chalk: rgba(236, 245, 239, .55);
  --chalk-soft: rgba(236, 245, 239, .16);

  --work: #15803D;
  --work-soft: #DCF3E3;
  --yellow: #FFD23F;
  --yellow-ink: #2B2200;
  --yellow-soft: #FFF6CF;
  --red: #D7263D;
  --red-ink: #A3172B;
  --red-soft: #FDE3E6;
  --bench: #7C8B82;
  --keeper: #6D4FC2;
  --keeper-ink: #F2EEFF;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(11, 61, 46, .06), 0 8px 24px -12px rgba(11, 61, 46, .22);
  --shadow-lift: 0 2px 4px rgba(11, 61, 46, .08), 0 18px 40px -18px rgba(11, 61, 46, .38);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: "Barlow", system-ui, sans-serif;
  --font-num: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #06120D;
  --surface: #0C1D16;
  --surface-2: #11271E;
  --ink: #E5EFE8;
  --ink-2: #AFC4B7;
  --ink-3: #8BA295;
  --line: #1C3529;
  --line-strong: #2A4A3B;
  --pitch: #0D4433;
  --pitch-2: #12513D;
  --pitch-3: #186049;
  --work: #3ECF79;
  --work-soft: rgba(62, 207, 121, .14);
  --yellow-soft: rgba(255, 210, 63, .14);
  --red: #FF5A6E;
  --red-ink: #FF8A98;
  --red-soft: rgba(255, 90, 110, .14);
  --bench: #7F9387;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .7);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 20px 44px -18px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  caret-color: var(--work);
}
::selection { background: var(--pitch); color: var(--pitch-ink); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--work); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Kerangka ---------- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: 100dvh; overflow: auto;
  background: var(--pitch); color: var(--pitch-ink);
  display: flex; flex-direction: column; gap: 24px; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand b { display: block; font: 700 22px/1 var(--font-num); letter-spacing: .04em; text-transform: uppercase; }
.brand span { font-size: 12px; color: var(--pitch-ink-2); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .squad a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--pitch-ink-2); text-decoration: none; font-weight: 700; font-size: 15px;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.nav a:hover, .squad a:hover { background: var(--chalk-soft); color: var(--pitch-ink); }
.nav a[aria-current="page"], .squad a[aria-current="page"] { background: var(--pitch-ink); color: var(--pitch); }
.nav .count { margin-left: auto; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 6px; background: var(--yellow); color: var(--yellow-ink); font: 700 15px/24px var(--font-num); text-align: center; }
.rail-title { font-size: 12px; font-weight: 700; color: var(--pitch-ink-2); padding: 0 12px 6px; }
.squad { display: flex; flex-direction: column; gap: 2px; }
.squad a { font-weight: 400; color: var(--pitch-ink); }
.squad .shirt-mini { width: 28px; height: 28px; font-size: 15px; }
.squad .dot { margin-left: auto; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.demo-tag { font-size: 12px; color: var(--pitch-ink-2); border: 1px dashed var(--chalk); border-radius: 8px; padding: 8px 10px; line-height: 1.4; }

.main { min-width: 0; display: flex; flex-direction: column; }
.view { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 20px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- Papan skor ---------- */
.board {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: stretch; gap: 0; flex-wrap: wrap;
  background: var(--pitch); color: var(--pitch-ink);
  border-bottom: 1px solid rgba(0,0,0,.2);
}
.board-when { display: flex; flex-direction: column; justify-content: center; padding: 10px 24px; min-width: 0; }
.board-when b { font: 700 20px/1.1 var(--font-num); letter-spacing: .03em; text-transform: uppercase; }
.board-when span { font-size: 13px; color: var(--pitch-ink-2); }
.score { display: flex; align-items: stretch; margin-left: auto; }
.score-cell { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 8px 18px; border-left: 1px solid var(--chalk-soft); min-width: 98px; }
.score-cell b { font: 700 30px/1 var(--font-num); font-variant-numeric: tabular-nums; }
.score-cell span { font-size: 12px; color: var(--pitch-ink-2); white-space: nowrap; }
.score-cell .card-chip { display: inline-block; width: 11px; height: 15px; border-radius: 2px; margin-right: 6px; vertical-align: -2px; }
.board-tools { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-left: 1px solid var(--chalk-soft); }
.tool {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--chalk-soft); background: transparent; color: var(--pitch-ink); font-weight: 700; font-size: 14px;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.tool:hover { background: var(--chalk-soft); border-color: var(--chalk); }
.tool[aria-pressed="true"] { background: var(--pitch-ink); color: var(--pitch); }

/* ---------- Bagian umum ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.panel-head h2 { font: 700 24px/1.15 var(--font-num); letter-spacing: .01em; }
.panel-head p { color: var(--ink-3); font-size: 14px; }
.panel-body { padding: 16px 20px 20px; }
.grid-lapangan { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); grid-template-areas: "pitch side" "lineup side"; gap: 20px; align-items: start; }
.area-side { align-self: start; }
.area-pitch { grid-area: pitch; } .area-side { grid-area: side; } .area-lineup { grid-area: lineup; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title h1 { font: 700 40px/1 var(--font-num); letter-spacing: .005em; }
.page-title p { color: var(--ink-2); max-width: 60ch; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; background: var(--bench); }
.dot.kerja { background: var(--work); }
.dot.tunggu { background: var(--yellow); border-radius: 2px; width: 9px; height: 12px; }
.dot.masalah { background: var(--red); border-radius: 2px; width: 9px; height: 12px; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.status-chip.kerja { background: var(--work-soft); color: var(--work); }
.status-chip.tunggu { background: var(--yellow-soft); color: var(--ink); }
.status-chip.masalah { background: var(--red-soft); color: var(--red-ink); }
.status-chip.istirahat { background: var(--surface-2); color: var(--ink-3); }

/* ---------- Kaos pemain ---------- */
.shirt {
  --kit: var(--pitch-ink); --kit-ink: var(--pitch);
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--kit); color: var(--kit-ink);
  font: 700 26px/1 var(--font-num); font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 0 rgba(0,0,0,.15), 0 10px 20px -10px rgba(0,0,0,.5);
  position: relative;
}
.shirt.keeper { --kit: var(--keeper); --kit-ink: var(--keeper-ink); }
.shirt-mini { width: 32px; height: 32px; font-size: 17px; box-shadow: none; }
.panel .shirt:not(.keeper), .chat .shirt:not(.keeper), .table .shirt:not(.keeper), .decision .shirt:not(.keeper) { --kit: var(--pitch); --kit-ink: var(--pitch-ink); }
.armband { position: absolute; right: -6px; top: -4px; width: 20px; height: 20px; border-radius: 5px; background: var(--pitch); color: var(--pitch-ink); border: 2px solid var(--pitch-ink); font: 700 12px/16px var(--font-num); text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ---------- Lapangan (gerakan khas) ---------- */
.pitch {
  position: relative; aspect-ratio: 4 / 3; margin: 16px 20px 8px; border-radius: 14px; overflow: hidden;
  background: var(--pitch);
  isolation: isolate;
}
/* Lapangan menyesuaikan lebarnya sendiri: sempit (HP, atau tab di dashboard Hermes) memakai label singkat. */
.pitch { container-type: inline-size; }
@container (max-width: 620px) {
  .pitch .player-task, .pitch .player-role { display: none; }
  .pitch .player-short { display: block; }
  .pitch .player { width: 36%; }
}
.pitch-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.pitch-lines * { fill: none; stroke: var(--chalk); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pass-layer { z-index: 3; pointer-events: none; }
.pbox, .gbox { position: absolute; left: 50%; bottom: 4%; border: 2px solid var(--chalk); border-bottom: 0; transform: translateX(-50%); }
.pbox { width: 56%; height: 27%; }
.gbox { width: 26%; height: 10%; }
@media (max-width: 640px) { .pbox { height: 30%; } .gbox { height: 10%; } }
.pass-line { stroke: var(--pitch-ink) !important; stroke-dasharray: 4 8; stroke-width: 2.5 !important; opacity: 0; }
.pass-line.on { opacity: .95; animation: dash .9s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -24; } }
.ball { position: absolute; left: 0; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; z-index: 3; opacity: 0; pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,.45)); }
.player {
  --anchor: -32px; --ax: -50%;
  position: absolute; z-index: 2; transform: translate(var(--ax), var(--anchor));
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(30%, 220px);
  background: none; border: 0; padding: 4px; color: var(--pitch-ink); text-align: center; border-radius: 14px;
  transition: transform .35s var(--ease);
}
.player:hover { transform: translate(var(--ax), calc(var(--anchor) - 3px)); }
.player-info { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 100%; }
.player.keeper { --ax: -30px; --anchor: -50%; flex-direction: row; width: auto; max-width: 50%; gap: 12px; text-align: left; }
.player.keeper .player-info { align-items: flex-start; }
.player:hover .shirt { box-shadow: 0 2px 0 rgba(0,0,0,.15), 0 16px 26px -12px rgba(0,0,0,.7); }
.player .ring { position: absolute; inset: -5px; border-radius: 50%; border: 3px solid transparent; }
.player[data-status="kerja"] .ring { border-color: var(--work); }
.player[data-status="tunggu"] .ring { border-color: var(--yellow); }
.player[data-status="masalah"] .ring { border-color: var(--red); animation: alarm 1.6s ease-in-out infinite; }
@keyframes alarm { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--red) 35%, transparent); } }
.player-name { font: 700 18px/1 var(--font-num); letter-spacing: .02em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.player-role { font-size: 12px; line-height: 1.2; color: var(--pitch-ink-2); margin: -4px 0 4px; }
.player-task {
  font-size: 13px; line-height: 1.35; color: var(--pitch-ink); max-width: 100%;
  background: rgba(4, 30, 21, .78); border: 1px solid var(--chalk-soft); border-radius: 10px; padding: 6px 9px;
}
.player-task > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.player-short { display: none; font-size: 11px; line-height: 1.2; font-weight: 700; color: var(--pitch); background: var(--pitch-ink); border-radius: 6px; padding: 2px 6px; max-width: 100%; }
.player.receive .shirt { animation: receive .8s var(--ease); }
@keyframes receive { 30% { transform: scale(1.18); } 100% { transform: scale(1); } }
.enter .player { animation: walkon .9s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 120ms); }
@keyframes walkon { from { transform: translate(var(--ax), calc(var(--anchor) + 36px)); } to { transform: translate(var(--ax), var(--anchor)); } }
.pitch-note { margin: 0 20px 16px; font-size: 13px; color: var(--ink-3); }

/* ---------- Tabel susunan pemain ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .2s var(--ease); cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.who { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.who div > b { display: block; font-weight: 700; }
.who div > span { font-size: 13px; color: var(--ink-3); }
.task { max-width: 52ch; color: var(--ink); }
.next-line { font-size: 13px; color: var(--ink-3); margin-top: 4px; max-width: 60ch; }
.next-line b { color: var(--ink-2); }
.steps-bar { display: flex; gap: 3px; margin-top: 8px; width: 140px; }
.steps-bar i { flex: 1; height: 6px; border-radius: 2px; background: var(--line); }
.steps-bar i.done { background: var(--work); }
.steps-bar i.now { background: linear-gradient(90deg, var(--work) var(--p, 50%), var(--line) var(--p, 50%)); animation: fill 2.2s var(--ease) both; }
@keyframes fill { from { --p: 0%; } }
@property --p { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
.steps-label { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.result b { font: 700 20px/1 var(--font-num); display: block; }
.result span { font-size: 12px; color: var(--ink-3); }
.table-wrap { overflow-x: auto; padding: 8px 8px 4px; }

/* ---------- Uang tersembunyi ---------- */
.money { border: 0; background: var(--surface-2); color: var(--ink); border-radius: 8px; padding: 2px 8px; font: inherit; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; }
.money .mask { letter-spacing: .12em; }
.money:hover { background: var(--line); }
.money .icon { width: 16px; height: 16px; color: var(--ink-3); }
.money.shown { background: transparent; padding-left: 0; }
.money .val { display: inline-block; }
.money.shown .val { animation: reveal .5s var(--ease); }
@keyframes reveal { from { filter: blur(6px); opacity: 0; } }

/* ---------- Kartu kuning: keputusan ---------- */
.decisions { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 20px; }
.decision {
  border: 1px solid color-mix(in srgb, var(--yellow) 65%, var(--line)); background: var(--yellow-soft);
  border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden;
  transition: opacity .4s var(--ease), transform .5s var(--ease), max-height .5s var(--ease), padding .5s var(--ease), margin .5s var(--ease);
  max-height: 600px;
}
.decision-top { display: flex; align-items: center; gap: 10px; }
.decision-top .meta { font-size: 13px; color: var(--ink-2); }
.decision-top .meta b { color: var(--ink); }
.ycard { width: 16px; height: 22px; border-radius: 3px; background: var(--yellow); flex: none; margin-left: auto; transform: rotate(8deg); box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.decision h3 { font-size: 17px; line-height: 1.3; }
.decision p { font-size: 14px; color: var(--ink-2); }
.decision dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: 13px; }
.decision dt { color: var(--ink-3); }
.decision dd { margin: 0; color: var(--ink); }
.decision .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 15px; transition: transform .15s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease); }
.btn:active { transform: scale(.97); }
.btn-go { background: var(--pitch); color: var(--pitch-ink); box-shadow: var(--shadow); }
.btn-go:hover { background: var(--pitch-3); }
.btn-no { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-no:hover { border-color: var(--red); color: var(--red-ink); }
.btn-plain { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-plain:hover { background: var(--surface-2); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
:root[data-theme="dark"] .decision .btn-go, :root[data-theme="dark"] .quick .btn-go { background: var(--pitch-ink); color: var(--pitch); }
:root[data-theme="dark"] .decision .btn-go:hover, :root[data-theme="dark"] .quick .btn-go:hover { background: #fff; }
:root[data-theme="dark"] .decision .btn-no, :root[data-theme="dark"] .quick .btn-plain { background: transparent; border-color: var(--line-strong); }
.reason { display: flex; flex-direction: column; gap: 8px; }
.reason label { font-size: 13px; font-weight: 700; }
.field { width: 100%; min-height: 44px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.field:focus { outline: 2px solid var(--work); outline-offset: 0; border-color: transparent; }
.stamp {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%) rotate(-12deg) scale(1.6); opacity: 0;
  font: 700 26px/1 var(--font-num); letter-spacing: .08em; padding: 6px 12px; border: 3px solid currentColor; border-radius: 6px;
  pointer-events: none;
}
.decision.stamped .stamp { animation: stamp .45s var(--ease) forwards; }
@keyframes stamp { to { opacity: 1; transform: translateY(-50%) rotate(-12deg) scale(1); } }
.decision.gone { opacity: 0; transform: translateX(24px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: -12px; border-width: 0; }
.stamp.ok { color: var(--work); } .stamp.no { color: var(--red-ink); }
.empty { padding: 20px; text-align: center; color: var(--ink-3); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty b { color: var(--ink); font-size: 16px; }

.history { display: flex; flex-direction: column; }
.hist-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.hist-row h3 { font-size: 15px; }
.hist-row p { font-size: 13px; color: var(--ink-3); }
.verdict { font: 700 15px/1 var(--font-num); letter-spacing: .08em; padding: 5px 8px; border: 2px solid currentColor; border-radius: 5px; transform: rotate(-4deg); }
.verdict.setuju { color: var(--work); } .verdict.tolak { color: var(--red-ink); }

/* ---------- Siaran langsung ---------- */
.feed { list-style: none; margin: 0; padding: 8px 20px 18px; display: flex; flex-direction: column; }
.feed li { display: grid; grid-template-columns: 46px 22px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: start; }
.feed li:last-child { border-bottom: 0; }
.feed time { font: 700 16px/1.25 var(--font-num); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.feed .mark { width: 14px; height: 18px; margin-top: 1px; border-radius: 3px; background: var(--line-strong); }
.feed .mark.card { background: var(--yellow); }
.feed .mark.red { background: var(--red); }
.feed .mark.pass, .feed .mark.done, .feed .mark.info { background: none; display: grid; place-items: center; }
.feed .mark svg { width: 16px; height: 16px; }
.feed li b { font-weight: 700; }
.feed li.new { animation: slidein .7s var(--ease); }
@keyframes slidein { from { opacity: 0; transform: translateY(-10px); background: var(--work-soft); } }

/* ---------- Halaman pemain ---------- */
.hero {
  background: var(--pitch); color: var(--pitch-ink); border-radius: var(--radius-lg); padding: 22px 24px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  background-image: radial-gradient(circle at 100% 50%, transparent 0 90px, var(--chalk-soft) 90px 92px, transparent 92px);
}
.hero .shirt { width: 84px; height: 84px; font-size: 44px; --kit: var(--pitch-ink); --kit-ink: var(--pitch); }
.hero .shirt.keeper { --kit: var(--keeper); --kit-ink: var(--keeper-ink); }
.hero h1 { font: 700 44px/1 var(--font-num); text-transform: uppercase; letter-spacing: .01em; }
.hero p { color: var(--pitch-ink-2); }
.hero .status-chip { margin-left: auto; }
.player-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 20px; align-items: start; }
@media (min-width: 901px) {
  .chat-col { position: sticky; top: 82px; }
  .player-grid .chat { height: max(420px, calc(100dvh - 330px)); }
}
.steps { list-style: none; margin: 0; padding: 16px 20px 20px; display: flex; flex-direction: column; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; position: relative; padding-bottom: 18px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child::before { display: none; }
.steps li.done::before { background: var(--work); }
.steps .node { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink-3); font: 700 15px/1 var(--font-num); z-index: 1; }
.steps li.done .node { background: var(--work); border-color: var(--work); color: #fff; }
.steps li.now .node { border-color: var(--work); color: var(--work); box-shadow: 0 0 0 5px var(--work-soft); }
.steps li span { padding-top: 3px; }
.steps li.now span b { display: block; font-size: 12px; color: var(--work); font-weight: 700; }
.steps li.next span { color: var(--ink-3); }
.kv { display: flex; flex-direction: column; padding: 8px 20px 18px; }
.kv div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-2); font-size: 14px; }
.kv dd { margin: 0; font: 700 22px/1 var(--font-num); font-variant-numeric: tabular-nums; }
.problem { margin: 16px 20px 0; padding: 12px 14px; border-radius: 12px; background: var(--red-soft); color: var(--ink); display: flex; gap: 10px; font-size: 14px; border: 1px solid color-mix(in srgb, var(--red) 40%, var(--line)); }
.problem .rcard { width: 14px; height: 19px; border-radius: 3px; background: var(--red); flex: none; margin-top: 1px; transform: rotate(-6deg); }
.next-up { padding: 16px 20px 20px; font-size: 15px; }
.tabs { display: none; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--line); }
.tabs button { flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: 9px; font-weight: 700; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Obrolan ---------- */
.chat { display: flex; flex-direction: column; height: min(78dvh, 760px); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 88%; animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.msg .bubble { padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.msg .meta { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; display: block; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--pitch); color: var(--pitch-ink); border-color: var(--pitch); border-radius: 16px 16px 4px 16px; }
.msg.me .meta { color: var(--pitch-ink-2); text-align: right; }
.msg.demo-reply .bubble::after { content: " · balasan contoh"; font-size: 12px; color: var(--ink-3); }
.pass-row { align-self: center; display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; border-radius: 999px; background: var(--surface-2); border: 1px dashed var(--line-strong); font-size: 13px; color: var(--ink-2); animation: rise .45s var(--ease) both; max-width: 100%; }
.pass-row .shirt-mini { width: 26px; height: 26px; font-size: 14px; }
.pass-row .lane { position: relative; width: 56px; height: 2px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px); }
.pass-row .lane i { position: absolute; top: -5px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); animation: roll 1.1s var(--ease) both; }
@keyframes roll { from { left: 0; transform: rotate(0); } to { left: calc(100% - 12px); transform: rotate(360deg); } }
.sys-row { align-self: center; max-width: 90%; text-align: center; font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 8px 14px; animation: rise .45s var(--ease) both; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { flex: 1; resize: none; min-height: 46px; max-height: 140px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.4; }
.composer textarea:focus { outline: 2px solid var(--work); outline-offset: 0; border-color: transparent; }
.composer .btn { min-width: 48px; padding: 0 14px; }
.chat-hint { font-size: 12px; color: var(--ink-3); padding: 0 16px 10px; }
.mention-bar { display: flex; gap: 6px; padding: 10px 12px 0; flex-wrap: wrap; }
.mention-bar button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 4px 10px 4px 4px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; min-height: 32px; }
.mention-bar button:hover { border-color: var(--line-strong); }
.mention-bar .shirt-mini { width: 24px; height: 24px; font-size: 13px; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.room-grid .chat { height: min(80dvh, 820px); }
.roster { padding: 8px 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.roster a { display: flex; gap: 10px; align-items: center; padding: 10px 8px; border-radius: 10px; text-decoration: none; }
.roster a:hover { background: var(--surface-2); }
.roster div > b { display: block; font-size: 15px; }
.roster div > span { font-size: 13px; color: var(--ink-3); }

/* ---------- Pengaturan ---------- */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.form-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.form-row:last-child { border-bottom: 0; }
.form-row label { font-size: 13px; color: var(--ink-3); display: block; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--line); }
.seg button { flex: 1; min-height: 42px; border: 0; background: transparent; border-radius: 9px; font-weight: 700; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.note { font-size: 14px; color: var(--ink-2); }

.quick { display: none; }
@media (max-width: 900px) {
  .quick {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center; position: relative; overflow: hidden;
    padding: 12px 14px; border-radius: 14px; background: var(--yellow-soft); border: 1px solid color-mix(in srgb, var(--yellow) 65%, var(--line));
    transition: opacity .4s var(--ease), max-height .5s var(--ease), padding .5s var(--ease); max-height: 300px;
  }
  .quick .ycard { margin: 0; }
  .quick-text span { display: block; font-size: 13px; color: var(--ink-2); }
  .quick-text b { display: block; font-size: 15px; line-height: 1.3; }
  .quick .actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .quick.stamped .stamp { animation: stamp .45s var(--ease) forwards; }
  .quick.gone { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; border-width: 0; }
  .page-title .legend { display: none; }
}

/* ---------- Halaman masuk ---------- */
.login-page { background: var(--pitch); color: var(--pitch-ink); }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-pitch { position: absolute; inset: 0; pointer-events: none; }
.login-pitch i { position: absolute; display: block; border: 2px solid var(--chalk-soft); }
.lp-circle { left: 50%; top: 50%; width: min(70vw, 520px); aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); }
.lp-line { left: 0; right: 0; top: 50%; border-width: 2px 0 0 !important; }
.lp-box { left: 50%; bottom: -2px; width: min(60vw, 440px); height: 18vh; transform: translateX(-50%); border-bottom: 0 !important; }
.login-card {
  position: relative; width: min(100%, 380px); display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); color: var(--ink); border-radius: 20px; padding: 28px 24px 24px; box-shadow: var(--shadow-lift);
  animation: rise .7s var(--ease) both;
}
.login-card .brand-mark { width: 44px; height: 44px; color: var(--pitch); }
:root[data-theme="dark"] .login-card .brand-mark { color: var(--pitch-ink); }
.login-card h1 { font: 700 40px/1 var(--font-num); text-transform: uppercase; letter-spacing: .02em; margin-top: 6px; }
.login-card > p { color: var(--ink-2); margin-bottom: 8px; }
.login-card label { font-size: 13px; font-weight: 700; }
.login-field { position: relative; }
.login-field .field { padding-right: 76px; font-size: 16px; }
.login-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 700; }
.login-error { min-height: 20px; font-size: 14px; color: var(--red-ink); }
.login-go { width: 100%; }

/* ---------- Tab bawah (HP) ---------- */
.tabbar { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; z-index: 50; transition: opacity .3s var(--ease), transform .4s var(--ease); pointer-events: none; box-shadow: var(--shadow-lift); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: var(--ease); }
::view-transition-old(main-view) { animation: vt-out .22s var(--ease) both; }
::view-transition-new(main-view) { animation: vt-in .38s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
.view { view-transition-name: main-view; }

@media (max-width: 1280px) {
  .tool .tool-label { display: none; }
  .score-cell { min-width: 0; padding: 8px 14px; }
  .board-when { padding: 10px 18px; }
}
@media (max-width: 1180px) {
  .grid-lapangan, .player-grid, .room-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-lapangan { grid-template-areas: "pitch" "lineup" "side"; }
  .room-grid .roster-panel { display: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .view { padding: 14px 14px 104px; gap: 14px; }
  .board { flex-wrap: wrap; }
  .board-when { flex: 1 1 0; padding: 10px 14px 8px; }
  .board-when b { font-size: 18px; }
  .board-tools { order: 2; padding: 6px 10px; border-left: 0; }
  .score { order: 3; margin-left: 0; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--chalk-soft); }
  .score-cell { min-width: 0; padding: 8px 10px; }
  .score-cell:first-child { border-left: 0; }
  .score-cell b { font-size: 24px; }
  .score-cell span { white-space: normal; line-height: 1.2; }
  .tool .tool-label { display: none; }
  .pitch { aspect-ratio: 1 / 1; margin: 12px 12px 6px; }
  .player { width: 40%; }
  .player-task { font-size: 12px; }
  .pitch-note { margin: 0 14px 14px; }
  .table thead { display: none; }
  .table, .table tbody { display: block; }
  .table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 12px; border-bottom: 1px solid var(--line); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { display: block; padding: 0; border: 0; }
  .table td.col-task { grid-column: 1 / -1; grid-row: 2; }
  .table td:nth-child(3) { text-align: right; }
  .table td:nth-child(3) .steps-bar { margin-left: auto; width: 110px; }
  .shirt:not(.shirt-mini) { width: 46px; height: 46px; font-size: 23px; }
  .player { --anchor: -29px; }
  .player.keeper { --ax: -27px; --anchor: -50%; }
  .page-title h1 { font-size: 32px; }
  .hero h1 { font-size: 34px; }
  .hero .shirt { width: 64px; height: 64px; font-size: 34px; }
  .tabs { display: flex; }
  .player-grid[data-tab="ringkasan"] .chat-col { display: none; }
  .player-grid[data-tab="chat"] .info-col { display: none; }
  .chat, .room-grid .chat { height: calc(100dvh - 250px); min-height: 420px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--pitch); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px -12px rgba(0,0,0,.4);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 54px; justify-content: center; color: var(--pitch-ink-2); text-decoration: none; font-size: 12px; font-weight: 700; border-radius: 12px; position: relative; }
  .tabbar a[aria-current="page"] { color: var(--pitch); background: var(--pitch-ink); }
  .tabbar .count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 5px; background: var(--yellow); color: var(--yellow-ink); font: 700 13px/18px var(--font-num); text-align: center; padding: 0 4px; }
  .table .col-result { display: none; }
  .toast { bottom: 92px; }
}
@media (max-width: 640px) {
  .pitch { aspect-ratio: 1 / 1; }
  .player-task, .player-role { display: none; }
  .player-short { display: block; }
  .player { width: 36%; }
  .player.keeper { top: 76% !important; }
  .player { gap: 4px; }
  .player-name { font-size: 16px; }
  .msg { max-width: 94%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .ball, .pass-line { display: none; }
}
