:root {
  --bg: #12141a;
  --bg-elev: #1a1d26;
  --bg-panel: #222632;
  --border: #2e3444;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #c0392b;
  --accent-soft: #8e2a22;
  --green: #2ecc71;
  --red: #e74c3c;
  --felt: #2c1e16;
  --felt-mid: #3d2a20;
  --felt-hi: #4e382a;
  --felt-edge: #140e0a;
  --rail: #2a1c14;
  --rail-hi: #4a3428;
  --rail-lo: #120c08;
  --gg-bb: #6ec8ff;
  --gg-pot: #3dde6a;
  --gg-cash: #d4b896;
  --gg-active: #2ee66a;
  --card: #f7f7f7;
  --card-text: #1a1a1a;
  --radius: 10px;
  --font: "Segoe UI", "IBM Plex Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 20% -10%, #2a2030 0%, transparent 50%),
    radial-gradient(900px 500px at 90% 0%, #1a2838 0%, transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 20, 26, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 180px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e74c3c, #922b21);
  font-weight: 700;
  font-size: 0.95rem;
}

.brand-name {
  font-weight: 650;
  letter-spacing: 0.02em;
}

.mode-tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-elev);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.mode-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
}

.mode-tab.active {
  background: var(--accent);
  color: #fff;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.auth-menu {
  position: relative;
}

.auth-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 220px;
}

.auth-menu-btn #auth-menu-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-menu-caret {
  opacity: 0.7;
  font-size: 0.75rem;
}

.auth-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 200px;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  background: var(--panel, #1a1f2a);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 40;
}

.auth-menu-user {
  padding: 0.45rem 0.65rem 0.25rem;
  font-size: 0.8rem;
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.auth-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.list-section {
  list-style: none;
  margin: 0.7rem 0 0.25rem;
  padding: 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
}

.range-badge {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75em;
}

.auth-tabs {
  display: flex;
  gap: 0.4rem;
}

.auth-message {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.85rem;
}

.auth-message.error {
  color: var(--red);
}

.auth-message.ok {
  color: var(--green);
}

.btn {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  border-color: #4a5568;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #d6453a, #a93226);
  border-color: #922b21;
  color: #fff;
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.85rem;
}

.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.settings-toggle input {
  accent-color: var(--accent);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 57px);
}

.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(26, 29, 38, 0.85);
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow: auto;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.drill-list,
.range-list,
.stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.list-item {
  border: 1px solid transparent;
  background: var(--bg-panel);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.list-item:hover {
  border-color: #3d465c;
}

.list-item.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.list-item .title {
  font-size: 0.92rem;
  font-weight: 600;
}

.list-item .meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.list-item .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.icon-btn:hover {
  color: var(--text);
  background: #2c3344;
}

.main {
  padding: 1rem 1.25rem 1.5rem;
  overflow: auto;
}

.pane[hidden] {
  display: none !important;
}

.session-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.session-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 180px;
}

.session-score {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.score-pct {
  color: var(--muted);
  font-size: 0.9rem;
}

.classic-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(320px, 0.9fr);
  gap: 1.25rem;
  align-items: start;
}

.table-wrap {
  position: relative;
}

#table-wrap[data-felt="charcoal"] {
  --felt: #2a2e33;
  --felt-mid: #353b42;
  --felt-hi: #454d56;
  --felt-edge: #16181c;
  --rail: #2a2e33;
  --rail-hi: #3d444d;
  --rail-lo: #141618;
}

#table-wrap[data-felt="gray"] {
  --felt: #5c636e;
  --felt-mid: #6e7682;
  --felt-hi: #8a929e;
  --felt-edge: #3a4048;
  --rail: #4a515c;
  --rail-hi: #6a7280;
  --rail-lo: #2c3138;
}

#table-wrap[data-felt="green"] {
  --felt: #143028;
  --felt-mid: #1c4336;
  --felt-hi: #286048;
  --felt-edge: #0a1c16;
  --rail: #163028;
  --rail-hi: #245040;
  --rail-lo: #0a1812;
}

#table-wrap[data-felt="wenge"] {
  --felt: #2c1e16;
  --felt-mid: #3d2a20;
  --felt-hi: #4e382a;
  --felt-edge: #140e0a;
  --rail: #2a1c14;
  --rail-hi: #4a3428;
  --rail-lo: #120c08;
}

#table-wrap[data-felt="blue"] {
  --felt: #152238;
  --felt-mid: #1c3050;
  --felt-hi: #274268;
  --felt-edge: #0c1424;
  --rail: #152033;
  --rail-hi: #243656;
  --rail-lo: #0a101c;
}

#table-wrap[data-felt="red"] {
  --felt: #6e1c28;
  --felt-mid: #8a2434;
  --felt-hi: #a83244;
  --felt-edge: #3a0e16;
  --rail: #4a1520;
  --rail-hi: #6e2434;
  --rail-lo: #240810;
}

#table-wrap[data-felt="purple"] {
  --felt: #4c1d95;
  --felt-mid: #5b21b6;
  --felt-hi: #7c3aed;
  --felt-edge: #2e1065;
  --rail: #3b0764;
  --rail-hi: #6d28d9;
  --rail-lo: #1e0a3a;
}

.felt-menu {
  position: fixed;
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(4, 28px);
  gap: 6px;
  padding: 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.felt-menu[hidden] {
  display: none;
}

.felt-menu button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
}

.felt-menu button:hover,
.felt-menu button.active {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 1px;
}

.felt-swatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.table-stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  padding: 1.15rem 0.9rem 1.35rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, color-mix(in srgb, var(--felt) 50%, transparent) 0%, transparent 65%),
    linear-gradient(180deg, color-mix(in srgb, var(--felt-edge) 75%, #000) 0%, #070605 55%, #050403 100%);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.65);
}

.table-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 75%, color-mix(in srgb, var(--felt) 30%, transparent), transparent 42%),
    radial-gradient(ellipse at 88% 18%, color-mix(in srgb, var(--felt-hi) 22%, transparent), transparent 38%);
  pointer-events: none;
}

.table-felt {
  position: relative;
  height: 400px;
  border-radius: 50% / 44%;
  background:
    radial-gradient(ellipse 55% 42% at 50% 42%, var(--felt-hi) 0%, var(--felt-mid) 42%, var(--felt) 72%, var(--felt-edge) 100%);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.45),
    inset 0 12px 28px rgba(255, 220, 180, 0.06),
    0 20px 44px rgba(0, 0, 0, 0.6);
  transition: box-shadow 0.2s ease, outline-color 0.2s ease;
  outline: 3px solid transparent;
  outline-offset: 10px;
  isolation: isolate;
}

.table-felt::before {
  content: "GTO";
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.28em;
  color: rgba(255, 235, 210, 0.07);
  pointer-events: none;
  z-index: 0;
}

.table-rail {
  position: absolute;
  inset: -16px;
  border-radius: 50% / 44%;
  background: linear-gradient(145deg, var(--rail-hi) 0%, var(--rail) 45%, var(--rail-lo) 100%);
  box-shadow:
    0 3px 0 rgba(255, 210, 160, 0.12) inset,
    0 -4px 10px rgba(0, 0, 0, 0.55) inset,
    0 12px 28px rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.table-rail::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50% / 44%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.table-stitch {
  position: absolute;
  inset: 9px;
  border-radius: 50% / 44%;
  border: 1.5px solid rgba(212, 175, 110, 0.45);
  box-shadow: 0 0 0 1px rgba(40, 25, 12, 0.45) inset;
  pointer-events: none;
  z-index: 1;
}

.table-felt.ok {
  outline-color: var(--gg-active);
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, 0.55),
    0 0 0 3px rgba(46, 230, 106, 0.35),
    0 18px 40px rgba(0, 0, 0, 0.55);
}

.table-felt.bad {
  outline-color: var(--red);
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, 0.55),
    0 0 0 3px rgba(231, 76, 60, 0.4),
    0 18px 40px rgba(0, 0, 0, 0.55);
}

.table-pot {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  z-index: 2;
  pointer-events: none;
}

.pot-chips {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 22px;
  gap: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.pot-chips .chip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  margin-left: -6px;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.15);
}

.pot-chips .chip:first-child {
  margin-left: 0;
}

.pot-chips .c1 { background: radial-gradient(circle at 35% 30%, #ffe08a, #d4a017); }
.pot-chips .c2 { background: radial-gradient(circle at 35% 30%, #7dff9a, #1f9d4a); }
.pot-chips .c3 { background: radial-gradient(circle at 35% 30%, #ff9ec8, #c2185b); }
.pot-chips .c4 { background: radial-gradient(circle at 35% 30%, #9ad4ff, #1e88e5); }

.table-pot .pot-bb {
  min-width: 72px;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--gg-pot);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.table-pot .pot-sub {
  font-size: 0.72rem;
  color: var(--gg-active);
  font-weight: 700;
  opacity: 0.95;
}

.action-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(240, 193, 75, 0.45);
  box-shadow: 0 0 12px rgba(240, 193, 75, 0.15);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 0.15rem;
}

.action-line .action-from {
  color: #f0c14b;
}

.action-line .action-verb {
  color: #d7dde8;
  font-weight: 650;
}

.action-line .action-size {
  color: #fff;
}

.table-seats {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 96px;
  text-align: center;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 0.78rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.seat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, #4a5160 0%, #2a303a 60%, #1a1e24 100%);
  border: 2px solid rgba(180, 190, 205, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.seat-panel {
  width: 100%;
  background: linear-gradient(180deg, #2a303c 0%, #1a1e28 100%);
  border: 1px solid #3a4458;
  border-radius: 8px;
  padding: 0.28rem 0.35rem 0.35rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.seat.active .seat-panel,
.seat.hero .seat-panel {
  border-color: var(--gg-active);
  box-shadow:
    0 0 0 1px rgba(46, 230, 106, 0.55),
    0 0 16px rgba(46, 230, 106, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

.seat.villain .seat-panel {
  border-color: #f0c14b;
  box-shadow:
    0 0 0 1px rgba(240, 193, 75, 0.45),
    0 0 14px rgba(240, 193, 75, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

.seat.villain .seat-avatar {
  border-color: rgba(240, 193, 75, 0.65);
}

.seat.hero .seat-avatar {
  border-color: rgba(46, 230, 106, 0.7);
  box-shadow: 0 0 10px rgba(46, 230, 106, 0.35);
}

.seat-name {
  font-weight: 700;
  font-size: 0.72rem;
  color: #f2f4f8;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-stack {
  color: var(--gg-bb);
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-shadow: 0 0 8px rgba(110, 200, 255, 0.25);
}

.seat-stack span {
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.9;
}

.seat .action-badge {
  display: inline-block;
  margin-top: 0.1rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7d774, #d4a017);
  color: #1a1400;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.seat .hero-tag {
  color: var(--gg-active);
  font-size: 0.65rem;
  font-weight: 700;
  margin-top: 0.05rem;
  text-shadow: 0 0 8px rgba(46, 230, 106, 0.4);
}

.dealer-btn {
  position: absolute;
  right: -2px;
  top: 28px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe566, #f0c000 55%, #c49200);
  color: #1a1400;
  font-size: 0.7rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  z-index: 5;
}

.bet-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 58px;
  padding: 0.22rem 0.5rem;
  border-radius: 5px;
  background: linear-gradient(180deg, #e8d2b0, #c9a878);
  color: #2a1e10;
  font-size: 0.68rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 4;
  text-align: center;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.bet-chip-pos {
  font-size: 0.58rem;
  opacity: 0.75;
  letter-spacing: 0.04em;
}

.bet-chip-bb {
  white-space: nowrap;
  font-size: 0.78rem;
}

.hole-cards {
  position: absolute;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.35rem;
  z-index: 4;
}

.hole-cards::after {
  content: "Hero";
  position: absolute;
  left: 50%;
  bottom: -1.05rem;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gg-active);
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(46, 230, 106, 0.35);
}

.card {
  position: relative;
  width: 56px;
  height: 82px;
  border-radius: 6px;
  font-family: Arial, "Segoe UI", sans-serif;
  font-weight: 800;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 3px 10px rgba(0, 0, 0, 0.55);
  border: 2px solid #f0f0f0;
  color: #fff;
  line-height: 1;
  overflow: hidden;
  user-select: none;
}

.card-tl {
  position: absolute;
  top: 3px;
  left: 4px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 1.1em;
}

.card-rank-sm {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.card-pip {
  font-size: 0.55rem;
  line-height: 1;
  margin-top: 1px;
}

.card-suit-mid {
  position: absolute;
  left: 5px;
  top: 48%;
  transform: translateY(-50%);
  font-size: 1.55rem;
  line-height: 1;
  z-index: 1;
  opacity: 0.95;
}

.card-rank-lg {
  position: absolute;
  right: 1px;
  bottom: -2px;
  z-index: 1;
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

/* GG 4-color solid faces */
.card.suit-s {
  background: #1f2126;
  color: #fff;
}

.card.suit-h {
  background: #c62828;
  color: #fff;
}

.card.suit-d {
  background: #1565c0;
  color: #fff;
}

.card.suit-c {
  background: #2e7d32;
  color: #fff;
}

.card.red {
  background: #c62828;
  color: #fff;
}

.card.back {
  background:
    linear-gradient(145deg, #6b2a2a 0%, #4a1818 50%, #3a1010 100%);
  border-color: #e8e8e8;
  box-shadow:
    inset 0 0 0 3px #5a2020,
    0 3px 10px rgba(0, 0, 0, 0.55);
}

.card.back::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 200, 180, 0.25);
  border-radius: 3px;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.12) 3px,
      rgba(0, 0, 0, 0.12) 6px
    );
}

.card.back .card-tl,
.card.back .card-rank-lg,
.card.back .card-suit-mid {
  display: none;
}

.feedback-banner {
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.feedback-banner.ok {
  border-color: rgba(46, 204, 113, 0.5);
  color: #a8efc4;
}

.feedback-banner.bad {
  border-color: rgba(231, 76, 60, 0.5);
  color: #f5b7b1;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.action-btn {
  min-width: 110px;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #1b1f2a;
  cursor: pointer;
  font-weight: 650;
}

.action-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.action-btn.correct-hint {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.action-btn .rng-hint {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.15rem;
}

.matrix-panel,
.stats-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
}

.matrix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.matrix-header h3,
.stats-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.matrix {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 2px;
  user-select: none;
}

.matrix.large {
  max-width: 720px;
  gap: 3px;
}

.matrix-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: #2a3040;
  color: #cfd5e3;
  font-size: clamp(0.45rem, 1.1vw, 0.7rem);
  display: grid;
  place-items: center;
  font-weight: 650;
  position: relative;
  border: 1px solid transparent;
  cursor: default;
}

.matrix.paint .matrix-cell {
  cursor: pointer;
}

.matrix-cell .dot-error {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4d4f;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.matrix-cell.highlight {
  outline: 2px solid #fff;
  outline-offset: -1px;
  z-index: 1;
}

.legend {
  display: none;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.paint-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.paint-tool {
  border: 2px solid var(--border);
  background: #1b1f2a;
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.paint-tool.active {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.range-mode-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stats-card.wide {
  grid-column: 1 / -1;
}

.stat-big {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.6rem;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.modal-card {
  width: min(420px, calc(100vw - 2rem));
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.modal-card label,
.modal-card fieldset {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  border: 0;
  padding: 0;
  margin: 0;
}

.modal-card input,
.modal-card select {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}

.checkbox-list {
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.checkbox-list label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 280px;
  }

  .classic-layout {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
