/* Seraph Table — Commander board, Codex tokens */
.seraph-table-host { margin: 0; }
.st { display: grid; grid-template-columns: minmax(0,1fr) 220px; grid-template-rows: auto 1fr auto auto; gap: 8px;
  min-height: calc(100vh - 150px); font-family: var(--f-util); color: var(--ink); }
.st * { box-sizing: border-box; }
.st-bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.st-bar button, .st-bar select, .st-bar input[type="number"], .st-bar input[type="text"] {
  font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 5px 8px; }
.st-bar button { cursor: pointer; }
.st-bar button:hover { border-color: var(--gold); color: var(--gold); }
.st-bar button.is-on { background: linear-gradient(180deg, var(--brass-1), var(--brass-2)); color: var(--brass-ink); border-color: var(--brass-3); }
.st-life { display: flex; align-items: center; gap: 4px; }
.st-life input { width: 52px; text-align: center; font-family: var(--f-display); font-size: 18px; color: var(--gold); }
.st-board { background: color-mix(in srgb, var(--bg-deep) 80%, #1a2416); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 8px; min-height: 360px; overflow: auto; }
.st-row { min-height: 118px; padding: 6px 6px 8px; margin-bottom: 6px;
  border: 1px dashed color-mix(in srgb, var(--gold) 25%, var(--line)); border-radius: 8px; }
.st-row__h { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.st-row__cards { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.st-mana { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.st-sort { display: flex; gap: 2px; }
.st-sort button { padding: 2px 6px; font-size: 11px; }
.st-rail { display: flex; flex-direction: column; gap: 8px; }
.st-cmd, .st-tstack { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.st-cmd h3, .st-tstack h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.st-hand { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.st-hand.is-hid .st-row__cards { filter: blur(8px); pointer-events: none; }
.st-wells { grid-column: 1 / -1; display: flex; gap: 8px; }
.st-well { flex: 1; min-height: 54px; cursor: pointer; text-align: center; padding: 8px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.st-well b { display: block; font-family: var(--f-display); color: var(--gold); font-size: 20px; }
.st-card { width: 132px; cursor: grab; position: relative; }
.st-card.is-sel { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.st-card.is-tap { transform: rotate(90deg); transform-origin: center; margin: 18px 10px; }
.st-card.is-atk { box-shadow: 0 0 0 2px var(--bad); }
.st-card__frame { width: 132px; }
.st-card__frame .mtgcard, .st-card__frame .mtgcard-wrap { width: 132px !important; }
.st-card__img { width: 132px; display: block; border-radius: 8px; border: 1px solid #1a160e; }
.st-card__face {
  width: 132px; min-height: 184px; background: var(--card-face); color: var(--card-ink);
  border: 2px solid #1a160e; border-radius: 8px; padding: 6px; font-family: var(--f-body); font-size: 11px;
}
.st-card__face b { display: block; font-size: 12px; }
.st-card__face .type { font-size: 10px; border-top: 1px solid var(--card-rule); border-bottom: 1px solid var(--card-rule); margin: 4px 0; }
.st-card__face .rules p { margin: 0 0 4px; line-height: 1.3; }
.st-card__pt { text-align: right; font-weight: 700; }
.st-card__n { position: absolute; right: 4px; top: 4px; background: var(--brass-2); color: var(--brass-ink);
  border-radius: 99px; padding: 0 5px; font-size: 10px; }
.st-modal {
  position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: flex; align-items: center; justify-content: center;
}
.st-sheet {
  width: min(640px, 94vw); max-height: 82vh; overflow: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-lift);
}
.st-sheet h2 { margin: 0 0 10px; font-family: var(--f-display); font-size: 20px; }
.st-sheet .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.st-sheet button { font: inherit; cursor: pointer; padding: 6px 10px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink); border-radius: var(--radius); }
.st-sheet button.primary { background: linear-gradient(180deg, var(--brass-1), var(--brass-2)); color: var(--brass-ink); border-color: var(--brass-3); }
.st-glist { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.st-glist label { display: flex; gap: 8px; align-items: center; }
.st-dice { font-family: var(--f-display); font-size: 64px; text-align: center; margin: 16px 0; color: var(--gold); }
.st-dice.is-roll { animation: stspin .12s linear infinite; }
@keyframes stspin { to { transform: rotate(18deg); } }
.st-log { font-family: var(--f-body); font-size: 13px; max-height: 50vh; overflow: auto; }
.st-log p { margin: 0 0 6px; }
.st-combat { grid-column: 1 / -1; padding: 8px 10px; background: color-mix(in srgb, var(--bad) 22%, var(--surface));
  border: 1px solid var(--bad); border-radius: var(--radius); display: flex; gap: 8px; align-items: center; }
.st-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.st-acts button { font-size: 11px; }
.st-picker { max-width: 240px; }
@media (max-width: 900px) {
  .st { grid-template-columns: 1fr; }
  .st-rail { flex-direction: row; }
}

.st-pick { position: relative; }
.st-pick__btn { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.st-pick__panel {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  width: min(420px, 86vw); max-height: min(70vh, 560px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift); padding: 8px;
}
.st-pick__panel input {
  width: 100%; margin-bottom: 8px; padding: 8px 10px; font: inherit;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
}
.st-pick__list { overflow: auto; max-height: min(58vh, 480px); }
.st-pick__g { margin: 10px 0 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.st-pick__r { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%;
  text-align: left; padding: 7px 8px; margin: 0; cursor: pointer;
  background: transparent; border: 0; border-radius: var(--radius); color: var(--ink); font: inherit; }
.st-pick__r span { color: var(--ink-3); font-size: 12px; }
.st-pick__r:hover, .st-pick__r.is-on { background: var(--gold-glow); }
.st-pick__empty { color: var(--ink-3); padding: 12px; }

.st-inspect { margin-top: 10px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.st-inspect__name { font-family: var(--f-display); font-size: 18px; margin: 0 0 4px; }
.st-inspect__type { color: var(--ink-2); margin: 0 0 8px; }
.st-inspect__rules p { margin: 0 0 6px; font-family: var(--f-body); line-height: 1.4; }
.st-menu { position: fixed; z-index: 90; min-width: 200px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.st-menu button { display: block; width: 100%; text-align: left; margin: 2px 0; font: inherit;
  padding: 7px 8px; background: var(--surface-2); border: 1px solid transparent; color: var(--ink); cursor: pointer; }
.st-menu button:hover { border-color: var(--gold); }
.st-librow { padding: 6px 4px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.st-librow span { color: var(--ink-3); font-size: 12px; }

.st-phases button { font-size: 11px; }
.st-pool { font-variant-numeric: tabular-nums; }
.st-mana__p { display: inline-block; margin-right: 8px; padding: 2px 6px; background: var(--surface-2); border-radius: 4px; }
.st-prev { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-top: 8px; }
.st-prev img { width: 100%; border-radius: 8px; display: block; margin-bottom: 8px; }
.st-prev__n { font-family: var(--f-display); font-size: 16px; margin: 0 0 4px; }
.st-prev__t { color: var(--ink-2); margin: 0 0 6px; }
.st-prev__r p { margin: 0 0 6px; font-family: var(--f-body); line-height: 1.35; }
.st-menu { position: fixed; z-index: 90; min-width: 210px; max-height: 70vh; overflow: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.st-menu button { display: block; width: 100%; text-align: left; margin: 2px 0; font: inherit; padding: 7px 8px;
  background: var(--surface-2); border: 1px solid transparent; color: var(--ink); cursor: pointer; }
.st-menu button:hover { border-color: var(--gold); }

.st-board, .st-row, .st-row__cards, .st-hand, .st-cmd { overflow: visible; }
.st-card { position: relative; z-index: 1; }
.st-card.is-front { z-index: 30; }
.st-card .st-menu,
.st-card .st-card__peek {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  width: 228px;
  z-index: 40;
}
.st-card__peek {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow-lift);
}
.st-menu--float { position: fixed; }
