/* HTML chrome only — the table itself is rendered on the PixiJS canvas behind
   everything. Theme tokens mirror the sim-viewer for a consistent look. */
:root {
  --bg: #0f1115;
  --panel: #1c2029;
  --panel-2: #232834;
  --line: #2c3340;
  --text: #e7ebf0;
  --muted: #97a1b0;
  --accent: #6ee7a8;
  --accent-2: #ffd479;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  --round: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.45 ui-rounded,
    'Segoe UI Rounded',
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
}

#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#stage canvas {
  display: block;
}

/* --- top bar --- */
.topbar {
  position: fixed;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(15, 17, 21, 0.92), rgba(15, 17, 21, 0.55));
  backdrop-filter: blur(6px);
}

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand .tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  vertical-align: middle;
  margin-left: 4px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.controls select,
.controls button,
.actionbar button {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
}

.controls button:hover,
.actionbar button:hover {
  border-color: var(--accent);
}

.status {
  margin-left: auto;
  color: var(--muted);
  font-weight: 600;
}

.status.you {
  color: var(--accent);
}

/* --- table log --- */
.log {
  position: fixed;
  z-index: 2;
  top: 64px;
  right: 12px;
  width: 216px;
  max-height: 196px;
  /* Scrolls when full. No seat is ever drawn under it — drawOpponent reserves
     this panel's rect — so it never covers or blocks a player/card target. */
  overflow: auto;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--round);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.log-title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 6px;
}

.log ol {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.log li {
  color: var(--text);
}

.log li.fresh {
  color: var(--accent-2);
}

/* --- center banner (thinking / game over) --- */
.banner {
  position: fixed;
  z-index: 4;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 14px 26px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.banner.win {
  font-size: 24px;
  border-color: var(--accent-2);
  color: var(--accent-2);
}

/* --- action bar (your turn) --- */
.actionbar {
  position: fixed;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  width: min(320px, 42vw);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
}

.action-header {
  font-weight: 700;
  margin-bottom: 3px;
}

.action-desc {
  min-height: 18px;
  margin-bottom: 4px;
  line-height: 1.25;
}

.action-desc .ci-name {
  font-weight: 700;
}

.action-desc .ci-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--accent-2);
  margin-left: 6px;
}

.action-desc .ci-text {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.action-desc .ci-hint {
  color: var(--muted);
  font-style: italic;
}

.action-options .opt.cancel {
  color: var(--muted);
}

.action-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-options .opt {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 11px;
  cursor: pointer;
  transition:
    transform 0.08s,
    border-color 0.12s,
    background 0.12s;
}

.action-options .opt:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.action-options .opt.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--panel-2));
}

.action-options .opt .ord {
  display: inline-block;
  min-width: 18px;
  margin-right: 4px;
  color: var(--accent);
  font-weight: 700;
}

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

.action-hint {
  color: var(--muted);
  font-size: 12px;
}

.confirm {
  margin-left: auto;
  background: color-mix(in srgb, var(--accent) 26%, var(--panel-2)) !important;
  border-color: var(--accent) !important;
  font-weight: 700;
}

.confirm[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}
