:root {
  --panel: #1c2026;
  --panel-raised: #262b33;
  --panel-deep: #15181d;
  --line: #3a424e;
  --text: #ece7dc;
  --muted: #9ba4ae;
  --amber: #f0a93b;
  --green: #6cc24a;
  --red: #e5603f;
  --steel: #3b4656;
  --paper: #12365f;
  --paper-line: #8cc4ff;
  --tray: 340px;
  --side: 340px;
  --store: 138px;
  --stencil: 'Saira Stencil One', Impact, 'Arial Narrow', sans-serif;
  --body: 'Saira Condensed', 'Arial Narrow', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #2a1a10;
  color: var(--text);
  font: 500 16px/1.25 var(--body);
  user-select: none;
  -webkit-user-select: none;
}

#table { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
body.panning #table, body.panning { cursor: grabbing; }
body.reorg #table { cursor: pointer; }
body.dragging, body.dragging * { cursor: grabbing !important; }

#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui > .hint, #ui > .tooltip, #ui > .bp-pop { pointer-events: none; }

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
a { color: var(--amber); }
[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; }
h1 { font: 400 40px/1.05 var(--stencil); color: var(--amber); letter-spacing: 0.5px; }
h2 { font: 400 22px/1 var(--stencil); color: var(--amber); letter-spacing: 0.4px; }
h3 { font-size: 13px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
h4 { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.note { color: var(--muted); font-size: 14px; margin: 6px 0; }
.grow { flex: 1; }
.scroll { overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* Buttons */
.primary {
  background: var(--amber);
  color: #241607;
  font-weight: 700;
  border: 0;
  border-radius: 5px;
  padding: 10px 20px;
  letter-spacing: 0.4px;
}
.primary:hover { background: #ffc15e; }
.primary.small { padding: 6px 14px; font-size: 15px; }

.ghost-button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 12px;
  color: var(--text);
  font-size: 14px;
}
.ghost-button:hover { border-color: var(--amber); color: var(--amber); }

.small-button {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 12px;
  color: var(--text);
}
.small-button:hover:not(:disabled) { border-color: var(--amber); }
.small-button:disabled { opacity: 0.4; }

/* Top bar */
.topbar {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  border-width: 0 0 1px;
}
.brand { font: 400 24px/1 var(--stencil); color: var(--amber); white-space: nowrap; }
.round {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font: 700 22px/1 var(--body);
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.round small { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.chips { display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 3px 10px 3px 8px;
  font-size: 15px;
  white-space: nowrap;
}
.chip:hover { border-color: var(--dot); }
.chip.on { background: #333a45; border-color: var(--dot); }
.chip-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.tick { color: var(--green); font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); flex: none; }
.dot.away { background: none; box-shadow: inset 0 0 0 2px var(--dot); }

/* Blueprints */
.tray {
  position: absolute;
  left: 0; top: 48px; bottom: var(--store);
  width: var(--tray);
  padding: 9px 0 0;
  display: flex;
  flex-direction: column;
  border-width: 0 1px 0 0;
}
.tray h2 { padding: 0 10px 6px; }
.tray .note { padding: 0 12px; }
.tray-head { display: flex; justify-content: space-between; align-items: center; padding: 0 10px 6px; }
.tray-head h2 { padding: 0; }
.reorg-button {
  padding: 4px 14px;
  border: 2px dashed var(--paper-line);
  border-radius: 6px;
  background: rgba(18, 54, 95, 0.5);
  color: var(--paper-line);
  font: 400 17px/1.1 var(--stencil);
}
.reorg-button:hover:not(:disabled) { border-color: var(--amber); color: var(--amber); }
.reorg-button.on, .reorg-button.on:hover:not(:disabled) { background: var(--amber); border-style: solid; border-color: var(--amber); color: #241607; }
.reorg-button:disabled { opacity: 0.45; }

.blueprints {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
  padding: 2px 8px 10px;
}

.bp, .bp-pop {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 12px 12px;
}
.bp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px 4px;
  border: 1px solid #2c5788;
  border-radius: 6px;
  color: #dcebfa;
}
.bp.ready { border-color: var(--paper-line); cursor: grab; box-shadow: 0 0 0 1px rgba(140, 196, 255, 0.3); }
.bp.ready:hover { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.bp-name { font-size: 15px; font-weight: 700; white-space: nowrap; }
.bp-art { width: 60px; height: 83px; border-radius: 4px; pointer-events: none; }
.bp:not(.ready) .bp-art { opacity: 0.75; }
.bp-costs { display: flex; justify-content: center; gap: 3px; min-height: 41px; }
.bp-cost { width: 30px; height: 41px; border-radius: 3px; outline: 1px solid rgba(255, 255, 255, 0.55); pointer-events: none; }
.bp-cost.short { opacity: 0.45; outline-color: var(--red); }
.own {
  position: absolute;
  top: 26px; right: 4px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--green);
  color: #0f1d09;
  font-weight: 700;
  font-size: 14px;
  line-height: 19px;
}
.buy {
  width: 100%;
  background: rgba(8, 24, 44, 0.75);
  color: #a4e88a;
  border: 1px solid #4f8a3e;
  border-radius: 4px;
  padding: 2px 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.buy:hover:not(:disabled) { background: #2b4524; }
.buy:disabled { color: #8fa6bf; border-color: #36587f; }

.bp-pop {
  position: absolute;
  left: calc(var(--tray) + 8px);
  width: 330px;
  padding: 12px 14px;
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  color: #dcebfa;
  z-index: 7;
}
.pop-head { display: flex; gap: 12px; }
.pop-head h3 { font: 400 22px/1.05 var(--stencil); text-transform: none; letter-spacing: 0.3px; color: #fff; }
.pop-head p { margin: 6px 0 0; font-size: 16px; line-height: 1.25; }
.pop-own { color: #a4e88a; font-weight: 700; }
.pop-art { width: 112px; height: 155px; border-radius: 6px; flex: none; }
.bp-pop h4 { margin: 10px 0 5px; color: var(--paper-line); }
.pop-need { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; margin-bottom: 5px; }
.pop-need span { flex: 1; }
.pop-need b { color: #ff9a80; font-size: 14px; }
.pop-need.got b { color: #a4e88a; }
.pop-cost { width: 48px; height: 66px; border-radius: 4px; outline: 1px solid rgba(255, 255, 255, 0.5); }

.facts { display: flex; gap: 16px; padding: 10px 12px; color: var(--muted); font-size: 13px; }
.facts b { display: block; font-size: 24px; color: var(--text); }

/* Side panel */
.side {
  position: absolute;
  right: 0; top: 48px; bottom: var(--store);
  width: var(--side);
  display: flex;
  flex-direction: column;
  border-width: 0 0 0 1px;
}
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button {
  flex: 1;
  background: none;
  border: 0;
  padding: 11px 6px 9px;
  font: 400 18px/1 var(--stencil);
  color: var(--muted);
  border-bottom: 3px solid transparent;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--amber); border-bottom-color: var(--amber); }

.zone { padding: 8px 12px; background: var(--panel-deep); border-bottom: 1px solid var(--line); flex: none; }
.zone h3 { display: flex; justify-content: space-between; align-items: baseline; }
.zone h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 13px; }
.zone .note { margin: 3px 0 0; }
.zone-items { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; max-height: 118px; overflow-y: auto; }
.zone-item {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px 2px 2px;
}
.zone-item:hover:not(:disabled) { border-color: var(--red); }
.zone-item .token { width: 30px; height: 41px; border-radius: 2px; display: block; }

.auto-smelt {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.auto-smelt:hover { background: var(--panel-raised); }
.auto-smelt input { width: 19px; height: 19px; accent-color: var(--amber); }
.auto-smelt b { display: block; font-size: 16px; }
.auto-smelt small { color: var(--muted); font-size: 14px; }

.recipes { padding: 4px 8px 10px; }
.recipes h4 { padding: 9px 4px 3px; }
.recipe {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 8px 4px 5px;
  margin: 4px 0;
  text-align: left;
}
.recipe:hover:not(:disabled) { border-color: var(--amber); }
.recipe:disabled { background: none; border-color: transparent; }
.recipe:disabled .mini { opacity: 0.55; }
.recipe:disabled .recipe-name { color: var(--muted); }
.mini { width: 36px; height: 50px; border-radius: 3px; display: block; }
.ins { display: flex; gap: 3px; }
.arrow { color: var(--muted); padding: 0 1px; font-size: 18px; }
.recipe-name { flex: 1; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.can { color: var(--green); font-weight: 700; font-size: 16px; }

.catalog { padding: 2px 10px 10px; }
.tier {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}
.price { font-weight: 700; font-size: 21px; color: var(--amber); line-height: 1.1; }
.price small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.price.error { color: var(--red); font-size: 17px; }
.android-token { width: 58px; display: block; }
.goods { display: flex; flex-wrap: wrap; gap: 6px; }
.good { position: relative; width: 58px; }
.good-token { width: 58px; height: 80px; border-radius: 4px; display: block; }
.good-have {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 11px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 19px;
  text-align: center;
}
.good-buy {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 1px 0;
  background: #3c2c10;
  color: #ffd28a;
  border: 1px solid #a8762a;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
}
.good-buy:hover:not(:disabled) { background: #5a4216; }
.good-buy:disabled { opacity: 0.32; }

.selling { padding: 2px 10px 10px; }
.sale {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}
.sale-token { width: 44px; height: 61px; border-radius: 3px; flex: none; }
.sale-name { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; line-height: 1.15; }
.sale-name small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.sale-one, .sale-all {
  border-radius: 5px;
  font-weight: 700;
  white-space: nowrap;
}
.sale-one {
  background: #2f6b1f;
  border: 1px solid #6cc24a;
  color: #fff;
  padding: 9px 10px;
  font-size: 16px;
}
.sale-one:hover:not(:disabled) { background: #3d8a28; }
.sale-one.refund { background: #a8650f; border-color: var(--amber); }
.sale-one.refund:hover:not(:disabled) { background: #c97a12; }
.sale-one:disabled { background: none; border-color: var(--line); color: var(--muted); font-weight: 500; font-size: 14px; }
.sale-all {
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 8px;
  font-size: 14px;
}
.sale-all:hover:not(:disabled) { border-color: var(--green); }

/* Store */
.store {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--store);
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 6px 12px;
  border-width: 1px 0 0;
}
.money {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 96px;
  font: 700 34px/1 var(--body);
  color: var(--green);
  padding-right: 12px;
  border-right: 1px solid var(--line);
}
.money small { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.bins { flex: 1; display: flex; gap: 14px; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.bin { flex: none; }
.bin h4 { padding-bottom: 2px; }
.tiles { display: flex; gap: 5px; }
.tile { width: 52px; }
.tile-face { position: relative; width: 52px; height: 72px; }
.tile-token { width: 52px; height: 72px; border-radius: 4px; display: block; }
.tile.empty .tile-token { opacity: 0.4; filter: saturate(0.6); }
.count {
  position: absolute;
  left: -3px; bottom: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 11px;
  background: #101317;
  border: 1px solid var(--line);
  font-size: 15px;
  line-height: 20px;
  text-align: center;
}
.tile.empty .count { color: var(--muted); opacity: 0.7; }
.coming {
  position: absolute;
  right: -3px; bottom: -2px;
  padding: 0 4px;
  height: 20px;
  border-radius: 10px;
  background: #24401d;
  color: #a4e88a;
  font-size: 13px;
  font-weight: 700;
  line-height: 19px;
}
.sell-chip {
  display: block;
  width: 100%;
  height: 20px;
  margin-top: 4px;
  padding: 0;
  border: 1px solid #6cc24a;
  border-radius: 4px;
  background: #2f6b1f;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 17px;
  white-space: nowrap;
}
.sell-chip:hover { background: #3d8a28; }
.sell-chip.refund { background: #a8650f; border-color: var(--amber); }
.sell-chip.refund:hover { background: #c97a12; }
.flash {
  position: absolute;
  left: 50%; top: 10px;
  transform: translateX(-50%);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 1px 4px #000, 0 0 12px var(--amber);
  animation: rise 1.9s ease-out forwards;
  pointer-events: none;
}
@keyframes rise {
  0% { opacity: 0; transform: translate(-50%, 16px) scale(0.7); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  70% { opacity: 1; transform: translate(-50%, -14px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(1); }
}

.turn {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  min-width: 200px;
}
.end {
  background: var(--amber);
  color: #241607;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  height: 58px;
  font: 400 21px/1 var(--stencil);
  white-space: nowrap;
}
.end:hover:not(:disabled) { background: #ffc15e; }
.end:disabled { opacity: 0.5; }
.waiting { color: var(--muted); font-size: 15px; max-width: 150px; text-align: right; }

/* Messages over the table */
.hint {
  position: absolute;
  left: 50%;
  top: 66px;
  transform: translateX(-50%);
  background: rgba(20, 23, 28, 0.92);
  border: 1px solid var(--amber);
  color: var(--text);
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 17px;
  width: max-content;
  max-width: calc(100vw - var(--tray) - var(--side) - 32px);
  text-align: center;
}
body.reorg .hint { top: 142px; }

.reorg-banner {
  position: absolute;
  left: 50%;
  top: 58px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100vw - var(--tray) - var(--side) - 24px);
  padding: 8px 12px 8px 16px;
  border: 2px solid var(--paper-line);
  border-radius: 8px;
  background: rgba(10, 34, 62, 0.95);
  color: #dcebfa;
  font-size: 16px;
  line-height: 1.2;
}
.reorg-banner b { font: 400 22px/1 var(--stencil); color: var(--paper-line); white-space: nowrap; }

.tooltip {
  position: fixed;
  background: rgba(16, 19, 23, 0.95);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 15px;
  max-width: 270px;
  z-index: 8;
}
.tooltip b { color: var(--amber); }

#toasts {
  position: fixed;
  left: 50%;
  bottom: 146px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 30;
}
.toast {
  background: rgba(16, 19, 23, 0.95);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 16px;
  max-width: 520px;
  text-align: center;
  transition: opacity 0.5s;
}
.toast.fade { opacity: 0; }

#notices {
  position: fixed;
  left: 50%;
  top: 64px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 31;
}
.notice {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 22px 10px 16px;
  border: 1px solid var(--dot);
  border-left-width: 6px;
  border-radius: 8px;
  background: rgba(16, 19, 23, 0.96);
  font-size: 21px;
  white-space: nowrap;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
  animation: notice-in 0.35s cubic-bezier(0.2, 1.5, 0.4, 1);
  transition: opacity 0.5s, transform 0.5s;
}
.notice .dot { width: 14px; height: 14px; }
.notice.fade { opacity: 0; transform: translateY(-10px); }
@keyframes notice-in {
  from { opacity: 0; transform: translateY(-22px) scale(0.9); }
  to { opacity: 1; transform: none; }
}

.offline {
  position: fixed;
  left: 50%; top: 58px;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  padding: 6px 16px;
  border-radius: 5px;
  z-index: 40;
}

#fanfare {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  cursor: pointer;
}

/* Popups */
.backdrop { position: fixed; inset: 0; z-index: 19; }
.popup {
  position: fixed;
  z-index: 20;
  padding: 12px 14px;
  border-radius: 8px;
  border-color: var(--amber);
}
.popup h3 { text-align: center; margin-bottom: 9px; text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--text); }
.options { display: flex; gap: 8px; }
.option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  width: 100px;
  font-size: 15px;
}
.option:hover { border-color: var(--amber); }
.option small { color: #ffb39f; font-size: 13px; line-height: 1.1; }
.option-token { width: 56px; height: 77px; border-radius: 4px; }

.menu { position: fixed; z-index: 20; border-radius: 6px; padding: 4px; min-width: 190px; }
.menu h3 { padding: 6px 14px 5px; color: var(--amber); }
.menu button {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 8px 14px;
  text-align: left;
  font-size: 17px;
}
.menu button:hover { background: var(--panel-raised); color: var(--amber); }

/* Full-screen sheets */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 10, 7, 0.55);
  z-index: 25;
  pointer-events: auto;
}
.overlay.solid { background: rgba(14, 10, 7, 0.35); }

.sheet {
  position: relative;
  border-radius: 10px;
  padding: 26px 30px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.lead { font-size: 18px; color: var(--text); margin: 8px 0 16px; }
.sheet input:not([type='checkbox']) {
  font: 500 19px var(--body);
  background: var(--panel-deep);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px 12px;
  user-select: text;
  -webkit-user-select: text;
}

.welcome { width: 430px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.welcome .lead { margin: 2px 0 6px; }
.welcome input { width: 100%; text-align: center; }
.trophy { width: 110px; margin: 0 auto; }

.lobby { width: 560px; display: flex; flex-direction: column; gap: 10px; }
.lobby-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.game-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.game-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
}
.game-row > div { flex: 1; min-width: 0; }
.game-row b { display: block; font-size: 18px; }
.game-row small { color: var(--muted); font-size: 14px; }
.new-game { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-items: end; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.new-game h3 { grid-column: 1 / -1; }
.new-game label { display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: var(--muted); }
.new-game label.check { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 12px; }
.new-game input[type='number'] { width: 100%; }
.new-game .primary { grid-column: 1 / -1; }

.seats { display: flex; flex-wrap: wrap; gap: 8px; }
.seat {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 18px;
}
.seat small { color: var(--muted); font-size: 13px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; }

.rules { width: 640px; user-select: text; -webkit-user-select: text; }
.rules h3 { margin-top: 16px; color: var(--amber); }
.rules p, .rules li { font-size: 17px; line-height: 1.35; color: var(--text); }
.rules p { margin: 5px 0; }
.rules ol, .rules ul { margin: 5px 0; padding-left: 22px; }
.rules li { margin-bottom: 3px; }
.sheet-close {
  position: absolute;
  right: 12px; top: 10px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
}
.sheet-close:hover { color: var(--text); }
