html, body.jc-body { margin: 0; padding: 0; height: 100%; height: 100dvh; overflow: hidden; background: #0a1736; color: #fff;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; }
.jc-body input { user-select: text; -webkit-user-select: text; }
.jc-back { text-decoration: none; color: #fff; font-weight: bold; border-radius: 14px; }
.jc-back-text { position: absolute; left: 16px; top: 16px; color: #fff; opacity: .8; text-decoration: none; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; border-radius: 14px; padding: .6em 1em;
  background: rgba(255,255,255,.14); touch-action: manipulation; }
button:active { transform: scale(.97); }
button:disabled { opacity: .35; }
input { font: inherit; padding: .5em .7em; border-radius: 10px; border: 2px solid #ffffff44; background: #ffffff14; color: #fff; width: 100%; }
input[type=checkbox] { width: auto; }
label { display: block; margin: .5em 0; }

#hud { position: fixed; top: 0; left: 0; right: 0; padding: max(8px, env(safe-area-inset-top)) 10px 0; z-index: 3; }
.hud { display: flex; gap: 8px; align-items: center; }
.icon { padding: .35em .5em; font-size: 1.2em; background: rgba(10,23,54,.55); }
.bars { flex: 1; display: grid; gap: 4px; background: rgba(10,23,54,.55); border-radius: 12px; padding: 6px 10px; }
.who { display: grid; grid-template-columns: 4.5em 1fr auto; gap: 8px; align-items: center; font-size: .85em; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: bold; }
.bar { height: 9px; background: #ffffff22; border-radius: 9px; overflow: hidden; }
.bar div { height: 100%; background: linear-gradient(90deg, #ffd34d, #ff6b6b); border-radius: 9px; transition: width .6s; }

.panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; max-height: 74vh; overflow-y: auto;
  padding: 18px 18px max(18px, env(safe-area-inset-bottom)); text-align: center;
  background: linear-gradient(180deg, rgba(14,40,86,.86), rgba(8,20,48,.96));
  border-top: 3px solid #ffffff33; border-radius: 26px 26px 0 0; backdrop-filter: blur(6px);
  box-shadow: 0 -10px 40px rgba(0,0,0,.4); animation: up .35s ease-out; }
.panel::before { content: ""; position: absolute; top: -3px; left: 0; right: 0; height: 8px; border-radius: 26px 26px 0 0;
  background: repeating-linear-gradient(90deg, #d4202a 0 18px, #fff 18px 36px); opacity: .85; }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
.s-setup, .s-home, .s-settings, .s-words, .s-how { max-height: 82vh; }

h1 { margin: .2em 0; font-size: 2em; text-shadow: 0 0 12px #ffd34d88; }
h2 { margin: .2em 0 .5em; font-size: 1.45em; }
h3 { margin: 1em 0 .3em; }
.lead { font-size: 1.05em; line-height: 1.35; }
.small { font-size: .85em; opacity: .85; }
.big { display: block; width: 100%; font-size: 1.25em; font-weight: bold; padding: .8em; margin: .5em 0; }
.go { background: linear-gradient(180deg, #ff4b55, #c8102e); box-shadow: 0 4px 0 #7a0a1c; }
.yes { background: linear-gradient(180deg, #34d058, #1a8f3a); box-shadow: 0 4px 0 #0e5a23; }
.no { background: linear-gradient(180deg, #ff9f43, #d9681a); box-shadow: 0 4px 0 #8a3f0b; }
.danger { background: #7a0a1c; }
.link { background: none; padding: 0; text-decoration: underline; border-radius: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: .6em; }
.row button { flex: 1; }
.judge { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.judge .big { margin: .3em 0; }

.elves { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: .6em 0; }
.elf { background: #ffffff14; border-radius: 16px; padding: 10px; line-height: 1.5; }
.elf h3 { margin: 0 0 .2em; }
.dots { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c); opacity: .5; }
.dots i.on { background: var(--c); opacity: 1; box-shadow: 0 0 8px var(--c); }

.roles { display: flex; justify-content: space-between; gap: 8px; font-size: .95em; margin-bottom: .4em; flex-wrap: wrap; }
.tag { background: var(--c); color: #111; padding: 2px 10px; border-radius: 10px; font-weight: bold; text-shadow: 0 0 2px #fff; }
.colours { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chip { background: var(--c); color: var(--ink); font-weight: bold; font-size: 1.1em; padding: 1em .2em; border: 3px solid #ffffff55;
  box-shadow: 0 4px 0 rgba(0,0,0,.35); display: flex; flex-direction: column; align-items: center; }
.chip small { font-size: .7em; }

.elfsay { margin: .2em 0 .5em; }
.card { background: #fffdf6; color: #1b2440; border-radius: 20px; padding: 16px 12px; margin: .4em 0 .8em;
  box-shadow: 0 6px 0 #c9b98a, 0 0 30px #ffd34d44; border: 3px dashed #c8102e55; }
.word { font-size: 2.6em; font-weight: bold; letter-spacing: .03em; word-break: break-word; }
.word b { color: #c8102e; }
.sentence { font-size: 1.1em; margin: .4em 0 .6em; font-style: italic; }
.say { background: #1b2440; color: #fff; }
.letters { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.letters span { background: #1b244014; border-radius: 8px; padding: 0 .12em; min-width: .8em; animation: pop .4s backwards; }
.letters span:nth-child(n) { animation-delay: calc(var(--i, 0) * 1ms); }
.small-mark { font-size: 1.3em; opacity: .75; margin-top: .3em; }
.hint { margin-top: .5em; font-size: 1.1em; }
@keyframes pop { from { transform: scale(0); } }
.second { color: #ffd34d; font-weight: bold; margin: .2em 0; }
.challenge { background: linear-gradient(90deg, #1a8f3a, #2ec94a); border-radius: 14px; padding: .6em; font-weight: bold;
  animation: wobble 1.2s ease-in-out infinite alternate; }
@keyframes wobble { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
.climbnow { background: var(--c); color: var(--ink); border-radius: 22px; padding: .7em; font-size: 1.5em; line-height: 1.25;
  border: 4px solid #fff; box-shadow: 0 0 30px var(--c); margin: .3em 0 .5em; }
.climbnow b { font-size: 1.6em; text-transform: uppercase; }
.cheer p { font-size: 1.15em; margin: .45em 0; }
.glow { animation: glow 1.2s ease-in-out infinite alternate; }
@keyframes glow { to { text-shadow: 0 0 30px #ffd34d, 0 0 60px #ff6b6b; } }
.how { text-align: left; line-height: 1.45; padding-left: 1.3em; }
.how li { margin: .35em 0; }
.checks { display: grid; grid-template-columns: repeat(3, 1fr); text-align: left; }
.checks label { margin: .25em 0; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); margin-right: 4px; vertical-align: middle; }
.settings label, .s-settings label, .s-setup label { text-align: left; }
.wl { width: 100%; border-collapse: collapse; margin-bottom: .8em; }
.wl td, .wl th { padding: .25em; border-bottom: 1px solid #ffffff18; }
.wl td:first-child { text-align: left; font-size: 1.1em; }
.wl .wk { text-align: left; color: #ffd34d; padding-top: .8em; }
.wl b { color: #ff8a8a; }
