/* Ujjain Market — Games Zone */
:root {
  --bg: #fff8ee; --ink: #2a1d12; --mut: #7a6656; --card: #fff; --line: #ecdcc6;
  --red: #d44a45; --org: #ff8a3d; --grn: #2fae3b; --blu: #457dd2;
  --r: 16px; --tap: 44px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; overflow-x: hidden; }
body { background: var(--bg); color: var(--ink); line-height: 1.4; -webkit-tap-highlight-color: transparent; min-height: 100vh; }
img { max-width: 100%; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--mut); font-size: .9rem; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35em;
  min-height: var(--tap); padding: .55em 1em; border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 700; text-decoration: none; background: #f3e6d4; color: var(--ink);
  transition: transform .12s ease, filter .12s ease; touch-action: manipulation;
}
.btn:active { transform: scale(.96); }
.btn:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #ffb44d; outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--go { background: linear-gradient(135deg, var(--grn), #60c94a); color: #fff; }
.btn--small { font-size: .9rem; padding: .45em .8em; }
.btn--ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn--wide { width: 100%; font-size: 1.1rem; }
.btn--wa { background: #25d366; color: #fff; }
.btn--shop { background: var(--red); color: #fff; }
.btn--yt { background: #cc0000; color: #fff; }
.btn--join { background: #2a1d12; color: #fff; }
.sel, select, input { font: inherit; min-height: var(--tap); border-radius: 10px; border: 2px solid var(--line); padding: .4em .6em; background: #fff; color: var(--ink); max-width: 100%; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; padding: .5rem 1rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar__brand { font-weight: 800; text-decoration: none; font-size: 1.05rem; min-height: var(--tap); display: flex; align-items: center; }
.topbar__nav { display: flex; gap: .4rem; }
.tlink { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 .75rem; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: .9rem; background: #f6ece0; }
.tlink--yt { background: #cc0000; color: #fff; }

/* hero */
#hub { max-width: 1240px; margin: 0 auto; padding: 1rem; }
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 2rem 1.25rem 1.5rem; color: #fff; text-align: center;
  background: radial-gradient(circle at 15% 20%, #ffcf4d 0 18%, transparent 19%), linear-gradient(135deg, #d44a45, #ff8a3d 55%, #a644d2);
  box-shadow: 0 10px 30px rgba(212, 74, 69, .25);
}
.hero__title { margin: 0; font-size: clamp(2rem, 7vw, 3.4rem); text-shadow: 0 3px 0 rgba(0,0,0,.18); position: relative; }
.hero__sub { margin: .5rem auto 1.1rem; max-width: 40rem; font-size: clamp(.98rem, 2.6vw, 1.15rem); position: relative; }
.hero__float { position: absolute; inset: 0; pointer-events: none; }
.hero__float span { position: absolute; font-size: 2.2rem; opacity: .28; animation: bob 4s ease-in-out infinite; }
.hero__float span:nth-child(1) { left: 6%; top: 60%; }
.hero__float span:nth-child(2) { left: 84%; top: 12%; animation-delay: -1s; }
.hero__float span:nth-child(3) { left: 72%; top: 66%; animation-delay: -2s; }
.hero__float span:nth-child(4) { left: 18%; top: 8%; animation-delay: -3s; }
.hero__float span:nth-child(5) { left: 46%; top: 78%; animation-delay: -1.5s; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(8deg); } }
.join { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; position: relative; }
.join__in { flex: 1 1 12rem; max-width: 16rem; text-transform: uppercase; letter-spacing: .1em; text-align: center; border-color: transparent; }

/* game cards */
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 1rem; margin: 1.25rem 0; }
.gcard {
  position: relative; border-radius: var(--r); padding: 1rem; color: #fff; display: flex; flex-direction: column; gap: .4rem;
  background: linear-gradient(140deg, var(--g1), var(--g2)); box-shadow: 0 6px 18px rgba(0,0,0,.12);
  animation: pop .4s ease both;
}
@keyframes pop { from { opacity: 0; transform: translateY(12px); } }
.gcard__top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.gcard__emoji { font-size: 2.8rem; line-height: 1; filter: drop-shadow(0 3px 2px rgba(0,0,0,.2)); }
.badge { background: rgba(255,255,255,.25); border-radius: 999px; padding: .25em .7em; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.gcard__title { margin: .2rem 0 0; font-size: 1.35rem; }
.gcard__line { margin: 0; font-size: .95rem; opacity: .95; flex: 1; }
.gcard__btns { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .4rem; }
.gcard__btns .btn { font-size: .88rem; padding: .5em .5em; line-height: 1.15; }
.btn--cpu { background: #fff; color: var(--g1); }
.btn--friends { background: rgba(0,0,0,.22); color: #fff; }
.btn--quick { grid-column: 1 / -1; background: #1d1440; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.gcard__soon { margin: 0; font-weight: 800; text-align: center; background: rgba(0,0,0,.2); border-radius: 10px; padding: .4em; }
.gcard.is-soon { filter: saturate(.55); }
.hubfoot { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; padding: .5rem 0 2rem; }

/* room */
#room { max-width: 1240px; margin: 0 auto; padding: .6rem .6rem 2rem; }
.roombar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.roombar__title { margin: 0; font-size: 1.2rem; flex: 1; min-width: 8rem; }
.roombar__code { font-size: .9rem; color: var(--mut); }
.share { display: flex; gap: .4rem; margin: .5rem 0; flex-wrap: wrap; }
.share__in { flex: 1 1 12rem; min-width: 0; font-size: .85rem; }
.controls, .media { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; align-items: center; }
.media .muted { flex-basis: 100%; margin: 0; }

/* players bar */
.pbar { display: flex; gap: .5rem; overflow-x: auto; padding: .3rem .1rem .5rem; scrollbar-width: thin; }
.pc { --pc: #888; position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: .45rem; padding: .35rem .6rem .35rem .35rem; background: #fff; border-radius: 14px; border: 3px solid var(--pc); min-width: 8.5rem; max-width: 12rem; transition: box-shadow .2s, transform .2s; }
.pc.is-turn { box-shadow: 0 0 0 3px #ffd34d, 0 4px 12px rgba(0,0,0,.15); transform: translateY(-2px); }
.pc.is-me { background: #fffbea; }
.pc.is-talk .pc__media { box-shadow: 0 0 0 3px #3ddc84; animation: talk .6s ease-in-out infinite alternate; }
@keyframes talk { to { box-shadow: 0 0 0 6px rgba(61,220,132,.4); } }
.pc__media { position: relative; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; background: var(--pc); }
.pc__av, .pc__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pc__video { opacity: 0; transition: opacity .2s; }
.pc__video.on { opacity: 1; }
.pc__video.mirror { transform: scaleX(-1); }
.pc__txt { display: flex; flex-direction: column; min-width: 0; }
.pc__name { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc__sub { font-size: .75rem; color: var(--mut); }

/* speech bubble */
.bubble { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -6px); background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 14px; padding: .35em .7em; font-size: .85rem; font-weight: 700; width: max-content; max-width: min(15rem, 70vw); z-index: 50; animation: bub .25s ease both; pointer-events: none; box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.bubble::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: var(--ink); }
.bubble--abs { bottom: auto; transform: translate(-50%, -100%); z-index: 99999; }
@keyframes bub { from { opacity: 0; scale: .7; } }

/* board area + waiting */
.board { position: relative; margin-top: .3rem; min-height: 200px; }
.waiting { text-align: center; padding: 2rem 1rem; background: #fff; border-radius: var(--r); border: 2px dashed var(--line); }
.waiting__emoji { font-size: 4rem; animation: bob 2.5s ease-in-out infinite; }
.waiting h2 { margin: .3rem 0; }

/* turn bar + dice (ludo, snakes …) */
.turnbar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: #fff; border-radius: 14px; padding: .4rem .5rem .4rem .8rem; margin-bottom: .4rem; border: 1px solid var(--line); }
.turnbar__info { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; min-width: 0; font-size: .95rem; }
.turnbar__info small { color: var(--mut); }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dice-btn { --dc: var(--red); width: 64px; height: 64px; flex: 0 0 auto; font-size: 2.4rem; line-height: 1; border-radius: 16px; border: 0; cursor: pointer; background: #fff; box-shadow: 0 0 0 3px var(--dc), 0 5px 0 rgba(0,0,0,.18); touch-action: manipulation; }
.dice-btn:disabled { opacity: .6; cursor: default; }
.dice-btn.ready { animation: ready 1s ease-in-out infinite; }
.dice-btn.rolling { animation: roll .5s linear; }
@keyframes ready { 50% { transform: scale(1.08); } }
@keyframes roll { to { transform: rotate(720deg); } }
.board-host { position: relative; }

/* 3D stage (views/common.js) */
.stage-root { position: relative; }
.stage-wrap { position: relative; width: 100%; overflow: auto; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; border-radius: var(--r); }
.stage { position: relative; }
.stage-tilt { position: absolute; inset: 0; transform-origin: 50% 50%; }
.stage-svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 10px 14px rgba(70,40,10,.25)); }
.stage-svg [data-tap], .stage-svg .tap { cursor: pointer; }
.stage-ovl { position: absolute; inset: 0; pointer-events: none; }
.stage-ovl > * { pointer-events: auto; }
.zoom-bar { position: absolute; right: .4rem; bottom: .4rem; display: flex; gap: .3rem; z-index: 5; }
.zbtn { width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: rgba(255,255,255,.92); box-shadow: 0 2px 6px rgba(0,0,0,.2); font-size: 1.3rem; font-weight: 800; cursor: pointer; color: var(--ink); }

/* chibi figures */
.chibi { position: absolute; left: 0; top: 0; transform-origin: 50% 100%; cursor: pointer; will-change: transform; transition: filter .2s; }
.chibi__fig { position: relative; width: 100%; aspect-ratio: 161 / 300; }
.chibi__body { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.chibi__face { position: absolute; border-radius: 50%; overflow: hidden; }
.chibi__face img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }
.chibi__tag { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -2px); display: flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 8px; color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.chibi__arrow { display: inline-block; font-size: 8px; transition: transform .2s; }
.chibi__name { max-width: 6em; overflow: hidden; text-overflow: ellipsis; }
.chibi__shadow { position: absolute; left: 15%; right: 15%; bottom: -4%; height: 8%; border-radius: 50%; background: rgba(0,0,0,.28); z-index: -1; }
.chibi--sm .chibi__tag { display: none; }
.chibi.can { filter: drop-shadow(0 0 6px #ffd34d) drop-shadow(0 0 3px #ffd34d); animation: canhop .8s ease-in-out infinite; }
.chibi.can::before { content: ""; position: absolute; inset: -20%; } /* bigger tap zone */
@keyframes canhop { 50% { margin-top: -6px; } }
.chibi.walking { transition: none; }
.chibi.home { opacity: .9; }
.chibi.frozen { transition: none; }
.chibi.poof { animation: poof .45s ease forwards; }
@keyframes poof { to { opacity: 0; scale: 1.6; filter: blur(3px); } }
.chibi.talk .chibi__face { box-shadow: 0 0 0 2px #3ddc84; }

/* setup sheet */
.sheet { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 1rem)); max-height: calc(100dvh - 1rem); color: var(--ink); }
.sheet::backdrop { background: rgba(30,15,5,.55); }
.sheet__form { padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.sheet__head { display: flex; align-items: center; gap: .5rem; }
.sheet__head h2 { margin: 0; font-size: 1.15rem; flex: 1; }
.xbtn { width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: #f3e6d4; font-size: 1.1rem; cursor: pointer; }
.su-me { display: flex; gap: .8rem; align-items: center; }
.su-av { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid var(--red); flex: 0 0 auto; background: #eee; }
.su-fields { flex: 1; display: grid; gap: .4rem; min-width: 0; }
.fld { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; font-weight: 700; color: var(--mut); }
.fld input, .fld select { color: var(--ink); font-weight: 400; width: 100%; }
.su-avbtns { display: flex; flex-wrap: wrap; gap: .4rem; }
.su-lib { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .2rem; }
.su-lib .muted { margin: 0; }
.lib-face { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: .15rem; border: 0; background: none; cursor: pointer; min-width: var(--tap); font: inherit; font-size: .75rem; }
.lib-face img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.su-opts { display: grid; gap: .5rem; }

/* toast */
#g-toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 150%); background: #2a1d12; color: #fff; padding: .7em 1.1em; border-radius: 12px; font-weight: 700; z-index: 1000; opacity: 0; transition: .25s; max-width: calc(100vw - 2rem); text-align: center; }
#g-toast.on { transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 900px) {
  .hero { padding: 3rem 2rem 2rem; }
  .pc__media { width: 52px; height: 52px; }
}
@media (max-width: 380px) {
  .gcard__btns { grid-template-columns: 1fr; }
  .topbar__brand { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* quick match (🌐 Online खेलें) */
.mm { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(30,15,5,.6); }
.mm__box { width: min(440px, 100%); max-height: calc(100dvh - 2rem); overflow-y: auto; background: #fff; border-radius: 22px; padding: 1.3rem 1.1rem 1.1rem; text-align: center; box-shadow: 0 14px 40px rgba(0,0,0,.3); }
.mm__emoji { font-size: 3.4rem; line-height: 1; animation: mmspin 2.4s linear infinite; display: inline-block; }
@keyframes mmspin { to { transform: rotate(360deg); } }
.mm__box h2 { margin: .5rem 0 .2rem; font-size: 1.3rem; }
.mm__count { margin: 0 0 .6rem; font-weight: 800; font-size: 1.1rem; color: var(--red); }
.mm__seats { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: .7rem; }
.mm__seat { display: flex; flex-direction: column; align-items: center; gap: .2rem; width: 4.6rem; font-size: .75rem; font-weight: 700; }
.mm__seat img, .mm__seat .mm__empty { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line); background: #f6ece0; }
.mm__seat .mm__empty { display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--mut); border-style: dashed; }
.mm__seat span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm__bar { height: 8px; border-radius: 99px; background: #f3e6d4; overflow: hidden; margin: 0 0 .5rem; }
.mm__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--org), var(--red)); transition: width .9s linear; }
.mm__safe { font-size: .82rem; background: #eef7ee; color: #1f5f2a; border-radius: 10px; padding: .45em .6em; margin: .5rem 0 .8rem; }
.pc { flex-wrap: wrap; }
.pc__tools { flex-basis: 100%; display: flex; gap: .25rem; justify-content: flex-start; }
.pc__tools:empty { display: none; }
.pc__tool { min-width: 40px; min-height: 40px; padding: 0 .35rem; border: 0; border-radius: 10px; background: #f3e6d4; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.pc__tool.is-on { background: #2a1d12; color: #fff; }
.qchat { display: flex; gap: .35rem; overflow-x: auto; padding: .1rem .1rem .4rem; scrollbar-width: thin; }
.qchat .btn { flex: 0 0 auto; font-size: .85rem; padding: .35em .75em; background: #fff; box-shadow: inset 0 0 0 2px var(--line); }
.tchat { margin: 0 0 .4rem; }
.tc-form { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.tc-in { flex: 1 1 12rem; min-width: 0; }
.tc-left { flex-basis: 100%; color: var(--mut); font-size: .78rem; }
.tc-lock { background: #fff6e0; border: 2px dashed #e0b14a; border-radius: 12px; padding: .5rem .7rem; }
.tc-lock p { margin: 0 0 .4rem; font-weight: 700; font-size: .92rem; }
.tc-lock__btns { display: flex; gap: .4rem; flex-wrap: wrap; }
.tc-prices { margin: .4rem 0 .2rem; padding-left: 1.1rem; font-size: .82rem; display: grid; gap: .1rem; }
.btn--stk.is-locked { opacity: .65; }
.pc__tier { display: inline-block; font-size: .68rem; font-weight: 800; background: #fff1c2; color: #7a5300; border-radius: 6px; padding: 0 .35em; margin-left: .25em; white-space: nowrap; vertical-align: middle; }
.pc__txt .pc__tier { margin: 0; align-self: flex-start; }
.pc__tier.is-x { background: linear-gradient(90deg, #2a1d12, #6b4a12); color: #ffd56a; }
.pk-list { display: grid; gap: .5rem; }
.pk { display: flex; gap: .6rem; align-items: center; border: 2px solid var(--line); border-radius: 14px; padding: .55rem .7rem; }
.pk--p { border-color: #e0b14a; background: #fffaf0; }
.pk--x { border-color: #6b4a12; background: #fff6dc; }
.pk__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pk__txt small { color: var(--mut); }
.pk-status { margin: 0; font-weight: 800; color: #7a5300; }
.pk-soon { margin: .2rem 0 0; }
.me { margin: 1rem 0 0; background: #fff; border-radius: 18px; padding: .8rem 1rem; border: 1px solid var(--line); }
.me__top { display: flex; gap: .7rem; align-items: center; }
.me__av { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid var(--red); flex: 0 0 auto; }
.me__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me__name { overflow-wrap: anywhere; }
.me__id { font-family: ui-monospace, monospace; color: var(--mut); }
.me__prog { margin-top: .5rem; }
.me__prog summary { cursor: pointer; font-weight: 700; min-height: var(--tap); display: flex; align-items: center; }
.me__prog ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.me__prog li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .6rem; border-top: 1px solid var(--line); padding-top: .3rem; }
.me__prog li small { color: var(--mut); }
.me__note { margin: .4rem 0 0; font-size: .78rem; }
.cont { display: flex; align-items: center; gap: .8rem; width: 100%; margin: .7rem 0 0; padding: .8rem 1rem; border: 0; border-radius: 18px; cursor: pointer; text-align: left; font: inherit; color: #fff; background: linear-gradient(135deg, #2fae3b, #0f8a6a); box-shadow: 0 6px 18px rgba(15,138,106,.25); min-height: var(--tap); }
.cont__emoji { font-size: 2rem; line-height: 1; }
.cont__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cont__txt b { font-size: 1.05rem; }
.cont__go { font-size: 1.3rem; font-weight: 800; }
.pk-h { margin: .6rem 0 0; font-size: 1rem; }
.pk-cat { margin: .2rem 0 0; font-weight: 800; font-size: .85rem; color: var(--mut); }
.pk--cos { padding: .4rem .6rem; }
.me__top { flex-wrap: wrap; }
.me__btns { display: flex; flex-direction: column; gap: .3rem; }
@media (max-width: 520px) { .me__btns { flex-direction: row; flex-basis: 100%; } .me__btns .btn { flex: 1; } }
/* nudge */
.nudge { position: fixed; left: 50%; bottom: 4.2rem; transform: translateX(-50%); z-index: 950; width: min(420px, calc(100vw - 1rem)); background: #2a1d12; color: #fff; border-radius: 16px; padding: .6rem .7rem; box-shadow: 0 10px 28px rgba(0,0,0,.35); animation: bub .25s ease both; }
.nudge b { display: block; margin-bottom: .4rem; }
.nudge__btns { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.nudge .btn--ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.nudge .xbtn { margin-left: auto; width: 40px; height: 40px; }
/* cosmetics: dice skins */
body[data-dice="dice-gold"] .dice-btn, body[data-dice="dice-gold"] .sn-dice { background: linear-gradient(145deg, #fff3b0, #e6b422); box-shadow: 0 0 0 3px #a87b00, 0 5px 0 rgba(0,0,0,.25); }
body[data-dice="dice-neon"] .dice-btn, body[data-dice="dice-neon"] .sn-dice { background: #14082e; color: #fff; box-shadow: 0 0 0 3px #39ff88, 0 0 14px #39ff88, 0 5px 0 rgba(0,0,0,.25); }
body[data-dice="dice-wood"] .dice-btn, body[data-dice="dice-wood"] .sn-dice { background: repeating-linear-gradient(100deg, #c58b4c 0 6px, #b07438 6px 11px); box-shadow: 0 0 0 3px #6b3f17, 0 5px 0 rgba(0,0,0,.25); }
/* cosmetics: avatar frames (own avatar) */
body[data-frame="frame-gold"] .pc.is-me .pc__media, body[data-frame="frame-gold"] .av-frame { box-shadow: 0 0 0 3px #e6b422, 0 0 0 5px #a87b00; }
body[data-frame="frame-rainbow"] .pc.is-me .pc__media, body[data-frame="frame-rainbow"] .av-frame { box-shadow: 0 0 0 3px #ff4d4d, 0 0 0 6px #ffd34d, 0 0 0 9px #3ddc84; }
body[data-frame="frame-fire"] .pc.is-me .pc__media, body[data-frame="frame-fire"] .av-frame { box-shadow: 0 0 0 3px #ff8a3d, 0 0 12px 4px #ff4d00; }
.rb-why { border: 2px solid var(--line); border-radius: 12px; display: grid; gap: .1rem; padding: .4rem .7rem .6rem; margin: 0; }
.rb-why legend { font-weight: 700; font-size: .9rem; padding: 0 .3rem; }
.rb-why label { display: flex; align-items: center; gap: .5rem; min-height: 40px; }
.rb-why input { min-height: auto; width: 20px; height: 20px; }
.btn--report { background: var(--red); color: #fff; }

/* site-wide videos strip: hub only, never over a game */
body[data-screen="room"] #always-videos, body[data-screen="room"] .av3-wrap, #room .av3-wrap { display: none !important; }
#always-videos { max-width: 100%; overflow: hidden; }

/* ===== FX THEME (festive 3D look) — BEGIN ===== */
:root {
  --saf: #ff8a00; --saf2: #ffc21a; --blue: #1d3fbf; --blue2: #3f6dff; --emr: #0a9a6a; --emr2: #2fd49a; --mag: #d6247a; --mag2: #ff5fa8;
  --ink: #241433; --mut: #6e5a72; --line: #efd9c2;
}
body {
  background:
    radial-gradient(circle at 1px 1px, rgba(214, 36, 122, .07) 1.2px, transparent 1.6px) 0 0 / 22px 22px,
    linear-gradient(180deg, #fff3df 0%, #fff0ea 45%, #f7f0ff 100%);
}
/* top bar */
.topbar { background: rgba(255, 255, 255, .94); border-bottom: 0; box-shadow: 0 2px 0 rgba(255, 138, 0, .25), 0 6px 18px rgba(80, 20, 60, .08); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: linear-gradient(90deg, var(--saf), var(--mag) 35%, var(--blue2) 70%, var(--emr2)); }
.topbar__brand { color: #b3124f; }
.tlink { background: linear-gradient(#fff, #fbeedd); box-shadow: inset 0 0 0 1.5px #f1d8b8, 0 2px 0 #e7c79e; }
.tlink--yt { background: linear-gradient(#ff3b3b, #c40000); color: #fff; box-shadow: 0 2px 0 #8a0000; }

/* buttons: glossy 3D keys */
.btn { background: linear-gradient(#fffaf2, #f6e2c8); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 3px 0 #dcb98d, 0 5px 10px rgba(90,40,10,.12); transition: transform .1s ease, box-shadow .1s ease, filter .12s; }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 0 #dcb98d, 0 2px 4px rgba(90,40,10,.12); }
.btn:disabled { box-shadow: none; transform: none; }
.btn--go { background: linear-gradient(#34d399, #0a9a6a 70%); color: #fff; text-shadow: 0 1px 0 rgba(0,60,30,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 0 #067048, 0 6px 14px rgba(10,154,106,.3); }
.btn--ghost { background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 2px #edd3b6, 0 2px 0 #e2c29b; }
.btn--wa { background: linear-gradient(#3fe07f, #18a957); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 3px 0 #0f7a3c; }
.btn--shop { background: linear-gradient(135deg, #ff4d6d, var(--mag)); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 0 #8f0f4e; }
.btn--yt { background: linear-gradient(#ff3b3b, #c40000); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 0 #7d0000; }
.btn--join { background: linear-gradient(#3a2457, #1a0f2e); color: #ffd56a; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 3px 0 #0a0514, 0 6px 14px rgba(0,0,0,.25); }
.btn--report { background: linear-gradient(#ff5a5a, #c62828); box-shadow: 0 3px 0 #7f1414; }
.sel, select, input { border-color: #efd3b3; box-shadow: inset 0 2px 3px rgba(80,30,0,.06); }

/* hero */
.hero {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 220, 90, .9) 0 15%, transparent 16%),
    radial-gradient(circle at 92% 110%, rgba(63, 109, 255, .65) 0 30%, transparent 31%),
    repeating-conic-gradient(from 0deg at 50% 120%, rgba(255,255,255,.07) 0 6deg, transparent 6deg 12deg),
    linear-gradient(135deg, #ff6a00 0%, #ff2f6d 48%, #8a2be2 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -6px 0 rgba(60,0,60,.25), 0 14px 30px rgba(214, 36, 122, .28);
}
.hero__title { text-shadow: 0 2px 0 #c2185b, 0 4px 0 #8e1450, 0 8px 14px rgba(60, 0, 40, .45); letter-spacing: .01em; }
.hero__sub { text-shadow: 0 1px 2px rgba(60,0,40,.4); }
.hero__float span { opacity: .4; filter: drop-shadow(0 4px 3px rgba(0,0,0,.25)); }
.join__in { background: rgba(255,255,255,.96); box-shadow: inset 0 2px 4px rgba(0,0,0,.12), 0 3px 0 rgba(120,0,60,.25); }

/* game cards: rich festive gradients, gloss + 3D tilt */
.ggrid { perspective: 1200px; }
.gcard[data-card="chess"] { --g1: #1b1f6b !important; --g2: #4a55e6 !important; --g3: #8b6cff; }
.gcard[data-card="ludo"] { --g1: #c81d16 !important; --g2: #ff6a00 !important; --g3: #ffc21a; }
.gcard[data-card="words"] { --g1: #035e4a !important; --g2: #0aa877 !important; --g3: #49e3b4; }
.gcard[data-card="checkers"] { --g1: #6d1199 !important; --g2: #c4227f !important; --g3: #ff6fb5; }
.gcard[data-card="snakes"] { --g1: #0b6a2c !important; --g2: #23b047 !important; --g3: #b8e52e; }
.gcard[data-card="pen"] { --g1: #0a338c !important; --g2: #1f78ff !important; --g3: #3fd2ff; }
.gcard[data-card="carrom"] { --g1: #6b300a !important; --g2: #b9601a !important; --g3: #f2b04a; }
.gcard[data-card="ttt"] { --g1: #9c0f55 !important; --g2: #e8308c !important; --g3: #ff9ec4; }
.gcard[data-card="memory"] { --g1: #9a3c06 !important; --g2: #e07b06 !important; --g3: #ffc53d; }
.gcard[data-card="quiz"] { --g1: #4b1287 !important; --g2: #9d2bd8 !important; --g3: #ff8a1a; }
.gcard {
  overflow: hidden; isolation: isolate; border-radius: 20px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,.28), transparent 55%),
    radial-gradient(circle at 0% 100%, var(--g3, var(--g2)) 0, transparent 55%),
    linear-gradient(150deg, var(--g1), var(--g2));
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), inset 0 -5px 0 rgba(0,0,0,.18), 0 10px 22px -6px rgba(40, 10, 50, .45);
  transform: translateZ(0); transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
}
.gcard::before { /* rangoli rings watermark */
  content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; z-index: -1; pointer-events: none;
  background: repeating-radial-gradient(circle, rgba(255,255,255,.14) 0 6px, transparent 6px 16px);
}
.gcard::after { /* glossy sheen that slides on hover */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.28) 48%, transparent 60%); transform: translateX(-60%); transition: transform .6s ease, opacity .3s;
}
@media (hover: hover) {
  .gcard:hover { transform: rotateX(5deg) rotateY(-5deg) translateY(-6px); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.5), inset 0 -5px 0 rgba(0,0,0,.18), 0 22px 30px -10px rgba(40, 10, 50, .55); }
  .gcard:hover::after { opacity: 1; transform: translateX(60%); }
  .gcard:hover .gcard__emoji { transform: translateY(-4px) scale(1.1) rotate(-6deg); }
}
.gcard:active { transform: scale(.985) translateY(1px); }
.gcard__emoji { font-size: 3rem; transition: transform .3s cubic-bezier(.3,1.6,.5,1); filter: drop-shadow(0 4px 0 rgba(0,0,0,.18)) drop-shadow(0 8px 8px rgba(0,0,0,.25)); }
.gcard__title { font-size: 1.45rem; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.gcard__line { text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.badge { background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.btn--cpu { background: linear-gradient(#fff, #fff1df); color: var(--g1); box-shadow: inset 0 1px 0 #fff, 0 3px 0 rgba(0,0,0,.25), 0 6px 10px rgba(0,0,0,.15); }
.btn--friends { background: rgba(0,0,0,.22); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35), 0 3px 0 rgba(0,0,0,.25); }
.btn--quick { background: linear-gradient(#2c1f5e, #140b33); color: #ffe08a; box-shadow: inset 0 0 0 1.5px rgba(255,214,106,.5), 0 3px 0 rgba(0,0,0,.35); }
.cont { background: linear-gradient(135deg, #12b886, #0a7a8c); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 0 #075a63, 0 10px 20px rgba(10,122,140,.3); }
.me { background: linear-gradient(#fff, #fff8f0); border: 0; box-shadow: inset 0 0 0 1.5px #f3dcc2, 0 6px 16px rgba(120,50,20,.08); }

/* room chrome */
.roombar__title { color: #8e1450; font-size: 1.3rem; text-shadow: 0 1px 0 #fff, 0 2px 0 rgba(255,138,0,.35); }
.pbar { padding: .75rem .5rem .8rem; }
.pc { background: linear-gradient(#fff, #fff7ee); box-shadow: 0 3px 0 color-mix(in srgb, var(--pc) 70%, #000), 0 5px 12px rgba(0,0,0,.08); }
.pc.is-me { background: linear-gradient(#fffdf2, #fff1cc); }
.pc.is-turn { transform: translateY(-3px); box-shadow: 0 0 0 3px #ffd34d, 0 0 9px 2px var(--pc), 0 6px 14px rgba(0,0,0,.18); animation: fxTurn 1.4s ease-in-out infinite; }
.pc.is-turn::after { content: "▶"; position: absolute; top: -9px; right: -7px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; background: radial-gradient(circle at 35% 30%, #ffe38a, #ff8a00 70%); box-shadow: 0 2px 0 #b35a00, 0 0 8px #ffb300; }
@keyframes fxTurn { 50% { box-shadow: 0 0 0 3px #ffe58a, 0 0 14px 5px var(--pc), 0 6px 14px rgba(0,0,0,.18); } }
.pc__media { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pc), 0 3px 6px rgba(0,0,0,.25); }
.turnbar { background: linear-gradient(#fff, #fff6ea); border: 0; box-shadow: inset 0 0 0 1.5px #f1d6b4, 0 3px 0 #ead0ad, 0 8px 16px rgba(120,50,20,.08); }
.dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.18); background-image: radial-gradient(circle at 35% 30%, rgba(255,255,255,.75), transparent 55%) !important; }
.waiting { background: linear-gradient(#fff, #fff6ea); border: 2px dashed #f0c48a; }
.sheet { box-shadow: 0 20px 50px rgba(40,0,40,.35); }
.mm__box { box-shadow: inset 0 3px 0 var(--saf), 0 14px 40px rgba(0,0,0,.3); }

/* tilted stage (ludo): cheap shadow instead of a big drop-shadow filter */
.stage-svg { filter: none; }
.stage::before { content: ""; position: absolute; left: 4%; right: 4%; bottom: 0; height: 26%; border-radius: 50%; background: radial-gradient(ellipse at 50% 50%, rgba(70,20,0,.38), transparent 68%); pointer-events: none; }
.zbtn { background: linear-gradient(#fff, #f3e3cf); box-shadow: inset 0 1px 0 #fff, 0 3px 0 #d2b28a, 0 5px 10px rgba(0,0,0,.2); }
.chibi.can { filter: drop-shadow(0 0 5px #ffd34d) drop-shadow(0 0 2px #ff8a00); }

/* ---- 3D dice (fx/fx.js dice3d) ---- */
.dice-btn.d3, .sn-dice.d3 {
  --ds: 34px; display: flex; align-items: center; justify-content: center; padding: 0; perspective: 260px; font-size: 0;
  background: radial-gradient(circle at 50% 35%, #fff 0, #fff3e2 60%, #f6dcc0 100%);
  border: 0; box-shadow: 0 0 0 3px var(--dc, #ff8a00), inset 0 -4px 0 rgba(0,0,0,.08), 0 5px 0 color-mix(in srgb, var(--dc, #ff8a00) 55%, #000), 0 8px 14px rgba(0,0,0,.2);
}
.sn-dice.d3 { --ds: 30px; }
.dice-btn.d3.ready, .sn-dice.d3.ready { animation: fxDiceReady 1.1s ease-in-out infinite; }
@keyframes fxDiceReady { 50% { transform: translateY(-3px) scale(1.06); box-shadow: 0 0 0 3px var(--dc, #ff8a00), 0 0 18px 4px var(--dc, #ff8a00), 0 8px 0 color-mix(in srgb, var(--dc, #ff8a00) 55%, #000), 0 12px 16px rgba(0,0,0,.2); } }
.dice-btn.d3.rolling, .sn-dice.d3.rolling, .dice-btn.d3.d3-hop, .sn-dice.d3.d3-hop { animation: fxDiceHop .75s cubic-bezier(.3,.7,.4,1); }
@keyframes fxDiceHop { 0% { transform: none; } 30% { transform: translateY(-14px) scale(1.08); } 60% { transform: translateY(0) scale(.96, 1.04); } 80% { transform: translateY(-3px); } 100% { transform: none; } }
.d3-cube { position: relative; display: block; width: var(--ds); height: var(--ds); transform-style: preserve-3d; transition: transform .8s cubic-bezier(.18,.85,.25,1.08); }
.d3-f {
  position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 13%; border-radius: 22%;
  background: radial-gradient(circle at 30% 25%, #fff 0, #fbf6ee 50%, #e9dcc8 100%);
  box-shadow: inset 0 0 0 1px rgba(120,80,40,.18), inset -2px -3px 5px rgba(120,80,40,.18); backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.d3-f i { border-radius: 50%; margin: 16%; }
.d3-f i.on { background: radial-gradient(circle at 35% 30%, #6b6b6b, #0d0d0d 70%); box-shadow: inset 0 1px 1px rgba(0,0,0,.6); }
.d3-f1 i.on, .d3-f4 i.on { background: radial-gradient(circle at 35% 30%, #ff8a8a, #c40000 70%); }
.d3-f1 i.on { margin: 0; }
.d3-f1 { transform: translateZ(calc(var(--ds) / 2)); }
.d3-f2 { transform: rotateY(90deg) translateZ(calc(var(--ds) / 2)); }
.d3-f3 { transform: rotateX(90deg) translateZ(calc(var(--ds) / 2)); }
.d3-f4 { transform: rotateX(-90deg) translateZ(calc(var(--ds) / 2)); }
.d3-f5 { transform: rotateY(-90deg) translateZ(calc(var(--ds) / 2)); }
.d3-f6 { transform: rotateY(180deg) translateZ(calc(var(--ds) / 2)); }

/* ---- particles + confetti (fx/fx.js) ---- */
.fx-burst { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 9000; }
.fx-burst i { position: absolute; left: -4px; top: -4px; border-radius: 50%; box-shadow: 0 0 6px rgba(255,255,255,.8); animation: fxSpark .75s cubic-bezier(.15,.7,.3,1) both; }
@keyframes fxSpark { 0% { transform: translate(0, 0) scale(1.3); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.15); opacity: 0; } }
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 9500; overflow: hidden; contain: strict; }
.fx-confetti i { position: absolute; top: -18px; width: 8px; height: 14px; border-radius: 2px; animation: fxFall 2s cubic-bezier(.3,.6,.5,1) both; }
@keyframes fxFall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 85% { opacity: 1; } 100% { transform: translate(var(--dx), 104vh) rotate(var(--r)); opacity: .2; } }

@media (prefers-reduced-motion: reduce) {
  .gcard, .gcard:hover { transform: none !important; }
  .fx-layer, .fx-burst { display: none !important; }
  .d3-cube { transition: none !important; }
}
/* ===== FX THEME — END ===== */

/* Bade screen (laptop / TV) par game poori jagah le: room ki 1240px seema hatao */
#room { max-width: none; }

/* Laptop / TV (landscape): whole game on one screen, no page scroll. Board fills the left at full
   height; players, dice turn info, buttons, chat / premium sit in a side frame on the right. */
.room-side { display: contents; }
@media (orientation: landscape) and (min-width: 900px) {
  body[data-screen="room"] { overflow: hidden; }
  body[data-screen="room"] .topbar, body[data-screen="room"] #hub { display: none !important; }
  body[data-screen="room"] #room {
    position: fixed; inset: 0; z-index: 40; background: var(--bg); max-width: none !important; margin: 0 !important;
    display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 380px); grid-template-rows: auto minmax(0, 1fr);
    gap: .4rem 1rem; height: 100vh; height: 100dvh; padding: .4rem .8rem .5rem; box-sizing: border-box; overflow: hidden;
  }
  body[data-screen="room"] #room > .roombar { grid-column: 1 / -1; grid-row: 1; }
  body[data-screen="room"] #room > #board { grid-column: 1; grid-row: 2; min-height: 0; overflow: hidden; margin: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
  body[data-screen="room"] #room > #board > * { width: 100%; }
  body[data-screen="room"] #room > .room-side { display: flex; flex-direction: column; gap: .4rem; grid-column: 2; grid-row: 2;
    min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: .2rem; }
  body[data-screen="room"] #room .pbar { flex-wrap: wrap; overflow: visible; padding: .3rem 0; }
  body[data-screen="room"] #room .controls, body[data-screen="room"] #room .media { margin: 0; }
}

/* premium shelf in the right side frame (laptop/TV only) */
.shelf { display: none; }
@media (orientation: landscape) and (min-width: 900px) {
  body[data-screen="room"] .shelf { display: flex; flex-direction: column; gap: .45rem; padding: .6rem; border-radius: 16px;
    background: linear-gradient(160deg, #fff4d6, #ffe0f0 55%, #e3e8ff); border: 2px solid #ffd27a; box-shadow: 0 4px 14px rgba(140,60,0,.12); }
  .shelf__h { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: #8e1450; }
  .shelf__coins { font-size: .9rem; background: #fff; border-radius: 999px; padding: .1rem .55rem; color: #6b4400; }
  .shelf__b { display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left; border: 0; border-radius: 12px; padding: .5rem .6rem;
    color: #fff; cursor: pointer; font: inherit; box-shadow: 0 3px 0 rgba(0,0,0,.18); transition: transform .12s; }
  .shelf__b:hover { transform: translateY(-2px) scale(1.02); }
  .shelf__b:active { transform: translateY(1px); }
  .shelf__i { font-size: 1.5rem; line-height: 1; }
  .shelf__t { display: flex; flex-direction: column; min-width: 0; }
  .shelf__t b { font-size: .98rem; } .shelf__t small { font-size: .78rem; opacity: .95; }
  .shelf--power { background: linear-gradient(135deg, #ff8a00, #ff3d6e); }
  .shelf--prem { background: linear-gradient(135deg, #f5b400, #ff7a00); color: #3a2200; }
  .shelf--exec { background: linear-gradient(135deg, #7b2ff7, #c2185b); }
  .shelf--msg { background: linear-gradient(135deg, #00a884, #0077c8); }
  .shelf--invite { background: linear-gradient(135deg, #25d366, #128c7e); }
  .shelf__note { color: #7a6656; font-size: .75rem; text-align: center; }
  .shelf--shake { animation: shelfShake .9s ease 2; }
  @keyframes shelfShake { 0%,100% { transform: none } 20% { transform: rotate(-1.5deg) scale(1.03) } 40% { transform: rotate(1.5deg) scale(1.03) } 60% { transform: rotate(-1deg) } 80% { transform: rotate(1deg) } }
}
