/* =========================================================================
   Simulasi draft (Captains Mode), halaman styles.

   Susunannya meniru layar draft di dalam game, karena gunanya latihan: satu
   baris empat kolom atribut untuk seluruh pool hero, kolom Radiant dan Dire di
   kanan berisi 24 langkah bernomor, dan jam di tengah antara dua plat tim.

   Token warna/permukaan dari ../../assets/theme.css; palet sisi di bawah ini
   SENGAJA menyalin nilai yang dipakai ../style.css (Radiant = --good,
   Dire = --bad) supaya dua halaman tidak saling memuat stylesheet-nya.
   ========================================================================= */

.sim { padding-top: 34px; }

[data-side="radiant"] { --side-color: var(--good); --side-soft: rgba(110, 231, 168, .1); }
[data-side="dire"] { --side-color: var(--bad); --side-soft: rgba(255, 122, 107, .1); }

[data-side="radiant"] {
  --side-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='3.8'/%3E%3Cpath d='M12 2.5v2.4M12 19.1v2.4M2.5 12h2.4M19.1 12h2.4M5.3 5.3l1.7 1.7M17 17l1.7 1.7M18.7 5.3 17 7M7 17l-1.7 1.7'/%3E%3C/svg%3E");
}

[data-side="dire"] {
  --side-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 1.8 14.7 8.2 21.4 5.9 17.2 11.5 22.1 15.8 15.5 16.1 15.8 22.4 12 17 8.2 22.4 8.5 16.1 1.9 15.8 6.8 11.5 2.6 5.9 9.3 8.2Z'/%3E%3C/svg%3E");
}

/* ---------- start panel ---------- */

.sim-start {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 22px;
  align-items: stretch;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 260px at 88% -10%, rgba(200, 162, 90, .12), transparent 70%),
    radial-gradient(500px 220px at 8% 120%, rgba(110, 231, 168, .07), transparent 70%),
    linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  box-shadow: var(--shadow);
}

/* Right half of the panel: what the mode IS. The left half asks the questions. */
.start-side { display: grid; gap: 10px; align-content: start; }

.start-art {
  position: relative;
  aspect-ratio: 16 / 7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0a11;
}

.start-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  transform: scale(1.02);
}

/* The art fades into the panel so the tag stays readable on any portrait. */
.start-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 12, .1), rgba(8, 8, 12, .5) 55%, #101019);
}

.start-art-tag {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 1;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .22em;
  color: var(--accent);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .8);
}

.start-art-sides {
  position: absolute;
  right: 12px;
  bottom: 9px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.start-art-sides .team-mark { width: 13px; height: 13px; }

.start-art-sides i {
  font-style: normal;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}

.start-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.start-stats li {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
}

.start-stats b {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.1;
  color: var(--accent);
}

.start-stats span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
}

.start-block { display: grid; gap: 12px; }

.start-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }

.start-block h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .02em;
}

.mode-pick { display: grid; gap: 8px; }

/* Each mode carries its own colour, so the pair can be told apart before either
   is selected: amber for the bot (the site's own accent, instant), blue for a
   person (a lobby with someone on the other end). */
.mode-btn[data-mode="bot"] {
  --mode-color: var(--accent);
  --mode-soft: rgba(200, 162, 90, .1);
  --mode-line: rgba(200, 162, 90, .5);
}

.mode-btn[data-mode="pvp"] {
  --mode-color: #7cc4ff;
  --mode-soft: rgba(124, 196, 255, .1);
  --mode-line: rgba(124, 196, 255, .5);
}

/* Solo: satu orang memegang kedua kursi. Warnanya ungu supaya terbaca sebagai
   "bukan lawan siapa-siapa" — bukan biru (ada orang lain) dan bukan amber
   (bot yang memilih). */
.mode-btn[data-mode="solo"] {
  --mode-color: #b79cff;
  --mode-soft: rgba(183, 156, 255, .1);
  --mode-line: rgba(183, 156, 255, .5);
}

.mode-btn {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 1px 10px;
  align-items: center;
  padding: 9px 12px 9px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--mode-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.mode-btn .mode-mark {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--mode-soft);
  color: var(--mode-color);
}

.mode-btn .mode-mark svg { width: 18px; height: 18px; }

.mode-btn b { font-size: 13.5px; font-weight: 700; }

.mode-btn em { font-style: normal; font-size: 11.5px; color: var(--muted); }

.mode-btn:hover { border-color: var(--mode-line); background: rgba(255, 255, 255, .05); }

.mode-btn:hover b { color: var(--mode-color); }

.mode-btn.is-on {
  border-color: var(--mode-color);
  background: var(--mode-soft);
  box-shadow: inset 0 0 0 1px var(--mode-color), 0 0 18px -8px var(--mode-color);
}

.mode-btn.is-on b { color: var(--mode-color); }

.mode-btn.is-on .mode-mark { background: var(--mode-color); color: #0b0a10; }

.mode-btn:focus-visible { outline: none; border-color: var(--mode-color); }

.sim-field { display: grid; gap: 6px; }

.mode-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}

/* A native <select> draws its LIST with the page's colour scheme: without this
   the options come out near-black text on the near-black menu. */
.sim-field select {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: rgba(255, 255, 255, .05);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23a8a6b6' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M1 2.2 6 6.6l5-4.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 11px 8px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.sim-field select option { background-color: #14141d; color: #f3f1ea; }

.sim-field select:focus-visible { outline: none; border-color: var(--accent); }

.start-note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); min-height: 1.2em; }

.sim-rules h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 15px; font-weight: 500; }

.sim-rules p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); max-width: 62ch; }

/* ---------- lobby ---------- */

.sim-lobby {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  box-shadow: var(--shadow);
}

.lobby-head { display: flex; align-items: center; gap: 10px; }

.lobby-head h2 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 500; }

.lobby-code {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .22em;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
}

.lobby-lede { margin: 8px 0 12px; font-size: 12.5px; line-height: 1.55; color: var(--muted); max-width: 70ch; }

.lobby-row { display: flex; gap: 8px; flex-wrap: wrap; }

.lobby-row input {
  flex: 1 1 280px;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .3);
  color: var(--text-soft);
  font: inherit;
  font-size: 12.5px;
}

.lobby-players { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }

.lobby-player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
  font-size: 13px;
}

.lobby-player.is-you { border-color: rgba(200, 162, 90, .45); }

.lobby-player.is-empty { color: var(--dim); border-style: dashed; font-size: 12px; }

.lobby-player em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.lobby-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.lobby-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- the draft screen ---------- */

.stage {
  --stage-text: 1;
  margin-top: 14px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(1100px 380px at 50% -12%, rgba(200, 162, 90, .06), transparent 70%),
    linear-gradient(180deg, #101019, #0a0a11);
  box-shadow: var(--shadow);
  font-size: calc(1rem * var(--stage-text));
}

.stage[data-tsize="l"] { --stage-text: 1.1; }
.stage[data-tsize="xl"] { --stage-text: 1.2; }

/* top strip: team plate, clock, team plate */

.stage-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.top-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.top-team.is-end { justify-content: flex-end; text-align: right; }

.team-mark {
  flex: none;
  width: 15px;
  height: 15px;
  background: var(--side-color);
  -webkit-mask: var(--side-icon) center / contain no-repeat;
  mask: var(--side-icon) center / contain no-repeat;
}

.top-team-body { display: grid; gap: 1px; min-width: 0; }

.team-name {
  font-size: calc(11px * var(--stage-text));
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--side-color);
}

.team-who {
  font-style: normal;
  font-size: calc(9.5px * var(--stage-text));
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-bar {
  display: block;
  width: 100%;
  min-width: 70px;
  height: 3px;
  border-radius: var(--radius);
  background: rgba(216, 223, 230, .12);
  overflow: hidden;
}

.team-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--side-color);
  transition: width .3s ease;
}

.team-reserve { font-size: calc(9.5px * var(--stage-text)); font-variant-numeric: tabular-nums; color: var(--dim); }

.top-team.is-turn .team-name { text-shadow: 0 0 14px var(--side-color); }

/* clock */

.stage-clock {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 190px;
  padding: 4px 16px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .015));
}

.clock-time {
  font-family: var(--font-mono);
  font-size: calc(30px * var(--stage-text));
  line-height: 1.02;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.clock-headline {
  font-size: calc(10px * var(--stage-text));
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--side-color, var(--text-soft));
  text-align: center;
}

.clock-phase { font-size: calc(9px * var(--stage-text)); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }

.clock-track {
  width: 100%;
  height: 3px;
  margin-top: 3px;
  border-radius: var(--radius);
  background: rgba(216, 223, 230, .12);
  overflow: hidden;
}

.clock-track i { display: block; height: 100%; width: 100%; background: var(--accent); transition: width .1s linear; }

.clock-step { font-size: calc(9px * var(--stage-text)); color: var(--dim); font-variant-numeric: tabular-nums; }

.stage-clock.is-yours { --side-color: var(--accent); border-color: rgba(200, 162, 90, .45); }
.stage-clock.is-yours .clock-time { color: var(--accent); }
.stage-clock.is-urgent .clock-time { color: var(--bad); }
.stage-clock.is-urgent .clock-track i { background: var(--bad); }
.stage-clock.is-paused .clock-time { color: var(--muted); }

/* search + tools */

.stage-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hero-search {
  position: relative;
  flex: 1 1 240px;
  min-width: 0;
}

.search-mark {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--dim);
  pointer-events: none;
}

.search-mark svg { width: 14px; height: 14px; }

.hero-search input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .32);
  color: var(--text);
  font: inherit;
  font-size: calc(11.5px * var(--stage-text));
}

.hero-search input::placeholder { color: var(--dim); }

.hero-search input:focus-visible { outline: none; border-color: var(--accent); }

.stage-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

.ctl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .05);
  color: var(--text-soft);
  font: inherit;
  font-size: calc(11px * var(--stage-text));
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.ctl:hover:not(:disabled) { border-color: rgba(200, 162, 90, .5); color: var(--text); }

.ctl:focus-visible { outline: none; border-color: var(--accent); }

.ctl:disabled { opacity: .38; cursor: not-allowed; }

.ctl.is-danger:hover:not(:disabled) { border-color: rgba(255, 122, 107, .6); color: var(--bad); }

.ctl.is-on { border-color: var(--accent); color: var(--accent); background: rgba(200, 162, 90, .1); }

.ctl--icon { padding: 5px 8px; }

.ctl--icon svg { width: 14px; height: 14px; }

/* tag filters */

.tagbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 7px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font: inherit;
  font-size: calc(9px * var(--stage-text));
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

.tag b { color: var(--dim); font-size: .92em; font-weight: 700; }

.tag--role { background: transparent; border-color: rgba(255, 255, 255, .07); }

/* Attribute icons: the game's own, loaded from the Valve CDN like the portraits
   (mask-based guesses were replaced on request — these are the real shapes). */
.tag-icon {
  width: 12px;
  height: 12px;
  object-fit: contain;
  flex: none;
  opacity: .9;
}

.tag.is-on .tag-icon { filter: brightness(0) saturate(100%); opacity: .85; }

.attr-icon {
  width: 13px;
  height: 13px;
  margin-right: 4px;
  object-fit: contain;
  opacity: .9;
}

.attr-head > span:first-child { display: inline-flex; align-items: center; }

.tag:hover { color: var(--text); border-color: rgba(200, 162, 90, .35); }

.tag.is-on { color: #0b0a10; background: var(--accent); border-color: var(--accent); }

.tag.is-on b { color: rgba(11, 10, 16, .62); }

.tag:focus-visible { outline: none; border-color: var(--accent); }

/* body: hero board + rail */

.stage-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 178px;
  gap: 10px;
  align-items: start;
  margin-top: 9px;
}

.hero-board { min-width: 0; }

/* One row of four attribute columns — the game's own arrangement, so the
   muscle memory of "Strength far left, Universal far right" carries over. */
.attr-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 12px;
  align-items: start;
}

.attr-col { min-width: 0; }

.attr-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 4px;
  font-size: calc(9px * var(--stage-text));
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}

.attr-head b { font-weight: 700; color: rgba(255, 255, 255, .22); }

.attr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 3px;
}

.hero-card {
  position: relative;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: rgba(0, 0, 0, .28);
  overflow: hidden;
  cursor: pointer;
  transition: transform .1s ease, border-color .1s ease;
}

.hero-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hero-card:hover:not(:disabled),
.hero-card:focus-visible:not(:disabled) { border-color: var(--accent); transform: scale(1.06); z-index: 3; }

.hero-card:focus-visible { outline: none; }

.hero-card:disabled { cursor: default; }

/* Only a hero that is actually gone is dimmed: the pool stays readable while
   the other captain is thinking. */
.hero-card[data-state] img { filter: grayscale(1) brightness(.42); }

.hero-card[data-state="banned"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(45deg, transparent 46%, rgba(255, 96, 96, .85) 47%, rgba(255, 96, 96, .85) 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(255, 96, 96, .85) 47%, rgba(255, 96, 96, .85) 53%, transparent 54%);
}

.hero-card[data-state="picked"] { border-color: var(--side-color); }

.hero-card.is-suggested::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(200, 162, 90, .85);
  border-radius: 3px;
  box-shadow: inset 0 0 12px rgba(200, 162, 90, .35);
  pointer-events: none;
}

/* The recommendation, on the card: same number the ring is drawn from, so a
   captain can compare two heroes instead of trusting five halos. */
.hero-pct {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0 3px;
  font-family: var(--font-mono);
  font-size: calc(7.5px * var(--stage-text));
  font-weight: 700;
  line-height: 1.5;
  color: #ffe2b0;
  background: rgba(8, 8, 12, .78);
  border-bottom-right-radius: 3px;
  pointer-events: none;
}

.hero-card[data-state] .hero-pct { display: none; }

.hero-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(200, 162, 90, .45);
  transform: translateY(-2px);
  z-index: 4;
}

.pool-empty { font-size: 12px; color: var(--dim); }

/* rail: all 24 steps in both columns */

.rail { display: grid; gap: 6px; min-width: 0; }

.rail-tools { display: flex; gap: 5px; justify-content: flex-end; }

.rail-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }

.rail-col {
  padding: 5px 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .02);
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 0 4px;
  font-size: calc(9px * var(--stage-text));
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--side-color);
}

.rail-head .team-mark { width: 11px; height: 11px; }

.rail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }

.rail-step {
  position: relative;
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  gap: 3px;
  align-items: center;
  min-height: 11px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.rail-num {
  font-family: var(--font-mono);
  font-size: calc(8.5px * var(--stage-text));
  font-weight: 700;
  color: var(--dim);
  text-align: right;
}

.rail-face {
  position: relative;
  display: block;
  border-radius: 3px;
  background: rgba(255, 255, 255, .04);
  aspect-ratio: 16 / 6;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .06);
}

/* Picks are the boxes you will still be looking at in twenty minutes, bans are
   the ones you forget — so the pick box is roughly twice the height of a ban box
   and the rail keeps the game's proportions instead of one uniform size. */
.rail-step.is-pick .rail-face { height: 36px; aspect-ratio: auto; }
.rail-step.is-ban .rail-face { height: 15px; aspect-ratio: auto; }

.rail-cta {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(8px * var(--stage-text));
  font-weight: 900;
  letter-spacing: .16em;
  color: var(--accent);
  background: rgba(200, 162, 90, .1);
}

.rail-step.is-other .rail-face { display: none; }

.rail-step.is-other { min-height: 11px; }

.rail-face img { display: block; width: 100%; height: 100%; object-fit: cover; }

.rail-name {
  position: absolute;
  left: 17px;
  right: 2px;
  bottom: 0;
  font-size: 7.5px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.rail-step.is-ban.is-done .rail-face img { filter: grayscale(1) brightness(.6); }

.rail-step.is-ban.is-done .rail-face::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(45deg, transparent 46%, rgba(255, 96, 96, .85) 47%, rgba(255, 96, 96, .85) 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(255, 96, 96, .85) 47%, rgba(255, 96, 96, .85) 53%, transparent 54%);
}

.rail-step.is-pick.is-done .rail-face { border-color: var(--side-color); }

.rail-step.is-current .rail-face { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.rail-step.is-current .rail-num { color: var(--accent); }

.rail-step.is-your-turn .rail-face { background: rgba(200, 162, 90, .13); }

.rail-step.is-lost { opacity: .5; }

.rail-intel {
  display: grid;
  gap: 4px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .25);
}

.intel-row { display: grid; gap: 1px; margin: 0; font-size: 10.5px; }

.intel-row b { color: var(--side-color); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }

.intel-row span { color: var(--text-soft); line-height: 1.35; }

.intel-chance { margin: 2px 0 0; font-size: 11px; font-weight: 700; color: var(--accent); }

.rail-conn { margin: 0; font-size: 9.5px; color: var(--dim); text-align: right; }

/* ---------- the decision bar ---------- */

.confirm-bar {
  position: sticky;
  bottom: 10px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #16151d, #0b0b11);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
}

.confirm-hero { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 260px; }

.confirm-hero img {
  width: 84px;
  height: 47px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  flex: none;
}

.confirm-copy { display: grid; gap: 1px; min-width: 0; }

.confirm-copy b {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.confirm-copy em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}

.confirm-pct { font-size: 11.5px; color: var(--accent); font-variant-numeric: tabular-nums; }

.confirm-actions { display: flex; gap: 8px; margin-left: auto; }

.confirm-go {
  min-width: 118px;
  padding: 10px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(200, 162, 90, .16);
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .16em;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.confirm-go:hover { background: var(--accent); color: #0b0a10; }

.confirm-go[data-kind="ban"] { border-color: rgba(255, 122, 107, .7); color: var(--bad); background: rgba(255, 122, 107, .12); }

.confirm-go[data-kind="ban"]:hover { background: var(--bad); color: #14090b; }

.confirm-go:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(200, 162, 90, .5); }

.confirm-cancel {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.confirm-cancel:hover { color: var(--text); border-color: rgba(200, 162, 90, .4); }

/* ---------- hover card ---------- */

.hero-tip {
  position: absolute;
  z-index: 40;
  width: 252px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #17151f, #100e16);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  overflow: hidden;
  pointer-events: none;
}

.tip-art { aspect-ratio: 16 / 9; background: #000; }

.tip-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tip-body { padding: 8px 10px 10px; display: grid; gap: 3px; }

.tip-body b { font-size: 13.5px; }

.tip-body em {
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--accent);
}

.tip-stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 4px 0 0;
  font-size: 11px;
}

.tip-stats dt { color: var(--dim); }

.tip-stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-soft); }

.tip-note { margin: 4px 0 0; font-size: 10.5px; color: var(--muted); line-height: 1.4; }

/* ---------- settings ---------- */

.sim-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: start center;
  padding: 5vh 16px 16px;
  background: rgba(4, 4, 9, .72);
  backdrop-filter: blur(3px);
  overflow: auto;
}

.sim-modal-box {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #15141d, #0d0c12);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
}

.sett-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.sett-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(200, 162, 90, .14);
  color: var(--accent);
}

.sett-mark svg { width: 17px; height: 17px; }

.sett-title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sett-title p { margin: 1px 0 0; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }

.sett-close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.sett-close:hover { border-color: var(--accent); color: var(--accent); }

.sett-row { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .05); }

.sett-row:first-of-type { border-top: none; }

.sett-row h3 {
  margin: 0 0 4px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text);
}

.sett-row p { margin: 0 0 10px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .3);
}

.seg button {
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.seg button:hover { color: var(--text); }

.seg button.is-on { background: rgba(200, 162, 90, .16); border-color: rgba(200, 162, 90, .5); color: var(--accent); }

.seg button:focus-visible { outline: none; border-color: var(--accent); }

.sett-slider {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

.sett-slider input[type="range"] { width: 100%; accent-color: var(--accent); }

.sett-hint {
  margin: 8px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--bad);
}

.sett-slider b { font-variant-numeric: tabular-nums; color: var(--text-soft); }

/* ---------- done ---------- */

.sim-done {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  box-shadow: var(--shadow);
}

.sim-done h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 22px; font-weight: 500; }

.sim-done .chance { font-size: 30px; font-family: var(--font-mono); color: var(--accent); }

.sim-done p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); max-width: 72ch; }

.sim-done .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.sim-verdict { font-size: 12px; font-weight: 700; margin-top: 10px; }

.sim-verdict.up { color: var(--good); }
.sim-verdict.down { color: var(--bad); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .stage-body { grid-template-columns: minmax(0, 1fr); }
  .rail { order: -1; }
  .rail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail-col .rail-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rail-step.is-other { display: none; }
  .attr-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
}

@media (max-width: 820px) {
  .sim-start { grid-template-columns: minmax(0, 1fr); }
  .start-side { order: -1; }
  .attr-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stage-clock { grid-column: 1 / -1; order: -1; min-width: 0; }
}

@media (max-width: 560px) {
  .attr-grid { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
  .rail-col .rail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-tools { margin-left: 0; }
  .hero-tip { display: none; }
}
