/* Girocastles: a modern, premium interface over a pixel-art world */
:root {
  --ink: #f4ecd8; --dim: #b9b2a2; --mute: #8a8578;
  --panel: rgba(21, 24, 40, 0.86); --panel2: rgba(32, 36, 58, 0.92); --line: rgba(233, 196, 106, 0.18); --line2: rgba(255, 255, 255, 0.08);
  --gold: #e9c46a; --gold2: #f4d58d; --gold-ink: #2a1f0b; --red: #e05a4f; --green: #6fcf7f;
  --radius: 14px; --shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #151a2b; color: var(--ink); font: 15px/1.45 var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: var(--gold2); }
.hidden { display: none !important; }
.grow { flex: 1; }
.sub { color: var(--dim); margin: .3em 0; }
.small, small { font-size: 12.5px; }
#bg { position: fixed; inset: 0; width: 100vw; height: 100vh; image-rendering: pixelated; z-index: 0; filter: saturate(1.05); }
#bar { position: fixed; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); z-index: 20;
  background: linear-gradient(180deg, rgba(12, 14, 26, .82), rgba(12, 14, 26, 0)); }
body.playing #bar { display: none; }
.logo { display: flex; align-items: center; gap: 9px; background: none; border: 0; padding: 4px; font: 700 15px/1 var(--serif); letter-spacing: .18em; color: var(--gold); }
.pill { white-space: nowrap; background: rgba(20, 22, 38, .7); border: 1px solid var(--line2); border-radius: 999px; padding: 7px 14px; backdrop-filter: blur(8px); }
.pill:hover { border-color: var(--line); }
.net { font-size: 13px; color: var(--gold2); background: rgba(80, 40, 10, .6); padding: 5px 10px; border-radius: 999px; }
#app { position: fixed; inset: 0; overflow: auto; z-index: 5; padding: 64px 16px 24px; }
.loading { display: grid; place-items: center; height: 70vh; color: var(--dim); font: 600 18px var(--serif); letter-spacing: .05em; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; padding: 10px 16px; border: 1px solid rgba(255, 255, 255, .14);
  background: linear-gradient(180deg, rgba(60, 64, 96, .9), rgba(40, 43, 68, .95)); font-weight: 600; box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 4px 14px rgba(0, 0, 0, .25);
  transition: transform .12s ease, filter .12s ease, border-color .12s; white-space: nowrap; }
.btn:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn.gold { background: linear-gradient(180deg, #f6dc94, #dcae4c); color: var(--gold-ink); border-color: #f8e3a8; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.btn.ghost { background: rgba(255, 255, 255, .05); box-shadow: none; }
.btn.big { padding: 14px 22px; font-size: 16.5px; border-radius: 12px; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.seg { display: inline-flex; background: rgba(0, 0, 0, .25); border: 1px solid var(--line2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 7px; color: var(--dim); font-weight: 600; font-size: 13.5px; }
.seg button.on { background: var(--gold); color: var(--gold-ink); }
.seg.wide { width: 100%; } .seg.wide button { flex: 1; }

/* home */
.hero { position: relative; max-width: 520px; margin: 9vh auto 0; padding: 34px 30px 26px; text-align: center; border-radius: 22px; background: radial-gradient(120% 140% at 50% 0%, rgba(30, 32, 56, .9), rgba(14, 16, 30, .9)); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(10px); animation: rise .5s ease both; }
.hero h1 { font: 700 clamp(40px, 9vw, 64px)/1 var(--serif); margin: 0 0 8px; letter-spacing: .02em; color: var(--ink); text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.hero h1 span { color: var(--gold); }
.hero .tag { color: var(--dim); margin: 0 0 24px; font-size: 16px; }
.menu { display: grid; gap: 10px; }
.join { display: flex; gap: 8px; }
.join input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .3em; text-align: center; font: 700 18px var(--sans); background: rgba(0, 0, 0, .3); border: 1px solid var(--line2); border-radius: 12px; padding: 12px; }
.join input:focus { outline: 2px solid var(--gold); }
.stage { color: var(--mute); margin: 18px 0 0; font-size: 13px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* cards, fields */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.field { display: grid; gap: 6px; margin: 10px 0; }
.field > label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--mute); font-weight: 700; }
.field small { color: var(--mute); }
input[type=text], input[type=password], input[type=number], select { background: rgba(0, 0, 0, .3); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 11px; font-size: 16px; min-width: 0; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.row { display: flex; gap: 6px; align-items: center; } .row input { width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tog { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; cursor: pointer; font-weight: 600; }
.tog input { display: none; }
.tog span { width: 40px; height: 22px; border-radius: 99px; background: rgba(255, 255, 255, .15); position: relative; transition: background .15s; flex: none; }
.tog span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.tog input:checked + span { background: var(--gold); } .tog input:checked + span::after { transform: translateX(18px); }
.tog small { flex-basis: 100%; color: var(--mute); font-weight: 400; padding-left: 50px; margin-top: -6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line2); font-size: 13.5px; cursor: pointer; }
.chip input { accent-color: var(--gold); margin: 0; } .chip.dim { opacity: .55; }
.later { color: var(--mute); font-size: 12.5px; border-left: 2px solid var(--line); padding-left: 10px; margin: 14px 0 4px; }
.note { background: rgba(233, 196, 106, .08); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--dim); }

/* lobby */
.lobby { display: grid; grid-template-columns: minmax(300px, 420px) minmax(320px, 620px); gap: 16px; justify-content: center; align-items: start; max-width: 1100px; margin: 0 auto; animation: rise .4s ease both; }
.room { padding: 16px; }
.room header, .settings header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.room header > div { flex: 1; }
.room h2 { margin: 0; font: 700 30px/1 var(--serif); letter-spacing: .18em; color: var(--gold); }
.room h2.solo { letter-spacing: .02em; font-size: 24px; }
.room header small { color: var(--mute); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; }
.seats { display: grid; gap: 6px; }
.seat { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line2); }
.seat.me { border-color: var(--line); background: rgba(233, 196, 106, .07); }
.seat .dot { width: 14px; height: 14px; border-radius: 4px; flex: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); }
.seat .nm { flex: 1; min-width: 0; display: grid; } .seat .nm small { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat em { font-style: normal; font-size: 11px; color: var(--mute); text-transform: capitalize; } .seat em.hostb { color: var(--gold); } .seat em.off { color: var(--red); }
.seat select { padding: 5px 24px 5px 8px; font-size: 13px; }
.seat .x { background: none; border: 0; color: var(--mute); font-size: 20px; padding: 0 4px; }
.seat.empty { border-style: dashed; color: var(--mute); justify-content: space-between; flex-wrap: wrap; }
.watchers { color: var(--dim); font-size: 13px; }
.mychoice { margin-top: 14px; width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, transparent), rgba(255, 255, 255, .03)); }
.mychoice > span:nth-child(2) { flex: 1; display: grid; } .mychoice small { color: var(--mute); text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; font-weight: 700; }
.mychoice b { font: 700 20px var(--serif); } .mychoice em { color: var(--dim); font-style: normal; font-size: 13px; } .mychoice .go { color: var(--gold); font-weight: 700; }
.ficon { width: 46px; height: 46px; display: grid; place-items: center; font-size: 26px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line2); flex: none; }
.ficon.big { width: 64px; height: 64px; font-size: 36px; }
.colours { display: flex; gap: 6px; margin: 10px 0 0; flex-wrap: wrap; }
.colours button { width: 26px; height: 26px; border-radius: 8px; border: 2px solid rgba(0, 0, 0, .3); background: var(--c); }
.colours button.on { box-shadow: 0 0 0 2px var(--gold); } .colours button:disabled { opacity: .2; }
.lchat { margin-top: 14px; border-top: 1px solid var(--line2); padding-top: 10px; }
.lchat .lines { max-height: 120px; overflow: auto; font-size: 13.5px; } .lchat p { margin: 3px 0; } .lchat b { color: var(--gold2); }
.lchat form { display: flex; gap: 6px; margin-top: 6px; } .lchat input { flex: 1; padding: 7px 10px; font-size: 14px; }
.settings { padding: 16px; max-height: calc(100vh - 90px); overflow: auto; }
.settings header h3 { margin: 0; flex: 1; font: 700 20px var(--serif); } .settings header small { color: var(--mute); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line2); margin-bottom: 10px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 12px; color: var(--dim); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--gold); border-bottom-color: var(--gold); }
.tabbody.ro { pointer-events: none; opacity: .85; }
.premades { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.pm { text-align: left; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line2); display: grid; gap: 3px; }
.pm.on { border-color: var(--gold); background: rgba(233, 196, 106, .08); } .pm small { color: var(--dim); } .pm em { color: var(--gold2); font-style: normal; font-size: 12px; }
.sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin: 8px 0; }
.sliders label { display: grid; font-size: 13px; color: var(--dim); } .sliders input { accent-color: var(--gold); }
.preview { margin-top: 10px; } .preview canvas { width: 100%; image-rendering: pixelated; border-radius: 10px; border: 1px solid var(--line2); background: #1f4f7d; }
.settings footer { position: sticky; bottom: -16px; margin: 14px -16px -16px; padding: 14px 16px; background: linear-gradient(180deg, rgba(21, 24, 40, 0), var(--panel2) 30%); border-radius: 0 0 18px 18px; text-align: center; }
.settings footer .btn { width: 100%; }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--panel2); color: var(--ink); padding: 22px; width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow); }
dialog.wide { width: min(900px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(6, 8, 16, .6); backdrop-filter: blur(3px); }
dialog h3 { margin: 0 0 6px; font: 700 22px var(--serif); } dialog h4 { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--mute); }
.dbtn { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.col { display: grid; gap: 8px; margin: 12px 0; }
.err { color: var(--red); min-height: 1.2em; font-size: 14px; }
.keys { padding-left: 18px; color: var(--dim); font-size: 14px; } .howto li { margin: 4px 0; }
.picker { display: grid; grid-template-columns: 250px 1fr; gap: 18px; }
.flist { display: grid; gap: 4px; align-content: start; max-height: 70vh; overflow: auto; }
.fopt { display: flex; gap: 10px; align-items: center; text-align: left; padding: 7px 8px; border-radius: 12px; border: 1px solid transparent; background: none; }
.fopt .ficon { width: 38px; height: 38px; font-size: 21px; } .fopt small { display: block; color: var(--mute); font-size: 11.5px; }
.fopt.on { background: rgba(233, 196, 106, .1); border-color: var(--line); } .fopt.later { opacity: .4; }
.fdetail header { display: flex; gap: 14px; align-items: center; } .fdetail header small { color: var(--dim); }
.fdetail p { color: var(--dim); }
.ratings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 10px 0; }
.ratings div { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--dim); }
.ratings i { display: flex; gap: 3px; } .ratings b { width: 16px; height: 7px; border-radius: 2px; background: rgba(255, 255, 255, .12); } .ratings b.on { background: var(--gold); }
.traits { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; margin: 6px 0; } .traits li { background: rgba(255, 255, 255, .06); padding: 4px 9px; border-radius: 99px; font-size: 12.5px; }
.cmds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cmd { display: grid; gap: 2px; text-align: left; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line2); }
.cmd.on { border-color: var(--gold); background: rgba(233, 196, 106, .09); } .cmd small { color: var(--gold2); } .cmd span { font-size: 12.5px; color: var(--dim); }

/* toasts */
.toast { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 60; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow); animation: drop .25s ease both; max-width: calc(100vw - 32px); font-weight: 600; }
.toast.bad { border-color: rgba(224, 90, 79, .6); background: rgba(70, 20, 22, .95); }
.toast.out { opacity: 0; transition: opacity .5s; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -10px); } }

/* ---------- the game ---------- */
#play { position: fixed; inset: 0; z-index: 10; }
.game { position: absolute; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.game canvas.world { position: absolute; inset: 0; image-rendering: pixelated; cursor: crosshair; }
.hud { position: absolute; z-index: 3; }
.hud.top { top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(14, 16, 28, .92), rgba(14, 16, 28, .72)); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.crest { width: 38px; height: 38px; display: grid; place-items: center; font-size: 21px; border-radius: 10px; background: linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 50%, #000)); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .4); }
.who { display: grid; line-height: 1.15; min-width: 0; } .who b { font: 700 15px var(--serif); } .who small { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.gold { background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-size: 14px; } .gold b { color: var(--gold2); font-variant-numeric: tabular-nums; }
.turn { color: var(--dim); font-size: 13px; font-weight: 600; }
.steps { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--mute); } .steps i { font-style: normal; opacity: .5; }
.step { padding: 3px 8px; border-radius: 99px; } .step.on { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.code { font: 700 14px var(--sans); letter-spacing: .2em; color: var(--gold2); background: rgba(0, 0, 0, .3); border-radius: 8px; padding: 5px 9px; }
.btn.ready { background: linear-gradient(180deg, #8fe39b, #4fae60); color: #08210d; border-color: #b6f0bf; min-width: 150px; }
.btn.ready.is { background: rgba(111, 207, 127, .15); color: var(--green); border-color: rgba(111, 207, 127, .5); }
.hud.tools { left: 12px; top: 70px; display: grid; gap: 6px; padding: 6px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tool { width: 62px; display: grid; justify-items: center; gap: 1px; padding: 7px 4px; border-radius: 10px; border: 1px solid transparent; background: none; }
.tool span { font-size: 20px; } .tool small { font-size: 9.5px; color: var(--dim); text-align: center; line-height: 1.1; }
.tool.on { background: rgba(233, 196, 106, .14); border-color: var(--line); } .tool:hover { background: rgba(255, 255, 255, .06); }
.hud.subtools { left: 90px; top: 70px; width: 250px; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); max-height: calc(100vh - 190px); overflow: auto; }
.subtools h4 { margin: 4px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--mute); }
.mats { display: grid; gap: 4px; }
.mat { display: grid; grid-template-columns: 22px 1fr; text-align: left; gap: 0 8px; padding: 6px 8px; border-radius: 10px; border: 1px solid transparent; background: rgba(255, 255, 255, .03); }
.mat i { grid-row: span 2; width: 22px; height: 22px; border-radius: 5px; align-self: center; }
.mat b { font-size: 13px; } .mat small { color: var(--dim); font-size: 11.5px; } .mat.on { border-color: var(--gold); background: rgba(233, 196, 106, .09); }
.m-palisade { background: repeating-linear-gradient(90deg, #9a6c3e 0 4px, #6d4a29 4px 5px); } .m-stone { background: repeating-linear-gradient(0deg, #a9a59c 0 5px, #7f7b74 5px 6px); }
.m-reinforced { background: repeating-linear-gradient(0deg, #d1cab9 0 5px, #8a8475 5px 6px); } .m-iron { background: linear-gradient(90deg, #7e828c 45%, #3b3e46 45% 55%, #7e828c 55%); }
.brush { display: flex; gap: 6px; }
.brush button { flex: 1; display: grid; justify-items: center; gap: 4px; padding: 6px; border-radius: 9px; border: 1px solid transparent; background: rgba(255, 255, 255, .04); font-size: 12px; }
.brush button i { background: var(--ink); display: block; } .brush button.on { border-color: var(--gold); }
.blist { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.bopt { display: grid; justify-items: center; gap: 1px; padding: 6px 4px; border-radius: 10px; border: 1px solid transparent; background: rgba(255, 255, 255, .04); }
.bopt canvas { width: 48px; height: 48px; image-rendering: pixelated; } .bopt b { font-size: 12px; } .bopt small { color: var(--gold2); font-size: 11px; }
.bopt.on { border-color: var(--gold); background: rgba(233, 196, 106, .09); }
.hint { color: var(--dim); font-size: 12.5px; margin: 10px 0 0; }
.hud.players { right: 12px; top: 70px; width: 230px; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.players h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--mute); }
.pl { display: flex; align-items: center; gap: 7px; padding: 4px 0; font-size: 13.5px; } .pl.me .nm { color: var(--gold2); }
.pl i { width: 10px; height: 10px; border-radius: 3px; flex: none; } .pl .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pl .nm small { color: var(--mute); font-size: 10px; }
.pl .rg { color: var(--dim); font-size: 12px; } .pl .rdy { width: 18px; text-align: center; color: var(--mute); } .pl .rdy.y { color: var(--green); font-weight: 700; }
.hud.minimap { right: 12px; bottom: 12px; border-radius: 10px; border: 2px solid rgba(233, 196, 106, .35); box-shadow: var(--shadow); image-rendering: pixelated; cursor: pointer; background: #1f4f7d; }
.hud.tip { left: 50%; bottom: 14px; transform: translateX(-50%); max-width: min(620px, calc(100vw - 280px)); padding: 9px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line2); color: var(--dim); font-size: 13.5px; text-align: center; box-shadow: var(--shadow); }
.hud.choose { left: 12px; top: 70px; width: 300px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); max-height: calc(100vh - 100px); overflow: auto; }
.choose h3 { margin: 0 0 4px; font: 700 19px var(--serif); color: var(--gold2); } .choose p { color: var(--dim); font-size: 13.5px; margin: 4px 0 10px; }
.starts { display: grid; gap: 6px; }
.start { text-align: left; display: grid; gap: 2px; padding: 9px 10px; border-radius: 11px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line2); }
.start:hover:not(:disabled) { border-color: var(--gold); } .start small { color: var(--dim); font-size: 12px; } .start meter { width: 100%; height: 6px; }
.hud.chat { left: 12px; bottom: 12px; width: 280px; font-size: 13px; }
.chat .lines p { margin: 2px 0; background: rgba(14, 16, 28, .7); padding: 3px 8px; border-radius: 7px; width: fit-content; max-width: 100%; } .chat b { color: var(--gold2); }
.chat .lines { opacity: .75; } .chat.fresh .lines { opacity: 1; }
.chat input { width: 100%; margin-top: 4px; padding: 6px 10px; font-size: 13px; border-radius: 9px; background: rgba(14, 16, 28, .75); border: 1px solid var(--line2); }
.game .toast { top: 74px; }
.phase-banner { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); z-index: 4; text-align: center; pointer-events: none; display: grid; gap: 4px; }
.phase-banner b { font: 700 clamp(34px, 6vw, 58px)/1 var(--serif); color: var(--gold2); text-shadow: 0 3px 0 rgba(0, 0, 0, .5), 0 0 30px rgba(0, 0, 0, .5); letter-spacing: .04em; }
.phase-banner span { color: var(--ink); text-shadow: 0 2px 6px rgba(0, 0, 0, .8); font-weight: 600; }
.phase-banner.go { animation: banner 2.6s ease both; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.96); } 15%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -56%); } }
.pause { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(8, 10, 20, .45); backdrop-filter: blur(2px); pointer-events: none; }
.pause div { display: grid; text-align: center; } .pause b { font: 700 46px var(--serif); color: var(--gold2); } .pause span { color: var(--dim); }

/* phones and small tablets */
@media (max-width: 900px) {
  .lobby { grid-template-columns: 1fr; }
  .settings { max-height: none; }
  .steps, .turn { display: none; }
}
@media (max-width: 760px) {
  #app { padding: 60px 10px 16px; }
  .hero { margin-top: 4vh; padding: 26px 18px 20px; }
  .grid2, .sliders, .premades { grid-template-columns: 1fr; }
  .picker { grid-template-columns: 1fr; } .flist { grid-template-columns: 1fr 1fr; max-height: 30vh; } .cmds { grid-template-columns: 1fr; }
  .who small, .code, .gold + .turn { display: none; }
  .hud.top { gap: 6px; padding-left: 8px; padding-right: 8px; } .btn.ready { min-width: 0; padding: 8px 10px; font-size: 13.5px; }
  .hud.top .btn.ghost { padding: 8px 10px; } .hud.top #pz .lbl { display: none; } .who b { font-size: 13px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .crest { width: 32px; height: 32px; font-size: 17px; } .gold { padding: 4px 9px; font-size: 13px; }
  .hud.minimap { transform: scale(.55); }
  .hud.players { display: none; }
  .hud.tools { top: auto; bottom: 8px; left: 8px; right: 8px; display: flex; overflow-x: auto; padding: 4px; }
  .tool { width: auto; min-width: 54px; flex: 1; }
  .hud.subtools { left: 8px; right: 8px; width: auto; top: auto; bottom: 78px; max-height: 38vh; }
  .hud.minimap { top: 62px; bottom: auto; right: 8px; transform: scale(.7); transform-origin: top right; }
  .hud.tip { bottom: 80px; max-width: calc(100vw - 20px); font-size: 12.5px; }
  .hud.chat { display: none; }
  .hud.choose { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; max-height: 42vh; }
}
