:root{
  color-scheme:light;
  --ink:#173945;--dark:#0d3948;--muted:#526c70;--teal:#176272;
  --paper:#f8efd9;--paper-light:#fff8e7;--line:#28556540;--gold:#b68238;
  --shadow:0 18px 45px #102e4140;--display:Georgia,"Times New Roman",serif;
  --body:"Avenir Next","Trebuchet MS",sans-serif;
  font-family:var(--body);color:var(--ink);background:#0e4656;
}
*,*::before,*::after{box-sizing:border-box}
body{margin:0;min-width:320px}
button,input,select{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #d28728;outline-offset:3px}
img{max-width:100%;display:block}
h1,h2,h3,p{margin:0}
h1,h2,h3{font-family:var(--display);font-weight:700}
h2{font-size:1.45rem;line-height:1.13}
h3{font-size:1.12rem}
p{line-height:1.55}
fieldset{padding:0;border:0;margin:0;min-width:0}
legend,.field>span{font-weight:700;margin:0 0 .45rem;display:block;font-size:.89rem}
small{font-size:.76rem}
.brand{display:flex;gap:.58rem;align-items:center;white-space:nowrap;font-family:var(--display);font-size:1.3rem}
.brand b{font-weight:700}
.brand-icon{width:41px;height:41px}
.tools{display:flex;align-items:center;gap:.5rem}
.glyph{width:20px;height:20px;object-fit:contain;flex:none}
.button,.icon-button{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.6rem .93rem;min-height:42px;
  border:1px solid #1e52644d;border-radius:6px;color:var(--ink);background:#fcf4df;
  font-weight:700;font-size:.88rem;text-decoration:none;line-height:1.12;transition:background .16s ease,box-shadow .16s ease;
}
.button:hover:not(:disabled),.icon-button:hover:not(:disabled){background:#fffaed;box-shadow:0 2px 8px #1a42522c}
.button:disabled{background:#e5dec9;color:#6d7974;border-color:#55696535}
.button.primary{background:#145466;color:#fff8e8;border-color:#083142;box-shadow:inset 0 0 0 2px #f4f0d331}
.button.primary:hover:not(:disabled){background:#0f6576;box-shadow:inset 0 0 0 2px #d9f2df70,0 3px 11px #0b3e5460}
.button.primary:disabled{background:#6c7f84;color:#fff3db;border-color:#4d666e;box-shadow:none}
.button.primary .glyph{filter:brightness(0) invert(.95)}
.button.quiet{background:#f8efd9a0}
.button.light{background:#fcf4df}
.icon-button{padding:.44rem;min-width:42px}
.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:.71rem;font-weight:800;color:#315e68}
.paper{
  background-color:var(--paper);
  background-image:linear-gradient(#faf3e6a0,#faf3e6a0),url("./assets/textures/dialog-paper.webp");
  background-size:auto,256px 256px;border:1px solid #2c586c44;
}
/* The island remains the focus of both the landing and the live table. */
.ocean-table{
  min-height:100svh;
  color:#f9edd0;
  background:
    radial-gradient(ellipse at 50% 43%,#6bb4b044 0%,#256c7b2b 38%,#10343fee 100%),
    linear-gradient(180deg,#18495640,#103e53b8),
    #1e586a url("./assets/backgrounds/playmat.webp") center/cover fixed;
}
.navigation{display:flex;justify-content:space-between;align-items:center;padding:.55rem clamp(.75rem,2.3vw,2rem);gap:.6rem;min-height:60px}
.navigation-brand{color:#fff4dc}
.navigation .brand-icon{width:38px;height:38px}
.navigation .button.quiet,.navigation .icon-button{background:#fdf3dbed}
.landing{position:relative}
.landing-view{position:relative;min-height:max(540px,calc(100svh - 60px));isolation:isolate}
.landing-island{position:absolute;inset:clamp(1rem,6vh,4.5rem) 12vw clamp(1rem,6vh,4.5rem);display:grid;place-items:center}
#home-island{width:100%;height:100%;min-height:0;display:block;pointer-events:none}
.landing-launch{
  position:absolute;z-index:1;left:clamp(1.1rem,4vw,4.5rem);bottom:clamp(2rem,10vh,6rem);
  max-width:min(410px,calc(100% - 2rem));padding:.5rem .25rem;
  text-shadow:0 2px 7px #072e3d,0 1px 2px #143747;
}
.landing h1{max-width:9ch;font-size:clamp(2.8rem,5.1vw,5.6rem);letter-spacing:-.065em;line-height:.9;margin:0 0 .65rem}
.landing h1 em{font-style:normal;color:#ffe8ad}
.landing-launch p{font-size:.95rem;color:#fff3d7;max-width:30ch}
.landing-actions{display:grid;gap:.55rem;margin-top:1rem;text-shadow:none}
.resume-line,.launch-line{display:flex;gap:.5rem}.launch-line{flex-wrap:nowrap}
.landing-actions .button{min-height:42px}
.lobby{min-height:100svh;background:linear-gradient(#0c40534d,#0a405a69),url("./assets/backgrounds/lobby-background.webp") center/cover fixed;padding-bottom:2rem}
.page-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.58rem clamp(.8rem,5vw,4rem);background:#f3e7c9;border-bottom:1px solid #bcaf8c}
.setup-sheet{
  width:min(860px,calc(100% - 2rem));margin:clamp(1.3rem,6vh,4.2rem) auto 0;padding:clamp(1.2rem,4vw,2.7rem);
  border-radius:9px;box-shadow:var(--shadow),inset 0 0 0 5px #f6eacb;position:relative;
}
.setup-intro{margin-bottom:1.45rem}
.setup-intro h1{font-size:clamp(2rem,5vw,3.3rem);line-height:1.06;letter-spacing:-.035em;margin:.3rem 0 .65rem}
.setup-intro p{color:var(--muted)}
.setup-form{display:grid;grid-template-columns:1fr .92fr;gap:1.45rem 2rem}
.setup-fields,.identity{display:grid;align-content:start;gap:1.1rem}
.field{display:block}
.field input,.field select{
  min-height:43px;padding:.58rem .67rem;border:1px solid #375d6666;background:#fffbef;border-radius:5px;color:var(--ink);width:100%;
}
.options{display:flex;flex-wrap:wrap;gap:.4rem}
.option{position:relative;display:block}
.option input{position:absolute;width:1px;height:1px;opacity:0}
.option span{display:block;padding:.55rem .7rem;border-radius:5px;border:1px solid #345a6361;background:#fff7e0;font-size:.89rem;font-weight:650;color:#304f53;cursor:pointer}
.option input:focus-visible+span{outline:3px solid #d28728;outline-offset:2px}
.option input:checked+span{color:#fff8df;background:#195769;border-color:#174351}
.seat-picks{display:flex;flex-wrap:wrap;gap:.45rem}
.avatar-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:.33rem}
.avatar-pick,.seat-pick{
  border:1px solid transparent;border-radius:7px;background:#ebe1c7b0;padding:.27rem;min-height:41px;display:grid;place-items:center;
}
.avatar-pick:hover,.seat-pick:hover{background:#fff8e7}
.avatar-pick[aria-pressed="true"],.seat-pick[aria-pressed="true"]{border:2px solid #255f70;background:#fef7dd;box-shadow:0 2px 3px #124e5522}
.avatar-pick .avatar{width:100%;max-width:52px}
.seat-pick{width:44px}
.seat-pick .marker{width:24px;height:24px;object-fit:contain}
.form-footer{grid-column:1/-1;display:flex;gap:.75rem;flex-wrap:wrap;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding-top:1.15rem}
.form-footer>span{font-size:.85rem;color:var(--muted)}
.online-entry{max-width:610px}
.online-info{display:grid;gap:.9rem}
.room-tabs{display:flex;gap:.45rem;margin:0 0 1.25rem}
.name-row{display:flex;align-items:end;gap:.6rem;flex-wrap:wrap}
.name-row .field{flex:1;min-width:9rem}
.controller-field .options{flex-wrap:nowrap}
.identity-hint{margin:.35rem 0;color:var(--muted);font-size:.83rem}
.invite-line{display:flex;gap:1rem;align-items:center;justify-content:flex-start}
.invite-line strong{
  font-family:var(--display);font-size:2rem;letter-spacing:.14em;color:#164759;font-variant-numeric:tabular-nums;
  padding:.34rem .57rem;background:#f8e5a8;border:1px solid #bfa158;border-radius:7px
}
.footer-actions{display:flex;align-items:center;gap:.42rem}
.lobby-seat.vacant{justify-content:space-between}
.lobby-seat .button{min-height:34px;font-size:.75rem}
.lobby-seats{display:grid;gap:.4rem}
.lobby-seat{display:grid;grid-template-columns:auto 1fr auto;gap:.55rem;align-items:center;padding:.38rem .65rem;background:#fbf3e1;border:1px solid #325d6250;border-radius:6px}
.lobby-seat .avatar{width:38px;height:38px;object-fit:contain}
.lobby-seat small{display:block;color:var(--muted)}
.lobby-seat small .marker{width:1rem;height:1rem;display:inline-block;vertical-align:middle}
.lobby-seat-status{display:flex;align-items:center;justify-content:flex-end;gap:.55rem;flex-wrap:wrap}
.lobby-seat span{font-size:.78rem;font-weight:800}
.lobby-seat.vacant{min-height:50px;border-style:dashed;color:var(--muted);display:flex}

.match-page{position:fixed;inset:0;isolation:isolate;overflow:hidden;overscroll-behavior:none}
.match-header{
  position:absolute;inset:0 0 auto;z-index:3;display:flex;justify-content:space-between;min-height:59px;
  background:linear-gradient(180deg,#1038469e,#123e4b4a);border-bottom:1px solid #f0d8ab35;pointer-events:none;
}
.match-header .tools{pointer-events:auto}
.round-status{font-size:.77rem;padding:.5rem .58rem .3rem;color:#274b53;line-height:1.3}
.players-rail{
  position:absolute;z-index:2;left:clamp(.4rem,1.4vw,1.3rem);top:83px;width:clamp(149px,15vw,205px);
  max-height:calc(100% - 187px);pointer-events:none;
}

.seat-strip{display:grid;gap:.43rem}
.seat{
  --seat-accent:#00a56e;position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;
  gap:.22rem .4rem;min-width:0;padding:.54rem .47rem .47rem .55rem;color:var(--ink);
  background:#f5ebd7db;
  border:1px solid #fceec7a0;border-left:4px solid var(--seat-accent);border-radius:6px;
  box-shadow:0 3px 9px #113e4b35;transition:transform .24s ease,background-color .24s ease;
}
.seat[data-color="amber"]{--seat-accent:#e5cb00}
.seat[data-color="violet"]{--seat-accent:#ad1885}
.seat[data-color="coral"]{--seat-accent:#e00061}
.seat[data-color="blue"]{--seat-accent:#007dc6}
.seat.active{
  transform:translateX(.62rem);border-color:#eeca82;border-left-color:var(--seat-accent);
  background-color:#fff2cedf;box-shadow:0 0 0 2px #edcc79b0,0 4px 11px #103e4c80;
}
.seat.active::after{
  content:"";position:absolute;top:0;left:0;width:5px;height:5px;border-radius:50%;
  background:#fff;box-shadow:0 0 7px 3px #fff7d9;pointer-events:none;
  offset-path:inset(0 round 5px);animation:active-seat-light 7s linear infinite;
}
@keyframes active-seat-light{to{offset-distance:100%}}
.portrait{position:relative;width:38px;height:40px;display:grid;place-items:center}
.portrait .avatar{width:34px;height:34px;object-fit:contain}
.seat-info{min-width:0}
.seat-name{display:flex;gap:.22rem;align-items:center}
.seat-name b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.86rem}
.seat-name .marker{width:12px;height:12px;object-fit:contain}
.seat-info>span{font-size:.68rem;color:#3d5b63;white-space:nowrap}
.seat-score,.goal-value{display:flex;align-items:baseline;gap:.12rem;padding:0 .07rem;white-space:nowrap}
.seat-score strong{font:700 1.26rem/1 var(--display)}
.seat-score small{font-size:.61rem;font-weight:800}
.seat-ledger{
  grid-column:1/-1;display:flex;flex-wrap:wrap;gap:.12rem .35rem;border-top:1px solid #2e657044;
  padding:.29rem 0 .04rem;font-size:.68rem;color:#294b54
}
.seat-awards{grid-column:1/-1;display:flex;gap:.2rem}
.award{width:20px;height:20px;object-fit:contain}
.victory-goal{
  display:flex;align-items:center;justify-content:space-between;gap:.3rem;margin-top:.5rem;
  background:#f5ebd7dc;border:1px solid #f8e6bf80;border-radius:6px;color:var(--ink);
  font-size:.82rem;padding:.36rem .54rem
}
.goal-value strong{font:700 1.22rem/1 var(--display)}
.goal-value small{font-size:.63rem;font-weight:800}
.seat-divider{color:#527078}
.history-rail{
  position:absolute;z-index:4;top:75px;right:clamp(.4rem,1.4vw,1.3rem);
  display:flex;flex-direction:column;align-items:stretch;width:clamp(170px,20.5vw,290px);
  max-height:calc(100% - 145px);pointer-events:none
}
.history-rail:has(.history-body[hidden]){align-items:flex-end}
.history-toggle{
  display:flex;align-items:center;justify-content:space-between;gap:.6rem;padding:.54rem .66rem;
  border:1px solid #e7c98f;border-radius:7px;background:#f7e9cde8;color:var(--ink);
  font-weight:800;line-height:1.2;font-size:.91rem;pointer-events:auto
}
.history-toggle span::before{content:"+";font-size:1.2rem;line-height:.8}
.history-toggle[aria-expanded="true"]{border-radius:7px 7px 0 0}
.history-toggle[aria-expanded="true"] span::before{content:"−"}
.history-body{
  min-height:0;display:flex;flex-direction:column;
  background:#f3e4c8e3;color:var(--ink);border:1px solid #e7c98f;border-top:0;border-radius:0 0 7px 7px;
  box-shadow:0 5px 20px #102e415e;pointer-events:auto;
}
.history-body[hidden],#classic-layout[hidden]{display:none}
#classic-layout .option span{min-width:2.6rem;text-align:center;padding-inline:.46rem}
.history-navigation{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.23rem;padding:.32rem .5rem}
.history-navigation h2{text-align:center;font-size:1.05rem}
.history-navigation .icon-button{width:30px;min-width:30px;min-height:31px;font-size:1.3rem;padding:.1rem}
.history-navigation .icon-button:disabled{opacity:.44}
.history-cards{display:grid;align-content:start;gap:.38rem;padding:.35rem .48rem .52rem;overflow:auto;overscroll-behavior:contain}
.history-card{border:1px solid #b89452;border-radius:7px;padding:.26rem .45rem;box-shadow:0 2px 4px #1736432b}
.history-card h3{display:flex;align-items:center;gap:.31rem;font-size:.91rem;overflow-wrap:anywhere;padding:.18rem 0 .28rem}
.history-card .marker{width:13px;height:13px;object-fit:contain;flex:none}
.history-line{padding:.27rem 0;border-top:1px solid #92724754;font-size:.75rem;line-height:1.28;overflow-wrap:anywhere}
.history-harvest{display:flex;align-items:center;flex-wrap:wrap;gap:.23rem .3rem}
.history-resources{display:flex;gap:.35rem;align-items:center;flex-wrap:wrap;margin-inline-start:auto}
.history-resource{display:inline-flex;align-items:center;gap:.11rem;font-weight:800;white-space:nowrap}
.history-resource img{width:17px;height:17px;object-fit:contain}
.history-muted,.history-empty{color:#456069}
.history-empty{font-size:.78rem;padding:.18rem .3rem}
.board-stage{position:absolute;inset:0}
#board{width:100%;height:100%;display:block;touch-action:none;cursor:grab}
#board:focus-visible{outline:2px solid #e3b96e;outline-offset:-3px}
.map-tools{position:absolute;display:flex;gap:.23rem;z-index:2;bottom:max(.6rem,env(safe-area-inset-bottom));right:clamp(.4rem,1.4vw,1.3rem)}
.map-tools .icon-button{min-width:35px;min-height:34px;padding:.32rem;background:#f9f1dccf}
.map-tools .glyph{width:16px;height:16px}
.map-tools [data-action="undo"] .glyph{transform:scaleX(-1)}
.fullscreen-glyph{display:grid;grid-template-columns:repeat(2,1fr);gap:3px;color:#124e60}
.fullscreen-glyph span{
  --angle:0deg;box-sizing:border-box;width:6.5px;height:6.5px;border:2px solid currentColor;
  border-right:0;border-bottom:0;border-top-left-radius:1.5px;transform:rotate(var(--angle));
  filter:drop-shadow(0 1px 0 #7cb0bb);
}
.fullscreen-glyph span:nth-child(2){--angle:90deg}
.fullscreen-glyph span:nth-child(3){--angle:-90deg}
.fullscreen-glyph span:nth-child(4){--angle:180deg}
.fullscreen-button[data-fullscreen="true"] .fullscreen-glyph span{transform:rotate(calc(var(--angle) + 180deg))}
.fullscreen-button:disabled{opacity:.58}
.board-prompt{position:relative;width:max-content;max-width:100%;pointer-events:none}
.place-bar{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:.35rem;padding:.38rem;
  background:#fbf0d9ed;color:var(--ink);border:1px solid #183b4f7a;border-radius:6px;pointer-events:auto;
}
.place-label{flex:1 1 155px;padding:0 .18rem;font-weight:750;font-size:.8rem}
.place-bar .button{min-height:36px;font-size:.78rem;padding:.4rem .6rem}
.robber-panel{
  width:min(345px,calc(100vw - 2rem));padding:.58rem .7rem;color:var(--ink);background-color:#fff2d8;
  border:1px solid #af8c55;border-radius:7px;box-shadow:var(--shadow);pointer-events:auto
}
.robber-panel h2{font-size:1.07rem;margin:0 0 .38rem}
.robber-panel p{margin:.12rem 0 .36rem;font-size:.82rem}
.robber-placement{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:.36rem}
.robber-placement p{margin:0;flex:1 1 130px}
.robber-panel .button{min-height:36px;font-size:.79rem;padding:.42rem .61rem}
.target-list{pointer-events:auto;position:absolute;bottom:calc(100% + .24rem);right:0;width:min(100%,325px);max-height:33vh;overflow:auto;display:grid;gap:.1rem;padding:.35rem;border-radius:6px;background:#fff7e3;box-shadow:var(--shadow)}
.target-row{display:block;text-align:left;background:transparent;border:0;border-radius:4px;padding:.43rem;color:var(--ink);font-size:.78rem;font-weight:650;min-height:35px}
.target-row[aria-pressed="true"],.target-row:hover{background:#e5d8b2;color:#192f38}
.panel-actions{display:flex;flex-wrap:wrap;gap:.4rem}
.panel-actions .button{flex:1 1 auto}
.build-list{display:grid;gap:.34rem;padding:.4rem;width:min(320px,calc(100vw - 1.5rem));background:#f9ebcfe8;border:1px solid #e6cb99;border-radius:8px;box-shadow:var(--shadow);pointer-events:auto}
.build-piece{width:31px;height:26px;object-fit:contain}
.build-row>span:first-of-type{flex:1}
.build-row{
  display:flex;gap:.35rem;align-items:center;justify-content:space-between;text-align:left;border:1px solid #43707855;
  background:#fff6de;border-radius:5px;padding:.46rem .44rem;min-height:47px;color:#173b45
}
.build-row:hover:not(:disabled){background:#f9edc7;border-color:#a27b3e;box-shadow:inset 2px 0 #bd892e}
.build-row:disabled{color:#627377;background:#e8e2d2}
.build-row small{display:block;font-size:.66rem}
.build-row b{font-size:.84rem}
.build-cost{display:flex;align-items:center;gap:.24rem;flex-wrap:wrap;flex-shrink:0}
.resource-mini{display:inline-flex;gap:.1rem;align-items:center;font-size:.7rem;font-weight:800}
.resource-glyph{width:14px;height:14px;object-fit:contain}
.table-dock{
  position:absolute;z-index:4;bottom:max(.6rem,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);
  display:grid;justify-items:center;gap:.34rem;width:max-content;max-width:calc(100% - 1.2rem);pointer-events:none;
}
.dock-popovers{position:relative;display:grid;justify-items:center;gap:.32rem;width:100%}
.dock-popovers>div:empty{display:none}
.command-dock{
  display:flex;align-items:center;justify-content:center;gap:.55rem;padding:.53rem .62rem;color:var(--ink);
  border:1px solid #e9d2a594;border-radius:9px;background:#f4e8ccd9;box-shadow:0 5px 22px #102e4165;pointer-events:auto;
  max-width:100%;
}
.hand-wrap{min-width:0}
.hand-row,.card-tools,.dock-awards{display:flex;align-items:center;gap:.28rem}
.hand-card,.reward-card,.dock-card{position:relative;text-align:center;width:clamp(43px,4.5vw,61px);isolation:isolate}
.hand-card.zero .card-face{filter:saturate(.6);opacity:.71}
.dock-card,.dock-award{border:0;background:transparent;padding:0;color:var(--ink)}
.dock-card b{
  display:block;position:absolute;bottom:5%;left:6%;right:6%;padding:.1rem;background:#fbefd3e8;
  border-radius:3px;font-size:.68rem;line-height:1.1
}
.dock-awards{flex-wrap:wrap;max-width:76px}
.dock-award{padding:.25rem;border-radius:4px;background:#fff4d6bd}
.dock-award .award{width:29px;height:34px}
.action-panel{display:grid;gap:.3rem}
.turn-actions{display:flex;align-items:stretch;justify-content:center;gap:.36rem}
.build-trade{display:grid;gap:.31rem}
.dice-command{
  min-width:88px;display:grid;justify-items:center;justify-content:stretch;align-content:center;gap:.23rem;
  padding:.22rem;border:1px solid #a88346;border-radius:7px;background:#eedbb4
}
.dice-illustration{display:flex;gap:.21rem;align-items:center;justify-content:center}
.dice-illustration img{width:22px;height:22px;object-fit:contain;transform:rotate(-9deg)}
.dice-illustration img+img{transform:rotate(8deg)}
.dice-command.inactive .dice-illustration{filter:grayscale(1);opacity:.58}
.dice-command.rolling .dice-illustration img{animation:dice-tumble .25s ease-in-out infinite alternate}
.dice-command.can-roll{background:#ffedbd;border-color:#ba8d3d}
.dice-command .button{width:100%;min-height:32px;padding:.37rem .45rem}
.urgent-actions{display:flex;justify-content:center;align-items:center;gap:.31rem;flex-wrap:wrap}
.turn-actions .button{white-space:nowrap}
.turn-actions .button,.urgent-actions .button{padding:.48rem .57rem;min-height:38px}
.turn-actions .glyph{width:17px;height:17px}
.card-face{filter:saturate(.59);opacity:.77}
.card-face{width:100%;aspect-ratio:5/7;object-fit:cover;border-radius:5px;box-shadow:0 3px 6px #0d2f3e72}
.hand-card b,.reward-card b{
  position:absolute;bottom:7%;left:3%;right:3%;display:block;font-size:clamp(.56rem,1.05vw,.73rem);
  color:#173641;line-height:1;font-weight:800;
}
.card-count{
  position:absolute;top:-.19rem;right:-.12rem;min-width:20px;border:1px solid #f2dab1;border-radius:5px;
  background:#174353;color:#fff4da;font-size:.75rem;font-weight:800;padding:.01rem .23rem;
}
.table-feedback{max-width:100%;pointer-events:none}
.resource-flights{position:absolute;inset:0;z-index:5;pointer-events:none}
.resource-flight{
  --seat-ring:#00a56e;position:absolute;left:0;top:0;display:grid;place-items:center;width:42px;height:42px;
  border:2px solid var(--seat-ring);border-radius:50%;background:#fff3d6;box-shadow:0 2px 8px #10374694;
}
.resource-flight[data-color="amber"]{--seat-ring:#e5cb00}
.resource-flight[data-color="violet"]{--seat-ring:#ad1885}
.resource-flight[data-color="coral"]{--seat-ring:#e00061}
.resource-flight[data-color="blue"]{--seat-ring:#007dc6}
.resource-flight .flight-icon{width:100%;height:100%;object-fit:contain;border-radius:50%}
.resource-flight b{
  position:absolute;right:-6px;bottom:-4px;min-width:21px;padding:2px 3px;color:#fff6df;background:#174353;
  border:1px solid var(--seat-ring);border-radius:9px;font-size:.71rem;text-align:center;
}
.production-receipts{
  position:absolute;z-index:5;top:77px;left:50%;transform:translateX(-50%);
  width:max-content;max-width:min(292px,63vw);display:grid;gap:.38rem;pointer-events:none;
}
.production-receipt{
  background-color:#fff3d8;border:1px solid #b59056;border-radius:7px;color:var(--ink);
  min-width:clamp(166px,18vw,238px);padding:.55rem .65rem;box-shadow:0 4px 13px #10374672;animation:reveal .2s ease-out both;
}
.production-receipt h3{font-size:1.06rem;margin-bottom:.23rem}
.production-seat{display:flex;align-items:center;flex-wrap:wrap;gap:.18rem .35rem;padding:.25rem 0}
.production-seat+.production-seat{border-top:1px solid var(--line)}
.production-seat>.marker{width:14px;height:14px;object-fit:contain}
.production-seat>b{font-size:.82rem;overflow-wrap:anywhere}
.production-amounts{display:flex;align-items:center;gap:.33rem;flex-wrap:wrap;margin-inline-start:auto}
.production-amount{display:inline-flex;gap:.18rem;align-items:center;font-size:.79rem;font-weight:700;white-space:nowrap}
.production-amount .resource-glyph{width:20px;height:20px}
.production-none{color:#607278;font-weight:700;line-height:1.25}
.round-show{
  position:absolute;inset:0;z-index:6;display:grid;place-items:center;pointer-events:none
}
.round-show-card{
  width:min(415px,calc(100% - 2rem));padding:1rem 1.25rem 1.35rem;text-align:center;color:var(--ink);
  background-color:#fff1d7;border:9px solid transparent;
  border-image:url("./assets/ui/dialog-standard.webp") 47 41 47 41 stretch;
  border-radius:10px;box-shadow:0 18px 60px #102f44ad;
}
.round-show-card h2{font-size:clamp(1.18rem,4.8vw,1.55rem);margin-bottom:.62rem;overflow-wrap:anywhere}
.round-show-card p{margin:.3rem 0 0}
.round-show-card .show-dice{display:flex;align-items:center;justify-content:center;gap:1rem;margin:.85rem 0}
.show-dice img{width:clamp(47px,12vw,62px);height:clamp(47px,12vw,62px);object-fit:contain;transform:rotate(-8deg)}
.show-dice img+img{transform:rotate(9deg)}
.roll-tumbling .show-dice img{animation:dice-tumble .21s ease-in-out infinite alternate}
.roll-tumbling .show-dice img+img,.dice-command.rolling .dice-illustration img+img{animation-delay:-.12s;animation-direction:alternate-reverse}
@keyframes dice-tumble{from{transform:translate(-3px,-5px) rotate(-18deg)}to{transform:translate(4px,1px) rotate(15deg)}}
.round-show-card .roll-number{min-height:1.55rem;font:800 1.25rem/1.25 var(--display);font-variant-numeric:tabular-nums}
.round-show-card .production-seat{padding:.42rem .12rem;border-top:1px solid var(--line);text-align:left}
.round-show-card .production-seat>b{font-size:.93rem}
.round-show-card .empty-harvest{font-size:.92rem;padding:.5rem 0 0;border-top:1px solid var(--line)}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.draw-toast{box-shadow:var(--shadow);border:1px solid #60818a;border-radius:9px;color:var(--ink);animation:reveal .23s ease-out both}
.draw-toast{display:flex;align-items:center;justify-content:space-between;gap:.62rem}
.draw-toast .icon-button{pointer-events:auto;min-width:31px;min-height:30px;padding:.27rem}
.draw-toast .glyph{width:15px;height:15px}
.harvest-cards{display:flex;justify-content:center;gap:.38rem;padding:.38rem .12rem .04rem}
.reward-card{width:clamp(43px,6.3vw,74px)}
.draw-toast{padding:.4rem .6rem;min-width:236px}
.draw-toast small{display:block;font-size:.72rem}
.draw-art{width:32px}
@keyframes reveal{from{opacity:0;transform:translateY(8px) scale(.96)}to{opacity:1;transform:none}}
.overlay{
  width:min(600px,calc(100% - 1.25rem));max-height:min(85svh,740px);padding:0;color:var(--ink);
  background:#fff4d8 url("./assets/textures/dialog-paper.webp") repeat;border:2px solid #315b68;border-radius:8px;
  box-shadow:0 19px 64px #102d3fad,inset 0 0 0 4px #f7eccb,inset 0 0 0 5px #325e685e;overflow:auto;
}
.overlay::backdrop{background:#0c2d3ab0}
.overlay.celebration{border-color:#b8833f}
.dialog-head{display:flex;gap:.6rem;align-items:center;justify-content:space-between;padding:.85rem 1rem .55rem;border-bottom:1px solid var(--line)}
.dialog-content{padding:.95rem 1rem 1.1rem}
.dialog-content p{font-size:.91rem;margin-bottom:.65rem}
.dialog-content h3{margin:.55rem 0 .4rem}
.dialog-footer{display:flex;gap:.45rem;flex-wrap:wrap;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding-top:.72rem;margin-top:.82rem}
.dialog-footer>span{font-size:.85rem;font-weight:700}
.choice-row{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.32rem}
.choice{display:flex;align-items:center;flex-direction:column;justify-content:center;gap:.22rem;text-align:center;background:#fff8df;border:1px solid var(--line);border-radius:6px;min-height:65px;color:var(--ink);padding:.32rem .08rem;font-size:.79rem}
.choice[aria-pressed="true"],.choice:hover:not(:disabled){background:#dfebd9;border-color:#216071}
.choice:disabled{opacity:.62}
.exchange-choice{position:relative;min-height:73px}
.exchange-choice:disabled .choice-art{filter:grayscale(1)}
.exchange-badge{
  position:absolute;top:.18rem;right:.2rem;padding:.1rem .28rem;min-width:1.4rem;
  border-radius:4px;background:#1e645a;color:#fff5da;font-size:.72rem;font-weight:900
}
.exchange-choice[data-action="bank-pay"] .exchange-badge{background:#993f31}
.choice small{font-size:.68rem}
.choice-art{width:30px;height:30px;object-fit:contain}
.picker{display:grid;gap:.25rem}
.picker-row{display:grid;grid-template-columns:auto 1fr 34px 24px 34px;gap:.26rem;align-items:center;padding:.3rem .44rem;border-bottom:1px solid var(--line)}
.picker-row strong{text-align:center}
.step{border:1px solid var(--line);background:#fffae5;color:var(--ink);border-radius:5px;min-height:33px;font-weight:900;font-size:1.05rem}
.step:disabled{opacity:.52}
.deck-overlay{width:min(690px,calc(100% - 1rem))}
.setting-section+.setting-section{border-top:1px solid var(--line);margin-top:1rem;padding-top:.45rem}
.pace-slider{width:100%;accent-color:#1b6874;margin:.6rem 0 .27rem}
.pace-labels{display:flex;justify-content:space-between;gap:.28rem;font-size:.78rem;color:#49636a}
.pace-labels .chosen{color:var(--ink);font-weight:900}
.dialog-title{display:flex;align-items:center;gap:.52rem}
.dev-info-button.icon-button{min-width:28px;min-height:28px;padding:0;border-radius:50%;font:italic 700 1.1rem var(--display)}
.dev-info-table th[scope="row"]{min-width:75px}
.award-grid,.dev-grid{display:grid;gap:.55rem}
.award-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.award-tile{
  display:flex;gap:.52rem;align-items:center;padding:.5rem;border:1px solid #ad925c;border-radius:6px;background:#fbebc8
}
.award-tile h3{margin:0;font-size:1rem}
.award-tile h3 small{white-space:nowrap;color:#896130}
.award-tile p{margin:.2rem 0;font-size:.79rem}
.award-tile div>small{font-size:.72rem}
.award-art{width:57px;height:65px;object-fit:contain}
.deck-heading{display:flex;justify-content:space-between;align-items:center;gap:.5rem;padding-top:.62rem}
.deck-heading span{font-size:.75rem;color:var(--muted)}
.deck-buy{display:flex;justify-content:space-between;align-items:center;gap:.4rem;margin:.35rem 0 .8rem;padding:.5rem 0;border-bottom:1px solid var(--line)}
.deck-buy .resource-glyph{width:18px;height:18px}
.deck-buy-reason{display:block;margin-top:.2rem;color:var(--muted)}
.deck-buy .button{flex:none}
.deck-reveal{display:flex;align-items:center;gap:.65rem;padding:.42rem .55rem;background:#dfebd6;border:1px solid #5d8e78;border-radius:6px;animation:reveal .24s ease-out both}
.deck-reveal h3,.deck-reveal p{margin:0}
.deck-reveal p{font-size:.77rem}
.deck-reveal-picture{position:relative;width:68px;aspect-ratio:5/7;flex:none;perspective:360px}
.deck-reveal-picture img{position:absolute;width:100%;height:100%;inset:0;object-fit:contain}
.deck-reveal-back{opacity:0;animation:card-back .5s ease-in both}
.deck-reveal-art{animation:card-front .63s ease-out both}
@keyframes card-back{0%{transform:rotateY(0deg);opacity:1}60%{transform:rotateY(90deg);opacity:1}61%,100%{opacity:0}}
@keyframes card-front{0%,46%{opacity:0;transform:rotateY(-90deg)}49%{opacity:1;transform:rotateY(-90deg)}100%{opacity:1;transform:none}}
.dev-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.dev-card{display:grid;justify-items:center;text-align:center;align-content:start;gap:.28rem;padding:.45rem;border:1px solid var(--line);border-radius:6px;background:#fff5de}
.dev-art{width:75px;height:105px;object-fit:contain}
.dev-card h4{margin:.04rem 0;font:700 .99rem var(--display)}
.dev-card p{font-size:.75rem;margin:0}
.dev-card small{color:#496369}
.dev-card .button{min-height:33px;margin-top:.18rem}
.dev-section+.dev-section{border-top:1px solid var(--line);margin-top:1rem;padding-top:.45rem}
.spent-card{background:#f4eddb}
.empty-deck{color:var(--muted)}
.result-banner{display:grid;grid-template-columns:70px 1fr;align-items:center;gap:.6rem;padding:.52rem;background:#fbebc5;border:1px solid #c89b59;border-radius:7px}
.result-banner p{margin:0}.result-banner h3{font-size:1.55rem;margin:.35rem 0}
.result-list{display:grid;gap:.25rem;margin-top:.72rem}
.result-row{display:grid;grid-template-columns:35px 1fr auto;align-items:center;gap:.5rem;border-bottom:1px solid var(--line);padding:.22rem .3rem}
.result-row .avatar{width:32px;height:32px}
.result-row span{font-weight:800}
.guide-overlay{width:min(830px,calc(100% - 1rem))}
.guide-overlay .dialog-head,.deck-overlay .dialog-head{position:sticky;top:0;z-index:1;background:#fff4da}
.guide-nav{display:flex;flex-wrap:wrap;gap:.4rem;padding:.18rem 0 .8rem}
.guide-nav .button{min-height:36px;font-size:.8rem;padding:.42rem .56rem}
.guide-section{border-top:1px solid var(--line);padding:.85rem 0 .3rem}
.guide-section h3{font-size:1.32rem;scroll-margin-top:4.75rem;margin:0 0 .52rem}
.guide-section ol,.guide-section ul{font-size:.87rem;padding-inline-start:1.25rem;margin:.44rem 0 .85rem}
.guide-section li{line-height:1.55;margin-bottom:.5rem}
.guide-section figure{margin:0}
.guide-map{border-radius:7px;overflow:hidden;background:#fbebc5;border:1px solid #ba9d69}
.guide-board{width:100%;height:auto;max-height:325px;object-fit:contain;background:#195364}
.guide-map figcaption{font-size:.79rem;line-height:1.45;padding:.5rem .68rem}
.guide-terrain,.guide-ports{display:grid;gap:.45rem;margin:.45rem 0 .8rem}
.guide-terrain{grid-template-columns:repeat(6,minmax(0,1fr))}
.guide-ports{grid-template-columns:repeat(3,minmax(0,1fr))}
.guide-terrain figure,.guide-ports figure{
  display:grid;justify-items:center;align-content:start;gap:.18rem;border:1px solid var(--line);
  border-radius:6px;background:#fff5df;text-align:center;padding:.38rem;font-size:.78rem
}
.guide-terrain figcaption span,.guide-ports figcaption span{display:block;color:#45606a;font-size:.74rem}
.guide-hex{width:68px}
.guide-port{width:43px;height:55px;object-fit:contain}
.guide-costs{width:100%;border-collapse:collapse;font-size:.81rem;line-height:1.35;margin:.32rem 0 .75rem}
.guide-costs th,.guide-costs td{border-bottom:1px solid var(--line);padding:.36rem;text-align:left}
.guide-costs th[scope="row"]{width:25%;min-width:78px}
.guide-costs .build-cost{min-width:43px}
.guide-piece{display:inline-block;width:27px;height:28px;object-fit:contain;vertical-align:middle;margin-right:.24rem}
.guide-cards{display:grid;grid-template-columns:1fr 1fr;gap:.45rem}
.guide-cards article{display:flex;gap:.45rem;align-items:center;padding:.42rem;border:1px solid var(--line);border-radius:6px;background:#fff5df}
.guide-cards h4{margin:0 0 .27rem;font-family:var(--display)}
.guide-cards p{margin:0;font-size:.77rem}
.guide-dev{width:39px;flex:none}
.notice{
  position:fixed;left:50%;bottom:1rem;transform:translateX(-50%);max-width:calc(100% - 2rem);width:max-content;z-index:10;
  padding:.64rem .95rem;border-radius:6px;border:1px solid #cbb77e;background:#173c4c;color:#fff3d7;box-shadow:var(--shadow);
  font-size:.88rem;font-weight:700;opacity:0;pointer-events:none;transition:opacity .15s ease;
}
.notice.visible{opacity:1}

@media(max-width:880px){
  .command-dock{display:grid;grid-template-columns:auto auto;gap:.44rem;justify-items:center}
  .action-panel{grid-column:1/-1;width:100%}
  .landing-island{inset:0 5vw 5rem}
  .landing-launch{bottom:1.75rem}
  .landing-view{min-height:max(575px,calc(100svh - 60px))}
}
@media(max-width:760px){
  .match-header{padding:.36rem .52rem}
  .players-rail{top:70px;width:clamp(88px,26vw,146px)}
  .map-tools{bottom:clamp(135px,19vh,181px)}
  .match-page:has(.board-prompt:not(:empty)) .map-tools{bottom:clamp(218px,27vh,260px)}
  .production-receipts{top:auto;bottom:clamp(160px,23vh,216px)}
  .history-rail{top:70px;width:min(250px,62vw);max-height:calc(100% - 230px)}
  .history-toggle{font-size:.81rem;padding:.43rem .5rem}
  .victory-goal{padding:.26rem .3rem;font-size:.68rem}
  .goal-value strong{font-size:1rem}
  .seat-strip{gap:.28rem}
  .seat.active{transform:translateX(.42rem)}
  .seat{padding:.26rem;gap:.1rem .18rem;border-left-width:3px}
  .portrait{width:22px;height:24px}
  .portrait .avatar{width:20px;height:20px}
  .seat-name b{font-size:.71rem}
  .seat-name .marker{width:9px;height:9px}
  .seat-info>span,.seat-ledger{font-size:.59rem}
  .seat-ledger{padding-top:.16rem}
  .seat-score strong{font-size:.91rem}
  .seat-score small{font-size:.51rem}
  .seat-awards .award{width:15px;height:15px}
}
@media(max-width:555px){
  .navigation{min-height:48px;padding:.32rem .55rem}
  .navigation .brand,.page-header .brand{font-size:1rem;gap:.22rem}
  .navigation .brand-icon,.page-header .brand-icon{width:29px;height:29px}
  .tools{gap:.23rem}
  .navigation .icon-button{min-height:33px;min-width:33px}
  .navigation .glyph{width:15px;height:15px}
  .navigation .button{min-height:33px;font-size:.72rem;padding:.3rem .4rem}
  .landing-view{display:flex;min-height:max(550px,calc(100svh - 48px));flex-direction:column;justify-content:flex-start}
  .landing-island{inset:0;position:relative;width:100%;height:min(55vh,392px)}
  .landing-launch{position:relative;left:auto;bottom:auto;padding:.2rem .9rem 1.3rem;margin-left:.2rem;max-width:100%;margin-top:-.9rem}
  .landing h1{font-size:2.9rem;max-width:none}
  .landing-actions{gap:.35rem}
  .landing-actions .button{padding:.47rem .65rem}
  .setup-form{grid-template-columns:1fr;gap:1.15rem}
  .setup-sheet{width:calc(100% - 1rem)}
  .hand-card,.dock-card{width:clamp(31px,9.5vw,49px)}
  .hand-row,.card-tools,.dock-awards{gap:.19rem}
  .dock-award{padding:.12rem}
  .dock-award .award{width:20px;height:26px}
  .card-count{min-width:17px;font-size:.64rem}
  .map-tools .icon-button{min-height:30px;min-width:30px}
  .command-dock{padding:.4rem;gap:.32rem}
  .turn-actions .button{min-height:33px;padding:.27rem .36rem;font-size:.71rem;gap:.2rem}
  .turn-actions .glyph{width:13px;height:13px}
  .dice-illustration img{width:18px;height:18px}
  .dice-command .button{min-height:27px}
  .footer-actions .button,.room-form .form-footer>.button{padding:.44rem .5rem}
  .place-bar{gap:.22rem;padding:.25rem}
  .place-label{flex-basis:100%;font-size:.72rem}
  .place-bar .button{font-size:.71rem;min-height:32px;padding:.25rem .4rem}
  .dialog-content,.dialog-head{padding:.64rem}
  .choice{font-size:.66rem}
  .choice small{font-size:.58rem}
  .choice-art{width:24px;height:24px}
  .award-tile{display:grid;gap:.2rem;justify-items:center;text-align:center;padding:.35rem}
  .award-art{width:39px;height:42px}
  .dev-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .deck-buy{flex-wrap:wrap}
  .guide-terrain{grid-template-columns:repeat(3,minmax(0,1fr))}
  .guide-cards{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}

.overlay {
  border: 10px solid transparent;
  border-image: url("./assets/ui/dialog-standard.webp") 47 41 47 41 stretch;
}
.overlay.celebration {
  border-width: 15px;
  border-image: url("./assets/ui/dialog-celebration.webp") 82 88 82 88 stretch;
}

.dialog-content h3,.dialog-content h4,.dialog-content legend,.dialog-footer .button,.form-footer .button{
  text-transform:capitalize;
}
