:root {
  color-scheme: dark;
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --ink: #f4efe0;
  --muted: #b4c7c3;
  --page: #101f24;
  --surface: #172f35;
  --border: #405c60;
  --gold: #f2c47d;
  --gold-ink: #242219;
  --cyan: #74d9e3;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 48% 0%, #233a3c 0%, var(--page) 52%); color: var(--ink); }
button, input, select { font: inherit; }
button, input, select, summary { min-height: 44px; }
button {
  border: 1px solid transparent;
  border-radius: .65rem;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 650;
  cursor: pointer;
  padding: .45rem .7rem;
  touch-action: manipulation;
}
button:disabled { opacity: .55; cursor: default; }
button.secondary { background: #24434b; color: var(--ink); border-color: var(--border); }
button.quiet { color: var(--ink); background: #17323a; border-color: var(--border); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
a { color: var(--cyan); overflow-wrap: anywhere; }
h1, h2, p { margin: 0; }
h1 { font: 600 clamp(1.15rem, 6vw, 1.75rem)/1.06 "Instrument Serif", Georgia, serif; }
h2 { font-size: 1.05rem; }
p { line-height: 1.45; }
.mast {
  background: linear-gradient(120deg, #1f363b, #112b31);
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: calc(.55rem + env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) .55rem max(.75rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
}
.mast > div { flex: 1; }
.mast img { border-radius: .4rem; }
.mast span { color: var(--muted); font-size: .75rem; }
main { max-width: 1240px; margin: auto; padding: .65rem max(.6rem, env(safe-area-inset-right)) calc(.75rem + env(safe-area-inset-bottom)) max(.6rem, env(safe-area-inset-left)); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: .85rem; box-shadow: 0 4px 16px #0b1b2370; }
.welcome { max-width: 35rem; margin: clamp(1rem, 6vw, 4rem) auto; padding: clamp(1rem, 4vw, 2rem); display: grid; gap: 1rem; }
.welcome h2 { font: 600 clamp(1.6rem, 6vw, 2.25rem)/1.06 "Instrument Serif", Georgia, serif; }
.welcome form, .stack { display: grid; gap: .65rem; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.join { border-top: 1px solid var(--border); padding-top: .7rem; display: flex; gap: .5rem; align-items: end; }
.join label { flex: 1; min-width: 0; }
label { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); }
input, select {
  width: 100%;
  min-width: 0;
  background: #12272c;
  color: var(--ink);
  padding: .4rem .55rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  font-size: 1rem;
}
.notice { padding: .6rem .75rem; border-radius: .55rem; background: #403227; color: #ffe4b5; margin-bottom: .5rem; overflow-wrap: anywhere; }
.turn-bar {
  min-height: 35px;
  display: flex;
  justify-content: space-between;
  gap: .55rem;
  align-items: center;
  color: var(--muted);
  font-size: .85rem;
  padding: 0 .15rem .4rem;
}
.turn-bar strong { color: var(--ink); }
.table-grid { display: grid; gap: .55rem; }
.board-panel { position: relative; border: 1px solid #79634d; border-radius: .8rem; overflow: hidden; background: #39342d; box-shadow: 0 7px 24px #070c10ac; }
.board-stage { position: relative; }
#map { display: block; width: 100%; height: clamp(221px, calc(40svh - 26px), 460px); touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }
.board-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; border-top: 1px solid #695747; padding: .2rem .4rem; background: #252d2c; }
.camera { display: flex; gap: .26rem; margin-inline-start: auto; }
.camera button { min-width: 44px; padding: .35rem .5rem; }
.table-tools { display: flex; flex-wrap: wrap; gap: .26rem; }
.table-tools button, .camera button { border-color: #8c6841; background: linear-gradient(160deg, #624629, #2c2422); color: #ffe4ab; }
.table-tools button { font-size: .78rem; padding-inline: .55rem; }
.map-inspection { position: absolute; left: .45rem; top: .45rem; color: var(--ink); font-size: .78rem; background: #112b31ee; padding: .3rem .55rem; border-radius: .35rem; pointer-events: none; }
.placement-hint { position: absolute; top: .45rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: 96%; pointer-events: none; font-weight: 650; color: #fff1c2; background: #2c251ce8; border: 1px solid #a78c5b; border-radius: .35rem; padding: .3rem .5rem; font-size: .8rem; }
.controls { padding: .6rem; display: grid; align-content: start; gap: .65rem; }
.seat-0 { --seat: var(--gold); }
.seat-1 { --seat: var(--cyan); }
.players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; max-width: 40rem; margin: 0 auto .45rem; }
.player { color: var(--ink); border: 1px solid #856343; padding: .24rem .5rem .24rem .24rem; border-radius: .55rem; background: linear-gradient(130deg, #514035, #241f20); min-width: 0; display: flex; align-items: center; gap: .5rem; text-align: left; }
.player.active { border-color: var(--seat); box-shadow: inset 0 -2px var(--seat); }
.player .portrait { width: 42px; height: 42px; flex: 0 0 42px; }
.player > span { min-width: 0; }
.player strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .85rem; }
.player small { color: var(--muted); }
.profile { display: grid; grid-template-columns: minmax(62px, 24%) 1fr; align-items: start; gap: .8rem; }
.portrait { position: relative; display: inline-block; border: 2px solid var(--frame, #e4b767); border-radius: .4rem; }
.portrait img { display: block; width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .27rem; }
.portrait .crest { position: absolute; display: grid; place-items: center; right: -.24rem; bottom: -.18rem; width: 1.03rem; height: 1.03rem; color: #271d16; background: var(--frame, #e4b767); border: 1px solid #36291a; border-radius: .35rem; font: 800 .67rem/1 system-ui; }
.frame-jade { --frame: #84d59c; }
.frame-garnet { --frame: #f8968a; }
.frame-silver { --frame: #c9dce7; }
.profile-portrait { width: 100%; }
.character-preview { display: flex; gap: .75rem; align-items: center; }
.character-preview .portrait { width: 4rem; height: 4rem; }
.character-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; }
.character-option { display: grid; justify-items: center; align-content: start; text-align: center; gap: .3rem; min-width: 0; padding: .24rem; border-color: #795b3c; background: #2a2521; color: #ffeed0; font-size: .7rem; line-height: 1.1; }
.character-option[aria-pressed="true"] { border-color: #ffe3ac; background: #75512e; }
.character-option img { width: 100%; border-radius: .25rem; aspect-ratio: 1; object-fit: cover; }
.player-stats { display: grid; grid-template-columns: minmax(0, 45%) 1fr; gap: .45rem .6rem; margin: 0; font-size: .85rem; }
.player-stats dt { color: var(--muted); }
.player-stats dd { margin: 0; font-weight: 600; }
.roll-reveal, .last-dice { position: absolute; pointer-events: none; z-index: 1; display: grid; justify-items: center; }
.roll-reveal { top: 37%; left: 50%; transform: translate(-50%, -40%); width: max-content; max-width: 94%; padding: .65rem 1rem; text-align: center; color: #fff4d8; border: 1px solid #d4ae6b; border-radius: .8rem; background: #231d18ec; box-shadow: 0 7px 26px #18130f; gap: .35rem; }
.roll-reveal strong { font: 700 clamp(1.25rem, 4vw, 2rem) Georgia, serif; }
.roll-reveal > span { font-size: .83rem; }
.last-dice { right: .45rem; bottom: .45rem; border: 1px solid #aa8859; border-radius: .5rem; color: #fff1d6; background: #26201cea; font-size: .7rem; padding: .3rem .4rem; gap: .25rem; }
.last-dice > span { max-width: 8.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dice-faces { display: flex; gap: .38rem; --die: clamp(3rem, 11vw, 4.7rem); }
.last-dice .dice-faces { --die: 1.5rem; gap: .23rem; }
.die { width: var(--die); height: var(--die); padding: calc(var(--die) * .12); display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center; background: linear-gradient(148deg, #fffae6, #e1c795); border: 1px solid #af905e; border-radius: calc(var(--die) * .16); box-shadow: inset 0 -3px #4c2d273d, 0 3px 4px #191512bc; color: #3c3327; }
.die-russet { background: linear-gradient(145deg, #cc674a, #933f30); border-color: #cd8060; }
.die-event { display: grid; grid-template: 1fr / 1fr; font: bold calc(var(--die) * .55) Georgia, serif; line-height: 1; }
.die-event img { width: 100%; height: 100%; object-fit: contain; }
.pip.ink { width: 72%; aspect-ratio: 1; border-radius: 50%; background: #362d21; }
.die-russet .pip.ink { background: #fadfb8; }
.situation { display: grid; gap: .22rem; font-size: .8rem; color: var(--muted); }
.situation strong { color: var(--ink); }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
.actions .wide { grid-column: 1 / -1; }
#placement { display: grid; gap: .45rem; }
#hand-area { display: grid; gap: .35rem; }
#hand-area h2 { font-size: .8rem; color: var(--muted); }
.hand { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; }
.card { min-width: 0; padding: .35rem .15rem; text-align: center; background: linear-gradient(150deg, #2e4d51, #1d383f); border-radius: .35rem; border-top: 2px solid var(--border); font-size: .72rem; }
.card b { display: block; font-size: .98rem; }
.wood { border-color: #85bd82; }
.brick { border-color: #eb9c77; }
.wool { border-color: #a9d28d; }
.grain { border-color: #eaca7a; }
.ore { border-color: #b3bbc5; }
.paper, .cloth, .coin { border-color: #bad5df; }
.activity { margin-top: .5rem; padding: .55rem .7rem; color: #ead4ac; background: #332920; font-size: .85rem; border-radius: .45rem; }
.event-list, .chat-list { list-style: none; padding: 0; margin: 0; max-height: 47svh; overflow-y: auto; display: grid; gap: .3rem; }
.entry { display: grid; grid-template-columns: max-content 1fr; gap: .55rem; border-inline-start: 3px solid var(--seat); border-radius: .3rem; background: #17282c; padding: .5rem; font-size: .86rem; overflow-wrap: anywhere; }
.entry > :first-child { color: var(--seat); font-size: .8rem; max-width: 8rem; }
.chat-list .entry { grid-template-columns: 1fr; gap: .18rem; }
.chat-form { display: flex; gap: .45rem; align-items: end; }
.chat-form label { flex: 1; }
dialog {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #aa8756;
  border-radius: 1rem 1rem 0 0;
  margin: auto auto 0;
  width: min(100%, 36rem);
  max-width: 100%;
  max-height: 90svh;
  padding: .75rem max(.75rem, env(safe-area-inset-right)) calc(.8rem + env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
}
dialog::backdrop { background: #081419be; }
.sheet-title { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
#sheet-body, .choice-list { display: grid; gap: .55rem; }
.choice-list button { display: grid; grid-template-columns: 2.1rem minmax(0, 1fr) minmax(0, 48%); text-align: left; gap: .6rem; align-items: center; }
.choice-list small { font-size: .75rem; color: var(--muted); }
.build-piece { width: 2rem; height: 1.9rem; object-fit: contain; }
.road-mark { display: grid; place-items: center; color: var(--gold); }
fieldset { min-width: 0; margin: 0; padding: .35rem; border: 1px solid var(--border); border-radius: .5rem; }
legend { padding-inline: .2rem; font-weight: 650; }
.trade-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .27rem; }
.trade-card { display: grid; justify-items: center; align-content: start; gap: .16rem; width: 100%; min-height: 4.9rem; padding: .18rem .12rem; color: #fff0cf; background: linear-gradient(150deg, #594536, #292a28); border-width: 1px; border-style: solid; font-size: .71rem; }
.trade-card span, .trade-card small { line-height: 1.1; }
.trade-card small { font-size: .62rem; font-weight: 500; }
.trade-card[aria-pressed="true"], .trade-tile.selected .trade-card { outline: 2px solid var(--gold); outline-offset: -2px; background: #61462c; }
.resource-art { display: grid; place-items: center; object-fit: cover; width: 1.9rem; height: 1.9rem; border-radius: .28rem; border: 1px solid #bd9f6a; background: #715538; color: #fff1c7; font-size: 1.25rem; }
.remove-card { width: 100%; padding: .17rem; min-height: 44px; background: #293b3d; color: var(--ink); border: 1px solid var(--border); }
.remove-card:disabled { display: none; }
.trade-summary { font-size: .84rem; color: #ffe0a4; }
.offer-line { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; border-bottom: 1px solid #826e51; padding-block: .35rem; }
.offer-line strong { flex-basis: 100%; }
.offer-item { display: inline-flex; align-items: center; gap: .25rem; color: #fff0cf; }
.seat-row { display: flex; gap: .4rem; align-items: center; }
.seat-row strong { flex: 1; overflow-wrap: anywhere; }
.invite-code { font-size: 1.5rem; font-variant-numeric: tabular-nums; letter-spacing: .14em; }
.qr { display: block; max-width: 11rem; border-radius: .45rem; image-rendering: pixelated; }
@media (min-width: 760px) {
  .mast { padding-inline: max(1rem, env(safe-area-inset-left)); }
  main { padding-inline: 1rem; }
  .table-grid { grid-template-columns: minmax(0, 1fr) minmax(244px, 31%); align-items: start; gap: .75rem; }
  #map { height: clamp(410px, calc(70svh - 27px), 680px); }
  .controls { padding: .75rem; }
  dialog { border-radius: 1rem; margin: auto; }
  .trade-cards { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (min-width: 760px) and (max-height: 850px) {
  #map { height: clamp(310px, calc(100svh - 310px), 540px); }
}

/* One continuous tabletop: the board and its controls share the same surface. */
:root { --ink:#fff0d4; --muted:#ddc7a2; --surface:#24282b; --border:#806342; --gold:#e8b45b; --cyan:#8ad6d5; }
body {
  background-color: #4b2d19;
  background-image: radial-gradient(ellipse at 48% 36%, #f7d29608 18%, #1b100d66 100%), url('/art/tabletop-premium.webp'), url('/art/tabletop.webp');
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}
body::before { content:''; position:fixed; inset:0; pointer-events:none; background:radial-gradient(ellipse at 48% 32%,#ffdc8130,transparent 60%,#160c0770); z-index:-1; }
button { border-radius:5px; border-color:#b78947; background:linear-gradient(#f5d78c,#c9943d); box-shadow:inset 0 1px #fff0b6,0 2px 3px #100b0870; color:#382619; }
button.secondary,button.quiet { background:linear-gradient(#42484a,#24282b); border-color:#a8834d; color:#ffedc9; box-shadow:inset 0 1px #ffffff20,0 2px 3px #100b0870; }
button:disabled { opacity:.44; }
.mast { background:linear-gradient(#2a1c15e8,#261912bc); border-bottom:1px solid #b48c4b70; box-shadow:0 2px 8px #140c0760; }
.mast h1 { letter-spacing:.015em; }
.panel,dialog { background:linear-gradient(135deg,#34383b,#1c2226); border-color:#a78049; }
.welcome { margin-top:10svh; padding:2rem; box-shadow:0 12px 50px #180e0dbb,inset 0 0 0 3px #d6a95f25; }
.welcome::before { content:'THE ISLES OF REPTON'; text-align:center; color:#d3ac62; font:small-caps 600 .7rem Georgia,serif; letter-spacing:.27em; }
input,select { background:#171f22; border-color:#7e6a4a; border-radius:4px; }
.players { gap:1.4rem; max-width:38rem; }
.player { background:linear-gradient(#38342b,#1e1c19); border:2px solid #9a7441; border-radius:5px 5px 15px 15px; box-shadow:0 5px 7px #1a0f0966; padding:5px 10px 5px 5px; }
.player.active { border-color:var(--seat); box-shadow:0 0 0 2px #2e2016,0 0 15px #ffe0a745; }
.player .portrait { width:54px; height:54px; flex-basis:54px; border-radius:50%; }
.portrait img { border-radius:inherit; }
.player strong { font-family:Georgia,serif; font-size:1rem; }
.player small { display:block; margin-top:5px; color:#f8dfb0; font-size:.76rem; }
.turn-bar { justify-content:center; gap:1rem; text-shadow:0 1px 4px #1b0e08; color:#fff1d4; }
.turn-bar strong { color:#fff1d4; }
.board-panel { border:0; border-radius:0; background:transparent; box-shadow:none; overflow:visible; }
.board-stage { background:transparent; }
.board-tools { border:0; background:none; padding:0; }
.controls { border:0; border-radius:0; background:none; box-shadow:none; }
.situation { color:#f5dfb6; }
.activity { background:#251b16dd; border:1px solid #a57e41; border-radius:4px; color:#eedab9; }

.cost-reference { display:grid; gap:5px; position:absolute; bottom:105px; left:6%; width:205px; padding:13px; transform:rotate(-4deg); background:linear-gradient(120deg,#e4cf9e,#f4e8c7 60%,#cbb486); color:#392b1b; border:4px double #776147; border-radius:2px; box-shadow:3px 7px 9px #1d100a77; text-align:left; font:12px Georgia,serif; }
.cost-reference strong { text-align:center; border-bottom:1px solid #9a815c; padding-bottom:5px; letter-spacing:.07em; }
.cost-reference > span { display:flex; justify-content:space-between; gap:8px; border-bottom:1px solid #8c744e45; padding-block:2px; }
.cost-reference em { font:9px/1.4 'Segoe UI',sans-serif; text-align:right; }
.cost-reference small { text-align:center; font:10px 'Segoe UI',sans-serif; }
.table-classic :is(.cost-knight, .cost-wall), #table:not(.table-printed) .cost-wall { display: none; }
#hand-area h2 { color:#e9ce96; text-align:center; font:small-caps 600 .7rem Georgia,serif; letter-spacing:.16em; }
.hand { grid-template-columns:repeat(8,minmax(0,1fr)); gap:4px; }
.card { position:relative; border:2px solid #bea776; border-radius:5px; background:linear-gradient(140deg,#e1ce9f,#7e7853); color:#fff2d8; padding:4px 3px 2px; box-shadow:0 4px 5px #160f0b90,inset 0 0 0 1px #403e25; }
.card .resource-art { width:100%; height:58px; border:1px solid #4c4a2b; border-radius:32% 32% 20% 20%; object-fit:cover; font-size:2rem; }
.card span:not(.resource-art) { display:block; color:#30291c; font-size:.65rem; font-weight:700; text-align:center; }
.card b { position:absolute; right:1px; top:-10px; border:1px solid #d2ad6c; border-radius:50%; min-width:24px; height:24px; background:#28241e; color:#fff1cf; line-height:22px; font-size:1rem; }
.card.empty { filter:saturate(.48); }
.card.empty b { color:#c8b99b; }
.actions { gap:6px; }
.actions button { min-height:48px; }
.actions .wide { grid-column:1/-1; }
#placement { background:#2b2520f2; padding:10px; border:1px solid #b38a48; border-radius:5px; }
.last-dice { border:0; background:none; box-shadow:none; padding:0; right:18px; bottom:144px; text-shadow:0 2px 2px #170f09; }
.last-dice .dice-faces { --die:2.3rem; gap:.35rem; }
.roll-reveal { background:linear-gradient(#34271ce8,#211b16e8); border:2px solid #d2ab60; box-shadow:0 15px 50px #1b120eb0,inset 0 0 0 3px #80613b; border-radius:7px; padding:1rem 1.7rem; }
.roll-reveal .dice-faces { --die:5rem; padding:.4rem; }
.die { transform:rotate(-7deg); }
.die:nth-child(2) { transform:rotate(9deg); }
.die:nth-child(3) { transform:rotate(-3deg); }
.dialog .die { transform:none; }
dialog { border:3px solid #d4a656; box-shadow:0 15px 70px #110b08a0,inset 0 0 0 2px #654b2c; border-radius:8px; padding:1rem; }
dialog::backdrop { background:#140d072b; }
.sheet-title { border-bottom:1px solid #927443; padding-bottom:.5rem; }
.sheet-title h2 { font:700 1.35rem Georgia,serif; color:#ffe7ba; }
.entry { background:#171c20; border-radius:0; padding:.65rem; }
.trade-cards { gap:6px; }
.trade-card { border:2px solid #b4a678; border-radius:5px; background:linear-gradient(130deg,#cdc08a,#696f4a); color:#241f16; padding:5px 3px; box-shadow:1px 4px 4px #111b; }
.trade-card .resource-art { width:100%; height:70px; border:2px ridge #b8a46a; border-radius:45% 45% 30% 30%; font-size:2.3rem; }
.trade-card small { color:#2d281c; }
.trade-card[aria-pressed="true"],.trade-tile.selected .trade-card { background:#e6c074; outline:3px solid #ffe7ab; outline-offset:1px; }
.trade-card:disabled { opacity:.48; }
fieldset { padding:10px; border:1px solid #887654; border-radius:3px; background:#141d2266; }
legend { font-family:Georgia,serif; color:#f4d7a0; }
.trade-tabs button { min-height:48px; }
.choice-list button { background:#e8d9b5; color:#32291c; border:1px solid #a08458; }
.choice-list small { color:#59472e; }
.choice-list .build-piece { height:2.6rem; width:2.6rem; }
.choice-list button:disabled { opacity:.53; }
.notice { position:relative; z-index:7; }
@media(min-width:760px) {
  body.playing { height:100svh; overflow:hidden; }
  .playing .mast { position:absolute; top:12px; left:16px; z-index:4; width:auto; padding:0; background:none; border:0; box-shadow:none; gap:8px; }
  .playing .mast img { width:33px; height:33px; filter:drop-shadow(0 2px 3px #1d100c); }
  .playing .mast h1 { font-size:1.22rem; text-shadow:0 2px 3px #28160c; }
  .playing .mast span { font-size:.63rem; color:#ead3ad; }
  .playing #menu { position:fixed; right:16px; top:14px; }
  .playing main { max-width:none; padding:0; margin:0; }
  #table { position:relative; height:100svh; min-height:560px; }
  .table-grid { display:block; }
  .board-panel,.board-stage { position:absolute; inset:0; }
  #map { width:100%; height:100%; }
  .players { position:absolute; z-index:3; top:13px; left:50%; transform:translateX(-50%); width:36%; min-width:310px; max-width:500px; margin:0; gap:22px; }
  .turn-bar { position:absolute; top:91px; left:50%; transform:translateX(-50%); z-index:3; background:#2c211bbd; border:1px solid #ba995c70; border-radius:20px; padding:5px 17px; white-space:nowrap; min-height:28px; font-size:.76rem; }
  .controls { position:absolute; inset:auto 0 0; height:135px; display:block; padding:0; pointer-events:none; z-index:3; }
  .controls > * { pointer-events:auto; }
  #hand-area { position:absolute; left:50%; bottom:32px; transform:translateX(-50%); width:clamp(370px,38vw,560px); padding:8px 13px 8px; border:2px solid #b68b43; background:linear-gradient(#30241be8,#1b1815f5); border-radius:14px 14px 0 0; box-shadow:0 -3px 15px #27180c50; }
  #hand-area h2 { margin-bottom:5px; }
  #actions { position:absolute; right:20px; bottom:45px; width:clamp(175px,19vw,280px); }
  #placement { position:absolute; bottom:45px; right:20px; width:clamp(180px,22vw,300px); }
  .situation { position:absolute; left:20px; bottom:45px; width:22%; max-width:270px; font-size:.72rem; text-shadow:0 1px 3px #140c08; }
  .activity { position:absolute; margin:0; left:50%; bottom:0; transform:translateX(-50%); width:min(760px,80%); min-height:28px; padding:5px 12px; font-size:.75rem; text-align:center; border-bottom:0; }
  .board-tools { position:absolute; left:15px; top:40%; z-index:4; display:flex; flex-direction:column; align-items:start; gap:15px; }
  .table-tools { display:flex; flex-direction:column; gap:7px; }
  .table-tools button { width:45px; height:45px; padding:0; position:relative; background:linear-gradient(#e7b85f,#a76c2e); color:#382419; border:2px solid #38291f; box-shadow:0 0 0 1px #b88f54,inset 0 0 0 2px #f2d58c; }
  .table-tools b { font-size:23px; }
  .table-tools button span { position:absolute; left:50px; top:5px; padding:8px; width:max-content; background:#241b15ed; color:#f4dbb0; border:1px solid #b88a47; border-radius:3px; visibility:hidden; }
  .table-tools button:hover span,.table-tools button:focus-visible span { visibility:visible; }
  .camera { flex-direction:column; gap:3px; margin:0; }
  .camera button { width:36px; min-width:36px; min-height:34px; padding:2px; font-size:13px; }
  .placement-hint { top:128px; }
  .map-inspection { left:74px; top:40%; max-width:230px; background:#211c17ee; border:1px solid #ba9356; }
  dialog[data-kind='trade'] { width:min(760px,86vw); margin:auto auto 32px; }
  dialog[data-kind='utility'] { width:350px; margin:auto auto 50px 75px; max-height:65svh; }
  dialog[data-kind='build'] { width:390px; margin:auto auto 75px 75px; background:linear-gradient(#e8d9b7,#c4ad83); color:#352b1f; border-color:#765d38; }
  dialog[data-kind='build'] h2 { color:#352b1f; }
  dialog[data-kind='build'] p { font-size:.8rem; }
  .playing .notice { position:absolute; left:50%; top:125px; transform:translateX(-50%); width:max-content; max-width:70%; }
}
@media(min-width:760px) and (max-width:1100px) {
  .playing .mast h1 { font-size:1rem; }
  .playing .mast img { display:none; }
  .players { top:12px; width:43%; }
  .player .portrait { width:44px; height:44px; flex-basis:44px; }
  .player strong { font-size:.83rem; }
  .turn-bar { top:79px; }

  .cost-reference { width:170px; left:7%; bottom:145px; font-size:10px; padding:9px; }
  .cost-reference em { font-size:8px; }
  #hand-area { width:39%; min-width:335px; }
  .card .resource-art { height:46px; }
  .card span:not(.resource-art) { font-size:.55rem; }
  .situation { max-width:200px; }
  #actions { width:22%; right:14px; }
  .actions button { font-size:.75rem; padding:5px; }
}
@media(max-width:759px) {
  .mast { padding:.55rem .65rem; }
  main { padding:.55rem; }
  .players { gap:.6rem; }
  .player { padding:4px; gap:6px; }
  .player .portrait { width:39px; height:39px; flex-basis:39px; }
  .player strong { font-size:.78rem; }
  .player small { font-size:.65rem; margin-top:3px; }
  .turn-bar { padding:5px 0; font-size:.7rem; }
  #map { height:clamp(230px,43svh,430px); }

  .board-tools { display:flex; justify-content:space-between; gap:5px; padding:5px 0; }
  .table-tools { flex-wrap:nowrap; gap:4px; }
  .table-tools button { padding:4px 6px; font-size:.68rem; }
  .table-tools b { display:none; }
  .camera { gap:3px; }
  .camera button { min-width:35px; padding:4px; }
  .controls { padding:6px 0 0; gap:8px; }
  .situation { font-size:.72rem; padding:5px 8px; background:#291e18c9; border:1px solid #96774766; border-radius:3px; }
  #hand-area { grid-row:2; padding:8px 7px; background:#251c16e3; border:1px solid #a3824d; border-radius:7px; }
  .hand { gap:3px; }
  .card { padding:2px 1px; border-width:1px; }
  .card .resource-art { height:36px; border-width:1px; font-size:1.25rem; }
  .card span:not(.resource-art) { font-size:.5rem; }
  .card b { min-width:18px; height:18px; line-height:16px; top:-6px; right:-2px; font-size:.75rem; }
  #hand-area h2 { font-size:.65rem; margin-bottom:4px; }
  #actions { grid-row:3; }
  .activity { margin-top:8px; font-size:.73rem; }
  .last-dice { bottom:5px; right:4px; background:#281d16ca; padding:4px; border:1px solid #b18b51; }
  .last-dice .dice-faces { --die:1.35rem; }
  .last-dice > span { font-size:.6rem; }
  .roll-reveal { top:40%; padding:.6rem; }
  .roll-reveal .dice-faces { --die:3rem; }
  dialog { max-height:92svh; padding:.7rem; border-radius:8px 8px 0 0; }
  .trade-cards { gap:5px; }
  .trade-card .resource-art { height:45px; }
  .trade-card { font-size:.65rem; }
  fieldset { padding:6px; }
  .sheet-title h2 { font-size:1.15rem; }
}
@media(prefers-reduced-motion:no-preference) {
  button { transition:filter .15s,box-shadow .15s; }
  button:not(:disabled):hover { filter:brightness(1.12); }
  .roll-reveal:not([hidden]) { animation:dice-arrive .28s ease-out; }
  @keyframes dice-arrive { from { opacity:0; transform:translate(-50%,-45%) scale(.8); } to { opacity:1; transform:translate(-50%,-40%) scale(1); } }
}
@media(min-width:760px) {
  .playing .notice { top:auto; left:20px; bottom:88px; transform:none; max-width:22%; padding:5px 8px; font-size:.7rem; background:#2b211bd9; border:1px solid #ad884f70; }
}
.resource-art.resource-wood,.resource-art.resource-brick,.resource-art.resource-wool,.resource-art.resource-grain,.resource-art.resource-ore,.resource-art.resource-paper,.resource-art.resource-cloth,.resource-art.resource-coin { background-image:url('/art/resource-atlas.webp'); background-size:400% 200%; background-repeat:no-repeat; }
.resource-wood { background-position:0 0; }
.resource-brick { background-position:33.333% 0; }
.resource-wool { background-position:66.667% 0; }
.resource-grain { background-position:100% 0; }
.resource-ore { background-position:0 100%; }
.resource-paper { background-position:33.333% 100%; }
.resource-cloth { background-position:66.667% 100%; }
.resource-coin { background-position:100% 100%; }

@media(min-width:760px) {
  .playing .notice:not([data-receipt='true']) { top:118px; bottom:auto; left:50%; transform:translateX(-50%); max-width:70%; background:#46261ef5; border:1px solid #e0aa68; padding:10px 14px; font-size:.85rem; }
}
@media(max-width:759px) {
  .playing .notice[data-receipt='true'] { padding:4px 8px; font-size:.65rem; background:#291e18c9; margin-bottom:5px; }
}
/* Table fidelity: cast-metal tools, contribution boards and physical fleet route. */
.table-tools { display:flex; flex-direction:column; gap:5px; }
.table-tools button { position:relative; width:42px; height:42px; min-height:42px; padding:0; border:3px solid #53483c; border-radius:7px; color:#74400e; background:linear-gradient(#ffe08b,#f4b527 48%,#cb7d19); box-shadow:0 0 0 1px #221a14,inset 0 0 0 2px #ffe6a1,2px 3px 3px #26170b88; }
.table-tools b { display:block; font-size:25px; line-height:32px; }
.table-tools button span { position:absolute; left:48px; top:0; padding:9px; width:max-content; background:#241b15f5; color:#ffe8bd; border:1px solid #b88a47; visibility:hidden; z-index:10; }
.table-tools button:hover span,.table-tools button:focus-visible span { visibility:visible; }
.table-tools .unread::after {content:'';position:absolute;right:-4px;top:-3px;width:9px;height:9px;border-radius:50%;background:#70db75;}
.die-event svg { width:90%;height:90%;display:block; }
.die-event { color:#171d23; }
.event-yellow {color:#d49b12;}.event-green{color:#43862b;}.event-blue{color:#236eb3;}

.city-improvements {position:absolute;left:28%;bottom:150px;display:flex;gap:2px;padding:4px;background:#998552;border:2px solid #bca467;border-radius:2px;transform:rotate(-4deg);box-shadow:4px 6px 6px #251a1088;color:#292918;}
.improvement-column{display:grid;grid-template-columns:1fr 1fr;gap:3px;padding:5px;width:64px;background:#d4ba54;border:1px solid #8e7628;font-size:9px;}
.improvement-column.coin{background:#8db4c5;border-color:#476a89;}.improvement-column.paper{background:#a9bd62;border-color:#647f2d;}
.improvement-column .resource-art{width:30px;height:25px;grid-column:1/-1;justify-self:center;}
.improvement-column b,.improvement-column>span{grid-column:1/-1;}
.improvement-column i{height:23px;display:grid;place-items:center;font-style:normal;border:1px solid #7a683a;box-shadow:inset 1px 1px 2px #44381c66;color:#695d32;background:#fff3a91c;}.improvement-column i.invested{background:#fff1b5;color:#2b681e;font-weight:bold;}
.improvement-detail{padding:10px;margin:7px 0;border-left:7px solid #b69a30;background:#303738;}.improvement-detail.coin{border-color:#5293bf;}.improvement-detail.paper{border-color:#7fa840;}.improvement-detail .resource-art{width:40px;height:35px;float:right;}
dialog[data-kind='trade'] {background:linear-gradient(#242c35,#141a21);border:5px ridge #e3a144;padding:15px;}
dialog[data-kind='trade'] .sheet-title{justify-content:center;position:relative;border:0;}
dialog[data-kind='trade'] .sheet-title h2{background:linear-gradient(#48545b,#152027);padding:10px 26px;border:4px ridge #d99b3e;box-shadow:0 2px 3px #000;font-family:Georgia,serif;}
dialog[data-kind='trade'] #close-sheet{position:absolute;right:0;top:0;}
.trade-lane{border:0;border-top:2px solid #3e4851;border-bottom:2px solid #0a1117;border-radius:0;padding:10px;background:#242c35;}
.trade-lane legend{font:600 12px 'Segoe UI',sans-serif;color:#e6dcc3;}
.trade-cards{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:9px;}
.trade-card{position:relative;min-width:0;min-height:0;padding:4px 3px;border:3px ridge #ded5b5;}.trade-card .resource-art{height:65px;}.trade-card span:not(.resource-art){font-size:10px;}.trade-card small{font-size:10px;}
.trade-card.offered{opacity:1;transform:translateY(-5px);box-shadow:0 5px 0 #bbb795,0 7px 0 #2a3923;}
.trade-card b{position:absolute;right:2px;top:2px;background:#273222;color:#e8efc4;font-size:14px;padding:1px 3px;}
.trade-card b:empty{display:none;}
.partner-badge{border:4px ridge #b49b6d;border-radius:25px;background:#323b44;color:#b8b9b8;margin:10px 6px 0 0;}.partner-badge.accepted{background:#387d43;color:#fff;opacity:1;}.partner-badge[aria-pressed='true']{outline:3px solid #ffcf59;outline-offset:2px;}
.confirm-exchange{background:linear-gradient(#82c982,#2d8041);color:#fff;border:3px ridge #b0b899;}
.receipt-card{width:63px;height:85px;padding:5px;background:#afa16b;border:3px ridge #e4d7b4;position:relative;z-index:2;box-shadow:3px 5px 4px #0008;}.receipt-card .resource-art{width:100%;height:57px;}.receipt-card b{color:#1e281b;}
@media(min-width:760px){.board-tools{top:38%;gap:7px;}.camera{position:fixed;left:16px;bottom:15px;flex-direction:row;}.cost-reference{left:8%;bottom:145px;width:170px;} .city-improvements{left:29%;bottom:152px;}}
@media(min-width:760px) and (max-height:750px){.table-tools{gap:3px;}.table-tools button{height:36px;min-height:36px;width:36px;}.board-tools{top:31%;}.city-improvements{bottom:150px;left:30%;}.improvement-column{width:51px;font-size:8px;}}
@media(max-width:759px){.board-panel{position:relative;padding-left:42px;}.board-tools{position:static;padding:0;}.table-tools{position:absolute;left:0;top:0;gap:3px;z-index:3;}.table-tools button{width:34px;height:34px;min-height:34px;}.table-tools b{font-size:20px;line-height:25px;}.camera{margin:4px 0 4px auto;}.city-improvements{left:auto;right:2px;bottom:45px;transform:rotate(3deg) scale(.7);transform-origin:right bottom;}.improvement-column{width:42px;font-size:8px;padding:3px;}.improvement-column .resource-art{height:18px;}.improvement-column i{height:15px;}.trade-cards{gap:3px;}.trade-card{border-width:1px;padding:2px 1px;}.trade-card .resource-art{height:42px;border-width:1px;}.trade-card span:not(.resource-art){font-size:8px;}.trade-card small{font-size:8px;}.trade-lane{padding:7px 2px;}.trade-lane legend{font-size:11px;}dialog[data-kind='trade']{padding:7px;width:calc(100vw - 12px);max-width:none;}.trade-tile{min-width:0;}.trade-tile .remove-card{min-height:25px;padding:0;}.trade-summary{font-size:12px;}.receipt-card{width:40px;height:66px;}.receipt-card .resource-art{height:40px;}}
.table-tools svg{width:25px;height:25px;vertical-align:middle;}
.trade-footer{display:flex;align-items:center;justify-content:flex-end;gap:9px;padding:8px 0 0;flex-wrap:wrap;}
.trade-footer .partner-badge{margin:0 auto 0 0;width:auto;min-width:150px;}
.trade-footer button{min-height:43px;width:auto;padding:8px 14px;font-size:12px;}
.trade-summary{margin:8px 0 10px;text-align:center;}
@media(min-width:760px){.cost-reference{bottom:155px;}.situation{bottom:88px;}.playing .notice[data-receipt='true']{bottom:124px;}}
@media(min-width:760px) and (max-width:1100px){.cost-reference{bottom:157px;width:158px;}.city-improvements{left:28%;bottom:151px;}}
@media(max-width:759px){.table-tools svg{width:21px;height:21px;}.trade-footer{gap:5px;}.trade-footer button{font-size:11px;padding:6px;}.trade-footer .partner-badge{min-width:110px;}.trade-card.offered{transform:translateY(-2px);}}
/* Second reference comparison: portrait tabs, card palettes and a sea-tile approach. */
.trade-lane{position:relative;margin-left:38px;}
.trade-seat-tab{position:absolute;left:-57px;top:22px;width:49px;display:grid;justify-items:center;color:#fff1cf;}
.trade-seat-tab .portrait{width:49px;height:49px;border:3px ridge #e4b35d;border-radius:6px;background-color:#343229;box-shadow:2px 3px 3px #0008;}
.trade-seat-tab small{background:linear-gradient(#b98037,#673d1a);border:1px solid #d4b06c;border-radius:3px;font-size:9px;width:59px;text-align:center;padding:2px;}
.trade-card.wood,.receipt-card.wood{background:linear-gradient(135deg,#a9bf58,#52702d);border-color:#c9d591;}
.trade-card.brick,.receipt-card.brick{background:linear-gradient(135deg,#dba36a,#a85c35);border-color:#e3b781;}
.trade-card.wool,.receipt-card.wool{background:linear-gradient(135deg,#b5ce67,#629336);border-color:#d0dd98;}
.trade-card.grain,.receipt-card.grain{background:linear-gradient(135deg,#f5cf56,#bb8f20);border-color:#f8dc8c;}
.trade-card.ore,.receipt-card.ore{background:linear-gradient(135deg,#bdbeba,#696e79);border-color:#e2ded2;}
.trade-card.paper,.receipt-card.paper{background:linear-gradient(135deg,#b9c77c,#6d863a);border-color:#d5dca0;}
.trade-card.cloth,.receipt-card.cloth{background:linear-gradient(135deg,#e5cc68,#9c8b34);border-color:#eee0a3;}
.trade-card.coin,.receipt-card.coin{background:linear-gradient(135deg,#b4bdc4,#677f95);border-color:#d6dfe3;}
.trade-card:disabled{opacity:.72;}.trade-card.offered{opacity:1;}.trade-card .resource-art{border-color:#eadb9c;}
.city-improvements{-webkit-tap-highlight-color:transparent;}

.situation:empty{display:none;}
.exchange-overlay{position:fixed;inset:0;z-index:100;pointer-events:none;}
.flight-card{position:absolute;top:0;left:0;margin:0;}
.exchange-caption{position:absolute;left:50%;top:48%;transform:translate(-50%,-50%);padding:12px 22px;background:#1f2931e8;border:3px ridge #d5a24f;border-radius:4px;color:#ffe5af;box-shadow:0 5px 15px #0007;text-align:center;}
@media(max-width:759px){.trade-lane{margin-left:27px;}.trade-seat-tab{left:-35px;top:20px;width:30px;}.trade-seat-tab .portrait{width:30px;height:35px;border-width:2px;}.trade-seat-tab small{width:35px;font-size:7px;padding:1px;}.trade-card .resource-art{height:36px;}.trade-card span:not(.resource-art){font-size:7px;}.exchange-caption{font-size:12px;max-width:75%;}.situation{background:none;border:0;padding:0;}}
/* Furniture yields to legal placement targets; live receipts never obscure the tool rail. */
.placing .city-improvements,.placing .cost-reference{visibility:hidden;pointer-events:none;}

.card-dock {
  display: flex;
  gap: .4rem;
  justify-content: center;
}
.card-dock button { min-height: 44px; font-size: .78rem; }
.card-dock .quiet { background: #2b211be8; border-color: #b58e4e; }
.card-library-tabs { display: flex; gap: .5rem; }
.collectible-section { display: grid; gap: .55rem; }
.collectible-section h3 { color: #ecd5a6; }
.collectible-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: .55rem;
}
.collectible-button { position: relative; padding: 0; color: #fff5d9; text-align: center; }
.collectible-face {
  --ink: #5a4532;
  --frame: #ccab6c;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  overflow: hidden;
  padding: .26rem;
  border: 2px solid var(--frame);
  border-radius: 5px;
  background: linear-gradient(160deg, var(--ink), #242021 90%);
  box-shadow: inset 0 0 0 1px #f8ecd56b, 0 4px 8px #0005;
  color: #fff6df;
}
.collectible-face.science, .card-motion.science { --ink: #516037; --frame: #a0ba72; }
.collectible-face.trade, .card-motion.trade { --ink: #74531f; --frame: #d7ba63; }
.collectible-face.politics, .card-motion.politics { --ink: #27475c; --frame: #82acc1; }
.card-painting {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--frame);
  border-radius: 2px;
}
.collectible-track {
  margin-top: .25rem;
  color: #f5daa2;
  font: 600 .66rem system-ui, sans-serif;
  letter-spacing: .045em;
}
.collectible-face strong { padding: .1rem; font: bold clamp(.7rem, 1.55vw, .88rem) Georgia, serif; line-height: 1.15; }
.collectible-section .collectible-track { display: none; }
.collectible-section .collectible-face strong { margin: .3rem 0 .15rem; }
.card-copies {
  position: absolute;
  top: .3rem;
  right: .3rem;
  padding: .16rem .32rem;
  border: 1px solid #f7cf73;
  border-radius: .25rem;
  background: #241b16;
  color: #ffebba;
  font: bold .75rem system-ui, sans-serif;
}
.collectible-reading {
  display: grid;
  grid-template-columns: minmax(100px, 36%) minmax(0, 1fr);
  align-items: start;
  gap: clamp(.7rem, 3vw, 1.5rem);
}
.collectible-copy { display: grid; gap: .7rem; padding-top: .25rem; line-height: 1.45; }
.collectible-copy small { color: #e5c891; }
.card-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: .6rem; }
.card-bundle { min-width: 0; }
.card-bundle-grid { display: grid; gap: .3rem; }
.card-bundle-row {
  display: grid;
  grid-template-columns: 2rem 1fr 44px 1.5rem 44px;
  align-items: center;
  gap: .25rem;
}
.card-bundle-row button { min-width: 44px; min-height: 44px; padding: 0; }
.card-bundle-row output { text-align: center; }
.card-bundle-row .resource-art { height: 2rem; }
.card-bundle-count { margin: .2rem 0; color: #f4d7a5; }
.improvement-threshold { grid-column: 2 / -1; color: #f2d8a7; }
.improvement-ability { display: block; grid-column: 2 / -1; color: #fff0c9; margin-top: .3rem; }
.card-motions {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
}
.card-motion-caption { top: auto; bottom: clamp(4rem, 24vh, 15rem); }
.card-motion {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  width: 66px;
  min-height: 72px;
  border: 2px solid var(--frame, #d6b879);
  border-radius: 6px;
  background: linear-gradient(140deg, var(--ink, #5a4435), #242024);
  color: #fff0c7;
  box-shadow: 0 5px 16px #000a;
}
.card-motion .resource-art { height: 48px; width: 48px; }
.card-motion small { margin: .1rem 0; font: 600 .7rem system-ui, sans-serif; }
.card-motion .collectible-face { padding: .12rem; border: 0; border-radius: 3px; }
.card-motion .collectible-face strong { font-size: .62rem; }
.card-motion .collectible-track { display: none; }
.card-motion .card-back { font-size: 2rem; color: #ebcf87; }
.card-motion .card-copies { top: -.4rem; right: -.4rem; }
@media (min-width: 760px) {
  .card-dock { position: absolute; bottom: calc(100% + 6px); left: 50%; width: max-content; transform: translateX(-50%); }
  dialog[data-kind^='card-'] { width: min(620px, 92vw); }
}
@media (max-width: 759px) {
  .hand-heading { display: flex; align-items: center; justify-content: space-between; gap: .35rem; }
  .card-dock { justify-content: end; }
  .card-dock button { padding: .35rem .45rem; font-size: .7rem; }
  .collectible-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-motion-caption { padding: .45rem .6rem; width: max-content; max-width: 85vw; }
}
@media (max-width: 759px) and (max-height: 640px) {
  #map { height: max(195px, 36svh); }
  #table { padding-bottom: calc(8rem + env(safe-area-inset-bottom)); }
  #actions, #placement {
    position: fixed;
    z-index: 6;
    inset: auto .35rem calc(.35rem + env(safe-area-inset-bottom));
    padding: .35rem;
    border: 1px solid #b58e4e;
    border-radius: .45rem;
    background: #271e18f7;
    box-shadow: 0 -.15rem .75rem #20150eb8;
  }
}

.harbour { display: grid; gap: clamp(.65rem, 2vw, 1.35rem); margin: .4rem auto 2rem; }
.harbour-hero {
  min-height: clamp(16rem, 31vw, 26rem);
  display: flex;
  align-items: end;
  padding: clamp(1.1rem, 4.5vw, 3.4rem);
  border: 1px solid #b99154;
  border-radius: .55rem;
  overflow: hidden;
  background: linear-gradient(90deg, #101c24ed, #1527345e 59%, #13232a30),
    linear-gradient(to top, #151e25dd, transparent 66%), url('/art/home-isles.webp') center 55% / cover #233541;
  box-shadow: 0 .6rem 1.4rem #160d0a80, inset 0 0 0 .24rem #e8c38428;
}
.harbour-hero h2 {
  font: 600 clamp(2.3rem, 6vw, 4.65rem)/.96 'Instrument Serif', Georgia, serif;
  text-shadow: 0 .2rem .6rem #0b151b;
  color: #fff0cd;
}
.harbour-hero p { margin: .6rem 0 .9rem; color: #f5e2bd; max-width: 31rem; }
.harbour-hero .secondary { background: #162b33e8; }
.harbour-hero-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.account-form .form-error { color: #ffb4a8; margin: 0; }
.account-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .4rem; margin: 0; }
.account-stats dt { font-size: .75rem; color: var(--muted); }
.account-stats dd { margin: 0; font: 700 1.25rem Georgia, serif; }
.account-games { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.account-games li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .1rem .6rem; padding: .45rem .6rem; border-radius: .4rem; background: #ffffff0d; }
.account-games li small { grid-column: 1; color: var(--muted); }
.account-games li button { grid-column: 2; grid-row: 1 / span 2; }
.audio-toggle { display: flex; gap: .6rem; align-items: center; min-height: 44px; }
.audio-toggle input { width: 1.25rem; height: 1.25rem; accent-color: #e1b15f; }
.harbour-content { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(19rem, .78fr); gap: clamp(.65rem, 2vw, 1.35rem); align-items: start; }
.voyages { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.voyage {
  position: relative;
  display: grid;
  justify-items: start;
  align-items: end;
  min-height: clamp(9rem, 14vw, 13rem);
  padding: .9rem;
  text-align: start;
  color: #fff0cd;
  border: 1px solid #a38153;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 .18rem #edbf752b, 0 .3rem .7rem #180e0a80;
}
.voyage-progress { background-image: linear-gradient(transparent 7%, #17222535 35%, #18211df9 87%), url('/art/cards/merchant-fleet.webp'); }
.voyage-classic { background-image: linear-gradient(transparent 5%, #20231e52 36%, #252019f8 87%), url('/art/cards/classic-road-building.webp'); }
.voyage-conquest { background-image: linear-gradient(transparent 5%, #201b1750 40%, #191e20fa 91%), url('/art/home-conquest.webp'); }
.voyage-workshop {
  background-image: linear-gradient(transparent 5%, #151e1b44 32%, #211a15f4 90%), url('/art/home-workshop.webp');
}
.voyage[aria-pressed='true'] { border-color: #ffcf78; box-shadow: inset 0 0 0 .18rem #efb85f75, 0 .3rem .7rem #180e0aa0; }
.voyage strong { display: block; font: 600 clamp(1.22rem, 2.5vw, 2rem)/1.05 Georgia, serif; }
.voyage small { display: block; margin-top: .35rem; font-size: .78rem; color: #f9dfb6; }
.harbour-entry { display: grid; gap: .7rem; padding: clamp(.8rem, 2vw, 1.25rem); }
.harbour-entry h2 { font: 600 1.45rem Georgia, serif; }
.harbour-entry form, .workshop-form { display: grid; gap: .65rem; }
.harbour-entry #select-character { justify-self: start; }
.table-settings-row label { min-width: 0; }
#join-fields { border-top: 1px solid #ad83567e; padding-top: .75rem; display: grid; gap: .5rem; }
.scenario-entry { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.scenario-entry p { color: #f8dba9; font-weight: 600; }
.table-options { display: grid; gap: .55rem; border: 1px solid #ad83567e; border-radius: .35rem; padding: .45rem .65rem; }
.table-options[open] { padding-bottom: .7rem; }
.table-options summary { -webkit-tap-highlight-color: transparent; cursor: pointer; color: #f8dba9; font-weight: 600; }
.table-options .check-row { display: flex; align-items: flex-start; gap: .5rem; }
.table-options .check-row input { width: auto; margin-top: .15rem; }
.table-options #table-options-note { color: #f8dba9; }
.workshop-seed { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
.workshop-status { color: #f5cd8e; min-height: 1.2rem; }
dialog[data-kind='workshop'][open] { display: flex; flex-direction: column; height: min(90svh, 58rem); overflow: hidden; }
dialog[data-kind='workshop'] > .sheet-title, .workshop-footer { flex: 0 0 auto; }
dialog[data-kind='workshop'] #sheet-body { min-height: 0; overflow-y: auto; display: block; padding-right: .2rem; }
dialog[data-kind='workshop'] #sheet-body > p { margin: 0 0 .6rem; }
.workshop-footer { padding-top: .7rem; margin-top: .6rem; border-top: 1px solid #ac91635c; }
.workshop-footer button { min-width: 0; }
.workshop-rules { padding: .7rem; border-left: 3px solid #d6ae6d; background: #211d1980; line-height: 1.5; }
.workshop-fog { grid-column: 1 / -1; border: 1px solid #92734c; border-radius: .4rem; padding: .7rem; }
.workshop-fog summary { cursor: pointer; min-height: 2rem; font-weight: 700; }
.workshop-fog p { font-size: .88rem; line-height: 1.5; margin: .5rem 0; }
.fog-hex-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: .35rem; max-height: 15rem; overflow-y: auto; }
.fog-hex-list label { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .3rem; background: #192a3280; border-radius: .25rem; }
.fog-hex-list input { width: 1.25rem; height: 1.25rem; margin: 0; }
.workshop-preview {
  grid-row: 2;
  margin: 0;
  min-width: 0;
  background: linear-gradient(143deg, #213840, #192a32 70%);
  border: 1px solid #92734c;
  border-radius: .4rem;
  overflow: hidden;
}
.workshop-preview canvas { display: block; width: 100%; height: clamp(10rem, 33vw, 19rem); }
.workshop-preview > button { margin: .5rem .65rem 0; width: calc(100% - 1.3rem); }
.workshop-paint-help { margin: .5rem .65rem; color: #f4d9a6; font-size: .78rem; line-height: 1.4; }
.workshop-preview.painting-fog { border-color: #ffe29b; }
.workshop-preview.painting-fog canvas { cursor: crosshair; }
.workshop-preview button[aria-pressed='true'] { background: #d3a75d; color: #211b13; }
.workshop-preview figcaption {
  color: #f4d9a6;
  font-size: .78rem;
  padding: .5rem .65rem;
  border-top: 1px solid #806748;
  background: #17252b;
  text-align: center;
}
.lobby-seats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; list-style: none; padding: 0; }
.lobby-seats li {
  display: grid;
  justify-items: center;
  gap: .2rem;
  padding: .35rem;
  background: #231d1a;
  border: 1px solid var(--seat-ink, #795b3b);
  border-radius: .35rem;
  overflow-wrap: anywhere;
}
.lobby-seats small { color: #e9cc9e; }
dialog[data-kind='character'] { width: min(43rem, 100%); }
.character-filters { display: flex; gap: .4rem; }
.character-filters button[aria-pressed='true'] { background: #9d7338; color: #fff4d5; border-color: #f2c983; }
.character-choices { grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); align-items: stretch; }
.character-option { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.frame-lapis { --frame: #87afe5; }
.frame-walnut { --frame: #cf9971; }
.seat-0 { --seat-ink: #ef8a7e; }.seat-1 { --seat-ink: #8fb0f0; }
.seat-2 { --seat-ink: #f4efe4; }.seat-3 { --seat-ink: #f6c95a; }
.seat-4 { --seat-ink: #b9b6c4; }.seat-5 { --seat-ink: #8fd3f2; }
.player { position: relative; }
.players .player.active { border-color: var(--seat-ink); box-shadow: 0 0 0 1px var(--seat-ink), 0 .2rem .8rem #21130d; }
.table-six .players .player .portrait { border-color: var(--seat-ink); }
.table-six .player-caption { min-width: 0; }
.route-badge { position: absolute; right: .25rem; top: .12rem; color: #fff1b9; text-shadow: 0 1px 2px #25140b; }
.choice-list .build-reason { grid-column: 2 / -1; font-size: .72rem; line-height: 1.3; opacity: 1; }
.paired-turn { color: #f4d099; font-size: .72rem; width: 100%; text-align: center; }
.table-prop { position: absolute; z-index: 1; pointer-events: none; object-fit: contain; height: auto; }
.table-candles { top: 10%; left: 8%; width: clamp(6.3rem, 14vw, 13rem); filter: drop-shadow(10px 14px 6px #20110799); transform: rotate(-8deg); }
.table-tankard { top: 28%; right: 7%; width: clamp(5.5rem, 12vw, 11rem); filter: drop-shadow(13px 16px 9px #1f110ad9); transform: rotate(16deg); }
.table-tools button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 2px solid #2c2018;
  border-radius: .48rem;
  color: #452713;
  background: linear-gradient(145deg, #ffe9af 3%, #e2ad5b 37%, #ad7239 78%, #7a451e 100%);
  box-shadow: inset 0 0 0 1px #f9d18c, inset 0 0 0 3px #bc8549, inset 0 -.2rem .4rem #64361988,
    0 0 0 1px #ad7e49, 0 .22rem .35rem #26160cbc;
}
.table-tools b { line-height: 1; }
.table-tools b svg { width: 25px; height: 25px; display: block; filter: drop-shadow(0 .65px .05px #ffedb4); }
.rail-shape, .rail-detail { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linejoin: round; stroke-linecap: round; }
.rail-detail { stroke: #795020; stroke-width: 1.5; }
.table-tools button:hover, .table-tools button:focus-visible { color: #35210f; box-shadow: inset 0 0 0 2px #ffdda1, 0 0 0 2px #e7b963, 0 .2rem .5rem #26160c; }
@media (min-width: 760px) {
  dialog[data-kind='workshop'] { width: min(72rem, 96vw); }
  .workshop-form { grid-template-columns: minmax(0, 1.6fr) minmax(15rem, .8fr); align-items: start; }
  .workshop-map { grid-column: 1; }
  .workshop-settings { grid-column: 2; position: sticky; top: 0; }
  .table-six .players {
    width: clamp(30rem, 55vw, 55rem);
    translate: 5% 0;
    max-width: none;
    grid-template-columns: repeat(var(--seat-count, 6), minmax(0, 1fr));
    gap: .3rem;
  }
  .table-six .players .player { min-width: 0; padding: .22rem; gap: .2rem; }
  .table-six .players .portrait { width: 34px; height: 39px; }
  .table-six .player strong { max-width: 7rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .72rem; }
  .table-six .turn-bar { display: flex; flex-wrap: wrap; justify-content: center; }
  .map-wide .table-candles { top: 12%; left: 5%; width: clamp(5rem, 10vw, 9.6rem); }
  .map-wide .table-tankard { top: 21%; right: 3%; width: clamp(4.7rem, 9vw, 8.5rem); }

  .map-wide .city-improvements { left: auto; right: 3%; transform: rotate(4deg); }
}
@media (min-width: 760px) and (max-width: 1020px) {
  .table-six .players { top: 56px; width: min(95%, 45rem); translate: none; }
  .table-six .turn-bar { top: 115px; }
  .table-candles { top: 16%; left: 6%; }
  .table-tankard { width: 13vw; }

}
@media (max-width: 759px) {
  .harbour-content { grid-template-columns: 1fr; }
  .harbour-hero { background-position: center, center, 58% 50%; }
  .table-candles { top: 1%; left: auto; right: 1%; width: clamp(2.8rem, 13vw, 4.1rem); }
  .table-tankard { display: none; }
  .table-six .players { grid-template-columns: repeat(var(--seat-columns, 3), minmax(0, 1fr)); gap: .3rem; }
  .table-six .players .player { min-width: 0; min-height: 44px; gap: .3rem; padding: .25rem; }
  .table-six .players .portrait { width: 29px; height: 34px; }
  .table-six .player strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .64rem; }
  .table-six .self-seat { display: none; }
  .table-six .player small { font-size: .53rem; }
  .table-six .turn-bar { flex-wrap: wrap; justify-content: center; }
}
@media(min-width:760px){.playing .notice[data-receipt='true']{left:75px;bottom:105px;max-width:180px;}}
@media (max-width: 759px) {

  .table-six .city-improvements {
    top: calc(100% + 4px); bottom: auto; left: 5px; right: auto; transform: none;
    height: 44px; padding: .28rem .45rem; color: #f7e4b7; background: #281d17ed;
    border: 1px solid #b48b52; border-radius: .32rem; font-size: .68rem; align-items: center;
  }
  .table-six .city-improvements::before { content: 'City improvements'; }
  .table-six .city-improvements .improvement-column { display: none; }
  .table-six .table-candles { top: 26px; }
}
@media (max-width: 359px) {
  .table-six .table-candles { display: none; }
}
@media (max-width: 759px) {
  .map-wide #map { height: clamp(220px, 41svh, 460px); }
}
@media (max-width: 759px) and (max-height: 640px) {
  .map-wide #map { height: max(215px, 38svh); }
}

/* Finished table components: warm brass edges, dark walnut recesses, ivory stock.
   Geometry and responsive placement stay with the existing table layout. */
.playing .player {
  background: linear-gradient(140deg, #574735, #302b23 55%, #211e1a);
  border-color: #a48a5e;
  box-shadow: inset 0 1px #edcf9166, inset 0 -2px #120f0bbb, 0 3px 7px #140c0a88;
}
.playing .players .player.active {
  background: linear-gradient(135deg, #6b5031, #3b3023 60%, #27221a);
  box-shadow: inset 0 1px #ffe1a3b0, inset 0 -2px #130e0bbb, 0 0 0 1px var(--seat-ink), 0 4px 9px #160e0abb;
}
.playing .portrait { box-shadow: inset 0 0 0 1px #fff0bf66, 0 2px 4px #120e0bc0; }
.playing #hand-area {
  background: linear-gradient(145deg, #4c3a2bf5, #29231df7 55%, #171713fa);
  border-color: #b49a68;
  box-shadow: inset 0 1px #f3d79b80, inset 0 0 0 3px #1d181780, 0 6px 18px #100b09aa;
}
.playing .card {
  background: linear-gradient(135deg, #f5e8bc, #c8b783 70%, #a68e5a);
  border-color: #e2cd96;
  box-shadow: inset 0 0 0 1px #7c6945, inset 0 2px #fff4ce, 0 2px 0 #705737, 0 5px 7px #100c0a90;
}
.playing .card .resource-art { border-radius: .28rem; border-color: #796a43; }
.playing .card b {
  background: linear-gradient(145deg, #4a4030, #211e19);
  border-color: #ecd59b;
  box-shadow: inset 0 1px #fff0c14d, 0 2px 3px #140e0c99;
}
.playing .card.empty { filter: saturate(.36); opacity: .76; }
.playing .turn-bar {
  background: linear-gradient(140deg, #30251dea, #201c18df);
  border: 1px solid #b69a615c;
  box-shadow: inset 0 1px #e0bd6c1f, 0 3px 9px #170e0933;
}
dialog {
  background: radial-gradient(ellipse at top left, #46504b, #232d2d 60%, #1b2425);
  border-color: #c9ac73;
  box-shadow: 0 18px 65px #100c0bbd, inset 0 0 0 1px #f8e2a7, inset 0 0 0 4px #4f4030;
}
dialog::backdrop { background: #100e0c66; }
dialog .sheet-title { border-bottom-color: #ac91635c; padding-bottom: .7rem; }
dialog input, dialog select { background-color: #152224; border-color: #9a855260; box-shadow: inset 0 2px 4px #10191680; }
.playing .camera button, .playing .card-dock button, .playing #menu {
  background: linear-gradient(#44483e, #252b27);
  border-color: #b49a68;
  box-shadow: inset 0 1px #e3d3a544, 0 2px 3px #170f0b88;
}

/* Keep placement guidance with its chooser, clear of the turn banner. */
#placement .placement-hint {
  position: static; transform: none; width: auto; max-width: none;
  margin: 0 0 .5rem; padding: 0 0 .5rem; border: 0;
  border-bottom: 1px solid #b69a615c; border-radius: 0; background: none;
  font-size: .78rem; line-height: 1.4;
}
@media (min-width: 760px) {
  .placing .last-dice { top: 78px; bottom: auto; right: 20px; }
}
@media (min-width: 760px) and (max-width: 1020px) {
  .placing .last-dice { top: 180px; }
}

.table-description {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.portrait-face { display: block; width: 100%; height: 100%; }
.players .player .portrait {
  width: clamp(32px, 4.1vw, 52px);
  height: auto;
  aspect-ratio: 1;
  flex: 0 0 auto;
}
.table-six .players .player .portrait { width: clamp(26px, 3vw, 41px); }
.players .portrait-face { border-radius: 50%; overflow: hidden; }
.players .portrait-face img {
  border-radius: 0;
  transform: translate(var(--portrait-x, 0%), var(--portrait-y, 21%)) scale(1.26);
}
.portrait-face:is([data-character="mara"], [data-character="fox"]) { --portrait-x: -15%; }
.portrait-face:is([data-character="otter"], [data-character="turtle"]) { --portrait-x: -10%; }
.portrait-face:is([data-character="healer"], [data-character="raven"]) { --portrait-x: -10%; --portrait-y: 14%; }
.portrait-face:is([data-character="corsair"], [data-character="mapmaker"], [data-character="lynx"]) { --portrait-x: -7%; }
.portrait-face:is([data-character="navigator"], [data-character="puffin"], [data-character="potter"]) { --portrait-x: 5%; --portrait-y: 15%; }
.portrait-face:is([data-character="hare"], [data-character="seal"]) { --portrait-y: 2%; }
.players .portrait .crest { width: .85rem; height: .85rem; right: -.17rem; bottom: -.1rem; font-size: .53rem; }

.table-supplies { display: grid; gap: 4px; }
/* Unbuilt pieces lie loose on the table beside each seat, like a real game in progress. */
.piece-reserve {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: #fff0cc;
}
.reserve-plaque {
  justify-self: start;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  padding: 1px 8px;
  font: 700 .68rem/1.35 system-ui;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #20160f;
  background: var(--seat-ink);
  border: 1px solid #1c120c;
  border-radius: 999px;
  box-shadow: 0 2px 4px #1e130e90;
}
/* Each seat's reserve mat: fixed slots in neat rows, so pieces never wrap or jitter.
   --u is one slot unit; every slot size derives from it. */
.piece-reserve { --u: clamp(9px, .85vw, 12.5px); justify-items: start; }
.piece-reserve.mine { --u: clamp(10px, 1vw, 14.5px); }
.reserve-mat {
  display: grid;
  gap: calc(var(--u) * .3);
  padding: calc(var(--u) * .45) calc(var(--u) * .55) calc(var(--u) * .35);
  /* No box: the pieces lie straight on the table in front of their owner. */
  background: none;
  border: 0;
}
.reserve-line { display: flex; align-items: flex-end; gap: calc(var(--u) * .6); }
.reserve-group { display: flex; align-items: flex-end; }
.reserve-slot { position: relative; display: grid; place-items: end center; flex: none; }
.reserve-slot.empty::after {
  content: '';
  position: absolute;
  left: 18%; right: 18%; bottom: 1px;
  height: calc(var(--u) * .32);
  border-radius: 50%;
  background: #00000026;
}
.reserve-city .reserve-slot { width: calc(var(--u) * 2); height: calc(var(--u) * 2); }
.reserve-settlement .reserve-slot { width: calc(var(--u) * 1.6); height: calc(var(--u) * 2); }
.reserve-road .reserve-slot { width: calc(var(--u) * .75); height: calc(var(--u) * 1.7); }
.reserve-ship .reserve-slot { width: calc(var(--u) * 1); height: calc(var(--u) * 1.45); }
.reserve-piece { display: block; filter: drop-shadow(2px 2px 1.5px #0a0604a0); }
img.reserve-piece { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.reserve-ship img.reserve-piece { left: -30%; width: 160%; }
.reserve-stick {
  width: calc(var(--u) * .42);
  height: calc(var(--u) * 1.45);
  border-radius: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--piece) 55%, #fff) 0 22%, var(--piece) 22% 70%, color-mix(in srgb, var(--piece) 55%, #000) 70%);
  box-shadow: 0 0 0 1px #120f0e, 1px 2px 1px #1a100a99;
}
.seat-0 { --piece: #c8372d; } .seat-1 { --piece: #2a54b0; } .seat-2 { --piece: #ece6d8; }
.seat-3 { --piece: #f0b323; } .seat-4 { --piece: #2b2a30; } .seat-5 { --piece: #4bb0e0; }
/* Every player card carries a solid band of that seat's piece colour, so who is who
   reads at a glance even when the hues are hard to tell apart. */
.players .player { position: relative; overflow: hidden; border-left: 7px solid var(--piece) !important; }
.players .player::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--piece) 38%, transparent), transparent 70%); pointer-events: none; }
.players .player > * { position: relative; }
.entry .entry-seat { width: .8rem; height: .8rem; margin-top: .2rem; border-radius: 3px; background: var(--piece); box-shadow: 0 0 0 1px #000a, inset 0 1px #fff5; }
.entry-roll { background: #1d2a2e; font-weight: 600; }

/* Cards held beside the seat: your faces, everyone else's backs. */
.table-cards {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  min-height: 0;
  height: clamp(34px, 3.6vw, 48px);
  margin: 2px 0 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.table-card {
  width: clamp(20px, 2.2vw, 30px);
  aspect-ratio: 2 / 3;
  margin: 0 -6px;
  border-radius: 3px;
  border: 1px solid #e6c578;
  background: #183247 url('/art/card-back.webp') center / cover;
  box-shadow: 1px 2px 3px #120a06aa;
  transform: rotate(calc(var(--fan) * 7deg)) translateY(calc(var(--fan) * var(--fan) * 1.2px));
  transform-origin: 50% 120%;
  overflow: hidden;
}
.table-card.face { background: #f3e2b8; }
.table-card.face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mine .table-cards:hover .table-card { translate: 0 -3px; }
.table-card-more { position: absolute; right: 0; bottom: 0; font: 800 .62rem/1 system-ui; color: #fff2cc; background: #1d1510d0; padding: 2px 3px; border-radius: 3px; }
.camera-panel {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: calc(100% + 6px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  width: min(18rem, calc(100vw - 24px));
  padding: .5rem;
  color: #fff3d4;
  background: #251d1a;
  border: 1px solid #bb9359;
  border-radius: .45rem;
  box-shadow: 0 5px 16px #0008;
}
.camera .camera-panel button { width: auto; min-height: 44px; }
.camera-panel small, #orbit-mode { grid-column: 1 / -1; }
.camera-panel small { padding: 0 .2rem .2rem; }
#camera-options.orbit-on, #orbit-mode[aria-pressed="true"] { background: #e8c88d; color: #2e2017; }
#map.orbit-drag, #map.orbit-drag:active { cursor: move; }
.trade-tabs-open { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.market-picker:not(.seat-trade-lane) { margin-inline-start: 0; }
.market-replies { list-style: none; display: grid; gap: .45rem; padding: 0; }
.market-reply {
  display: grid;
  grid-template-columns: minmax(5.5rem, 1fr) minmax(6rem, 1fr) 44px;
  gap: .45rem;
  align-items: center;
  padding: .45rem;
  border: 1px solid #8e775166;
  border-inline-start: 3px solid var(--seat-ink);
  border-radius: .25rem;
  background: #242c32;
}
.market-name { display: flex; align-items: center; gap: .4rem; overflow-wrap: anywhere; }
.market-name .portrait { width: 2.05rem; height: 2.05rem; flex: 0 0 auto; }
.market-terms { display: grid; gap: .2rem; padding: .35rem; font-size: .86rem; background: #131c21; border-radius: .25rem; }
.market-reply :is(.market-terms, .duo, .duo + small) { grid-column: 1 / -1; }
.market-reply button { margin: 0; }
.market-response {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 40px;
  color: #e9e1cf;
  font: 800 1.15rem/1 system-ui;
}
.market-accepted { color: #efffe9; background: #226545; border-color: #8bcf9f; }
.market-accepted[aria-expanded="true"] { outline: 2px solid #ffe6ab; }
.market-passed { color: #f4b5a3; }
.bank-rate { display: block; margin-top: .2rem; color: #2b2115; font-size: .83rem; }
.player.rival-against-you .player-caption::after {
  content: 'Rival';
  display: inline-block;
  margin-top: .15rem;
  color: #ffe3c8;
  background: #763b33;
  border-radius: .2rem;
  padding: .1rem .25rem;
  font: 700 .56rem/1 system-ui;
}
.rivalry-note { grid-column: 1 / -1; color: #ffd8b7; }
.hand .card .hand-change {
  position: absolute;
  z-index: 1;
  right: -.2rem;
  bottom: 55%;
  min-width: 1.1rem;
  padding: .18rem .25rem;
  border: 1px solid #eed9a1;
  border-radius: .35rem;
  color: #fff5d2;
  background: #253d2b;
  font: 750 .72rem/1 system-ui;
  text-align: center;
  pointer-events: none;
  animation: hand-change 1s both;
}
.hand .card .hand-spend { background: #542e30; }
@keyframes hand-change {
  0% { opacity: 0; transform: translateY(5px); }
  18%, 70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) { .hand .card .hand-change { display: none; } }
@media (min-width: 760px) {
  .table-supplies {
    position: absolute;
    z-index: 2;
    width: clamp(120px, 13vw, 190px);
    top: 17%;
    gap: clamp(6px, 1.6vh, 18px);
  }
  .table-supplies { width: auto; }
  .supplies-near { left: 6%; top: 31%; display: flex; flex-direction: column-reverse; align-items: flex-start; }
  .supplies-far { right: 2%; align-items: end; }
  .supplies-far .piece-reserve { justify-items: end; }
  /* Your own mat sits at the near edge, just left of your hand. */
  .supplies-own { top: auto; bottom: 34px; right: calc(50% + clamp(185px, 19vw, 280px) + 14px); }
}
@media (min-width: 760px) and (max-width: 1099px) {
  .supplies-near { top: 15%; }
  .supplies-far { top: 13.5%; gap: 6px; }
  .supplies-own { left: 70px; right: auto; bottom: 152px; }
  .camera-panel { left: 0; right: auto; }
  .table-candles { left: 7%; top: 10%; }
  .map-wide .table-candles { width: clamp(3.4rem, 5vw, 5rem); }
  .map-wide .table-tankard { right: 5%; top: 10%; width: clamp(3.4rem, 7vw, 6.6rem); }
}
@media (max-width: 759px) {
  .board-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .board-stage, .table-supplies { grid-column: 1 / -1; min-width: 0; }
  .cost-reference { display: none; }
  .board-panel > .city-improvements {
    position: static;
    transform: none;
    height: 40px;
    margin-right: 4px;
    padding: .25rem .35rem;
    font-size: .68rem;
    color: #f7e4b7;
    background: #281d17ed;
    border: 1px solid #b48b52;
    border-radius: .32rem;
  }
  .board-panel > .city-improvements::before { content: 'City improvements'; }
  .city-improvements .improvement-column { display: none; }
  .board-panel > .board-tools { grid-column: 2; }
  .table-six .players .player .portrait { width: 28px; }
  .table-supplies { margin-block: 4px; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .piece-reserve { min-height: 44px; }
  .reserve-plaque { min-height: 22px; }
  .table-cards { height: 30px; }
  .camera { position: relative; }
  .market-picker .trade-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .market-picker .trade-card { min-height: 46px; }
  .market-picker .trade-tile .remove-card { min-height: 32px; }
  .market-picker .trade-card span:not(.resource-art), .market-picker .trade-card small { font-size: .66rem; }
}

/* Optional Conquest mode */
.conquest-pact { display:flex; gap:.7rem; padding:.8rem; background:#29494b; color:#fff5d9; border:1px solid #cbb57a; border-radius:8px; }
.conquest-pact input { width:1.3rem; flex:none; }
.conquest-battle { padding:.8rem; border-left:4px solid #d4aa52; background:#233c46; color:#fff5df; }
.conquest-army { padding:.4rem .6rem; border-bottom:1px solid #bba06d55; }
.conquest-position { padding:.7rem; border:1px solid #c7a263; border-radius:.4rem; background:#183c3f; color:#fff0c9; }
.conquest-rivals { margin:.5rem 0; }
.conquest-rivals summary { min-height:44px; padding:.6rem; cursor:pointer; background:#211d1980; }
.conquest-card { display:flow-root; padding:.8rem; border:1px solid #bba06d; border-radius:10px; margin:.6rem 0; }
.conquest-card img { float:left; object-fit:cover; margin:0 .8rem .5rem 0; border-radius:6px; }

/* A phone table keeps the map and counted hand together; details open in place. */
.phone-hand { display:none; }
.full-phone-hand { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.65rem; padding-top:.5rem; }
.full-phone-hand .card { min-height:90px; }
.full-phone-hand .card .resource-art { height:60px; }
.full-phone-hand .card span:not(.resource-art) { font-size:.8rem; }
@media(max-width:599px) {
  body.playing { height:100svh; overflow:hidden; }
  .playing .mast { height:48px; box-sizing:border-box; padding:2px 6px; gap:5px; }
  .playing .mast > img { width:28px; height:28px; }
  .playing .mast h1 { font-size:1rem; white-space:nowrap; }
  .playing #edition { display:block; font-size:.57rem; max-width:205px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .playing #menu { min-height:44px; padding:4px 8px; }
  .playing main { height:calc(100svh - 48px); padding:3px 4px 0; box-sizing:border-box; }
  .playing #table { height:100%; padding:0; display:flex; flex-direction:column; gap:3px; }
  .playing .players { flex:none; margin:0; gap:3px; }
  .playing .players .player { min-height:44px; height:44px; padding:3px; }
  .playing .players .player small { font-size:.57rem; }
  .playing .turn-bar { flex:none; margin:0; padding:2px 4px; min-height:30px; gap:2px 8px; font-size:.66rem; }
  .playing .paired-turn { font-size:.62rem; }
  .playing .table-grid { flex:1; min-height:0; display:flex; flex-direction:column; gap:0; }
  .playing .board-panel { flex:1; min-height:0; display:flex; flex-direction:column; padding:0 0 0 44px; }
  .playing .board-stage { flex:1; min-height:0; width:100%; }
  .playing #map, .playing .map-wide #map { width:100%; height:100%; }
  .playing .table-supplies, .playing .board-panel > .city-improvements, .playing .table-prop { display:none; }
  .playing .board-tools { flex:none; height:44px; display:flex; justify-content:flex-end; }
  .playing .table-tools { top:0; bottom:0; width:42px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }
  .playing .table-tools button { width:40px; height:44px; min-height:44px; flex:none; }
  .playing .camera { margin:0; height:44px; gap:3px; }
  .playing .camera > button { min-width:44px; min-height:44px; padding:3px; }
  .playing .controls { flex:none; display:flex; flex-direction:column; gap:3px; padding:2px 0 calc(3px + env(safe-area-inset-bottom)); }
  .playing #hand-area { display:none; }
  .playing .phone-hand { display:flex; align-items:center; gap:1px; width:100%; min-height:48px; padding:3px; border:1px solid #c9a66a; background:#241d16f5; }
  .phone-good { flex:1; min-width:0; display:grid; justify-items:center; position:relative; }
  .phone-good .resource-art { width:23px; height:26px; }
  .phone-good b { font:800 13px/15px system-ui; color:#fff2cc; }
  .phone-good.empty { opacity:.55; }
  .phone-hand-label { font:700 .65rem/1.15 system-ui; width:33px; white-space:normal; color:#ffe3a3; }
  .playing #actions, .playing #placement { position:static; inset:auto; width:100%; margin:0; padding:3px; box-sizing:border-box; max-height:33svh; overflow-y:auto; flex:none; box-shadow:none; }
  .playing #actions button { min-height:48px; }
  .playing #situation, .playing #activity { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); }
  .playing .notice[data-receipt='true'] { display:none; }
  .playing .notice:not([data-receipt='true']) { position:fixed; top:48px; left:4px; right:4px; z-index:20; }
  .playing .last-dice { transform:scale(.8); transform-origin:bottom right; }
}

/* Your own cards, face up above your hand. */
#own-cards { display: flex; align-items: flex-end; gap: 8px; }
#own-cards .own-card-fan { display: flex; align-items: flex-end; }
#own-cards:not(.has-cards) .own-card-fan { display: none; }
#own-cards .table-card { width: clamp(26px, 2.6vw, 36px); margin: 0 -7px; }
#own-cards.has-cards { padding-left: 14px; }
.own-card-label { white-space: nowrap; }

/* Owner request 2026-11-16: the build-cost card no longer sits on the table. */
#table-cost-reference { display: none; }

/* Pop-up cost card: each piece = the resource cards it costs, drawn as pictures. */
dialog[data-kind='cost'] {
  width: min(360px, calc(100vw - 24px));
  background: linear-gradient(120deg, #e4cf9e, #f4e8c7 60%, #cbb486);
  color: #392b1b;
  border: 4px double #776147;
  border-radius: 4px;
  box-shadow: 3px 9px 18px #1d100a99;
}
dialog[data-kind='cost'] .sheet-title { border-bottom-color: #9a815c; }
dialog[data-kind='cost'] .sheet-title h2 { color: #392b1b; font: 700 1.05rem Georgia, serif; letter-spacing: .08em; text-transform: uppercase; }
dialog[data-kind='cost'] #close-sheet { color: #392b1b; border-color: #8c744e; background: #f4e8c7; }
.cost-card { display: grid; gap: 4px; }
.cost-row {
  display: grid;
  grid-template-columns: 48px 14px 1fr;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 3px 4px;
  border-bottom: 1px solid #8c744e45;
}
.cost-row:last-child { border-bottom: 0; }
.cost-piece { position: relative; display: grid; place-items: center; height: 44px; }
.cost-piece img { max-width: 44px; max-height: 42px; object-fit: contain; filter: drop-shadow(1px 2px 1px #3a250f80); }
.cost-for-road .cost-piece img { max-width: 46px; }
.cost-for-card .cost-piece img { max-height: 40px; border-radius: 3px; }
.cost-badge {
  position: absolute; right: -2px; bottom: 0;
  min-width: 17px; height: 17px; padding: 0 3px;
  display: grid; place-items: center;
  font: 800 .62rem/1 system-ui; color: #fff4d6;
  background: #4c3420; border: 1px solid #f0d9a8; border-radius: 999px;
}
.cost-equals { font: 700 1rem/1 Georgia, serif; font-style: normal; color: #6a5434; text-align: center; }
.cost-pay { display: flex; flex-wrap: wrap; gap: 3px; }
.cost-pay .resource-art { width: 34px; height: 34px; border-radius: 4px; border: 1px solid #6e5634; box-shadow: 1px 2px 2px #3a250f55; }

/* Almanac: searchable rulebook with every card. */
.sheet-help { margin-left: auto; display: flex; }
.sheet-help:empty { display: none; }
.almanac-help { min-width: 34px; min-height: 34px; padding: 0; font: 700 1rem/1 Georgia, serif; border-radius: 50%; }
dialog[data-kind='almanac'] { width: min(760px, calc(100vw - 20px)); }
.almanac-search {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  font: 1rem system-ui;
  color: #2c2117;
  background: #f6ecd2;
  border: 2px solid #a8834b;
  border-radius: 8px;
}
.almanac-chapters { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.almanac-chip { min-height: 32px; padding: 4px 10px; font-size: .8rem; border-radius: 999px; }
.almanac-book [hidden], .almanac-none[hidden] { display: none !important; }
.almanac-chapter { padding-top: 8px; scroll-margin-top: 8px; }
.almanac-chapter > h3 { font: 700 1.1rem Georgia, serif; color: #ffe2a8; border-bottom: 1px solid #ac91635c; padding-bottom: 4px; margin-bottom: 6px; }
.almanac-entry { padding: 6px 8px; margin-bottom: 4px; border-radius: 6px; scroll-margin-top: 8px; }
.almanac-entry h4, .almanac-deck h4 { font: 700 .95rem Georgia, serif; color: #f6d99b; margin-bottom: 3px; }
.almanac-entry p { font-size: .9rem; line-height: 1.45; margin: 0 0 4px; }
.almanac-deck { margin: 8px 0 12px; scroll-margin-top: 8px; }
.almanac-focus { animation: almanac-focus 1.6s ease-out; }
@keyframes almanac-focus { 0%, 40% { background: #d9a64a40; box-shadow: 0 0 0 2px #e0b25c; } 100% { background: transparent; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .almanac-focus { animation: none; background: #d9a64a26; } }
.almanac-none { font-style: italic; opacity: .8; }
.almanac-search { position: sticky; top: 0; z-index: 2; box-shadow: 0 6px 10px #1a222499; }
@media (max-width: 599px) {
  .almanac-chapters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .almanac-chip { flex: none; }
}

/* Map maker: the map with its tools beside a settings panel (stacked on phones). */
.workshop-map, .workshop-settings { display: grid; gap: .55rem; min-width: 0; }
.workshop-settings { padding: .7rem; border: 1px solid #92734c; border-radius: .5rem; background: #1d1915b3; }
.workshop-settings h3 { font: 700 1rem Georgia, serif; color: #ffe2a8; margin: 0; }
.workshop-map .workshop-preview canvas { height: clamp(13rem, 42vw, 30rem); }
.workshop-randomisers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.workshop-randomisers button, .workshop-tools button { min-width: 0; padding-inline: .4rem; font-size: .82rem; }
.workshop-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; }
.workshop-tools button[aria-pressed='true'], .workshop-swatch[aria-pressed='true'] { background: #d3a75d; color: #211b13; border-color: #ffe29b; }
.workshop-palette { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 2.4rem; align-items: center; }
.workshop-swatch { min-height: 2.2rem; padding: .25rem .6rem; font-size: .8rem; display: inline-flex; align-items: center; gap: .3rem; }
.workshop-swatch.hot { color: #ffb4a6; }
.workshop-swatch[aria-pressed='true'].hot { color: #8b1c10; }
.workshop-swatch .resource-art { width: 1.4rem; height: 1.4rem; }
.workshop-swatch[class*='terrain-']::before { content: ''; width: .9rem; height: .9rem; border-radius: 50%; border: 1px solid #0006; background: var(--swatch); }
.terrain-wood { --swatch: #1f5a24; } .terrain-brick { --swatch: #c9572b; } .terrain-wool { --swatch: #9fd04a; }
.terrain-grain { --swatch: #f0bf2c; } .terrain-ore { --swatch: #7f8fa3; } .terrain-gold { --swatch: #f2c23c; }
.terrain-desert { --swatch: #ead9a7; } .terrain-sea { --swatch: #246079; }
.workshop-check { display: flex; gap: .5rem; align-items: flex-start; font-size: .85rem; line-height: 1.35; }
.workshop-check input { width: 1.1rem; height: 1.1rem; margin-top: .1rem; flex: none; }
.workshop-map .workshop-paint-help { margin: 0; }
.workshop-footer .workshop-status { grid-column: 1 / -1; margin: 0; font-size: .85rem; line-height: 1.35; }
.workshop-saved { display: grid; gap: .4rem; min-width: 0; padding: .55rem; border: 1px solid #92734c66; border-radius: .4rem; background: #15110e66; }
.workshop-saved h4 { margin: 0; font: 700 .9rem Georgia, serif; color: #ffe2a8; }
.workshop-saved input[type='search'] { width: 100%; min-height: 2.6rem; box-sizing: border-box; }
.workshop-saved-count { margin: 0; font-size: .78rem; color: #f4d9a6; }
.workshop-saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; max-height: 14rem; overflow-y: auto; overscroll-behavior: contain; }
.workshop-saved-list[hidden] { display: none; }
.workshop-saved-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem; align-items: stretch; }
.workshop-saved-load { display: grid; gap: .1rem; text-align: left; min-height: 2.75rem; padding: .35rem .6rem; min-width: 0; }
.workshop-saved-load strong, .workshop-saved-load small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workshop-saved-load small { font-size: .74rem; opacity: .85; }
.workshop-saved-load[aria-current='true'] { border-color: #ffe29b; box-shadow: inset 0 0 0 1px #ffe29b; }
.workshop-saved-delete { min-width: 4.2rem; min-height: 2.75rem; padding-inline: .5rem; font-size: .8rem; }
@media (max-width: 759px) {
  .workshop-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workshop-randomisers { grid-template-columns: 1fr 1fr; }
  .workshop-randomisers button:first-child { grid-column: 1 / -1; }
}

/* Six seats: the right-hand reserves need the space the tankard used. */
.table-six .table-tankard { display: none; }


/* Phone table: one menu button bottom-left; the tools open as a labelled grid. */
.tools-toggle { display: none; }
@media (max-width: 759px) {
  .board-panel { padding-left: 0 !important; }
  .tools-toggle {
    display: grid; place-items: center; position: absolute; left: 6px; bottom: 6px; z-index: 21;
    width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 9px; font-size: 24px;
    color: #4a2a0c; border: 3px solid #53483c; background: linear-gradient(#ffe08b, #f4b527 48%, #cb7d19);
    box-shadow: 0 0 0 1px #221a14, inset 0 0 0 2px #ffe6a1, 2px 3px 4px #26170b99;
  }
  .board-tools:not(.tools-open) .table-tools { display: none !important; }
  .board-tools.tools-open .table-tools {
    display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
    position: absolute; left: 6px; right: 6px; bottom: 60px; top: auto; width: auto; overflow: visible; z-index: 20; padding: 10px;
    border-radius: 12px; background: #1d1611f2; border: 1px solid #b88a47; box-shadow: 0 8px 24px #000a;
  }
  .board-tools.tools-open .table-tools button { width: 100%; height: auto; min-height: 64px; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; }
  .board-tools.tools-open .table-tools button span {
    position: static; visibility: visible; width: auto; padding: 0; background: none; border: 0; color: #3a220c; font: 700 11px system-ui;
  }
  .camera { position: absolute !important; right: 6px; top: 6px; bottom: auto !important; left: auto !important; z-index: 6; flex-direction: column !important; gap: 4px !important; margin: 0 !important; }
  .camera > button { width: 40px !important; min-width: 40px !important; min-height: 38px !important; padding: 0 !important; font-size: 13px; }
  .camera-panel { right: 48px; left: auto; top: 0; bottom: auto; }
}

/* Scoreboard */
dialog[data-kind='scoreboard'] { width: min(760px, calc(100vw - 16px)); }
.dice-chart { margin: 0 0 .8rem; padding: .7rem; border-radius: .5rem; background: #12191b; }
.dice-chart figcaption { font: 700 .85rem system-ui; color: #f2dcae; margin-bottom: .5rem; }
.dice-bars { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; align-items: end; height: 150px; }
.dice-bar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; font: 600 .75rem system-ui; color: #e9dfc8; }
.dice-bar i { align-self: end; display: block; min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(#f3c86a, #b98227); }
.dice-bar.seven i { background: linear-gradient(#f07d6f, #a8352a); }
.score-row { margin: 0 0 .45rem; border-radius: .45rem; overflow: hidden; border-left: 8px solid var(--piece);
  background: linear-gradient(90deg, color-mix(in srgb, var(--piece) 45%, #1a1714), #1a1714 75%); }
.score-row summary { display: grid; grid-template-columns: minmax(5rem, 9rem) 1fr; align-items: center; gap: .5rem; padding: .5rem .7rem; cursor: pointer; }
.score-row summary strong { font: 700 1rem Georgia, serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-cells { display: flex; flex-wrap: wrap; gap: .5rem .9rem; }
.score-cells span { display: grid; justify-items: center; min-width: 1.8rem; }
.score-cells b { font: 700 1.05rem system-ui; }
.score-cells small { font-size: .7rem; opacity: .8; }
.score-cells .score-vp b { font-size: 1.35rem; color: #ffd677; }
.score-more { padding: 0 .7rem .7rem; }
.score-more p { margin: 0 0 .4rem; font-size: .8rem; }
.score-goods { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .25rem; }
.score-good { display: flex; align-items: center; gap: .25rem; padding: 2px 6px 2px 2px; border-radius: 6px; background: #ffffff12; }
.score-good .resource-art { width: 26px; height: 26px; }


/* The unbuilt pieces now stand on the table around the island (drawn on the board), so
   the old HTML reserves stay only for screen readers. */
.table-supplies { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; padding: 0 !important; margin: -1px !important; }

/* Turn moves as picture buttons: undo, build, trade, end turn. */
.turn-icons { display: flex; justify-content: flex-end; gap: 8px; }
.turn-icons .turn-icon { flex: 0 1 64px; min-width: 48px; min-height: 52px; padding: 4px; display: grid; place-items: center;
  border: 3px solid #53483c; border-radius: 9px; color: #4a2a0c; background: linear-gradient(#ffe08b, #f4b527 48%, #cb7d19);
  box-shadow: 0 0 0 1px #221a14, inset 0 0 0 2px #ffe6a1, 2px 3px 4px #26170b99; }
.turn-icons .turn-icon svg { width: 32px; height: 32px; }
.turn-icons .turn-icon .rail-shape { stroke-width: 2.1; }
.turn-icons .turn-end { flex-basis: 76px; background: linear-gradient(#c9f08f, #7cc246 48%, #3f7d23); }
.turn-icons .turn-icon:disabled { opacity: .45; filter: grayscale(.7); }
.turn-icons .turn-icon:hover:not(:disabled), .turn-icons .turn-icon:focus-visible { box-shadow: inset 0 0 0 2px #ffdda1, 0 0 0 2px #e7b963, 0 .2rem .5rem #26160c; }
.playing #actions .turn-icons .turn-icon { min-height: 48px; }
.trade-tile.short .trade-card { outline: 3px solid #e0533d; }
.trade-tile.short small { color: #ffb4a8; }

/* Trade terms drawn as cards with the name underneath. */
.terms-cards { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.terms-side { display: grid; gap: 2px; justify-items: start; }
.terms-side em { font: 700 10px system-ui; font-style: normal; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.terms-arrow { font-size: 18px; opacity: .8; }
.bundle-cards { display: flex; gap: 4px; flex-wrap: wrap; }
.bundle-card { position: relative; display: grid; justify-items: center; width: 44px; padding: 2px; border: 1px solid #b88a47; border-radius: 5px; background: #f3e2bd; color: #3a220c; }
.bundle-card .resource-art { width: 38px; height: 44px; }
.bundle-card b { position: absolute; top: -6px; right: -6px; min-width: 20px; padding: 1px 4px; border-radius: 10px; background: #3a220c; color: #ffe8bd; font: 800 11px/16px system-ui; text-align: center; }
.bundle-card small { font: 700 9px/12px system-ui; }
.market-reply { grid-template-columns: minmax(4.5rem, auto) minmax(0, 1fr) 44px; }

/* Signed in now: invite people straight to the table. */
.online-now { margin-top: .8rem; padding: .6rem; border: 1px solid #b88a47; border-radius: .4rem; background: #1d1611d9; text-align: left; }
.online-now h3 { margin: 0 0 .4rem; font-size: 1rem; }
.online-now ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; max-height: 14rem; overflow-y: auto; }
.online-now li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: .5rem; align-items: center; }
.online-now li strong { overflow-wrap: anywhere; }
.online-now li button { margin: 0; min-height: 40px; }
.presence-dot { width: 10px; height: 10px; border-radius: 50%; background: #70db75; box-shadow: 0 0 0 2px #10301280; }
.online-now li.idle .presence-dot { background: #d9a441; }
.online-now li.idle small { color: #e8c37a; }
.account-invites { position: fixed; z-index: 60; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(460px, calc(100vw - 24px)); display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .7rem .8rem;
  border: 2px solid #e7b963; border-radius: .6rem; background: #241b15f7; color: #ffe8bd; box-shadow: 0 8px 24px #000a; }
.account-invites p { flex: 1 1 100%; margin: 0; font-weight: 700; }
.account-invites button { margin: 0; flex: 1 1 0; }
.turn-icons .turn-end { flex-basis: 84px; gap: 1px; }
.turn-icons .turn-end svg { width: 30px; height: 30px; }
.turn-caption { font: 800 10px/12px system-ui; letter-spacing: .02em; color: #1d3a0e; white-space: nowrap; }
/* Narrow action panels: let the turn buttons wrap rather than run off the screen. */
.turn-icons { flex-wrap: wrap; row-gap: 6px; }
.turn-icons .turn-icon { min-width: 44px; }

/* Games this device holds a seat in. */
.device-games { margin: 0 0 1rem; padding: .7rem; border: 1px solid #b88a47; border-radius: .5rem; background: #1d1611e6; }
.device-games h3 { margin: 0 0 .5rem; }
.device-games ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.device-games li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto auto; gap: 0 .5rem; align-items: center; }
.device-games li strong { grid-column: 1; overflow-wrap: anywhere; }
.device-games li small { grid-column: 1; grid-row: 2; opacity: .85; }
.device-games li button { grid-row: 1 / span 2; margin: 0; min-height: 44px; }
.device-games li.your-turn small { color: #9be59f; font-weight: 700; }
