/* ──────────────────────────────────────────────────────────
   Diwali Gali — retro UI overlays
   Newsprint + cracker-box print aesthetic, 90s bazaar signage
   ────────────────────────────────────────────────────────── */

:root {
  --ink: #1d1410;
  --paper: #f3e6c4;
  --paper-dark: #e2cf9f;
  --newsprint: #ece3cf;
  --marigold: #ff9f1c;
  --sindoor: #d7263d;
  --peacock: #0f7c86;
  --indigo: #1b1433;
  --violet: #4a2f6b;
  --gold: #ffd166;
  --glow: rgba(255, 190, 90, 0.55);
  --shadow: rgba(0, 0, 0, 0.45);

  --f-display: "Bungee", "Impact", sans-serif;
  --f-deva: "Yatra One", "Rozha One", serif;
  --f-serif: "Rozha One", Georgia, serif;
  --f-type: "Special Elite", "Courier New", monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--indigo);
  color: var(--paper);
  font-family: var(--f-type);
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
}

#flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 60%, rgba(255, 240, 200, 0.9), rgba(255, 150, 60, 0.3) 50%, transparent 80%);
  opacity: 0;
  mix-blend-mode: screen;
  z-index: 5;
}

button { font: inherit; color: inherit; cursor: pointer; }

/* ───── generic screens ───── */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  pointer-events: none;
}
.screen.active { display: block; }
.screen.active > * { pointer-events: auto; }

.btn {
  font-family: var(--f-display);
  font-size: 15px;
  letter-spacing: 0.04em;
  padding: 12px 18px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: var(--marigold);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { filter: grayscale(0.8); opacity: 0.6; }
.btn-big { font-size: 18px; padding: 16px 24px; }
.btn-alt { display: block; margin: 12px auto 0; font-size: 13px; padding: 9px 14px; background: var(--newsprint); }

/* ───── TITLE POSTER ───── */
#title-screen {
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 120%, rgba(255, 120, 40, 0.35), transparent 60%);
}
#title-screen.active { display: flex; }

.poster {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  padding: 28px 24px 22px;
  text-align: center;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.035) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 30% 20%, #fff6d8, var(--paper) 60%, var(--paper-dark));
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 6px var(--sindoor), 0 0 0 10px var(--ink), 0 30px 60px var(--shadow);
  transform: rotate(-1.2deg);
  overflow: hidden;
}
.poster-sun {
  position: absolute;
  inset: -40% -40% auto;
  height: 160%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 159, 28, 0.22) 0 8deg, transparent 8deg 16deg);
  pointer-events: none;
}
.poster > *:not(.poster-sun) { position: relative; }
.poster-kicker { font-family: var(--f-type); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; margin: 0 0 6px; }
.poster h1 {
  font-family: var(--f-display);
  font-size: clamp(48px, 15vw, 72px);
  line-height: 0.9;
  margin: 6px 0 10px;
  color: var(--sindoor);
  text-shadow: 3px 3px 0 var(--gold), 6px 6px 0 var(--ink);
}
.poster h1 span { color: var(--peacock); }
.poster-tag { font-family: var(--f-serif); font-size: 16px; margin: 0 0 20px; }
.poster-lead { font-family: var(--f-serif); font-size: 17px; font-weight: 700; margin: 0 0 12px; }
.poster-why { list-style: none; padding: 0; margin: 0 0 20px; text-align: left; font-family: var(--f-serif); font-size: 14.5px; line-height: 1.4; }
.poster-why li { margin: 0 0 8px; padding-left: 22px; position: relative; }
.poster-why li::before { content: "🪔"; position: absolute; left: 0; top: 0; font-size: 13px; }
.poster-why b { display: block; }
.poster-fine { font-size: 11px; margin: 16px 0 0; opacity: 0.7; }

/* ───── SHOP ───── */
#shop-screen {
  display: none;
  flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) 16px 16px;
  gap: 12px;
}
#shop-screen.active { display: flex; }

.shop-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
}
.shop-sign {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 14px;
  background: var(--sindoor);
  color: var(--gold);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink), inset 0 0 0 3px var(--gold);
  transform: rotate(-0.6deg);
}
.sign-hi { font-family: var(--f-deva); font-size: 24px; line-height: 1.1; }
.sign-en { font-family: var(--f-display); font-size: 11px; letter-spacing: 0.08em; color: #fff3d0; }

.wallet {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 8px 14px;
  background: var(--newsprint);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  min-width: 130px;
}
.wallet-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; }
.wallet-amt { font-family: var(--f-display); font-size: 22px; color: #166534; }
.wallet.bump { animation: bump 0.35s; }
.wallet.broke .wallet-amt { color: var(--sindoor); }
@keyframes bump { 30% { transform: scale(1.08) rotate(1deg); } }

.shop-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 14px;
}

.shop-grid {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding: 4px 6px 12px 2px;
  align-content: start;
  grid-auto-rows: max-content;
  scrollbar-width: thin;
}

/* the cracker box card */
.box {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 3px solid var(--ink);
  background: var(--newsprint);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  text-align: left;
  padding: 0;
  overflow: hidden;
  transition: transform 0.1s;
}
.box:hover { transform: translateY(-2px) rotate(-0.5deg); }
.box:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.box.cant { filter: grayscale(0.9) contrast(0.8); }
.box.cant::after {
  content: "Paise kam!";
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--f-display);
  font-size: 16px;
  color: var(--sindoor);
  border: 3px solid var(--sindoor);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.8);
}

.box-art {
  position: relative;
  height: 112px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-bottom: 3px solid var(--ink);
  overflow: hidden;
  background: var(--art-bg, var(--sindoor));
}
.box-art::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: repeating-conic-gradient(from 0deg, var(--art-ray, rgba(255,209,102,0.45)) 0 10deg, transparent 10deg 20deg);
}
.box-art::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  pointer-events: none;
}
.box-icon {
  position: relative;
  font-size: 46px;
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.5));
}
.box-brand {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--f-display);
  font-size: 10px;
  color: #fff;
  text-shadow: 1px 1px 0 var(--ink);
  letter-spacing: 0.1em;
}
.box-stamp {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-family: var(--f-deva);
  font-size: 13px;
  background: var(--gold);
  border: 2px solid var(--ink);
  padding: 0 6px;
  transform: rotate(6deg);
}
.box-info { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.box-name { font-family: var(--f-serif); font-size: 17px; line-height: 1.05; }
.box-desc { font-size: 11px; opacity: 0.75; flex: 1; }
.box-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.box-price { font-family: var(--f-display); font-size: 17px; color: var(--sindoor); }
.box-pack { font-size: 11px; }

/* polythene bag */
.polybag {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 14px 14px;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(255,255,255,0.35) 0 12%, transparent 30% 60%, rgba(255,255,255,0.25) 75%, transparent),
    rgba(240, 236, 255, 0.82);
  border: 2px solid rgba(29, 20, 16, 0.6);
  border-radius: 6px 6px 18px 18px;
  box-shadow: 0 12px 30px var(--shadow);
  backdrop-filter: blur(4px);
  min-height: 0;
}
.polybag-handle {
  position: absolute;
  top: -16px;
  left: 50%;
  width: 90px;
  height: 34px;
  transform: translateX(-50%);
  border: 6px solid rgba(240, 236, 255, 0.82);
  border-bottom: none;
  border-radius: 40px 40px 0 0;
}
.polybag h3 { margin: 0 0 8px; font-family: var(--f-serif); font-size: 19px; }
.bag-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 40px; }
.bag-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(29, 20, 16, 0.3);
  font-size: 13px;
}
.bag-list .bag-icon { font-size: 20px; }
.bag-list .bag-name { flex: 1; line-height: 1.1; }
.bag-list .bag-qty { font-family: var(--f-display); font-size: 13px; }
.bag-list .bag-remove {
  border: 2px solid var(--ink);
  background: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  line-height: 1;
  padding: 0;
  font-weight: bold;
}
.bag-empty { font-size: 13px; opacity: 0.7; margin: 4px 0 8px; }
.bag-total { margin: 8px 0 10px; font-size: 14px; }
.polybag .btn { width: 100%; }

/* ───── PLAY HUD ───── */
#play-screen > * { pointer-events: auto; }

.hud-top {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-left, .hud-right { display: flex; gap: 6px; align-items: center; }

.chip {
  font-family: var(--f-display);
  font-size: 12px;
  padding: 7px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--newsprint);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap;
}
.score-chip { background: var(--gold); }
.wallet-chip { color: #166534; }

/* floating environment toggle */
.env-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--newsprint);
  box-shadow: 3px 3px 0 var(--ink);
}
.env-opt {
  position: relative;
  z-index: 1;
  border: 0;
  background: none;
  font-family: var(--f-display);
  font-size: 13px;
  padding: 6px 16px;
  color: var(--ink);
  transition: color 0.2s;
}
.env-opt.active { color: var(--gold); }
.env-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--sindoor);
  transition: transform 0.3s cubic-bezier(0.5, 1.6, 0.4, 1);
}
.env-switch[data-env="terrace"] .env-pill { transform: translateX(100%); }

.missions {
  position: absolute;
  top: 64px;
  right: 16px;
  width: min(300px, calc(100vw - 32px));
  padding: 12px 14px;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 21px, rgba(15, 124, 134, 0.25) 21px 22px),
    #fbf5e2;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(0.8deg);
}
.missions[hidden] { display: none; }
.missions h3 { margin: 0 0 6px; font-family: var(--f-serif); font-size: 18px; }
.missions ul { list-style: none; margin: 0; padding: 0; }
.missions li { padding: 5px 0 5px 26px; position: relative; font-size: 13px; line-height: 1.25; }
.missions li::before {
  content: "☐";
  position: absolute;
  left: 2px;
  top: 3px;
  font-size: 16px;
}
.missions li.done { text-decoration: line-through; opacity: 0.6; }
.missions li.done::before { content: "☑"; color: var(--sindoor); }
.missions li b { color: var(--sindoor); font-family: var(--f-display); font-size: 11px; }

.hint {
  position: absolute;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 6px 12px;
  font-size: 13px;
  text-align: center;
  background: rgba(20, 12, 36, 0.7);
  border: 1px solid rgba(255, 209, 102, 0.4);
  border-radius: 6px;
  pointer-events: none !important;
  transition: opacity 0.4s;
}
.hint.hide { opacity: 0; }

.toast-stack {
  position: fixed;
  z-index: 40;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  font-family: var(--f-display);
  font-size: 14px;
  padding: 8px 14px;
  color: var(--ink);
  background: var(--gold);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  animation: toast-in 0.4s cubic-bezier(0.5, 1.8, 0.4, 1), toast-out 0.4s 2.6s forwards;
  text-align: center;
}
.toast small { display: block; font-family: var(--f-type); font-size: 11px; }
.toast.mission { background: var(--sindoor); color: #fff; }
@keyframes toast-in { from { transform: scale(0.4) rotate(-6deg); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-20px); opacity: 0; } }

/* inventory strip (the bag, opened) */
.inventory {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  overflow-x: auto;
  background: linear-gradient(transparent, rgba(12, 6, 24, 0.85) 30%);
  scrollbar-width: none;
}
.inventory::-webkit-scrollbar { display: none; }
.inv-item {
  flex: 0 0 auto;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  color: var(--ink);
  background: var(--newsprint);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.15s;
}
.inv-item .inv-icon { font-size: 28px; line-height: 1; }
.inv-item .inv-name { font-size: 10px; text-align: center; line-height: 1.05; height: 2.1em; overflow: hidden; }
.inv-item .inv-qty {
  font-family: var(--f-display);
  font-size: 11px;
  background: var(--ink);
  color: var(--gold);
  border-radius: 999px;
  padding: 0 7px;
}
.inv-item.selected {
  background: var(--gold);
  transform: translateY(-8px);
  box-shadow: 3px 3px 0 var(--ink), 0 0 20px var(--glow);
}
.inv-item.empty { opacity: 0.4; }
.inv-none { font-size: 13px; padding: 14px 4px; opacity: 0.85; }

/* ───── toli picker ───── */
#gang-screen { display: none; align-items: center; justify-content: center; }
#gang-screen.active { display: flex; }
.gang-card {
  width: min(440px, calc(100vw - 32px));
  padding: 22px 20px;
  color: var(--ink);
  text-align: center;
  background:
    repeating-linear-gradient(0deg, transparent 0 21px, rgba(15, 124, 134, 0.2) 21px 22px),
    #fbf5e2;
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink), 0 30px 60px var(--shadow);
  transform: rotate(0.6deg);
}
.gang-card h2 { margin: 0 0 6px; font-family: var(--f-deva); font-size: 30px; color: var(--sindoor); }
.gang-step { margin: 12px 0 6px; font-family: var(--f-serif); font-size: 17px; }
.pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--newsprint);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s;
}
.pick .pick-icon { font-size: 34px; }
.pick .pick-label { font-family: var(--f-display); font-size: 13px; }
.pick.active { background: var(--gold); transform: translateY(-3px) rotate(-1deg); }
.gang-preview { margin: 14px 0 16px; font-size: 13px; min-height: 2.6em; }

/* ───── shop tabs ───── */
.shop-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.shop-tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 5px 14px 4px;
  color: var(--ink);
  background: var(--newsprint);
  border: 3px solid var(--ink);
  border-radius: 8px 8px 2px 2px;
  box-shadow: 2px 2px 0 var(--ink);
}
.tab-hi { font-family: var(--f-deva); font-size: 17px; line-height: 1.1; }
.tab-en { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.tab.active { background: var(--sindoor); color: var(--gold); transform: translateY(-2px); }
.box-hi { font-family: var(--f-deva); font-size: 19px; line-height: 1.05; color: var(--sindoor); }
.bag-name small { display: block; font-size: 10px; opacity: 0.7; }
.bag-warn { font-size: 12px; color: var(--sindoor); margin: 2px 0 6px; font-weight: bold; }

/* ───── play extras ───── */
.fire-chip { background: #fff3d6; }
.fire-chip.empty { background: #ffccd5; color: var(--sindoor); }
.status {
  position: absolute;
  left: 50%;
  bottom: 182px;
  transform: translate(-50%, 8px);
  max-width: calc(100vw - 32px);
  padding: 6px 14px;
  font-family: var(--f-serif);
  font-size: 15px;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  opacity: 0;
  pointer-events: none !important;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
}
.status.show { opacity: 1; transform: translate(-50%, 0); }
.inv-wrap { position: absolute; left: 0; right: 0; bottom: 0; }
.inv-wrap .inventory { position: static; }
.queue {
  position: absolute;
  right: 16px;
  top: -26px;
  font-family: var(--f-display);
  font-size: 12px;
  color: var(--gold);
  text-shadow: 1px 1px 0 var(--ink);
}
.inv-item .inv-name { font-family: var(--f-deva); font-size: 12px; }
.missions { max-height: 60vh; overflow-y: auto; }
.missions .m-title { color: var(--ink); font-family: var(--f-serif); font-size: 13px; }

/* ───── mohalla: muqabla, mummy, mithai ───── */
.muqabla {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-family: var(--f-display);
  font-size: 10px;
  color: var(--ink);
  background: var(--newsprint);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  pointer-events: none !important;
}
.mq-side b { color: var(--sindoor); }
.mq-track {
  position: relative;
  width: 120px;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(90deg, #2a9d8f 0 50%, #e76f51 50% 100%);
  overflow: hidden;
}
.mq-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.mq-fill {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 12px;
  height: 14px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--ink);
  transition: left 0.4s cubic-bezier(0.4, 1.6, 0.5, 1);
}
.muqabla.winning .mq-you, .muqabla.losing .mq-them { color: var(--sindoor); }

.mummy-card {
  position: absolute;
  left: 50%;
  top: 104px;
  transform: translateX(-50%) rotate(-1deg);
  width: min(380px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff3d6;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  animation: toast-in 0.4s cubic-bezier(0.5, 1.8, 0.4, 1);
}
.mummy-card[hidden] { display: none; }
.mummy-card.loud { background: #ffd6d6; animation: shake 0.5s 2; }
@keyframes shake { 25% { transform: translateX(-52%) rotate(-3deg); } 75% { transform: translateX(-48%) rotate(2deg); } }
.mummy-face { font-size: 36px; grid-row: span 2; align-self: center; }
.mummy-label { display: block; font-family: var(--f-display); font-size: 11px; color: var(--sindoor); }
.mummy-text { display: block; font-family: var(--f-serif); font-size: 16px; line-height: 1.15; }
.mummy-timer { margin-top: 6px; height: 6px; background: rgba(0,0,0,0.12); border-radius: 3px; overflow: hidden; }
.mummy-timer span { display: block; height: 100%; width: 100%; background: var(--sindoor); }
.mummy-btn { grid-column: span 2; padding: 9px 12px; font-size: 13px; }

.mithai-modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(20, 10, 30, 0.35);
}
.mithai-modal[hidden] { display: none; }
.mithai-card {
  width: min(420px, calc(100vw - 32px));
  padding: 16px;
  text-align: center;
  color: var(--ink);
  background: radial-gradient(circle at 50% 45%, #f4f6f8 0 52%, #c9d1d9 53% 56%, #fbf5e2 57%);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 6px 6px 0 var(--ink);
}
.mithai-card h3 { margin: 0; font-family: var(--f-deva); font-size: 24px; color: var(--sindoor); }
.mithai-card p { margin: 2px 0 12px; font-size: 12px; }
.mithai-thali { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sweet {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px;
  background: #fffaf0;
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 2px 2px 0 var(--ink);
}
.sweet:active { transform: translate(2px, 2px); box-shadow: none; }
.sweet-hi { font-family: var(--f-deva); font-size: 15px; }
.sweet-en { font-size: 10px; opacity: 0.7; }
.sweet-art { width: 40px; height: 34px; display: block; position: relative; }
.sweet-kaju { background: linear-gradient(135deg, #e8d5b0, #d9c095); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); box-shadow: inset 0 0 0 3px #dfe3e8; }
.sweet-laddoo { width: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd166, #f4a300 55%, #c77700); }
.sweet-jalebi { width: 36px; border-radius: 50%; border: 6px solid #f77f00; box-shadow: inset 0 0 0 5px #ffb347, inset 0 0 0 9px #f77f00; }
.sweet-jamun { width: 32px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a0522d, #5a2a12 60%, #3a1a0a); }
.sweet-barfi { border-radius: 4px; background: #f4f1de; box-shadow: inset 0 -6px 0 #e9e4c8; }
.sweet-barfi::after { content: ""; position: absolute; left: 14px; top: 8px; width: 10px; height: 8px; border-radius: 50%; background: #6a994e; }
.sweet-soan { border-radius: 4px; background: repeating-linear-gradient(90deg, #e9c46a 0 3px, #f4d58d 3px 6px); }

/* ───── quick chat ───── */
.quickchat {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qc {
  min-width: 44px;
  padding: 6px 9px;
  font-family: var(--f-deva);
  font-size: 13px;
  line-height: 1.1;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.92);
  border: 2px solid var(--ink);
  border-radius: 14px 14px 4px 14px;
  box-shadow: 2px 2px 0 var(--ink);
}
.qc:active { transform: translate(2px, 2px); box-shadow: none; }
.qc .qc-e { font-size: 16px; margin-right: 3px; }

/* ───── multiplayer lobby ───── */
#mp-screen { display: none; align-items: center; justify-content: center; }
#mp-screen.active { display: flex; }
.btn-mp { background: #caffbf; }
.mp-input {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--f-display);
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 8px;
  margin-bottom: 10px;
}
.mp-code { text-transform: uppercase; letter-spacing: 0.3em; text-align: center; margin: 0; }
.mp-gender { margin-bottom: 12px; }
.mp-actions { display: grid; gap: 10px; }
.mp-join { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.mp-codebig { font-family: var(--f-display); font-size: 18px; margin: 6px 0; }
.mp-codebig b { color: var(--sindoor); letter-spacing: 0.2em; }
.mp-list { list-style: none; padding: 0; margin: 8px 0 14px; text-align: left; }
.mp-list li { padding: 6px 10px; margin: 4px 0; background: #fff3d6; border: 2px solid var(--ink); border-radius: 8px; font-family: var(--f-serif); }
.mp-status { font-size: 12px; min-height: 1.4em; margin: 10px 0 6px; }
.mp-status.err { color: var(--sindoor); font-weight: bold; }
.mp-wait { font-size: 13px; }

#btn-mic.on { background: #caffbf; }
#btn-mic.talking { box-shadow: 0 0 0 3px #38b000, 2px 2px 0 var(--ink); }
#btn-mic.denied { background: #ffccd5; }

/* ───── loading ───── */
.loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: var(--paper);
  background: radial-gradient(ellipse at 50% 110%, #7a2e1a 0%, #3b1f3d 40%, #1b1433 75%);
  transition: opacity 0.6s;
}
.loading.done { opacity: 0; pointer-events: none; }
.loading-title { margin: 0; font-family: var(--f-display); font-size: 34px; color: var(--gold); text-shadow: 3px 3px 0 var(--sindoor); }
.loading-step { margin: 0; font-family: var(--f-serif); font-size: 16px; }
.loading-tip { margin: 8px 0 0; max-width: 320px; font-size: 13px; opacity: 0.85; min-height: 3em; }
.loading-bar { width: 220px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.15); overflow: hidden; }
.loading-bar span { display: block; height: 100%; width: 8%; background: linear-gradient(90deg, var(--marigold), var(--gold)); transition: width 0.4s; }
.loading-diya { position: relative; width: 70px; height: 70px; }
.loading-diya .bowl { position: absolute; left: 5px; right: 5px; bottom: 6px; height: 26px; border-radius: 0 0 40px 40px; background: #b5541f; box-shadow: inset 0 -6px 0 #8a3b12; }
.loading-diya .flame { position: absolute; left: 50%; bottom: 28px; width: 16px; height: 30px; margin-left: -8px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff6c4, #ffb347 60%, rgba(255,120,30,0)); filter: drop-shadow(0 0 12px #ff9a3c); animation: flicker 0.22s infinite alternate; }
@keyframes flicker { to { transform: scale(1.06, 0.92) rotate(2deg); } }
.poster-warn { font-size: 11px; margin: 8px 0 0; color: var(--sindoor); }

/* ───── coach marks, ek aur ───── */
.coach {
  position: absolute;
  left: 50%;
  bottom: 128px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  font-family: var(--f-serif);
  font-size: 17px;
  color: var(--ink);
  background: var(--gold);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
  pointer-events: none !important;
  animation: bob 1s ease-in-out infinite alternate;
}
.coach[hidden] { display: none; }
@keyframes bob { to { transform: translate(-50%, -6px); } }
.pulse { animation: pulse 0.5s 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--gold), 0 0 30px var(--gold); } }
.btn-again {
  position: absolute;
  left: 140px;
  bottom: 140px;
  padding: 8px 12px;
  font-size: 13px;
}
.btn-again[hidden] { display: none; }
.popup {
  position: fixed;
  z-index: 30;
  font-family: var(--f-display);
  font-size: 18px;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink);
  pointer-events: none;
  animation: popup 1.2s ease-out forwards;
}
@keyframes popup { from { transform: translate(-50%, 0) scale(0.6); opacity: 0; } 15% { transform: translate(-50%, -10px) scale(1.15); opacity: 1; } to { transform: translate(-50%, -70px) scale(1); opacity: 0; } }

/* ───── modals ───── */
.modal { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15, 8, 25, 0.55); z-index: 35; }
.modal[hidden] { display: none; }
.modal-card {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 18px;
  color: var(--ink);
  background: #fbf5e2;
  border: 4px solid var(--ink);
  border-radius: 14px;
  box-shadow: 6px 6px 0 var(--ink);
}
.modal-card h3 { margin: 0 0 10px; font-family: var(--f-serif); font-size: 22px; color: var(--sindoor); }
.modal-card .row { display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }
.modal-card .row.check { grid-template-columns: auto 1fr; }
.modal-card select, .modal-card input[type=range] { width: 100%; accent-color: var(--sindoor); }
.modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.chip.danger { background: #ffccd5; color: var(--sindoor); }
.credits { margin-top: 10px; font-size: 12px; }
.summary-card { background: radial-gradient(circle at 50% 0%, #fff3d6, #fbf5e2 60%); }
.summary-sub { margin: 0 0 10px; font-size: 13px; }
.summary-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.summary-stats li { padding: 8px; background: #fff; border: 2px solid var(--ink); border-radius: 10px; font-size: 12px; }
.summary-stats b { display: block; font-family: var(--f-display); font-size: 20px; color: var(--sindoor); }

/* ───── joystick ───── */
.joystick {
  position: absolute;
  left: 18px;
  bottom: 140px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,250,240,0.18), rgba(255,250,240,0.06));
  border: 2px solid rgba(255,250,240,0.5);
  touch-action: none;
}
.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) { .joystick { opacity: 0.55; } }

/* ───── profile / character select ───── */
#profile-screen { display: none; justify-content: flex-start; align-items: stretch; }
#profile-screen.active { display: flex; }
.profile-card {
  width: min(400px, 100vw);
  height: 100%;
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) 16px 20px;
  color: var(--ink);
  background: linear-gradient(90deg, rgba(251,245,226,0.97) 70%, rgba(251,245,226,0.85));
  border-right: 4px solid var(--ink);
}
.profile-card h2 { margin: 0 0 10px; font-family: var(--f-deva); font-size: 28px; color: var(--sindoor); }
.pf-gender { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.pf-gender .pick { flex-direction: row; justify-content: center; padding: 8px; }
.pf-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pf-char .pf-face { width: 100%; aspect-ratio: 1; display: block; border-radius: 7px; background: radial-gradient(circle at 50% 40%, #ffe6b0, #e9a35a 70%, #b8612a); margin-bottom: 3px; }
.pf-char {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 4px 6px;
  text-align: left;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink);
}
.pf-char .sw { display: flex; gap: 3px; margin-bottom: 2px; }
.pf-char .sw i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.pf-char b { font-family: var(--f-serif); font-size: 12px; line-height: 1.1; text-align: center; }
.pf-char small { font-size: 10px; opacity: 0.7; line-height: 1.2; }
.pf-char.active { background: var(--gold); transform: translateY(-2px); }
.pf-tag { font-size: 13px; min-height: 1.3em; margin: 8px 0; }
.pf-actions { display: grid; gap: 10px; margin-top: 6px; }
.pf-actions .btn-alt { margin: 0; }
@media (max-width: 760px) {
  #profile-screen { align-items: flex-end; }
  .profile-card { width: 100vw; height: 62vh; border-right: 0; border-top: 4px solid var(--ink); border-radius: 18px 18px 0 0; background: rgba(251,245,226,0.97); }
  .pf-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ───── responsive ───── */
@media (max-width: 760px) {
  .shop-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .box-art { height: 84px; }
  .box-icon { font-size: 36px; }
  .box-desc { display: none; }
  .polybag { max-height: 30vh; padding: 16px 12px 10px; }
  .bag-list li { padding: 3px 0; }
  .bag-total { margin: 4px 0 6px; }
  .polybag .btn { padding: 9px 12px; font-size: 13px; }
  .polybag h3 { font-size: 16px; margin-bottom: 4px; }
  .sign-hi { font-size: 19px; }
  .wallet { min-width: 0; }
  .wallet-amt { font-size: 18px; }

  .hud-top { flex-wrap: wrap; justify-content: center; }
  .hud-left, .hud-right { flex: 1 1 auto; }
  .hud-right { justify-content: flex-end; }
  .env-switch { order: 3; }
  .missions { top: 132px; }
  .muqabla { top: 96px; }
  .mummy-card { top: 130px; }
  .toast-stack { top: 110px; }
  .chip { font-size: 11px; padding: 6px 8px; }
  .qc { font-size: 11px; padding: 5px 7px; }
  .btn-again { bottom: 132px; }
  .coach { bottom: 136px; font-size: 15px; }
  .quickchat { top: 46%; }
}

/* ───── mobile-first play controls (adult edition) ───── */
.muqabla[hidden] { display: none; }
.move-zone {
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 0;
  width: 44%;
  touch-action: none;
  z-index: 0;
}
#play-screen > .joystick { z-index: 1; pointer-events: none; transition: opacity 0.2s; }
.joystick.floating { transition: none; opacity: 1 !important; }
body:not([data-phase="play"]) .joystick { display: none; }
.btn-act {
  position: absolute;
  right: 18px;
  bottom: 150px;
  padding: 14px 20px;
  font-size: 17px;
  border-radius: 999px;
  animation: actPulse 1.2s ease-in-out infinite;
  z-index: 3;
}
.btn-act, .btn-act[hidden] { display: none !important; } /* tap the diya itself instead */
.chip .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.chip .ico circle, .chip .ico rect { fill: none; }
.diya-chip { display: inline-flex; align-items: center; gap: 5px; }
.diya-chip b { font-weight: 800; }
.diya-chip[hidden], .mic-chip[hidden] { display: none; }
.mic-chip { display: inline-flex; align-items: center; justify-content: center; }
.mic-chip .ico { width: 20px; height: 20px; }
.mic-chip .slash { stroke: #c1121f; stroke-width: 2.6; }
.mic-chip.denied .ico { opacity: 0.5; }
@keyframes actPulse { 50% { transform: scale(1.07); box-shadow: 0 0 0 6px rgba(255, 209, 102, 0.35), 3px 3px 0 var(--ink); } }
.diya-chip.done { background: var(--gold); }
#btn-toli.pulse, #btn-aarti.on { animation: actPulse 1s ease-in-out infinite; background: var(--gold); }
#btn-fullscreen.on { opacity: 0.6; }
@media (hover: hover) and (pointer: fine) { #btn-fullscreen { display: none; } }
body.invited .mp-join { order: -1; }
/* keep the social buttons clear of the thumb-stick */
#social-root .sc-fabs { bottom: calc(env(safe-area-inset-bottom, 0px) + 268px); }
#social-root .sc-chatlog { bottom: calc(env(safe-area-inset-bottom, 0px) + 272px); }
#social-root .sc-chatbar { bottom: calc(env(safe-area-inset-bottom, 0px) + 268px); }
#social-root .sc-chatting .sc-chatlog { bottom: calc(env(safe-area-inset-bottom, 0px) + 324px); }

/* ───── phone in landscape (the PUBG / Free Fire grip) ───── */
@media (orientation: landscape) and (max-height: 500px) {
  .inv-wrap { left: 36%; right: 6px; }
  .inventory { padding: 6px 8px max(6px, env(safe-area-inset-bottom)); gap: 6px; background: linear-gradient(transparent, rgba(12, 6, 24, 0.7) 40%); }
  .inv-item { width: 58px; padding: 3px 2px; border-width: 2px; box-shadow: 2px 2px 0 var(--ink); }
  .inv-item .inv-icon { font-size: 20px; }
  .inv-item .inv-name { font-size: 9px; height: 1.15em; }
  .quickchat { top: 58px; transform: none; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; max-width: 46%; gap: 4px; }
  .qc { padding: 4px 7px; font-size: 11px; }
  .btn-act { bottom: 92px; right: 14px; padding: 10px 16px; font-size: 15px; }
  .btn-again { left: 36%; bottom: 92px; }
  .joystick { left: calc(env(safe-area-inset-left, 0px) + 34px); bottom: 34px; }
  .move-zone { top: 16%; width: 36%; }
  .coach { top: 58px; bottom: auto; }
  #social-root .sc-fabs { bottom: auto; top: 58px; left: calc(env(safe-area-inset-left, 0px) + 10px); flex-direction: row; }
  #social-root .sc-fab { width: 42px; height: 42px; font-size: 20px; }
  #social-root .sc-chatlog { bottom: auto; top: 108px; }
  #social-root .sc-chatbar { bottom: auto; top: 104px; }
  .hud-top { padding-top: 6px; }
  .chip { padding: 5px 8px; font-size: 12px; }
}
.chip[hidden], .hud-top [hidden] { display: none !important; }

/* ═════ Mobile-first HUD cleanup (v3) ═════ */
.quickchat, #social-root .sc-fab-chat, #social-root .sc-chatbar { display: none !important; }
.aarti-chip { background: var(--gold); font-size: 13px; padding: 7px 14px; }
.aarti-chip.on { animation: actPulse 1s ease-in-out infinite; }
.mic-chip.on { background: #06d6a0; }
.mic-chip.talking { box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.55), 2px 2px 0 var(--ink); }
.mic-chip.denied { background: #ff6b6b; }
.invite-chip { background: #ff9f1c; color: #fff; }
/* desktop: the "more" items sit inline like before */
.hud-more { display: flex; gap: 6px; align-items: center; }
#btn-more { display: none; }
/* the join / hello / poke feed lives on the left, under the player count */
#social-root .sc-chatlog { left: calc(env(safe-area-inset-left, 0px) + 10px); right: auto; top: calc(env(safe-area-inset-top, 0px) + 104px); bottom: auto; width: min(280px, 72vw); }
#social-root .sc-players.collapsed { width: auto; }
#social-root .sc-players.collapsed .sc-rtt { display: none; }

@media (max-width: 760px) {
  .hud-top { left: 10px; right: 10px; flex-wrap: nowrap; justify-content: space-between; top: max(8px, env(safe-area-inset-top)); }
  .hud-left, .hud-right { flex: 0 0 auto; gap: 5px; }
  .chip { font-size: 12px; padding: 7px 9px; }
  #btn-more { display: inline-flex; font-size: 16px; padding: 4px 11px; }
  .hud-more {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px;
    background: rgba(12, 6, 24, 0.85); border: 1px solid rgba(255, 209, 102, 0.3);
  }
  .hud-more.open { display: flex; }
  .hud-more .chip { font-size: 16px; padding: 8px 12px; }
  .hud-right { position: relative; }
  /* players pill just under the bar, feed under that */
  #social-root { --sc-top: calc(env(safe-area-inset-top, 0px) + 54px); }
  #social-root .sc-chatlog { top: calc(env(safe-area-inset-top, 0px) + 98px); }
  #social-root .sc-line { font-size: 12px; padding: 4px 9px; }
  /* emotes button moves to the right thumb, above the action button */
  #social-root .sc-fabs { left: auto; right: calc(env(safe-area-inset-right, 0px) + 14px); top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 222px); }
  .btn-act { right: 14px; bottom: 140px; }
  .coach { bottom: 132px; font-size: 14px; max-width: calc(100vw - 24px); }
  .hint { display: none; }
}
@media (max-width: 760px) {
  #social-root .sc-players { top: calc(env(safe-area-inset-top, 0px) + 52px); }
  #social-root .sc-chatlog { top: calc(env(safe-area-inset-top, 0px) + 96px); }
  .coach { bottom: 250px; }
}

/* ═════ Messages live in the upper middle, never over the joystick / bar (v4) ═════ */
#play-screen .hint {
  display: block !important;
  top: calc(env(safe-area-inset-top, 0px) + 22vh); bottom: auto;
  font-family: var(--f-serif); font-size: 16px; font-weight: 700; color: #fff;
  padding: 8px 16px; border-radius: 14px; max-width: min(92vw, 460px);
  background: rgba(20, 12, 36, 0.78); text-shadow: 0 1px 2px #000;
  z-index: 6;
}
#play-screen .hint small { display: block; font-weight: 400; font-size: 13px; opacity: 0.85; margin-top: 2px; }
#play-screen .status { top: calc(env(safe-area-inset-top, 0px) + 34vh); bottom: auto; z-index: 6; text-align: center; }
#play-screen .coach { top: calc(env(safe-area-inset-top, 0px) + 42vh) !important; bottom: auto !important; z-index: 6; }
.toast-stack { top: calc(env(safe-area-inset-top, 0px) + 22vh) !important; max-width: min(92vw, 460px); }
@media (orientation: landscape) and (max-height: 500px) {
  #play-screen .hint { top: calc(env(safe-area-inset-top, 0px) + 60px); font-size: 14px; }
  #play-screen .status { top: calc(env(safe-area-inset-top, 0px) + 40vh); }
  #play-screen .coach { top: calc(env(safe-area-inset-top, 0px) + 50vh) !important; font-size: 13px; padding: 6px 12px; max-width: 52vw; }
  .toast-stack { top: calc(env(safe-area-inset-top, 0px) + 60px) !important; }
}

/* left = walk, right = look: shown when you arrive in the gali on a phone */
.controls-guide { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; pointer-events: none; z-index: 5; transition: opacity 0.6s; }
.controls-guide[hidden] { display: none; }
.controls-guide.fade { opacity: 0; }
.cg-half { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; color: #fff; text-shadow: 0 1px 3px #000; padding: 0 10px; }
.cg-left { background: linear-gradient(90deg, rgba(255, 209, 102, 0.28), rgba(255, 209, 102, 0.05)); border-right: 2px dashed rgba(255, 255, 255, 0.55); }
.cg-right { background: linear-gradient(270deg, rgba(76, 201, 240, 0.25), rgba(76, 201, 240, 0.04)); }
.cg-icon { font-size: 40px; }
.cg-half b { font-family: var(--f-display); font-size: 18px; }
.cg-half small { font-family: var(--f-serif); font-size: 13px; max-width: 180px; }

/* please rotate (iPhone can't be turned by the page) */
.rotate-tip { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; color: #fff; background: rgba(12, 6, 24, 0.9); }
.rotate-tip[hidden] { display: none; }
.rotate-tip b { font-family: var(--f-display); font-size: 22px; }
.rotate-tip p { font-family: var(--f-serif); font-size: 14px; max-width: 280px; margin: 0 0 8px; opacity: 0.85; }
.rotate-phone { font-size: 64px; animation: turn 1.8s ease-in-out infinite; }
@keyframes turn { 0%, 20% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

/* ═════ Profile: 1 name → 2 look → 3 play, with the play buttons always on screen ═════ */
.profile-card { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.pf-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 6px; }
.pf-actions {
  flex: 0 0 auto; display: grid; gap: 8px; margin: 0 -16px; padding: 8px 16px max(12px, env(safe-area-inset-bottom));
  background: rgba(251, 245, 226, 0.98); border-top: 2px dashed rgba(29, 20, 16, 0.25);
}
.pf-actions .btn-big { padding: 12px; font-size: 17px; }
.pf-actions .btn-alt { padding: 9px; font-size: 15px; }
.pf-actions .mp-join .mp-input, .pf-actions .mp-join .btn { padding: 8px 10px; font-size: 14px; }
.pf-actions .mp-status:empty { display: none; }
.pf-step { margin: 8px 0 5px; font-family: var(--f-display); font-size: 13px; letter-spacing: 0.04em; display: flex; align-items: center; gap: 7px; }
.pf-step span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--sindoor); color: #fff; font-size: 12px; }
.pf-actions .pf-step { margin: 2px 0 0; }
.profile-card h2 { margin-bottom: 2px; font-size: 24px; }
#pf-name.need { animation: pulse 0.5s 3; border-color: var(--sindoor); box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.25); }
.pf-tag { margin: 6px 0 0; }
@media (max-width: 760px) {
  .profile-card { height: min(76vh, 680px); }
  /* one swipeable row of faces instead of two rows */
  .pf-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 74px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
  .pf-grid .pf-char { scroll-snap-align: start; }
}
@media (orientation: landscape) and (max-height: 500px) {
  /* sideways phone: steps 1–2 on the left, step 3 (play) in its own column */
  .profile-card { width: min(640px, 68vw); display: grid; grid-template-columns: 1fr 210px; gap: 0 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .pf-scroll { overflow-y: auto; }
  .pf-actions { margin: 0 -16px 0 0; padding: 4px 16px 10px 14px; border-top: 0; border-left: 2px dashed rgba(29, 20, 16, 0.25); align-content: center; }
  .pf-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 66px; overflow-x: auto; }
  .profile-card h2 { font-size: 19px; }
  .pf-step { margin: 5px 0 4px; }
  .pf-gender { margin-bottom: 6px; }
  .pf-gender .pick { padding: 4px; }
  .pf-actions .btn-big { padding: 9px 6px; font-size: 14px; }
  .pf-actions .btn-alt { padding: 7px 6px; font-size: 13px; }
  .pf-actions .mp-join { grid-template-columns: 1fr auto; }
  .pf-actions .mp-join .mp-input { letter-spacing: 0.1em; font-size: 12px; padding: 7px 6px; }
  .pf-actions .mp-join .btn { padding: 7px 8px; font-size: 13px; }
}
