/* Tablets and phones: one hand, thumbs, and a private screen. */
body.tablet { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
#joinScreen { display: flex; flex-direction: column; gap: 16px; padding-top: 6vh; }
#joinScreen:not(.hidden) { display: flex; }
.brand { text-align: center; }
.crest { color: var(--brass); letter-spacing: .4em; }
.center { text-align: center; }

.bar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: rgba(18, 13, 10, .92); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.codechip { font-size: 1.5rem; color: var(--brass-2); letter-spacing: .12em; }
.tabs { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.tabs button { min-height: 38px; padding: 6px 14px; border-radius: 999px; font-size: .92rem; white-space: nowrap; }
.tabs button.on { background: linear-gradient(180deg, var(--brass-2), var(--brass)); color: #1c1410; }
.tab { padding-top: 16px; }

.turn { font-size: 1.4rem; color: var(--brass-2); margin: 0 0 10px; text-align: center; }
.turn.mine { color: var(--ivory); }
#board { max-width: 520px; margin: 0 auto; }
.secret { max-width: 320px; margin: 0 auto; }
.secret .where { font-family: var(--serif); font-size: 1.6rem; color: var(--brass-2); text-align: center; margin-top: 10px; }

.screen-row { flex-wrap: wrap; }
.screen-row select { width: auto; min-height: 38px; padding: 6px 10px; }
.addscreen summary { cursor: pointer; color: var(--brass-2); font-weight: 600; }

.log { list-style: none; padding: 0; margin: 0; }
.log li { padding: 4px 0; }

.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 60; padding: 16px; }
.sheet .panel { width: 100%; max-width: 520px; }

/* Narrow phones: the tabs need the room, so the code moves into the menu. */
.menucode { display: none; }
@media (max-width: 480px) {
  .codechip { display: none; }
  .menucode { display: block; }
  .tabs button { padding: 6px 11px; font-size: .86rem; }
}

/* A game on sale that nobody at the table owns yet. */
.locked-note { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(201, 162, 39, .08); }
.locked-note p { margin: 0 0 8px; }

/* ---------- the title screen ---------- */
#titleScreen:not(.hidden), #accountScreen:not(.hidden) { display: flex; flex-direction: column; gap: 14px; }
#titleScreen { max-width: 520px; padding-top: 10px; min-height: 100vh; }
.titlebar { display: flex; align-items: center; gap: 10px; min-height: 60px; }
/* Skeeple's round bubbles: your account and settings on the left, sign out on the right. */
.bubble { width: 52px; height: 52px; min-height: 0; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 1.45rem; line-height: 1; text-decoration: none; color: var(--ivory); cursor: pointer;
  background: linear-gradient(180deg, rgba(243, 234, 218, .16), rgba(243, 234, 218, .04)); border: 1px solid rgba(243, 234, 218, .28);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 6px 14px rgba(0, 0, 0, .3); }
.bubble:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.bubble.acct { width: 60px; height: 60px; font-size: 1.7rem; }
.bubble.acct.in { background: linear-gradient(180deg, var(--brass-2), var(--brass)); border-color: var(--brass-2); color: var(--wood-0, #1a120d); font-family: var(--serif); font-weight: 700; }
.bubble:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.hero { text-align: center; padding: 0 0 6px; position: relative; z-index: 1; }
/* The logo: a brass emblem that floats and catches the light. The words are the picture's;
   the heading stays for screen readers, and shows if the picture can't load. */
.emblem { position: relative; width: min(78%, 340px); margin: 0 auto; aspect-ratio: 959 / 915; display: grid; place-items: center;
  animation: emblem-float 7s ease-in-out infinite; }
.emblem-art { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 14px 26px rgba(0, 0, 0, .65)) drop-shadow(0 0 18px rgba(227, 194, 90, .18)); }
.emblem::after { content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  -webkit-mask: url(/art/title/logo.webp) center / contain no-repeat; mask: url(/art/title/logo.webp) center / contain no-repeat;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 244, 200, .9) 50%, transparent 62%) -160% 0 / 250% 100% no-repeat;
  animation: emblem-shine 6s ease-in-out 1.2s infinite; }
.emblem .logo { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.emblem.no-art { aspect-ratio: auto; animation: none; }
.emblem.no-art::after, .emblem.no-art .emblem-art { display: none; }
.emblem.no-art .logo { position: static; width: auto; height: auto; margin: 18px 0 8px; overflow: visible; clip: auto; }
.logo { font-size: clamp(1.8rem, 8.6vw, 3.1rem); white-space: nowrap; letter-spacing: .12em; text-indent: .12em; line-height: 1; margin-top: 10px; }
@keyframes emblem-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes emblem-shine { 0% { background-position: -160% 0; } 45%, 100% { background-position: 260% 0; } }

/* The gearworks behind the title screen (public/title-gears.js lays the gears out). */
.gearworks { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(ellipse at 50% 32%, rgba(18, 13, 10, .15), rgba(18, 13, 10, .72) 70%), url(/art/title/backdrop.webp) center / cover no-repeat; }
.gearworks::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(227, 194, 90, .1), transparent 55%); }
.gear { position: absolute; max-width: none; opacity: .5; filter: brightness(.8) drop-shadow(0 10px 18px rgba(0, 0, 0, .6));
  transform: rotate(var(--r0, 0deg)); animation: gear-turn linear infinite; will-change: transform; }
.gear.far { opacity: .32; filter: brightness(.6) blur(1px); }
@keyframes gear-turn { from { transform: rotate(var(--r0, 0deg)); } to { transform: rotate(calc(var(--r0, 0deg) + 360deg)); } }
#titleScreen > :not(.gearworks) { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .gear, .emblem, .emblem::after { animation: none; }
}
.resume { border-color: var(--brass); background: rgba(201, 162, 39, .1); }
.resume p { margin: 0 0 12px; }
.title-menu { display: grid; gap: 10px; }
/* Play holds Play a game and the Store: hidden until Play is pressed, then shown inside its frame. */
.play-group { display: grid; gap: 0; border-radius: 22px; transition: background .2s ease, box-shadow .2s ease, padding .2s ease; }
.play-group.open { padding: 8px 8px 12px; background: linear-gradient(180deg, rgba(227, 194, 90, .16), rgba(28, 20, 16, .82));
  box-shadow: inset 0 0 0 2px rgba(201, 162, 39, .55), 0 14px 30px rgba(0, 0, 0, .5); }
.play-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 4px 0; animation: play-open .28s ease-out; }
.play-menu .btn.plaque { min-height: 70px; border-width: 16px 26px; border-image-width: 16px 26px; font-size: 1rem; }
.play-menu .btn.plaque small { font-size: .72rem; }
.play-menu[hidden] { display: none; }
@keyframes play-open { from { opacity: 0; transform: translateY(-8px); } }
/* Gear-themed buttons: a brass (gold) or iron plaque stretched by its middle, ends kept whole. */
.btn.plaque { position: relative; border-style: solid; border-color: transparent; border-width: 19px 34px; border-image: url(/art/title/plaque-iron.webp) 25% 12% fill / 19px 34px stretch;
  background: none; box-shadow: none; color: var(--ivory); text-shadow: 0 1px 2px rgba(0, 0, 0, .8); padding: 2px 6px; min-height: 76px; border-radius: 0;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .55)); transition: transform .12s ease, filter .12s ease; }
.btn.plaque.gold { border-image-source: url(/art/title/plaque-gold.webp); color: #2a1a08; text-shadow: 0 1px 0 rgba(255, 240, 190, .55); }
.btn.plaque:hover { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6)) brightness(1.08); }
.btn.plaque:active { transform: translateY(2px) scale(.99); }
.btn.plaque:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 4px; }
/* Invite players: the join QR code in the lobby. */
.invite:not(.hidden) { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.invite .qr { background: var(--ivory); padding: 10px; border-radius: 10px; flex: none; }
.invite .qr img, .invite .qr canvas { display: block; width: 150px !important; height: auto !important; }
.invite .stack { flex: 1 1 180px; }
.invite h2, .invite p { margin: 0; }
.joincode { font-size: 2rem; letter-spacing: .18em; color: var(--brass-2); }
.btn.big { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 62px; padding: 12px 16px; font-size: 1.12rem; font-weight: 700; text-decoration: none; text-align: center; }
.btn.big small { font-size: .8rem; font-weight: 400; opacity: .78; }
.titlefoot { margin-top: auto; display: flex; justify-content: center; align-items: center; gap: 14px; padding: 18px 0 6px; }
.buildtag { background: none; border: none; min-height: 32px; padding: 4px 8px; color: var(--muted); font-size: .78rem; box-shadow: none; }
/* Settings */
.setpanel { max-height: calc(100vh - 32px); overflow-y: auto; background: linear-gradient(180deg, #2a1e17, #1a120d); }
.setpanel input[type="range"] { accent-color: var(--brass-2); width: 100%; }
.setgroup .switchrow { margin: 2px 0; min-height: 32px; color: var(--ivory); }
.sheet .setpanel { align-self: center; }
.setgroup { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid rgba(243, 234, 218, .15); background: rgba(0, 0, 0, .2); }
.setgroup h3 { margin: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-family: inherit; }
.setgroup label { margin: 4px 0 0; }
.setgroup p { margin: 0; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg button { min-height: 40px; padding: 4px; font-size: .9rem; }
.seg button.on { background: var(--brass-2); color: var(--wood-0, #1a120d); border-color: var(--brass-2); }
.menurow { gap: 8px; }
#accountScreen { max-width: 560px; padding-top: 16px; }

/* undo */
.undobar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px; border-radius: 14px;
  background: rgba(201, 162, 39, .12); border: 1px solid rgba(201, 162, 39, .45); }
.undobar span { flex: 1; min-width: 160px; }

/* chat */
.tabs .badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--danger, #b5483b); color: #fff; font-size: .74rem; line-height: 18px; }
.chatlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.chatlist li { display: flex; flex-direction: column; align-items: flex-start; max-width: 100%; }
.chatlist li.mine { align-items: flex-end; }
.chatlist .who { font-size: .78rem; font-weight: 700; margin-bottom: 2px; }
.chatlist .who .muted { font-weight: 600; margin-left: 6px; }
.chatlist .bubble { max-width: 85%; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  white-space: pre-wrap; word-break: break-word; }
.chatlist li.mine .bubble { background: rgba(201, 162, 39, .16); border-color: rgba(201, 162, 39, .4); }
.chatlist li.whisper .bubble { background: rgba(110, 90, 168, .2); border-color: rgba(140, 123, 176, .55); }
.chatto label { min-width: 22px; }
.chatsend input { min-width: 0; }

/* music in the menu */
.musicrow input[type=range] { display: block; width: 100%; margin: 10px 0 0; accent-color: var(--brass-2); }
.musicrow p { margin: 8px 0 0; }

/* the dice tray */
.dicepanel { max-height: 88vh; overflow-y: auto; background: linear-gradient(180deg, #33261c, #261c15); }
.traypick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.traydie { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; background: rgba(0, 0, 0, .2); border: 1px solid rgba(239, 230, 210, .12); }
.traydie.on { border-color: var(--brass-2); background: rgba(201, 162, 39, .12); }
.traydie b { font-size: 1rem; }
.traydie .count { display: flex; align-items: center; gap: 4px; }
.traydie .count button { min-height: 30px; width: 30px; min-width: 0; padding: 0; border-radius: 50%; }
.traydie .count span { min-width: 1.4em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.dicesets { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
@media (max-width: 480px) { .dicesets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.diceset { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-width: 0; white-space: normal; padding: 8px 4px 9px; border-radius: 12px; text-align: center; border: 2px solid rgba(239, 230, 210, .18); background: rgba(0, 0, 0, .2); min-height: 0; }
.diceset.on { border-color: var(--brass-2); background: rgba(201, 162, 39, .18); }
.diceset b { display: block; font-size: .85rem; margin-top: 2px; }
.diceset small { display: block; font-size: .68rem; line-height: 1.25; color: var(--muted, #b8ab93); margin-top: 2px; }
.switchrow { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.switchrow input { width: 20px; height: 20px; accent-color: var(--brass-2); }
/* Which cards and tiles a screen shows: one switch per deck. */
.modpick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.modpick .chipbtn { min-height: 34px; padding: 4px 12px; border-radius: 999px; }
.modpick .chipbtn.on { background: linear-gradient(180deg, var(--brass-2), var(--brass)); color: #1c1410; }

/* ---- Drawers (public/drawers.js), like Skeeple's game drawers: tabs on the right edge, a drawer
   sliding out for the one picked, ‹ › or a swipe to move through them. ---- */
:root { --dw: min(460px, calc(100vw - 44px)); }
.dtabs {
  position: fixed; right: 0; top: 84px; z-index: 46; display: flex; flex-direction: column; gap: 6px;
  transition: transform .3s ease; transform: translateX(0);
}
body.drawer-open .dtabs { transform: translateX(calc(-1 * var(--dw))); }
.dtabs.away { transform: translateX(48px); pointer-events: none; }
.dtab {
  position: relative; width: 34px; height: clamp(54px, calc((100vh - 130px) / var(--n) - 6px), 116px); min-height: 0; padding: 0;
  border-radius: 14px 0 0 14px; border: 1px solid var(--brass); border-right: none;
  background: linear-gradient(180deg, #4a3526, #2a1e17); color: var(--ivory); cursor: grab; touch-action: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; box-shadow: -6px 0 16px rgba(0, 0, 0, .3); overflow: hidden;
}
.dtab.on { background: linear-gradient(180deg, #f3d77a, var(--brass)); color: #1c1410; }
.dtab .dicon { font-size: 15px; line-height: 1; }
.dtab .dname { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: calc(100% - 26px); }
.dtab .ddot-on, .dpeek.dot::after { position: absolute; top: 6px; left: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--brass-2); content: ''; }
.dtab.on .ddot-on { background: #1c1410; }
.dpeek {
  position: fixed; right: 0; top: 84px; z-index: 46; width: 22px; height: 58px; min-height: 0; padding: 0; border-radius: 12px 0 0 12px;
  border: 1px solid var(--brass); border-right: none; background: linear-gradient(180deg, #4a3526, #2a1e17); color: var(--ivory); font-size: 18px;
}
.dpanel {
  position: fixed; top: 0; bottom: 0; right: 0; width: var(--dw); z-index: 45; transform: translateX(calc(var(--dw) + 40px)); transition: transform .25s ease;
  background: linear-gradient(180deg, var(--wood-2), var(--wood-1)); border-left: 1px solid var(--brass); box-shadow: -12px 0 30px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; visibility: hidden;
}
.dpanel.open { transform: none; visibility: visible; }
.dhead { padding: 10px 8px 8px; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .15); }
.dnav { display: flex; align-items: center; gap: 4px; }
.dbtn { background: none; border: none; color: var(--ivory); font-size: 26px; line-height: 1; padding: 2px 10px; min-height: 40px; }
.dclose { font-size: 24px; }
.dtitle { flex: 1; text-align: center; font-size: 1.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ddots { display: flex; justify-content: center; gap: 7px; margin-top: 4px; }
.ddots button { width: 9px; height: 9px; min-height: 0; padding: 0; border-radius: 50%; border: none; background: rgba(239, 230, 210, .3); }
.ddots button.on { background: var(--brass-2); }
.dbody { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px 12px 40px; }
.dbody > * + * { margin-top: 12px; }
.dbody .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.dlog { list-style: none; margin: 0; padding: 0; }
.dlog li { padding: 6px 0; border-bottom: 1px solid rgba(201, 162, 39, .12); font-size: .92rem; }
.dhint { font-size: .82rem; color: var(--muted); }
/* the page keeps a strip clear on the right so the tabs only just touch it */
body.has-drawers #tableScreen { padding-right: 14px; }

/* ---- My resources: a drawer from the bottom edge (ResDrawer in public/drawers.js). Closed, its
   strip shows each resource and its count; open, it covers the lower part of the screen. ---- */
.rdrawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 44; height: min(62vh, 560px); display: flex; flex-direction: column;
  transform: translateY(calc(100% - 58px)); transition: transform .28s ease;
  background: linear-gradient(180deg, var(--wood-2), var(--wood-1)); border-top: 1px solid var(--brass);
  border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .45);
}
.rdrawer.open { transform: translateY(0); }
.rdrawer.dragging { transition: none; }
.rstrip {
  position: relative; flex: 0 0 58px; min-height: 58px; width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px;
  background: none; border: none; border-radius: 18px 18px 0 0; color: var(--ivory); cursor: grab; touch-action: none; text-align: left;
}
.rgrip { position: absolute; left: 50%; top: 5px; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: rgba(239, 230, 210, .35); }
.rsum { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.rsum::-webkit-scrollbar { display: none; }
.rchip { flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); font-size: .85rem; white-space: nowrap; }
.rchip b { font-family: var(--serif); font-size: 1.15rem; color: var(--brass-2); }
.rchip.turn { background: linear-gradient(180deg, var(--brass-2), var(--brass)); color: #1c1410; font-weight: 700; }
.rchev { flex: 0 0 auto; font-size: 1.1rem; transition: transform .28s; }
.rdrawer.open .rchev { transform: rotate(180deg); }
.rbody { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px 24px; }
.rbody > * + * { margin-top: 12px; }
body.has-rdrawer #tableScreen { padding-bottom: 70px; }
body.has-rdrawer .dtab { height: clamp(48px, calc((100vh - 200px) / var(--n) - 6px), 116px); }
.rchip i { font-style: normal; color: var(--ivory-2); }
@media (max-width: 600px) { .rchip i { display: none; } }
body.rdrawer-open .dtabs, body.rdrawer-open .dpeek { z-index: 43; }

/* The ⓘ sheet and "Complete this action?" */
.actpanel { max-height: 86vh; overflow-y: auto; }
.actq { font-size: 1.2rem; color: var(--brass-2); margin: 4px 0 0; text-align: center; }
.actbtns { gap: 10px; }
.pinfo p { margin: 0 0 8px; line-height: 1.5; }
.symkey { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 6px; }
.symkey li { display: flex; align-items: center; gap: 10px; }
.symkey .sym { font-size: .85rem; min-width: 44px; justify-content: center; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; min-height: 56px; }
.choice img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; flex: none; }
.choice .grow { display: flex; flex-direction: column; gap: 2px; }
.choice.on { border-color: var(--brass-2); box-shadow: 0 0 0 2px rgba(227, 194, 90, .55); background: rgba(227, 194, 90, .12); }
.emore .morebtns, .dbody .morebtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.setgroup .switchrow input { min-height: 0; margin: 0; }

/* ---------- the main board, as big as the screen allows ---------- */
/* A game made with the engine: the Board tab is as wide as the screen, and the board picture as
   big as fits between the turn line and the resource strip (tablet.js fitBoard sets its width). */
#tabBoard.wide { max-width: none; padding: 8px 8px 12px; }
#tabBoard.wide #engineTab { padding: 8px 10px 12px; gap: 6px; }
#tabBoard.wide .turn { margin: 0; font-size: 1.15rem; }
#tabBoard.wide #ePlaces .boardscroll { margin-bottom: 8px; }
#tabBoard.wide #ePlaces .boardpic { margin-inline: auto; }
.eturnrow { display: flex; align-items: center; gap: 8px; }
.eturnrow .turn { flex: 1; }
.bigbtn { flex: none; white-space: nowrap; }

/* Fill the screen: only the board, over everything, edge to edge. Held upright, the board turns
   on its side so it uses the long side of the screen. */
.bigboard { position: fixed; inset: 0; z-index: 55; background: #0b0806; }
.bigstage { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.bigstage.bigrot { width: 100vh; width: 100dvh; height: 100vw; transform-origin: top left; transform: rotate(90deg) translateY(-100%); }
.bigtop { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 8px; min-height: 40px; background: rgba(18, 13, 10, .9); border-bottom: 1px solid var(--line); overflow: hidden; }
.bigturn { color: var(--brass-2); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.bigturn.mine { color: var(--ivory); }
.bigres { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.bigres .rchip { padding: 2px 8px; min-height: 0; font-size: .8rem; }
.bigres .rchip i { display: none; }
.bigtop .morebtns { display: flex; gap: 6px; margin: 0; flex-wrap: nowrap; }
.bigtop button { min-height: 32px; padding: 4px 10px; flex: none; }
.bigfit { flex: 1; min-height: 0; overflow: auto; container-type: size; padding: 0; }
.bigfit .boardscroll { overflow: visible; margin: 0; }
.bigfit .boardpic { min-width: 0 !important; margin: 0 auto 8px; border-radius: 0; width: min(100cqw, 100cqh * var(--ar, 1.5)); }
.bigfit > :not(.boardscroll):not(.bhead) { padding: 0 10px; }
body.bigboard { overflow: hidden; }
body.bigboard .dtabs, body.bigboard .dpeek, body.bigboard .dpanel, body.bigboard .rdrawer { display: none; }
/* The questions a space asks turn with the board. */
body.bigboard.bigrotated .sheet { inset: auto; top: 0; left: 0; width: 100vh; width: 100dvh; height: 100vw; transform-origin: top left; transform: rotate(90deg) translateY(-100%); }

/* ---------- a drawer pulled out ---------- */
.dpop { font-size: 20px; }
.popscreen { align-items: center; gap: 12px; }
.popscreen .qr { background: var(--ivory); padding: 8px; border-radius: 10px; flex: none; }
.popscreen .qr img, .popscreen .qr canvas { display: block; width: 130px !important; height: auto !important; }
.popurl { word-break: break-all; font-size: .85rem; color: var(--brass-2); }
#popSheet .panel { max-height: 92vh; overflow-y: auto; }
/* The pulled-out window: no tabs or menu, just the drawer, as wide as the window. */
body.popout .bar { display: none; }
body.popout #popView { max-width: none; padding: 10px 12px; }
body.popout #popView h2 { margin: 0; color: var(--brass-2); }
body.popout .boardscroll > .boardpic { min-width: 0; }
