/* ==========================================================================
   neon-dominion.mobile.css -- NEON DOMINION's TOUCH LAYOUT (TASK-1707[Q]).

   Drawn only while the mount carries .nd-touch, which neon-dominion.mobile.js
   sets on a phone viewport (or when a tablet asks for it).  Nothing here
   matches the desk layout: every rule is under .nd-touch or under .ndm, and
   .ndm is display:none until .nd-touch shows it.

   The house rules this sheet is held to (CLAUDE.md "UI readability" and the
   suite server/neon_dominion_mobile.test.js measures them in a real browser):
   every tap target 44px or more, readable text 12px or more at 4.5:1 or
   better, fixed-size panels whose bodies scroll, no state change that moves
   layout, safe-area insets on the outer edge, and nothing hover-only.

   PORTRAIT (the base): status bar with its verbs, the three tracks, one chip
   per operator, the city, and a tab bar; a tab opens a fixed-height sheet
   over the lower city.  LANDSCAPE (a container query on the mount, so a
   framed page and a bare one decide the same way): the city column on the
   left, and status, sheet and tabs stacked on the right with the sheet
   always open.
   ========================================================================== */
.neon-dominion-game .ndm { display: none; }
.neon-dominion-game.nd-touch:not(.is-title) .app { display: none; }
.neon-dominion-game.nd-touch:not(.is-title) .ndm { display: grid; }
.neon-dominion-game.nd-touch .ndm.ndm-idle > * { visibility: hidden; }

.neon-dominion-game .ndm {
  position: absolute;
  inset: 0;
  z-index: 5;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  grid-template-areas: "status" "tracks" "players" "body" "tabs";
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
  background: #07090e;
  color: #e8f2ff;
  font: 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}
.neon-dominion-game .ndm button {
  font: inherit;
  color: #e8f2ff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.neon-dominion-game .ndm button:disabled { cursor: default; }
.neon-dominion-game .ndm button:focus-visible { outline: 2px solid #ffffff; outline-offset: -2px; }

/* ---- the status bar (BGA's page title): whose move, then the verbs ------- */
.neon-dominion-game .ndm-status {
  grid-area: status;
  min-width: 0;
  padding: 6px calc(8px + var(--met-inset-tr, 0px)) 6px 8px;
  background: #0b111b;
  border-bottom: 1px solid #31425a;
  box-shadow: inset 0 3px 0 #31425a;
}
.neon-dominion-game .ndm-status.ndm-yours { box-shadow: inset 0 3px 0 #46e0ff; }
.neon-dominion-game .ndm-status.ndm-wait { box-shadow: inset 0 3px 0 #ffbf47; }
.neon-dominion-game .ndm-status.ndm-over { box-shadow: inset 0 3px 0 #b6ff5a; }
.neon-dominion-game .ndm-status.ndm-ping { animation: ndm-ping .55s ease-in-out 3; }
@keyframes ndm-ping { 50% { background: #123447; } }
.neon-dominion-game .ndm-srow { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.neon-dominion-game .ndm-menu {
  flex: 0 0 auto;
  min-width: 60px;
  min-height: 44px;
  border: 1px solid #3a4d68;
  border-radius: 4px;
  background: #111a26;
  font: 800 12px/1 system-ui, sans-serif;
  letter-spacing: .08em;
}
.neon-dominion-game .ndm-stext { flex: 1 1 auto; min-width: 0; }
.neon-dominion-game .ndm-stitle {
  display: block;
  font: 800 15px/1.2 system-ui, sans-serif;
  letter-spacing: .05em;
  color: #e8f2ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.neon-dominion-game .ndm-yours .ndm-stitle { color: #46e0ff; }
.neon-dominion-game .ndm-wait .ndm-stitle { color: #ffbf47; }
.neon-dominion-game .ndm-over .ndm-stitle { color: #b6ff5a; }
.neon-dominion-game .ndm-ssub {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  color: #b9c9da;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The verb row keeps its height whether it holds a hint, two verbs or four,
   so selecting something never moves the board under the finger. */
.neon-dominion-game .ndm-verbs { display: flex; gap: 6px; height: 52px; margin-top: 6px; align-items: stretch; }
.neon-dominion-game .ndm-hint {
  flex: 1 1 0;
  min-width: 0;
  align-self: center;
  font-size: 13px;
  line-height: 1.3;
  color: #b9c9da;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.neon-dominion-game .ndm-verb {
  flex: 1 1 0;
  min-width: 60px;
  min-height: 44px;
  padding: 3px 4px;
  border: 1px solid #3a4d68;
  border-radius: 4px;
  background: #111a26;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font: 800 12px/1.15 system-ui, sans-serif;
  letter-spacing: .03em;
  text-align: center;
  overflow: hidden;
}
.neon-dominion-game .ndm-verb b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neon-dominion-game .ndm-verb small { max-width: 100%; font: 600 12px/1.15 ui-monospace, Consolas, monospace; color: #c9d6e3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neon-dominion-game .ndm-verb.ndm-go { border-color: #46e0ff; background: #0f2a36; }
.neon-dominion-game .ndm-verb.ndm-danger { border-color: #ff5f6d; background: #2a1016; }
.neon-dominion-game .ndm-verb.ndm-x { flex: 0 0 76px; }
.neon-dominion-game .ndm-verb:disabled { border-color: #2a3646; background: #0c121a; color: #95a6ba; }
.neon-dominion-game .ndm-verb:disabled small { color: #95a6ba; }

/* ---- the strips -------------------------------------------------------- */
.neon-dominion-game .ndm-tracks {
  grid-area: tracks;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  padding: 6px 8px;
  background: #080d14;
  border-bottom: 1px solid #22303f;
}
.neon-dominion-game .ndm-track {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 4px;
  font: 700 12px/1.2 ui-monospace, Consolas, monospace;
}
.neon-dominion-game .ndm-track span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neon-dominion-game .ndm-track b { color: #e8f2ff; }
.neon-dominion-game .ndm-t-grid { color: #ffe45e; }
.neon-dominion-game .ndm-t-air { color: #a8ff78; }
.neon-dominion-game .ndm-t-net { color: #55d6ff; }
.neon-dominion-game .ndm-bar { grid-column: 1 / -1; display: block; height: 5px; margin-top: 3px; background: #1b2635; }
.neon-dominion-game .ndm-bar i { display: block; height: 100%; background: currentColor; }
.neon-dominion-game .ndm-gen { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; font: 700 12px/1.2 ui-monospace, Consolas, monospace; color: #d8e5f2; }
.neon-dominion-game .ndm-gen span { color: #b9c9da; }
.neon-dominion-game .ndm-players {
  grid-area: players;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 6px 8px;
  background: #07090e;
  border-bottom: 1px solid #22303f;
}
.neon-dominion-game .ndm-pchip {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 6px;
  align-items: center;
  padding: 4px 6px;
  text-align: left;
  border: 1px solid #2d3c51;
  border-radius: 4px;
  background: #0d1420;
}
.neon-dominion-game .ndm-pchip.ndm-active { border-color: #46e0ff; box-shadow: inset 0 3px 0 #46e0ff; }
.neon-dominion-game .ndm-pchip.ndm-on { background: #13263a; }
.neon-dominion-game .ndm-pchip.ndm-exposed .ndm-ps { color: #ff8a95; }
.neon-dominion-game .ndm-sig {
  grid-row: 1 / span 2;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  font: 900 14px/1 ui-monospace, Consolas, monospace;
}
.neon-dominion-game .ndm-pn { min-width: 0; font: 700 12px/1.25 system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.neon-dominion-game .ndm-ps { min-width: 0; font: 600 12px/1.25 ui-monospace, Consolas, monospace; color: #c9d6e3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.neon-dominion-game .ndm-me .ndm-pn { color: #46e0ff; }

/* ---- the city: its own space, panned and pinched, never scrolled ------- */
.neon-dominion-game .ndm-body { grid-area: body; position: relative; min-height: 0; min-width: 0; overflow: hidden; }
.neon-dominion-game .ndm-city {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  background: radial-gradient(circle at 50% 45%, rgba(20, 42, 62, .55), #08101a 70%);
}
.neon-dominion-game .ndm-stage { position: absolute; left: 0; top: 0; width: 437px; height: 371px; transform-origin: 0 0; will-change: transform; }
.neon-dominion-game .ndm-hex {
  position: absolute;
  width: 46px;
  height: 53px;
  padding: 0;
  border: 0;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: #31455f;
}
.neon-dominion-game .ndm-hf {
  position: absolute;
  inset: 2px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: #0b1018;
  color: #b9c9da;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
}
.neon-dominion-game .ndm-hs { font: 800 16px/1 ui-monospace, Consolas, monospace; }
.neon-dominion-game .ndm-hn { font: 600 12px/1 ui-monospace, Consolas, monospace; color: #a9bccf; }
.neon-dominion-game .ndm-ind { background: #ffbf47; }
.neon-dominion-game .ndm-ind .ndm-hf { background: #15140d; color: #ffbf47; }
.neon-dominion-game .ndm-pub { background: #b6ff5a; }
.neon-dominion-game .ndm-pub .ndm-hf { background: #0e1810; color: #b6ff5a; }
.neon-dominion-game .ndm-own { background: var(--own, #46e0ff); }
.neon-dominion-game .ndm-own .ndm-hf { background: #0a1018; color: var(--own, #46e0ff); }
.neon-dominion-game .ndm-own .ndm-hs { font-size: 20px; font-weight: 900; }
.neon-dominion-game .ndm-legal { background: #46e0ff; animation: ndm-legal 1.4s ease-in-out infinite; }
.neon-dominion-game .ndm-legal .ndm-hf { background: #0b1d29; color: #d8fbff; }
.neon-dominion-game .ndm-sel { background: #ffffff; animation: none; }
.neon-dominion-game .ndm-sel .ndm-hf { background: #1d4058; color: #ffffff; }
@keyframes ndm-legal { 50% { background: #1f6f86; } }
.neon-dominion-game .ndm-hud { position: absolute; right: 8px; bottom: 8px; z-index: 3; display: flex; gap: 6px; }
.neon-dominion-game .ndm-hud button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid #3a4d68;
  border-radius: 4px;
  background: #0b111b;
  font: 800 15px/1 system-ui, sans-serif;
}

/* ---- the sheet: fixed height, its body scrolls -------------------------- */
.neon-dominion-game .ndm-sheet {
  grid-area: body;
  align-self: end;
  z-index: 4;
  height: 60%;
  min-height: 0;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  background: #0b1018;
  border-top: 2px solid #46e0ff;
  box-shadow: 0 -14px 30px rgba(0, 0, 0, .55);
}
.neon-dominion-game .ndm.ndm-open .ndm-sheet { display: grid; }
.neon-dominion-game .ndm-shead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 2px 8px 2px 12px;
  border-bottom: 1px solid #22303f;
}
.neon-dominion-game .ndm-sname { min-width: 0; font: 800 13px/1.2 system-ui, sans-serif; letter-spacing: .1em; color: #d8e5f2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.neon-dominion-game .ndm-close { min-width: 72px; min-height: 44px; border: 1px solid #3a4d68; border-radius: 4px; background: #111a26; font: 800 12px/1 system-ui, sans-serif; letter-spacing: .08em; }
.neon-dominion-game .ndm-sbody { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 10px 12px; -webkit-overflow-scrolling: touch; }
.neon-dominion-game .ndm-note { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: #c4d2df; }
.neon-dominion-game .ndm-empty { margin: 14px 0; font-size: 14px; color: #c4d2df; text-align: center; }
.neon-dominion-game .ndm-sub2 { display: block; margin: 12px 0 8px; font: 800 12px/1 system-ui, sans-serif; letter-spacing: .12em; color: #b9c9da; }

/* ---- the tab bar ---------------------------------------------------------- */
.neon-dominion-game .ndm-tabs {
  grid-area: tabs;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #0b111b;
  border-top: 1px solid #31425a;
}
.neon-dominion-game .ndm-tab {
  min-width: 0;
  min-height: 52px;
  padding: 2px;
  border: 0;
  border-top: 3px solid transparent;
  background: transparent;
  color: #c9d6e3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font: 800 12px/1.15 system-ui, sans-serif;
  letter-spacing: 0;
}
.neon-dominion-game .ndm-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neon-dominion-game .ndm-tab small { font: 700 12px/1 ui-monospace, Consolas, monospace; color: #e8f2ff; white-space: nowrap; }
.neon-dominion-game .ndm-tab.ndm-on { color: #46e0ff; border-top-color: #46e0ff; background: #0f1d2a; }

/* ---- cards: every word a player needs, readable without a magnifier ----- */
.neon-dominion-game .ndm-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.neon-dominion-game .ndm-seg button { min-height: 44px; border: 1px solid #3a4d68; border-radius: 4px; background: #0e1622; font: 800 12px/1 system-ui, sans-serif; letter-spacing: .08em; }
.neon-dominion-game .ndm-seg button.ndm-on { border-color: #46e0ff; background: #102534; color: #46e0ff; }
.neon-dominion-game .ndm-card {
  --tagc: #46e0ff;
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 9px 10px 9px 12px;
  text-align: left;
  border: 1px solid #2d3c51;
  border-left: 4px solid var(--tagc);
  border-radius: 4px;
  background: #0e1622;
  color: #e8f2ff;
}
.neon-dominion-game .ndm-card.ndm-on { border-color: #46e0ff; border-left-color: var(--tagc); background: #102534; }
.neon-dominion-game .ndm-card.tag-industrial { --tagc: #ff9f43; }
.neon-dominion-game .ndm-card.tag-data { --tagc: #55d6ff; }
.neon-dominion-game .ndm-card.tag-bio { --tagc: #a8ff78; }
.neon-dominion-game .ndm-card.tag-energy { --tagc: #ffe45e; }
.neon-dominion-game .ndm-card.tag-civic { --tagc: #bba6ff; }
.neon-dominion-game .ndm-card.tag-logistics { --tagc: #71f6c4; }
.neon-dominion-game .ndm-card.tag-public { --tagc: #91ffcf; }
.neon-dominion-game .ndm-card.tag-commerce { --tagc: #ffcf67; }
.neon-dominion-game .ndm-card.tag-covert { --tagc: #ff6a9e; }
.neon-dominion-game .ndm-ch { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.neon-dominion-game .ndm-cn { min-width: 0; font: 800 15px/1.25 system-ui, sans-serif; }
.neon-dominion-game .ndm-cc { flex: 0 0 auto; font: 800 14px/1.2 ui-monospace, Consolas, monospace; color: #ffcf67; }
.neon-dominion-game .ndm-short .ndm-cc { color: #ff8a95; }
.neon-dominion-game .ndm-ct { display: block; margin-top: 3px; font: 600 12px/1.3 ui-monospace, Consolas, monospace; color: #b9c9da; }
.neon-dominion-game .ndm-cx { display: block; margin-top: 4px; font-size: 13px; line-height: 1.4; color: #dbe6f0; }
.neon-dominion-game .ndm-cf { display: block; margin-top: 7px; font: italic 13px/1.4 Georgia, serif; color: #c4d2df; }
.neon-dominion-game .ndm-cn2 { display: block; margin-top: 6px; font: 600 12px/1.35 ui-monospace, Consolas, monospace; color: #d8e5f2; }

/* ---- actions, the advisor, rivals, contracts, the log, a board, the menu - */
.neon-dominion-game .ndm-advice { margin: 0 0 10px; padding: 10px; border: 1px solid #30425b; background: #0d1826; font-size: 13px; line-height: 1.45; color: #dbe6f0; }
.neon-dominion-game .ndm-advice strong { color: #ffffff; }
.neon-dominion-game .ndm-at { display: block; margin-bottom: 4px; font: 800 12px/1.3 system-ui, sans-serif; letter-spacing: .08em; color: #46e0ff; }
.neon-dominion-game .ndm-wide { display: block; width: 100%; min-height: 44px; margin-top: 8px; border: 1px solid #46e0ff; border-radius: 4px; background: #0f2a36; font: 800 13px/1 system-ui, sans-serif; letter-spacing: .06em; }
.neon-dominion-game .ndm-wide:disabled { border-color: #2a3646; background: #0c121a; color: #95a6ba; }
.neon-dominion-game .ndm-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.neon-dominion-game .ndm-act {
  min-width: 0;
  min-height: 60px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  text-align: left;
  border: 1px solid #2d3c51;
  border-radius: 4px;
  background: #0e1622;
}
.neon-dominion-game .ndm-act .ndm-ag { grid-row: 1 / span 2; font: 800 20px/1 ui-monospace, Consolas, monospace; color: #46e0ff; }
.neon-dominion-game .ndm-act b { font: 800 14px/1.2 system-ui, sans-serif; letter-spacing: .05em; }
.neon-dominion-game .ndm-act small { font: 600 12px/1.25 ui-monospace, Consolas, monospace; color: #b9c9da; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neon-dominion-game .ndm-act.ndm-on { border-color: #46e0ff; background: #102534; }
.neon-dominion-game .ndm-act:disabled, .neon-dominion-game .ndm-act.ndm-short { background: #0b1119; }
.neon-dominion-game .ndm-act:disabled b, .neon-dominion-game .ndm-act:disabled small,
.neon-dominion-game .ndm-act:disabled .ndm-ag, .neon-dominion-game .ndm-act.ndm-short small { color: #95a6ba; }
.neon-dominion-game .ndm-act-pass { grid-column: 1 / -1; }
.neon-dominion-game .ndm-act-pass.ndm-on { border-color: #ff5f6d; background: #24111a; }
.neon-dominion-game .ndm-rival {
  width: 100%;
  min-height: 52px;
  margin: 0 0 8px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  text-align: left;
  border: 1px solid #2d3c51;
  border-radius: 4px;
  background: #0e1622;
}
.neon-dominion-game .ndm-rival b { display: block; font: 800 14px/1.2 system-ui, sans-serif; }
.neon-dominion-game .ndm-rival small { display: block; font: 600 12px/1.3 ui-monospace, Consolas, monospace; color: #c4d2df; }
.neon-dominion-game .ndm-rival.ndm-on { border-color: #ff4fd8; background: #23122a; }
.neon-dominion-game .ndm-deal {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 9px 10px;
  text-align: left;
  border: 1px solid #2d3c51;
  border-radius: 4px;
  background: #0e1622;
  color: #e8f2ff;
}
.neon-dominion-game .ndm-deal b { display: block; font: 800 14px/1.25 system-ui, sans-serif; letter-spacing: .05em; }
.neon-dominion-game .ndm-dd { display: block; margin-top: 3px; font-size: 13px; line-height: 1.4; color: #dbe6f0; }
.neon-dominion-game .ndm-dl { display: block; margin-top: 4px; font: italic 12px/1.4 Georgia, serif; color: #b9c9da; }
.neon-dominion-game .ndm-ds { display: block; margin-top: 6px; font: 700 12px/1.3 ui-monospace, Consolas, monospace; color: #c9d6e3; }
.neon-dominion-game .ndm-deal.ndm-ready { border-color: #b6ff5a; }
.neon-dominion-game .ndm-deal.ndm-ready .ndm-ds { color: #b6ff5a; }
.neon-dominion-game .ndm-deal.ndm-on { border-color: #46e0ff; background: #102534; }
.neon-dominion-game .ndm-deal.ndm-claimed { background: #0a0f16; }
.neon-dominion-game .ndm-clock { display: grid; gap: 4px; margin: 0 0 10px; padding: 9px 10px; border: 1px solid #2b3b52; background: #0a1019; font-size: 13px; line-height: 1.4; color: #dbe6f0; }
.neon-dominion-game .ndm-clock b { font: 800 13px/1.2 ui-monospace, Consolas, monospace; color: #46e0ff; }
.neon-dominion-game .ndm-log { list-style: none; margin: 0; padding: 0; font: 12px/1.5 ui-monospace, Consolas, monospace; color: #c4d2df; }
.neon-dominion-game .ndm-log li { padding: 6px 0; border-bottom: 1px solid #1c2735; }
.neon-dominion-game .ndm-log li:first-child { color: #ffffff; }
.neon-dominion-game .ndm-pk { display: block; font: 800 15px/1.25 system-ui, sans-serif; color: #e8f2ff; }
.neon-dominion-game .ndm-flags { display: block; margin: 4px 0 8px; font: 800 12px/1.2 ui-monospace, Consolas, monospace; color: #ffbf47; }
.neon-dominion-game .ndm-motto { margin: 0 0 10px; font: italic 13px/1.4 Georgia, serif; color: #c4d2df; }
.neon-dominion-game .ndm-res { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 10px; }
.neon-dominion-game .ndm-res div { min-width: 0; padding: 6px 7px; border: 1px solid #243249; background: #0e1622; font: 600 12px/1.25 ui-monospace, Consolas, monospace; color: #c4d2df; }
.neon-dominion-game .ndm-res span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neon-dominion-game .ndm-res b { display: block; font: 800 17px/1.2 ui-monospace, Consolas, monospace; color: #e8f2ff; }
.neon-dominion-game .ndm-res small { display: block; font-size: 12px; color: #b9c9da; }
.neon-dominion-game .ndm-mrow {
  display: block;
  width: 100%;
  min-height: 52px;
  margin: 0 0 8px;
  padding: 9px 12px;
  text-align: left;
  border: 1px solid #2d3c51;
  border-radius: 4px;
  background: #0e1622;
}
.neon-dominion-game .ndm-mrow b { display: block; font: 800 14px/1.2 system-ui, sans-serif; letter-spacing: .06em; }
.neon-dominion-game .ndm-mrow small { display: block; margin-top: 2px; font-size: 12px; color: #b9c9da; }

/* ---- the desk file's overlays, sized for a finger ----------------------- */
.neon-dominion-game.nd-touch .modal { padding: max(8px, env(safe-area-inset-top, 0px)) 8px max(8px, env(safe-area-inset-bottom, 0px)); }
.neon-dominion-game.nd-touch .dialog { width: 100%; max-width: 640px; max-height: 100%; padding: 14px; font-size: 14px; }
.neon-dominion-game.nd-touch .dialog h2 { font-size: 18px; padding-right: max(0px, calc(var(--met-inset-tr, 0px) - 12px)); }
/* The desk overlays inherit the page's type on a bare page, which is a serif
   there; on a phone they read in the touch layout's own face. */
.neon-dominion-game.nd-touch .dialog,
.neon-dominion-game.nd-touch .shield,
.neon-dominion-game.nd-touch .btn,
.neon-dominion-game.nd-touch .dialog h2,
.neon-dominion-game.nd-touch .shield h1 { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.neon-dominion-game.nd-touch .dialog .row { flex-direction: column; align-items: stretch; }
.neon-dominion-game.nd-touch .dialog .row label { min-height: 44px; display: flex; align-items: center; gap: 10px; font-size: 14px !important; color: #dbe6f0; }
.neon-dominion-game.nd-touch .dialog input[type="checkbox"] { width: 22px; height: 22px; flex: 0 0 auto; }
.neon-dominion-game.nd-touch .dialog select,
.neon-dominion-game.nd-touch .dialog input:not([type="checkbox"]) { min-height: 44px; font-size: 16px; }
.neon-dominion-game.nd-touch .setupgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.neon-dominion-game.nd-touch .setupgrid label { grid-column: 1 / -1; margin-top: 4px; font-size: 13px; color: #c4d2df; }
.neon-dominion-game.nd-touch .setupgrid input,
.neon-dominion-game.nd-touch .setupgrid select { min-width: 0; width: 100%; }
.neon-dominion-game.nd-touch .btn { min-height: 48px; padding: 10px 14px; font-size: 14px; }
.neon-dominion-game.nd-touch .dialogfooter .btn { flex: 1 1 140px; }
.neon-dominion-game.nd-touch .finalgrid { grid-template-columns: minmax(0, 1fr); }
.neon-dominion-game.nd-touch .carddialog { grid-template-columns: minmax(0, 1fr); }
.neon-dominion-game.nd-touch .shield { width: min(520px, calc(100% - 24px)); padding: 20px 16px; }
.neon-dominion-game.nd-touch .shield h1 { font-size: 20px; overflow-wrap: anywhere; }
.neon-dominion-game.nd-touch .shield p { font-size: 14px; color: #c4d2df; }
.neon-dominion-game.nd-touch .toast { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 24px); font-size: 13px; text-align: center; }
/* The desk's hover tooltips: a tap fires pointerover too, so a press on START
   would raise a stray card of help text.  The touch panels print every cost
   and effect a decision needs, and the full rules are one press away under
   MENU, so on touch the tooltips stay down. */
.neon-dominion-game.nd-touch .game-tooltip { display: none; }
/* The title on a phone: the ticker sits above the host's copyright plate and
   clear of its studio mark (both are the bare page's own corner layer, named
   by the --met-inset-* variables; on a framed page they are 0). */
.neon-dominion-game.nd-touch .title-ticker {
  left: 18px;
  right: max(18px, var(--met-inset-br, 0px));
  bottom: calc(14px + var(--met-inset-bl-h, 0px));
  white-space: normal;
  text-align: left;
}

/* ---- landscape: the city keeps the left, the panel stays open right ----- */
@container neon-dominion-root (orientation: landscape) {
  .neon-dominion-game .ndm {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 47%);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "tracks status" "players status" "body sheet" "body tabs";
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }
  .neon-dominion-game .ndm-status { border-left: 1px solid #31425a; }
  .neon-dominion-game .ndm-players { border-bottom: 0; }
  .neon-dominion-game .ndm-sheet,
  .neon-dominion-game .ndm.ndm-open .ndm-sheet {
    grid-area: sheet;
    align-self: stretch;
    height: auto;
    display: grid;
    border-top: 0;
    border-left: 1px solid #31425a;
    box-shadow: none;
  }
  .neon-dominion-game .ndm-shead { min-height: 36px; }
  .neon-dominion-game .ndm-close { display: none; }
  .neon-dominion-game .ndm-tabs { border-left: 1px solid #31425a; padding-bottom: 0; }
  .neon-dominion-game .ndm-tab { min-height: 46px; letter-spacing: 0; }
  .neon-dominion-game .ndm-tab.ndm-shown { color: #46e0ff; border-top-color: #46e0ff; background: #0f1d2a; }
}

/* A phone on its side: the desk title pads its left by the host's whole
   copyright plate and its bottom by the studio mark, which leaves a 290 by
   190 box for a lockup twice that tall.  Here the lockup sizes by height and
   only the corners the host really occupies are kept clear. */
@container neon-dominion-root (orientation: landscape) and (max-height: 520px) {
  .neon-dominion-game.nd-touch .title-screen {
    padding: 10px max(16px, var(--met-inset-tr, 0px)) calc(14px + var(--met-inset-bl-h, 0px)) 16px;
    place-items: start center;
  }
  .neon-dominion-game.nd-touch .title-lockup { width: 100%; }
  .neon-dominion-game.nd-touch .title-kicker { margin-bottom: 6px; font-size: 12px; letter-spacing: .14em; }
  .neon-dominion-game.nd-touch .title-logo span { font-size: min(9cqh, 40px); }
  .neon-dominion-game.nd-touch .title-logo strong { font-size: min(18cqh, 80px); }
  .neon-dominion-game.nd-touch .title-tagline { margin-top: 10px; font-size: 13px; letter-spacing: .1em; }
  .neon-dominion-game.nd-touch .title-prompt { margin-top: 12px; padding: 9px 14px; font-size: 13px; }
  .neon-dominion-game.nd-touch .title-how { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .neon-dominion-game .ndm-legal, .neon-dominion-game .ndm-status.ndm-ping { animation: none; }
}
