/* Lava Shove: a volcano night, built on Floe Wobble's look (Doug, 3 Oct: "the same look and feel as the ice game").
   Smoky glass cards, ember-orange buttons and the same serif storybook title (Fraunces, self-hosted, OFL). games.css
   loads first only for the shared rules (no selectable text, the back button's pop-up); everything you see is here. */
@font-face { font-family: Fraunces; src: url(/fonts/Fraunces.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --night: #140708; --deep: #2a0f0b; --ice: #fff1e0; --frost: #f6d9c2; --ink: #2a0f0a; --aurora: #ffb02e;
  --glow: #ff7a3a; --soft: #d7a993;
}
* { box-sizing: border-box; }
html, body.ls { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body.ls { background: var(--night); color: var(--ice); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
.ls #app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }

button, .link { font: inherit; color: var(--ink); cursor: pointer; }
button { border: 0; border-radius: 16px; background: linear-gradient(#ffffff, var(--frost)); padding: 10px 16px; min-height: 48px; font-weight: 700; font-size: 17px; box-shadow: 0 4px 0 #b4693a, 0 8px 20px #0007; transition: transform .08s, box-shadow .08s; }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 #b4693a, 0 4px 10px #0007; }
button:focus-visible, .link:focus-visible { outline: 3px solid var(--aurora); outline-offset: 3px; }
button.big { width: 100%; font-family: Fraunces, Georgia, serif; font-size: 26px; font-weight: 800; min-height: 62px; }
button.cta { background: linear-gradient(#ffe08a, var(--aurora)); box-shadow: 0 4px 0 #b4501a, 0 8px 22px #ffb02e55; }
button.soft { background: #ffffff22; color: var(--ice); box-shadow: inset 0 0 0 2px #ffffff55; }
.link { background: none; border: 0; box-shadow: none; min-height: 44px; padding: 8px 10px; font-size: 16px; font-weight: 600; color: var(--frost); text-decoration: underline; text-underline-offset: 4px; display: inline-flex; align-items: center; }
button.icon { min-width: 44px; min-height: 44px; padding: 4px 8px; font-size: 18px; border-radius: 50%; background: #ffffff1f; color: var(--ice); box-shadow: inset 0 0 0 2px #ffffff44; }

/* top bar */
.ls-top { position: absolute; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 10px 6px; pointer-events: none; }
.ls-top > * { pointer-events: auto; }
#back-slot:empty { display: none; }
button.back, button.back.quiet { color: var(--ice); background: #ffffff1f; box-shadow: inset 0 0 0 2px #ffffff44; font-weight: 700; }
button.back { min-height: 44px; min-width: 44px; padding: 6px 14px 6px 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 16px; border-radius: 22px; }
.playing button.back { font-size: 0; gap: 0; padding: 6px; justify-content: center; }
.playing button.back span { font-size: 22px; }
.ls-top #sound { margin-left: auto; }
#pause { margin-left: auto; }
.playing #sound { margin-left: 0; }
.hud { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 12px; background: #2a0f0ab3; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 22px; padding: 4px 14px; box-shadow: inset 0 0 0 1.5px #ffffff33; min-height: 44px; }
.hud .num { white-space: nowrap; }
.hud .num b { font-family: Fraunces, Georgia, serif; font-size: 24px; font-variant-numeric: tabular-nums; }
.hud .fishes { font-size: 18px; display: flex; align-items: center; gap: 4px; }
.hud .fishes i { font-style: normal; }
.stage { font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--aurora); white-space: nowrap; }

#stage { position: relative; flex: 1; min-height: 0; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* pages over the moving sea */
.page { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: calc(max(8px, env(safe-area-inset-top)) + 56px) 16px max(16px, env(safe-area-inset-bottom)); overflow-y: auto; }
.rock-card { width: min(420px, 100%); background: linear-gradient(160deg, #ffffff22, #ffffff0c); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 28px; padding: 20px; box-shadow: inset 0 0 0 1.5px #ffffff55, 0 20px 50px #0009; display: flex; flex-direction: column; gap: 12px; }
.rock-card h2 { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 30px; text-align: center; font-weight: 800; }
.rock-card p { margin: 0; text-align: center; }
.home .rock-card { align-self: start; }
@media (orientation: landscape) { .home .rock-card { align-self: center; margin-right: auto; } }
.logo { margin: 0; text-align: center; font-family: Fraunces, Georgia, serif; font-weight: 900; font-size: clamp(44px, 13vw, 64px); line-height: .95; letter-spacing: -1px; color: var(--ice); text-shadow: 0 3px 0 #7a240e, 0 0 30px #ff7a3a88; }
.logo em { font-style: italic; color: var(--aurora); display: inline-block; transform: rotate(-4deg); animation: ls-wobble 3s ease-in-out infinite; }
@keyframes ls-wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-2px); } }
.tag { font-size: 16px; color: var(--frost); }
.best { font-size: 16px; min-height: 20px; color: var(--aurora); }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.small-row { justify-content: center; gap: 0 14px; }
.small-row > * { flex: 0 1 auto; white-space: nowrap; }
.controls { display: flex; gap: 8px; }
.chip { flex: 1; min-height: 44px; font-size: 15px; padding: 6px 8px; background: #ffffff1a; color: var(--ice); box-shadow: inset 0 0 0 2px #ffffff40; }
.chip[aria-pressed="true"] { background: var(--ice); color: var(--ink); box-shadow: inset 0 0 0 2px var(--aurora), 0 0 16px #ffb02e66; }

.how-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 16px; line-height: 1.35; color: var(--ice); }
.how-list b { color: var(--aurora); }

/* end card */
.end-card h2 { font-size: 38px; color: var(--glow); }
.end-sub { font-size: 17px; color: var(--frost); }
.medal { align-self: center; font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: 18px; padding: 8px 18px; border-radius: 99px; color: var(--ink); animation: ls-pop .5s cubic-bezier(.2,1.8,.4,1) both; }
.medal.gold { background: linear-gradient(#fff3a6, #f2c230); }
.medal.silver { background: linear-gradient(#ffffff, #b9c6d3); }
.medal.bronze { background: linear-gradient(#ffd6a8, #c47a3a); }
@keyframes ls-pop { from { transform: scale(0) rotate(-20deg); } to { transform: none; } }
.end-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 17px; }
.end-parts li { display: flex; justify-content: space-between; border-bottom: 1px solid #ffffff2e; padding: 4px 2px; }
.end-parts li b { font-variant-numeric: tabular-nums; }
.end-parts li.total { font-family: Fraunces, Georgia, serif; font-size: 22px; border: 0; color: var(--aurora); }
.end-best { font-size: 16px; color: var(--frost); }
.end-best.new { color: #fff3a6; font-weight: 700; }

/* warnings over the sea: gusts, seals, a rougher sea */
.banner { position: absolute; z-index: 6; left: 50%; top: 30%; transform: translateX(-50%); background: #2a0f0ad9; color: var(--ice); border-radius: 99px; padding: 8px 20px; font-family: Fraunces, Georgia, serif; font-size: 22px; font-weight: 800; white-space: nowrap; box-shadow: inset 0 0 0 2px var(--aurora), 0 8px 20px #0008; animation: ls-pop .35s cubic-bezier(.2,1.8,.4,1); }
.banner.warn { box-shadow: inset 0 0 0 2px #ffb24d, 0 8px 20px #0008; color: #ffe0b0; }

/* touch: hold a side */
.pads { position: absolute; z-index: 4; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 0 18px max(18px, env(safe-area-inset-bottom)); pointer-events: none; }
.pad { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; color: var(--ice); background: #ffffff1a; box-shadow: inset 0 0 0 2px #ffffff40; transition: background .1s; }
.pad.on { background: #ffb02e66; }

/* tips */
.tip { position: absolute; z-index: 12; left: 50%; top: calc(max(8px, env(safe-area-inset-top)) + 60px); transform: translateX(-50%); width: min(420px, calc(100% - 24px)); display: flex; gap: 10px; align-items: center; background: #2a0f0ae6; border-radius: 18px; padding: 8px 8px 8px 14px; box-shadow: inset 0 0 0 1.5px #ffffff44; font-size: 16px; }
.tip p { margin: 0; flex: 1; }
.tip button { min-height: 40px; min-width: 40px; padding: 2px 8px; font-size: 16px; }

/* the leave question (kit.js builds it) */
.leave-ask { position: fixed; inset: 0; z-index: 50; background: #120405cc; display: grid; place-items: center; padding: 16px; }
.leave-ask .card { width: min(400px, 100%); background: var(--deep); color: var(--ice); border-radius: 24px; padding: 22px; box-shadow: inset 0 0 0 1.5px #ffffff44; }
.leave-ask .card > * + * { margin-top: 12px; }
.leave-ask h2 { margin: 0; font-family: Fraunces, Georgia, serif; }
.leave-ask .stay { background: linear-gradient(#ffe08a, var(--aurora)); }

/* short screens (phones held sideways) */
@media (max-height: 520px) {
  .page { padding-top: calc(max(6px, env(safe-area-inset-top)) + 52px); padding-bottom: 8px; }
  .rock-card { padding: 12px 16px; gap: 8px; }
  .logo { font-size: 40px; }
  .tag { display: none; }
  button.big { min-height: 50px; font-size: 22px; }
  .how-list { font-size: 14px; gap: 4px; }
  .end-card h2 { font-size: 28px; }
  .home .best { font-size: 13px; margin: 0; }
  .chip, .levels .chip { min-height: 36px; font-size: 14px; padding: 4px 8px; }
  .home .soft, .home .soft-btn { min-height: 38px; padding: 4px 10px; font-size: 15px; }
  /* sideways phones: the home card goes two columns so it fits without scrolling (levels and Play on the left,
     controls, party and links on the right); the egg stays in sight on the right of wide screens */
  .home .home-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 8px; width: min(640px, 100%); align-items: center; }
  .home-card .logo { grid-column: 1 / -1; }
  .home-card .levels { grid-column: 1; grid-row: 2; }
  .home-card .best { grid-column: 1; grid-row: 3; }
  .home-card #go { grid-column: 1; grid-row: 4; }
  .home-card .controls:not(.levels) { grid-column: 2; grid-row: 2; }
  .home-card .party-row { grid-column: 2; grid-row: 3; }
  .home-card .small-row { grid-column: 2; grid-row: 4; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (pointer: fine) { .pads { display: none; } }

/* party: the home's two party buttons */
.party-row > * { flex: 1; }
.soft-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 10px; border-radius: 16px; background: #ffffff22; color: var(--ice); box-shadow: inset 0 0 0 2px #ffffff55; font-weight: 700; font-size: 15px; text-decoration: none; text-align: center; }
.party-row button.soft { font-size: 15px; padding: 8px 10px; }

/* party: TV and phone */
.dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 2px #ffffffaa; flex: none; }
.count { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; pointer-events: none; }
.count span { font-family: Fraunces, Georgia, serif; font-weight: 900; font-size: clamp(90px, 22vw, 220px); color: var(--aurora); text-shadow: 0 6px 0 #2a0f0a, 0 0 40px #ffb02e88; animation: ls-pop .4s cubic-bezier(.2,1.8,.4,1); }
.tv-stage { margin: 0 auto; font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: clamp(16px, 2vw, 26px); background: #2a0f0ab3; border-radius: 99px; padding: 6px 18px; box-shadow: inset 0 0 0 1.5px #ffffff33; }
.ls-tv .ls-top #sound { margin-left: 0; }
.ls-tv .ls-top { justify-content: space-between; }
.tv-card { width: min(1100px, 100%); display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; padding: 28px 36px; }
.tv-card .logo { text-align: left; font-size: clamp(44px, 6vw, 80px); }
.tv-card .tag { text-align: left; font-size: clamp(16px, 1.8vw, 24px); }
.tv-join { display: grid; gap: 14px; }
.join-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: clamp(18px, 2.2vw, 28px); font-weight: 600; }
.join-steps li { display: inline-flex; align-items: center; gap: 10px; }
.join-steps b { color: var(--aurora); }
.js-n { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--aurora); color: var(--ink); font-weight: 800; flex: none; }
.big-code { justify-self: start; font-family: Fraunces, Georgia, serif; font-size: clamp(64px, 10vw, 128px); font-weight: 900; letter-spacing: .14em; line-height: 1; padding: 10px 26px 14px 36px; color: var(--ink); background: var(--ice); border-radius: 26px; box-shadow: 0 8px 0 #b4693a; }
.qr { background: var(--ice); color: var(--ink); border-radius: 22px; padding: 16px; text-align: center; }
.qr svg { width: clamp(150px, 20vw, 240px); height: auto; display: block; }
.qr p { margin: 8px 0 0; font-weight: 700; font-size: 18px; }
.tv-people, .people { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.tv-person, .person { display: flex; align-items: center; gap: 10px; font-size: clamp(18px, 2vw, 26px); font-weight: 700; }
.person { font-size: 18px; }
.tv-person small, .person small { font-size: 13px; color: var(--ink); background: var(--aurora); border-radius: 99px; padding: 1px 8px; }
.tv-person.away, .person.away { opacity: .45; }
.tv-win { width: min(720px, 100%); }
.places { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.places li { display: grid; grid-template-columns: 34px 22px 1fr auto; gap: 10px; align-items: center; font-size: 18px; padding: 6px 8px; border-bottom: 1px solid #ffffff2e; }
.places li b { font-family: Fraunces, Georgia, serif; color: var(--aurora); }
.places li small { color: var(--frost); font-variant-numeric: tabular-nums; }
.places li.me { background: #ffb02e26; border-radius: 12px; }
.ls-tv .places li { font-size: clamp(18px, 2vw, 28px); }
.board { display: grid; gap: 4px; }
.board .row { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.board .row span { flex: 1; }
.tv-corner { position: absolute; z-index: 3; right: 16px; bottom: 12px; margin: 0; padding: 6px 14px; border-radius: 99px; background: #2a0f0ab3; font-size: 16px; color: var(--frost); }
.tv-corner b { color: var(--ice); }
.tv-status { position: absolute; z-index: 30; left: 50%; bottom: 10px; transform: translateX(-50%); margin: 0; color: #ffe0b0; font-weight: 700; }
.tv-status:empty { display: none; }
.name-box { font: inherit; font-size: 20px; padding: 12px 14px; border-radius: 14px; border: 0; background: var(--ice); color: var(--ink); box-shadow: inset 0 0 0 2px #b4693a; }
.err { color: #ffb2a8; min-height: 20px; font-weight: 600; }
.tag.small { font-size: 14px; }
.ls-room .ls-top #sound { margin-left: auto; }
.ls-room.playing .ls-top #sound, .ls-room .playing #sound { margin-left: 0; }
@media (max-width: 760px) { .tv-card { grid-template-columns: 1fr; text-align: center; } .tv-card .qr { display: none; } }

/* difficulty chips: a touch smaller than the control chips so the home still fits one screen */
.levels .chip { min-height: 40px; font-size: 14px; }
.levels .chip:disabled { opacity: .55; cursor: default; }
.levels .chip:disabled[aria-pressed="true"] { opacity: 1; }

/* JUMP: a big round button bottom right, over the lava, on every round screen */
.jump { position: absolute; z-index: 5; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px)); width: 104px; height: 104px; border-radius: 50%; padding: 0; font-family: Fraunces, Georgia, serif; font-size: 22px; font-weight: 900; letter-spacing: 1px; color: var(--ink); background: radial-gradient(circle at 35% 30%, #fff3b0, var(--aurora) 55%, #e2531d); box-shadow: 0 6px 0 #8a2a0c, 0 10px 24px #0009, 0 0 24px #ffb02e55; touch-action: none; }
.jump.on, .jump:active { transform: translateY(4px); box-shadow: 0 2px 0 #8a2a0c, 0 4px 12px #0009; }
.jump small { display: block; font-size: 11px; letter-spacing: 0; font-family: system-ui, sans-serif; font-weight: 700; opacity: .7; }
@media (pointer: fine) { .jump { width: 88px; height: 88px; font-size: 18px; } }
/* with the side pads showing, the right pad moves up out of JUMP's way */
.pads .pad.r { margin-bottom: 118px; }
@media (max-height: 520px) { .jump { width: 84px; height: 84px; font-size: 18px; } .pads .pad.r { margin-bottom: 96px; } }
.hud .gems { font-size: 18px; display: flex; align-items: center; gap: 4px; }
.hud .gems i { font-style: normal; }
.board .row > * { flex: 0 0 auto; }
.board .row span { flex: 1; }
