:root {
  --ink: #211d18;
  --paper: #fffdf5;
  --yellow: #ffdb40;
  --blue: #318ee3;
  --line: #dfddd2;
  --muted: #716d64;
  --pink: #f4b5c8;
  --green: #a5d6b7;
  font-family:
    Inter, "Avenir Next", Avenir, "Apple SD Gothic Neo", "Noto Sans KR",
    system-ui, sans-serif;
  color: var(--ink);
  background: #f4f3eb;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
input:focus,
select:focus {
  outline: 3px solid #a8ceff;
  border-color: var(--blue);
}
a {
  color: inherit;
  text-decoration: none;
}
p {
  line-height: 1.6;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  letter-spacing: -0.055em;
  font-weight: 850;
  line-height: 1.02;
}
h2 {
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}
h3 {
  font-size: 1rem;
}
small {
  font-size: 0.8rem;
}
button {
  transition:
    transform 0.12s,
    background 0.12s;
}
button:not(:disabled):active {
  transform: translateY(2px);
}
.topbar {
  height: 92px;
  max-width: 1360px;
  margin: auto;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: 0.02em;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  box-shadow: 2px 2px 0 var(--ink);
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}
.quiet {
  padding: 8px 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 0.88rem;
  font-weight: 600;
}
.language {
  padding: 10px 14px;
  border: 1px solid var(--ink);
  background: transparent;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 650;
}
#connection {
  font-size: 0.8rem;
  color: var(--muted);
}
#connection.connected {
  color: #287144;
}
.primary,
.secondary {
  padding: 14px 20px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  font-weight: 750;
  font-size: 1rem;
  min-height: 48px;
}
.primary {
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
}
.primary:not(:disabled):hover {
  background: #ffe66b;
}
.secondary {
  background: var(--paper);
}
.secondary:hover {
  background: #f0efe4;
}
.full {
  width: 100%;
}
.small {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}
.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}
#app {
  max-width: 1288px;
  margin: 0 auto;
  padding: 42px 0 50px;
}
.start-layout {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 40px;
  min-height: 680px;
  align-items: center;
}
.start-board {
  padding: 32px 20px 32px 8px;
  position: relative;
}
.start-board:before {
  content: "";
  position: absolute;
  inset: 10px -10px 80px -30px;
  background-image:
    linear-gradient(#ddd9c74a 1px, transparent 1px),
    linear-gradient(90deg, #ddd9c74a 1px, transparent 1px);
  background-size: 30px 30px;
  z-index: -1;
  mask-image: linear-gradient(90deg, #000, transparent);
}
.start-board h1 {
  font-size: clamp(3.4rem, 6.3vw, 6rem);
  margin-bottom: 28px;
}
.intro {
  font-size: 1.15rem;
  color: #565146;
  margin-bottom: 32px;
}
.start-stocks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.start-stocks span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  font-weight: 750;
  font-size: 0.82rem;
}
.start-meta {
  display: flex;
  gap: 20px;
  font-size: 0.86rem;
  font-weight: 650;
}
.start-meta span + span {
  border-left: 1px solid #b9b5a8;
  padding-left: 20px;
}
.entry-panel {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 7px 7px 0 #dedccd;
  min-height: 500px;
}
.entry-art {
  overflow: hidden;
  background: linear-gradient(90deg, var(--yellow) 50%, var(--blue) 50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.entry-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.entry-form {
  padding: 34px 24px;
  align-self: center;
}
.entry-form h2 {
  font-size: 1.8rem;
  line-height: 1.1;
  letter-spacing: -0.05em;
  margin-bottom: 30px;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 650;
  margin-bottom: 8px;
}
input,
select {
  min-width: 0;
  width: 100%;
  padding: 13px 12px;
  border: 1.5px solid #ccc8b8;
  border-radius: 7px;
  background: #fff;
  font-size: 1rem;
  min-height: 48px;
}
#player-name {
  margin-bottom: 16px;
}
.or {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin: 24px 0 16px;
}
.join-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.join-row input {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.join-row button {
  padding: 12px 14px;
}
.entry-form > .small {
  margin-top: 20px;
  margin-bottom: 0;
}
.panel {
  background: var(--paper);
  border: 1.5px solid #d1cec0;
  border-radius: 12px;
}
.lobby-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
}
.lobby-main {
  padding: 32px;
}
.room-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.room-heading h1 {
  font-size: 3rem;
  max-width: 400px;
  margin: 0;
}
.mascot-crop {
  width: 128px;
  height: 146px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border-radius: 20px;
}
.mascot-crop img {
  position: absolute;
  width: 225px;
  height: auto;
  max-width: none;
  left: -48px;
  top: -123px;
}
.room-code-label {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  font-weight: 800;
  margin-top: 20px;
}
.code-row {
  display: flex;
  gap: 24px;
  align-items: center;
  margin: 10px 0 30px;
  flex-wrap: wrap;
}
.room-code {
  font-size: 2.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.seats {
  display: grid;
  gap: 10px;
}
.seat {
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  background: #fff;
}
.seat > div {
  flex: 1;
}
.seat strong {
  display: block;
  font-size: 1rem;
}
.seat div > span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}
.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 1.5rem;
  background: var(--player-color);
}
.player-0 {
  --player-color: #fbe1a3;
}
.player-1 {
  --player-color: #c5e0fb;
}
.player-2 {
  --player-color: #f6cadb;
}
.player-3 {
  --player-color: #c8e5ca;
}
.ready-state {
  font-size: 0.78rem;
  font-weight: 750;
}
.empty-seat {
  border-style: dashed;
  color: var(--muted);
  font-size: 0.9rem;
}
.empty-seat .avatar {
  background: #f1f0e8;
  font-size: 1.3rem;
}
.lobby-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 28px 0 18px;
}
.lobby-main > .small {
  margin-bottom: 0;
}
.physical-preview {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}
.quick-rules {
  padding: 26px 6px;
}
.quick-rules p {
  font-size: 0.92rem;
  margin-bottom: 10px;
}
.game-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}
.game-top .eyebrow {
  margin-bottom: 10px;
}
.game-top h1 {
  font-size: 3.4rem;
  margin: 0;
}
.round-box {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 14px;
}
.round-box > span:first-child {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.round-box strong {
  font-size: 2rem;
}
.round-box strong small {
  font-size: 1rem;
  color: var(--muted);
}
.timer {
  grid-column: 1/-1;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  min-height: 22px;
}
.timer.urgent {
  color: #b33831;
}
.players-strip {
  display: grid;
  grid-template-columns: repeat(var(--players, 4), 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.player-card {
  border: 1px solid var(--line);
  border-top: 5px solid var(--player-color);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
}
.player-card.you {
  border-color: var(--ink);
  border-top-color: var(--player-color);
}
.player-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.92rem;
}
.player-name strong {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.player-name small {
  margin-left: auto;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.player-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 8px 0;
}
.player-value small {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 8px;
  color: var(--muted);
}
.player-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  gap: 8px;
}
.holding-row {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.holding-row span {
  font-size: 0.67rem;
  border-bottom: 2px solid var(--stock-color);
  padding-bottom: 3px;
}
.holding-row b {
  font-size: 0.78rem;
}
.player-state {
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 12px;
  color: #615e55;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.market {
  padding: 24px 22px 0;
  overflow: hidden;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading > span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.market-chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 10px 0 20px;
  overflow: visible;
}
.market-chart text {
  font-family: inherit;
  font-size: 12px;
  fill: #817b6d;
}
.grid-line {
  stroke: #dedcce;
  stroke-width: 1;
}
.grid-line.vertical {
  stroke: #e8e5d8;
}
.grid-line.zero {
  stroke: #d16868;
  stroke-width: 2;
}
.stock-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.stock-tile {
  padding: 14px 10px;
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--line);
  border-top: 4px solid var(--stock-color);
  border-radius: 7px;
  opacity: 1 !important;
}
.stock-tile.selected {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.stock-tile > div {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}
.stock-tile b {
  font-size: 0.75rem;
}
.stock-tile strong {
  margin-left: auto;
  font-size: 1.45rem;
  letter-spacing: -0.06em;
}
.stock-tile > span {
  display: block;
  font-size: 0.77rem;
  font-weight: 650;
}
.stock-tile > small {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 6px;
}
.stock-icon {
  font-size: 1.1rem;
}
.stock-tile.delisted {
  background: #eeeae1;
  color: var(--muted);
}
.delisting-band {
  background: #f8dfdb;
  color: #9f3938;
  margin: 0 -22px;
  padding: 12px 22px;
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  font-weight: 800;
}
.trading-panel {
  padding: 22px;
  background: #fcf4d5;
  border: 1.5px solid #d4c492;
}
.panel-number {
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  background: #fff;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 1rem !important;
  color: var(--ink) !important;
}
.news-hint {
  padding: 14px;
  background: var(--paper);
  border: 1px solid #ddd1a9;
  border-radius: 7px;
  margin-bottom: 20px;
}
.news-hint span {
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  font-weight: 750;
  display: block;
  color: var(--muted);
}
.news-hint strong {
  display: block;
  font-size: 1.1rem;
  margin-top: 6px;
}
.news-hint small {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
.action-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #c3b993;
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 20px;
}
.action-tabs button {
  background: #fffdf4;
  padding: 12px 6px;
  font-size: 0.85rem;
  font-weight: 750;
  min-height: 46px;
}
.action-tabs button + button {
  border-left: 1px solid #c3b993;
}
.action-tabs button.active {
  background: var(--ink);
  color: var(--yellow);
}
.quantity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}
.quantity-row label {
  margin: 0;
}
.quantity-buttons {
  display: flex;
  gap: 6px;
}
.quantity-buttons button {
  height: 40px;
  width: 40px;
  border: 1px solid #c3b993;
  border-radius: 5px;
  background: var(--paper);
  font-weight: 700;
}
.quantity-buttons button.active {
  background: var(--ink);
  color: var(--paper);
}
.trade-total {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  margin: 18px 0;
  padding: 15px 0;
  border-top: 1px solid #dbcfaa;
  border-bottom: 1px solid #dbcfaa;
}
.trade-total strong {
  font-size: 0.93rem;
}
.protection-box {
  margin: 18px 0 22px;
}
.protection-box label {
  font-size: 0.8rem;
}
.protection-box label small {
  float: right;
}
.protection-box p {
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 9px 0 0;
}
.trading-panel > .small {
  font-size: 0.74rem;
  margin: 14px 0 0;
}
.first-round-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 28px 0;
}
.small-mascot {
  width: 72px;
  height: 88px;
  border-radius: 12px;
}
.small-mascot img {
  width: 135px;
  left: -31px;
  top: -74px;
}
.first-round-note p {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
}
.recap-panel {
  display: flex;
  gap: 26px;
  margin-top: 26px;
  overflow: hidden;
}
.recap-art {
  width: 146px;
  background: var(--yellow);
  flex-shrink: 0;
  overflow: hidden;
}
.recap-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recap-main {
  padding: 24px 24px 24px 0;
  flex: 1;
  min-width: 0;
}
.recap-main .eyebrow {
  margin-bottom: 8px;
}
.recap-main h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}
.recap-main > p {
  margin-bottom: 14px;
}
.dice-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.dice-row > span {
  font-size: 0.85rem;
  margin-left: 6px;
}
.die {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 7px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  box-shadow: 2px 3px 0 #211d1826;
  transform: rotate(-8deg);
}
.die.red {
  background: #ed4742;
}
.die.blue {
  background: #2c7ed4;
  transform: rotate(8deg);
}
.die span.pip {
  border-radius: 50%;
  background: #fff;
}
.movement-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.movement-row > span {
  border-left: 3px solid var(--stock-color);
  padding-left: 10px;
  font-size: 0.85rem;
}
.movement-row small {
  display: block;
  font-size: 0.69rem;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.4;
}
.below-board {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  margin-top: 24px;
}
.activity {
  padding: 24px;
}
.activity > .small {
  margin-bottom: 0;
}
summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 650;
}
.journal-round {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}
.journal-round:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.journal-round p {
  margin: 7px 0 0;
  font-size: 0.78rem;
}
.reaction-panel {
  padding: 20px;
  text-align: center;
  align-self: start;
}
.reaction-panel > span {
  font-size: 0.8rem;
  color: var(--muted);
}
.reaction-panel > div {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0;
}
.reaction-panel button[data-reaction] {
  font-size: 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 46px;
  min-width: 46px;
}
.reaction-panel .quiet {
  font-size: 0.78rem;
}
.results {
  display: flex;
  gap: 28px;
  align-items: center;
  border: 2px solid var(--ink);
  background: var(--yellow);
  padding: 26px 30px;
  border-radius: 12px;
  margin-bottom: 26px;
}
.results > div {
  flex: 1;
}
.results .eyebrow {
  margin-bottom: 10px;
}
.results h2 {
  font-size: 2rem;
}
.results p {
  font-size: 0.85rem;
  margin: 0;
}
.results ol {
  padding: 0;
  list-style-position: inside;
  min-width: 200px;
  margin: 0;
}
.results li {
  padding: 6px 0;
  font-size: 0.9rem;
}
.results li strong {
  float: right;
  margin-left: 18px;
}
.results button {
  background: var(--paper);
  white-space: nowrap;
}
footer {
  max-width: 1288px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 24px 0 32px;
  color: var(--muted);
  font-size: 0.76rem;
}
dialog {
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  max-width: 620px;
  width: calc(100% - 32px);
  padding: 28px;
  max-height: 85vh;
}
dialog::backdrop {
  background: #211d1880;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 15px;
}
.dialog-heading h2 {
  font-size: 1.65rem;
}
.icon-button {
  background: transparent;
  font-size: 1.1rem;
  padding: 8px;
}
.dialog-heading + div section {
  border-top: 1px solid var(--line);
  padding: 18px 0 0;
  margin-bottom: 18px;
}
.dialog-heading + div h3 {
  margin-bottom: 7px;
}
.dialog-heading + div p {
  font-size: 0.9rem;
  margin-bottom: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 15px);
  background: var(--ink);
  color: #fff;
  padding: 14px 20px;
  border-radius: 9px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  font-size: 0.9rem;
  max-width: calc(100% - 32px);
  width: max-content;
  box-shadow: 0 6px 20px #211d1826;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (min-width: 1400px) {
  #app {
    padding-top: 52px;
  }
  .start-layout {
    min-height: 690px;
  }
}
@media (max-width: 1360px) {
  #app,
  footer {
    margin-left: 36px;
    margin-right: 36px;
  }
  .start-layout {
    gap: 28px;
  }
  .entry-panel {
    grid-template-columns: 0.64fr 1fr;
  }
  .start-board h1 {
    font-size: 5.4vw;
  }
}
@media (max-width: 1000px) {
  .entry-panel {
    grid-template-columns: 1fr;
  }
  .entry-art {
    height: 200px;
  }
  .entry-art img {
    object-fit: cover;
    object-position: 50% 48%;
    width: 100%;
  }
  .entry-form {
    padding: 26px;
  }
  .start-board h1 {
    font-size: 7vw;
  }
  .entry-form h2 {
    margin-bottom: 20px;
  }
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 16px;
  }
  .market {
    padding: 20px 14px 0;
  }
  .delisting-band {
    margin: 0 -14px;
    padding-left: 14px;
  }
  .stock-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
  .players-strip {
    gap: 8px;
  }
  .player-card {
    padding: 12px;
  }
  .holding-row {
    gap: 5px;
  }
  .movement-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .results {
    flex-wrap: wrap;
  }
  .lobby-main {
    padding: 24px;
  }
  .room-heading h1 {
    font-size: 2.5rem;
  }
  .mascot-crop {
    width: 96px;
  }
}
@media (max-width: 740px) {
  .topbar {
    height: 78px;
    padding: 0 20px;
  }
  .header-controls {
    gap: 14px;
  }
  .brand {
    font-size: 0.62rem;
    gap: 8px;
  }
  .brand-mark {
    font-size: 1.1rem;
    padding: 8px 10px;
  }
  #connection {
    display: none;
  }
  .header-controls .quiet {
    font-size: 0.8rem;
  }
  .language {
    padding: 8px 10px;
    font-size: 0.78rem;
  }
  #app,
  footer {
    margin-left: 20px;
    margin-right: 20px;
  }
  #app {
    padding-top: 28px;
  }
  .start-layout {
    grid-template-columns: 1fr;
    gap: 26px;
    min-height: 0;
  }
  .start-board {
    padding: 10px 0 0;
  }
  .start-board h1 {
    font-size: clamp(3.2rem, 11vw, 5rem);
    margin-bottom: 20px;
  }
  .start-board h1 br:nth-child(2) {
    display: none;
  }
  .start-board h1 br:nth-child(2):after {
    content: " ";
  }
  .intro {
    font-size: 1rem;
    margin-bottom: 22px;
  }
  .eyebrow {
    font-size: 0.7rem;
    margin-bottom: 14px;
  }
  .start-stocks {
    margin-bottom: 20px;
  }
  .start-stocks span {
    padding: 8px 10px;
    font-size: 0.74rem;
  }
  .start-meta {
    gap: 14px;
    font-size: 0.75rem;
  }
  .start-meta span + span {
    padding-left: 14px;
  }
  .entry-panel {
    grid-template-columns: 0.75fr 1fr;
    min-height: 390px;
    box-shadow: 4px 4px 0 #dedccd;
  }
  .entry-art {
    height: auto;
  }
  .entry-art img {
    height: 100%;
    object-position: center;
  }
  .entry-form {
    padding: 24px 18px;
  }
  .entry-form h2 {
    font-size: 1.5rem;
  }
  .entry-form label {
    font-size: 0.8rem;
  }
  .join-row {
    grid-template-columns: 1fr;
  }
  .join-row button {
    width: 100%;
  }
  .entry-form .small {
    font-size: 0.74rem;
  }
  .or {
    margin-top: 20px;
  }
  .lobby-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .lobby-main {
    padding: 24px 20px;
  }
  .room-heading h1 {
    font-size: 2.5rem;
  }
  .room-code {
    font-size: 2.2rem;
  }
  .code-row {
    gap: 16px;
  }
  .lobby-aside {
    display: grid;
    grid-template-columns: 0.8fr 1fr;
    gap: 20px;
    align-items: start;
  }
  .quick-rules {
    padding: 2px 0;
  }
  .quick-rules h2 {
    font-size: 1.05rem;
  }
  .quick-rules p {
    font-size: 0.78rem;
  }
  .quick-rules .quiet {
    font-size: 0.76rem;
  }
  .game-top h1 {
    font-size: 2.3rem;
  }
  .round-box {
    gap: 8px;
  }
  .round-box strong {
    font-size: 1.6rem;
  }
  .round-box > span:first-child {
    font-size: 0.65rem;
  }
  .players-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .player-card {
    padding: 12px 14px;
  }
  .game-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .stock-tiles {
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
  }
  .stock-tile {
    padding: 12px 7px;
  }
  .stock-tile b {
    font-size: 0.65rem;
  }
  .stock-icon {
    display: none;
  }
  .stock-tile strong {
    font-size: 1.2rem;
  }
  .stock-tile > span {
    font-size: 0.66rem;
  }
  .stock-tile > small {
    font-size: 0.65rem;
  }
  .market-chart {
    margin-bottom: 14px;
  }
  .section-heading h2 {
    font-size: 1.1rem;
  }
  .trading-panel {
    padding: 22px;
  }
  .trading-panel .news-hint {
    margin-bottom: 16px;
  }
  .trading-panel .quantity-row {
    margin-top: 16px;
  }
  .protection-box p,
  .trading-panel > .small {
    font-size: 0.8rem;
  }
  .recap-panel {
    gap: 18px;
  }
  .recap-art {
    width: 96px;
  }
  .recap-main {
    padding: 20px 16px 20px 0;
  }
  .recap-main h2 {
    font-size: 1.5rem;
  }
  .recap-main .eyebrow {
    font-size: 0.63rem;
  }
  .recap-main > p {
    font-size: 0.84rem;
  }
  .movement-row {
    gap: 12px;
  }
  .movement-row > span {
    font-size: 0.74rem;
  }
  .movement-row small {
    font-size: 0.65rem;
  }
  .recap-main .secondary {
    font-size: 0.8rem;
    padding: 12px;
  }
  .below-board {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .reaction-panel {
    padding: 18px;
  }
  .results {
    padding: 22px;
    gap: 20px;
  }
  .results > div {
    flex-basis: 100%;
  }
  .results ol {
    flex: 1;
  }
  .results h2 {
    font-size: 1.6rem;
  }
  .results button {
    font-size: 0.9rem;
  }
  .activity {
    padding: 20px;
  }
  .activity .section-heading {
    align-items: start;
  }
  .activity .section-heading > span {
    max-width: 100px;
    text-align: right;
    font-size: 0.65rem;
  }
  footer {
    font-size: 0.65rem;
    gap: 12px;
  }
  .first-round-note {
    justify-content: flex-start;
  }
  .first-round-note p {
    font-size: 0.85rem;
  }
}
@media (max-width: 390px) {
  .topbar {
    padding: 0 14px;
  }
  .header-controls {
    gap: 10px;
  }
  .brand > span:last-child {
    max-width: 70px;
  }
  .header-controls .quiet {
    font-size: 0.73rem;
  }
  .entry-panel {
    grid-template-columns: 0.6fr 1fr;
  }
  .entry-form {
    padding: 22px 14px;
  }
  #app,
  footer {
    margin-left: 14px;
    margin-right: 14px;
  }
  .room-heading .mascot-crop {
    display: none;
  }
  .room-code {
    font-size: 1.9rem;
  }
  .stock-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
  .stock-icon {
    display: inline;
  }
  .stock-tile > span {
    font-size: 0.77rem;
  }
  .stock-tile b {
    font-size: 0.75rem;
  }
  .game-top h1 {
    font-size: 2.05rem;
  }
  .round-box > span:first-child {
    display: none;
  }
  .round-box strong {
    grid-column: 2;
  }
  .recap-art {
    width: 74px;
  }
  .lobby-aside {
    grid-template-columns: 1fr;
  }
  .physical-preview {
    max-height: 260px;
    object-fit: cover;
  }
  .player-name {
    font-size: 0.82rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.solo-button {
  margin-top: 14px;
  background: #d8eafa;
}
.solo-button:hover {
  background: #c3e0fa;
}

.is-reveal .die {
  animation: dice-reveal 0.55s ease-out;
}
.is-reveal .recap-art {
  animation: news-reveal 0.45s ease-out;
}
@keyframes dice-reveal {
  from {
    transform: rotate(-120deg) scale(0.5);
    opacity: 0.2;
  }
  to {
    opacity: 1;
  }
}
@keyframes news-reveal {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (max-width: 740px) {
  .market-chart text {
    font-size: 25px;
  }
}

/* Keep the decision and its saved state visible on the playing surface. */
body.is-playing .topbar {
  height: 72px;
}
body.is-playing #app {
  padding-top: 24px;
}
.game-top {
  margin-bottom: 16px;
}
.game-top h1 {
  font-size: 2.4rem;
}
.game-top .eyebrow {
  font-size: 0.7rem;
  margin-bottom: 7px;
}
.game-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
}
.game-toolbar .quiet {
  font-size: 0.78rem;
}
.round-box {
  column-gap: 8px;
}
.round-box strong {
  font-size: 1.65rem;
}
.players-strip {
  gap: 10px;
  margin-bottom: 18px;
}
.player-card {
  padding: 11px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 14px;
}
.player-name {
  grid-column: 1;
}
.player-value {
  grid-column: 2;
  grid-row: 1 / 3;
  margin: 0;
  font-size: 1.65rem;
  text-align: right;
}
.player-meta {
  grid-column: 1;
  justify-content: flex-start;
  gap: 16px;
}
.holding-row {
  grid-column: 1;
  margin-top: 4px;
}
.player-state {
  grid-column: 2;
  font-size: 0.72rem;
  margin: 0;
  text-align: right;
}
.round-change {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-top: 3px;
}
.gain {
  color: #247144;
}
.loss {
  color: #aa3735;
}
.game-layout {
  grid-template-columns: minmax(0, 1fr) 342px;
  gap: 20px;
}
.market {
  padding-top: 20px;
}
.market-chart {
  margin: 8px 0 10px;
}
.market-chart .endpoint-label {
  fill: var(--ink);
  font-size: 16px;
  font-weight: 800;
}
.market-chart .latest-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.future-zone {
  fill: #e9e6da66;
}
.round-hit {
  fill: transparent;
  cursor: crosshair;
}
.chart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chart-toggle {
  display: flex;
  gap: 5px;
}
.chart-toggle button {
  background: transparent;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 36px;
}
.chart-toggle button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.chart-controls select {
  width: auto;
  max-width: 155px;
  min-height: 36px;
  padding: 7px 8px;
  font-size: 0.75rem;
}
.chart-inspection {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.78rem;
  padding: 9px 0 14px;
  min-height: 38px;
}
.chart-inspection > strong {
  margin-right: 3px;
}
.chart-inspection small {
  color: var(--muted);
}
.stock-tiles {
  gap: 8px;
  margin-bottom: 18px;
}
.stock-tile {
  padding: 10px 9px;
}
.stock-tile:disabled:not(.delisted) {
  opacity: 0.58 !important;
}
.delisting-band {
  padding-top: 9px;
  padding-bottom: 9px;
}
.trading-panel {
  padding: 18px;
  position: sticky;
  top: 14px;
}
.trading-panel .section-heading {
  margin-bottom: 12px;
}
.trading-panel .timer {
  min-height: auto;
  font-size: 1rem;
  color: var(--ink);
}
.trading-panel .timer.urgent {
  color: #b33831;
}
.news-hint {
  padding: 11px 12px;
  margin-bottom: 14px;
}
.news-hint strong {
  font-size: 1rem;
  margin-top: 4px;
}
.news-hint small {
  margin-top: 4px;
}
.action-tabs {
  margin-bottom: 14px;
}
.action-tabs button {
  padding: 10px 6px;
  min-height: 42px;
}
.trading-panel select {
  padding: 10px;
  min-height: 42px;
  font-size: 0.9rem;
}
.quantity-row {
  margin-top: 12px;
  gap: 10px;
}
.quantity-buttons {
  gap: 5px;
}
.quantity-buttons button {
  width: 36px;
  height: 36px;
}
.quantity-limit {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 6px 0 10px;
}
.order-summary {
  padding: 12px;
  border: 1px solid #d8c99e;
  background: #fffdf6;
  border-radius: 7px;
  font-size: 0.85rem;
  margin-top: 12px;
}
.order-summary > strong {
  display: block;
}
.order-summary > div {
  font-size: 0.78rem;
  line-height: 1.5;
  margin-top: 5px;
}
.order-summary.invalid {
  border-color: #c6625d;
  color: #9d302c;
  background: #ffefea;
}
.protection-box {
  margin: 14px 0;
}
.protection-box p {
  font-size: 0.72rem;
  margin-top: 6px;
}
.protection-box summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 0;
}
.protection-box summary span {
  float: right;
}
.protection-box[open] summary {
  margin-bottom: 6px;
}
.draft-status {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  color: #286346;
  margin: 10px 0 7px;
}
.draft-status.saving {
  color: #70600d;
}
.draft-status.invalid,
.draft-status.error {
  color: #a53730;
}
.draft-status > span {
  display: block;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  margin-top: 4px;
}
.saved-order {
  background: #e9e4cd;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  line-height: 1.45;
  margin-bottom: 12px;
}
.saved-order > b {
  display: block;
  margin-top: 2px;
}
.solo-clock,
.home-timer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.solo-clock label,
.home-timer label {
  margin: 0;
  font-size: 0.75rem;
}
.solo-clock select,
.home-timer select {
  margin-left: auto;
  width: 150px;
  padding: 7px 9px;
  min-height: 34px;
  font-size: 0.75rem;
}
.home-timer select {
  width: 135px;
}
.recap-panel {
  margin-top: 20px;
  gap: 20px;
}
.recap-main {
  padding: 20px 20px 20px 0;
}
.recap-main h2 {
  font-size: 1.45rem;
  margin-top: 8px;
}
.recap-main .eyebrow {
  margin-bottom: 8px;
}
.recap-art {
  width: 124px;
}
.news-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 4px;
  padding: 5px 8px;
}
.news-badge.positive {
  background: #ffe57c;
}
.news-badge.negative {
  background: #c8e2fb;
}
.personal-settlement {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.82rem;
  margin-bottom: 14px;
}
.personal-settlement > span {
  color: var(--muted);
}
.below-board:not(:has(.reaction-panel)) {
  grid-template-columns: 1fr;
}
.mobile-order-bar {
  display: none;
}
@media (max-width: 1000px) and (min-width: 741px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 14px;
  }
  .player-card {
    grid-template-columns: 1fr;
  }
  .player-value {
    grid-column: 1;
    grid-row: auto;
    text-align: left;
  }
  .player-meta,
  .holding-row,
  .player-state {
    grid-column: 1;
    text-align: left;
  }
  .chart-controls {
    flex-wrap: wrap;
  }
}
@media (max-width: 740px) {
  .game-top {
    align-items: start;
    gap: 12px;
  }
  .game-top h1 {
    font-size: 1.9rem;
  }
  .game-toolbar {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px 12px;
    justify-items: end;
  }
  .game-toolbar .round-box {
    grid-column: 1 / -1;
  }
  .game-toolbar .quiet {
    font-size: 0.72rem;
    white-space: nowrap;
  }
  .player-card {
    padding: 10px 12px;
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .player-name {
    font-size: 0.85rem;
  }
  .player-value {
    grid-column: 1;
    grid-row: auto;
    text-align: left;
    font-size: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
  }
  .player-value small {
    margin-left: 2px;
  }
  .round-change {
    font-size: 0.68rem;
    flex-basis: 100%;
  }
  .player-meta,
  .holding-row,
  .player-state {
    grid-column: 1;
    text-align: left;
  }
  .player-meta {
    gap: 8px;
    font-size: 0.73rem;
  }
  .game-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .trading-panel {
    position: static;
  }
  .chart-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
  .chart-toggle button {
    font-size: 0.72rem;
    padding: 8px;
  }
  .market-chart .endpoint-label {
    font-size: 23px;
  }
  .market-chart .latest-label {
    font-size: 19px;
  }
  .chart-inspection {
    font-size: 0.72rem;
    gap: 7px 11px;
  }
  .recap-art {
    width: 90px;
  }
  .recap-main h2 {
    font-size: 1.1rem;
    line-height: 1.3;
  }
  .personal-settlement {
    font-size: 0.76rem;
    gap: 5px;
  }
  .mobile-order-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff7ddec;
    backdrop-filter: blur(12px);
    padding: 11px 16px max(11px, env(safe-area-inset-bottom));
    border-top: 1px solid #c6b887;
    box-shadow: 0 -4px 15px #211d180c;
  }
  .mobile-order-bar > div {
    flex: 1;
    min-width: 0;
    font-size: 0.72rem;
    line-height: 1.4;
  }
  .mobile-order-bar strong {
    display: block;
    font-size: 0.8rem;
  }
  .mobile-order-bar button {
    min-width: 100px;
    padding: 11px 15px;
    font-size: 0.85rem;
    box-shadow: 2px 2px 0 var(--ink);
  }
  body.is-playing footer {
    padding-bottom: 105px;
  }
}
