/*
  星球改造 / Planet Terra: the planet fills the stage under the site bar. Glass panels sit
  round it: the corporations on the left, your board on the right, the space station and the
  decision of the moment at the bottom, the round and prompt on top.
*/

html,
body {
  height: 100%;
}

body.tr-body {
  margin: 0;
  overflow: hidden;
  color: var(--gh-ink);
  background:
    radial-gradient(ellipse 60% 55% at 50% 44%, rgba(76, 120, 190, 0.26), transparent 70%),
    radial-gradient(ellipse at 50% 50%, #142039 0%, #0b1324 50%, #050912 100%);
  font-family: var(--gh-font-body);
  overscroll-behavior: none;
}

.tr-stage {
  --glass: rgba(9, 16, 23, 0.7);
  --glass-line: rgba(255, 255, 255, 0.1);
  --bone: var(--gh-bone, #f4f1e8);
  --muted: #9fb0c3;
  --accent: #ffbe0b;
  --side-l: 212px;
  --side-r: 312px;
  --dock-h: 232px;
  position: fixed;
  inset: 56px 0 0;
  color: var(--bone);
}

#trCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  opacity: 0;
  transition: opacity 900ms ease;
}

.tr-stage.is-ready #trCanvas {
  opacity: 1;
}

.tr-stage[data-mode="place"] #trCanvas,
.tr-stage[data-mode="patch"] #trCanvas,
.tr-stage[data-mode="stored"] #trCanvas,
.tr-stage[data-mode="deploy"] #trCanvas,
.tr-stage[data-mode="move"] #trCanvas {
  cursor: crosshair;
}

.tr-top,
.tr-acts,
.tr-players,
.tr-board,
.tr-dock,
.tr-card,
.tr-viewing,
.tr-feed li,
.tr-ringtip {
  border: 1px solid var(--glass-line);
  background: var(--glass);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
}

.tr-i {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.2em;
  flex: none;
}

/* While the menu is up only the planet shows behind it. */
.tr-stage.is-menu .tr-top,
.tr-stage.is-menu .tr-players,
.tr-stage.is-menu .tr-board,
.tr-stage.is-menu .tr-dock,
.tr-stage.is-menu .tr-feed,
.tr-stage.is-menu .tr-acts,
.tr-stage.is-menu .tr-viewing,
.tr-stage.is-menu .tr-ringtip {
  display: none;
}

/* ---------- Top: round and prompt ---------- */

.tr-top {
  position: absolute;
  top: 12px;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 2px;
  max-width: min(560px, calc(100% - var(--side-l) - var(--side-r) - 40px));
  padding: 8px 18px 9px;
  border-radius: 14px;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.tr-round {
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.8rem;
}

.tr-round b {
  color: var(--bone);
  font-family: var(--gh-font-display);
  font-size: 1.05rem;
  font-weight: 400;
}

.tr-crown {
  color: var(--accent);
}

.tr-prompt {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.4;
}

.tr-acts {
  position: absolute;
  top: 12px;
  right: calc(var(--side-r) + 24px);
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
}

.tr-acts button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.tr-acts button:hover {
  color: var(--bone);
  background: rgba(255, 255, 255, 0.08);
}

.tr-acts svg {
  width: 22px;
  height: 22px;
}

.tr-board-toggle {
  display: none !important;
}

.tr-acts .tr-mute-line {
  display: none;
}

.tr-acts button[aria-pressed="false"] {
  color: rgba(159, 176, 195, 0.55);
}

.tr-acts button[aria-pressed="false"] .tr-mute-line {
  display: inline;
}

.tr-acts button[aria-pressed="false"] .tr-wave {
  display: none;
}

.tr-stage.show-board .tr-board-toggle {
  color: var(--accent) !important;
}

/* ---------- Corporations (left) ---------- */

.tr-players {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
  width: var(--side-l);
  max-height: calc(100% - 24px);
  padding: 8px;
  overflow-y: auto;
  border-radius: 14px;
  box-sizing: border-box;
}

.tr-player {
  display: grid;
  gap: 5px;
  padding: 7px 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--who);
  border-radius: 10px;
  color: inherit;
  background: rgba(255, 255, 255, 0.03);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tr-player:hover {
  background: rgba(255, 255, 255, 0.07);
}

.tr-player.is-viewing {
  border-color: rgba(255, 255, 255, 0.24);
  border-left-color: var(--who);
  background: rgba(255, 255, 255, 0.09);
}

.tr-player-head {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.85rem;
}

.tr-player-head small {
  color: var(--muted);
  font-size: 0.7rem;
}

.tr-player-score {
  margin-left: auto;
  color: var(--who);
  font-family: var(--gh-font-display);
  font-size: 1.25rem;
  line-height: 1;
}

.tr-turn {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 190, 11, 0.6);
  animation: tr-ping 1.2s ease-out infinite;
}

@keyframes tr-ping {
  to {
    box-shadow: 0 0 0 7px rgba(255, 190, 11, 0);
  }
}

.tr-player canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
}

.tr-player-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.74rem;
}

.tr-player-stats em {
  margin-left: auto;
  font-style: normal;
}

/* ---------- Your board (right) ---------- */

.tr-board {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: var(--side-r);
  padding: 10px 12px 12px;
  overflow-y: auto;
  border-radius: 14px;
  box-sizing: border-box;
  font-size: 0.8rem;
}

.tr-board h3 {
  margin: 12px 0 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tr-track {
  padding: 5px 6px 6px;
  border-radius: 9px;
  transition: background-color 600ms ease;
}

.tr-track + .tr-track {
  margin-top: 3px;
}

.tr-track.is-flash {
  background: color-mix(in srgb, var(--res) 20%, transparent);
}

.tr-track-head {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-bottom: 3px;
}

.tr-track-head b {
  font-size: 0.82rem;
}

.tr-track-pos {
  color: var(--muted);
  font-size: 0.72rem;
}

.tr-track-medal {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  margin-left: auto;
  font-family: var(--gh-font-display);
  font-size: 0.95rem;
}

.tr-steps {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-step {
  position: relative;
  display: grid;
  place-items: center;
  height: 19px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.6rem;
  line-height: 1;
}

.tr-step.is-past {
  background: color-mix(in srgb, var(--res) 34%, transparent);
  opacity: 0.55;
}

.tr-step.is-here {
  background: var(--res);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
  color: #0b1320;
  z-index: 1;
}

.tr-step .tr-i,
.tr-step-ico {
  width: 12px;
  height: 12px;
}

.tr-step-card {
  padding: 1px 2px;
  border-radius: 2px;
  color: #0b1320;
  background: #f0a65a;
  font-weight: 800;
  font-size: 0.55rem;
}

.tr-step-move {
  color: #ffb08a;
  font-weight: 800;
}

.tr-step-move::before {
  content: "→";
  margin-right: 1px;
  font-weight: 400;
}

.tr-step-tech {
  color: #d7c2ff;
  font-weight: 800;
}

.tr-step-medal {
  position: absolute;
  right: -1px;
  bottom: -3px;
  display: grid;
  place-items: center;
  min-width: 11px;
  height: 11px;
  border-radius: 6px;
  color: #3b2a00;
  background: #ffc83d;
  font-size: 0.52rem;
  font-weight: 800;
}

.tr-step.is-here .tr-step-move,
.tr-step.is-here .tr-step-tech {
  color: #0b1320;
}

.is-boost {
  color: #ffd34d;
}

.is-deploy {
  color: #ff8b7e;
}

.tr-techs {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-techs li {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.tr-techs li b {
  color: #b9a5e8;
  font-size: 0.7rem;
}

.tr-techs li.is-on {
  color: var(--bone);
  background: rgba(176, 124, 242, 0.24);
}

.tr-techs li.is-on b {
  color: #e2d4ff;
}

.tr-inv {
  margin: 10px 0 0;
  color: var(--muted);
}

.tr-cards,
.tr-goals {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-cards li {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(240, 154, 62, 0.12);
}

.tr-cards li.is-empty,
.tr-goals li.is-empty {
  color: var(--muted);
  background: none;
}

.tr-cards em {
  margin-left: auto;
  color: #ffd34d;
  font-style: normal;
}

.tr-rank {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 16px;
  padding: 0 3px;
  border-radius: 3px;
  color: #241303;
  background: #f0a65a;
  font-size: 0.62rem;
  font-weight: 800;
}

.tr-goals li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1px 8px;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
}

.tr-goals li span {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.72rem;
}

.tr-goals li span i {
  font-style: normal;
}

.tr-goals li em {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-style: normal;
}

.tr-goals li.is-done {
  background: rgba(124, 216, 143, 0.14);
}

.tr-goals li.is-done em {
  color: #8dff7a;
}

.tr-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 10px;
  margin: 0;
}

.tr-sheet div {
  display: flex;
  justify-content: space-between;
}

.tr-sheet dt {
  color: var(--muted);
}

.tr-sheet dd {
  margin: 0;
  font-family: var(--gh-font-display);
}

.tr-sheet .is-total {
  grid-column: 1 / -1;
  padding-top: 4px;
  border-top: 1px solid var(--glass-line);
  font-size: 1rem;
}

.tr-sheet .is-total dt {
  color: var(--bone);
}

/* ---------- Dock: station and decision ---------- */

.tr-dock {
  position: absolute;
  left: calc(var(--side-l) + 24px);
  right: calc(var(--side-r) + 24px);
  bottom: 12px;
  display: flex;
  gap: 10px;
  min-height: 150px;
  max-height: var(--dock-h);
  padding: 8px 12px 8px 8px;
  border-radius: 16px;
  box-sizing: border-box;
}

.tr-station {
  flex: none;
  width: 196px;
  height: 196px;
  align-self: center;
}

.tr-station-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tr-st-plate {
  fill: rgba(255, 255, 255, 0.03);
  stroke: rgba(255, 255, 255, 0.12);
}

.tr-st-ring {
  transform: rotate(var(--ring, 0deg));
  transform-box: view-box;
  transform-origin: 50% 50%;
  transition: transform 700ms var(--gh-ease, ease);
}

.tr-st-up {
  transform: rotate(calc(var(--ring, 0deg) * -1));
  transition: transform 700ms var(--gh-ease, ease);
}

.tr-st-sector {
  fill: rgba(255, 255, 255, 0.05);
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1;
}

.tr-st-count {
  fill: var(--muted);
  font: 700 9px var(--gh-font-body);
}

.tr-st-empty {
  fill: rgba(255, 255, 255, 0.3);
  font: 14px var(--gh-font-body);
}

.tr-st-hub {
  fill: #172234;
  stroke: rgba(255, 255, 255, 0.2);
}

.tr-st-core {
  fill: #7dfcff;
  opacity: 0.8;
}

.tr-st-seat text {
  fill: #0b1320;
  font: 800 10px var(--gh-font-body);
}

.tr-st-seat.is-me circle {
  stroke: #fff;
  stroke-width: 2;
}

.tr-st-crown {
  color: var(--accent);
}

.tr-st-beam {
  opacity: 0.16;
}

.tr-panel {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  font-size: 0.86rem;
}

.tr-panel-head {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 4px 0 6px;
  font-size: 1.02rem;
  font-weight: 700;
}

.tr-panel-text {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.tr-panel-text.tr-warn,
.tr-warn {
  color: #ffb08a;
}

.tr-note:empty {
  display: none;
}

.tr-note {
  color: #ffe08a;
}

.tr-keys {
  font-size: 0.74rem;
}

.tr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.tr-btn {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: var(--bone);
  background: rgba(255, 255, 255, 0.06);
  font: 600 0.88rem var(--gh-font-body);
  cursor: pointer;
}

.tr-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.tr-btn .tr-i {
  width: 20px;
  height: 20px;
}

.tr-btn.is-primary {
  border-color: transparent;
  color: #1b1302;
  background: var(--accent);
  box-shadow: 0 8px 24px -10px rgba(255, 190, 11, 0.8);
}

.tr-btn.is-primary:hover {
  background: #ffcd3c;
}

.tr-btn.is-on {
  border-color: var(--accent);
  background: rgba(255, 190, 11, 0.16);
}

.tr-btn.is-big {
  min-height: 48px;
  padding: 8px 22px;
  font-size: 1rem;
}

.tr-offer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tr-tile-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-width: 132px;
  min-height: 116px;
  padding: 10px 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: var(--bone);
  background: rgba(255, 255, 255, 0.05);
  font: 600 0.8rem var(--gh-font-body);
  cursor: pointer;
  transition: transform 160ms var(--gh-ease, ease), border-color 160ms ease, background-color 160ms ease;
}

.tr-tile-card:hover:not([disabled]) {
  border-color: var(--accent);
  background: rgba(255, 190, 11, 0.1);
  transform: translateY(-2px);
}

.tr-tile-card[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.tr-tile-card.is-static {
  min-width: 96px;
  min-height: 80px;
  cursor: default;
}

.tr-tile-card em {
  font-style: normal;
  font-size: 0.72rem;
}

.tr-tile-card kbd {
  position: absolute;
  top: 5px;
  left: 7px;
  color: var(--muted);
  font: 600 0.65rem var(--gh-font-body);
}

.tr-hand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tr-hand span {
  color: var(--muted);
}

.tr-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tr-choice {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 1px 6px;
  align-items: center;
  min-width: 150px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--res) 50%, transparent);
  border-radius: 10px;
  color: var(--bone);
  background: color-mix(in srgb, var(--res) 12%, transparent);
  font: 600 0.85rem var(--gh-font-body);
  text-align: left;
  cursor: pointer;
}

.tr-choice:hover {
  background: color-mix(in srgb, var(--res) 26%, transparent);
}

.tr-choice span {
  color: var(--muted);
  font-size: 0.75rem;
  justify-self: end;
}

.tr-choice small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.72rem;
}

.tr-civ {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tr-civ-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-content: start;
  gap: 4px 6px;
  width: 190px;
  flex: none;
  padding: 9px 10px;
  border: 1px solid rgba(240, 166, 90, 0.4);
  border-radius: 11px;
  color: var(--bone);
  background: linear-gradient(160deg, rgba(240, 166, 90, 0.16), rgba(240, 166, 90, 0.04));
  font: 600 0.82rem var(--gh-font-body);
  text-align: left;
  cursor: pointer;
}

.tr-civ-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tr-civ-card small {
  color: var(--muted);
  font-size: 0.68rem;
}

.tr-civ-card.is-end small {
  color: #8dd3ff;
}

.tr-civ-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: #d8dee8;
  font-weight: 500;
  font-size: 0.76rem;
  line-height: 1.4;
}

.tr-civ-card em {
  grid-column: 1 / -1;
  color: #ffd34d;
  font-style: normal;
  font-size: 0.72rem;
}

/* ---------- Feed, ring tip, viewing banner ---------- */

.tr-feed {
  position: absolute;
  left: calc(var(--side-l) + 24px);
  bottom: calc(var(--dock-h) + 24px);
  display: grid;
  gap: 5px;
  width: min(380px, calc(100% - var(--side-l) - var(--side-r) - 48px));
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.tr-feed li {
  padding: 6px 11px;
  border-left: 3px solid var(--muted);
  border-radius: 9px;
  font-size: 0.8rem;
  line-height: 1.35;
  animation: tr-in 260ms var(--gh-ease, ease) both;
  transition: opacity 900ms ease;
}

.tr-feed li svg {
  vertical-align: middle;
}

.tr-feed li.is-old {
  opacity: 0.42;
}

.tr-feed-good {
  border-left-color: #8dff7a !important;
}

.tr-feed-warn {
  border-left-color: #ff8a5c !important;
}

.tr-feed-rival {
  border-left-color: var(--who, #ff6b57) !important;
}

.tr-feed-round {
  border-left-color: var(--accent) !important;
}

@keyframes tr-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.tr-ringtip {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  gap: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  pointer-events: none;
  white-space: nowrap;
}

.tr-viewing[hidden],
.tr-ringtip[hidden] {
  display: none;
}

.tr-viewing {
  position: absolute;
  top: 84px;
  left: 50%;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 8px 6px 14px;
  border-left: 3px solid var(--who);
  border-radius: 12px;
  font-size: 0.86rem;
  transform: translateX(-50%);
}

/* ---------- Cards: menu, rules, result ---------- */

.tr-card {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 20;
  width: min(620px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 26px 28px 24px;
  overflow-y: auto;
  border-radius: 20px;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}

.tr-card[hidden] {
  display: none;
}

.tr-card h1,
.tr-card h2 {
  margin: 0 0 10px;
  font-family: var(--gh-font-display);
  font-weight: 400;
}

.tr-menu h1 {
  font-size: 3rem;
  line-height: 1;
  background: linear-gradient(90deg, #8dd3ff, #8dff7a 45%, #ffd34d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tr-lede {
  margin: 0 0 16px;
  color: #d8dee8;
  line-height: 1.6;
}

.tr-howto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.tr-howto li {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.tr-howto b {
  color: var(--accent);
  font-family: var(--gh-font-display);
  font-weight: 400;
  font-size: 1.1rem;
}

.tr-howto span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.tr-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.tr-opts[hidden] {
  display: none;
}

.tr-opts-label {
  min-width: 64px;
  color: var(--muted);
  font-size: 0.82rem;
}

.tr-opts button {
  display: grid;
  justify-items: center;
  min-width: 74px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  color: var(--bone);
  background: rgba(255, 255, 255, 0.04);
  font: 600 0.9rem var(--gh-font-body);
  cursor: pointer;
}

.tr-opts button small {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.68rem;
}

.tr-opts button[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(255, 190, 11, 0.14);
}

.tr-go {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tr-go [hidden] {
  display: none;
}

.tr-btn-stack {
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}

.tr-btn-stack small {
  font-weight: 500;
  font-size: 0.7rem;
  opacity: 0.75;
}

.tr-volume {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.tr-volume label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tr-volume input {
  width: 120px;
  accent-color: var(--accent);
}

/* ---------- Tutorial: a spotlight and a bubble ---------- */

.tr-tour-spot {
  position: absolute;
  z-index: 18;
  border: 2px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 0 0 200vmax rgba(4, 8, 14, 0.42), 0 0 24px rgba(255, 190, 11, 0.55);
  pointer-events: none;
  transition: left 160ms ease, top 160ms ease, width 160ms ease, height 160ms ease;
}

.tr-tour-spot[hidden] {
  display: none;
}

.tr-tour-bubble {
  position: absolute;
  z-index: 19;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100% - 24px));
  padding: 14px 16px 12px;
  border: 1px solid rgba(255, 190, 11, 0.45);
  border-radius: 14px;
  background: rgba(9, 16, 23, 0.95);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.9);
  color: var(--bone);
}

.tr-tour-count {
  margin: 0;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
}

.tr-tour-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
}

.tr-tour-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tr-tour-actions button {
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.tr-tour-actions .tr-tour-next {
  border-color: transparent;
  background: var(--accent);
  color: #1a1204;
  font-weight: 700;
}

.tr-tour-wait {
  color: var(--muted);
  font-size: 0.78rem;
}

.tr-tour-actions .tr-tour-quit {
  margin-left: auto;
  color: var(--muted);
}

.tr-stage.is-menu .tr-tour-spot,
.tr-stage.is-menu .tr-tour-bubble,
.tr-stage.is-over .tr-tour-spot,
.tr-stage.is-over .tr-tour-bubble {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .tr-tour-spot {
    transition: none;
  }
}

.tr-help {
  width: min(860px, calc(100% - 32px));
  font-size: 0.86rem;
}

.tr-help-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.tr-help h3 {
  margin: 10px 0 6px;
  color: var(--accent);
  font-size: 0.9rem;
}

.tr-help ol {
  margin: 0;
  padding-left: 1.2em;
  color: #d8dee8;
  line-height: 1.55;
}

.tr-help li + li {
  margin-top: 5px;
}

.tr-help p {
  margin: 0;
  color: #d8dee8;
  line-height: 1.55;
}

.tr-help-tracks {
  display: grid;
  gap: 5px;
  margin: 0;
}

.tr-help-tracks div {
  display: grid;
  grid-template-columns: 44px 1fr;
}

.tr-help-tracks dt {
  font-weight: 700;
}

.tr-help-tracks dd {
  margin: 0;
  color: #d8dee8;
}

.tr-help-keys {
  color: var(--muted) !important;
  font-size: 0.8rem;
}

.tr-result {
  width: min(720px, calc(100% - 32px));
  text-align: center;
}

.tr-result h2 {
  font-size: 2.2rem;
}

.tr-kicker {
  margin: 0 0 4px;
  color: var(--muted);
}

.tr-score-table {
  width: 100%;
  margin: 8px 0 4px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.tr-score-table th,
.tr-score-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tr-score-table thead th,
.tr-score-table tr:first-child th {
  color: var(--who, var(--bone));
}

.tr-score-table tr th:first-child {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
}

.tr-score-table td {
  text-align: center;
  font-family: var(--gh-font-display);
}

.tr-score-table small {
  color: var(--muted);
}

.tr-score-table .is-total td,
.tr-score-table .is-total th {
  color: var(--bone);
  font-size: 1.1rem;
  border-bottom: 0;
}

.tr-result .tr-row {
  justify-content: center;
  margin-top: 16px;
}

/* After the game: browse planets with the result card closed. */
.tr-stage.is-browsing .tr-dock {
  display: flex;
}

.tr-fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 8px;
  width: min(440px, calc(100% - 32px));
  padding: 20px;
  border-radius: 16px;
  background: var(--glass);
  transform: translate(-50%, -50%);
  text-align: center;
}

.tr-fallback[hidden] {
  display: none;
}

/* ---------- Narrower screens ---------- */

@media (max-width: 1180px) {
  .tr-stage {
    --side-l: 180px;
    --side-r: 270px;
  }
}

@media (max-width: 900px) {
  .tr-stage {
    --side-l: 0px;
    --side-r: 0px;
    --dock-h: 46%;
  }

  .tr-players {
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    width: auto;
    max-height: none;
    padding: 6px;
    overflow-x: auto;
  }

  .tr-player {
    flex: 0 0 auto;
    grid-template-columns: auto auto;
    width: auto;
    padding: 5px 7px;
  }

  .tr-player canvas {
    width: 76px;
    grid-row: 1 / 3;
  }

  .tr-player-head {
    gap: 4px;
  }

  .tr-player-stats {
    font-size: 0.66rem;
  }

  .tr-top {
    top: 96px;
    max-width: calc(100% - 24px);
    padding: 5px 12px;
  }

  .tr-prompt {
    font-size: 0.8rem;
  }

  .tr-acts {
    top: auto;
    right: 8px;
    bottom: calc(var(--dock-h) + 16px);
    z-index: 16;
  }

  .tr-board-toggle {
    display: grid !important;
  }

  .tr-board {
    display: none;
  }

  .tr-stage.show-board .tr-board {
    display: block;
    top: 96px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 15;
    width: auto;
  }

  .tr-dock {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-height: 46%;
    padding: 6px;
  }

  .tr-station {
    width: 120px;
    height: 120px;
  }

  .tr-feed {
    left: 8px;
    bottom: calc(var(--dock-h) + 16px);
    width: calc(100% - 70px);
  }

  .tr-feed li:nth-child(n + 3) {
    display: none;
  }

  .tr-howto {
    grid-template-columns: 1fr;
  }

  .tr-help-cols {
    grid-template-columns: 1fr;
  }

  .tr-tile-card {
    min-width: 104px;
    min-height: 92px;
  }

  .tr-menu h1 {
    font-size: 2.3rem;
  }
}
