/* Best Jest. Base look (buttons, sheets, screens, mega buttons, lobby) comes straight from ProcreNate. */
:root {
  --bg: #ebe8f4;
  --panel: #ffffff;
  --ink: #2a2440;
  --muted: #8a83a3;
  --line: #e4e0f0;
  --press: #d9d4ea;
  --accent: #7b5cff;
  --accent-d: #5a3ee0;
  --green: #22c070;
  --green-d: #179456;
  --orange: #ff9f1c;
  --orange-d: #d97f00;
  --red: #ff4d5e;
  --red-d: #cf2f40;
  --shadow: 0 12px 32px rgba(42, 36, 64, 0.16), 0 2px 6px rgba(42, 36, 64, 0.06);
  --checker: repeating-conic-gradient(#e6e3ef 0 25%, #fff 0 50%) 0 0 / 14px 14px;
  --font: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 800;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
.hidden { display: none !important; }
.ic { width: 26px; height: 26px; flex: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 18px;
  background: var(--panel);
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 4px 0 var(--press), 0 8px 20px rgba(42, 36, 64, 0.1);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.15s;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--press), 0 3px 8px rgba(42, 36, 64, 0.1); }
.btn:disabled { opacity: 0.45; }
.btn.icon-btn { width: 56px; padding: 0; }
.btn.small { min-height: 44px; width: 44px; border-radius: 14px; }
.btn.small .ic { width: 22px; height: 22px; }
.btn.big { min-height: 64px; font-size: 20px; border-radius: 22px; width: 100%; }
.btn.big .ic { width: 28px; height: 28px; }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-d), 0 8px 20px rgba(34, 192, 112, 0.3); }
.btn-green:active:not(:disabled) { box-shadow: 0 1px 0 var(--green-d); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-d), 0 8px 20px rgba(123, 92, 255, 0.3); }
.btn-accent:active:not(:disabled) { box-shadow: 0 1px 0 var(--accent-d); }
.btn-orange { background: var(--orange); color: #fff; box-shadow: 0 4px 0 var(--orange-d), 0 8px 20px rgba(255, 159, 28, 0.3); }
.btn-orange:active:not(:disabled) { box-shadow: 0 1px 0 var(--orange-d); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-d); }
.btn.ghost { background: rgba(255, 255, 255, 0.5); box-shadow: none; color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 14px;
  border-radius: 24px;
  background: #f1eff8;
  color: var(--muted);
  font-size: 16px;
  transition: background 0.15s, color 0.15s, transform 0.08s;
}
.pill:active { transform: scale(0.96); }
.pill.on { background: var(--accent); color: #fff; }

.seg {
  display: inline-flex;
  background: #f1eff8;
  border-radius: 18px;
  padding: 4px;
  gap: 4px;
}
.seg button {
  min-width: 48px;
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.seg button .ic { width: 20px; height: 20px; }
.seg button.on { background: #fff; color: var(--accent); box-shadow: 0 2px 0 var(--press), 0 3px 10px rgba(42, 36, 64, 0.1); }
.seg-wide { display: flex; width: 100%; }
.seg-wide button { flex: 1; padding: 0 6px; }

.switch {
  width: 64px;
  height: 38px;
  border-radius: 19px;
  background: #dcd8ea;
  position: relative;
  flex: none;
  transition: background 0.2s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(42, 36, 64, 0.25);
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(26px); }

/* ---------------------------------------------------------------- sliders */
.hslider, .vslider { position: relative; touch-action: none; cursor: pointer; }
.hslider { height: 46px; }
.hslider .sl-track {
  position: absolute;
  inset: 7px 0;
  border-radius: 16px;
  background: #ece9f5;
  box-shadow: inset 0 0 0 1px rgba(42, 36, 64, 0.08);
}
.sl-thumb {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 0 var(--press), 0 4px 12px rgba(42, 36, 64, 0.22);
  display: grid;
  place-items: center;
  transition: transform 0.12s;
  pointer-events: none;
}
.hslider .sl-thumb { top: 0; left: calc(var(--f, 0) * (100% - 46px)); }
.sl-thumb span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.08);
}
.hslider.active .sl-thumb, .vslider.active .sl-thumb { transform: scale(1.12); }
.set-slider .sl-track { background: linear-gradient(90deg, #ece9f5, #cfc4ff); }

/* ---------------------------------------------------------------- popups */
.toast {
  position: fixed;
  left: 50%;
  top: calc(80px + var(--st));
  transform: translate(-50%, -12px);
  padding: 12px 20px;
  border-radius: 18px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  max-width: calc(100vw - 40px);
  text-align: center;
  transition: opacity 0.18s, transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.flash {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 24px;
  border-radius: 20px;
  background: rgba(42, 36, 64, 0.82);
  color: #fff;
  font-size: 20px;
  pointer-events: none;
  opacity: 0;
  z-index: 85;
}
.flash.show { animation: flash 0.75s ease-out; }
@keyframes flash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

.menu-backdrop { position: fixed; inset: 0; z-index: 50; }
.popmenu {
  position: fixed;
  z-index: 51;
  min-width: 210px;
  padding: 8px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(42, 36, 64, 0.28), 0 2px 6px rgba(42, 36, 64, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform: scale(0.6);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.12s;
}
.popmenu.show { transform: none; opacity: 1; }
.pm-item {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 18px 0 14px;
  border-radius: 16px;
  font-size: 18px;
  text-align: left;
}
.pm-item:hover:not(:disabled) { background: #f4f2fa; }
.pm-item:active:not(:disabled) { background: #ebe7f8; transform: scale(0.98); }
.pm-item:disabled { opacity: 0.32; }
.pm-item.danger { color: var(--red-d); }
.pm-item.cancel { color: var(--muted); border-top: 2px solid #f1eff8; border-radius: 0 0 16px 16px; }

/* ---------------------------------------------------------------- sheets */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(42, 36, 64, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.sheet.show { opacity: 1; pointer-events: auto; }
.sheet-card {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  touch-action: pan-y;
  padding: 20px;
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.sheet.show .sheet-card { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { margin: 0; font-size: 24px; font-weight: 900; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.btn.tile { flex-direction: column; gap: 6px; min-height: 92px; font-size: 15px; padding: 10px; }
.btn.tile .ic { width: 30px; height: 30px; color: var(--accent); }
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 2px;
  border-top: 2px solid #f4f2fa;
  font-size: 16px;
}
.set-row > span { flex: 1; }
.set-row .set-slider { flex: 1.2; }
.set-head { margin: 16px 2px 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 900; }
.set-row .seg button { min-width: 0; padding: 0 12px; }
.set-select { font: inherit; font-size: 15px; color: var(--ink); background: #f1eff8; border: 0; border-radius: 14px; height: 42px; padding: 0 12px; max-width: 55%; }
.set-note { margin: 2px 2px 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); line-height: 1.4; }
body.native-shell .web-only, body:not(.native-shell) .shell-only { display: none; }
.confirm-card { width: min(380px, 100%); text-align: center; }
.confirm-card h3 { margin: 4px 0 8px; font-size: 24px; font-weight: 900; }
.confirm-card p { margin: 0 0 20px; color: var(--muted); font-weight: 700; line-height: 1.4; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tips { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; font-weight: 700; line-height: 1.4; color: #4d466a; }
.tips b { color: var(--ink); font-weight: 900; }

/* ---------------------------------------------------------------- screens */
.screen {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(12px + var(--st)) calc(16px + var(--sr)) calc(16px + var(--sb)) calc(16px + var(--sl));
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 159, 28, 0.28), transparent 38%),
    radial-gradient(circle at 88% 12%, rgba(43, 192, 107, 0.24), transparent 38%),
    radial-gradient(circle at 82% 88%, rgba(47, 125, 255, 0.24), transparent 42%),
    radial-gradient(circle at 12% 88%, rgba(255, 59, 79, 0.2), transparent 40%),
    #ece8f6;
  opacity: 0;
  pointer-events: none;
  transform: translateX(48px);
  transition: opacity 0.28s ease, transform 0.42s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.screen[data-dir='back'] { transform: translateX(-48px); }
.screen[data-dir='fade'] { transform: scale(0.98); }
.screen.show { opacity: 1; pointer-events: auto; transform: none; }
.screen.leaving { opacity: 0; pointer-events: none; transform: translateX(-48px); }
.screen.leaving[data-dir='back'] { transform: translateX(48px); }
.screen.leaving[data-dir='fade'] { transform: scale(1.02); }
#screens .screen.leaving { z-index: 69; }
.home-card, .finish-card {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  transform: translateY(16px);
  transition: transform 0.3s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.screen.show .home-card, .screen.show .finish-card { transform: none; }
.logo { display: flex; align-items: center; justify-content: center; gap: 10px; }
.logo-mark { width: 74px; height: 74px; filter: drop-shadow(0 4px 0 var(--press)) drop-shadow(0 8px 16px rgba(42, 36, 64, 0.18)); }
.logo h1 { margin: 0; font-size: clamp(40px, 11vw, 56px); font-weight: 900; letter-spacing: -1.5px; }
.logo h1 span { color: var(--accent); }
.tagline { margin: -8px 0 6px; text-align: center; color: var(--muted); font-size: 18px; }
.home-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.6);
}
.hint { margin: -2px 0 2px; text-align: center; color: var(--muted); font-size: 14px; }

.finish-card h2 { margin: 0; text-align: center; font-size: 36px; font-weight: 900; }
.finish-prompt { margin: -8px 0 0; text-align: center; color: var(--muted); font-size: 18px; min-height: 0; }
.finish-prompt:empty { display: none; }
.preview {
  border-radius: 26px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(42, 36, 64, 0.06);
  height: min(42vh, 360px);
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}
.preview img { max-width: 100%; max-height: calc(min(42vh, 360px) - 32px); object-fit: contain; display: block; }
.preview p { color: var(--muted); font-size: 18px; }
.export-opts { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.export-opts .pill { background: #fff; }
.export-opts .pill.on { background: var(--accent); }
.export-opts .seg { background: #fff; }
.export-opts .seg button.on { background: var(--accent); color: #fff; box-shadow: 0 2px 0 var(--accent-d); }
.dims { margin: -4px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.finish-actions { display: flex; gap: 12px; }
.finish-actions .btn { flex: 1; }

/* ================================================================ juicy buttons */
.fx { position: relative; overflow: hidden; isolation: isolate; -webkit-tap-highlight-color: transparent; }
.fx::after {
  /* a soft, blurred sheen that glides across, like light over glossy plastic */
  content: '';
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: 0;
  width: 70%;
  background: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 22%,
    rgba(255, 255, 255, 0.22) 38%,
    rgba(255, 255, 255, 0.42) 50%,
    rgba(255, 255, 255, 0.22) 62%,
    rgba(255, 255, 255, 0.05) 78%,
    rgba(255, 255, 255, 0) 100%);
  filter: blur(10px);
  opacity: 0;
  transform: translateX(-130%) skewX(-12deg);
  pointer-events: none;
  z-index: 3;
}
.fx:not(.badge)::before {
  /* faint top-edge gloss that brightens on hover */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 45%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 2;
}
.mega, .pick-card, .gal-card, .badge, .round-btn, .fx.btn {
  transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.2s, filter 0.2s;
}
@media (hover: hover) and (pointer: fine) {
  .fx:hover:not(:disabled):not(.locked) { transform: translateY(-4px) scale(1.015); filter: brightness(1.06) saturate(1.06); }
  .fx:hover:not(:disabled):not(.locked)::after { animation: glimmer 1.25s cubic-bezier(0.35, 0.1, 0.25, 1); }
  .fx:not(.badge):hover:not(:disabled):not(.locked)::before { opacity: 1; }
  .mega:hover .mega-art .art, .pick-card:hover .pick-art .art { animation: wiggle 0.6s ease-in-out; }
  .mega:hover .mega-go { transform: translateX(4px); background: rgba(255, 255, 255, 0.4); }
  .pick-card:hover:not(:disabled), .gal-card:hover { box-shadow: 0 0 0 4px rgba(123, 92, 255, 0.35), 0 6px 0 var(--press), 0 18px 34px rgba(123, 92, 255, 0.25); }
  .round-btn:hover { box-shadow: 0 0 0 4px rgba(123, 92, 255, 0.25), 0 4px 0 var(--press), 0 10px 22px rgba(42, 36, 64, 0.14); }
}
.fx:active:not(:disabled):not(.locked) {
  transform: translateY(5px) scale(0.975) !important;
  box-shadow: 0 1px 0 var(--shade, var(--press)), 0 4px 10px rgba(42, 36, 64, 0.12) !important;
  transition-duration: 0.06s;
}
.ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0, rgba(255, 255, 255, 0) 62%);
  transform: scale(0);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 2;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
@keyframes glimmer {
  0% { opacity: 0; transform: translateX(-130%) skewX(-12deg); }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(190%) skewX(-12deg); }
}
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg) scale(1.07); } 55% { transform: rotate(6deg) scale(1.07); } 80% { transform: rotate(-2deg); } }
.shake { animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-9px) rotate(-2deg); }
  40%, 60% { transform: translateX(9px) rotate(2deg); }
}
@keyframes breathe { 0%, 100% { box-shadow: 0 6px 0 var(--shade), 0 10px 26px var(--glow, rgba(34, 192, 112, 0.35)); } 50% { box-shadow: 0 6px 0 var(--shade), 0 10px 40px 6px var(--glow, rgba(34, 192, 112, 0.55)); } }
@media (prefers-reduced-motion: reduce) {
  .fx::after, .doodle, .logo-big .logo-mark { animation: none !important; }
  .screen { transition: opacity 0.2s; transform: none !important; }
}

/* ================================================================ menu layout */
.menu-top {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  position: relative;
  z-index: 2;
}
.menu-title { margin: 0; font-size: 22px; font-weight: 900; text-align: center; flex: 1; }
.round-btn, .round-spacer { width: 52px; height: 52px; flex: none; }
.round-btn {
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  --shade: var(--press);
  box-shadow: 0 4px 0 var(--press), 0 8px 18px rgba(42, 36, 64, 0.12);
}
.round-btn .ic { width: 24px; height: 24px; }
.menu-body {
  flex: 1;
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 8px 0 20px;
  position: relative;
  z-index: 1;
}
.wide-body { width: min(920px, 100%); }
.menu-lead { margin: 0 0 4px; text-align: center; font-size: 18px; color: var(--muted); }
.big-title { margin: 0; text-align: center; font-family: 'Luckiest Guy', var(--font); font-weight: 400; letter-spacing: 1px; font-size: clamp(34px, 8vw, 48px); color: var(--ink); }

/* ---- title */
.title-body { align-items: stretch; }
.logo-big { flex-direction: column; gap: 4px; }
.logo-big .logo-mark { width: 96px; height: 96px; animation: bob 3.2s ease-in-out infinite; }
.logo-big h1 { font-size: clamp(50px, 14vw, 80px); line-height: 0.95; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
.title-body .tagline { margin: 2px 0 14px; font-size: 20px; }
.doodles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.doodle { position: absolute; width: 90px; height: 90px; opacity: 0.55; animation: drift 9s ease-in-out infinite; }
.doodle.d0 { left: 4%; top: 14%; }
.doodle.d1 { right: 6%; top: 9%; animation-delay: -2s; width: 70px; }
.doodle.d2 { left: 8%; bottom: 12%; animation-delay: -4s; }
.doodle.d3 { right: 5%; bottom: 18%; animation-delay: -6s; width: 110px; }
.doodle.d4 { left: 44%; top: 4%; animation-delay: -3s; width: 70px; }
.doodle.d5 { right: 30%; bottom: 4%; animation-delay: -5s; width: 60px; }
@keyframes drift { 0%, 100% { transform: translate(0, 0) rotate(0); } 33% { transform: translate(12px, -14px) rotate(8deg); } 66% { transform: translate(-10px, 8px) rotate(-6deg); } }
@media (max-width: 600px) { .doodle { width: 60px; height: 60px; opacity: 0.4; } .doodle.d4, .doodle.d5 { display: none; } }

/* ---- mega buttons */
.mega-stack { display: flex; flex-direction: column; gap: 18px; }
.mega {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 116px;
  padding: 14px 18px 14px 14px;
  border-radius: 30px;
  color: #fff;
  text-align: left;
  --shade: #4b2bb8;
  background: linear-gradient(135deg, #9a63ff, #6a3df0);
  box-shadow: 0 7px 0 var(--shade), 0 18px 34px rgba(106, 61, 240, 0.3);
}
.mega-art { width: 92px; height: 92px; border-radius: 24px; background: rgba(255, 255, 255, 0.92); display: grid; place-items: center; box-shadow: inset 0 -4px 0 rgba(42, 36, 64, 0.08); }
.mega-art .art { width: 80px; height: 80px; }
.mega-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mega-text b { font-family: 'Luckiest Guy', var(--font); font-weight: 400; font-size: 30px; letter-spacing: 0.8px; line-height: 1.05; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.18); }
.mega-text small { font-size: 15px; opacity: 0.92; font-weight: 800; }
.mega-go { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, 0.24); display: grid; place-items: center; transition: transform 0.2s, background 0.2s; }
.mega-party { --shade: #c4245e; background: linear-gradient(135deg, #ff8a3d, #ff3b8d); box-shadow: 0 7px 0 var(--shade), 0 18px 34px rgba(255, 59, 141, 0.3); }
.mega-draw { --shade: #14874c; background: linear-gradient(135deg, #3bd889, #18a85f); box-shadow: 0 7px 0 var(--shade), 0 18px 34px rgba(34, 192, 112, 0.3); }
.mega-gallery { --shade: #1d55c4; background: linear-gradient(135deg, #4f9bff, #2f6cf0); box-shadow: 0 7px 0 var(--shade), 0 18px 34px rgba(47, 108, 240, 0.3); }
.mega-irl { --shade: #c2580a; background: linear-gradient(135deg, #ffb13b, #ff7a1f); box-shadow: 0 7px 0 var(--shade), 0 18px 34px rgba(255, 122, 31, 0.3); }
.mega-online { --shade: #0b7f86; background: linear-gradient(135deg, #2fd1c5, #1497b8); box-shadow: 0 7px 0 var(--shade), 0 18px 34px rgba(20, 151, 184, 0.3); }
@media (max-width: 480px) {
  .mega { min-height: 100px; gap: 12px; border-radius: 26px; }
  .mega-art { width: 76px; height: 76px; border-radius: 20px; }
  .mega-art .art { width: 66px; height: 66px; }
  .mega-text b { font-size: 25px; }
  .mega-text small { font-size: 13.5px; }
  .mega-go { width: 38px; height: 38px; }
}

.btn.saved { background: var(--green-d); }
.btn-red-soft { background: #ffe9ec; color: var(--red-d); box-shadow: 0 4px 0 #f6c9cf; }
.btn-danger-soft { color: var(--red-d); }
.choice-col { display: flex; flex-direction: column; gap: 10px; }
.avatar {
  --sz: 44px; width: var(--sz); height: var(--sz); flex: none; border-radius: 50%; background: var(--pc, var(--accent)); color: #fff;
  display: inline-grid; place-items: center; font-weight: 900; font-size: calc(var(--sz) * 0.45);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15), 0 3px 0 rgba(42, 36, 64, 0.15);
}
.avatar.sm { --sz: 30px; }
.avatar.lg { --sz: 64px; }
.avatar.xl { --sz: 112px; box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.15), 0 0 0 8px #fff, 0 14px 30px rgba(42, 36, 64, 0.2); }
.avatar.bob { animation: bob 2.6s ease-in-out infinite; }
.name-tag { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 22px; background: #fff; font-size: 17px; box-shadow: 0 3px 0 var(--press); color: var(--ink); }

/* ================================================================ online */
.mega-host { --shade: #0b7f86; background: linear-gradient(135deg, #2fd1c5, #1497b8); box-shadow: 0 7px 0 var(--shade), 0 18px 34px rgba(20, 151, 184, 0.3); }
.mega-join { --shade: #c4245e; background: linear-gradient(135deg, #ff8a3d, #ff3b8d); box-shadow: 0 7px 0 var(--shade), 0 18px 34px rgba(255, 59, 141, 0.3); }
.join-form { display: flex; flex-direction: column; gap: 10px; }
.join-lbl { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 6px; }
.join-form input { font: inherit; border: 3px solid #e2ddf2; border-radius: 22px; background: #fff; color: var(--ink); outline: none; padding: 14px 18px; font-size: 22px; font-weight: 900; }
.join-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(123, 92, 255, 0.2); }
.join-code { font-family: 'Luckiest Guy', var(--font) !important; font-weight: 400 !important; font-size: 52px !important; letter-spacing: 14px; text-align: center; text-transform: uppercase; }
.join-form .btn { margin-top: 10px; }

.lobby-body { width: min(1000px, 100%); justify-content: flex-start; }
.room-card { position: relative; text-align: center; background: #fff; border-radius: 30px; padding: 18px 20px 20px; box-shadow: var(--shadow); }
.room-big { font-family: 'Luckiest Guy', var(--font); font-size: clamp(64px, 14vw, 120px); letter-spacing: 0.18em; line-height: 1; color: var(--accent); text-shadow: 0 6px 0 #d9cffd; margin: 4px 0 8px; padding-left: 0.18em; }
.room-how { margin: 0; color: #4d466a; font-weight: 700; font-size: 17px; }
.room-how b { color: var(--ink); }
.net-badge { position: absolute; top: 14px; right: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 159, 28, 0.2); }
.net-badge[data-st='open'] { background: var(--green); box-shadow: 0 0 0 4px rgba(34, 192, 112, 0.2); }
.net-badge[data-st='reconnecting'] { background: var(--red); animation: pulse 1s infinite; }
.lobby-players { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.lp { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 20px; background: #fff; box-shadow: 0 4px 0 var(--press); font-size: 14px; animation: popin 0.4s cubic-bezier(0.3, 1.5, 0.5, 1); min-width: 0; }
.lp b { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp.empty { background: rgba(255, 255, 255, 0.5); box-shadow: none; color: var(--muted); animation: none; }
.lp.empty .avatar { background: #e4e0f0; box-shadow: none; }
.lp.off { opacity: 0.5; }
.lp-kick { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: #f1eff8; color: var(--muted); display: grid; place-items: center; opacity: 0; transition: opacity 0.15s; }
.lp-kick .ic { width: 14px; height: 14px; }
.lp:hover .lp-kick { opacity: 1; }
@media (max-width: 760px) { .lobby-players { grid-template-columns: repeat(4, 1fr); } }
.lobby-tip { margin-top: 4px; }
.close-room { align-self: center; }

.player-panel .menu-body { justify-content: flex-start; }
.pl-top { display: flex; justify-content: space-between; align-items: center; position: relative; min-height: 36px; }
.pl-top .net-badge { position: static; }
.pl-lobby, .pl-wait { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; margin: auto 0; padding: 20px 0; }
.pl-roster { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 20px; background: #fff; box-shadow: 0 3px 0 var(--press); font-size: 15px; }
.pl-chip.off { opacity: 0.45; }
.look-up { width: 110px; height: 110px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--accent); box-shadow: var(--shadow); animation: bob 2.4s ease-in-out infinite; }
.look-up .ic { width: 56px; height: 56px; }
.mirror-word { font-family: 'Luckiest Guy', var(--font); font-weight: 400; font-size: 1.6em; color: var(--accent); letter-spacing: 0.5px; }
.pl-big { font-size: 22px; }
.guess-live .gl-status { color: var(--muted); font-size: 15px; }
.gl-log { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.gl-log span { padding: 4px 10px; border-radius: 12px; background: #f1eff8; color: var(--muted); font-size: 14px; text-decoration: line-through; }
.host-panel .menu-body { width: min(900px, 100%); }
.waiting { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.host-bar { width: min(520px, 90%); background: rgba(123, 92, 255, 0.15); }
.host-bar span { background: var(--accent); }
.wait-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.wait-chip { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 14px; min-width: 104px; border-radius: 22px; background: #fff; box-shadow: 0 4px 0 var(--press); font-size: 15px; }
.wait-chip .avatar { animation: bob 1.6s ease-in-out infinite; }
.wait-chip i { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; transform: scale(0); transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); font-style: normal; }
.wait-chip i .ic { width: 18px; height: 18px; }
.wait-chip.done i { transform: scale(1); }
.wait-chip.done .avatar { animation: none; }
.live-host { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.live-host .tr-image { max-height: 58vh; min-height: 280px; }
.live-host .tr-image img { max-height: calc(58vh - 20px); }
.lh-log { margin: 0; min-height: 22px; color: var(--green-d); font-size: 18px; }

/* ---------------------------------------------------------------- sound popover */
.vol-pop {
  position: fixed;
  z-index: 120;
  width: min(320px, calc(100vw - 20px));
  padding: 14px 16px 6px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(40, 20, 90, 0.25), 0 2px 0 rgba(255, 255, 255, 0.8) inset;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: none;
}
.vol-pop.show { opacity: 1; transform: none; pointer-events: auto; }
.vol-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.vol-head b { font-size: 20px; font-weight: 900; }
.vol-mute { display: inline-flex; align-items: center; gap: 6px; }
.vol-mute .ic { width: 18px; height: 18px; }
.vp-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 2px solid #f4f2fa; font-size: 15px; }
.vp-row > span, .vol-row > span { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-width: 128px; }
.vp-row > span .ic, .vol-row > span .ic { width: 18px; height: 18px; color: var(--accent); }
.vp-row .set-slider { flex: 1; }


/* ---------------------------------------------------------------- top bar */
.topbar {
  position: fixed;
  top: calc(14px + var(--st));
  right: calc(14px + var(--sr));
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 10;
}
.done-btn { padding: 0 20px 0 16px; }
.chip {
  height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  font-size: 14px;
  color: var(--muted);
}

.game-chip {
  position: fixed;
  top: calc(14px + var(--st));
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100vw - 340px));
  padding: 8px 8px 8px 18px;
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 9;
}
.game-chip.pop { animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.gc-label { color: var(--muted); font-size: 14px; flex: 0 1 auto; }
.gc-prompt { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 3em; }
.gc-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.gc-time {
  flex: none;
  min-width: 64px;
  height: 40px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--chip, var(--orange));
  color: #fff;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.game-chip.urgent .gc-time { background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }

