:root {
  --ink: #1b1b2f;
  --cream: #fff6dc;
  --gold: #ffd25c;
  --panel: rgba(18, 24, 56, 0.92);
  --line: #3a4a8c;
  --pc: #ffd25c;
  --font-fun: 'Luckiest Guy', 'Arial Black', Impact, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b1430;
  color: var(--cream);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  image-rendering: pixelated;
}

.hidden { display: none !important; }

/* ---------- screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  touch-action: pan-y;
}
.panel {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--ink), 0 0 0 3px var(--line) inset;
  padding: 20px 24px;
  width: min(720px, 100%);
  max-height: 100%;
  overflow-y: auto;
  -webkit-user-select: text;
  user-select: text;
}

.logo {
  font-family: var(--font-fun);
  font-weight: 400;
  font-size: clamp(56px, 12vw, 104px);
  letter-spacing: 4px;
  margin: 0;
  text-align: center;
  color: var(--gold);
  text-shadow: 4px 4px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1.5deg); } }
.logo img {
  display: block;
  width: min(380px, 70%);
  height: auto;
  margin: -6px auto 0;
  filter: drop-shadow(0 6px 0 rgba(27, 27, 47, 0.45));
}
.tagline { text-align: center; margin: 4px 0 18px; font-weight: 700; color: #cfe2ff; }

.field { margin: 10px 0; }
.field.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.label { display: block; font-weight: 700; margin-bottom: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-fun);
  font-size: 22px;
  width: 52px;
  height: 46px;
  border-radius: 10px;
  border: 3px solid var(--ink);
  background: #2b3a78;
  color: var(--cream);
  cursor: pointer;
}
.chip.on { background: var(--gold); color: var(--ink); }
.chips.rooms .chip { width: auto; padding: 0 14px; font-size: 18px; }
.blurb { font-size: 13px; opacity: 0.8; margin-top: 6px; }

.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 12px 0; }
.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 4px 8px;
}
.name-row img { width: 48px; height: 48px; image-rendering: pixelated; object-fit: contain; }
.name-col { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.name-row select.seat { font-size: 13px; padding: 2px 4px; }
.name-row.bot img { filter: saturate(0.85); }
.name-row input, select {
  font: inherit;
  font-weight: 700;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
}
select { width: auto; margin-left: 6px; }
label.check { display: flex; align-items: center; gap: 6px; font-weight: 700; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--gold); }

.big-btn {
  font-family: var(--font-fun);
  font-size: 30px;
  letter-spacing: 1px;
  display: block;
  margin: 18px auto 6px;
  padding: 12px 36px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s;
}
.big-btn:hover { transform: translateY(-2px) rotate(-1deg); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.ghost-btn {
  font: inherit;
  font-weight: 700;
  background: none;
  border: 2px solid var(--line);
  color: var(--cream);
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
}

.howto { margin-top: 12px; color: #cfe2ff; }
.howto summary { cursor: pointer; font-weight: 700; }
.howto li { margin: 4px 0; }

.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pc); border: 2px solid var(--ink); display: inline-block; flex: none; }

.coin {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  background: url('../assets/coin/coin_frame_1.png') center / contain no-repeat;
  image-rendering: pixelated;
}
/* nest rooms: eggs instead of coins (Nov 7) */
body.nest-room .coin { background-image: url('../assets/eggs/egg1.png'); image-rendering: auto; }

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  font-family: var(--font-fun);
  text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink);
}
.hud-left { position: absolute; left: max(12px, env(safe-area-inset-left)); top: 10px; }
.hud-who { display: flex; align-items: center; gap: 8px; font-size: 22px; color: var(--pc); }
.hud-coins { display: flex; align-items: center; gap: 6px; font-size: 22px; color: var(--gold); }
.hud-hearts { display: flex; gap: 3px; margin: 2px 0 4px; }
.hud-hearts img { width: 22px; height: auto; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5)); }
.hud-hearts img.lost { opacity: 0.3; filter: grayscale(1) brightness(0.7); }
.hud-hearts.hit img { animation: pulse 0.3s 2; }
body.no-early-nap .nap-early { display: none; }
#hud-perks { font-family: system-ui, sans-serif; font-weight: 700; font-size: 12px; opacity: 0.9; }
.hud-center { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); }
#hud-timer { font-size: 44px; color: var(--cream); }
#hud-timer.warn { color: #ff6f61; animation: pulse 0.5s infinite; }
#hud-timer.bonus { color: #7af0ff; animation: pulse 0.3s 3; }
@keyframes pulse { 50% { transform: scale(1.15); } }
.hud-right { position: absolute; right: max(12px, env(safe-area-inset-right)); top: 12px; font-size: 20px; color: var(--gold); text-align: right; }
#hud-exit { font-size: 15px; color: var(--cream); }
#hud-exit.open { color: #7ddc4f; }
#hud-action {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  font-family: system-ui, sans-serif;
  font-weight: 800;
  font-size: 14px;
  white-space: pre;
  opacity: 0.9;
}
body.touch #hud-action { display: none; }

/* ---------- recap ---------- */
.rc-panel h2 {
  font-family: var(--font-fun);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 52px);
  margin: 0;
  text-align: center;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--ink);
}
#rc-sub { text-align: center; opacity: 0.85; margin: 4px 0 12px; }
#rc-list { list-style: none; padding: 0; margin: 0; }
#rc-list li {
  position: relative;
  display: grid;
  grid-template-columns: 52px 56px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.rc-place { font-family: var(--font-fun); font-size: 24px; color: var(--pc); text-align: center; }
#rc-list img { width: 56px; height: 56px; image-rendering: pixelated; object-fit: contain; }
/* the finish trophy sits on the portrait's top corner */
#rc-list img.rc-trophy {
  position: absolute; left: 104px; top: 2px; width: 28px; height: 28px;
  image-rendering: auto; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.35));
}
.rc-name { font-family: var(--font-fun); font-size: 22px; color: var(--pc); }
.rc-stats { font-size: 12px; opacity: 0.85; }
.rc-titles { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 11px;
  font-weight: 800;
  background: var(--gold);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 8px;
  border: 2px solid var(--ink);
}
.rc-coins { font-family: var(--font-fun); font-size: 22px; color: var(--gold); text-align: right; min-width: 64px; }
.rc-bonus { display: block; font-size: 12px; color: var(--cream); opacity: 0; transform: translateY(6px); transition: opacity 0.3s, transform 0.3s; white-space: nowrap; }
.rc-bonus.show { opacity: 1; transform: none; }
.rc-coins.pop { animation: rc-pop 0.25s ease-out; }
@keyframes rc-pop { 50% { transform: scale(1.25); } }
#rc-list li.winner { background: rgba(255, 210, 92, 0.16); border-radius: 12px; }
#rc-list li.winner .rc-place { animation: rc-pop 0.5s ease-out 2; }
@media (prefers-reduced-motion: reduce) { .rc-bonus { transition: none; } .rc-coins.pop, #rc-list li.winner .rc-place { animation: none; } }
.rc-buttons { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.rc-buttons .big-btn { margin: 14px 0 0; }
.rc-buttons .ghost-btn { margin-top: 14px; }

#rotate {
  position: fixed;
  inset: 0;
  background: #0b1430;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-fun);
  font-size: 26px;
  text-align: center;
  padding: 24px;
  z-index: 10;
}

@media (max-height: 520px) {
  .panel { padding: 12px 16px; }
  .logo { font-size: 52px; }
  .logo img { width: min(200px, 40%); }
  .tagline { margin-bottom: 8px; }
  .big-btn { font-size: 24px; padding: 8px 28px; margin-top: 10px; }
  #hud-timer { font-size: 34px; }
}

/* ---------- upright phone: logo, screen, retro controller ---------- */
#play-logo { position: fixed; display: flex; justify-content: center; align-items: center; pointer-events: none; }
#play-logo picture { display: flex; justify-content: center; height: 100%; width: 100%; }
#play-logo img { height: 100%; width: auto; max-width: 80%; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35)); }
#screen-frame { position: fixed; pointer-events: none; box-shadow: 0 0 0 2px #1b1b2f, 0 6px 18px rgba(0, 0, 0, 0.55); }
#pad { position: fixed; touch-action: none; user-select: none; -webkit-user-select: none; }
#pad img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
#pad .pad-body { position: absolute; inset: 0; width: 100%; height: 100%; }
/* sideways touch screens: no controller body, the pieces float over the game,
   see-through so the play shows through them */
#pad.side { inset: 0; pointer-events: none; }
#pad.side .pad-body { display: none; }
#pad.side .pad-dpad, #pad.side .pbtn { pointer-events: auto; opacity: 0.6; }
#pad.side .pad-dpad.on, #pad.side .pbtn.on { opacity: 0.85; }
/* someone else's turn (a bot, or the turn changing hands): the controls go
   grey and don't light up when pressed, so they don't look playable */
body.spectate #pad .pad-dpad, body.spectate #pad .pbtn { filter: grayscale(1) brightness(0.7); opacity: 0.45; transition: opacity 0.2s, filter 0.2s; }
body.spectate #pad.side .pad-dpad, body.spectate #pad.side .pbtn { opacity: 0.25; }
body.spectate #pad .pbtn.on .up, body.spectate #pad .pad-dpad.on .up { visibility: visible; }
body.spectate #pad .pbtn.on .dn, body.spectate #pad .pad-dpad.on .dn { visibility: hidden; }
.pad-dpad { position: absolute; transform: translate(-50%, -50%); touch-action: none; }
.pad-dpad img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.pad-dpad .dn, .pad-dpad.on .up { visibility: hidden; }
.pad-dpad.on .dn { visibility: visible; }
/* the d-pad's touch area reaches well past the art, so a thumb that drifts still counts */
.pad-dpad::after { content: ''; position: absolute; inset: -22%; border-radius: 50%; }
.pbtn {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.pbtn img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pbtn .dn, .pbtn.on .up { visibility: hidden; }
.pbtn.on .dn { visibility: visible; }
.pbtn::after { content: ''; position: absolute; inset: -14%; border-radius: 50%; }
.pbtn span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -54%);
  font-family: var(--font-fun);
  font-size: var(--lbl, 12px);
  line-height: 0.95;
  color: #fff6dc;
  text-align: center;
  white-space: pre-line;
  width: 110%;
  text-shadow: 1px 1px 0 rgba(27, 27, 47, 0.9), -1px -1px 0 rgba(27, 27, 47, 0.6), 1px -1px 0 rgba(27, 27, 47, 0.6), -1px 1px 0 rgba(27, 27, 47, 0.6);
  pointer-events: none;
}
.pbtn.on span { transform: translate(-50%, -44%); }
body.upright #hud { inset: auto; }
body.upright .hud-left { left: 8px; top: 6px; }
body.upright .hud-right { right: 8px; top: 6px; font-size: 14px; }
body.upright .hud-who, body.upright .hud-coins { font-size: 15px; gap: 5px; }
body.upright .hud-coins .coin { width: 14px; height: 14px; }
body.upright #hud-perks { display: none; }
body.upright #hud-exit { font-size: 11px; }
body.upright .hud-center { top: 2px; }
body.upright #hud-timer { font-size: 28px; }
body.upright .dot { width: 9px; height: 9px; }

/* loading screen: covers everything until all the art is in (main.js) */
#loading {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #0b1430; color: #ffd23f; font-family: 'Luckiest Guy', sans-serif; font-size: 22px;
  text-align: center; padding: 16px;
}
#loading img { width: min(60vw, 360px); height: auto; }
#loading .load-msg { animation: loadpulse 1.2s ease-in-out infinite alternate; }
@keyframes loadpulse { from { opacity: 0.45; } to { opacity: 1; } }

/* ---------- re-roll vote (between rounds in nest rooms) ---------- */
#vote { background: rgba(10, 12, 28, 0.55); }
.vote-panel { width: min(520px, 100%); padding: 14px 16px 16px; }
.vt-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.vote-panel h2 {
  font-family: var(--font-fun);
  font-weight: 400;
  font-size: clamp(26px, 5vw, 38px);
  margin: 0;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--ink);
  line-height: 1.05;
}
#vt-sub { margin: 4px 0 0; font-size: 13px; opacity: 0.9; }
/* a six-sided die: a 3x3 grid of pips, shown per face */
.vt-die {
  flex: none;
  width: 52px; height: 52px;
  background: #fffaf0;
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--ink);
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 5px;
  box-sizing: border-box;
}
.vt-die i { width: 9px; height: 9px; margin: auto; border-radius: 50%; background: var(--ink); visibility: hidden; }
.vt-die i.on { visibility: visible; }
.vt-die.rolling { animation: vt-tumble 0.32s linear infinite; }
@keyframes vt-tumble {
  25% { transform: translate(3px, -6px) rotate(90deg); }
  50% { transform: translate(0, -9px) rotate(180deg); }
  75% { transform: translate(-3px, -6px) rotate(270deg); }
  100% { transform: rotate(360deg); }
}
.vt-die.landed { animation: rc-pop 0.35s ease-out; }
#vt-list { list-style: none; padding: 0; margin: 0; position: relative; --rowh: 58px; }
#vt-list li {
  position: absolute; left: 0; right: 0; top: 0;
  height: var(--rowh);
  display: grid;
  grid-template-columns: 40px 48px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  transition: transform 0.14s ease-out;
  box-sizing: border-box;
  background: #121838; /* solid, so rows cover each other cleanly mid-shuffle */
}
#vt-list.settle li { transition-duration: 0.45s; transition-timing-function: cubic-bezier(.3, 1.5, .5, 1); }
.vt-slot { font-family: var(--font-fun); font-size: 20px; color: var(--cream); opacity: 0.8; text-align: center; }
#vt-list img { width: 48px; height: 48px; image-rendering: pixelated; object-fit: contain; }
.vt-name { font-family: var(--font-fun); font-size: 20px; color: var(--pc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vt-pick { display: flex; gap: 6px; }
.vt-pick button {
  font: 800 13px system-ui, sans-serif;
  padding: 8px 10px;
  border-radius: 9px;
  border: 2px solid var(--ink);
  background: #3a3f63;
  color: #e9ecff;
  cursor: pointer;
  touch-action: manipulation;
}
.vt-pick button.sel { background: var(--gold); color: var(--ink); box-shadow: 0 0 0 2px #fff6 inset; }
.vt-pick button[data-yes="1"].sel { background: #ff8a5c; }
.vt-pick.closed button { pointer-events: none; opacity: 0.7; }
.vt-chip { font: 800 13px system-ui, sans-serif; padding: 6px 10px; border-radius: 9px; background: #3a3f63; color: #e9ecff; white-space: nowrap; }
.vt-chip.yes { background: #ff8a5c; color: var(--ink); }
.vt-chip.no { background: var(--gold); color: var(--ink); }
.vt-chip.wait { opacity: 0.65; font-style: italic; }
.vt-bar { height: 6px; border-radius: 3px; background: #ffffff22; margin-top: 12px; overflow: hidden; }
#vt-bar-fill { height: 100%; width: 100%; background: var(--gold); }
@media (prefers-reduced-motion: reduce) { .vt-die.rolling, .vt-die.landed { animation: none; } #vt-list li { transition: none; } }

/* ---------- menus (menu.js, uikit.js) ---------- */
#menu {
  display: block;
  padding: 0;
  overflow: hidden;
  touch-action: manipulation;
  background: radial-gradient(ellipse at center, rgba(8, 12, 28, 0.25), rgba(4, 6, 16, 0.75));
}
body.upright #menu { background: radial-gradient(ellipse at 50% 30%, #1d2a4d, #070a16 75%); }
#menu.hidden { display: none; }
#menu-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#menu-stage * { box-sizing: border-box; }
body.menu-open #pad, body.menu-open #play-logo, body.menu-open #screen-frame { display: none !important; }
.m-abs { position: absolute; }
.m-text { display: flex; align-items: center; white-space: nowrap; overflow: hidden; line-height: 1.05; pointer-events: none; }
.m-wrap { white-space: normal; }
.m-fun {
  font-family: var(--font-fun); color: #fff3d6; letter-spacing: 0.02em;
  text-shadow: -1px -1px 0 #1b1410, 1px -1px 0 #1b1410, -1px 1px 0 #1b1410, 1px 1px 0 #1b1410, 0 1.5px 0 #1b1410;
}
.m-gold .m-fun { color: #3a2208; text-shadow: 0 1px 0 rgba(255, 236, 170, 0.6); }
.m-small { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 700; color: #e9e2d0; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); }
.m-ink { color: #5a3a20; text-shadow: none; }
.m-off .m-fun { color: #d8d3c8; }
.m-body { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 600; color: #eee6d2; line-height: 1.35; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }
.m-caption { color: #cfc6b0; font-weight: 600; }
.m-btn { cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.m-off { cursor: default; }
.m-btn img, .m-picker img { pointer-events: none; }
.m-glow { filter: drop-shadow(0 0 1.5px #ffd84a) drop-shadow(0 0 2.5px rgba(255, 200, 60, 0.8)); }
.m-swatch { border-radius: 50%; }
.m-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: transparent; border: none; outline: none; padding: 0 2px;
  text-align: center; color: #fff3d6; caret-color: #ffd84a;
  transform-origin: center;
}
.m-well { overflow: visible; }

/* results and the re-roll vote: same stone panel and buttons */
.panel.rc-panel, .panel.vote-panel {
  background: var(--ui-panel-center) center / calc(100% - 24px) calc(100% - 24px) no-repeat;
  border: 22px solid transparent;
  border-image: var(--ui-panel) 55 / 22px round;
  border-radius: 0;
  box-shadow: none;
}
.rc-buttons .big-btn, .rc-buttons .ghost-btn {
  height: 46px; padding: 0 30px; margin: 14px 0 0;
  border: none; border-radius: 0; background: none; box-shadow: none;
  border-style: solid; border-width: 0 22px; border-color: transparent;
  font-family: var(--font-fun); font-size: 22px; letter-spacing: 0.5px;
}
.rc-buttons .big-btn { border-image: var(--ui-btn-gold-n) 0 40 fill / 0 22px stretch; color: #3a2208; }
.rc-buttons .big-btn:hover, .rc-buttons .big-btn:focus-visible { border-image-source: var(--ui-btn-gold-s); transform: none; }
.rc-buttons .big-btn:active { border-image-source: var(--ui-btn-gold-p); transform: translateY(1px); box-shadow: none; }
.rc-buttons .ghost-btn {
  border-image: var(--ui-btn-stone-n) 0 40 fill / 0 22px stretch; color: #fff3d6;
  text-shadow: -1px -1px 0 #1b1410, 1px -1px 0 #1b1410, -1px 1px 0 #1b1410, 1px 1px 0 #1b1410;
}
.rc-buttons .ghost-btn:hover { border-image-source: var(--ui-btn-stone-s); }
.rc-buttons .ghost-btn:active { border-image-source: var(--ui-btn-stone-p); }
/* Luckiest Guy sits high in its line box: nudge single-line labels down so
   the letters land in the middle of their button (measured, Nov 8) */
.m-text.m-fun:not(.m-wrap) { padding-top: 0.3em; }

.m-pencil { position: absolute; cursor: text; z-index: 1; }

/* start menu (Nov 9): floating logo, frameless icon buttons */
.m-float { animation: m-bob 2.4s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes m-bob { 50% { transform: translateY(-3px) rotate(-1.5deg); } }
.m-plain img { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5)); }
.m-plain:active { transform: translateY(0.6px) scale(0.97); }
.m-wait { color: #ffd84a; }
.m-host { cursor: default; }
.m-shade { background: rgba(5, 8, 20, 0.6); }
/* level preview: a few views crossfading with a slow drift */
.m-prev-win { overflow: hidden; border-radius: 2px; background: #0d1226; }
.m-prev-win img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.9s ease; }
.m-prev-win img.on { opacity: 1; animation: m-drift 7s ease-in-out infinite alternate; }
@keyframes m-drift { from { transform: scale(1.04) translateX(-1.5%); } to { transform: scale(1.12) translateX(1.5%); } }
.m-prev-frame { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .m-float, .m-prev-win img.on { animation: none; } }
/* button and sign labels in capitals, like the mockups (the font draws
   lowercase as small capitals, which looked uneven next to each other) */
.m-btn .m-fun, .m-plaque .m-fun { text-transform: uppercase; }

/* ---------- results: Eggs Rescued (results.js, Nov 9) ---------- */
.r-art { pointer-events: none; user-select: none; -webkit-user-select: none; max-width: none; }
.r-group { pointer-events: none; }
.r-group[role] { pointer-events: none; }
.r-fg-tall { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 32%); mask-image: linear-gradient(to bottom, transparent 0, #000 32%); }
.r-ink { color: #3a2208; text-shadow: 0 1px 0 rgba(255, 236, 170, 0.6); }
/* three ray fans stacked, each swaying back and forth at its own pace */
.r-rays { pointer-events: none; }
.r-rays img { mix-blend-mode: screen; transform-origin: 50% 96%; opacity: 0.7; animation: r-sway 7s ease-in-out infinite alternate; }
.r-rays img:nth-child(2) { opacity: 0.55; animation-duration: 9.5s; animation-direction: alternate-reverse; }
.r-rays img:nth-child(3) { opacity: 0.6; animation-duration: 12s; animation-delay: -4s; }
@keyframes r-sway { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
.r-fade { animation: r-fade 1s ease-out both; }
@keyframes r-fade { from { opacity: 0; } }
.r-drop { animation: r-drop 0.7s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes r-drop { from { transform: translateY(-40px) scale(0.85); opacity: 0; } }
.r-rise { animation: r-rise 0.75s cubic-bezier(.2, .9, .3, 1.12) both; }
@keyframes r-rise { from { transform: translateY(110px); } }
.r-hide { opacity: 0; }
.r-pop { animation: r-pop 0.45s cubic-bezier(.2, .9, .3, 1.6) both; }
@keyframes r-pop { from { transform: scale(0.3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .r-rays img, .r-fade, .r-drop, .r-rise, .r-pop { animation: none; } }
.r-still img { animation: none; }
