@font-face {
  font-family:'brook-reg';
  src: url(./fonts/brook-regular.otf);
}

@font-face {
  font-family:'brook-italic';
  src: url(./fonts/brook-italic.otf);
}

@font-face {
  font-family:'xeippa';
  src: url(./fonts/xenipp3U.ttf);
}



:root {
  --paper: #FFF4D6;
  --grid: #cfe3f3;
  --grid-strong: #b5d3ec;
  --ink: #141414;
  --muted: var(--ink);
  --accent: #ff4fa3;
  --violet: #b56cff;
  --live: #19c37d;
  --warn: #e0362c;
  --card-w: 220px;
  --mono: 'brook-reg', ui-monospace, monospace;
  --serif: 'schoolbook-condensed', Georgia, serif;
  --deco: 'xeppia', serif;
  --sans:'jaf-herb', Helvetica, sans-serif;
  --black: 'xeippa', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.45 var(--mono);
  color: var(--ink);
  background-color: var(--paper);
  min-height: 100vh;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--bg-gif, none) center / cover no-repeat; mix-blend-mode: multiply; opacity: .55;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; line-height: 1.35; }
.hand { font-family: var(--sans); font-size: 20px; }
h1, h2, h3 { font-weight: 400; margin: 0; }
h2 { font-family: var(--serif); font-size: 30px; line-height: 1.1; margin-bottom: 12px; }

.screen { display: none; position: relative; z-index: 1; }
body.screen-onboard #onboard, body.screen-home #home, body.screen-room #room { display: block; }

/* ---------- hand-drawn pills & blobs ---------- */
.pill {
  background: var(--glow, var(--paper));
  border: 1.5px solid var(--glow, var(--ink));
  border-radius: 999px;
  padding: 7px 16px;
  margin: 5px;
  white-space: nowrap;
}
.pill:hover { background: color-mix(in srgb, var(--glow, var(--paper)) 65%, white); }
.pill.big { font-size: 16px; padding: 10px 22px; }
.blob-form button[type=submit] { font-family: var(--sans); }
.pill.small { font-size: 12px; padding: 4px 12px; }
.pill.warn { color: var(--warn); }
.glow-red .pill.warn { color: var(--ink); }
.pill.on { background: var(--ink); color: var(--paper); }
.pill:disabled { opacity: .4; cursor: not-allowed; transform: none; }

input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), textarea, select {
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  width: 100%;
  outline: none;
}
textarea { border-radius: 16px; resize: vertical; }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 3px #ffd6ea; }
input[type=number] { width: 80px !important; padding: 5px 10px !important; }
input[type=file] { border-radius: 14px !important; padding: 8px !important; background: #fff; }
.form-err { color: var(--warn); min-height: 1em; margin: 6px 0 0; }

/* ---------- floating images ---------- */
/* absolute + no z-index: floaters share the page's stacking order, so a hovered one can rise above the panels */
body { position: relative; }
#floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floater { z-index: 0; }
body:not(.screen-home):not(.screen-onboard) #floaters { display: none; }
.floater {
  position: absolute; width: 220px; pointer-events: auto;
  border-radius: 12px;
  box-shadow: 0 0 18px 4px rgba(255,255,255,.9), 0 0 40px 10px color-mix(in srgb, var(--glow, var(--accent)) 50%, transparent);
  animation: drift linear infinite;
  will-change: transform;
}
.floater a { display: block; position: relative; text-decoration: none; color: var(--ink); border-radius: 12px; overflow: hidden; }
.floater img { display: block; border-radius: 12px; width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #eee; }
.floater.square img { aspect-ratio: 1; }
.floater:hover { animation-play-state: paused; z-index: 10; box-shadow: 0 0 22px 6px rgba(255,255,255,1), 0 0 60px 18px color-mix(in srgb, var(--glow, var(--accent)) 75%, transparent); }
.floater-over {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  padding: 8px; background: linear-gradient(transparent 25%, rgba(251,250,246,.96) 70%);
  opacity: 0; transition: opacity .15s; font-size: 11px; line-height: 1.3;
}
.floater:hover .floater-over, .floater a:focus-visible .floater-over { opacity: 1; }
.fo-who { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.fo-who .face { width: 26px; height: 26px; font-size: 13px; }
.fo-word { font: 400 20px/1 var(--serif); }
.fo-meta { color: var(--muted); }
/* let the gaps between panels pass the mouse through to the floating boards */
#home, #onboard, .onboard-wrap { pointer-events: none; }
#home > *, .onboard-head, .onboard-grid, #home .home-head, #home .panel { pointer-events: auto; }
@keyframes drift {
  0% { transform: translate(0, 0) rotate(var(--r0)); }
  50% { transform: translate(var(--dx), var(--dy)) rotate(var(--r1)); }
  100% { transform: translate(0, 0) rotate(var(--r0)); }
}

/* ---------- logotype ---------- */
.logo-img { height: 64px; aspect-ratio: 963 / 212; display: block; position: relative; mix-blend-mode: multiply; }
/* the mask lives on ::before so a filter on .logo-img can draw an outline around the letter shapes */
.logo-img::before {
  content: ''; position: absolute; inset: 0;
  background: var(--glow, #002fff); -webkit-mask: url(/logo.svg) center / contain no-repeat; mask: url(/logo.svg) center / contain no-repeat;
}
.glow-light .logo-img { filter: drop-shadow(1.5px 0 0 var(--ink)) drop-shadow(-1.5px 0 0 var(--ink)) drop-shadow(0 1.5px 0 var(--ink)) drop-shadow(0 -1.5px 0 var(--ink)); }
.dotquest { font-family: var(--black); font-size: 58px; line-height: 1; }
.logotype { display: flex; align-items: flex-end; gap: 6px; justify-content: center; flex-wrap: wrap; }
.logotype .logo-img { height: 78px; }
.logotype .dotquest { font-size: 70px; margin-bottom: -2px; }
.logotype-s { font-family: var(--black); }

/* ---------- surfer card ---------- */
.scard {
  --c: var(--accent);
  width: var(--card-w);
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 6px 6px 18px var(--c);
  position: relative;
  font-size: 12px;
}
.scard-top { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.scard-top .sc-logo { font-family: var(--black); font-size: 15px; letter-spacing: 0; text-transform: none; }
.scard-img {
  aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--ink);
  background: var(--c) center/cover no-repeat;
  display: grid; place-items: center; font: 400 64px var(--black); color: #fff;
}
.scard-name { font: 400 26px/1.05 var(--serif); margin: 8px 2px 3px; word-break: break-word; }
.scard-link { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); margin: 0 2px; }
.scard-link:hover { color: var(--ink); }
.scard.mini { --card-w: 150px; padding: 6px; font-size: 11px; }
.scard.mini .scard-name { font-size: 19px; }
.scard.mini .scard-img { font-size: 44px; }

#me-card { position: fixed; z-index: 30; cursor: pointer; transition: top .3s, left .3s, right .3s; }
#me-card .scard { --card-w: 170px; }
#me-card .scard .scard-name { font-size: 21px; }
body.screen-home #me-card { top: 14px; left: 14px; }
body.screen-room #me-card { display: none; }
#me-card:hover .scard { transform: rotate(-1.5deg); }

/* ---------- onboarding ---------- */
.onboard-wrap { max-width: 860px; margin: 0 auto; padding: 40px 16px 60px; }
.onboard-head { text-align: center; display: flex; flex-direction: column; align-items: center; }
.onboard-head .logo-img { height: 30vh; mix-blend-mode:hard-light;}
.onboard-head .dotquest { margin-top: -6px; }
.onboard-grid, .home-head, .panel {
  background: rgba(255,255,255,.35); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1.5px solid var(--ink); border-radius: 14px;
  box-shadow: inset 0 0 40px rgba(0,0,0,.22), inset 0 0 12px rgba(0,0,0,.18), inset 0 0 0 2px rgba(0,0,0,.1);
}
.onboard-grid {
  display: grid; grid-template-columns: 1fr auto; gap: 34px; align-items: start; overflow-wrap: anywhere;
  padding: 34px 40px; margin-top: 22px;
}
.blob-form label, .field { display: block; margin-bottom: 16px; }
.blob-form label > input { margin-top: 5px; }
.lbl { display: block; margin-bottom: 6px; }
form label, .lbl { text-transform: uppercase; }
form label .muted, .lbl .muted { text-transform: lowercase; }
form label input, form label textarea { text-transform: none; }
.paren { text-transform: lowercase; font-style: italic; }
input, textarea, select { font-style: italic; text-transform: none; }
.swatches { display: flex; align-items: center; gap: 10px; }
.swatch-custom { flex: none; width: 30px; height: 30px; border: none; background: none; padding: 0; cursor: pointer; }
.hue-slider { flex: 1; -webkit-appearance: none; appearance: none; width: 100%; height: 18px; border: 1.5px solid var(--ink); border-radius: 999px; cursor: pointer;
  background: linear-gradient(to right, #ff3d3d, #ffff3d, #3dff3d, #3dffff, #3d3dff, #ff3dff, #ff3d3d); }
.hue-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 1.5px solid var(--ink); }
.hue-slider::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 1.5px solid var(--ink); }
.preview-col { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 4px; }
#card-preview .scard { --card-w: 230px; transform: rotate(2deg); }
.preview-col > .hand { transform: rotate(2deg); }

/* ---------- home ---------- */
#home { max-width: 1060px; margin: 0 auto; padding: 22px 16px 40px; }
body.screen-home #home { display: flex; flex-direction: column; }
#home > .home-head { width: 100%; }
.home-head {
  text-align: center; padding: 50px 80px 44px; margin: 10px auto 26px; max-width: 760px; border-radius: 50%;
}
.hello { margin: 0 0 4px; }
.blobs { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; margin-top: 22px; }
.blob {
  text-decoration: none; display: inline-block; background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 8px; font-size: 15px; padding: 9px 20px;
}
.blob:hover { background: #fff0f8; }

.panel { padding: 22px 24px; margin-bottom: 26px; }
.games-row { display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center; }
.or { font-family: var(--sans); font-size: 30px; }
.host-circle {
  width: 170px; height: 170px; border-radius: 50%;
  border: 1.5px solid var(--ink); background: var(--paper);
  font-family: var(--sans); font-size: 28px; line-height: 1.05;
  transition: transform .2s, background .2s;
}
.host-circle:hover { transform: rotate(-6deg) scale(1.04); background: #fff0f8; }
.room-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.room-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 10px 12px 10px 22px; background: #fff;
  cursor: pointer; transition: transform .12s, background .12s;
}
.room-row:hover { background: #fff0f8; transform: translateX(4px); }
.room-row .rname { font: 400 22px/1.1 var(--serif); }
.room-row .rmeta { font-size: 11px; color: var(--muted); }
.room-row .rfaces { display: flex; align-items: center; }
.room-row .rfaces .face { margin-left: -8px; }
.room-empty { font-family: var(--sans); font-size: 20px; color: var(--muted); border: 1.5px dashed var(--muted); border-radius: 999px; padding: 12px 22px; }
.phase-tag { display: inline-block; padding: 0 7px; border-radius: 999px; border: 1px solid currentColor; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; margin-left: 6px; }
.phase-tag.live { color: var(--live); }

.face {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ink);
  background: var(--c, var(--accent)) center/cover no-repeat; display: inline-grid; place-items: center;
  font: 400 15px var(--black); color: #fff; flex: none;
}

.inline-input { display: inline-block; width: 160px !important; padding: 3px 12px !important; }
.link-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.link-list a {
  display: block; text-decoration: none; border: 1.5px solid var(--ink); border-radius: 12px; padding: 9px 12px; background: #fff; height: 100%;
  transition: transform .12s, box-shadow .12s;
}
.link-list a:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--glow, var(--violet)); }
.link-list b { display: block; font-weight: 700; }
.link-list span { font-size: 11px; color: var(--muted); }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px 14px; justify-items: center; }
.dir-grid .scard:nth-child(3n) { transform: rotate(1.2deg); }
.dir-grid .scard:nth-child(4n+1) { transform: rotate(-1deg); }

/* ---------- dialogs ---------- */
.dlg {
  border: 1.5px solid var(--ink); border-radius: 18px; padding: 26px 30px; max-width: 720px; width: calc(100% - 32px);
  background: var(--paper); box-shadow: 0 0 0 6px var(--paper), 0 0 0 7.5px var(--ink), 14px 14px 0 7px rgba(181,108,255,.4);
  max-height: calc(100vh - 40px);
}
.dlg::backdrop { background: rgba(20,20,20,.35); backdrop-filter: blur(2px); }
.small-dlg { max-width: 420px; }
.host-form label { display: block; margin: 10px 0; }
.host-form fieldset { border: 1.5px solid var(--ink); border-radius: 16px; margin: 14px 0; padding: 8px 14px 10px; }
.host-form legend { padding: 0 6px; font-family: var(--sans); font-size: 19px; }
.inl { display: inline-flex !important; align-items: center; gap: 6px; margin: 6px 16px 6px 0 !important; }
.chk { cursor: pointer; }
.chk input { accent-color: var(--accent); }
.unit { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.row3 label { display: flex; flex-direction: column; gap: 4px; }
.row3 .unit { margin-left: 0; }
.tech-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 10px; margin-top: 8px; max-height: 200px; overflow: auto; font-size: 12px; }
.tech-picks label { margin: 2px 0 !important; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.zoom-dlg { max-width: 1200px; padding: 14px; }
.zoom-dlg img { width: 100%; display: block; border-radius: 8px; }
.close-x { float: right; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 20px; border-radius: 999px; transition: transform .25s;
  max-width: calc(100% - 32px);
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- room ---------- */
#room { --side: 250px; }
.room-top {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 14px;
  padding: 8px 14px; margin-right: calc(var(--side) + 20px);
  background: rgba(251,250,246,.94); border-bottom: 1.5px solid var(--ink);
}
.room-title { display: flex; align-items: center; gap: 8px; font: 400 24px/1 var(--serif); min-width: 0; }
.room-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.logo-mini { height: 26px; mix-blend-mode: multiply; }
.phases { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.phases li { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.phases li::before { content: ''; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; background: var(--paper); }
.phases li:not(:last-child) { padding-right: 34px; position: relative; }
.phases li:not(:last-child)::after {
  content: ''; position: absolute; right: 6px; top: 50%; width: 22px; border-top: 1.5px solid currentColor;
}
.phases li.done { color: var(--ink); }
.phases li.done::before { background: var(--ink); }
.phases li.now { color: var(--ink); font-weight: 700; }
.phases li.now::before { background: var(--accent); border-color: var(--ink); box-shadow: 0 0 0 3px #ffd6ea; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.clock-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 3px; }
#clock { font: 700 26px var(--mono); font-variant-numeric: tabular-nums; }
#clock.urgent { color: var(--warn); }

.room-side {
  position: fixed; top: 0; right: 0; bottom: 0; width: calc(var(--side) + 20px); z-index: 25;
  padding: 14px 14px 20px; overflow-y: auto;
  background: rgba(251,250,246,.96); border-left: 1.5px solid var(--ink);
}
#side-card-slot .scard { --card-w: 100%; cursor: pointer; }
.share-box { margin: 18px 0 6px; text-align: center; }
.share-box .pill { width: calc(100% - 10px); white-space: normal; }
#share-btn.on { background: var(--live); color: #fff; border-color: var(--ink); }
.side-h { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 8px; border-bottom: 1px dashed var(--grid-strong); padding-bottom: 4px; }
.member-icons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.member-icons li { position: relative; cursor: default; }
.member-icons .face { width: 40px; height: 40px; font-size: 20px; }
.member-icons li.host .face { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--violet); }
.member-icons li.sharing::after {
  content: ''; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--live); border: 1.5px solid var(--paper);
}
.member-icons li .tip {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--ink); color: var(--paper); font-size: 11px; padding: 2px 8px; border-radius: 999px; display: none; z-index: 3;
}
.member-icons li:hover .tip { display: block; }
.host-controls .pill { display: block; width: calc(100% - 10px); }
.room-info div { margin-bottom: 3px; }

.stage { margin-right: calc(var(--side) + 20px); padding: 18px 18px 40px; min-height: calc(100vh - 60px); }
.stage-h { font: 400 34px/1.1 var(--serif); margin: 0 0 4px; }
.stage-sub { color: var(--muted); margin: 0 0 16px; }

.center-col { max-width: 900px; margin: 0 auto; text-align: center; }
.bignum { font: 700 84px/1 var(--mono); font-variant-numeric: tabular-nums; margin: 10px 0; }
.waiting-box { border: 1.5px solid var(--ink); background: rgba(255,255,255,.9); border-radius: 18px; padding: 26px; margin: 0 auto 22px; max-width: 760px; }

/* live grid */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.tile { border: 1.5px solid var(--ink); border-radius: 12px; background: #fff; overflow: hidden; cursor: zoom-in; }
.tile-screen { aspect-ratio: 16/10; background: #eee center/contain no-repeat; display: grid; place-items: center; position: relative; }
.tile-screen img { width: 100%; height: 100%; object-fit: contain; display: block; background: #111; }
.tile-screen .no-sig { font-family: var(--sans); font-size: 18px; color: var(--muted); }
.tile-bar { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-top: 1.5px solid var(--ink); font-size: 12px; }
.tile-bar .face { width: 24px; height: 24px; font-size: 12px; }
.tile-bar .tname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-bar .ttech { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.grid-empty { font-family: var(--sans); font-size: 20px; color: var(--muted); padding: 30px; border: 1.5px dashed var(--muted); border-radius: 16px; text-align: center; margin-top: 18px; }

/* spin */
.spin-wrap { display: flex; gap: 40px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 10px 0 20px; }
.spin-col { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.spin-col .hand { font-size: 24px; }
.reel {
  width: 260px; height: 270px; overflow: hidden; position: relative;
  border: 1.5px solid var(--ink); border-radius: 60px / 40px; background: #fff;
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 6.5px var(--ink);
}
.reel::before, .reel::after { content: ''; position: absolute; left: 0; right: 0; height: 90px; z-index: 2; pointer-events: none; }
.reel::before { top: 0; background: linear-gradient(var(--paper), transparent); }
.reel::after { bottom: 0; background: linear-gradient(transparent, var(--paper)); }
.reel-window { position: absolute; left: 8px; right: 8px; top: 105px; height: 60px; border: 1.5px solid var(--ink); border-radius: 999px; z-index: 3; pointer-events: none; box-shadow: 0 0 0 3px rgba(255,79,163,.25); }
.reel-strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.reel-strip div { height: 60px; display: grid; place-items: center; font: 400 30px/1 var(--serif); padding: 0 16px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wheel-box { position: relative; width: 340px; height: 340px; }
.wheel-box canvas { width: 100%; height: 100%; border-radius: 50%; will-change: transform; }
.wheel-pointer { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 30px solid var(--ink); z-index: 2; }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink); z-index: 2; display: grid; place-items: center; font: 400 22px var(--black); }
.landed { font: 400 40px/1.1 var(--serif); min-height: 46px; }

/* surf */
.surf-hero { display: grid; grid-template-columns: 1fr 1fr minmax(160px, 220px); gap: 16px; align-items: stretch; }
.hero-box { border: 1.5px solid var(--ink); border-radius: 18px; background: rgba(255,255,255,.92); padding: 16px 20px; }
.hero-box .k { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hero-word { font: 400 64px/1 var(--serif); margin: 6px 0 2px; word-break: break-word; }
.hero-tech { font: 400 36px/1.05 var(--serif); margin: 6px 0; }
.go-link {
  display: inline-block; margin-top: 10px; text-decoration: none; font-size: 18px; font-weight: 700;
  background: var(--accent); color: #fff; border: 1.5px solid var(--ink); border-radius: 999px; padding: 10px 22px;
  transition: transform .12s;
}
.go-link:hover { transform: rotate(-2deg) scale(1.03); }
.go-url { font-size: 11px; color: var(--muted); word-break: break-all; margin-top: 10px; }
.prompt-share { margin-top: 14px; padding: 12px 16px; border: 1.5px dashed var(--ink); border-radius: 14px; background: #fff8e0; }

/* editor */
.editor { display: flex; flex-direction: column; gap: 10px; }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; border: 1.5px solid var(--ink); border-radius: 16px; background: rgba(255,255,255,.95); padding: 6px 8px; position: sticky; top: 64px; z-index: 10; }
.ed-bar .sep { width: 1px; height: 26px; background: var(--grid-strong); margin: 0 6px; }
.ed-bar label.pill { display: inline-flex; align-items: center; gap: 6px; }
.ed-bar input[type=color] { width: 28px; height: 24px; border: 1.5px solid var(--ink); border-radius: 6px; padding: 0; background: none; cursor: pointer; }
.ed-bar select, .ed-bar .font-input { width: auto !important; padding: 4px 10px !important; font-size: 12px; }
.ed-bar .font-input { width: 150px !important; }
.ed-bar .size-input { width: 64px !important; }
.ed-status { margin-left: auto; font-size: 11px; color: var(--muted); padding: 0 6px; white-space: nowrap; }
.ed-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 0; }
.ed-sub.hidden { display: none; }
.embed-row { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 260px; }
.embed-row input { padding: 5px 12px !important; }
.stage-outer { position: relative; width: 100%; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 6px 6px 0 rgba(0,0,0,.08); }
.stage-outer.drop { box-shadow: 0 0 0 4px var(--accent); }
.board { position: absolute; left: 0; top: 0; width: 1600px; height: 1000px; transform-origin: 0 0; background: #fff center/cover no-repeat; overflow: hidden; }
.bitem { position: absolute; transform-origin: 50% 50%; }
.bitem img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.bitem iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.bitem .btext { width: 100%; height: 100%; white-space: pre-wrap; word-break: break-word; outline: none; line-height: 1.15; overflow: hidden; }
.board.editing .bitem { cursor: move; }
.board.editing .bitem iframe { pointer-events: none; }
.board.editing .bitem.sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.board.editing .bitem .btext[contenteditable=true] { cursor: text; background: rgba(255,214,234,.25); }
.handle { position: absolute; width: 26px; height: 26px; background: #fff; border: 3px solid var(--accent); border-radius: 50%; display: none; z-index: 5; }
.bitem.sel .handle { display: block; }
.h-resize { right: -15px; bottom: -15px; cursor: nwse-resize; }
.h-rotate { left: 50%; top: -52px; margin-left: -13px; cursor: grab; }
.h-rotate::after { content: ''; position: absolute; left: 50%; top: 23px; height: 26px; border-left: 3px solid var(--accent); }
.board-empty { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--sans); font-size: 54px; color: #bbb; pointer-events: none; text-align: center; }

/* present */
.present { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 18px; align-items: start; }
.present-left { display: flex; flex-direction: column; gap: 12px; }
.present-left .scard { --card-w: 100%; }
.replay { border: 1.5px solid var(--ink); border-radius: 12px; background: #111; overflow: hidden; }
.replay-screen { aspect-ratio: 16/10; display: grid; place-items: center; color: #aaa; font-family: var(--sans); font-size: 18px; text-align: center; padding: 0; }
.replay-screen img { width: 100%; height: 100%; object-fit: contain; display: block; }
.replay-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #fff; border-top: 1.5px solid var(--ink); font-size: 11px; }
.replay-bar input[type=range] { flex: 1; accent-color: var(--accent); }
.replay-bar button { border: 1.5px solid var(--ink); background: #fff; border-radius: 999px; padding: 1px 10px; }
.present-right .presenter-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 10px; flex-wrap: wrap; }
.upnext { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); }

/* vote / results */
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.vote-card { border: 1.5px solid var(--ink); border-radius: 14px; background: #fff; overflow: hidden; }
.vote-card .stage-outer { border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; box-shadow: none; cursor: zoom-in; }
.vote-card .vbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.vote-card .vbar .face { width: 26px; height: 26px; font-size: 13px; }
.heart-btn { margin-left: auto; border: 1.5px solid var(--ink); background: #fff; border-radius: 999px; padding: 3px 14px; font-size: 16px; transition: transform .12s; }
.heart-btn:hover { transform: scale(1.08); }
.heart-btn.on { background: var(--accent); color: #fff; }
.heart-btn:disabled { opacity: .35; cursor: default; transform: none; }
.vote-card.winner { box-shadow: 0 0 0 4px var(--paper), 0 0 0 5.5px var(--ink), 0 0 0 10px var(--accent); }
.rank { font: 700 14px var(--mono); }
.crown { font-size: 22px; }

.history { margin-top: 26px; text-align: left; }
.history li { margin-bottom: 4px; }

@media (max-width: 900px) {
  #room { --side: 0px; }
  .room-side { position: static; width: auto; border-left: 0; border-bottom: 1.5px solid var(--ink); }
  #side-card-slot .scard { --card-w: 200px; margin: 0 auto; }
  .room-top { margin-right: 0; grid-template-columns: auto 1fr auto; }
  .phases { grid-column: 1 / -1; order: 5; overflow-x: auto; justify-content: flex-start; }
  .stage { margin-right: 0; }
  .surf-hero, .present { grid-template-columns: 1fr; }
  .games-row { grid-template-columns: 1fr; justify-items: center; }
  .games-list { width: 100%; }
  .onboard-grid { grid-template-columns: 1fr; padding: 24px 20px; border-radius: 18px; }
  .row3 { grid-template-columns: 1fr; }
  body.screen-home #me-card { position: static; display: flex; justify-content: center; padding-top: 12px; }
  .room-title span { max-width: 140px; }
}

/* fixes */
.tile-screen .no-sig { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.tile-screen img:not([hidden]) + .no-sig { display: none; }
.toast:not(.show) { opacity: 0; pointer-events: none; }
.scard.mini .scard-top span:last-child { font-size: 9px; }
.editor .stage-outer { max-width: calc((100vh - 230px) * 1.6); min-width: 520px; margin: 0 auto; }
.present-right [data-r=board] .stage-outer, .present-right .stage-outer { max-width: calc((100vh - 140px) * 1.6); }
@media (max-width: 900px) {
  body.screen-room #room { display: flex; flex-direction: column; }
  .room-top { order: 0; } .stage { order: 1; } .room-side { order: 2; border-top: 1.5px solid var(--ink); border-bottom: 0; }
  #side-card-slot .scard { --card-w: 160px; }
  .bignum { font-size: 60px; }
  .hero-word { font-size: 46px; }
}

/* ---------- card background patterns + city ---------- */
.scard { overflow: hidden; }
.scard-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; }
.scard > :not(.scard-bg) { position: relative; z-index: 1; }
.scard.has-bg .scard-top span, .scard.has-bg .scard-name span, .scard.has-bg .scard-city span, .scard.has-bg .scard-link {
  background: rgba(255,255,255,.92); border-radius: 6px; padding: 0 5px; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.scard.has-bg .scard-link { display: inline-block; max-width: 100%; vertical-align: top; }
.scard-city { margin: 0 2px 3px; font-size: 11px; }
.scard.mini .scard-city { font-size: 10px; }
.scard.has-bg { box-shadow: 6px 6px 18px var(--c); }

.pattern-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; margin-bottom: 8px; }
.pat { border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; padding: 3px; display: flex; flex-direction: column; gap: 2px; }
.pat span { display: block; height: 34px; border-radius: 6px; background: repeating-linear-gradient(45deg, #fff 0 4px, #eee 4px 8px); }
.pat[data-pat=none] span { background: #fff; border: 1px dashed #bbb; }
.pat i { font-style: normal; font-size: 9px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pat.sel { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--accent); }
.pattern-ctrls { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 12px; margin-bottom: 6px; }
.pattern-ctrls .mini { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; }
.pattern-ctrls input[type=color] { width: 30px; height: 24px; border: 1.5px solid var(--ink); border-radius: 6px; padding: 0; background: none; }
.pattern-ctrls input[type=range] { width: 90px; accent-color: var(--accent); }
.paste-css summary { cursor: pointer; font-size: 12px; }
.paste-css textarea { margin-top: 6px; font-size: 11px; }
.delete-zone { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--grid-strong); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.onboard-grid .preview-col { position: sticky; top: 20px; }

/* ---------- live cursors (playhtml) ---------- */
.playhtml-cursor-other { z-index: 9999 !important; }
.playhtml-cursor-name { font-family: var(--mono) !important; font-weight: 700; opacity: .95 !important; }

/* ---------- sign in ---------- */
.signin-form { max-width: 420px; margin: 22px auto 0; background: rgba(255,255,255,.9); border: 1.5px solid var(--ink); border-radius: 18px; padding: 26px 28px; pointer-events: auto; }
.signin-form label { display: block; margin-bottom: 14px; }
.signin-form label > input { margin-top: 5px; }
.signin-form a { display: inline-block; margin-top: 6px; }
#signin-toggle-wrap { margin: 4px 0 0; }

/* sites a surfer can switch off on their card */
.site-picks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.blob-form .site-picks label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.hero-lang { margin-top: 6px; }

/* per-round timing table in the host dialog */
.round-times { border-collapse: collapse; width: 100%; }
.round-times th, .round-times td { padding: 3px 6px; text-align: left; font-weight: normal; }
.round-times thead th { font-size: .85em; opacity: .7; }
.round-times input { width: 5em; }
.sound-box { margin: 10px 0; }
#sound-btn:not(.on) { opacity: .6; }
/* end-of-game standings */
.final-list { list-style: none; padding: 0; margin: 14px auto; max-width: 420px; text-align: left; }
.final-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed currentColor; }
.final-list li span { margin-left: auto; }

/* ---------- collapsible search technique collection ---------- */
#links-details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
#links-details > summary::-webkit-details-marker { display: none; }
#links-details > summary::before { content: '▸'; font-size: 22px; transition: transform .15s; }
#links-details[open] > summary::before { transform: rotate(90deg); }
#links-details > summary h2 { margin: 0; }
#links-details[open] > summary { margin-bottom: 12px; }

/* ---------- random bird during surf ---------- */
.hero-bird { padding: 0; overflow: hidden; min-height: 180px; }
.hero-bird img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- screen sharing is required ---------- */
.share-gate {
  position: fixed; top: 0; left: 0; bottom: 0; right: calc(var(--side) + 20px); z-index: 22;
  display: grid; place-items: center; padding: 20px;
  background: rgba(255,244,214,.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.gate-box {
  max-width: 520px; text-align: center; border: 1.5px solid var(--ink); border-radius: 18px; background: rgba(255,255,255,.95);
  padding: 26px 28px; box-shadow: 10px 10px 0 color-mix(in srgb, var(--glow, var(--accent)) 45%, transparent);
}
.gate-box .hand { font-size: 30px; margin-bottom: 8px; }
.gate-box p { margin: 10px 0; }

/* ---------- observation view ---------- */
.obs-btn { position: fixed; left: 14px; bottom: 14px; z-index: 70; margin: 0; box-shadow: 3px 3px 0 var(--ink); }
.obs-btn.on { background: var(--ink); color: var(--paper); border-color: var(--paper); }
.obs-view { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #111; }
.obs-head { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--paper); color: var(--ink); border-bottom: 1.5px solid var(--ink); }
.obs-title { font: 400 24px/1 var(--serif); white-space: nowrap; }
.obs-meta { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.obs-clock { margin-left: auto; font: 700 22px var(--mono); font-variant-numeric: tabular-nums; }
.obs-head .pill { margin: 0; }
.obs-grid {
  flex: 1; min-height: 0; padding: 8px 8px 64px; display: grid; gap: 8px;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr));
}
.obs-tile { display: flex; flex-direction: column; min-height: 0; border: 2px solid var(--c, var(--accent)); border-radius: 10px; overflow: hidden; background: #000; cursor: zoom-in; }
.obs-tile .tile-screen { flex: 1; min-height: 0; aspect-ratio: auto; background: #000; }
.obs-tile .tile-screen img { background: #000; }
.obs-bar { flex: none; height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--c, var(--accent)); color: #fff; font-size: 12px; text-shadow: 0 0 3px rgba(0,0,0,.7); }
.obs-bar .face { width: 20px; height: 20px; font-size: 10px; border-color: #fff; }
.obs-bar .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-bar .ttech { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.obs-empty { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; font-family: var(--sans); font-size: 28px; color: #aaa; }

/* ---------- observer mode (/observe/abc123): only the observation view ---------- */
body.screen-observe #room { display: block; }
body.screen-observe #room > :not(#obs-view) { display: none !important; }
body.screen-observe #me-card { display: none; }
body.screen-observe .obs-grid { padding-bottom: 8px; }
