/* Guess It Up! shared styles. Layout: circus-night stage, chunky press-down buttons, scalloped awning on top. */
:root {
  --ink: #12102a; --ink2: #1b1940; --ink3: #27245a; --line: #3b3772;
  --text: #eceaff; --mute: #a3a0d4;
  --chalk: #f3f5ff; --chalk-shadow: #a7a9dc;
  --sun: #ffc83d; --sun-d: #c99200;
  --tomato: #ff5d73; --tomato-d: #b3283d;
  --mint: #2ee6c5; --mint-d: #139c85;
  --display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--ink);
  background-image: radial-gradient(1100px 560px at 50% -8%, #2c2873 0, transparent 62%);
  color: var(--text);
  font-family: var(--body); font-weight: 600; font-size: 16px; line-height: 1.45;
  min-height: 100vh;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}
h1, h2, h3, p { margin: 0; }
h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .02em; }
a { color: var(--sun); }
small { color: var(--mute); font-weight: 700; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* awning */
.awning {
  height: 30px;
  background: repeating-linear-gradient(90deg, var(--tomato) 0 40px, var(--chalk) 40px 80px);
  -webkit-mask: linear-gradient(#000, #000) top / 100% 10px no-repeat, radial-gradient(circle at 20px 10px, #000 19.5px, transparent 20px) 0 0 / 40px 30px repeat-x;
  mask: linear-gradient(#000, #000) top / 100% 10px no-repeat, radial-gradient(circle at 20px 10px, #000 19.5px, transparent 20px) 0 0 / 40px 30px repeat-x;
}

/* header */
.top {
  max-width: 1100px; margin: 0 auto; padding: 14px 16px 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.logo {
  font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 6vw, 2.8rem);
  color: var(--sun); letter-spacing: .02em; transform: rotate(-2deg);
  text-shadow: 0 3px 0 #7a4f00;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  padding: 6px 11px; border-radius: 999px; background: var(--ink3); border: 1px solid var(--line);
}
.chip.sun { background: var(--sun); color: #3a2800; border-color: var(--sun); }
main { max-width: 1100px; margin: 0 auto; padding: 8px 16px; }
.foot { max-width: 1100px; margin: 18px auto 0; padding: 0 16px; font-size: .85rem; color: var(--mute); }

/* buttons */
.btn {
  font-family: var(--display); font-size: 1.1rem; letter-spacing: .03em;
  padding: 12px 20px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--sun); color: #3a2800; box-shadow: 0 5px 0 var(--sun-d);
  transition: transform .06s, box-shadow .06s;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--sun-d); }
.btn.alt { background: var(--chalk); color: var(--ink); box-shadow: 0 5px 0 var(--chalk-shadow); }
.btn.alt:active:not(:disabled) { box-shadow: 0 1px 0 var(--chalk-shadow); }
.btn.bad { background: var(--tomato); color: #3b0610; box-shadow: 0 5px 0 var(--tomato-d); }
.btn.bad:active:not(:disabled) { box-shadow: 0 1px 0 var(--tomato-d); }
.btn.good { background: var(--mint); color: #04332b; box-shadow: 0 5px 0 var(--mint-d); }
.btn.good:active:not(:disabled) { box-shadow: 0 1px 0 var(--mint-d); }
.btn.sm { font-size: .92rem; padding: 7px 12px; border-radius: 11px; box-shadow: 0 3px 0 var(--sun-d); }
.btn.sm.alt { box-shadow: 0 3px 0 var(--chalk-shadow); }
.btn.sm.bad { box-shadow: 0 3px 0 var(--tomato-d); }
.btn.sm:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--sun-d); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.ghost {
  font: inherit; font-weight: 800; font-size: .8rem; color: var(--mute); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.ghost:hover { color: var(--text); border-color: var(--mute); }

/* panels */
.panel { background: var(--ink2); border: 2px solid var(--line); border-radius: 22px; padding: 22px; min-width: 0; }
.panel > * + * { margin-top: 14px; }
.panel h2 { font-size: 1.7rem; }
.panel h3 { font-size: 1.15rem; color: var(--sun); }
.lead { color: var(--mute); font-size: 1.05rem; }
.rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.rules li { padding-left: 22px; position: relative; }
.rules li::before { content: ''; position: absolute; left: 0; top: .55em; width: 9px; height: 9px; border-radius: 50%; background: var(--sun); }

/* player layout */
.play { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.left { display: grid; gap: 14px; min-width: 0; }
.right h3 { margin-bottom: 10px; }
@media (max-width: 900px) { .play { grid-template-columns: minmax(0, 1fr); } }

.turn {
  display: flex; align-items: center; gap: 18px; padding: 16px 20px; border-radius: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--pc) 26%, var(--ink2)), var(--ink2));
  border: 2px solid var(--pc); box-shadow: 0 6px 0 rgba(0, 0, 0, .28); min-width: 0;
}
.turn.pop { animation: pop .45s cubic-bezier(.2, .9, .3, 1.3); }
.bigav {
  flex: none; width: clamp(64px, 16vw, 100px); aspect-ratio: 1; border-radius: 50%;
  background: var(--pc); color: var(--ink); display: grid; place-items: center;
  font-family: var(--display); font-size: clamp(2rem, 7vw, 3.3rem); box-shadow: 0 6px 0 rgba(0, 0, 0, .3);
}
.tt { min-width: 0; display: grid; gap: 6px; flex: 1; }
.tt h2 { font-size: clamp(1.7rem, 5vw, 2.7rem); color: var(--pc); overflow-wrap: anywhere; line-height: 1.05; }
.streak { font-family: var(--mono); font-size: .8rem; color: var(--sun); }

.bulbs { display: flex; gap: 8px; }
.bulbs i { width: clamp(24px, 5.4vw, 38px); aspect-ratio: 1; display: block; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.34' cy='.26' r='.9'%3E%3Cstop offset='0' stop-color='%234a47a0'/%3E%3Cstop offset='.6' stop-color='%232b2860'/%3E%3Cstop offset='1' stop-color='%231b1945'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 2.7 4.5 6.4 4.5c2.1 0 3.9 1.1 5.6 3.3 1.7-2.2 3.5-3.3 5.6-3.3 3.7 0 5.5 3.9 4 7.3C19.5 16.4 12 21 12 21z' fill='url(%23g)'/%3E%3Cellipse cx='8.1' cy='8.4' rx='2.7' ry='1.5' fill='%23fff' fill-opacity='.12' transform='rotate(-35 8.1 8.4)'/%3E%3C/svg%3E") center / contain no-repeat; }
.bulbs i.on { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.34' cy='.26' r='.9'%3E%3Cstop offset='0' stop-color='%23ff9aae'/%3E%3Cstop offset='.3' stop-color='%23ff5a78'/%3E%3Cstop offset='.75' stop-color='%23d81b44'/%3E%3Cstop offset='1' stop-color='%238f0f2e'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 2.7 4.5 6.4 4.5c2.1 0 3.9 1.1 5.6 3.3 1.7-2.2 3.5-3.3 5.6-3.3 3.7 0 5.5 3.9 4 7.3C19.5 16.4 12 21 12 21z' fill='url(%23g)'/%3E%3Cellipse cx='8.1' cy='8.4' rx='2.7' ry='1.5' fill='%23fff' fill-opacity='.3' transform='rotate(-35 8.1 8.4)'/%3E%3C/svg%3E"); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)) drop-shadow(0 0 7px rgba(255, 77, 109, .55)); }
.timer { position: relative; height: 22px; border-radius: 999px; background: var(--ink); border: 2px solid var(--line); overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: var(--mint); transition: width .2s linear; }
.timer[data-low="1"] i { background: var(--tomato); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: .75rem; color: var(--text); mix-blend-mode: normal; text-shadow: 0 1px 2px rgba(0,0,0,.6); }

.hintbox { display: flex; gap: 10px; align-items: baseline; justify-content: center; flex-wrap: wrap; text-align: center; }
.hintbox b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--sun); }

/* word tiles */
.word { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; padding: 10px 0 6px; }
.wg { display: flex; flex-wrap: nowrap; justify-content: center; gap: 6px; max-width: 100%; min-width: 0; }
.tile {
  width: clamp(24px, 6.4vw, 58px); flex-shrink: 1; min-width: 20px; height: clamp(34px, 8.8vw, 76px); border-radius: 10px;
  background: var(--ink3); border: 2px dashed var(--line); display: grid; place-items: center;
}
.tile i { font-style: normal; font-family: var(--display); font-size: clamp(.9rem, 4vw, 2.4rem); color: var(--ink); line-height: 1; }
.tile.on { background: var(--sun); border: 2px solid var(--sun); box-shadow: 0 5px 0 var(--sun-d); }
.tile.missed { background: color-mix(in srgb, var(--tomato) 80%, var(--chalk)); border-color: var(--tomato); box-shadow: 0 5px 0 var(--tomato-d); }
.tile.peek i { color: var(--mute); }
.tile.flip { animation: flip .6s cubic-bezier(.2, .8, .3, 1.2); }
.punct { align-self: center; font-family: var(--display); font-size: 2rem; color: var(--mute); }

/* keyboard */
.kb { display: grid; gap: 8px; width: 100%; max-width: 760px; margin: 4px auto 0; }
.krow { display: flex; justify-content: center; gap: 6px; }
.key {
  flex: 1 1 0; max-width: 62px; min-width: 0; height: 52px; border: 0; border-radius: 10px; cursor: pointer;
  font-family: var(--display); font-size: 1.25rem; background: var(--chalk); color: var(--ink);
  box-shadow: 0 5px 0 var(--chalk-shadow); transition: transform .06s, box-shadow .06s;
}
.key:hover:not(:disabled) { background: #fff; }
.key:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--chalk-shadow); }
.key:disabled { cursor: not-allowed; transform: translateY(3px); }
.key.hit { background: var(--mint); color: #04332b; box-shadow: 0 2px 0 var(--mint-d); }
.key.miss { background: var(--tomato); color: #4a0612; opacity: .55; box-shadow: 0 2px 0 var(--tomato-d); }
@media (max-width: 520px) { .key { height: 46px; font-size: 1.1rem; } .krow { gap: 4px; } .kb { gap: 7px; } }

.wrongs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; min-height: 28px; }
.wrongs span { font-family: var(--mono); font-size: .85rem; padding: 2px 8px; border-radius: 8px; background: color-mix(in srgb, var(--tomato) 30%, var(--ink2)); color: #ffd3da; text-decoration: line-through; }

/* scoreboard */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.prow {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 16px; background: var(--ink2); border: 2px solid var(--line);
}
.prow.now { border-color: var(--pc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 35%, transparent); background: color-mix(in srgb, var(--pc) 12%, var(--ink2)); }
.prow.out .av, .prow.out .ps, .prow.out .pn b, .prow.out .mini { opacity: .45; filter: grayscale(.7); }
.av { width: 40px; height: 40px; border-radius: 50%; background: var(--pc); color: var(--ink); display: grid; place-items: center; font-family: var(--display); font-size: 1.2rem; }
.pn { min-width: 0; display: grid; gap: 3px; }
.pn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn em { font-style: normal; font-size: .68rem; font-weight: 800; letter-spacing: .1em; color: var(--tomato); }
.mini { display: inline-flex; gap: 4px; }
.mini i { width: 14px; height: 14px; display: block; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.34' cy='.26' r='.9'%3E%3Cstop offset='0' stop-color='%234a47a0'/%3E%3Cstop offset='.6' stop-color='%232b2860'/%3E%3Cstop offset='1' stop-color='%231b1945'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 2.7 4.5 6.4 4.5c2.1 0 3.9 1.1 5.6 3.3 1.7-2.2 3.5-3.3 5.6-3.3 3.7 0 5.5 3.9 4 7.3C19.5 16.4 12 21 12 21z' fill='url(%23g)'/%3E%3Cellipse cx='8.1' cy='8.4' rx='2.7' ry='1.5' fill='%23fff' fill-opacity='.12' transform='rotate(-35 8.1 8.4)'/%3E%3C/svg%3E") center / contain no-repeat; }
.mini i.on { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.34' cy='.26' r='.9'%3E%3Cstop offset='0' stop-color='%23ff9aae'/%3E%3Cstop offset='.3' stop-color='%23ff5a78'/%3E%3Cstop offset='.75' stop-color='%23d81b44'/%3E%3Cstop offset='1' stop-color='%238f0f2e'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 2.7 4.5 6.4 4.5c2.1 0 3.9 1.1 5.6 3.3 1.7-2.2 3.5-3.3 5.6-3.3 3.7 0 5.5 3.9 4 7.3C19.5 16.4 12 21 12 21z' fill='url(%23g)'/%3E%3Cellipse cx='8.1' cy='8.4' rx='2.7' ry='1.5' fill='%23fff' fill-opacity='.3' transform='rotate(-35 8.1 8.4)'/%3E%3C/svg%3E"); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)) drop-shadow(0 0 3px rgba(255, 77, 109, .5)); }
.ps { text-align: right; font-family: var(--display); letter-spacing: .02em; }
.ps, .ps b, .ps small, .recap .ps b, .recap .ps small { font-family: var(--display); font-weight: 400 !important; font-synthesis: none; }
.ps b { font-size: 1.3rem; font-weight: 400; }
.ps small { display: block; color: var(--mint); font-size: .75rem; }

/* round over / final */
.center { text-align: center; }
.center > * { margin-left: auto; margin-right: auto; }
.recap { display: grid; gap: 8px; max-width: 520px; margin: 0 auto; width: 100%; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 22px 0 6px; }
.step { width: min(28vw, 150px); text-align: center; min-width: 0; }
.step .nm { font-family: var(--display); font-size: 1.15rem; overflow-wrap: anywhere; margin-bottom: 6px; }
.step .blk { border-radius: 14px 14px 0 0; background: var(--pc); color: var(--ink); display: grid; place-items: start center; padding-top: 10px; font-family: var(--display); font-size: 2.2rem; }
.step .pts { font-family: var(--mono); color: var(--mute); margin-bottom: 4px; }
.tw { overflow-x: auto; max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); padding: 6px 10px; white-space: nowrap; }
.tbl td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--pc); margin-right: 8px; vertical-align: -1px; }

/* toast + confetti */
#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 30px); opacity: 0; transition: opacity .25s, transform .25s;
  background: var(--ink); border: 2px solid var(--sun); color: var(--text); padding: 10px 18px; border-radius: 999px;
  font-weight: 800; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; z-index: 5;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9; }

@keyframes flip { 0% { transform: rotateX(90deg) scale(.6); } 100% { transform: none; } }
@keyframes pop { 0% { transform: scale(.94); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.shake { animation: shake .45s; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* admin */
.adm-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .adm-grid { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 20px; min-width: 0; }
.in {
  width: 100%; background: var(--ink); border: 2px solid var(--line); color: var(--text); border-radius: 12px;
  padding: 10px 12px; font: inherit; font-weight: 700;
}
.in:focus { border-color: var(--sun); outline: none; }
textarea.in { resize: vertical; font-family: var(--mono); font-size: .92rem; line-height: 1.6; }
select.in { appearance: auto; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pedit { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; }
.pedit .dot { margin: 0; width: 18px; height: 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.note { font-size: .88rem; color: var(--mute); }
.bad-lines { color: #ffd3da; font-size: .85rem; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--sun); }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.queue li { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 10px; background: var(--ink); font-size: .92rem; min-width: 0; }
.queue li b { font-family: var(--mono); font-weight: 500; overflow-wrap: anywhere; }
.queue li.cur { outline: 2px solid var(--sun); }
.queue li.done { opacity: .5; }
.queue li span { color: var(--mute); font-family: var(--mono); font-size: .8rem; flex: none; }

/* online play */
.chip.warn { background: var(--tomato); color: #3b0610; border-color: var(--tomato); }
.kb.locked { opacity: .45; pointer-events: none; }
.joinform { display: grid; gap: 14px; width: 100%; max-width: 360px; text-align: left; }
.in.code { font-family: var(--display); font-size: 1.6rem; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.roomcode { font-family: var(--display); font-size: clamp(2.4rem, 9vw, 3.6rem); letter-spacing: .22em; color: var(--sun); line-height: 1; text-shadow: 0 3px 0 #7a4f00; }
.linkrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.linkrow .in { flex: 1 1 220px; min-width: 0; font-family: var(--mono); font-size: .85rem; }
.lobby { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lobby li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--ink); min-width: 0; }
.lobby li b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.errbox { border-color: var(--tomato); }
.errbox h2 { color: var(--tomato); }

/* per-word hint rows */
.wlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 340px; overflow: auto; }
.wrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--ink); }
.wrow .wword { grid-column: 1 / 2; font-family: var(--mono); font-weight: 500; overflow-wrap: anywhere; }
.wrow .wmove { grid-column: 2 / 3; grid-row: 1; display: flex; gap: 6px; }
.wrow .wmove .btn { min-width: 38px; padding-left: 0; padding-right: 0; }
.wrow .btn:disabled { opacity: .35; cursor: default; }
.wrow .in { grid-column: 1 / 2; padding: 8px 10px; }
.wrow .check { grid-column: 1 / -1; }
.wrow .btn { grid-column: 2 / 3; grid-row: 3; }

/* word bank folders */
.bfolders{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.bfolder{background:rgba(255,255,255,.05);border-radius:12px;padding:8px 10px}
.brow{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.brow .check{flex:1 1 140px;margin:0}
.bwords{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:4px}
.bwords li{display:flex;align-items:center;gap:8px}
.bwords li b{font-family:var(--mono,'DM Mono',monospace);font-weight:500}
.bwords li small{flex:1;opacity:.7}

/* admin: use the whole screen */
body.adm .top, body.adm main, body.adm .foot { max-width: none; padding-left: clamp(16px, 2.5vw, 40px); padding-right: clamp(16px, 2.5vw, 40px); }
.adm-grid.adm3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1300px) { .adm-grid.adm3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .adm-grid.adm3 { grid-template-columns: minmax(0, 1fr); } }
body.adm .adm-grid:not(.adm3) { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
@media (max-width: 900px) { body.adm .adm-grid:not(.adm3) { grid-template-columns: minmax(0, 1fr); } }
.baddrow{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;margin:8px 0}
@media (max-width:600px){.baddrow{grid-template-columns:1fr}}
.key.pend{opacity:.55;transform:scale(.94);pointer-events:none}

/* countdown bars keep their full width inside centred panels */
.timer { width: 100%; }
.center > .timer { width: min(100%, 460px); }

/* admin copy of the player keyboard: look only */
.adminkb .key { display: grid; place-items: center; cursor: default; pointer-events: none; }
.key.free { outline: 2px dashed rgba(255,255,255,.55); outline-offset: -4px; }

/* live rules panel */
.livepanel > summary { cursor: pointer; list-style: none; }
.livepanel > summary::-webkit-details-marker { display: none; }
.livepanel[open] > summary { margin-bottom: 12px; }
.livepanel > * + * { margin-top: 14px; }

.comingup { margin: 8px 0 0; font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--sun); text-align: center; }
.recap .ps small { font-size: 1.1rem !important; font-weight: 400; font-family: var(--display); color: var(--text) !important; }
.hl { color: var(--sun); }

/* chat window */
.chatbtn { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 40; font-family: var(--display); font-size: 1.05rem; padding: 10px 18px; border-radius: 999px; border: 0; cursor: pointer; background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 var(--sun-d), 0 8px 20px rgba(0,0,0,.4); }
.chatbtn small { color: var(--ink); font-family: var(--body); }
.chatbadge { font-style: normal; display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--tomato); color: #fff; font-size: .85rem; text-align: center; }
.chatbox { position: fixed; right: 14px; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); z-index: 41; width: min(360px, calc(100vw - 28px)); max-height: min(70vh, 520px); display: flex; flex-direction: column; background: var(--ink2); border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 12px 36px rgba(0,0,0,.5); overflow: hidden; }
.chathead { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--ink3); font-family: var(--display); }
.chathead b { font-weight: 400; font-size: 1.1rem; flex: 1; }
.chatctl { display: flex; align-items: center; gap: 10px; font-size: .85rem; font-family: var(--body); }
.chatsw { display: flex; align-items: center; gap: 4px; }
.chatx { background: none; border: 0; color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.chatlist { list-style: none; margin: 0; padding: 10px 12px; overflow-y: auto; flex: 1; min-height: 140px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.chatlist li { overflow-wrap: anywhere; font-weight: 600; }
.chatlist .who { font-family: var(--display); font-weight: 400; }
.chatlist .mine .txt { color: var(--chalk); }
.chatlist .chatempty { color: var(--mute); font-size: .9rem; }
.chatlink { background: none; border: 0; color: var(--mute); font: inherit; font-size: .78rem; text-decoration: underline; cursor: pointer; padding: 0 0 0 6px; }
.chatform { display: flex; gap: 8px; padding: 10px 12px; border-top: 2px solid var(--line); }
.chatform .in { flex: 1; min-width: 0; padding: 8px 10px; }
.chatname { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 2px solid var(--line); font-size: .85rem; color: var(--mute); }
.chatname .in { flex: 1; min-width: 0; padding: 5px 9px; }
.chatlist .who.host { color: var(--sun); }
.hosttag { font-style: normal; font-family: var(--body); font-weight: 800; font-size: .65rem; letter-spacing: .06em; padding: 1px 6px; margin-left: 5px; border-radius: 6px; background: var(--sun); color: var(--ink); vertical-align: 2px; }

/* pause */
.pausebar { max-width: 1100px; margin: 0 auto 14px; padding: 12px 18px; border-radius: 16px; background: var(--sun); color: var(--ink); font-family: var(--body); font-weight: 800; font-size: 1.15rem; letter-spacing: .01em; text-align: center; box-shadow: 0 5px 0 var(--sun-d); }
.ispaused .key, .ispaused .keyboard button { opacity: .5; pointer-events: none; }
.pausemodal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(8, 6, 24, .72); }
.pausecard { width: min(460px, 100%); padding: 26px 24px; text-align: center; background: var(--ink2); border: 3px solid var(--sun); border-radius: 22px; box-shadow: 0 14px 40px rgba(0,0,0,.55); display: grid; gap: 14px; justify-items: center; }
.pausecard small { color: var(--sun); letter-spacing: .12em; }
.pausecard p { font-family: var(--body); font-weight: 700; font-size: 1.45rem; line-height: 1.35; overflow-wrap: anywhere; }
.pausebox { display: grid; gap: 10px; margin-bottom: 14px; }
.pausebox.paused { border-color: var(--sun); }
.pausetitle { font-family: var(--body); font-weight: 800; font-size: 1.25rem; color: var(--sun); }
.left { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 520px) { .wg { gap: 3px; } .tile { min-width: 11px; border-radius: 7px; } .tile i { font-size: .85rem; } }

.cat { color: var(--sun); font-size: 1.4rem; margin: 2px 0 10px; }
.cat b { font-weight: 800; }

/* admin section colours: each kind of section gets its own tint (set by tagPanels() in admin13579.html).
   To go back to plain panels, delete this block and the tagPanels() script. */
.adm .panel[data-tone] { border-color: color-mix(in srgb, var(--tn) 85%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--tn) 30%, var(--ink2)), color-mix(in srgb, var(--tn) 14%, var(--ink2)) 70%); }
.adm .panel[data-tone] > h2, .adm .panel[data-tone] > h3 { color: var(--tn); }
.adm .panel[data-tone] > .field > span, .adm .panel[data-tone] small { color: color-mix(in srgb, var(--tn) 55%, #c9c6f5); }
.adm .panel[data-tone="cyan"]   { --tn: #4cc9f0; }
.adm .panel[data-tone="pink"]   { --tn: #ff7ac6; }
.adm .panel[data-tone="purple"] { --tn: #d08bff; }
.adm .panel[data-tone="red"]    { --tn: #ff5d73; }
.adm .panel[data-tone="blue"]   { --tn: #8c9bff; }
.adm .panel[data-tone="orange"] { --tn: #ff9f43; }
.adm .panel[data-tone="green"]  { --tn: #7be07b; }
.adm .panel[data-tone="teal"]   { --tn: #2ee6c5; }
.adm .panel[data-tone="gold"]   { --tn: #ffd24a; }

/* colour dot you can click to change a player's colour */
.dotbtn { border: 0; padding: 0; cursor: pointer; box-shadow: 0 0 0 2px rgba(255,255,255,.18); transition: transform .12s, box-shadow .12s; }
.dotbtn:hover { transform: scale(1.18); box-shadow: 0 0 0 3px rgba(255,255,255,.55); }
.lobby .dotbtn { width: 18px; height: 18px; flex: none; margin-right: 8px; }

/* colour palette under a player */
.palli { list-style: none; }
.palrow { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 6px 4px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; background: var(--c); cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.35); transition: transform .12s; }
.swatch:hover:not(:disabled) { transform: scale(1.18); }
.swatch.cur { box-shadow: 0 0 0 3px var(--ink2), 0 0 0 6px #fff; }
.swatch:disabled { opacity: .22; cursor: not-allowed; }
.lobby li.palli { background: transparent; padding: 0; }


.hexbox { display: inline-flex; gap: 8px; align-items: center; margin-left: 4px; }
.hexin { width: 110px; padding: 6px 10px; font-family: var(--mono); text-transform: lowercase; }

.hexprev { width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 2px 0 3px rgba(0,0,0,.3); flex: none; }
.hexprev.bad { background: repeating-linear-gradient(45deg, #3a3770 0 5px, #2b2860 5px 10px); box-shadow: 0 0 0 3px rgba(255,255,255,.3); }

.specwrap { flex-basis: 100%; display: grid; gap: 6px; }
.specbox { position: relative; width: min(300px, 100%); height: 150px; border-radius: 12px; cursor: crosshair; touch-action: none; border: 2px solid rgba(255,255,255,.35); overflow: hidden;
  background: linear-gradient(to bottom, rgba(140,140,140,0), #8c8c8c), linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); }
.specmark { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.55); pointer-events: none; }

.specwheel { position: relative; width: 190px; height: 190px; border-radius: 50%; cursor: crosshair; touch-action: none; border: 2px solid rgba(255,255,255,.35);
  background: radial-gradient(circle closest-side, #fff, rgba(255,255,255,0)), conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.hexbox { flex-wrap: wrap; } .hexbox .btn { white-space: nowrap; }

/* a clear red OUT label when a player is knocked out */
.outtag { display: inline-block; font-style: normal; font-size: .82rem; font-weight: 800; letter-spacing: .16em; padding: 3px 12px; margin-top: 4px; border-radius: 999px; background: #ff3b52; color: #fff; box-shadow: 0 0 0 2px rgba(255,59,82,.35), 0 3px 10px rgba(255,59,82,.45); }
td .outtag { font-size: .7rem; padding: 1px 8px; margin: 0 0 0 6px; }
.pn em.outtag { color: #fff; font-size: .82rem; letter-spacing: .16em; }

.pn .outtag { justify-self: start; width: fit-content; }
.recap .pn { text-align: left; }
.recap .pn .outtag { justify-self: start; }
.recap .ps b, .recap .ps small { color: #fff !important; }
.recap .ps .gd { color: var(--sun); }
.lead.nextup { color: var(--sun); font-family: var(--display); font-weight: 400 !important; font-synthesis: none; font-size: 1.2rem; letter-spacing: .04em; }
.panel h2 .gd { color: var(--sun); }
/* Lilita One and DM Mono ship in one weight each: never let the browser fake a bolder version (that is what made text look fat) */
html, body, * { font-synthesis: none; }
.medal { vertical-align: -5px; margin-right: 6px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }
.tbl td .medal { margin: 0 0 0 8px; vertical-align: -6px; }
.tbl th:nth-child(2), .tbl td:nth-child(2) { text-align: left; }

.lead.waitgo { color: #fff; font-size: calc(1.05rem + 2px); }
.panel small.inroom { font-size: calc(.8em + 2px); }
/* shot clock: thicker bar, plain black number on a light track so it stays readable as the fill shrinks */
.timer.shot { height: 34px; background: #f1efff; border-color: var(--line); }
.timer.shot span { font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: #000; text-shadow: none; letter-spacing: .02em; }
.cat.wt { font-size: 1.15rem; margin: 0; color: #ece9f8; } /* the grid gap gives equal space above and below */
.cat.wt b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--sun); } /* same look as the hint text */
.cat.wt + .word { padding-top: 0; } /* so the tiles are as far below the topic as the topic is below the clock */
/* score screen: equal space above and below "Next word coming up...", and room between the word and the score rows */
.comingup { margin: 16px 0; }
.comingup + .word { padding-top: 0; }
.panel .word + .recap { margin-top: 18px; }

.avgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 6px; }
.avbtn { font-size: 1.5rem; line-height: 1; padding: 8px 0; border-radius: 12px; border: 2px solid transparent; background: rgba(255, 255, 255, .08); cursor: pointer; }
.avbtn.on { border-color: var(--sun); background: rgba(255, 255, 255, .2); }
.avbtn:disabled { opacity: .25; cursor: not-allowed; }
.av, .bigav { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', var(--display), sans-serif; }

.tmtag { display: inline-block; align-self: start; padding: 2px 10px; border-radius: 999px; background: var(--tc); color: #1b1b1b; font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.tmchip { background: var(--tc); color: #1b1b1b; border-color: transparent; }
.board .teamhead { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; margin-top: 10px; border-left: 6px solid var(--tc); background: rgba(255, 255, 255, .06); border-radius: 8px; font-family: var(--display); }
.board .teamhead:first-child { margin-top: 0; }
.board .teamhead b { color: var(--tc); }
.teamwin { font-family: var(--display); font-size: 1.2rem; margin: 6px 0 4px; }
.teamwin b { color: var(--tc); }
.teamlist { list-style: none; padding: 0; margin: 0 auto 14px; max-width: 360px; display: grid; gap: 4px; }
.teamlist li { display: flex; justify-content: space-between; border-left: 6px solid var(--tc); padding: 4px 10px; background: rgba(255, 255, 255, .06); border-radius: 6px; }
.teamlist li b { color: var(--tc); }
.tmsel { width: auto; min-width: 7rem; padding: 6px 8px; }
.lav { font-size: 1.2rem; margin-right: 2px; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }

.bfolders { max-height: 450px; overflow-y: auto; padding: 8px 8px 8px 0; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: rgba(0, 0, 0, .12); scrollbar-width: thin; }
.avadmin { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); max-height: 330px; overflow-y: auto; padding-right: 4px; }
