:root {
  --pink: #ff4f9a; --pink2: #ff8fb8; --rose: #c2185b; --cream: #fff6f9; --ink: #4a1631; --md: #3f74ff; --fz: #ff3d8b;
  --card: rgba(255, 247, 251, 0.94); --shadow: 0 12px 40px rgba(140, 20, 70, 0.28);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #ffb6cf; color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; overscroll-behavior: none; }
body { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
#app { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px var(--rose); }

/* HUD */
#hud { position: absolute; top: max(6px, env(safe-area-inset-top)); left: 0; right: 0; display: flex; gap: 8px; justify-content: center; align-items: center; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }
.hbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.85); box-shadow: 0 3px 10px rgba(120,0,60,.25); font-size: 16px; font-weight: 700; color: var(--rose); }
.chip { background: rgba(255,255,255,0.85); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; color: var(--rose); box-shadow: 0 3px 10px rgba(120,0,60,.2); white-space: nowrap; }
#hint { position: absolute; top: 54px; left: 50%; transform: translateX(-50%); max-width: min(560px, 80vw); text-align: center; background: rgba(74, 22, 49, 0.78); color: #fff; padding: 7px 14px; border-radius: 14px; font-size: 14px; line-height: 1.3; opacity: 0; transition: opacity .35s; pointer-events: none; z-index: 4; }
#hint.show { opacity: 1; }
#netBadge { position: absolute; top: calc(max(6px, env(safe-area-inset-top)) + 50px); left: max(10px, env(safe-area-inset-left)); font-size: 12px; background: rgba(255,255,255,.85); border-radius: 999px; padding: 4px 10px; color: var(--rose); font-weight: 700; z-index: 5; }
#toast { position: absolute; left: 50%; bottom: 24%; transform: translateX(-50%); background: rgba(255,255,255,.95); color: var(--rose); font-weight: 800; padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 30; font-size: 15px; white-space: nowrap; }
#toast.show { opacity: 1; }

/* overlays */
.overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 12px; z-index: 20; overflow-y: auto;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), transparent 60%), rgba(255, 120, 170, 0.35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.overlay.show { display: flex; }
#menu { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.card { background: var(--card); border-radius: 26px; box-shadow: var(--shadow); padding: 18px 22px; width: min(440px, 94vw); text-align: center; margin: auto; border: 2px solid rgba(255,255,255,.9); }
.card.wide { width: min(720px, 96vw); }
.card.hero { width: min(560px, 96vw); }
.kicker { margin: 0; font-weight: 800; color: var(--pink); letter-spacing: .5px; font-size: 14px; }
h1 { margin: 2px 0 2px; font-size: clamp(30px, 7vw, 48px); line-height: 1.05; color: var(--rose); text-shadow: 0 2px 0 #ffd3e4, 0 3px 0 rgba(194,24,91,.18); letter-spacing: .5px; }
h2 { margin: 4px 0 10px; color: var(--rose); font-size: 24px; }
.sub { margin: 4px 0 8px; font-size: 16px; }
.small { font-size: 13px; opacity: .85; }
.duo { display: flex; justify-content: center; margin: 2px 0; }
#duoCanvas { width: 280px; height: 110px; }
.big { display: block; width: 100%; border: 0; border-radius: 18px; padding: 12px 10px; font-size: 18px; font-weight: 800; color: #fff; background: linear-gradient(180deg, #ff6aa8, #e91e63); box-shadow: 0 5px 0 #a3134a, 0 8px 18px rgba(163,19,74,.3); margin: 8px 0; text-decoration: none; }
.big:active { transform: translateY(3px); box-shadow: 0 2px 0 #a3134a; }
.big small { display: block; font-size: 12px; font-weight: 600; opacity: .92; margin-top: 3px; }
.big.alt { background: linear-gradient(180deg, #b388ff, #7c4dff); box-shadow: 0 5px 0 #4a2bb0, 0 8px 18px rgba(74,43,176,.3); }
.big.md { background: linear-gradient(180deg, #6f97ff, #3f74ff); box-shadow: 0 5px 0 #1f47b8; }
.big.wa { background: linear-gradient(180deg, #4be07d, #1fa855); box-shadow: 0 5px 0 #127a3b; }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.row .big { flex: 1; }
.label { margin: 10px 0 0; font-weight: 700; font-size: 14px; }
.join input { flex: 1; min-width: 0; font: inherit; font-size: 26px; font-weight: 900; letter-spacing: 8px; text-align: center; text-transform: uppercase; border-radius: 16px; border: 3px solid var(--pink2); padding: 8px; margin: 8px 0; color: var(--rose); background: #fff; }
.code { font-size: 44px; font-weight: 900; letter-spacing: 12px; color: var(--rose); background: #fff; border-radius: 18px; padding: 6px 0 6px 12px; border: 3px dashed var(--pink2); }
.status { min-height: 1.3em; font-weight: 700; color: #7c4dff; margin: 8px 0 2px; }
.status.err { color: #d50000; }
.status.ok { color: #1a9a4b; }
ul.how { text-align: left; padding-left: 20px; margin: 6px 0; line-height: 1.45; font-size: 15px; }
.keys { font-size: 13px; text-align: left; background: rgba(255, 200, 220, .45); border-radius: 12px; padding: 8px 10px; margin: 6px 0; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 12px; }
.lv { border: 0; border-radius: 18px; padding: 10px 6px; background: linear-gradient(180deg, #fff, #ffe1ec); box-shadow: 0 4px 0 #f3a6c4, 0 6px 14px rgba(194,24,91,.15); min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.lv b { font-size: 22px; color: var(--rose); }
.lv span { font-size: 12px; font-weight: 700; line-height: 1.2; }
.lv i { font-style: normal; font-size: 13px; letter-spacing: 1px; }
.lv[disabled] { opacity: .5; filter: grayscale(.6); cursor: not-allowed; }
.hearts { font-size: 34px; letter-spacing: 6px; margin: 2px 0 6px; }
.love { font-size: 17px; font-weight: 700; color: #8e1e52; margin: 6px 0; line-height: 1.35; }
.letter { background: linear-gradient(180deg, rgba(255,250,252,.97), rgba(255,229,239,.97)); }
.rot { font-size: 54px; animation: turn 1.8s ease-in-out infinite; display: inline-block; }
@keyframes turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.18); } }
@media (max-height: 480px) {
  .card { padding: 10px 16px; border-radius: 20px; }
  h1 { font-size: 34px; }
  .sub { margin: 2px 0 4px; font-size: 14px; }
  #duoCanvas { width: 200px; height: 78px; }
  .big { padding: 9px 8px; font-size: 16px; margin: 5px 0; }
  .grid { grid-template-columns: repeat(8, 1fr); gap: 6px; }
  .lv { min-height: 78px; padding: 6px 2px; }
  .lv span { font-size: 10px; }
  .overlay { align-items: flex-start; }
  .code { font-size: 34px; }
  .love { font-size: 15px; margin: 4px 0; }
  .hearts { font-size: 26px; margin: 0 0 2px; }
  h2 { margin: 2px 0 6px; font-size: 20px; }
}
@media (max-width: 560px) { .grid { grid-template-columns: repeat(4, 1fr); } }

/* v2: continue, level sections, easy toggle */
.big.cont { background: linear-gradient(180deg, #ffb74d, #ff7043); box-shadow: 0 5px 0 #c2410c, 0 8px 18px rgba(194,65,12,.3); margin: 6px 0 2px; }
#levels .card.wide { max-height: calc(100dvh - 24px); display: flex; flex-direction: column; }
#lvGrid { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 4px 2px 8px; min-height: 0; }
#levels .overlay, #levels { touch-action: pan-y; }
.lvhead { grid-column: 1 / -1; margin: 6px 0 0; font-weight: 800; color: var(--rose); text-align: left; font-size: 14px; }
.lv.gen { background: linear-gradient(180deg, #fff, #f3e8ff); box-shadow: 0 4px 0 #c9a3f5, 0 6px 14px rgba(124,77,255,.15); }
.lv.fin { background: linear-gradient(180deg, #fff3f8, #ffd0e4); box-shadow: 0 4px 0 #e91e63, 0 6px 14px rgba(233,30,99,.25); }
.lv.cur { outline: 3px solid #ff7043; outline-offset: 2px; }
.lv span { display: block; white-space: normal; line-height: 1.15; max-height: 2.35em; overflow: hidden; max-width: 100%; }
.lv { min-height: 96px; }
.lv:focus-visible, .big:focus-visible { outline: 3px solid #7c4dff; outline-offset: 2px; }
#autoNote { min-height: 1em; margin: 0; }
/* bigger jump hit area: an invisible ring around the round jump buttons */
#game, #hud { touch-action: none; }
@media (max-height: 500px) and (orientation: landscape) {
  .card.hero.has-progress .duo { display: none; }
  .big.cont { padding: 8px 10px; }
  .lv { min-height: 84px; }
}

/* v4: sound controls + zoom */
#zoomBox { position: absolute; right: max(8px, env(safe-area-inset-right)); top: calc(max(6px, env(safe-area-inset-top)) + 50px); display: flex; flex-direction: column; gap: 8px; z-index: 5; }
#zoomBox[hidden] { display: none; }
#zoomBox .hbtn { font-size: 22px; line-height: 1; touch-action: manipulation; }
#hud .chip#lvlName { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; }
#pause .snd { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0; }
#pause .np { margin: 2px 0 6px; font-size: 13px; color: var(--rose); min-height: 1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) { .hbtn { width: 36px; height: 36px; font-size: 15px; } #hud { gap: 5px; } .chip { padding: 5px 10px; font-size: 13px; } #hud .chip#lvlName { max-width: 30vw; } }
@media (max-height: 480px) { #pause .card { padding: 10px 14px; } #pause .big { padding: 7px 8px; font-size: 15px; margin: 4px 0; } #pause .snd { grid-template-columns: 1fr 1fr 1fr; } #pause .snd .ghost { font-size: 13px; padding: 6px 4px; min-height: 36px; } #pause h2 { margin: 2px 0 6px; font-size: 18px; } #zoomBox { top: calc(max(4px, env(safe-area-inset-top)) + 46px); gap: 6px; } }

@media (orientation: portrait) and (max-width: 480px) {
}
@media (orientation: portrait) and (max-width: 340px) {
}
@media (max-height: 360px) { #pause h2 { display: none; } }

/* v5 Light mode: weak phones — no blur behind overlays, no looping CSS animation, flatter shadows */
body.light .overlay { backdrop-filter: none; -webkit-backdrop-filter: none; }
body.light .rot { animation: none; }
body.light .hbtn, body.light .chip, body.light #toast { box-shadow: none; }
#ytWrap { contain: strict; pointer-events: none; }

/* ---------- app install + update (v6) ---------- */
.ghost.install { border-color: #f2b632; color: #8a3a00; background: linear-gradient(180deg, #fffbe6, #ffd76a); box-shadow: 0 3px 0 #d99a1e; font-weight: 800; animation: instGlow 2.4s ease-in-out 3; }
.ghost.install:active { transform: translateY(2px); box-shadow: 0 1px 0 #d99a1e; }
@keyframes instGlow { 0%, 100% { box-shadow: 0 3px 0 #d99a1e; } 50% { box-shadow: 0 3px 0 #d99a1e, 0 0 0 5px rgba(255,215,106,.55); } }
.card.hero { position: relative; }
.ver { position: absolute; right: 14px; bottom: 6px; margin: 0; font-size: 10.5px; color: var(--rose); opacity: .45; pointer-events: none; }
.ver:empty { display: none; }
.pwa-banner { position: absolute; left: 50%; top: max(8px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 40; width: min(460px, 94vw);
  display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.97); border-radius: 18px; padding: 8px 8px 8px 10px; box-shadow: var(--shadow); border: 2px solid #ffd3e4; animation: pbIn .35s ease-out; }
.pwa-banner img { border-radius: 10px; flex: none; }
.pwa-banner p { margin: 0; flex: 1; text-align: left; font-size: 14px; line-height: 1.2; color: var(--ink); }
.pwa-banner p span { display: block; font-size: 12px; opacity: .75; }
.pb-go { border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 800; color: #fff; background: linear-gradient(180deg, #ff6aa8, #e91e63); box-shadow: 0 3px 0 #a3134a; }
@keyframes pbIn { from { transform: translate(-50%, -30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.pwa-sheet { position: absolute; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(74,22,49,.45); overflow-y: auto; }
.pwa-sheet[hidden] { display: none; }
.sheet-card { background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 16px 20px; width: min(400px, 94vw); text-align: center; border: 2px solid #fff; margin: auto; }
.sheet-card img { border-radius: 16px; }
.sheet-card h2 { margin: 6px 0 6px; }
.sheet-card ol { text-align: left; margin: 6px 0; padding-left: 22px; line-height: 1.5; font-size: 15px; }
.sheet-card p { margin: 4px 0; font-size: 15px; }
.sheet-card .ico { font-size: 18px; }
.upd-toast { position: absolute; left: 50%; top: max(10px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.98); color: var(--rose); font-weight: 800; padding: 6px 6px 6px 14px; border-radius: 999px; box-shadow: var(--shadow); border: 2px solid #ffd3e4; white-space: nowrap; font-size: 14px; animation: utIn .3s ease-out; }
.upd-toast[hidden] { display: none; }
.upd-toast #updGo { border: 0; border-radius: 999px; padding: 7px 12px; font-weight: 800; color: #fff; background: linear-gradient(180deg, #ff6aa8, #e91e63); box-shadow: 0 3px 0 #a3134a; }
.upd-toast #updX { border: 0; background: none; color: var(--rose); opacity: .6; font-size: 16px; padding: 4px 6px; }
@keyframes utIn { from { transform: translate(-50%, -20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- v6 ---------- */
#coinChip { color: #9a6d00; }
.credit { margin: 10px 0 0; font-size: 13px; font-weight: 700; color: var(--rose); opacity: .9; }
.credit a { color: var(--rose); text-decoration: underline; }
#appVer { opacity: .6; font-weight: 600; }
#raceBar { position: absolute; top: calc(max(6px, env(safe-area-inset-top)) + 76px); left: max(10px, env(safe-area-inset-left)); width: min(170px, 26vw); background: rgba(255,255,255,.6); border-radius: 12px; padding: 5px 8px; z-index: 5; box-shadow: 0 3px 10px rgba(120,0,60,.2); pointer-events: none; }
#raceBar .lane { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; line-height: 1.5; }
#raceBar .nm { width: 42%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#raceBar .tr { flex: 1; height: 7px; background: rgba(0,0,0,.08); border-radius: 9px; overflow: hidden; }
#raceBar .tr i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(.02); border-radius: 9px; transition: transform .3s linear; }
#hint.big { font-size: 44px; font-weight: 900; padding: 10px 30px; top: 35%; background: rgba(194,24,91,.85); }
.seg { display: flex; gap: 6px; margin: 6px 0; }
.seg button { flex: 1; border: 2px solid rgba(194,24,91,.3); background: rgba(255,255,255,.75); border-radius: 14px; padding: 8px 6px; font-weight: 800; color: var(--rose); font-size: 15px; }
.seg button small { display: block; font-size: 11px; font-weight: 600; opacity: .8; }
.seg button.on { background: linear-gradient(180deg, #ff6aa8, #e91e63); color: #fff; border-color: transparent; }
.seg button:disabled { opacity: .75; }
.seg.small button { padding: 5px 4px; font-size: 13px; }
.slots .slot { flex: 1; min-width: 130px; border: 3px solid #ccc; background: #fff; border-radius: 16px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 800; color: var(--ink); }
.slot small { font-size: 11px; opacity: .75; font-weight: 600; }
.slot.add { border-style: dashed; color: var(--rose); opacity: .85; }
.dot { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 12px; align-items: center; justify-content: center; text-shadow: 0 1px 1px rgba(0,0,0,.3); box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.sw { width: 74px; height: 64px; border-radius: 16px; border: 3px solid #fff; color: #fff; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(0,0,0,.18); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.sw span { font-size: 20px; }
.sw small { font-size: 10px; font-weight: 700; line-height: 1.1; }
.sw.on { outline: 4px solid var(--ink); outline-offset: 1px; transform: scale(1.06); }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.mood { border: 2px solid rgba(194,24,91,.3); background: rgba(255,255,255,.8); border-radius: 16px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; color: var(--rose); }
.mood span { font-size: 28px; }
.mood.on { background: linear-gradient(180deg, #ff6aa8, #e91e63); color: #fff; border-color: transparent; }
.np { min-height: 1.2em; font-size: 13px; font-weight: 700; color: #7c4dff; }
.roomrow { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.roomrow .code { font-size: 30px; letter-spacing: 8px; padding: 2px 4px 2px 12px; }
.ghost.wa { text-decoration: none; background: #25d366; color: #fff; border-color: #1fa855; }
.lobby { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.lp { border: 3px solid #ddd; background: #fff; border-radius: 14px; padding: 5px 8px; display: flex; align-items: center; gap: 6px; text-align: left; flex-wrap: wrap; }
.lp b { font-size: 15px; }
.lp small { font-size: 11px; opacity: .75; width: 100%; padding-left: 28px; margin-top: -4px; }
.lp .tm { font-size: 10px; font-weight: 900; background: #3d7bff; color: #fff; border-radius: 8px; padding: 1px 6px; margin-left: auto; }
.lp .tm.b { background: #ff6a14; }
#lobbyLevel { min-width: 110px; }
ol.ranks { list-style: none; padding: 0; margin: 8px 0; }
ol.ranks li { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 7px 10px; margin: 5px 0; font-size: 15px; box-shadow: 0 2px 6px rgba(120,0,60,.12); }
ol.ranks .md { font-size: 22px; width: 30px; }
ol.ranks b { flex: 1; text-align: left; }
ol.ranks .t { font-size: 12px; opacity: .75; }
ol.ranks .cn { font-weight: 900; color: #9a6d00; min-width: 52px; text-align: right; }
.card.demo { width: min(460px, 96vw); }
#demoCanvas { width: 100%; max-width: 360px; height: auto; aspect-ratio: 360 / 190; border-radius: 16px; display: block; margin: 0 auto; box-shadow: inset 0 0 0 2px rgba(194,24,91,.2); }
.ghost.install { background: linear-gradient(180deg, #4be07d, #1fa855); color: #fff; border-color: #127a3b; }
@media (max-height: 420px) { .card { padding: 10px 14px; } h1 { font-size: 30px; } #duoCanvas { height: 80px; width: 204px; } .big { padding: 8px 8px; font-size: 16px; margin: 5px 0; } .sub { margin: 0 0 4px; font-size: 14px; } .ghost { padding: 5px 11px; font-size: 13px; margin: 2px; } .lobby { grid-template-columns: 1fr 1fr 1fr 1fr; } .mgrid { grid-template-columns: repeat(6, 1fr); } }

/* ================= v6.1: one button system, icons, settings, new flow, robust touch pad ================= */
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.ic.huge { width: 64px; height: 64px; color: var(--rose); }
.hbtn { display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.hbtn .ic { width: 20px; height: 20px; }
.chip { display: inline-flex; align-items: center; gap: 5px; }
.chip .ic { width: 17px; height: 17px; }
.chip.coin .ic { color: #c98a00; }

/* every button on every screen = this one shape (same height, radius, font) */
.btn, .tile, .seg button, .mood, .set { font: inherit; -webkit-appearance: none; appearance: none; }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; margin: 8px 0 0;
  padding: 10px 16px; border-radius: 16px; border: 2px solid rgba(194,24,91,.28); background: #fff; color: var(--rose);
  font-size: 17px; font-weight: 800; text-decoration: none; box-shadow: 0 3px 0 rgba(194,24,91,.22); line-height: 1.1; }
.btn .ic { width: 22px; height: 22px; }
.btn:active, .tile:active, .seg button:active, .mood:active, .set:active { transform: translateY(2px); box-shadow: none; }
.btn.primary { color: #fff; border-color: transparent; background: linear-gradient(180deg, #ff6aa8, #e91e63); box-shadow: 0 4px 0 #a3134a; }
.btn.gold { color: #6b3a00; border-color: transparent; background: linear-gradient(180deg, #ffe58a, #ffc233); box-shadow: 0 4px 0 #c98a00; }
.btn.xl { min-height: 64px; font-size: 22px; letter-spacing: 2px; }
.btn.xl .ic { width: 26px; height: 26px; }
.btn.sq { width: 54px; flex: none; padding: 0; margin: 0; }
.btn[disabled] { opacity: .5; }
.btn:focus-visible, .tile:focus-visible, .set:focus-visible, .seg button:focus-visible { outline: 3px solid #7c4dff; outline-offset: 2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 > [hidden] { display: none; }
.row2:has(> [hidden]) { grid-template-columns: 1fr; }
.lvrow { align-items: center; margin-top: 8px; }
.lvrow .chip { font-size: 16px; padding: 10px 16px; }

/* choice tiles (Khud khelo / Versus / Solo / Co-op / 1v1 ...) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 120px; padding: 12px 8px;
  border-radius: 18px; border: 2px solid rgba(194,24,91,.28); background: #fff; color: var(--rose); box-shadow: 0 4px 0 rgba(194,24,91,.22); }
.tile .ic { width: 38px; height: 38px; }
.tile b { font-size: 19px; }
.tile small { font-size: 12px; font-weight: 700; opacity: .8; color: var(--ink); }
.tile.on { color: #fff; background: linear-gradient(180deg, #ff6aa8, #e91e63); border-color: transparent; box-shadow: 0 4px 0 #a3134a; }
.tile.on small { color: #fff; }
.tiles.four .tile { min-height: 92px; }
.tiles.four .tile .ic { width: 28px; height: 28px; }

/* segmented choice, same height as buttons */
.seg { display: flex; gap: 8px; margin: 10px 0 0; }
.seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 54px; margin: 0; padding: 6px 8px; border-radius: 16px;
  border: 2px solid rgba(194,24,91,.28); background: #fff; color: var(--rose); font-size: 16px; font-weight: 800; box-shadow: 0 3px 0 rgba(194,24,91,.22); }
.seg button .ic { width: 20px; height: 20px; }
.seg button.on { color: #fff; background: linear-gradient(180deg, #ff6aa8, #e91e63); border-color: transparent; box-shadow: 0 3px 0 #a3134a; }
.seg[hidden] { display: none; }

/* settings rows: icon, label, switch */
.setlist { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.set { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 14px; border-radius: 16px; border: 2px solid rgba(194,24,91,.2);
  background: #fff; color: var(--ink); font-size: 16px; font-weight: 700; text-align: left; box-shadow: 0 3px 0 rgba(194,24,91,.15); }
.set .ic { width: 22px; height: 22px; color: var(--rose); }
.set span { flex: 1; }
.set .sw { all: unset; flex: none; width: 46px; height: 26px; border-radius: 999px; background: #e7c9d6; position: relative; transition: background .15s; }
.set .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.set[aria-pressed="true"] .sw { background: #e91e63; }
.set[aria-pressed="true"] .sw::after { left: 23px; }
#settings h2 .ic, #players h2 .ic { color: var(--rose); }

/* mood chips inside settings: same family as buttons */
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0; }
.mood { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 6px 4px; border-radius: 16px;
  border: 2px solid rgba(194,24,91,.28); background: #fff; color: var(--rose); font-weight: 800; font-size: 14px; box-shadow: 0 3px 0 rgba(194,24,91,.22); }
.mood .ic { width: 24px; height: 24px; }
.mood.on { color: #fff; background: linear-gradient(180deg, #ff6aa8, #e91e63); border-color: transparent; box-shadow: 0 3px 0 #a3134a; }

/* player setup cards */
.plcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 8px 0 2px; }
.pcard { background: #fff; border: 3px solid #ddd; border-radius: 18px; padding: 10px; text-align: left; }
.pcard .ph { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pcard .ph canvas { flex: none; width: 64px; height: 64px; }
.pcard .ph b { font-size: 15px; color: var(--ink); flex: 1; }
.pcard .ph .coins { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13px; color: #9a6d00; }
.pcard .ph .coins .ic { width: 16px; height: 16px; color: #c98a00; }
.pcard .swap { width: 44px; min-height: 44px; margin: 0; padding: 0; flex: none; }
.modeline { margin: -4px 0 4px; font-weight: 800; color: var(--ink); font-size: 14px; }

/* player symbol dots (circle, diamond, triangle, star) */
.dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; flex: none; }
.dot .ic { width: 14px; height: 14px; }
.ranks .md { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border-radius: 50%; background: #eee; color: var(--ink); font-weight: 900; font-size: 14px; }
.ranks .md.p1 { background: #ffc233; color: #6b3a00; } .ranks .md.p2 { background: #d6dbe4; } .ranks .md.p3 { background: #f0b48a; color: #6b2f00; }
.ranks .cn { display: inline-flex; align-items: center; gap: 3px; } .ranks .cn .ic { width: 15px; height: 15px; color: #c98a00; }
.lv i .ic { width: 14px; height: 14px; color: #e91e63; } .lv i .ic.off { color: #e5c2d1; }
.lv i { display: inline-flex; gap: 1px; align-items: center; justify-content: center; }
.lvhead { display: flex; align-items: center; gap: 6px; }
.upd-toast #updGo { display: inline-flex; align-items: center; gap: 6px; }
.upd-toast #updGo .ic, .upd-toast #updX .ic { width: 18px; height: 18px; }
#hint .ic { width: 16px; height: 16px; }
.rot { margin: 4px 0; }

/* ---------- on-screen controls (shown with body.pad-on while playing) ---------- */
#touch { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 12; transition: none; animation: none; }
body.pad-on #touch { display: block; }
#touch .side { position: absolute; bottom: 12px; bottom: max(12px, env(safe-area-inset-bottom)); top: 0; width: 50%; pointer-events: none; }
#touch .side.p0 { left: 0; }
#touch .side.p1 { right: 0; }
#touch .side.hidden { display: none; }
#touch .tb { position: absolute; bottom: 0; width: 72px; height: 72px; padding: 0; margin: 0; border-radius: 22px; border: 3px solid rgba(255,255,255,.95);
  pointer-events: auto; touch-action: none; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: .82; background: rgba(61,123,255,.72); box-shadow: 0 3px 10px rgba(60,0,40,.25); -webkit-user-select: none; user-select: none; }
#touch .tb .ic { width: 34px; height: 34px; stroke-width: 3; }
#touch .tb small { font-size: 10px; font-weight: 900; letter-spacing: .5px; margin-top: -2px; }
#touch .tb.on { transform: scale(.92); opacity: 1; filter: brightness(1.15); }
#touch .tb.j { width: 84px; height: 84px; border-radius: 50%; }
#touch .tb.j::after { content: ''; position: absolute; top: -14px; left: -14px; right: -14px; bottom: -14px; border-radius: 50%; }
#touch .p0 .l { left: 16px; left: max(16px, env(safe-area-inset-left)); }
#touch .p0 .r { left: 100px; left: calc(max(16px, env(safe-area-inset-left)) + 84px); }
#touch .p0 .j { left: 196px; left: calc(max(16px, env(safe-area-inset-left)) + 180px); }
#touch .p1 .r { right: 16px; right: max(16px, env(safe-area-inset-right)); }
#touch .p1 .l { right: 100px; right: calc(max(16px, env(safe-area-inset-right)) + 84px); }
#touch .p1 .j { right: 196px; right: calc(max(16px, env(safe-area-inset-right)) + 180px); }
#touch .tag { position: absolute; bottom: 92px; font-weight: 900; font-size: 13px; color: #fff; padding: 2px 10px; border-radius: 999px; background: rgba(0,0,0,.35); white-space: nowrap; }
#touch .p0 .tag { left: 16px; left: max(16px, env(safe-area-inset-left)); }
#touch .p1 .tag { right: 16px; right: max(16px, env(safe-area-inset-right)); }
/* one player on this phone: arrows left, jump right, full width */
#touch.solo .side { width: 100%; }
#touch.solo .side .j { left: auto; right: 22px; right: max(22px, env(safe-area-inset-right)); }
#touch.solo .side .l { left: 16px; left: max(16px, env(safe-area-inset-left)); right: auto; }
#touch.solo .side .r { left: 100px; left: calc(max(16px, env(safe-area-inset-left)) + 84px); right: auto; }
#touch.solo .side .tag { left: 16px; left: max(16px, env(safe-area-inset-left)); right: auto; }
/* short landscape screens */
@media (max-height: 380px) {
  #touch .tb { width: 64px; height: 64px; } #touch .tb.j { width: 72px; height: 72px; } #touch .tb .ic { width: 30px; height: 30px; }
  #touch .p0 .r { left: calc(max(16px, env(safe-area-inset-left)) + 74px); } #touch .p0 .j { left: calc(max(16px, env(safe-area-inset-left)) + 160px); }
  #touch .p1 .l { right: calc(max(16px, env(safe-area-inset-right)) + 74px); } #touch .p1 .j { right: calc(max(16px, env(safe-area-inset-right)) + 160px); }
  #touch.solo .side .r { left: calc(max(16px, env(safe-area-inset-left)) + 74px); }
  #touch .tag { bottom: 80px; }
}
/* portrait (rotate skipped): two players share the bottom, smaller pads */
@media (orientation: portrait) {
  #touch:not(.solo) .tb { width: 50px; height: 50px; border-radius: 15px; } #touch:not(.solo) .tb.j { width: 56px; height: 56px; }
  #touch:not(.solo) .tb .ic { width: 24px; height: 24px; } #touch:not(.solo) .tb small { display: none; }
  #touch:not(.solo) .p0 .l { left: 8px; } #touch:not(.solo) .p0 .r { left: 62px; } #touch:not(.solo) .p0 .j { left: 118px; }
  #touch:not(.solo) .p1 .r { right: 8px; } #touch:not(.solo) .p1 .l { right: 62px; } #touch:not(.solo) .p1 .j { right: 118px; }
  #touch:not(.solo) .tag { bottom: 64px; }
}
@media (orientation: portrait) and (max-width: 350px) {
  #touch:not(.solo) .tb { width: 46px; height: 46px; } #touch:not(.solo) .tb.j { width: 50px; height: 50px; }
  #touch:not(.solo) .p0 .r { left: 58px; } #touch:not(.solo) .p0 .j { left: 108px; }
  #touch:not(.solo) .p1 .l { right: 58px; } #touch:not(.solo) .p1 .j { right: 108px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .card { padding: 12px 16px; } h2 { font-size: 21px; margin: 2px 0 6px; }
  .tile { min-height: 96px; } .btn { min-height: 50px; margin-top: 6px; } .seg button { min-height: 50px; }
  .card.hero .duo { display: none; }
}


.lv i .ic.off { color: #e5c2d1; }

.row.join { flex-wrap: nowrap; align-items: stretch; margin-top: 6px; }
.row.join .btn { width: auto; flex: none; margin: 0; padding: 0 18px; }

/* v6.15 intro splash */
#splash { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(160deg, #ffd1e1 0%, #ffb6cf 55%, #ff9fc3 100%); transition: opacity .4s ease; cursor: pointer; }
#splash.out { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s ease, visibility 0s linear .3s; }   /* v6.19: never left half-visible under home */
#splash .sp-in { animation: spIn .5s ease-out both; padding: 16px; }
#splash .sp-title { font-size: clamp(44px, 12vw, 92px); font-weight: 900; letter-spacing: 3px; line-height: 1; color: #c2185b; text-shadow: 0 3px 0 #fff; }
#splash .sp-tag { margin-top: 12px; font-size: clamp(17px, 4.2vw, 26px); font-weight: 700; color: #6a1b4d; }
#splash .sp-sub { margin-top: 6px; font-size: clamp(13px, 3vw, 17px); font-weight: 600; color: #8e3b6b; opacity: .85; }
#splash .sp-rope { width: min(240px, 60vw); height: auto; margin-bottom: 10px; }
#splash .sp-rope circle { fill: #c2185b; }
#splash .sp-rope path { fill: none; stroke: #c2185b; stroke-width: 4; stroke-linecap: round; }
@keyframes spIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* v6.17: quick music mute on the home screen (top right) + bigger tap area for the in-game one */
#homeMusic { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); right: calc(10px + env(safe-area-inset-right, 0px)); width: 48px; height: 48px; z-index: 30; touch-action: manipulation; }
#homeMusic .ic { width: 24px; height: 24px; }
#homeMusic[aria-pressed="false"], #hudMusic[aria-pressed="false"] { color: #8a7a85; }
#hudMusic { position: relative; }
#hudMusic::after { content: ''; position: absolute; inset: -4px; }

/* v6.17: lobby slots */
.lp.empty { border: 3px dashed #d9c3d0; background: rgba(255,255,255,.6); color: #9a8592; animation: lpPulse 1.6s ease-in-out infinite; }
.lp.empty .dot { background: #eadbe3; }
.lp .dot .ic { width: 16px; height: 16px; color: #fff; }
.lp .tm.host { background: #8a2be2; }
.lp.pop { animation: lpPop .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes lpPulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes lpPop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.lobby.teams { grid-template-columns: 1fr 1fr; }
.tgrp { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.tgrp > .tm { align-self: flex-start; font-size: 11px; font-weight: 900; background: #3d7bff; color: #fff; border-radius: 8px; padding: 1px 8px; }
.tgrp > .tm.b { background: #ff6a14; }
#lvLabel { margin: 6px 0 0; }
#lvHint { margin: 2px 0 4px; }
.lvrow .btn.sq:disabled { opacity: .35; }

/* v6.18 coin wallet + coin history */
.wallet { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: calc(10px + env(safe-area-inset-left, 0px)); z-index: 30; display: flex; align-items: center; gap: 6px; height: 44px; min-width: 44px; padding: 0 14px 0 6px; border-radius: 22px; border: 2px solid #e8b100; background: linear-gradient(180deg, #fff8dc, #ffe9a3); color: #6b4a00; font: 900 19px/1 system-ui, sans-serif; box-shadow: 0 3px 10px rgba(120, 70, 0, .22); cursor: pointer; touch-action: manipulation; }
.wallet[hidden] { display: none; }
.wallet .gcoin { width: 30px; height: 30px; flex: none; }
.wallet:active { transform: scale(.95); }
.chist { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 10px; background: rgba(60, 20, 40, .35); }
.chist[hidden] { display: none; }
.chist .card { width: min(460px, 100%); max-height: calc(100% - 8px); display: flex; flex-direction: column; overflow: hidden; }
.chist h2 { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 6px; }
.chist h2 .gcoin { width: 28px; height: 28px; }
.chtabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.chtabs:empty { display: none; }
.chtabs button { border: 2px solid #e5d3dc; background: #fff; border-radius: 14px; padding: 4px 12px; font-weight: 800; font-size: 14px; color: #6b4a5a; }
.chtabs button.on { background: #ffe9a3; border-color: #e8b100; color: #6b4a00; }
.chbal { margin: 6px 0; font-size: 15px; }
.chbal b { font-size: 22px; color: #b07a00; }
.chlist { flex: 1 1 auto; overflow-y: auto; text-align: left; margin-bottom: 8px; min-height: 60px; -webkit-overflow-scrolling: touch; }
.chday { border: 2px solid #f0e2e8; border-radius: 12px; margin: 0 0 6px; background: #fff; }
.chday summary, .chsum { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-weight: 800; font-size: 15px; cursor: pointer; list-style: none; }
.chday summary::-webkit-details-marker { display: none; }
.chday summary::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 4px 2px 2px; border: solid #b08a9a; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform var(--dur-fast, 160ms) var(--ease-out, ease-out); }
.chday[open] summary::before { transform: rotate(45deg); }
.chday summary small, .chsum small { font-weight: 600; opacity: .6; font-size: 12px; margin-right: auto; }
.chrow { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 26px; border-top: 1px solid #f5ecf0; font-size: 14px; }
.chrow small { opacity: .6; min-width: 62px; font-size: 12px; }
.chrow span:not(.amt) { margin-right: auto; }
.chsum { border: 2px solid #f0e2e8; border-radius: 12px; margin: 0 0 6px; background: rgba(255, 255, 255, .8); cursor: default; }
.chhead { margin: 10px 2px 4px; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #9a7a8a; }
.amt { font-weight: 900; font-variant-numeric: tabular-nums; }
.amt.pos { color: #1e9e4a; }
.amt.neg { color: #d93a4a; }
.amt + .amt { margin-left: 6px; }
.chempty { text-align: center; opacity: .7; padding: 14px 0; }
/* v6.18 lobby: cards sized to the mode */
.lobby.sized { display: flex; gap: 8px; align-items: stretch; justify-content: center; }
.lobby.sized > .lp, .lobby.sized > .tgrp { flex: 1 1 0; min-width: 0; }
.lobby.sized .lp { padding: 10px 12px; min-height: 58px; }
.lobby.n2 .lp { min-height: 76px; padding: 12px 16px; }
.lobby.n2 .lp b { font-size: 19px; }
.lobby.n2 .lp .dot { width: 34px; height: 34px; }
.lobby.n2 .lp .dot .ic { width: 22px; height: 22px; }
.lobby.n2 .lp small { font-size: 13px; padding-left: 40px; }
.lobby .vsm { flex: none; align-self: center; font: 900 22px/1 system-ui, sans-serif; color: #e91e63; text-shadow: 0 2px 0 #fff; padding: 0 2px; }
@media (orientation: portrait) and (max-width: 520px) {
  .lobby.n3, .lobby.n4 { flex-wrap: wrap; }
  .lobby.n3 > .lp, .lobby.n4 > .lp { flex: 1 1 40%; }
  .lobby.nteams { flex-direction: column; }
  .lobby.nteams .vsm { font-size: 18px; }
}

/* v6.19 volume sliders */
.vol { display: grid; grid-template-columns: auto 1fr 3.2em; align-items: center; gap: 10px; padding: 2px 14px 6px 48px; margin-top: -2px; font-size: .86em; color: #7a3b57; }
.vol label { white-space: nowrap; }
.vol output { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: #c2185b; }
.vol.muted output { color: #a98898; font-weight: 600; font-size: .9em; }
.vol input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: 0; touch-action: pan-y; --p: 70%; }
.vol input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, #e91e63 0, #e91e63 var(--p), #f0d5e0 var(--p)); }
.vol input[type=range]::-moz-range-track { height: 8px; border-radius: 999px; background: #f0d5e0; }
.vol input[type=range]::-moz-range-progress { height: 8px; border-radius: 999px; background: #e91e63; }
.vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%; background: #fff; border: 3px solid #e91e63; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.vol input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #e91e63; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.vol.muted input[type=range] { opacity: .5; }
.vol input[type=range]:focus-visible { outline: 3px solid #7c4dff; outline-offset: 2px; border-radius: 8px; }

/* v6.19 unique colours: a colour another player has is locked */
.lcols .col.taken { opacity: .38; filter: saturate(.55); position: relative; cursor: not-allowed; box-shadow: none; }
.col .who { position: absolute; right: 3px; bottom: 2px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: rgba(255,255,255,.95); color: #5a2a40; font: 800 11px/16px system-ui, sans-serif; font-style: normal; }
.lcols { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; font-weight: 700; color: var(--ink); font-size: 15px; }
.lcols[hidden] { display: none; }
.lcols .cols { display: flex; gap: 8px; flex: 1; }
.lcols .col { flex: 1; min-height: 44px; max-width: 70px; border-radius: 14px; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.08); display: flex; align-items: center; justify-content: center; color: #fff; padding: 0; margin: 0; position: relative; }
.lcols .col .ic { width: 20px; height: 20px; }
.lcols .col.on { box-shadow: 0 0 0 3px var(--ink); }

/* v6.19 install nudge */
.pb-no { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--rose); opacity: .75; padding: 8px 6px; white-space: nowrap; }
#installBtn span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
#installBtn .isub { font-size: 11px; font-weight: 600; opacity: .85; }

/* v6.19 bottom ad banner (only when ads are switched on in ads-config.js) */
.ad-banner { position: fixed; left: 50%; bottom: env(safe-area-inset-bottom, 0); transform: translateX(-50%); z-index: 60; width: 320px; height: 50px; background: rgba(255,255,255,.6); border-radius: 8px 8px 0 0; overflow: hidden; }
.ad-banner[hidden] { display: none; }
body.ad-banner-on .overlay { padding-bottom: 58px; }

/* v6.19 backup / restore */
.savebtns { display: flex; gap: 8px; flex-wrap: wrap; }
.savebtns .btn { flex: 1 1 140px; margin: 4px 0; }
.savebox { margin: 6px 0 4px; padding: 10px; border-radius: 14px; background: #fff6fa; border: 2px solid rgba(194,24,91,.18); }
.savebox[hidden] { display: none; }
.savebox textarea { width: 100%; box-sizing: border-box; font: 12px/1.35 ui-monospace, Menlo, monospace; border-radius: 10px; border: 2px solid rgba(194,24,91,.25); padding: 8px; resize: vertical; word-break: break-all; background: #fff; color: var(--ink); }

/* v6.19 coin pill count-up bump */
@keyframes walletBump { 0% { transform: scale(1); } 30% { transform: scale(1.14); } 60% { transform: scale(.97); } 100% { transform: scale(1); } }
@keyframes coinSpinY { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }
.wallet.bump { animation: walletBump .55s ease-out; }
.wallet.bump .gcoin { animation: coinSpinY .7s ease-in-out; }
.wallet.up b { color: #2e9d4f; } .wallet.down b { color: #c62828; }
.wallet b { transition: color .3s; font-variant-numeric: tabular-nums; }

/* v6.19 logo ("Four friends") */
#title.logo { margin: 0 0 2px; line-height: 0; text-shadow: none; }
#title.logo img { display: block; width: auto; height: clamp(70px, 19vh, 132px); max-width: 100%; margin: 0 auto; object-fit: contain; }
@media (max-height: 420px) { #title.logo img { height: 66px; } }
#splash .sp-logo { display: block; width: min(560px, 82vw); height: auto; margin: 0 auto; filter: drop-shadow(0 4px 0 rgba(255,255,255,.6)); }


/* ===================== v6.21: one font + pro home screen ===================== */
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fonts/fredoka-latin.woff2) format('woff2'); }
html, body, button, input, textarea, select { font-family: 'Fredoka', "Trebuchet MS", system-ui, -apple-system, Roboto, sans-serif; }
.wallet { font-family: 'Fredoka', system-ui, sans-serif; font-weight: 700; }
/* smooth screen changes + button presses (all screens) */
.overlay.show { animation: ovIn .2s ease-out; }
.overlay.show > .card { animation: cardIn .26s cubic-bezier(.2,.9,.3,1.2); }
@keyframes ovIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.btn, .tile, .mode, .ibtn, .pchip, .playbtn, .instpill, .wallet { transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; }
.btn:active, .tile:active { transform: translateY(2px) scale(.98); }

/* home layout */
#menu.home { flex-direction: column; align-items: stretch; justify-content: flex-start; overflow-x: hidden; overflow-y: auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px)); }
body.ad-banner-on #menu.home { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
.home-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 52px; }
.home-top-r { display: flex; gap: 8px; flex: none; }
.pchip { display: flex; align-items: center; gap: 8px; height: 52px; padding: 3px 16px 3px 3px; max-width: calc(100vw - 260px); min-width: 0;
  border-radius: 26px; border: 2px solid #fff; background: rgba(255,255,255,.94); color: var(--ink); box-shadow: 0 4px 0 rgba(194,24,91,.16), 0 8px 18px rgba(140,20,70,.16); touch-action: manipulation; }
.pchip canvas { width: 44px; height: 44px; border-radius: 50%; flex: none; background: radial-gradient(circle at 50% 35%, #fff 0%, #ffd6e6 60%, #ffb6cf 100%); box-shadow: inset 0 0 0 2px rgba(194,24,91,.18); }
.pc-t { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.05; }
.pc-t b { font-size: 16px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-t small { font-size: 12px; font-weight: 500; color: var(--rose); }
.ibtn { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border-radius: 16px; border: 2px solid #fff;
  background: rgba(255,255,255,.94); color: var(--rose); box-shadow: 0 4px 0 rgba(194,24,91,.16), 0 8px 18px rgba(140,20,70,.16); touch-action: manipulation; }
.ibtn .ic { width: 24px; height: 24px; }
#menu #homeMusic { position: static; width: 48px; height: 48px; }
.ibtn:active, .pchip:active { transform: translateY(2px) scale(.96); box-shadow: 0 2px 0 rgba(194,24,91,.16), 0 4px 10px rgba(140,20,70,.14); }
/* coin pill sits in the top bar on home, left of settings + mute */
body[data-scr="menu"] .wallet { top: calc(14px + env(safe-area-inset-top, 0px)); left: auto; right: calc(124px + env(safe-area-inset-right, 0px)); }

.home-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 2.4vh, 24px); padding: 6px 0; }
.home-brand { display: flex; flex-direction: column; align-items: center; min-width: 0; }
#menu .logo { margin: 0; line-height: 0; }
#menu .logo img { display: block; width: min(520px, 88vw); height: auto; max-height: 28vh; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(140,20,70,.22)); }
#menu .sub { margin: 6px 0 0; padding: 5px 14px; border-radius: 999px; background: rgba(255,255,255,.8); color: var(--rose); font-size: 14px; font-weight: 600; letter-spacing: .2px; box-shadow: 0 3px 10px rgba(140,20,70,.12); }
#menu .duo { margin: 4px 0 0; }
#menu #duoCanvas { width: 230px; height: 90px; }
.home-act { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(440px, 100%); }

.playbtn { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; width: min(340px, 84vw); height: 72px; padding: 0 24px;
  border-radius: 24px; border: 3px solid #fff; color: #fff; background: linear-gradient(180deg, #ffd84a 0%, #ffa51f 55%, #ff8a1f 100%);
  font-size: 32px; font-weight: 700; letter-spacing: 3px; text-shadow: 0 2px 0 rgba(150,60,0,.55);
  box-shadow: 0 6px 0 #c25a00, 0 12px 24px rgba(194,90,0,.35); touch-action: manipulation; animation: playPulse 2.2s ease-in-out infinite; }
.playbtn .ic { width: 30px; height: 30px; filter: drop-shadow(0 2px 0 rgba(150,60,0,.55)); }
.playbtn::after { content: ''; position: absolute; inset: 4px 10px auto; height: 38%; border-radius: 18px 18px 40px 40px; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0)); pointer-events: none; }
.playbtn:active { animation: none; transform: translateY(5px) scale(.98); box-shadow: 0 1px 0 #c25a00, 0 4px 10px rgba(194,90,0,.3); }
@keyframes playPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.mode { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 96px; padding: 10px 4px 9px; min-width: 0;
  border-radius: 20px; border: 2px solid #fff; background: rgba(255,255,255,.94); color: var(--ink);
  box-shadow: 0 4px 0 rgba(194,24,91,.16), 0 8px 18px rgba(140,20,70,.16); touch-action: manipulation; }
.mode:active { transform: translateY(3px) scale(.97); box-shadow: 0 1px 0 rgba(194,24,91,.16), 0 4px 10px rgba(140,20,70,.14); }
.mode .mi { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.mode .mi .ic { width: 24px; height: 24px; }
.mode b { font-size: 15px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.mode small { font-size: 12px; font-weight: 500; color: #a0577a; line-height: 1; }
.instpill { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 18px 6px 14px; border-radius: 999px; border: 2px solid #fff;
  background: linear-gradient(180deg, #fff3c4, #ffd76a); color: #6b3a00; box-shadow: 0 4px 0 #d99a1e, 0 8px 16px rgba(194,120,0,.2); touch-action: manipulation; }
.instpill .ic { width: 22px; height: 22px; }
.instpill span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; font-size: 15px; font-weight: 700; }
.instpill .isub { font-size: 11px; font-weight: 500; opacity: .85; }
.instpill:active { transform: translateY(3px); box-shadow: 0 1px 0 #d99a1e; }
.home-foot { flex: none; text-align: center; }
#menu .credit { margin: 0; font-size: 12px; font-weight: 500; opacity: .85; }
body.ad-banner-on .home-foot { display: none; }

/* narrow phones */
@media (max-width: 380px) {
  .mode b { font-size: 13.5px; } .mode small { font-size: 11px; } .modes { gap: 8px; }
  .pc-t small { display: none; } .pchip { padding-right: 12px; }
}
@media (orientation: portrait) and (max-height: 720px) { #menu #duoCanvas { width: 184px; height: 72px; } #menu .logo img { max-height: 24vh; } }
@media (orientation: portrait) and (max-height: 600px) { #menu .duo { display: none; } }
/* landscape phones: logo left, actions right */
@media (orientation: landscape) and (max-height: 540px) {
  .home-main { flex-direction: row; justify-content: center; gap: 5vw; }
  .home-brand { flex: 0 1 auto; max-width: 46vw; }
  #menu .logo img { width: min(400px, 42vw); max-height: 40vh; }
  #menu #duoCanvas { width: 200px; height: 78px; }
  .home-act { width: min(380px, 46vw); gap: 12px; }
  .playbtn { width: 100%; height: 64px; font-size: 28px; }
  .mode { min-height: 86px; }
  .home-top { height: 50px; }
}
@media (orientation: landscape) and (max-height: 400px) {
  #menu .sub { font-size: 12px; padding: 4px 12px; }
  .mode { min-height: 78px; padding: 7px 4px; } .mode .mi { width: 38px; height: 38px; } .mode small { display: none; }
  .home-main { gap: 4vw; }
}
body.ad-banner-on #menu .duo { display: none; }
/* desktop / big screens */
@media (min-width: 900px) and (min-height: 600px) {
  .playbtn { height: 78px; font-size: 34px; width: 360px; }
  .home-act { width: 460px; }
  .mode { min-height: 104px; }
  .mode b { font-size: 16px; }
  .mode:hover, .ibtn:hover, .pchip:hover { filter: brightness(1.03); transform: translateY(-2px); }
  .playbtn:hover { filter: brightness(1.05); }
}
@media (prefers-reduced-motion: reduce) { .playbtn { animation: none; } .overlay.show, .overlay.show > .card { animation: none; } }

@media (max-width: 400px) {
  .ibtn, #menu #homeMusic { width: 44px; height: 44px; border-radius: 14px; } .home-top-r { gap: 6px; }
  body[data-scr="menu"] .wallet { right: calc(112px + env(safe-area-inset-right, 0px)); top: calc(12px + env(safe-area-inset-top, 0px)); padding-right: 11px; }
  .pchip { max-width: calc(100vw - 232px); padding-right: 10px; gap: 6px; height: 48px; } .pchip canvas { width: 40px; height: 40px; }
}
@media (orientation: landscape) and (max-height: 540px) { .mode b { font-size: 14px; } }

/* ===================== v6.23: big game home (illustrated mode cards, side buttons, tab bar) + tab pages ===================== */
#menu.home::before, .tabpage::before { content: ''; position: fixed; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='56' viewBox='0 0 64 56'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M0 14c8-7 16-7 16 0s8 7 16 0 8-7 16 0 8 7 16 0'/%3E%3Cpath d='M0 14c8 7 16 7 16 0s8-7 16 0 8 7 16 0 8-7 16 0' opacity='.6'/%3E%3Cpath d='M-16 42c8-7 16-7 16 0s8 7 16 0 8-7 16 0 8 7 16 0 8-7 16 0'/%3E%3Cpath d='M-16 42c8 7 16 7 16 0s8-7 16 0 8 7 16 0 8-7 16 0 8 7 16 0' opacity='.6'/%3E%3C/g%3E%3C/svg%3E"); background-size: 64px 56px; opacity: .16; pointer-events: none; z-index: 0; transform: rotate(-8deg) scale(1.3); }
#menu.home > *, .tabpage > * { position: relative; z-index: 1; }
body.tabs-on #menu.home { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
body.tabs-on .home-foot { display: none; }
body.tabs-on .overlay:not(#menu) { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
body.tabs-on.ad-banner-on #menu.home { padding-bottom: calc(126px + env(safe-area-inset-bottom, 0px)); }
.home-main { position: relative; }
#menu .logo img { width: min(500px, calc(100vw - 172px)); max-height: 20vh; }
.home-act { width: min(460px, 100%); gap: 14px; }
.playbtn { width: min(360px, calc(100vw - 172px)); height: 66px; }

/* 2 x 2 illustrated cards with a thick gold 3D frame */
.mcards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.mcard { position: relative; display: flex; flex-direction: column; padding: 0; aspect-ratio: 1.28; min-width: 0; min-height: 0; overflow: hidden; border-radius: 22px; border: 4px solid transparent; color: #fff;
  background: linear-gradient(#ffe9f2, #ffe9f2) padding-box, linear-gradient(180deg, #fff7c9 0%, #ffd84a 30%, #f2a900 68%, #b86f00 100%) border-box;
  box-shadow: 0 5px 0 #9c5d00, 0 10px 20px rgba(140, 60, 0, .28); touch-action: manipulation; transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; }
.mcard::after { content: ''; position: absolute; inset: 0; border-radius: 18px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.75); pointer-events: none; }
.mcard:active { transform: translateY(4px) scale(.98); box-shadow: 0 1px 0 #9c5d00, 0 4px 10px rgba(140, 60, 0, .25); }
.mc-art { display: block; flex: 1 1 0; width: 100%; height: 0; min-height: 0; }
.mc-lab { flex: none; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding: 4px 10px 5px; text-align: left; line-height: 1.1; }
.mc-lab b { font-size: 16px; font-weight: 700; text-shadow: 0 2px 0 rgba(0,0,0,.25); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mc-lab small { font-size: 11.5px; font-weight: 500; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mc-solo .mc-lab { background: linear-gradient(180deg, #ff6aa8, #d81b60); }
.mc-coop .mc-lab { background: linear-gradient(180deg, #6f9bff, #2f62e0); }
.mc-two .mc-lab { background: linear-gradient(180deg, #b77bff, #7b3fd6); }
.mc-vs .mc-lab { background: linear-gradient(180deg, #ff9a52, #e85a0c); }

/* glowing side buttons */
.side { position: absolute; top: 0; display: flex; flex-direction: column; gap: 10px; z-index: 3; }
.side-l { left: 0; } .side-r { right: 0; }
.fab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 66px; min-height: 44px; padding: 0; border: 0; background: none; color: #fff; font: inherit; touch-action: manipulation; }
.fab .fi { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; animation: fabGlow 2.6s ease-in-out infinite; transition: transform .12s ease; }
.fab .fi .ic { width: 26px; height: 26px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.25)); }
.fab:active .fi { transform: scale(.92); }
.f-daily .fi { background: radial-gradient(circle at 35% 28%, #fff0a0, #ffb31f 55%, #f08a00); }
.f-invite .fi { background: radial-gradient(circle at 35% 28%, #c9dbff, #5b8dff 55%, #2f62e0); animation-delay: .8s; }
.f-coins .fi { background: radial-gradient(circle at 35% 28%, #ffc6e0, #ff5aa0 55%, #d81b60); animation-delay: 1.6s; }
.fab small { font-size: 11.5px; font-weight: 700; color: var(--ink); background: rgba(255,255,255,.9); padding: 1px 7px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(140,20,70,.15); }
.fdot { position: absolute; top: -1px; right: 8px; width: 14px; height: 14px; border-radius: 50%; background: #ff2d55; border: 2px solid #fff; animation: beat 1.2s infinite; }
.fdot[hidden] { display: none; }
@keyframes fabGlow { 0%, 100% { box-shadow: 0 4px 0 rgba(120,0,60,.25), 0 0 0 0 rgba(255,236,140,0); } 50% { box-shadow: 0 4px 0 rgba(120,0,60,.25), 0 0 16px 5px rgba(255,240,150,.9); } }

/* bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: flex; justify-content: space-around; align-items: stretch; height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 0 calc(6px + env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) calc(6px + env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, #ffffff, #ffe8f1); border-radius: 22px 22px 0 0; border-top: 2px solid #fff; box-shadow: 0 -6px 20px rgba(140, 20, 70, .18); }
.tabbar[hidden] { display: none; }
body.ad-banner-on .tabbar { bottom: 50px; border-radius: 22px; }
.tabbar button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 44px; max-width: 120px; height: 64px; padding: 0; border: 0; background: none; color: #b0708e; font: inherit; font-size: 12px; font-weight: 600; touch-action: manipulation; transition: color .15s, transform .12s; }
.tabbar button .ic { width: 25px; height: 25px; transition: transform .15s; }
.tabbar button.on { color: var(--rose); }
.tabbar button.on:not(.t-home) .ic { transform: translateY(-2px) scale(1.08); }
.tabbar button:not(.t-home).on::after { content: ''; width: 18px; height: 4px; border-radius: 2px; background: var(--rose); margin-top: 1px; }
.tabbar button:active { transform: scale(.94); }
.t-home .th { display: grid; place-items: center; width: 60px; height: 60px; margin-top: -26px; border-radius: 50%; border: 4px solid #fff; color: #fff;
  background: linear-gradient(180deg, #ff8fbf, #e2337f); box-shadow: 0 5px 0 #a3134a, 0 8px 18px rgba(163, 19, 74, .35); }
.t-home.on .th { background: linear-gradient(180deg, #ffd84a, #ff8a1f); box-shadow: 0 5px 0 #c25a00, 0 8px 18px rgba(194, 90, 0, .35); }
.t-home .th .ic { width: 28px; height: 28px; }

/* tab pages (Friends, Wallet, Settings) */
.overlay.tabpage { align-items: flex-start; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
.page { width: min(580px, 100%); margin: 0 auto; text-align: left; padding: 0 2px 10px; }
.overlay.show > .page { animation: cardIn .26s cubic-bezier(.2,.9,.3,1.2); }
.ptitle { display: flex; align-items: center; gap: 10px; margin: 4px 4px 12px; font-size: 26px; color: var(--rose); }
.ptitle .ic { width: 28px; height: 28px; }
.gh { margin: 14px 6px 6px; font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #8a2152; }
.gcard { background: rgba(255,255,255,.95); border-radius: 20px; padding: 12px 14px; margin: 0 0 10px; border: 2px solid #fff; box-shadow: 0 4px 0 rgba(194,24,91,.14), 0 8px 18px rgba(140,20,70,.12); }
.gcard.setlist { margin: 0 0 10px; }
.gcard .set { background: #fff7fb; }
.gcard .label { margin-top: 12px; }
.gnote { margin: 0 0 4px; }
.srow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 6px 2px; border: 0; border-bottom: 1px solid #f3e1e9; background: none; color: var(--ink); font: inherit; text-align: left; text-decoration: none; }
.srow:last-child { border-bottom: 0; }
.srow > .ic { flex: none; width: 24px; height: 24px; color: var(--rose); }
.srow span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.srow b { font-size: 15.5px; font-weight: 700; }
.srow small { font-size: 12.5px; color: #8f5a74; }
.srow small a { color: var(--rose); font-weight: 700; }
.sbtnrow { cursor: pointer; } .sbtnrow:active { background: #fff0f6; }
#settings .btn.back { margin-top: 6px; }

/* friends */
.me-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.me-card canvas { width: 64px; height: 64px; border-radius: 50%; flex: none; background: radial-gradient(circle at 50% 35%, #fff 0%, #ffd6e6 60%, #ffb6cf 100%); box-shadow: inset 0 0 0 3px rgba(194,24,91,.2); }
.me-t { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.me-t > b { font-size: 19px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-t > small { font-size: 12px; color: #8f5a74; }
.fcode { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.fcode small { font-size: 12px; font-weight: 600; color: #8f5a74; }
.fcode b { font-size: 22px; font-weight: 700; letter-spacing: 3px; color: var(--rose); background: #fff1f7; border: 2px dashed #ff9cc4; border-radius: 10px; padding: 0 8px; }
.me-b { display: flex; gap: 8px; }
.sbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 14px; border: 2px solid rgba(194,24,91,.22); background: #fff; color: var(--rose); font: inherit; font-size: 14px; font-weight: 700; flex: none; touch-action: manipulation; }
.sbtn .ic { width: 20px; height: 20px; }
.sbtn:active { transform: scale(.95); }
.sbtn.inv, .sbtn.add { color: #fff; border-color: transparent; background: linear-gradient(180deg, #ff6aa8, #e91e63); box-shadow: 0 3px 0 #a3134a; }
.sbtn.rm { padding: 0; width: 44px; color: #b0708e; }
.sbtn.rm.sure { width: auto; padding: 0 10px; color: #fff; background: #d32f2f; border-color: transparent; }
.connect { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 10px; }
.cbtn { position: relative; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 10px; border-radius: 16px; border: 2px solid #fff; background: rgba(255,255,255,.8); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 700; text-align: left; line-height: 1.1; }
.cbtn:disabled { opacity: 1; color: #9a7486; cursor: not-allowed; }
.cbtn .cl { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #5f6368; font-size: 18px; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.cbtn .cl.fb { background: #6d84b4; color: #fff; }
.cbtn span { flex: 1; min-width: 0; }
.cbtn em { position: absolute; top: -8px; right: 8px; font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff; background: #a0577a; padding: 1px 7px; border-radius: 999px; }
.frtabs i { font-style: normal; font-size: 12px; opacity: .85; }
.frtabs i:empty { display: none; }
.frlist { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.frow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 18px; background: rgba(255,255,255,.95); border: 2px solid #fff; box-shadow: 0 3px 0 rgba(194,24,91,.12), 0 6px 14px rgba(140,20,70,.1); }
.frow.hl { border-color: #ffd34d; box-shadow: 0 0 0 3px rgba(255,211,77,.5); }
.fav { position: relative; flex: none; }
.fav canvas { display: block; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #fff 0%, #ffd6e6 60%, #ffb6cf 100%); }
.frlist.mini .fav canvas { width: 36px; height: 36px; }
.odot { position: absolute; right: 0; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #b9a3ad; border: 2px solid #fff; }
.odot.on { background: #22c55e; }
.fr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.fr-t b { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-t small { font-size: 12px; color: #8f5a74; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.isfr { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 13px; font-weight: 700; color: #1b8a4b; }
.isfr .ic { width: 18px; height: 18px; }
.frempty { text-align: center; padding: 10px 14px 4px; background: rgba(255,255,255,.75); border-radius: 18px; }
.frempty canvas { width: 180px; height: 84px; display: block; margin: 0 auto; }
.frempty p { margin: 6px 0 4px; font-size: 14px; color: var(--ink); line-height: 1.35; }
#frAdd { margin-top: 10px; }
.afmsg { min-height: 1.2em; margin: 4px 0; }
.afmsg.err { color: #c62828; } .afmsg.ok { color: #1b8a4b; font-weight: 700; } .afmsg.info { color: #8a2152; }
#addFr .card { text-align: left; max-height: calc(100% - 8px); overflow-y: auto; }
#addFr h2 { text-align: center; }
.addfr { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 2px; }
.addfr[hidden] { display: none; }
.afrow { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 8px; border-radius: 14px; background: #fff; border: 2px solid #f6dbe7; text-align: left; }
.afrow b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobbyfr[hidden] { display: none; }
.lobbyfr .label { text-align: left; }

/* wallet page */
.whero { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin: 0 0 10px; border-radius: 22px; border: 3px solid #fff;
  background: radial-gradient(circle at 20% 30%, #fff6c2 0%, #ffd84a 45%, #f5a300 100%); box-shadow: 0 5px 0 #b87400, 0 10px 22px rgba(160,90,0,.3); color: #5b3200; }
.spin-coin { perspective: 400px; flex: none; }
.spin-coin svg { display: block; width: 78px; height: 78px; animation: coinSpin 2.6s linear infinite; filter: drop-shadow(0 4px 4px rgba(120,60,0,.35)); }
@keyframes coinSpin { 0% { transform: rotateY(0deg); } 100% { transform: rotateY(360deg); } }
.wh-t { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.wh-t small { font-size: 14px; font-weight: 600; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-t b { font-size: 46px; font-weight: 700; color: #fff; text-shadow: 0 3px 0 #b06a00, 0 6px 10px rgba(120,60,0,.3); }
.wh-t span { font-size: 13px; font-weight: 600; opacity: .85; }
.streak { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.st-t { flex: 1 1 160px; display: flex; flex-direction: column; line-height: 1.2; }
.st-t b { font-size: 16px; } .st-t small { font-size: 12.5px; color: #8f5a74; }
.st-dots { display: flex; gap: 5px; flex: none; }
.st-dots i { width: 16px; height: 16px; border-radius: 50%; background: #f1dde6; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); }
.st-dots i.on { background: linear-gradient(180deg, #ffd84a, #f2a900); }
.st-dots i.now { box-shadow: 0 0 0 2px #e91e63; }
.btn.sm { width: auto; min-height: 46px; margin: 0; padding: 0 16px; font-size: 15px; }
.earn { padding: 4px 14px; }
.erow { display: flex; align-items: center; gap: 12px; min-height: 58px; border-bottom: 1px solid #f3e1e9; }
.erow:last-child { border-bottom: 0; }
.ei { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: #fff; background: linear-gradient(180deg, #ff86b9, #e2337f); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.ei .ic { width: 22px; height: 22px; }
.erow:nth-child(2) .ei { background: linear-gradient(180deg, #ffd84a, #f08a00); }
.erow:nth-child(3) .ei { background: linear-gradient(180deg, #ffa36b, #ff6a14); }
.erow:nth-child(4) .ei { background: linear-gradient(180deg, #b77bff, #7b3fd6); }
.erow:nth-child(5) .ei { background: linear-gradient(180deg, #7aa6ff, #3d7bff); }
.et { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.et b { font-size: 15px; } .et small { font-size: 12.5px; color: #8f5a74; }
.erow em { flex: none; font-style: normal; font-size: 12px; font-weight: 700; color: var(--rose); background: #ffe6f0; padding: 3px 9px; border-radius: 999px; }
.erow em.soon { color: #7a6470; background: #eee4e9; }
.erow em.ready { color: #fff; background: #1b8a4b; }
#wpFilter { margin: 4px 0 8px; }
#wpFilter button { min-height: 44px; font-size: 14px; }
.wplist { overflow: visible; flex: none; }

/* daily reward popup */
.dlg .card { max-height: calc(100% - 8px); overflow-y: auto; }
.daily-card { width: min(440px, 100%); }
.daily-card h2 { font-size: 28px; margin: 0 0 8px; }
.dygrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 6px; }
.dy { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px 7px; border-radius: 16px; background: #fff; border: 2px solid #f4d9e5; color: var(--ink); }
.dy small { font-size: 11.5px; font-weight: 600; color: #8f5a74; }
.dy .dc .ic { width: 30px; height: 30px; color: #e09a00; fill: #ffd34d; }
.dy b { font-size: 17px; font-weight: 700; color: #b06a00; }
.dy.big { grid-column: span 2; background: linear-gradient(180deg, #fff6d0, #ffe28a); border-color: #ffc928; }
.dy.big .stack { display: flex; } .dy.big .stack .ic { margin: 0 -5px; }
.dy.done { background: #f6fbf7; border-color: #bfe6cc; opacity: .8; }
.dy .ck { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: #1b8a4b; color: #fff; display: grid; place-items: center; }
.dy .ck .ic { width: 13px; height: 13px; }
.dy.now { border-color: #e91e63; box-shadow: 0 0 0 3px rgba(233,30,99,.25); animation: dyPulse 1.4s ease-in-out infinite; }
.dy.got { border-color: #1b8a4b; background: #eaf8ef; }
@keyframes dyPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.daily-card.yay { animation: yay .6s ease; }
@keyframes yay { 0% { transform: scale(1); } 30% { transform: scale(1.04) rotate(-1deg); } 60% { transform: scale(.99) rotate(1deg); } 100% { transform: none; } }
#dyClaim:disabled { opacity: .7; filter: grayscale(.3); }

/* layouts */
@media (orientation: portrait) and (max-height: 820px) { #menu .duo { display: none; } }
@media (orientation: portrait) and (max-height: 760px) { .mcard { aspect-ratio: 1.55; } #menu .logo img { max-height: 15vh; } .home-main { gap: 10px; } .playbtn { height: 58px; font-size: 28px; } }
@media (orientation: portrait) and (max-height: 640px) { #menu .sub { display: none; } .mcard { aspect-ratio: 1.75; } .mc-lab small { display: none; } }
@media (max-width: 360px) { .mc-lab b { font-size: 14px; } .mcards { gap: 9px; } .fab { width: 58px; } .fab .fi { width: 46px; height: 46px; } #menu .logo img { width: calc(100vw - 150px); } }
@media (orientation: landscape) and (max-height: 540px) {
  .home-main { display: grid; grid-template-columns: auto auto; grid-template-areas: "brand cards" "brand play" "inst play"; align-content: center; justify-content: center; column-gap: 3.5vw; row-gap: 10px; padding-left: 70px; }
  .home-act { display: contents; }
  .home-brand { grid-area: brand; align-self: end; max-width: 36vw; }
  #menu .logo img { width: min(330px, 34vw); max-height: 30vh; }
  #menu .duo { display: none; }
  .playbtn { grid-area: play; width: min(300px, 34vw); height: 58px; font-size: 26px; justify-self: center; }
  .instpill { grid-area: inst; justify-self: center; }
  .mcards { grid-area: cards; width: min(50vw, calc(1.62 * (100vh - 150px))); gap: 10px; align-self: center; }
  .mcard { aspect-ratio: 1.62; }
  .side { top: 50%; transform: translateY(-50%); left: 0; right: auto; }
  .side-l { margin-top: -40px; } .side-r { margin-top: 112px; }
  .tabbar { height: calc(54px + env(safe-area-inset-bottom, 0px)); left: 50%; right: auto; transform: translateX(-50%); width: min(560px, 100%); }
  .tabbar button { height: 54px; font-size: 11px; } .t-home .th { width: 52px; height: 52px; margin-top: -20px; }
  body.tabs-on #menu.home { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  body.tabs-on .overlay:not(#menu) { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
}
@media (orientation: landscape) and (max-height: 400px) { .mc-lab small { display: none; } .mc-lab b { font-size: 14px; } .fab .fi { width: 44px; height: 44px; } .side { gap: 6px; } .side-l { margin-top: -36px; } .side-r { margin-top: 96px; } .home-top { height: 46px; } }
@media (min-width: 900px) and (min-height: 600px) {
  .home-act { width: 600px; }
  #menu .logo img { width: min(460px, 40vw); max-height: 22vh; }
  .playbtn { width: 380px; }
  .mcards { gap: 16px; } .mcard { aspect-ratio: 1.5; } .mc-lab b { font-size: 18px; } .mc-lab small { font-size: 13px; }
  .side-l { left: calc(50% - 400px); top: 40px; } .side-r { right: calc(50% - 400px); top: 40px; }
  .mcard:hover { filter: brightness(1.04); transform: translateY(-3px); }
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 600px; bottom: 12px; border-radius: 24px; }
  .tabbar button:hover { color: var(--rose); }
}
@media (prefers-reduced-motion: reduce) { .fab .fi, .spin-coin svg, .dy.now, .fdot { animation: none; } }

/* v6.23 fixes */
.tabbar { box-sizing: border-box; }
.tabbar button { height: auto; align-self: stretch; }
#menu .sub { max-width: calc(100vw - 160px); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-t small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dy .dc svg { width: 30px; height: 30px; display: block; }
.dy.big .stack svg { margin: 0 -6px; }
@media (orientation: landscape) and (max-height: 540px) { .home-main { padding-left: 80px; } #menu .sub { max-width: 34vw; } }
@media (orientation: portrait) and (max-height: 640px) { .mcard { aspect-ratio: 1.6; } }
@media (min-width: 900px) and (min-height: 600px) { #menu .sub { max-width: none; font-size: 14px; } }
@media (min-width: 900px) and (min-height: 600px) and (max-height: 1040px) { #menu .duo { display: none; } #menu .logo img { max-height: 18vh; } .mcard { aspect-ratio: 1.7; } }
body.tabs-on #levels .card.wide { max-height: calc(100dvh - 100px - env(safe-area-inset-bottom, 0px)); }
@media (orientation: landscape) and (max-height: 540px) { body.tabs-on #levels .card.wide { max-height: calc(100dvh - 76px - env(safe-area-inset-bottom, 0px)); } }
#menu .sub { white-space: normal; text-overflow: clip; text-align: center; line-height: 1.25; border-radius: 14px; }
@media (orientation: portrait) and (max-width: 480px) { #menu .sub { white-space: nowrap; font-size: 12px; padding: 4px 10px; max-width: calc(100vw - 148px); } }

/* ===== v6.24 missions, daily day badge, wallet tab dot ===== */
.missions { padding: 4px 14px; }
.mrow { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 6px 0; border-bottom: 1px solid #f3e1e9; }
.mrow:last-child { border-bottom: 0; }
.mrow .ei { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fff; background: linear-gradient(180deg, #ff7fb4, #e91e63); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.mrow .ei .ic { width: 22px; height: 22px; }
.mrow.claimed .ei, .mrow.soon .ei { background: linear-gradient(180deg, #d9c6cf, #b8a1ac); }
.mrow .mt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mrow .mt b { font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .mt small { font-size: 12px; color: #9a7486; }
.mbar { display: block; height: 8px; border-radius: 999px; background: #f6e3ec; overflow: hidden; }
.mbar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffb31f, #ff6aa8); transition: width .4s ease; }
.mrow.claimed .mbar i { background: #c9b3bd; }
.mrow em { flex: none; font-style: normal; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.mrow em .ic { width: 14px; height: 14px; }
.mrow em.mrew { color: #8a5a00; background: #fff1c7; }
.mrow em.mdone { color: #2e7d32; background: #e3f4e4; }
.mrow em.soon { color: #7a6470; background: #eee4e9; }
.sbtn.mclaim { color: #6b3a00; border-color: transparent; background: linear-gradient(180deg, #ffe58a, #ffc233); box-shadow: 0 3px 0 #c98a00; animation: beat 1.4s infinite; }
.mrow.ready { background: linear-gradient(90deg, rgba(255,229,138,.25), transparent); margin: 0 -14px; padding: 6px 14px; }
.fday { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 800; line-height: 1; color: #fff; background: #e91e63; border: 2px solid #fff; padding: 2px 6px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 4px rgba(140,20,70,.25); pointer-events: none; }
.fday[hidden] { display: none; }
@media (max-width: 360px) { .fday { top: 34px; } }
@media (orientation: landscape) and (max-height: 400px) { .fday { top: 32px; } }
.tabbar button { position: relative; }
.tdot { position: absolute; top: 8px; left: calc(50% + 8px); width: 12px; height: 12px; border-radius: 50%; background: #ff2d55; border: 2px solid #fff; animation: beat 1.2s infinite; }
.tdot[hidden] { display: none; }
#dyDouble[hidden] { display: none; }

/* ===== v6.25 daily: weeks, Day 7 mystery gift, reveal ===== */
.daily-card { position: relative; }
.wkpill { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; color: #fff; background: linear-gradient(180deg, #ff7ab8, #e91e63); box-shadow: 0 2px 0 rgba(140,10,60,.25); vertical-align: 1px; }
.dy .dc svg.coin3d, .dy .dc .ic { width: 34px; height: 34px; }
.dy.gift { flex-direction: row; justify-content: center; gap: 4px; padding: 4px 6px; background: radial-gradient(circle at 30% 30%, #fff8dd, #ffe08a 60%, #ffc94a); border-color: #ffbf1f; overflow: visible; }
.dy.gift .gwrap { position: relative; width: 58px; height: 58px; flex: none; }
.dy.gift .giftbox { width: 58px; height: 58px; display: block; filter: drop-shadow(0 0 6px rgba(255,214,80,.95)) drop-shadow(0 3px 3px rgba(150,40,80,.3)); transform-origin: 50% 90%; animation: giftShake 2.4s ease-in-out infinite; }
.dy.gift.done .giftbox, .dy.gift.opened .giftbox { animation: none; }
.dy.gift.opened .gb-lid { transform: translate(6px, -10px) rotate(14deg); transform-origin: 50% 50%; transform-box: fill-box; }
.dy.gift .gtx { display: flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.1; }
.dy.gift .gtx b { font-size: 16px; color: #b0306a; }
.dy.gift .gtx em { font-style: normal; font-size: 11.5px; font-weight: 700; color: #9a6d00; }
.dy.gift .tw { position: absolute; width: 10px; height: 10px; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 1.8s ease-in-out infinite; }
.dy.gift .t1 { top: 2px; left: 0; } .dy.gift .t2 { top: 8px; right: -2px; width: 7px; height: 7px; animation-delay: .6s; } .dy.gift .t3 { bottom: 6px; left: -3px; width: 6px; height: 6px; animation-delay: 1.2s; }
.dy.gift.now { animation: none; }
@keyframes giftShake { 0%, 62%, 100% { transform: rotate(0); } 66% { transform: rotate(-7deg) scale(1.04); } 72% { transform: rotate(6deg) scale(1.04); } 78% { transform: rotate(-4deg); } 84% { transform: rotate(3deg); } 90% { transform: rotate(0); } }
@keyframes twinkle { 0%, 100% { transform: scale(.3); opacity: 0; } 50% { transform: scale(1); opacity: 1; } }
/* the reveal (covers the card) */
.gift-reveal { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: inherit; overflow: hidden; background: radial-gradient(circle at 50% 42%, #fff6d6 0, #ffd6ea 45%, #ffb3d3 100%); }
.gift-reveal[hidden] { display: none; }
.gr-rays { position: absolute; left: 50%; top: 40%; width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%; background: repeating-conic-gradient(rgba(255,236,150,.75) 0 10deg, rgba(255,255,255,0) 10deg 22deg); -webkit-mask: radial-gradient(circle, #000 18%, transparent 62%); mask: radial-gradient(circle, #000 18%, transparent 62%); opacity: 0; transform: scale(.4); transition: opacity .4s ease, transform .6s ease; }
.gr-box { position: relative; width: 150px; height: 150px; }
.gr-box .giftbox { width: 150px; height: 150px; display: block; transform-origin: 50% 88%; filter: drop-shadow(0 0 14px rgba(255,214,80,.95)); }
.gr-box .gb-lid { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .55s cubic-bezier(.2,.9,.3,1.3), opacity .5s ease .25s; }
.s-shake .gr-box .giftbox { animation: giftShakeHard .9s ease-in-out; }
.s-open .gr-rays, .s-num .gr-rays { opacity: 1; transform: scale(1); animation: raySpin 9s linear infinite; }
.s-open .gr-box .gb-lid, .s-num .gr-box .gb-lid { transform: translate(-14px, -70px) rotate(-28deg); opacity: 0; }
.s-open .gr-box .giftbox, .s-num .gr-box .giftbox { animation: giftPop .5s ease forwards; }
.gr-burst { position: absolute; left: 50%; top: 40%; width: 0; height: 0; }
.gr-burst i { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; animation: coinFly .95s cubic-bezier(.15,.7,.35,1) var(--d) forwards; opacity: 0; }
.gr-burst i svg { width: 28px; height: 28px; display: block; }
.gr-txt { position: relative; display: flex; flex-direction: column; align-items: center; opacity: 0; transform: translateY(10px) scale(.8); transition: all .35s cubic-bezier(.2,.9,.3,1.3); }
.s-num .gr-txt { opacity: 1; transform: none; }
.gr-txt small { font-size: 13px; font-weight: 700; color: #b0306a; text-transform: uppercase; letter-spacing: .06em; }
.gr-txt b { display: flex; align-items: center; gap: 6px; font-size: 48px; line-height: 1; color: #b06a00; text-shadow: 0 2px 0 #fff, 0 4px 10px rgba(180,100,0,.25); }
.gr-txt .gr-coin svg { width: 44px; height: 44px; display: block; animation: coinSpinY 1.2s ease-in-out infinite; }
.gr-txt em { font-style: normal; font-size: 13px; color: #8f5a74; }
.gift-reveal #grOk { position: relative; margin-top: 6px; opacity: 0; transition: opacity .3s ease .5s; min-width: 160px; }
.s-num #grOk { opacity: 1; }
@keyframes giftShakeHard { 0% { transform: rotate(0); } 15% { transform: rotate(-9deg) scale(1.05); } 30% { transform: rotate(9deg) scale(1.08); } 45% { transform: rotate(-8deg) scale(1.1); } 60% { transform: rotate(8deg) scale(1.12); } 75% { transform: rotate(-5deg) scale(1.14); } 100% { transform: rotate(0) scale(1.16); } }
@keyframes giftPop { 0% { transform: scale(1.16); } 100% { transform: scale(.72) translateY(-14px); opacity: .9; } }
@keyframes raySpin { to { transform: scale(1) rotate(360deg); } }
@keyframes coinFly { 0% { opacity: 0; transform: translate(0, 0) scale(.4) rotate(0); } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) { .dy.gift .giftbox, .dy.gift .tw, .gr-rays, .gr-box .giftbox { animation: none !important; } }
/* the one coin: a touch of depth wherever it sits */
svg.coin3d, .chip.coin .ic, .gcoin { filter: drop-shadow(0 1px 1px rgba(120,60,0,.25)); }
.spin-coin svg { filter: drop-shadow(0 6px 6px rgba(120,60,0,.35)); }

/* ===== v6.25 avatars: "Your player" dialog ===== */
.av-card { width: min(520px, 100%); padding-bottom: 8px; }
.av-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; text-align: left; }
.av-prev { position: relative; flex: none; width: 96px; height: 96px; border-radius: 50%; overflow: visible; box-shadow: 0 6px 16px rgba(140,20,70,.22), 0 0 0 4px #fff; background: #fff; }
.av-prev > svg, .av-prev > canvas { width: 96px; height: 96px; display: block; border-radius: 50%; }
.av-prev.prem { box-shadow: 0 6px 16px rgba(140,20,70,.22), 0 0 0 4px #ffc928, 0 0 0 6px #fff3b0; }
.av-prev .pframe { position: absolute; top: -14px; left: 50%; width: 30px; height: 22px; margin-left: -15px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M2 16 1 3l6 5 5-7 5 7 6-5-1 13z' fill='%23ffc928' stroke='%23c98500' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E"); filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.av-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.av-id .kicker { margin: 0; }
.avname { display: flex; gap: 6px; }
.avname input { flex: 1; min-width: 0; height: 44px; border-radius: 14px; border: 2px solid #f4d9e5; padding: 0 12px; font: inherit; font-size: 17px; font-weight: 700; color: var(--ink); background: #fff; }
.avname .sbtn { min-height: 44px; }
.prem-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px 4px 8px; border: 0; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 700; color: #8a5a00; background: linear-gradient(180deg, #fff6cf, #ffe08a); box-shadow: inset 0 0 0 2px #ffc928, 0 2px 0 rgba(160,100,0,.25); }
.prem-chip.on { color: #fff; background: linear-gradient(180deg, #ffd34d, #f0a800); box-shadow: inset 0 0 0 2px #fff3b0, 0 2px 0 rgba(160,100,0,.35); }
.prem-chip .ic { width: 20px; height: 20px; }
.av-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 16px; background: #fbe9f1; margin-bottom: 8px; }
.av-tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 700; color: #8f5a74; background: none; }
.av-tabs button.on { color: #fff; background: linear-gradient(180deg, #ff6fae, #e91e63); box-shadow: 0 3px 0 rgba(140,10,60,.25); }
.av-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 2px 8px; margin: 0 -2px; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; }
.avt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1; padding: 0; border: 3px solid transparent; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(140,20,70,.14); }
.avt > svg, .avt > canvas { width: 100%; height: 100%; border-radius: 50%; display: block; }
.avt small { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; color: #fff; background: #8f5a74; padding: 0 6px; border-radius: 999px; }
.avt.on { border-color: #e91e63; box-shadow: 0 0 0 4px rgba(233,30,99,.28), 0 0 14px rgba(233,30,99,.35); transform: none; }   /* v6.32: selected = ring + glow only, same size as the others */
.avt.pr { border-color: #ffd34d; }
.avt.pr.on { border-color: #e91e63; }
.avt.locked > svg { filter: saturate(.75) brightness(.92); }
.pbadge { position: absolute; top: -5px; right: -3px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.18); pointer-events: none; }
.pbadge .ic { width: 17px; height: 17px; }
.plock { position: absolute; bottom: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(43,27,58,.78); pointer-events: none; }
.plock .ic { width: 13px; height: 13px; }
.av-make { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.avrow .label { margin: 0 0 4px; }
.avopts { display: flex; gap: 8px; overflow-x: auto; padding: 6px 4px 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.avopts::-webkit-scrollbar { display: none; }
.avopts.o-seg { flex-wrap: wrap; overflow: visible; }
.avseg { position: relative; min-height: 44px; min-width: 88px; padding: 0 16px; border: 2px solid #f4d9e5; border-radius: 14px; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); background: #fff; }
.avseg.on { color: #fff; border-color: #e91e63; background: linear-gradient(180deg, #ff6fae, #e91e63); }
.avsw { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); padding: 0; }
.avsw.on { box-shadow: 0 0 0 3px #e91e63, 0 2px 6px rgba(0,0,0,.18); }
.avsw .pbadge, .avseg .pbadge { width: 20px; height: 20px; top: -7px; right: -7px; } .avsw .pbadge .ic, .avseg .pbadge .ic { width: 14px; height: 14px; }
.avth { position: relative; flex: none; width: 66px; padding: 0 0 2px; border: 3px solid transparent; border-radius: 16px; background: #fff; box-shadow: 0 2px 6px rgba(140,20,70,.12); display: flex; flex-direction: column; align-items: center; }
.avth > svg { width: 58px; height: 58px; display: block; border-radius: 50%; margin-top: 2px; }
.avth small { font-size: 10.5px; font-weight: 700; color: #8f5a74; white-space: nowrap; }
.avth.on { border-color: #e91e63; }
#avRand { align-self: center; margin-top: 2px; }
.av-foot { display: flex; gap: 8px; margin-top: 6px; }
.av-foot .btn { flex: 1; margin: 0; }
.linkbtn { display: block; margin: 6px auto 0; min-height: 36px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: #b0306a; text-decoration: underline; }
/* premium frame on the home chip */
.pchip.prem canvas { box-shadow: 0 0 0 2.5px #ffc928, 0 0 8px rgba(255,201,40,.8); }
/* players' avatars in lobby / results / add-friend rows */
.dot.hasav { padding: 0; overflow: hidden; }
.dot.hasav canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
/* Premium screen */
.prem-card { width: min(440px, 100%); background: linear-gradient(180deg, #fffaf0, #fff); }
.prem-crown { width: 72px; height: 72px; margin: 0 auto 2px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #fff6c0, #ffd34d 55%, #f0a000); border: 3px solid #fff; box-shadow: 0 4px 0 rgba(160,90,0,.25), 0 0 18px rgba(255,214,80,.8); animation: fabGlow 2.6s ease-in-out infinite; }
.prem-crown svg { width: 42px; height: 42px; filter: drop-shadow(0 2px 0 rgba(150,80,0,.35)); }
.prem-card h2 { margin: 4px 0 2px; }
.prem-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; text-align: left; }
.prem-ads { margin: 10px 0 4px; padding: 10px; border-radius: 16px; background: #fdf0f6; text-align: center; }
.prem-ads b { display: block; font-size: 14px; margin-bottom: 6px; }
.prem-bar { height: 10px; border-radius: 999px; background: #f4d9e5; overflow: hidden; margin-bottom: 8px; }
.prem-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd34d, #f0a000); border-radius: inherit; transition: width .4s ease; }
.prem-ads .btn { margin: 0 auto; }
.gr-prem { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: 4px; padding: 6px 14px; border-radius: 16px; background: linear-gradient(180deg, #fff6cf, #ffe08a); box-shadow: inset 0 0 0 2px #ffc928; opacity: 0; transform: scale(.6); transition: all .4s cubic-bezier(.2,.9,.3,1.4) .35s; }
.s-num .gr-prem { opacity: 1; transform: none; }
.gr-crown .ic { width: 34px; height: 34px; animation: crownBob 1.4s ease-in-out infinite; }
.gr-prem b { color: #8a5a00; font-size: 17px; } .gr-prem small { color: #9a6d00; font-size: 12px; }
.gr-bonus { position: relative; margin: 2px 0 0; font-weight: 700; color: #9a6d00; opacity: 0; transition: opacity .3s ease .4s; } .s-num .gr-bonus { opacity: 1; }
@keyframes crownBob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-4px) rotate(6deg); } }
.btn.danger { margin-top: 8px; width: 100%; color: #c62828; background: #fff; box-shadow: inset 0 0 0 2px #f6c3c3, 0 3px 0 rgba(198,40,40,.15); }
#adsTestRow .sbtn { margin-left: auto; min-width: 64px; }
#avDlg .card, #premDlg .card { background: #fff; }

/* v6.25: PLAY sits under the mode cards — landscape phones make room for it */
@media (orientation: landscape) and (max-height: 540px) {
  .mcards { width: min(48vw, calc(1.62 * (100vh - 238px) + 10px)); align-self: end; }
  .playbtn { height: 50px; font-size: 24px; width: min(260px, 30vw); align-self: start; }
  .home-main { row-gap: 8px; }
}
@media (orientation: landscape) and (max-height: 380px) { .mc-lab b { font-size: 12.5px; letter-spacing: -.01em; } }
.gift-reveal #grOk { width: auto; flex: none; padding-left: 28px; padding-right: 28px; }
.dy .ck { top: -7px; right: -7px; box-shadow: 0 0 0 2px #fff; }

/* v6.26 login + account (cloud.js) */
.lg-card { position: relative; text-align: center; }
.lg-card h2 { margin-top: 4px; }
.lg-x { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #8a5a72; }
.lg-x .ic { width: 22px; height: 22px; }
.lg-ic { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 2px; border-radius: 50%; color: #fff; background: radial-gradient(circle at 35% 30%, #9be7ff, #2f8fe8 60%, #1b5fb3); box-shadow: inset 0 -4px 8px rgba(0,0,0,.2), inset 0 3px 6px rgba(255,255,255,.6), 0 6px 14px rgba(47,143,232,.35); }
.lg-ic .ic { width: 34px; height: 34px; }
.lg-btns { display: grid; gap: 10px; margin: 12px 0 4px; }
.lgb { justify-content: center; min-height: 54px; font-size: 15.5px; background: #fff; border-color: #f1d6e3; box-shadow: 0 3px 0 rgba(140,40,90,.15); }
.lgb .glogo { flex: none; width: 24px; height: 24px; }
.lgb .cl.em { color: #e91e63; } .lgb .cl.em .ic { width: 18px; height: 18px; }
.lgb em { margin-left: 4px; font-style: normal; font-size: 11.5px; font-weight: 700; color: #b0306a; background: #ffe3ef; border-radius: 999px; padding: 2px 8px; }
.lgb.wait { opacity: .6; pointer-events: none; }
.lgb:disabled:not(#lgFb) { opacity: .65; }
.lgb.mg span { display: flex; flex-direction: column; gap: 2px; } .lgb.mg small { font-weight: 600; color: #8a5a72; }
.lg-guest { margin-top: 10px; }
.lg-in { width: 100%; min-height: 50px; margin: 6px 0; padding: 0 14px; border: 2px solid #f1d6e3; border-radius: 14px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.lg-in:focus { outline: none; border-color: #ff6aa8; }
.lg-row { gap: 8px; } .lg-row .btn { flex: 1; }
.lg-card .tiny { margin: 8px 0 0; font-size: 11.5px; color: #8a5a72; } .lg-card .tiny a { color: #b0306a; }
.lg-nudge { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 55; display: flex; align-items: center; gap: 8px; width: min(420px, calc(100% - 20px)); padding: 6px 6px 6px 14px; border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(80,20,50,.25); font-weight: 700; color: var(--ink); animation: lgUp .35s ease-out; }
.lg-nudge[hidden] { display: none; }
.lg-nudge > .ic { flex: none; width: 24px; height: 24px; color: #2f8fe8; } .lg-nudge span { flex: 1; text-align: left; }
.lg-nudge .btn { width: auto; min-height: 44px; margin: 0; padding: 0 16px; }
.lg-nudge .lg-x { position: static; }
@keyframes lgUp { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.acct-row { display: flex; align-items: center; gap: 10px; text-align: left; }
.acct-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #f3e6ee; color: #8a5a72; }
.acct-ic.on { background: radial-gradient(circle at 35% 30%, #b9f6ca, #2fbf71 60%, #1b8a4e); color: #fff; }
.acct-t { display: flex; flex-direction: column; min-width: 0; } .acct-t small { color: #8a5a72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .btn { min-height: 48px; } .acct-b { gap: 8px; } .acct-b .btn { flex: 1; }
.acct-s { margin: 8px 0 0; color: #2f7a4f; font-weight: 600; } .acct-v { margin: 4px 0 0; color: #a3134a; } .acct-v .linkbtn { display: inline; margin: 0; }
.linkbtn.danger { color: #b3261e; font-size: 12.5px; }
.av-acct { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.av-acct .acct-mini { display: inline-flex; align-items: center; gap: 4px; color: #2f7a4f; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.av-acct .ic { width: 16px; height: 16px; } .av-acct .sbtn { min-height: 36px; }
.av-acct .acct-in .ic { width: 18px; height: 18px; color: #2f8fe8; }
.wlogin { display: flex; align-items: center; gap: 6px; margin: 8px 2px 0; padding: 6px 10px; border-radius: 14px; background: rgba(255,255,255,.75); font-size: 13px; font-weight: 600; color: #6b3f57; }
.wlogin[hidden] { display: none; }
.wlogin > .ic { flex: none; width: 20px; height: 20px; color: #2f8fe8; } .wlogin span { flex: 1; }
.wlogin .linkbtn { margin: 0; min-height: 36px; white-space: nowrap; }
.connect[hidden] { display: none; }
.app-card img { flex: none; width: 32px; height: 32px; border-radius: 8px; }
.app-card span { font-size: 13.5px; line-height: 1.2; }
.app-card .btn { font-size: 14px; white-space: nowrap; }
/* v6.26 invites tracker (Friends) + gold "Get the app" card */
.refbox { padding: 10px 12px; }
.refbox[hidden] { display: none; }
.ref-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ref-h b { font-size: 14.5px; } .ref-h .sbtn { flex: none; }
.ref-p { margin: 6px 0 0; color: #6b3f57; }
.ref-row { margin-top: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.7); }
.ref-row.done { background: linear-gradient(180deg, #fff8dc, #ffeaa8); box-shadow: inset 0 0 0 2px #ffc928; }
.ref-t { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ref-t small { color: #8a5a72; font-weight: 600; } .ref-row.done .ref-t small { color: #8a5a00; }
.ref-bar { height: 8px; margin: 6px 0; border-radius: 99px; background: #f3e1ea; overflow: hidden; }
.ref-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ff6aa8, #ffb300); transition: width .6s ease; }
.ref-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; font-size: 11.5px; font-weight: 600; color: #8a5a72; }
.ref-steps span { display: flex; align-items: center; gap: 4px; line-height: 1.15; }
.ref-steps em { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #e8c9d8; background: #fff; }
.ref-steps .on { color: #1b7a43; } .ref-steps .on em { border-color: transparent; color: #fff; background: radial-gradient(circle at 35% 30%, #b9f6ca, #2fbf71 60%, #1b8a4e); }
.ref-steps em svg { width: 13px; height: 13px; }
.app-card span { display: flex; flex-direction: column; } .app-card span small { font-weight: 600; color: #8a5a72; font-size: 12px; }
.app-card.gold { padding: 10px 8px 10px 14px; background: linear-gradient(180deg, #fff8dc, #ffe08a); box-shadow: inset 0 0 0 2px #ffc928, 0 10px 28px rgba(160,100,0,.35); }
.app-card.gold img { width: 44px; height: 44px; border-radius: 12px; }
.app-card.gold span b { font-size: 15.5px; color: #6b4300; } .app-card.gold span small { color: #8a5a00; }
.app-card.gold .btn { min-height: 48px; padding: 0 18px; font-size: 15px; }
/* v6.28 Facebook Friends (Friends page) */
.fbbox { padding: 10px 12px; }
.fbbox[hidden] { display: none; }
.fb-h { display: flex; align-items: center; gap: 8px; }
.fb-h .fb-tt { flex: 1; font-size: 15px; }
.fbbox .cl.fb, .fbshare .cl.fb { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #1877f2; color: #fff; font: 700 18px/1 Arial, sans-serif; }
.fbshare .cl.fb { width: 20px; height: 20px; border-radius: 6px; font-size: 14px; }
.fbre { flex: none; }
.fb-p { margin: 6px 0 8px; color: #6b3f57; }
.fbgo { width: 100%; }
.fbsoon { width: 100%; }
.fblist { margin: 8px 0 2px; }
.fbpic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #e7ecf5; color: #6d84b4; }
.fbpic.none .ic { width: 24px; height: 24px; }
.isfr.fbsent { color: #8f5a74; }
.fb-inv { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-inv .sbtn { flex: 1; justify-content: center; text-decoration: none; }

/* ===================== v6.29: Versus / Campaign choice screens in the home style (gold frames, glossy 3D, character art) ===================== */
.card.fancy { position: relative; background: linear-gradient(180deg, #ffffff 0%, #fff3f8 55%, #ffe6f0 100%); border: 3px solid #fff; border-radius: 28px;
  box-shadow: 0 6px 0 rgba(194,24,91,.18), 0 16px 40px rgba(140,20,70,.3); padding-top: 22px; }
.card.fancy h2 { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.ribbon { position: relative; margin: -40px auto 8px !important; padding: 7px 26px 8px; min-width: 60%; border-radius: 18px; border: 3px solid #fff; color: #fff !important;
  font-size: 25px; font-weight: 700; letter-spacing: .5px; text-shadow: 0 2px 0 rgba(120,40,0,.45); background: linear-gradient(180deg, #ffb06e 0%, #ff8a3a 45%, #e85a0c 100%);
  box-shadow: 0 5px 0 #b2410a, 0 10px 18px rgba(178,65,10,.3); }
.ribbon::after { content: ''; position: absolute; inset: 3px 10px auto; height: 42%; border-radius: 14px 14px 30px 30px; background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0)); pointer-events: none; }
.ribbon .ic { width: 24px; height: 24px; filter: drop-shadow(0 2px 0 rgba(120,40,0,.4)); }
.vs-card, .rcard { padding-top: 30px; overflow: visible; }
.ribbon.r-pink { background: linear-gradient(180deg, #ff8fc0 0%, #ff5a9f 45%, #d81b60 100%); box-shadow: 0 5px 0 #9c1459, 0 10px 18px rgba(156,20,89,.3); text-shadow: 0 2px 0 rgba(120,0,50,.45); }
.ribbon.r-pink .ic { filter: drop-shadow(0 2px 0 rgba(120,0,50,.4)); }
.vs-card > p.small:first-of-type { margin: 0 0 4px; }
.sec-lab { display: flex; align-items: center; gap: 8px; margin: 10px 2px 6px; font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #b0507e; }
.sec-lab::before, .sec-lab::after { content: ''; flex: 1; height: 2px; border-radius: 1px; background: linear-gradient(90deg, rgba(194,24,91,0), rgba(194,24,91,.28)); }
.sec-lab::after { background: linear-gradient(90deg, rgba(194,24,91,.28), rgba(194,24,91,0)); }

/* the four Versus mode tiles = mini home cards: art on top, colored label strip, gold frame when chosen */
#vsModes { gap: 12px; margin: 0; }
.tile.vtile { position: relative; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; min-height: 0 !important; padding: 0; overflow: hidden;
  border-radius: 20px; border: 4px solid transparent; color: #fff;
  background: linear-gradient(#ffe9f2, #ffe9f2) padding-box, linear-gradient(180deg, #ffffff 0%, #ffd9e8 60%, #f3a9c8 100%) border-box;
  box-shadow: 0 4px 0 #d77ea6, 0 8px 16px rgba(140,20,70,.18); }
.tile.vtile::after { content: ''; position: absolute; inset: 0; border-radius: 16px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); pointer-events: none; }
.vs-art { display: block; width: 100%; height: 70px; flex: none; }
.vt-lab { display: flex; flex-direction: column; align-items: flex-start; padding: 5px 10px 6px; text-align: left; line-height: 1.1; }
.vt-lab b { font-size: 17px; font-weight: 700; text-shadow: 0 2px 0 rgba(0,0,0,.22); }
.tile.vtile .vt-lab small { font-size: 11.5px; font-weight: 500; color: #fff; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.v-1 .vt-lab { background: linear-gradient(180deg, #ff9a52, #e85a0c); }
.v-3 .vt-lab { background: linear-gradient(180deg, #b77bff, #7b3fd6); }
.v-4 .vt-lab { background: linear-gradient(180deg, #6f9bff, #2f62e0); }
.v-t .vt-lab { background: linear-gradient(180deg, #ff6aa8, #d81b60); }
.tile.vtile:not(.on) { filter: saturate(.86); }
.tile.vtile.on { color: #fff; filter: none; transform: translateY(-2px);
  background: linear-gradient(#ffe9f2, #ffe9f2) padding-box, linear-gradient(180deg, #fff7c9 0%, #ffd84a 30%, #f2a900 68%, #b86f00 100%) border-box;
  box-shadow: 0 5px 0 #9c5d00, 0 0 0 3px rgba(255,216,74,.45), 0 10px 22px rgba(194,120,0,.4); }
.tile.vtile.on::before { content: ''; position: absolute; z-index: 2; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat, linear-gradient(180deg, #4cd964, #1fa34a);
  box-shadow: 0 2px 0 rgba(0,80,30,.35); }
.tile.vtile:active { transform: translateY(3px) scale(.98); box-shadow: 0 1px 0 #9c5d00, 0 4px 10px rgba(140,60,0,.25); }

/* entry coin chips: glossy gold when chosen */
.seg.stakes { gap: 8px; margin: 0; }
.seg.stakes button { position: relative; min-height: 50px; border-radius: 999px; border: 2px solid #f6cf6a; color: #8a5200; font-size: 17px; font-weight: 700;
  background: linear-gradient(180deg, #fffdf3, #fff1c9); box-shadow: 0 3px 0 #e2b23f; overflow: hidden; }
.seg.stakes button .ic { width: 22px; height: 22px; filter: drop-shadow(0 1px 0 rgba(150,90,0,.35)); }
.seg.stakes button.on { color: #fff; border-color: #fff; text-shadow: 0 1px 0 rgba(150,60,0,.55);
  background: linear-gradient(180deg, #ffd84a 0%, #ffa51f 60%, #ff8a1f 100%); box-shadow: 0 4px 0 #c25a00, 0 6px 14px rgba(194,90,0,.35); }
.seg.stakes button.on::after { content: ''; position: absolute; inset: 2px 8px auto; height: 42%; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0)); pointer-events: none; }
.notebox { margin: 10px 0 2px; padding: 8px 12px 8px 38px; border-radius: 14px; text-align: left; line-height: 1.35; color: #6b2a4a; background: rgba(255,255,255,.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23ff8a3a'/%3E%3Cpath d='M12 11v6M12 7.3v.2' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") 11px 9px / 19px no-repeat; border: 2px dashed rgba(232,90,12,.3); }
.notebox:empty { display: none; }

/* glossy primary on these screens (same orange-gold as the home PLAY button) */
.btn.gloss { position: relative; overflow: hidden; border: 3px solid #fff; color: #fff; font-size: 19px; letter-spacing: 1px; text-shadow: 0 2px 0 rgba(150,60,0,.5);
  background: linear-gradient(180deg, #ffd84a 0%, #ffa51f 55%, #ff8a1f 100%); box-shadow: 0 5px 0 #c25a00, 0 10px 20px rgba(194,90,0,.3); margin-top: 12px; }
.btn.gloss::after { content: ''; position: absolute; inset: 3px 10px auto; height: 40%; border-radius: 14px 14px 30px 30px; background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0)); pointer-events: none; }
.btn.gloss .ic { filter: drop-shadow(0 2px 0 rgba(150,60,0,.5)); }
.btn.gloss:active { box-shadow: 0 1px 0 #c25a00, 0 4px 10px rgba(194,90,0,.3); }

/* Campaign / Choose a mode tiles: glossy white with a colored 3D icon badge */
.card.fancy .tile:not(.vtile) { border: 3px solid #fff; background: linear-gradient(180deg, #ffffff, #ffeef5); box-shadow: 0 5px 0 rgba(194,24,91,.22), 0 10px 18px rgba(140,20,70,.14); gap: 6px; }
.card.fancy .tile:not(.vtile) > .ic { width: 56px; height: 56px; padding: 13px; border-radius: 18px; color: #fff; background: linear-gradient(180deg, #ff86b9, #e2337f); box-shadow: inset 0 -4px 0 rgba(0,0,0,.15), 0 3px 0 rgba(120,0,60,.2); }
.card.fancy #pickCoop > .ic { background: linear-gradient(180deg, #6f9bff, #2f62e0); }
.card.fancy #pickVs > .ic { background: linear-gradient(180deg, #ff9a52, #e85a0c); }
.card.fancy .tile:not(.vtile) b { color: var(--ink); }

@media (max-width: 360px) { .vs-art { height: 62px; } .vt-lab b { font-size: 15.5px; } .seg.stakes button { font-size: 15px; gap: 4px; padding: 6px 4px; } .seg.stakes button .ic { width: 19px; height: 19px; } .ribbon { font-size: 23px; } }
@media (orientation: portrait) and (max-height: 700px) { .vs-art { height: 56px; } .sec-lab { margin: 6px 2px 4px; } }
@media (max-height: 520px) and (orientation: landscape) { #vsModes { grid-template-columns: repeat(4, 1fr); gap: 8px; } .vs-art { height: 50px; } .vt-lab small { display: none; } .sec-lab { margin: 4px 2px; } .vs-card { padding-top: 26px; } .ribbon { font-size: 20px; padding: 4px 20px 5px; margin-top: -36px !important; } .notebox { margin-top: 6px; padding-top: 5px; padding-bottom: 5px; } .vs-card { width: min(640px, 96vw); } .vs-card .btn { min-height: 46px; margin-top: 6px; } .seg.stakes button { min-height: 44px; } }

/* v6.31: Play Together cards are read-only (look + name live in the character builder) */
.pmini .ph { margin: 0; }
.pmini .ph b { display: flex; flex-direction: column; gap: 1px; font-size: 18px; line-height: 1.15; min-width: 0; overflow-wrap: anywhere; }
.pmini .pwho { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #b05a86; }
.pmini .ph .coins { font-size: 12px; margin-top: 2px; }
.pmini .pbtns { display: flex; flex-direction: column; gap: 6px; flex: none; }
.pmini .sbtn, .pcard.pmini .swap { width: auto; min-height: 40px; margin: 0; padding: 0 12px; }
/* v6.31: character builder base picker (blue boy / pink girl) + in-game preview */
.av-base { display: flex; gap: 10px; margin: 2px 0 10px; }
.av-base button { flex: 1; display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; min-height: 76px; border-radius: 18px; border: 3px solid #f3d3e2; background: linear-gradient(180deg, #fff, #fff3f8); font: inherit; font-size: 17px; font-weight: 800; color: #8f5a74; box-shadow: 0 3px 0 rgba(140,20,70,.12); cursor: pointer; position: relative; }
.av-base button canvas { width: 64px; height: 64px; flex: none; border-radius: 14px; background: radial-gradient(circle at 50% 38%, #eef4ff, #c9dbff); }
.av-base button[data-g="girl"] canvas { background: radial-gradient(circle at 50% 38%, #fff0f7, #ffc6de); }
.av-base button[data-g="boy"].on { border-color: #3d7bff; color: #1d47b5; box-shadow: 0 0 0 3px rgba(61,123,255,.18), 0 3px 0 rgba(29,71,181,.22); }
.av-base button[data-g="girl"].on { border-color: #e23a8e; color: #9c1459; box-shadow: 0 0 0 3px rgba(226,58,142,.18), 0 3px 0 rgba(156,20,89,.22); }
.av-base button.base::after { content: ""; position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: #2fbf71 no-repeat center/14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.av-base button:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(140,20,70,.12); }
.av-ingame { position: absolute; right: -12px; bottom: -6px; width: 40px; height: 46px; border-radius: 12px; background: linear-gradient(180deg, #fff, #ffeef6); box-shadow: 0 2px 8px rgba(140,20,70,.28), 0 0 0 2px #fff; overflow: hidden; }
.av-ingame canvas { width: 40px; height: 46px; display: block; }

/* v6.31: no sideways scrolling on any screen (the tilted rope pattern behind Home / Friends / Wallet / Settings
   made those pages scroll sideways on phones) + long names wrap instead of pushing cards wider */
.overlay, #menu.home { overflow-x: hidden; overflow-x: clip; }
html, body { max-width: 100%; overflow-x: hidden; }
.frow .fr-t, .ref-t b, .fb-tt, .me-card > div { min-width: 0; overflow-wrap: anywhere; }
.ref-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ===================== v6.32 SEASONS ===================== */
#levels .card.wide { max-width: 560px; }
#lvGrid.ssn-list, #lvGrid.ssn-map { display: block; overflow-x: hidden; }
.ssn-card { --a: #7ed957; --b: #2f9e44; --c: #fff7d6; position: relative; border-radius: 22px; padding: 12px 12px 12px; margin: 0 0 14px;
  background: linear-gradient(160deg, var(--c), #fff 70%); box-shadow: 0 5px 0 var(--b), 0 10px 22px rgba(80, 20, 50, .16); border: 2px solid rgba(255,255,255,.9); overflow: hidden; }
.ssn-card::before { content: ""; position: absolute; right: -30px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, var(--a) 0, transparent 70%); opacity: .35; pointer-events: none; }
.ssn-row { display: flex; align-items: center; gap: 12px; position: relative; }
.ssn-art { flex: none; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; position: relative;
  background: linear-gradient(180deg, var(--a), var(--b)); box-shadow: inset 0 -6px 0 rgba(0,0,0,.14), inset 0 4px 0 rgba(255,255,255,.35), 0 4px 10px rgba(0,0,0,.15); transform: rotate(-4deg); }
.ssn-art::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 9px; height: 14px; border-radius: 14px 14px 4px 4px; background: rgba(255,255,255,.28); }
.ssn-num { font: 700 34px/1 'Fredoka', system-ui, sans-serif; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.22); position: relative; z-index: 1; }
.ssn-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ssn-txt small { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--b); }
.ssn-txt b { font: 700 21px/1.1 'Fredoka', system-ui, sans-serif; color: var(--ink); }
.ssn-txt em { font-style: normal; font-size: 12.5px; font-weight: 600; color: #7a4a62; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ssn-txt em .ic { width: 13px; height: 13px; color: #e91e63; }
.ssn-bar { display: block; height: 10px; border-radius: 10px; background: rgba(0,0,0,.08); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.ssn-bar i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--a), var(--b)); min-width: 6px; transition: width .6s ease; }
.ssn-bar.need { margin-top: 6px; }
.ssn-bar.need i { background: linear-gradient(90deg, #ffd34d, #ff9f1a); }
.ssn-tick { position: absolute; right: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--b); color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.ssn-tick .ic { width: 18px; height: 18px; }
.ssn-foot { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; position: relative; }
.ssn-foot:empty { display: none; }
.ssn-card .btn { min-height: 42px; font-size: 15px; padding: 6px 14px; margin: 0; flex: 1 1 auto; width: auto; }
.ssn-card .btn .ic { width: 18px; height: 18px; }
.ssn-go { color: #fff; border-color: transparent; background: linear-gradient(180deg, var(--a), var(--b)); box-shadow: 0 4px 0 rgba(0,0,0,.22); text-shadow: 0 1px 0 rgba(0,0,0,.2); }
.ssn-lock { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #7a4a62; }
.ssn-lock .ic { width: 16px; height: 16px; flex: none; }
.ssn-card.locked { filter: saturate(.55); }
.ssn-card.locked .ssn-art { filter: grayscale(.4); }
.ssn-card.locked .ssn-foot { width: 100%; flex-direction: column; gap: 0; }
.ssn-card.locked .ssn-claim { filter: none; }
.ssn-card.done .ssn-art { transform: rotate(0); }
.ssn-top { margin-bottom: 8px; }
.ssn-top .ssn-all { position: relative; margin-top: 10px; width: 100%; background: #fff; color: var(--b); border: 2px solid var(--a); box-shadow: 0 3px 0 var(--a); }
.ssn-meadow { --a: #8ad85c; --b: #3b9b3f; --c: #f2ffd9; }
.ssn-candy  { --a: #ff8cc6; --b: #d81b72; --c: #ffe6f3; }
.ssn-caves  { --a: #8f9bff; --b: #5146d8; --c: #ebeaff; }
.ssn-lava   { --a: #ffab5e; --b: #e0531f; --c: #fff0e2; }
.ssn-sky    { --a: #6fd0ff; --b: #2a7fd6; --c: #e4f6ff; }
.ssn-bonus  { --a: #c39bff; --b: #7c4dff; --c: #f3ecff; }
/* the map: snake of 4 per row with a dotted road behind */
.ssn-path { position: relative; overflow: hidden; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 104px; padding: 8px 2px 4px;
  border-radius: 22px; background: radial-gradient(circle at 20% 10%, rgba(255,255,255,.75), rgba(255,255,255,.35) 60%), linear-gradient(180deg, var(--c, #fff), #fff); }
.ssn-path svg.road { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.road-bed { fill: none; stroke: rgba(255,255,255,.95); stroke-width: 14; stroke-linecap: round; }
.road-dots { fill: none; stroke: #e0bccd; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0.1 12; }
.road-done { fill: none; stroke: var(--b); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0.1 12; }
.lvt { position: relative; z-index: 1; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.lvc { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: linear-gradient(180deg, var(--a), var(--b));
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.16), inset 0 3px 0 rgba(255,255,255,.4), 0 5px 0 rgba(0,0,0,.18), 0 8px 14px rgba(0,0,0,.14);
  border: 3px solid #fff; transition: transform .15s; }
.lvc::after { content: ""; position: absolute; left: 22%; top: 9%; width: 38%; height: 22%; border-radius: 50%; background: rgba(255,255,255,.45); transform: rotate(-18deg); pointer-events: none; }
.lvt.boss .lvc::after { left: 18%; top: 14%; }
.lvc b { position: relative; z-index: 1; font: 700 24px/1 'Fredoka', system-ui, sans-serif; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.lvt:active .lvc { transform: translateY(3px) scale(.97); }
.lvs { font-style: normal; display: inline-flex; gap: 1px; align-items: center; justify-content: center; min-height: 15px; background: rgba(255,255,255,.92); border-radius: 10px; padding: 1px 5px; box-shadow: 0 2px 4px rgba(0,0,0,.08); }
.lvs .ic { width: 13px; height: 13px; color: #e91e63; }
.lvs .ic.off { color: #edc9d8; }
.lvs small { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--b); }
.lvt.lock .lvc { background: linear-gradient(180deg, #e9dfe4, #c9b8c1); box-shadow: inset 0 -6px 0 rgba(0,0,0,.08), 0 4px 0 rgba(0,0,0,.12); }
.lvt.lock .lvc b { color: #fff; opacity: .9; }
.lvt.lock .lvs { background: transparent; box-shadow: none; }
.lvt.lock .lvs .ic { color: #b9a3ae; }
.lvt[disabled] { cursor: not-allowed; }
.lvt.boss .lvc { width: 70px; height: 70px; border-radius: 22px; transform: rotate(45deg); }
.lvt.boss .lvc b { transform: rotate(-45deg); }
.lvt.boss.lock .lvc { transform: rotate(45deg); }
.lvt.cur .lvc { animation: lvGlow 1.6s ease-in-out infinite; }
.lvt.cur.boss .lvc { animation: lvGlowB 1.6s ease-in-out infinite; }
.lvt.cur::before { content: ""; position: absolute; top: 2px; left: 50%; width: 76px; height: 76px; margin-left: -38px; border-radius: 50%; background: radial-gradient(circle, rgba(255,214,77,.55), transparent 70%); z-index: -1; }
@keyframes lvGlow { 0%,100% { transform: scale(1); box-shadow: inset 0 -6px 0 rgba(0,0,0,.16), 0 5px 0 rgba(0,0,0,.18), 0 0 0 0 rgba(255,193,7,.7); } 50% { transform: scale(1.07); box-shadow: inset 0 -6px 0 rgba(0,0,0,.16), 0 5px 0 rgba(0,0,0,.18), 0 0 0 9px rgba(255,193,7,0); } }
@keyframes lvGlowB { 0%,100% { transform: rotate(45deg) scale(1); } 50% { transform: rotate(45deg) scale(1.07); } }
@media (prefers-reduced-motion: reduce) { .lvt.cur .lvc, .lvt.cur.boss .lvc { animation: none; } }
@media (max-width: 359px) { .lvc { width: 52px; height: 52px; } .lvt.boss .lvc { width: 58px; height: 58px; } .ssn-txt b { font-size: 18px; } .ssn-art { width: 54px; height: 54px; } }
@media (min-width: 700px) { .ssn-path { grid-auto-rows: 116px; } .lvc { width: 68px; height: 68px; } .lvt.boss .lvc { width: 76px; height: 76px; } }

/* ===================== v6.32 LOGIN: Facebook recommended (left) + Google (right), small guest/email links ===================== */
.lg-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 10px; }
.lgbig { position: relative; border: 0; border-radius: 20px; padding: 22px 8px 12px; min-height: 132px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; font-size: 17px; transition: transform .12s; }
.lgbig:active { transform: translateY(3px); }
.lgbig small { font-size: 11.5px; font-weight: 600; line-height: 1.25; opacity: .9; }
.lgbig em { font-style: normal; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.25); border-radius: 999px; padding: 2px 8px; }
.lgbig.fb { color: #fff; background: linear-gradient(180deg, #4d8dff, #1a5fe0); box-shadow: 0 5px 0 #1446a8, 0 10px 20px rgba(26,95,224,.3); outline: 3px solid #ffd34d; outline-offset: 2px; }
.lgbig.gg { color: var(--ink); background: #fff; box-shadow: 0 5px 0 #e6c9d7, 0 10px 20px rgba(140,40,90,.12); border: 2px solid #f4dbe7; }
.lgbig.gg small { color: #7a4a62; }
.lgbig:disabled { opacity: .7; }
.lgbig.wait { opacity: .6; pointer-events: none; }
.lg-logo { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 2px; }
.lgbig.fb .lg-logo { background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.lgbig.gg .lg-logo { background: #fff6f9; box-shadow: inset 0 0 0 2px #f4dbe7; }
.lg-logo .fblogo { width: 30px; height: 30px; }
.lg-logo .glogo { width: 26px; height: 26px; }
.lg-rib { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 800; letter-spacing: .5px; color: #6b3a00; background: linear-gradient(180deg, #ffe58a, #ffc233); border-radius: 999px; padding: 3px 10px; box-shadow: 0 2px 0 #c98a00; }
.lg-why { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 12.5px; line-height: 1.35; color: #7a4a62; background: #fff6f9; border-radius: 14px; padding: 8px 10px; margin: 4px 0 8px; }
.lg-why .ic { flex: none; width: 18px; height: 18px; color: #1a5fe0; margin-top: 1px; }
.lg-small { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.lg-small i { font-style: normal; color: #c9a1b4; }
.lg-small .linkbtn { font-size: 14px; }
@media (max-width: 359px) { .lgbig { min-height: 118px; font-size: 15px; } .lgbig small { font-size: 10.5px; } }

.f-tour .fi { background: radial-gradient(circle at 35% 28%, #fff1b3, #ffbf1f 55%, #e08600); animation-delay: 2.2s; }
.f-tour .fi .ic { color: #fff; }
.cn-rec { position: relative; outline: 3px solid #ffd34d; outline-offset: 1px; }
.cn-rec::after { content: "Recommended"; position: absolute; top: -9px; right: 10px; font-size: 10px; font-weight: 800; color: #6b3a00; background: linear-gradient(180deg, #ffe58a, #ffc233); border-radius: 999px; padding: 2px 8px; }
/* v6.32 live bars (remote.js): announcement / maintenance / on hold / app update / offer */
.rr-bar { position: relative; z-index: 3; display: flex; align-items: center; gap: 8px; margin: 6px 12px 0; padding: 8px 10px; border-radius: 14px; font-size: 13px; font-weight: 600; line-height: 1.3; background: #fff; color: var(--ink); box-shadow: 0 3px 0 #f1c6d8, 0 6px 14px rgba(140,40,90,.12); }
.rr-bar.maint { background: #fff4d6; box-shadow: 0 3px 0 #f0cf72; }
.rr-bar.hold { background: #ffe4e4; box-shadow: 0 3px 0 #f2a5a5; }
.rr-bi .ic { width: 20px; height: 20px; color: var(--rose); display: block; }
.rr-bt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rr-bl { flex: none; font-weight: 800; color: var(--rose); text-decoration: none; padding: 4px 10px; border-radius: 999px; background: #ffe3ef; }
.rr-bx { flex: none; border: 0; background: transparent; padding: 4px; color: #a0607e; }
.rr-bx .ic { width: 16px; height: 16px; display: block; }
.rr-offer { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 10px 12px; border-radius: 18px; background: linear-gradient(135deg, #fff7d6, #ffe0ef); box-shadow: 0 4px 0 #f0cf72, 0 8px 18px rgba(140,40,90,.12); }
.rr-oi .ic { width: 30px; height: 30px; color: #e08600; display: block; }
.rr-ot { flex: 1; min-width: 0; display: flex; flex-direction: column; } .rr-ot b { font-size: 15px; } .rr-ot small { font-size: 12px; color: #7a4a62; }
.rr-offer .btn { flex: none; width: auto; margin: 0; min-height: 40px; padding: 4px 12px; }
.prem-list .erow.got .ei { background: #e6f7e6; color: #2e9e44; }

.ref-ms { margin-top: 10px; padding: 10px; border-radius: 16px; background: linear-gradient(135deg, #fff7d6, #fff); box-shadow: inset 0 0 0 2px #ffe08a; }
.ref-ms > b { font-size: 14px; }
.ref-ms-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.ref-ms-row span { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; min-width: 0; }
.ref-ms-row i { font-style: normal; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #9a6a00; background: #fff; box-shadow: 0 3px 0 #f0cf72; }
.ref-ms-row span.on i { color: #fff; background: linear-gradient(180deg, #ffd34d, #f29d00); }
.ref-ms-row small { font-size: 10px; line-height: 1.2; color: #7a4a62; overflow-wrap: anywhere; }
.ref-ms p { margin: 6px 0 0; }

/* v6.32 Play Together: Online (two phones, default) | Offline (one phone) as two big choice cards */
.wopts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 8px; }
.wopt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 8px 12px; border-radius: 20px; border: 3px solid #f4dbe7; background: #fff; color: var(--ink); font-family: inherit; transition: transform .12s, border-color .15s, box-shadow .15s; box-shadow: 0 4px 0 #f1d3e1; }
.wopt:active { transform: translateY(2px); }
.wopt b { font-size: 19px; line-height: 1.1; }
.wopt small { font-size: 13px; font-weight: 600; color: #8a5a72; }
.wo-ic { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #fff1f7; margin-bottom: 4px; }
.wo-ic .ic { width: 30px; height: 30px; color: var(--rose); }
.wopt.on { border-color: var(--rose); background: linear-gradient(180deg, #fff, #fff2f8); box-shadow: 0 4px 0 #d42f78, 0 10px 22px rgba(226,51,127,.18); }
.wopt.on .wo-ic { background: linear-gradient(180deg, #ff86b9, #e2337f); }
.wopt.on .wo-ic .ic { color: #fff; }
.wo-tick { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #f4dbe7; color: #fff; }
.wo-tick svg { width: 14px; height: 14px; }
.wopt.on .wo-tick { background: var(--rose); }
.wo-rib { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; font-weight: 800; letter-spacing: .4px; color: #6b3a00; background: linear-gradient(180deg, #ffe58a, #ffc233); border-radius: 999px; padding: 3px 9px; box-shadow: 0 2px 0 #c98a00; }
#plNote { text-align: center; }

.wallet.tmusic { left: auto; right: calc(10px + env(safe-area-inset-right, 0px)); padding: 0; width: 44px; justify-content: center; z-index: 31; }
.wallet.tmusic .ic { width: 22px; height: 22px; color: #8a5a00; }

.ssn-go.ssn-locked { background: #ece3ea; color: #8f7a88; box-shadow: 0 4px 0 #cdbfc9; filter: saturate(.4); }
.ssn-go.ssn-locked .ic { color: #8f7a88; }
.ssn-hint { display: block; font-size: 11.5px; font-weight: 700; color: #8a5a72; margin-top: 3px; }
.ssn-pop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(58,18,48,.45); animation: ssnFade .18s ease-out; }
.ssn-popc { width: min(320px, 100%); background: #fff; border-radius: 24px; padding: 22px 18px 16px; text-align: center; box-shadow: 0 18px 40px rgba(58,18,48,.35); animation: ssnPopIn .22s cubic-bezier(.2,1.4,.5,1); }
.ssn-popi { width: 58px; height: 58px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #ff86b9, #e2337f); }
.ssn-popi .ic { width: 28px; height: 28px; color: #fff; }
.ssn-popc h3 { margin: 4px 0 6px; font-size: 20px; }
.ssn-popc p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.4; color: #6d4a5e; }
.ssn-popc .btn { width: 100%; margin: 0; }
@keyframes ssnFade { from { opacity: 0; } }
@keyframes ssnPopIn { from { transform: scale(.85); opacity: 0; } }

.ssn-popi.gold { background: linear-gradient(180deg, #fff1b3, #ffbf1f); }
.ssn-popi.gold .ic { width: 34px; height: 34px; }
.ssn-popc .btn + .btn, .ssn-popc .lc-left + .btn { margin-top: 8px; }
.lc-left { display: block; margin: 4px 0 2px; font-size: 12px; font-weight: 700; color: #8a5a72; }

.frow .sbtn.more { flex: none; width: 34px; min-width: 34px; padding: 0; justify-content: center; background: transparent; box-shadow: none; color: #a0607e; }
.frow .sbtn.more .ic { width: 18px; height: 18px; }
.ssn-popc.pm .btn { width: 100%; margin: 0 0 8px; }
.ssn-popc.pm .pm-why p { margin: 0 0 10px; }
.ssn-popc.pm .pm-blk.sure { background: #ffe1e1; color: #c62828; }

/* ===================== v6.32 IN-MATCH CONTROLLER (redesign) =====================
   Bug fixed: the home ".side" rule (landscape phones: top 50% + translateY(-50%)) also hit #touch .side and floated the
   pads to the middle of the screen. Pads now sit in the bottom corners, thumb-sized (56 px min), safe-area aware,
   glossy cartoon buttons tinted with the player's colour (--pc), clear pressed state. */
body #touch .side { position: absolute; top: 0; bottom: 0; height: auto; width: 50%; margin: 0; transform: none; display: block; gap: 0; z-index: auto; pointer-events: none; }
body #touch.solo .side { width: 100%; }
body #touch .tb { --pc: 233,30,99; position: absolute; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: 68px; height: 68px; margin: 0; padding: 0; border-radius: 24px; border: 3px solid #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; opacity: .94; pointer-events: auto;
  background: radial-gradient(120% 90% at 30% 18%, rgba(255,255,255,.55), rgba(255,255,255,0) 46%), linear-gradient(180deg, rgba(var(--pc),.95), rgba(var(--pc),.8));
  box-shadow: 0 5px 0 rgba(40,10,30,.28), 0 9px 18px rgba(40,10,30,.22), inset 0 -4px 0 rgba(0,0,0,.14);
  transition: transform .05s ease-out, box-shadow .05s ease-out, filter .05s; touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
body #touch .tb .ic { width: 32px; height: 32px; stroke-width: 3.2; filter: drop-shadow(0 1px 0 rgba(0,0,0,.18)); }
body #touch .tb small { font-size: 10px; font-weight: 800; letter-spacing: .6px; margin-top: -1px; text-shadow: 0 1px 0 rgba(0,0,0,.2); }
body #touch .tb.on { transform: translateY(4px) scale(.95); filter: brightness(1.12); box-shadow: 0 1px 0 rgba(40,10,30,.28), 0 3px 8px rgba(40,10,30,.2), inset 0 -2px 0 rgba(0,0,0,.14); }
body #touch .tb.j { width: 80px; height: 80px; border-radius: 50%; }
body #touch .tag { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); font-size: 12px; padding: 3px 10px; box-shadow: 0 2px 0 rgba(0,0,0,.15); }
/* solo / online: arrows bottom-left, jump bottom-right */
body #touch.solo .side .l { left: max(16px, env(safe-area-inset-left)); right: auto; }
body #touch.solo .side .r { left: calc(max(16px, env(safe-area-inset-left)) + 80px); right: auto; }
body #touch.solo .side .j { left: auto; right: max(20px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
body #touch.solo .side .tag { left: max(16px, env(safe-area-inset-left)); right: auto; }
/* two players on one phone: each player owns a bottom corner (arrows on the outside, jump just inside, raised) */
body #touch:not(.solo) .tb { width: 58px; height: 58px; border-radius: 20px; }
body #touch:not(.solo) .tb.j { width: 62px; height: 62px; border-radius: 50%; }
body #touch:not(.solo) .tb .ic { width: 28px; height: 28px; }
body #touch:not(.solo) .tb small { display: none; }
body #touch:not(.solo) .p0 .l { left: max(10px, env(safe-area-inset-left)); }
body #touch:not(.solo) .p0 .r { left: calc(max(10px, env(safe-area-inset-left)) + 66px); }
body #touch:not(.solo) .p0 .j { left: calc(max(10px, env(safe-area-inset-left)) + 132px); bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
body #touch:not(.solo) .p1 .r { right: max(10px, env(safe-area-inset-right)); }
body #touch:not(.solo) .p1 .l { right: calc(max(10px, env(safe-area-inset-right)) + 66px); }
body #touch:not(.solo) .p1 .j { right: calc(max(10px, env(safe-area-inset-right)) + 132px); bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
body #touch:not(.solo) .tag { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
body #touch:not(.solo) .p0 .tag { left: max(10px, env(safe-area-inset-left)); }
body #touch:not(.solo) .p1 .tag { right: max(10px, env(safe-area-inset-right)); left: auto; }
/* very narrow portrait phones: jump sits above the inner arrow so each side fits in half the screen */
@media (max-width: 420px) {
  body #touch:not(.solo) .tb { width: 56px; height: 56px; }
  body #touch:not(.solo) .p0 .r { left: calc(max(8px, env(safe-area-inset-left)) + 62px); }
  body #touch:not(.solo) .p0 .j { left: calc(max(8px, env(safe-area-inset-left)) + 62px); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; }
  body #touch:not(.solo) .p1 .l { right: calc(max(8px, env(safe-area-inset-right)) + 62px); }
  body #touch:not(.solo) .p1 .j { right: calc(max(8px, env(safe-area-inset-right)) + 62px); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; }
  body #touch:not(.solo) .tag { bottom: calc(144px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { body #touch .tb { transition: none; } }
body #touch .side.p0 { left: 0; right: auto; } body #touch .side.p1 { left: auto; right: 0; } body #touch.solo .side.p0 { right: 0; }
.wshare { margin: 2px auto 8px; display: inline-flex; }
#win .card { text-align: center; }

/* v6.32 short phones: the Style side button would cover the Solo tile; Style stays in the character dialog */
/* v6.34: Style stays on short phones too (the side columns have their own space now) */

/* =====================================================================================================
   v6.33 HOME LAYOUT (Wali): Play button up in the centre between the side buttons, the 4 mode cards below.
   One grid for every screen; phones portrait / tablets / laptops; no overlap anywhere. Wins over the older
   home rules above by specificity (#menu.home ...).
   ===================================================================================================== */
#menu.home .home-main { position: relative; display: grid; width: 100%; max-width: 560px; margin: 0 auto; padding: 4px 8px 6px; box-sizing: border-box;
  grid-template-columns: 74px minmax(0, 1fr) 74px; grid-template-areas: "l brand r" "l cta r" "cards cards cards";
  grid-template-rows: auto auto auto; align-content: center; justify-content: stretch; column-gap: 4px; row-gap: clamp(8px, 1.8vh, 16px); flex: 1 1 auto; }
#menu.home .home-brand { grid-area: brand; max-width: none; align-self: end; min-width: 0; }
#menu.home .logo img { width: 100%; max-width: 330px; max-height: 17vh; height: auto; object-fit: contain; }
#menu.home .sub { margin: 2px 0 0; font-size: 12.5px; text-align: center; }
#menu.home .duo { display: none; }
#menu.home .home-act { display: contents; }
#menu.home .home-cta { grid-area: cta; display: flex; flex-direction: column; align-items: center; gap: 8px; align-self: start; min-width: 0; }
#menu.home .playbtn { width: 100%; max-width: 300px; height: 62px; font-size: 28px; margin: 0; }
#menu.home .instpill { max-width: 100%; }
#menu.home .mcards { grid-area: cards; width: 100%; max-width: 480px; justify-self: center; gap: 12px; align-self: start; }
#menu.home .mcard { aspect-ratio: 1.3; }
#menu.home .side { position: static; transform: none; margin: 0; top: auto; left: auto; right: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; align-self: center; z-index: 3; }
#menu.home .side-l { grid-area: l; } #menu.home .side-r { grid-area: r; }
#menu.home .fab { width: 74px; }
#menu.home .fab small { display: block; max-width: 74px; white-space: normal; text-align: center; line-height: 1.12; padding: 2px 6px; font-size: 11px; }
#menu.home .fab .fi { width: 50px; height: 50px; }
#menu.home .fhot { position: absolute; top: -4px; right: 0; padding: 1px 5px; border-radius: 8px; background: #ff2d55; color: #fff; font: 700 9px/1.3 Fredoka, system-ui, sans-serif; font-style: normal; border: 1.5px solid #fff; letter-spacing: .3px; animation: beat 1.4s infinite; }
#menu.home .f-invite .fi { background: radial-gradient(circle at 35% 28%, #fff3b0, #ffc31f 55%, #e08a00); }
#menu.home .f-invite small { background: linear-gradient(180deg, #fff6c4, #ffe08a); }
/* short phones */
@media (orientation: portrait) and (max-height: 740px) {
  #menu.home .home-main { row-gap: 8px; }
  #menu.home .logo img { max-height: 13vh; }
  #menu.home .mcard { aspect-ratio: 1.55; }
  #menu.home .playbtn { height: 54px; font-size: 25px; }
  #menu.home .side { gap: 6px; } #menu.home .fab .fi { width: 44px; height: 44px; }
}
@media (max-width: 360px) { #menu.home .home-main { grid-template-columns: 66px minmax(0, 1fr) 66px; padding: 4px 4px; } #menu.home .fab, #menu.home .fab small { width: 66px; max-width: 66px; } #menu.home .fab small { font-size: 10px; padding: 2px 4px; } }
/* tall phones / tablets portrait: a bit more air */
@media (orientation: portrait) and (min-height: 900px) { #menu.home .logo img { max-height: 19vh; } #menu.home .playbtn { height: 68px; } }
@media (orientation: portrait) and (min-width: 600px) { #menu.home .home-main { max-width: 640px; grid-template-columns: 96px minmax(0, 1fr) 96px; } #menu.home .mcards { max-width: 560px; } #menu.home .fab { width: 90px; } #menu.home .fab small { max-width: 90px; font-size: 12px; } }

/* LANDSCAPE (laptops, desktops, tablets, and phones behind the rotate card):
   [left rail] [brand + PLAY] [2x2 cards sized by the height] [right rail], centred, max 1180px */
@media (orientation: landscape) {
  #menu.home .home-main { max-width: 1260px; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1.3fr) 96px; grid-template-rows: 1fr auto 1fr;
    grid-template-areas: "l brand cards r" "l cta cards r" "l . cards r"; column-gap: clamp(12px, 2.4vw, 36px); row-gap: 14px; align-content: stretch; padding: 6px 16px 10px; }
  #menu.home .home-brand { align-self: end; }
  #menu.home .home-cta { align-self: start; }
  #menu.home .logo img { max-width: 420px; max-height: 24vh; }
  #menu.home .playbtn { max-width: 340px; height: 64px; }
  #menu.home .mcards { align-self: center; max-width: none; width: min(100%, calc((100vh - 190px) * 1.42)); }
  #menu.home .mcard { aspect-ratio: 1.42; }
  #menu.home .side { align-self: center; gap: 14px; }
  #menu.home .fab { width: 92px; } #menu.home .fab small { max-width: 92px; font-size: 12px; }
}
@media (orientation: landscape) and (min-width: 1500px) { #menu.home .home-main { max-width: 1320px; } #menu.home .logo img { max-width: 480px; } #menu.home .playbtn { height: 74px; font-size: 32px; max-width: 380px; } #menu.home .fab .fi { width: 60px; height: 60px; } #menu.home .fab .fi .ic { width: 30px; height: 30px; } }
@media (orientation: landscape) and (max-height: 640px) { #menu.home .mcards { width: min(100%, calc((100vh - 150px) * 1.5)); } #menu.home .mcard { aspect-ratio: 1.5; } #menu.home .side { gap: 8px; } #menu.home .fab .fi { width: 44px; height: 44px; } #menu.home .logo img { max-height: 22vh; } #menu.home .playbtn { height: 54px; font-size: 24px; } }
@media (orientation: landscape) and (max-height: 460px) { #menu.home .home-main { grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1.2fr) 74px; column-gap: 10px; padding: 2px 10px 4px; }
  #menu.home .fab { width: 74px; } #menu.home .fab small { font-size: 10px; max-width: 74px; } #menu.home .fab .fi { width: 38px; height: 38px; } #menu.home .fab .fi .ic { width: 20px; height: 20px; } #menu.home .side { gap: 4px; }
  #menu.home .sub { display: none; } #menu.home .mcards { gap: 8px; width: min(100%, calc((100vh - 120px) * 1.6)); } #menu.home .mcard { aspect-ratio: 1.6; } }

/* v6.33 phones held sideways outside a match: ask to turn the phone upright (touch screens only; laptops never see it) */
.rothome { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  body:is([data-scr="menu"], [data-scr="settings"], [data-scr="levels"], [data-scr="friends"], [data-scr="wpage"], [data-scr="camp"], [data-scr="vs"], [data-scr="how"]):not(.rot-ok) .rothome {
    display: grid; place-items: center; position: fixed; inset: 0; z-index: 2147483000; background: radial-gradient(circle at 50% 35%, #fff2f7, #ffd6e7 70%, #ffc1da); }  body:is([data-scr="menu"], [data-scr="settings"], [data-scr="levels"], [data-scr="friends"], [data-scr="wpage"], [data-scr="camp"], [data-scr="vs"], [data-scr="how"]):not(.rot-ok) .rr-chip { display: none !important; }   /* v6.40.1: nothing floats over the card */
}
.rothome .rh-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 28px; max-width: 420px; text-align: center; color: var(--ink); background: #fff; border-radius: 26px; box-shadow: 0 10px 30px rgba(194, 24, 91, .22); }
.rothome .rh-ic { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; background: linear-gradient(180deg, #ff6aa8, #d81b60); color: #fff; animation: rhTurn 2.4s ease-in-out infinite; }
.rothome .rh-ic .ic { width: 38px; height: 38px; }
.rothome b { font-size: 21px; font-weight: 700; } .rothome small { font-size: 14px; opacity: .8; }
.rothome .rh-go { margin-top: 8px; min-width: 160px; min-height: 46px; }   /* v6.40.1: the card can never trap anyone */
@keyframes rhTurn { 0%, 30% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { .rothome .rh-ic { animation: none; } }

/* v6.33 polish: room-code join = big full-width code box with the Join button under it (same pattern as Add friend) */
#net :has(> #joinCode) { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
#net #joinCode { width: 100%; box-sizing: border-box; height: 56px; font-size: 26px; font-weight: 700; letter-spacing: 10px; text-align: center; text-transform: uppercase; }
#net #joinBtn { width: 100%; justify-content: center; }

.connect.one { grid-template-columns: 1fr; }
.cbtn[hidden] { display: none !important; }
.lgbig[hidden], .fbbox[hidden] { display: none !important; }

/* v6.33: the "turn your phone upright" card hides the ad banner too */
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  body:is([data-scr="menu"], [data-scr="settings"], [data-scr="levels"], [data-scr="friends"], [data-scr="wpage"], [data-scr="camp"], [data-scr="vs"], [data-scr="how"]):not(.rot-ok) #adBanner { display: none !important; }
}

/* v6.33 day badge sits on the top corner of the button so it never covers the label */
.fab .fday, .fab .fday[class] { top: -5px !important; left: auto; right: -6px; transform: none; font-size: 9.5px; padding: 1px 5px; }

/* =====================================================================================================
   v6.34 HOME ON REAL PHONES (Wali: v6.32 look, nothing overlapping at 360x~690 with Chrome's bars).
   Portrait: [left column] [logo + tagline + PLAY] [right column] - the side columns span only the logo/PLAY rows,
   so they can never reach the logo, the tagline or the tiles; the 4 mode tiles sit below across the full width.
   Every size comes from the HEIGHT (vh clamps) so short phones get tighter spacing, never a scaled page.
   ===================================================================================================== */
@media (orientation: portrait) {
  #menu.home .home-top { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 0; }
  #menu.home .home-main { max-width: 480px; padding: clamp(2px, 1vh, 10px) 10px clamp(4px, 1.4vh, 14px);
    grid-template-columns: 74px minmax(0, 1fr) 74px; grid-template-rows: auto auto auto;
    grid-template-areas: "l brand r" "l cta r" "cards cards cards"; column-gap: 6px; row-gap: clamp(6px, 1.7vh, 18px); align-content: center; }
  #menu.home .home-brand { align-self: end; display: flex; flex-direction: column; align-items: center; }
  #menu.home .logo { margin: 0; }
  #menu.home .logo img { width: 100%; max-width: 300px; max-height: clamp(58px, 11.5vh, 112px); display: block; margin: 0 auto; }
  #menu.home .sub { display: block; margin: 4px 0 0; padding: 3px 12px 4px; font-size: clamp(11px, 1.7vh, 13.5px); line-height: 1.2; white-space: nowrap; text-align: center; max-width: 100%; overflow: visible; }
  #menu.home .sub .sdot { display: none; } #menu.home .sub .sub2 { display: block; font-size: .84em; font-weight: 500; opacity: .85; }
  #menu.home .home-cta { grid-area: cta; align-self: start; gap: clamp(5px, 1vh, 9px); width: 100%; }
  #menu.home .playbtn { width: 100%; max-width: 260px; height: clamp(48px, 7.4vh, 66px); font-size: clamp(22px, 3.6vh, 30px); margin: 0 auto; }
  #menu.home .instpill { max-width: 100%; margin: 0 auto; padding-top: 6px; padding-bottom: 6px; }
  #menu.home .side { align-self: center; justify-content: center; gap: clamp(4px, 1vh, 12px); padding: 0; }
  #menu.home .fab { width: 74px; position: relative; }
  #menu.home .fab .fi { width: clamp(40px, 6.6vh, 54px); height: clamp(40px, 6.6vh, 54px); }
  #menu.home .fab .fi .ic { width: clamp(20px, 3.3vh, 27px); height: clamp(20px, 3.3vh, 27px); }
  #menu.home .fab small { max-width: 74px; font-size: clamp(10px, 1.45vh, 11.5px); padding: 2px 5px; margin-top: 2px; white-space: nowrap; }
  #menu.home .mcards { max-width: 460px; gap: clamp(8px, 1.5vh, 14px); }
  #menu.home .mcard { aspect-ratio: 1.32; }
}
/* short phones: a little flatter tiles, same layout */
@media (orientation: portrait) and (max-height: 760px) { #menu.home .mcard { aspect-ratio: 1.5; } }
@media (orientation: portrait) and (max-height: 660px) { #menu.home .mcard { aspect-ratio: 1.75; } #menu.home .mcards { max-width: 400px; } }
@media (orientation: portrait) and (max-height: 580px) { #menu.home .mcard { aspect-ratio: 2.1; } #menu.home .sub { display: none; } }
@media (orientation: portrait) and (max-width: 350px) { #menu.home .home-main { grid-template-columns: 62px minmax(0, 1fr) 62px; padding-left: 6px; padding-right: 6px; column-gap: 4px; } #menu.home .fab, #menu.home .fab small { width: 62px; max-width: 62px; } #menu.home .fab small { font-size: 9px; padding: 2px 2px; white-space: normal; } }
@media (orientation: portrait) and (min-width: 600px) { #menu.home .home-main { max-width: 620px; grid-template-columns: 96px minmax(0, 1fr) 96px; } #menu.home .mcards { max-width: 560px; } #menu.home .fab { width: 92px; } #menu.home .fab small { max-width: 92px; font-size: 12px; } }

/* badges live INSIDE their button: Day N = small pill on the gift icon's top-right corner; FREE on the coin icon */
#menu.home .fab .fday, #menu.home .fab .fday[class] { position: absolute; top: -2px !important; right: 0 !important; left: auto !important; bottom: auto; transform: none !important;
  font: 700 9px/1.25 Fredoka, system-ui, sans-serif; padding: 1px 4px; border-radius: 8px; border: 1.5px solid #fff; white-space: nowrap; z-index: 2; }
#menu.home .f-daily:has(.fday:not([hidden])) .fdot { display: none; }
#menu.home .fab .fdot { top: 0; right: 8px; }
#menu.home .fhot { top: -2px; right: 0; }

/* the "Download Android app" pill is not on home any more (the Install button does that job) */
#rrDlPill { display: none !important; }

/* v6.34 LAPTOP / DESKTOP home: the side rails sit right next to the content (not at the far screen edges), bigger
   buttons and logo, everything centred as one block - a proper game-site landing. Phones held sideways see the rotate card. */
@media (orientation: landscape) and (min-height: 540px) {
  #menu.home .home-main { max-width: 1240px; grid-template-columns: 112px minmax(0, 480px) minmax(0, 720px) 112px; justify-content: center;
    column-gap: clamp(18px, 2.8vw, 48px); row-gap: clamp(10px, 2vh, 20px); padding: 0 20px 8px; }
  #menu.home .side { gap: clamp(10px, 2vh, 18px); }
  #menu.home .fab { width: 112px; }
  #menu.home .fab .fi { width: clamp(52px, 7.4vh, 66px); height: clamp(52px, 7.4vh, 66px); }
  #menu.home .fab .fi .ic { width: clamp(26px, 3.6vh, 32px); height: clamp(26px, 3.6vh, 32px); }
  #menu.home .fab small { max-width: 112px; font-size: clamp(12px, 1.7vh, 14px); padding: 3px 9px; white-space: nowrap; }
  #menu.home .fhot { font-size: 10.5px; padding: 1px 6px; top: -2px; right: 14px; }
  #menu.home .fab .fday, #menu.home .fab .fday[class] { right: 14px !important; font-size: 10.5px; }
  #menu.home .logo img { max-width: 480px; max-height: 27vh; }
  #menu.home .sub { font-size: clamp(13px, 1.8vh, 16px); padding: 5px 16px; white-space: nowrap; max-width: none; }
  #menu.home .playbtn { max-width: 360px; height: clamp(58px, 8.6vh, 78px); font-size: clamp(26px, 3.8vh, 34px); }
  #menu.home .mcards { width: min(100%, calc((100vh - 200px) * 1.38)); gap: clamp(10px, 1.8vh, 18px); }
  #menu.home .mcard { aspect-ratio: 1.38; }
  #menu.home .mc-lab b { font-size: clamp(15px, 2.2vh, 19px); } #menu.home .mc-lab small { font-size: clamp(11.5px, 1.6vh, 13.5px); display: block; }
}
@media (orientation: landscape) and (min-height: 540px) and (max-width: 1100px) {
  #menu.home .home-main { grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1.2fr) 92px; column-gap: 16px; padding: 0 12px 6px; }
  #menu.home .fab { width: 92px; } #menu.home .fab small { max-width: 92px; font-size: 12px; padding: 2px 6px; } #menu.home .fhot, #menu.home .fab .fday, #menu.home .fab .fday[class] { right: 6px !important; }
  #menu.home .logo img { max-width: 360px; }
}

/* v6.34 small-phone fixes found by the screen checker */
div.af2 p.af2-sub, .af2 .af2-sub.af2-sub { margin-right: 46px; }
.av-id { min-width: 0; flex: 1 1 auto; }
.avname { display: flex; gap: 6px; min-width: 0; }
#avName { min-width: 0; flex: 1 1 auto; width: auto; }
.av-acct, .av-acct > * { max-width: 100%; box-sizing: border-box; }
.av-acct .acct-in { white-space: normal; text-align: left; line-height: 1.2; }
@media (max-width: 420px) {
  .av-head { gap: 10px; }
  .av-prev { width: 84px !important; height: 84px !important; } .av-prev > svg, .av-prev > canvas:not(#avInGame) { width: 84px !important; height: 84px !important; }
  #avNameOk span { display: none; } #avNameOk { flex: none; padding-left: 10px; padding-right: 10px; }
}

/* v6.34: the Install pill on home is one tidy line (the subtitle only where there is room); the old top "Install Rope Rush" banner
   is not used any more - it covered the profile, the Daily badge and the logo, and the Install pill on home already offers the same */
#installBanner { display: none !important; }
#menu.home .instpill { min-height: 40px; padding: 5px 16px 5px 12px; gap: 8px; }
#menu.home .instpill span { font-size: 14px; white-space: nowrap; }
#menu.home .instpill .isub { white-space: nowrap; font-size: 10.5px; }
@media (orientation: portrait) and (max-width: 480px) { #menu.home .instpill .isub { display: none; } #menu.home .instpill { min-height: 38px; } }
@media (orientation: portrait) and (min-height: 600px) { #menu.home .mc-lab small { display: block; } }
@media (orientation: portrait) and (max-width: 350px) { #menu.home .mc-lab small { font-size: 10px; } }
/* v6.34 Gift codes side button (giftcode.js) */
#menu.home .f-gift .fi { background: radial-gradient(circle at 35% 28%, #b9fbe0, #2ed3a0 55%, #0e9f76); color: #fff; }
#menu.home .f-gift small { background: #fff; }
/* v6.34: Friends page offer strip - both lines readable on a 360px phone (no '...') */
#refBox .rr-offer-strip .ros-t b, #refBox .rr-offer-strip .ros-t small { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.25; }

/* =====================================================================================================
   v6.34b HOME + NAV REDESIGN (Wali 2:43 PM): home keeps only Daily reward (left) and Free coins (right), each hugging
   its screen edge beside the logo; logo + tagline centred; PLAY big in the middle; the 4 mode tiles below.
   Style -> profile dialog, Gift codes -> Settings, Tournament + Earn -> bottom nav, Install -> floating chip.
   ===================================================================================================== */
#menu.home .fab[data-moved] { display: none !important; }
#menu.home #installBtn, #menu.home .instpill { display: none !important; }
#menu.home .f-coins.cooling .fi { filter: saturate(.55); }
#menu.home .f-coins.cooling small { font-variant-numeric: tabular-nums; }
@media (orientation: portrait) {
  #menu.home .home-main { max-width: none; padding: clamp(4px, 1.4vh, 14px) max(6px, env(safe-area-inset-right)) clamp(6px, 1.6vh, 16px) max(6px, env(safe-area-inset-left));
    grid-template-columns: 80px minmax(0, 1fr) 80px; grid-template-rows: auto auto auto;
    grid-template-areas: "l brand r" "cta cta cta" "cards cards cards"; column-gap: 4px; row-gap: clamp(10px, 2.7vh, 30px); align-content: center; }
  #menu.home .home-brand { align-self: center; }
  #menu.home .logo img { max-width: 260px; max-height: clamp(64px, 12.5vh, 124px); }
  #menu.home .sub { margin-top: clamp(4px, 1vh, 10px); }
  #menu.home .side { align-self: center; justify-content: center; }
  #menu.home .side-l { justify-self: start; } #menu.home .side-r { justify-self: end; }
  #menu.home .fab { width: 80px; }
  #menu.home .fab .fi { width: clamp(48px, 7.6vh, 62px); height: clamp(48px, 7.6vh, 62px); }
  #menu.home .fab .fi .ic { width: clamp(24px, 3.8vh, 31px); height: clamp(24px, 3.8vh, 31px); }
  #menu.home .fab small { max-width: 80px; font-size: clamp(10.5px, 1.6vh, 12.5px); padding: 2px 7px; margin-top: 3px; }
  #menu.home .home-cta { width: 100%; justify-self: center; }
  #menu.home .playbtn { max-width: 280px; height: clamp(52px, 8vh, 70px); font-size: clamp(24px, 3.9vh, 32px); }
  #menu.home .mcards { max-width: 460px; width: calc(100% - 8px); justify-self: center; }
}
@media (orientation: portrait) and (max-width: 350px) { #menu.home .home-main { grid-template-columns: 68px minmax(0, 1fr) 68px; } #menu.home .fab, #menu.home .fab small { width: 68px; max-width: 68px; } #menu.home .fab small { font-size: 10px; padding: 2px 3px; white-space: nowrap; } }
@media (orientation: portrait) and (min-width: 600px) { #menu.home .home-main { grid-template-columns: 104px minmax(0, 1fr) 104px; padding-left: 16px; padding-right: 16px; } #menu.home .fab { width: 100px; } #menu.home .fab small { max-width: 100px; font-size: 13px; } #menu.home .mcards { max-width: 560px; } }
/* the floating install chip sits above the tab bar; home keeps that strip free so the chip never covers a tile */
body.tabs-on.chip-on #menu.home { padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
body.tabs-on.chip-on.ad-banner-on #menu.home { padding-bottom: calc(172px + env(safe-area-inset-bottom, 0px)); }
@media (orientation: landscape) { body.tabs-on.chip-on #menu.home { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }
/* bottom nav: 5 even buttons, Home raised in the middle; Earn gets the gold coin colour */
.tabbar button.t-earn:not(.on) { color: #c97a00; }
.tabbar button { position: relative; }
.tabbar .tdot { position: absolute; top: 8px; right: calc(50% - 18px); }
.wallet .tdot { position: absolute; top: -2px; right: -2px; }
/* page header with a back arrow (Wallet, Settings: reached from the top bar, not the nav) */
.phead { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.phead .ptitle { margin: 0; flex: 1; min-width: 0; }
.phead .pback { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; color: var(--rose, #c2185b); display: grid; place-items: center; padding: 0; cursor: pointer;
  box-shadow: 0 3px 0 rgba(163,19,74,.18), 0 4px 12px rgba(120,0,60,.12); }
.phead .pback .ic { width: 22px; height: 22px; }

/* v6.34: Coin history button inside the Wallet hero */
.whero .wh-hist { margin-left: auto; align-self: center; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; border: 0; border-radius: 14px; background: rgba(255,255,255,.85); color: #8a4a00; font: 700 11.5px/1.15 Fredoka, system-ui, sans-serif; box-shadow: 0 2px 0 rgba(138,74,0,.18); cursor: pointer; max-width: 84px; text-align: center; }
.whero .wh-hist .ic { width: 22px; height: 22px; }

/* v6.34 profile dialog: Get Premium + Style as two equal buttons, the account line full width below */
#avDlg .av-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 6px; }
#avDlg .av-chips .prem-chip { margin: 0; width: 100%; min-height: 38px; justify-content: center; box-sizing: border-box; white-space: nowrap; }
#avDlg .av-acct { width: 100%; }
#avDlg .av-chips { width: 100%; } #avDlg .av-chips .prem-chip { min-width: 0; max-width: none; padding-left: 8px; padding-right: 8px; overflow: hidden; }
#avDlg .av-acct button, #avDlg .av-acct a { font-size: 13.5px; }
@media (max-width: 400px) { #avDlg .av-acct button, #avDlg .av-acct a { font-size: 12.5px; } }
#avDlg .av-chips { grid-template-columns: minmax(0, 1fr) auto; } #avDlg .av-chips .prem-chip { font-size: 14px; gap: 5px; } #avDlg .av-chips .prem-chip .ic { width: 18px; height: 18px; flex: 0 0 18px; }
@media (max-width: 400px) { #avDlg .av-chips .prem-chip { font-size: 13px; padding-left: 6px; padding-right: 8px; } }

/* v6.34 profile dialog v2 (root): avatar + name row; then Style and Premium as two equal cards across the card; login full width */
#avDlg .av-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 8px; width: 100%; }
#avDlg .av-chips .prem-chip { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; min-height: 56px; margin: 0; width: 100%; padding: 8px 12px; border-radius: 16px; text-align: left; white-space: normal; box-sizing: border-box; font-size: 15px; }
#avDlg .av-chips .prem-chip .ic { width: 26px; height: 26px; flex: 0 0 26px; }
#avDlg .av-chips .prem-chip span { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
#avDlg .av-chips .prem-chip b { font-size: 15.5px; }
#avDlg .av-chips .prem-chip small { font-size: 11.5px; font-weight: 600; opacity: .85; }
#avDlg .av-acct { width: 100%; margin: 0 0 8px; }
#avDlg .av-acct .sbtn { width: 100%; justify-content: center; min-height: 44px; font-size: 14.5px; }
@media (max-width: 400px) { #avDlg .av-chips { gap: 8px; } #avDlg .av-chips .prem-chip { padding: 8px 9px; gap: 7px; } #avDlg .av-chips .prem-chip small { font-size: 10.5px; } }
/* inner pages: the bottom nav (and a banner under it) never hides the last content */
body.tabs-on.ad-banner-on .overlay.tabpage { padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }
body.tabs-on .overlay.tabpage { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

/* ==========================================================================
   v6.35 DESIGN TOKENS: motion, icons, states (MOTION.md is the spec; change values here only)
   Rules: animate transform + opacity only (60fps on low-end Android), no layout properties.
   ========================================================================== */
:root {
  --dur-tap: 100ms;          /* press feedback */
  --dur-fast: 160ms;         /* colour / small state changes, dialog OUT */
  --dur-dlg: 140ms;          /* dialog IN (v6.41 tap lag: was 220; the dialog is already seen in its first frame) */
  --dur-screen: 140ms;       /* page / tab screen IN (v6.41 tap lag: was 240; first frame already shows the page) */
  --dur-ind: 240ms;          /* nav indicator slide */
  --dur-coin: 600ms;         /* coin fly to the counter */
  --dur-count: 600ms;        /* counter count-up */
  --dur-reward: 800ms;       /* reward reveal (gift, win stars) */
  --dur-attn: 4s;            /* idle attention pulse cycle (ready items only) */
  --stagger: 60ms;           /* list / reveal stagger step, max 8 steps */
  --ease-out: cubic-bezier(.2, .8, .2, 1);      /* things arriving */
  --ease-in: cubic-bezier(.4, 0, 1, 1);         /* things leaving */
  --ease-std: cubic-bezier(.4, 0, .2, 1);       /* moving between two places */
  --ease-pop: cubic-bezier(.3, 1.45, .5, 1);    /* rewards only (small overshoot) */
  --press-scale: .96;
  --ic-sm: 16px; --ic-md: 20px; --ic-lg: 24px; --ic-xl: 28px;
  --c-ready: #ff4f9a; --c-disabled-ink: #9a7486;
}

/* --- icons: one size scale --- */
.ic.sm { width: var(--ic-sm); height: var(--ic-sm); } .ic.md { width: var(--ic-md); height: var(--ic-md); }
.ic.lg { width: var(--ic-lg); height: var(--ic-lg); } .ic.xl { width: var(--ic-xl); height: var(--ic-xl); }
.tag .ic, .lane .nm .ic { width: .9em; height: .9em; vertical-align: -.08em; }

/* --- STATE 1/5 default + 2/5 pressed: every button gives feedback within 100ms --- */
:where(button, .btn, [role="button"], a.rr-chip-go) { transition: transform var(--dur-tap) var(--ease-out), box-shadow var(--dur-tap) var(--ease-out), background-color var(--dur-fast) var(--ease-std), color var(--dur-fast) var(--ease-std), opacity var(--dur-fast) var(--ease-std), filter var(--dur-fast) var(--ease-std), scale var(--dur-tap) var(--ease-out); }
:where(button:not(:disabled):not(.btn, .tile, .mood, .set, .wallet, .ibtn, .pchip, .playbtn, .mode, .instpill, .mcard, .fab, .sbtnrow, .sbtn, .big, .lgbig, .wopt, .lvt, .lgb), [role="button"]):where(:not(.seg *, .tabbar *, .av-base *)):active { scale: var(--press-scale); }
/* --- STATE 3/5 disabled: faded, flat, no motion, still readable --- */
:where(button:disabled, button[aria-disabled="true"]):not(.is-busy) { opacity: .5; filter: grayscale(.35); box-shadow: none; cursor: not-allowed; animation: none; }
/* --- STATE 4/5 loading: content hidden (keeps its size, no layout jump), spinner in the middle --- */
button.is-busy, .btn.is-busy { position: relative; pointer-events: none; cursor: progress; }
button.is-busy:not(.fab) > *, .btn.is-busy > * { visibility: hidden; }
button.is-busy:not(.fab)::after, .fab.is-busy .fi::after { content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: rrSpin .7s linear infinite; visibility: visible; }
.fab.is-busy .fi { position: relative; animation: none; } .fab.is-busy .fi .ic { opacity: 0; } .fab.is-busy .fi::after { color: #fff; }
@keyframes rrSpin { to { transform: rotate(360deg); } }
/* --- STATE 5/5 ready: only things the player can act on right now get the attention pulse (one short pulse every 4 s) --- */
.fab .fi { animation: none; }
.fab.is-ready .fi { animation: rrAttn var(--dur-attn) var(--ease-std) infinite; }
.f-coins.is-ready .fi { animation-delay: 2s; }   /* never pulse in sync with Daily */
.fab.is-ready .fi::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid rgba(255, 240, 150, .95); opacity: 0; animation: rrRing var(--dur-attn) var(--ease-out) infinite; animation-delay: inherit; pointer-events: none; }
.fab .fi { position: relative; }
@keyframes rrAttn { 0%, 12%, 100% { transform: scale(1); } 5% { transform: scale(1.09); } 9% { transform: scale(.98); } }
@keyframes rrRing { 0%, 2% { opacity: 0; transform: scale(1); } 6% { opacity: .9; } 22%, 100% { opacity: 0; transform: scale(1.35); } }
/* idle / cooldown: calm, desaturated, no motion; the label carries the time ("Next 12:30") */
.fab.is-idle .fi { animation: none; }
.fab.cooling .fi { animation: none; filter: saturate(.5) brightness(.97); }
.fab.cooling small { font-variant-numeric: tabular-nums; color: #8a5a72; }
/* PLAY: the main action keeps a gentle 4 s breath (same cadence as other ready items) */
.playbtn { animation: rrBreath var(--dur-attn) var(--ease-std) infinite; }
@keyframes rrBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }

/* --- screens and dialogs: IN 240 / 220 ms ease-out, OUT 160 ms ease-in (no overshoot on screens) --- */
.overlay { opacity: 0; transition: opacity var(--dur-fast) var(--ease-in), display var(--dur-fast) allow-discrete; }
.overlay.show { opacity: 1; }
.overlay:not(.show) { pointer-events: none; }
.overlay.show { animation: rrFade var(--dur-dlg) var(--ease-out); }
.overlay.show > .card { animation: rrDlgIn var(--dur-dlg) var(--ease-out); }
.overlay.show > .page { animation: rrScreenIn var(--dur-screen) var(--ease-out); }
#menu.overlay.show { animation: rrFade var(--dur-screen) var(--ease-out); }
/* v6.41 tap lag: a screen is SEEN in the frame of the tap (starts at .7-.8 opacity, 6 px rise) and settles in 140 ms; it no longer fades up from 0 */
@keyframes rrFade { from { opacity: .7; } to { opacity: 1; } }
@keyframes rrDlgIn { from { opacity: .8; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rrScreenIn { from { opacity: .8; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* v6.41 tap lag: when another screen is opening, the old one goes at once (no 160 ms fade on top of the new one) */
body:has(.overlay.show) .overlay:not(.show) { transition: none; }
#toast { transition: opacity var(--dur-fast) var(--ease-in), translate var(--dur-fast) var(--ease-in); translate: 0 8px; }
#toast.show { translate: 0 0; transition-duration: var(--dur-dlg); transition-timing-function: var(--ease-out); }

/* --- bottom nav: one indicator that slides to the active tab --- */
.tabbar button:not(.t-home).on::after { content: none; }
.tabbar .tab-ind { position: absolute; left: 0; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: 18px; height: 4px; border-radius: 2px; background: var(--rose); pointer-events: none; opacity: 0; transform: translateX(var(--ind-x, 0px)) scaleX(1); transition: transform var(--dur-ind) var(--ease-std), opacity var(--dur-fast) var(--ease-std); }
.tabbar .tab-ind.on { opacity: 1; }
.tabbar .tab-ind.nomove { transition: none; }

/* --- coins: fly to the counter, then the counter counts up and bumps --- */
.rr-coinfly { position: fixed; left: 0; top: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; z-index: 90; pointer-events: none; will-change: transform, opacity; }
.rr-coinfly svg { width: 100%; height: 100%; display: block; }
#walletN { font-variant-numeric: tabular-nums; }

/* --- win dialog: title, stars/hearts, then actions (stagger 60 ms, reward pop 800 ms) --- */
#win.show .card > * { animation: rrRise var(--dur-screen) var(--ease-out) both; }
#win.show .card > :nth-child(1) { animation-delay: 0ms; } #win.show .card > :nth-child(2) { animation-delay: 60ms; }
#win.show .card > :nth-child(3) { animation-delay: 120ms; } #win.show .card > :nth-child(4) { animation-delay: 420ms; }
#win.show .card > :nth-child(5) { animation-delay: 480ms; } #win.show .card > :nth-child(6) { animation-delay: 540ms; }
#win.show .card > :nth-child(n+7) { animation-delay: 600ms; }
#win.show #winHearts .ic { animation: rrPop 420ms var(--ease-pop) both; }
#win.show #winHearts .ic:nth-child(1) { animation-delay: 160ms; } #win.show #winHearts .ic:nth-child(2) { animation-delay: 280ms; } #win.show #winHearts .ic:nth-child(3) { animation-delay: 400ms; }
@keyframes rrRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rrPop { 0% { opacity: 0; transform: scale(.3); } 60% { opacity: 1; transform: scale(1.15); } 100% { opacity: 1; transform: scale(1); } }

/* --- countdowns: digits never jump in width --- */
.rrt-cd, .rrt-cd *, #dyNote, #fabCoinsLab { font-variant-numeric: tabular-nums; }

/* --- reduced motion: no movement, instant state changes, nothing loops --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .rr-coinfly { display: none; }
}

/* --- v6.35 TOP BAR: one chip style on every screen (home, inner pages, in game) ---
   white chip, 2px white border, rose icon, same soft shadow; 44px tall; square icon buttons r14, pills r22.
   Gold appears only on the coin glyph itself. */
:root { --chip-bg: rgba(255, 255, 255, .95); --chip-ink: var(--rose); --chip-shadow: 0 3px 0 rgba(194, 24, 91, .16), 0 6px 14px rgba(140, 20, 70, .14); }
body .ibtn, body .wallet, body #topMusic, body #hud .hbtn { background: var(--chip-bg) !important; border: 2px solid #fff !important; color: var(--chip-ink) !important; box-shadow: var(--chip-shadow) !important; background-image: none !important; }
body .ibtn, body #topMusic, body #hud .hbtn { width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; }
body .ibtn .ic, body #topMusic .ic, body #hud .hbtn .ic { width: 24px; height: 24px; }
body .wallet { height: 44px; border-radius: 22px; padding: 0 14px 0 5px; }
body .wallet b, body .wallet #walletN { color: var(--ink) !important; text-shadow: none !important; -webkit-text-stroke: 0 !important; font-size: 18px; }
body .wallet .gcoin { width: 30px; height: 30px; filter: none; }
body #hud .chip { background: var(--chip-bg); border: 2px solid #fff; color: var(--chip-ink); box-shadow: var(--chip-shadow); height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; }
#homeMusic[aria-pressed="false"], #hudMusic[aria-pressed="false"], #topMusic[aria-pressed="false"] { color: #9a7486 !important; }
body .ibtn:active, body #topMusic:active, body #hud .hbtn:active, body .wallet:active { transform: translateY(2px) scale(.96); box-shadow: 0 1px 0 rgba(194, 24, 91, .16), 0 3px 8px rgba(140, 20, 70, .14) !important; }

/* --- v6.35 PREMIUM BADGE (one emblem everywhere; icons.js #i-pbadge, RRBadge()) --- */
.prem-emb { width: 76px; height: 76px; margin: 0 auto 2px; filter: drop-shadow(0 5px 0 rgba(160, 90, 0, .22)); }
.prem-emb svg { width: 100%; height: 100%; display: block; }
#premDlg:not([hidden]) .prem-emb { animation: rrPop 600ms var(--ease-pop) both; }
#premDlg:not([hidden]) .prem-emb .pb-shine, .rr-pb.reveal .pb-shine { animation: rrShine 900ms var(--ease-std) 350ms both; }
.pb-shine { opacity: 0; }
@keyframes rrShine { 0% { opacity: 0; transform: translate(-30px, 30px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(30px, -30px); } }
#premTitle { margin: 2px 0 4px; letter-spacing: .02em; }
#premState { margin: 0 auto 8px; }
#premState.prem-left { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #fff3c4; color: #8a5a00; font-weight: 800; font-size: 12.5px; }
.prem-list .erow small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prem-chip .ic, #premGet .ic, .gr-crown .ic { filter: drop-shadow(0 1px 0 rgba(120, 60, 0, .2)); }
.prem-chip.on { box-shadow: 0 0 0 2px #ffc93c inset; }
.rr-pb { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; } .rr-pb-i { width: 1.4em; height: 1.4em; }
.rr-pb em { font-style: normal; font-size: 11px; font-weight: 800; color: #8a5a00; background: #fff3c4; padding: 1px 7px; border-radius: 999px; }
/* --- v6.35 Wallet: Daily reward lives on home only --- */
#wpage .gcard.streak { display: none !important; }

/* v6.35 tournament: token icons (same family), Weekly trophy / Monthly cup */
#tour.k-w .rrt-cup-m, #tour.k-m .rrt-cup-w, #tour:not(.k-m):not(.k-w) .rrt-cup-m { display: none; }
#tour .rrt-cup { filter: drop-shadow(0 4px 0 rgba(140, 60, 0, .18)); }
#tour .rrt-g .ic { width: 18px; height: 18px; }

/* v6.38 Friends: one login choice (Facebook recommended, Google); hidden once logged in */
.cn-h { margin: 2px 2px 8px; font-size: 13px; font-weight: 800; color: var(--ink); }
.cn-h[hidden] { display: none; }
.connect .cbtn { justify-content: center; min-height: 48px; font-size: 15px; }
.connect .cbtn span { flex: 0 1 auto; }

/* v6.38 Online room: polished player cards (real Style avatar, name, level, coins), no colour picker */
#net .lobby.sized { gap: 10px; align-items: stretch; }
#net .lobby.sized .lp { position: relative; flex-direction: column; flex-wrap: nowrap; align-items: center; justify-content: center; text-align: center; gap: 3px; min-height: 0; padding: 12px 8px 10px;
  border: 2px solid #fff; border-radius: 18px; background: linear-gradient(180deg, #fff 0%, #fff3f8 100%); box-shadow: 0 3px 0 rgba(194, 24, 91, .14), 0 6px 14px rgba(140, 20, 70, .10); }
#net .lp .lav { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(180deg, #ffe7f0, #ffcfe0); overflow: hidden; flex: none; }
#net .lobby.n2:not(.teams) .lp .lav { width: 62px; height: 62px; border-radius: 18px; }
#net .lp .lav canvas { display: block; width: 40px; height: 40px; }
#net .lobby.n2:not(.teams) .lp .lav canvas { width: 56px; height: 56px; }
#net .lp .lav .ic { width: 26px; height: 26px; color: #e3bfd0; }
#net .lp b, #net .lobby.n2 .lp b { font-size: 16px; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#net .lp .lst { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; font-size: 12px; font-weight: 700; color: #8a4a68; line-height: 1.2; }
#net .lp .lco { display: inline-flex; align-items: center; gap: 3px; }
#net .lp .lco .ic { width: 14px; height: 14px; }
#net .lp .tm.host { position: absolute; top: 6px; right: 6px; margin: 0; }
#net .lp .lyou { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 800; color: #6b3a00; background: linear-gradient(180deg, #ffe58a, #ffc233); border-radius: 8px; padding: 1px 6px; }
#net .lp.me { box-shadow: 0 0 0 3px #ffd34d, 0 3px 0 rgba(194, 24, 91, .14), 0 6px 14px rgba(140, 20, 70, .10); }
#net .lobby.sized .lp.empty { border: 2px dashed #e7bfd2; background: rgba(255, 255, 255, .55); box-shadow: none; color: #a07890; }
#net .lp.empty .lav { background: #f7e9f0; }
#net .lp.empty b { font-size: 14px; font-weight: 700; }
#net .lobby .vsm { align-self: center; }
#lobbyInfo[hidden] { display: none; }

/* v6.38 TOP BAR (Wali): one line for every top-bar item, and the mute button at exactly the same spot on every page.
   --tb-top = top of the 44px buttons; every item is centred on --tb-top + 22px. Home's own items are pinned to the same spots. */
:root { --tb-top: calc(16px + env(safe-area-inset-top, 0px)); --tb-l: calc(12px + env(safe-area-inset-left, 0px)); --tb-r: calc(12px + env(safe-area-inset-right, 0px)); }
body .wallet, body[data-scr="menu"] .wallet { top: var(--tb-top) !important; height: 44px !important; }
body .wallet:not(.tmusic) { left: var(--tb-l); }
body .wallet.tmusic, body #topMusic { left: auto !important; right: var(--tb-r) !important; top: var(--tb-top) !important; width: 44px !important; height: 44px !important; min-width: 44px; border-radius: 14px; }
body[data-scr="menu"] .wallet:not(.tmusic) { left: auto; right: calc(var(--tb-r) + 104px) !important; }
body #menu.home .home-top > #homeProfile { position: fixed; z-index: 30; left: var(--tb-l); top: calc(var(--tb-top) - 2px); height: 48px; }
body #menu.home .home-top-r > #settingsBtn { position: fixed; z-index: 30; right: calc(var(--tb-r) + 52px); top: var(--tb-top); width: 44px; height: 44px; }
body #menu.home .home-top-r > #homeMusic { position: fixed; z-index: 30; right: var(--tb-r); top: var(--tb-top); width: 44px; height: 44px; border-radius: 14px; }
body #menu.home .home-top-r { width: 96px; height: 44px; }
body #menu.home .home-top { height: 52px; }
body .wallet.tmusic .ic, body #topMusic .ic, body #rpMusic .ic { color: var(--chip-ink, #c2185b) !important; width: 24px; height: 24px; }
body #topMusic[aria-pressed="false"] .ic, body #rpMusic[aria-pressed="false"] .ic { color: #9a7486 !important; }
body .overlay.tabpage { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }   /* page titles share the top-bar centre line */
body:has(#tour.show) #rpStrip, body:has(#rrRefer:not([hidden])) #rpStrip { display: none !important; }   /* v6.38: the Rope Pass chip is a Home item */
body #menu.home > #rpStrip { position: fixed; z-index: 5; }
body.tabs-on #levels.lv-tab .back { display: none; }
body #tour.overlay.tabpage { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }   /* the tournament hero's Weekly | Monthly switch already sits on the top-bar centre line */
body[data-scr="net"] #netBadge { display: none !important; }   /* v6.38: the room page already shows the code and the players */

/* ===== v6.40 online: profile plates, Play online, quick match, invites, versus intro ===== */
.rlp { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; color: var(--ink); }
.rlp-av { position: relative; flex: none; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ffe1ec 70%); box-shadow: 0 0 0 3px #fff, 0 3px 8px rgba(140,20,70,.22); }
.rlp-l .rlp-av { width: 76px; height: 76px; } .rlp-m .rlp-av { width: 56px; height: 56px; } .rlp-s .rlp-av { width: 40px; height: 40px; box-shadow: 0 0 0 2px #fff, 0 2px 5px rgba(140,20,70,.2); }
.rlp-cv { display: block; border-radius: 50%; }
.rlp.prem .rlp-av { box-shadow: 0 0 0 3px #ffd54a, 0 0 0 5px #fff, 0 4px 12px rgba(200,140,0,.35); }
.rlp-shield { position: absolute; right: -6px; bottom: -4px; width: 42%; height: auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); pointer-events: none; }
.rlp-nm { position: relative; display: flex; align-items: center; min-width: 0; height: 30px; }
.rlp-tag { position: absolute; left: 0; top: 0; pointer-events: none; }
.rlp-name { position: relative; font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rlp.tagged .rlp-name { opacity: 0; }
.rlp-l .rlp-name { font-size: 17px; } .rlp-s .rlp-nm { height: 24px; } .rlp-s .rlp-name { font-size: 13.5px; }
.rlp > .rlp-nm, .rlp > .rlp-meta { grid-column: 2; }
.rlp { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; row-gap: 1px; }
.rlp > .rlp-av { grid-row: 1 / span 2; }
.rlp-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; font-weight: 800; color: rgba(74,22,49,.72); min-width: 0; }
.rlp-pr { display: inline-flex; align-items: center; gap: 3px; color: #a26a00; }
.rlp-pr .rr-pb { transform: scale(.85); }
.rlp-you, .rlp-host { position: absolute; top: -6px; right: -4px; font-size: 10.5px; font-weight: 900; padding: 1px 7px; border-radius: 999px; background: var(--rose); color: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.rlp-host { background: #6a3df0; } .rlp-you + .rlp-host { right: 36px; }
.lp.lp640 { padding: 8px 10px; }
/* Play online: two big choices + small code row */
.po640 { display: grid; gap: 10px; margin: 6px 0 4px; }
.po-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 86px; padding: 10px 12px; border-radius: 22px; border: 2px solid #fff; font: inherit; text-align: left; color: #fff; cursor: pointer; touch-action: manipulation;
  box-shadow: 0 5px 0 rgba(0,0,0,.16), 0 10px 22px rgba(140,20,70,.22); transition: transform .12s; }
.po-card:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.16); }
.po-quick { background: linear-gradient(135deg, #ff9a3c, #ff3d8b 60%, #c2185b); }
.po-friends { background: linear-gradient(135deg, #8b5cff, #5b2ad6 70%); }
.po-art { flex: none; width: 66px; height: 66px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.18); }
.po-art img { width: 62px; height: 62px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); }
.po-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.po-t b { font-size: 19px; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.po-t small { font-size: 12.5px; font-weight: 800; opacity: .92; }
.po-go { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.25); }
.po-go .ic { width: 18px; height: 18px; }
.po-code { margin-top: 12px; }
/* Quick match overlay */
.mm640 { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 12px; overflow-y: auto;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.35), transparent 60%), linear-gradient(180deg, #ff9cc2, #ff6aa8 55%, #e9407f); }
.mm640[hidden] { display: none; }
.mm-card { width: min(440px, 96vw); margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mm-rib { margin: 0; padding: 6px 26px 8px; border-radius: 16px; background: linear-gradient(180deg, #7b3dff, #5320d0); color: #fff; font-size: 22px; font-weight: 900; box-shadow: 0 4px 0 #3a138f; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.mm-mode { margin: 0; font-weight: 900; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.2); font-size: 14px; }
.mm-radar { position: relative; width: 168px; height: 168px; margin: 4px 0; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.55), rgba(255,255,255,.12) 70%); box-shadow: inset 0 0 0 3px rgba(255,255,255,.7); overflow: hidden; }
.mm-radar i { position: absolute; inset: 0; margin: auto; border-radius: 50%; border: 2px solid rgba(255,255,255,.75); animation: mmPing 2.4s ease-out infinite; opacity: 0; }
.mm-radar .r2 { animation-delay: .8s; } .mm-radar .r3 { animation-delay: 1.6s; }
@keyframes mmPing { 0% { transform: scale(.35); opacity: .95; } 100% { transform: scale(1.05); opacity: 0; } }
.mm-sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(255,255,255,.55), transparent 22%); animation: mmSpin 1.8s linear infinite; }
@keyframes mmSpin { to { transform: rotate(360deg); } }
.mm-me { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px #fff, 0 6px 16px rgba(120,10,60,.35); }
.mm-me canvas { border-radius: 50%; }
.mm640[data-phase=found] .mm-radar, .mm640[data-phase=found] .mm-stat, .mm640[data-phase=found] .mm-slots { display: none; }
.mm-stat { display: flex; align-items: center; gap: 10px; }
.mm-time { font-size: 30px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2); font-variant-numeric: tabular-nums; }
.mm-win { font-size: 12.5px; font-weight: 900; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--ink); }
.mm-slots { display: grid; gap: 8px; width: 100%; grid-template-columns: 1fr 1fr; }
.mm-slots.n2 { grid-template-columns: 1fr 1fr; }
.mm-slot { min-height: 58px; padding: 7px 9px; border-radius: 18px; background: rgba(255,255,255,.94); border: 2px solid #fff; display: flex; align-items: center; box-shadow: 0 3px 0 rgba(140,20,70,.18); }
.mm-slot.on { animation: cardIn .3s cubic-bezier(.2,.9,.3,1.2); }
.mm-slot.wait { justify-content: center; gap: 8px; background: rgba(255,255,255,.45); border-style: dashed; color: #fff; font-weight: 900; font-size: 13.5px; box-shadow: none; }
.mm-slot.wait .mm-q { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.35); animation: mmBlink 1.2s ease-in-out infinite; }
@keyframes mmBlink { 50% { opacity: .45; } }
.mm-slot .rlp { width: 100%; }
.mm-found { margin: 0; min-height: 20px; font-weight: 900; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.2); }
.mm-teams { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; flex-wrap: wrap; }
.mm-teams .rlp { padding: 9px 11px; border-radius: 20px; background: #fff; box-shadow: 0 4px 0 rgba(140,20,70,.2); animation: cardIn .35s cubic-bezier(.2,.9,.3,1.2) both; }
.mm-teams.t1v1 { flex-direction: column; } .mm-teams.t1v1 .rlp { width: min(300px, 86vw); }
.mm-teams.t1v1 .rlp:last-child { animation-delay: .12s; }
.mm-tm { flex: 1 1 140px; display: flex; flex-direction: column; gap: 7px; padding: 8px; border-radius: 22px; }
.mm-tm.a { background: rgba(63,116,255,.28); } .mm-tm.b { background: rgba(255,61,61,.26); }
.mm-tl { font-weight: 900; color: #fff; font-size: 13px; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.mm-teams.tn .rlp { flex: 1 1 150px; }
.mm-vs, .vsi-vs { font-size: 30px; font-weight: 900; font-style: italic; color: #ffd54a; text-shadow: 0 3px 0 #a3134a, 0 0 14px rgba(255,255,255,.5); animation: vsPop .45s cubic-bezier(.2,.9,.3,1.4) both .1s; }
@keyframes vsPop { from { transform: scale(2.4); opacity: 0; } to { transform: none; opacity: 1; } }
.mm-none { width: 100%; padding: 12px; border-radius: 22px; background: rgba(255,255,255,.95); box-shadow: 0 5px 0 rgba(140,20,70,.18); display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); }
.mm-none-art { width: 64px; height: 64px; object-fit: contain; }
.mm-none b { font-size: 16px; font-weight: 900; }
.mm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.mm640.none .mm-radar { width: 110px; height: 110px; } .mm640.none .mm-me { transform: scale(.75); }
.mm-cancel { max-width: 220px; background: rgba(255,255,255,.92); }
body.mm-on #tabbar { visibility: hidden; }
/* Invite friends (room) */
.ifr-list { display: flex; flex-direction: column; gap: 6px; max-height: 236px; overflow-y: auto; padding: 2px; }
.ifr { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 16px; background: #fff; border: 2px solid #f4d9e5; }
.ifr .rlp { flex: 1; min-width: 0; }
.ifr-st { display: inline-flex; align-items: center; gap: 4px; }
.ifr-st i { width: 8px; height: 8px; border-radius: 50%; background: #b9a3ae; }
.ifr.on .ifr-st { color: #14a44d; } .ifr.on .ifr-st i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.ifr.match .ifr-st { color: #d97706; } .ifr.match .ifr-st i { background: #f59e0b; }
.ifr-btn { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; font: inherit; font-weight: 900; font-size: 14px; color: #fff; background: linear-gradient(180deg, #ff6aa8, #e91e63); box-shadow: 0 3px 0 #a3134a; touch-action: manipulation; }
.ifr-btn .ic { width: 16px; height: 16px; }
.ifr-btn:disabled { opacity: .5; } .ifr-btn.sent { background: #e9dbe2; color: var(--ink); box-shadow: none; opacity: 1; font-variant-numeric: tabular-nums; }
.ifr-empty { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; font-weight: 700; }
.ifr-more { display: inline-flex; align-items: center; gap: 6px; margin: 8px auto 0; border: 0; background: none; font: inherit; font-weight: 800; color: var(--rose); font-size: 13.5px; }
.ifr-more .ic { width: 16px; height: 16px; }
/* Incoming invite popup */
.inv640 { position: fixed; left: 0; right: 0; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 80; display: flex; justify-content: center; padding: 0 10px; animation: invIn .32s cubic-bezier(.2,.9,.3,1.25); }
.inv640.out { animation: invOut .22s ease-in forwards; }
@keyframes invIn { from { transform: translateY(-120%); } } @keyframes invOut { to { transform: translateY(-130%); opacity: 0; } }
.inv-card { width: min(400px, 96vw); padding: 12px 14px; border-radius: 24px; background: #fff; border: 3px solid #ffd54a; box-shadow: 0 6px 0 rgba(140,20,70,.18), 0 14px 30px rgba(80,10,40,.35); color: var(--ink); }
.inv-top .rlp { width: 100%; }
.inv-mode { padding: 1px 8px; border-radius: 999px; background: #6a3df0; color: #fff; }
.inv-q { margin: 6px 0 6px; font-weight: 900; font-size: 15px; }
.inv-bar { height: 6px; border-radius: 6px; background: #f4e3ea; overflow: hidden; } .inv-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff9a3c, #ff3d8b); transition: width .25s linear; }
.inv-btns { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; } .inv-btns[hidden] { display: none; }
.inv-btns .btn { min-height: 48px; }
.inv-leave { margin-top: 8px; } .inv-leave b { display: block; font-size: 15px; }
/* Versus intro */
.vsi640 { position: fixed; inset: 0; z-index: 55; display: flex; align-items: center; justify-content: center; pointer-events: none; background: radial-gradient(circle, rgba(60,10,40,.55), rgba(60,10,40,.75)); animation: ovIn .2s ease-out; }
.vsi640.out { animation: invOut .4s ease-in forwards; }
.vsi-in { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; width: min(560px, 96vw); }
.vsi-side, .vsi-all { display: flex; flex-direction: column; gap: 8px; flex: 1 1 150px; min-width: 0; }
.vsi-all { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.vsi-side .rlp, .vsi-all .rlp { padding: 9px 11px; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.25); }
.vsi-side.a .rlp { animation: vsiL .45s cubic-bezier(.2,.9,.3,1.2) both; } .vsi-side.b .rlp { animation: vsiR .45s cubic-bezier(.2,.9,.3,1.2) both; }
.vsi-all .rlp { flex: 1 1 150px; animation: cardIn .4s both; }
@keyframes vsiL { from { transform: translateX(-120%); } } @keyframes vsiR { from { transform: translateX(120%); } }
@media (max-width: 380px) { .vsi-in { flex-direction: column; } .vsi-side { width: 100%; flex: none; } .po-card { min-height: 78px; } .po-art { width: 58px; height: 58px; } .po-art img { width: 54px; height: 54px; } }
@media (prefers-reduced-motion: reduce) { .mm-radar i, .mm-sweep, .mm-slot.wait .mm-q { animation: none; } }
.lp.lp640 { justify-content: center; padding: 10px 6px; }
.lp.lp640 .rlp { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; text-align: center; }
.lp.lp640 .rlp-nm { justify-content: center; max-width: 100%; }
.lp.lp640 .rlp-tag { left: 50%; transform: translateX(-50%); }
.lp.lp640 .rlp-meta { justify-content: center; }
.lp.lp640 .rlp-av { margin-bottom: 2px; }
.lobby.sized .lp.lp640 { padding: 12px 6px 8px; }
/* ===== end v6.40 online ===== */

/* ===== v6.40 refer: per-friend row + 3D milestone track ===== */
.rf-hero .rf-pfx { position: relative; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 10px; padding: 8px 10px; border-radius: 18px; background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.5); }
.rf-pfx-i { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; padding: 3px 9px 3px 4px; border-radius: 999px; background: #fff; color: #7a1f48; box-shadow: 0 3px 0 rgba(140,10,60,.18); }
.rf-pfx-i img { width: 30px; height: 30px; object-fit: contain; margin: -6px 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.rf-pfx-i b { font-size: 15.5px; font-weight: 800; } .rf-pfx-i small { font-size: 11.5px; font-weight: 700; opacity: .75; }
.rf-pfx-plus { font-style: normal; font-weight: 800; font-size: 18px; color: #fff; }
.rf-pfx-per { flex-basis: 100%; text-align: center; font-size: 12.5px; font-weight: 700; color: #fff; opacity: .95; }
.rf-mt h3 .rf-mt-c { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: #ffe1ec; color: #c2185b; opacity: 1; }
.rf-mt h3 .rf-mt-c b { font-size: 15px; }
.rf-ms-list.rmt { position: relative; display: grid; grid-template-columns: repeat(var(--mt-n, 4), 1fr); gap: 4px; margin-top: 6px; }
.rmt .rmt-bar { position: absolute; left: 12%; right: 12%; top: 37px; height: 12px; border-radius: 99px; background: #f6dbe7; box-shadow: inset 0 2px 3px rgba(140,20,70,.18); z-index: 0; }
.rmt .rmt-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--mt-pct, 0%); border-radius: 99px; background: linear-gradient(90deg, #ff6aa8, #ffb72e); box-shadow: 0 0 10px rgba(255,183,46,.6); }
.rmt .rf-ms { position: relative; z-index: 1; background: none; border: 0; padding: 0 2px 4px; gap: 3px; }
.rmt .rmt-art { position: relative; display: grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #ffe7f0 65%, #f9cfe0); box-shadow: 0 4px 0 #f1cfe0, inset 0 -3px 6px rgba(194,24,91,.12); }
.rmt .rmt-art img { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.22)); }
.rmt .rmt-art .rmt-pr { position: absolute; right: -6px; bottom: -4px; width: 30px; height: 30px; }
.rmt .rf-ms:not(.ready):not(.done) .rmt-art img { filter: grayscale(.25) brightness(.97) drop-shadow(0 3px 3px rgba(0,0,0,.18)); }
.rmt .rf-ms.ready .rmt-art { background: radial-gradient(circle at 40% 35%, #fff, #fff1c4 60%, #ffd34d); box-shadow: 0 4px 0 #c98a00, 0 0 0 4px rgba(255,194,51,.35), 0 0 22px rgba(255,194,51,.7); animation: rmtGlow 1.6s ease-in-out infinite; }
.rmt .rf-ms.done .rmt-art { background: radial-gradient(circle at 40% 35%, #fff, #dcfce7 65%, #9be7b4); box-shadow: 0 4px 0 #6cc48d; }
@keyframes rmtGlow { 50% { transform: translateY(-3px) scale(1.04); } }
.rmt .rf-ms .n { width: auto; height: auto; min-width: 30px; padding: 1px 9px; margin-top: -12px; border-radius: 999px; font-size: 14px; background: #c2185b; color: #fff; box-shadow: 0 2px 0 #7a0f39; position: relative; z-index: 2; }
.rmt .rf-ms.ready .n { background: #ffb000; color: #5a3100; box-shadow: 0 2px 0 #b07800; }
.rmt .rf-ms.done .n { background: #22c55e; box-shadow: 0 2px 0 #15803d; }
.rmt .rf-ms .r { min-height: 0; gap: 2px; font-size: 13px; font-weight: 800; color: #7a1f48; white-space: nowrap; }
.rmt .rf-ms .r img { width: 16px; height: 16px; object-fit: contain; }
.rmt .rf-ms .r em { font-style: normal; margin-left: 3px; color: #a26a00; }
.rmt .rf-ms button, .rmt .rf-ms .st { min-height: 30px; font-size: 12.5px; }
.rmt .rf-ms .st { gap: 3px; }
@media (max-width: 360px) { .rmt .rmt-art { width: 60px; height: 60px; } .rmt .rmt-art img { width: 50px; height: 50px; } .rmt .rmt-bar { top: 32px; } .rmt .rf-ms .r { font-size: 12px; } }
/* ===== end v6.40 refer ===== */

/* ===== v6.40 friends: add friends ===== */
.me-card .fcode, .me-card .me-b { display: none; }
.af640 { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.af-wa { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 70px; padding: 8px 12px; border: 0; border-radius: 20px; font: inherit; text-align: left; color: #fff; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, #3be07f, #1fae59 65%, #138a45); box-shadow: 0 4px 0 #0f7a3b, 0 8px 18px rgba(19,138,69,.3); touch-action: manipulation; }
.af-wa:active { transform: translateY(3px); box-shadow: 0 1px 0 #0f7a3b; }
.af-wa-i { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.22); }
.af-wa-i svg { width: 28px; height: 28px; }
.af-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; padding-right: 48px; }
.af-t b { font-size: 18px; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.af-t small { font-size: 12px; font-weight: 700; opacity: .95; }
.af-art { position: absolute; right: -8px; bottom: -14px; width: 74px; height: 74px; object-fit: contain; opacity: .9; transform: rotate(-8deg); pointer-events: none; }
.af-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.af-s { display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; min-height: 48px; padding: 4px 8px; border-radius: 16px; border: 2px solid #f4d9e5; background: #fff; color: var(--ink); font: inherit; font-weight: 800; font-size: 13.5px; touch-action: manipulation; }
.af-s .ic { width: 20px; height: 20px; color: var(--rose); }
.af-fb { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #1877f2; color: #fff; font: 900 15px/1 Arial, sans-serif; }
.af-code { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 auto; padding: 2px 8px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 700; color: rgba(74,22,49,.7); }
.af-code b { font-family: ui-monospace, Menlo, monospace; letter-spacing: 2px; color: var(--rose); font-size: 13px; }
.af-code .ic { width: 15px; height: 15px; }
#frAdd.af-add { min-height: 44px; background: rgba(255,255,255,.85); font-size: 14.5px; }
/* ===== end v6.40 friends ===== */

/* v6.40: toasts sit in the top area, under the top bar, never over buttons */
#toast { top: calc(env(safe-area-inset-top, 0px) + 66px); bottom: auto; max-width: calc(100% - 32px); text-align: center; }
/* v6.40: the online room starts under the top bar (coin pill + mute), so the room code is never under the pill */
#net.overlay { padding-top: calc(64px + env(safe-area-inset-top, 0px)); }

/* v6.40 refer helper (Wali review 9:08 PM): Friends page offer strip uses the 3D gift */
.rr-offer-strip .ros-ic.fx3 { background: radial-gradient(closest-side, rgba(255,255,255,.95), rgba(255,255,255,.35) 70%, rgba(255,255,255,0)); box-shadow: none; }
.rr-offer-strip .ros-ic.fx3 img { width: 46px; height: 46px; object-fit: contain; display: block; filter: drop-shadow(0 3px 3px rgba(122,59,0,.25)); }

/* v6.40 refer helper - HOME HEADER (Wali review 9:08 PM): Daily reward (left) and Free coins (right) sit directly under the
   top bar; the ROPE RUSH logo (logo-rich.svg: glossy fill, 3D extrude, white rim) is bigger. Layout otherwise unchanged:
   PLAY and the 4 cards follow right below; the Rope Pass bar keeps the free strip under the cards. */
@media (orientation: portrait) {
  #menu.home .home-main { align-content: start; padding-top: 4px; padding-left: 0; padding-right: 0; grid-template-columns: 70px minmax(0, 1fr) 70px; column-gap: 2px; row-gap: clamp(10px, 2.7vh, 30px); }
  #menu.home .mcards { width: calc(100% - 20px); }
  #menu.home .side { align-self: start; justify-content: flex-start; }
  #menu.home .fab { width: 70px; } #menu.home .fab small { max-width: 72px; }
  #menu.home .home-brand { align-self: start; }
  #menu.home .logo img { width: 100%; max-width: 330px; max-height: clamp(78px, 15vh, 150px); filter: drop-shadow(0 6px 10px rgba(140,20,70,.28)); }
  #menu.home .sub { margin-top: clamp(2px, .8vh, 8px); }
}
@media (orientation: portrait) and (min-width: 380px) { #menu.home .home-main { grid-template-columns: 76px minmax(0, 1fr) 76px; } #menu.home .fab { width: 76px; } #menu.home .fab small { max-width: 78px; font-size: 11.5px; padding: 2px 6px; } }
@media (orientation: portrait) and (min-width: 600px) { #menu.home .home-main { grid-template-columns: 104px minmax(0, 1fr) 104px; } #menu.home .fab { width: 100px; } #menu.home .fab small { max-width: 100px; } }
@media (orientation: landscape) { #menu.home .side { align-self: start; } }

/* ===== v6.40 ONE persistent bottom banner slot (Wali, 31 Oct) =====
   --banner-h = the space the banner takes at the bottom (0 when there is no banner: Premium, no fill, in a match).
   The slot (#adBanner, ads-config.js) is made once and stays mounted; every full-screen layer ends at
   bottom: var(--banner-h), so no button, Back or Claim can ever sit under the ad. html.rr-ad-on is set by ads-config.js. */
@property --banner-h { syntax: '<length>'; inherits: true; initial-value: 0px; }
:root { --banner-h: 0px; --banner-unit: 50px; }
html.rr-ad-on { --banner-h: calc(var(--banner-unit) + 8px + env(safe-area-inset-bottom, 0px)); }
/* the strip: full width, fixed height, the 320x50 unit centred in it (in the app AdMob draws its banner over this strip) */
.ad-banner { left: 0; right: 0; bottom: 0; width: auto; height: var(--banner-h); transform: none; z-index: 65; box-sizing: border-box;
  display: flex; justify-content: center; align-items: flex-start; padding: 4px 0 env(safe-area-inset-bottom, 0px); border-radius: 0;
  background: linear-gradient(#fff6fb, #ffe9f3); box-shadow: 0 -1px 0 rgba(194, 24, 91, .14), 0 -6px 16px rgba(80, 0, 60, .08); overflow: hidden; contain: layout paint; }
.ad-banner[hidden] { display: none; }
.ad-banner .ad-unit { width: 320px; height: var(--banner-unit); flex: none; border-radius: 8px; overflow: hidden; }
.ad-banner.native { background: transparent; box-shadow: none; }
/* every full-screen layer stops above the strip (#app holds all game pages: home, levels, friends, tournament, room, results ...) */
#app, .chist, .dlg, .sh-ov, .sh-mod, .rp-ov, .rf-page, .af2-back, .gc-page, .gc-rv, .cos-ov, .cos-fxcv, .cal-ov, .rrt-intro, .rrt-cel, .rrt-cel canvas, .rrx { bottom: var(--banner-h) !important; }
.cos-fxcv, .rrt-cel canvas { height: auto !important; }
/* the older per-page banner paddings are not needed any more (the page itself is shorter now) */
body.ad-banner-on .overlay { padding-bottom: 12px; }
body.ad-banner-on #menu.home { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
body.tabs-on.ad-banner-on #menu.home { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
body.tabs-on.ad-banner-on .overlay:not(#menu) { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
body.tabs-on.ad-banner-on .overlay.tabpage { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
body.tabs-on.chip-on.ad-banner-on #menu.home { padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
@media (orientation: landscape) { body.tabs-on.chip-on.ad-banner-on #menu.home { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }
/* things pinned to the bottom of the screen sit on top of the strip */
.tabbar, body.ad-banner-on .tabbar { bottom: var(--banner-h); }
body.ad-banner-on .tabbar { border-radius: 22px 22px 0 0; }
.lg-nudge { bottom: calc(86px + max(var(--banner-h), env(safe-area-inset-bottom, 0px))); }
html body.ad-banner-on .rr-chip { bottom: calc(92px + var(--banner-h)); }
html body .rr-dlcard { bottom: calc(14px + var(--banner-h)); }
#installBanner, #updToast { margin-bottom: var(--banner-h); }
/* v6.40 MUSIC (Wali 9:12 PM): no mute button in the top bar on any page; Music and Sound effects are On/Off in Settings.
   Home: the gear takes the right edge (the old mute spot), the coin pill sits next to it; same centre line as before. */
body #menu.home .home-top-r > #settingsBtn { right: var(--tb-r); }
body[data-scr="menu"] .wallet:not(.tmusic) { right: calc(var(--tb-r) + 52px) !important; }
body #menu.home .home-top-r { width: 44px; }
body .rp-top, body .sh-top { padding-right: 0; }   /* Rope Pass / Shop headers: the space kept for the old mute button goes back to the title row */

/* v6.40 final: wide landscape, the Free coins +100 badge clears the coin pill above it */
@media (orientation: landscape) and (min-width: 900px) { html body #menu.home .fhot { top: 2px; } }
/* v6.40 final: the Style sheet is solid (no page showing through behind it) */
.card.cos-card { background: #fff7fb; }

/* ================= v6.41 stars + gems (custom art, assets/ui) ================= */
.ri { display: inline-block; width: 16px; height: 16px; object-fit: contain; vertical-align: middle; -webkit-user-drag: none; user-select: none; pointer-events: none; }
/* win popup */
.wstars { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin: 2px 0 4px; min-height: 58px; }
.wstars .ri { width: 50px; height: 50px; }
.wstars .ri:nth-child(2) { width: 60px; height: 60px; margin-bottom: 6px; }
.wstars .ri.off { opacity: .9; }
.wstars .ri.pop { animation: riPop .42s cubic-bezier(.2,1.6,.5,1) both; }
.wstars .ri.pop.d1 { animation-delay: .70s; } .wstars .ri.pop.d2 { animation-delay: .96s; } .wstars .ri.pop.d3 { animation-delay: 1.22s; }
@keyframes riPop { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.wgems { display: flex; justify-content: center; gap: 6px; margin: 0 0 4px; }
.wgems .ri { width: 26px; height: 26px; }
.wgems .ri.new { animation: riGlint 1.4s ease-in-out .9s 2 both; }
@keyframes riGlint { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(120,255,220,0)); } 50% { transform: scale(1.22); filter: drop-shadow(0 0 7px rgba(120,255,220,.95)); } }
#winLine.need { font-weight: 700; color: #8a5a72; font-style: normal; }
@media (max-height: 520px) { .wstars { min-height: 0; margin: 0 0 2px; } .wstars .ri { width: 32px; height: 32px; } .wstars .ri:nth-child(2) { width: 38px; height: 38px; margin-bottom: 3px; }
  #winStars, #winGems:not([hidden]) { display: inline-flex; vertical-align: middle; } #winGems:not([hidden]) { margin: 0 0 2px 10px; gap: 3px; } .wgems .ri { width: 20px; height: 20px; } }   /* landscape: stars and gems share one row */
@media (prefers-reduced-motion: reduce) { .wstars .ri.pop, .wgems .ri.new, .gemc .ri.new { animation: none; } }
/* in-level HUD: gem slots + clock */
#hud .gemc { display: inline-flex; align-items: center; gap: 1px; padding: 4px 8px; }
#hud .gemc[hidden], #hud .clockc[hidden] { display: none; }
#hud .gemc .ri { width: 17px; height: 17px; }
#hud .gemc .ri.new { animation: riGlint 1s ease-in-out 1 both; }
#hud .clockc { font-variant-numeric: tabular-nums; }
#hud .clockc.low { color: #e0531f; }
#hud .clockc .ic, #oopsChip .ic { width: 15px; height: 15px; vertical-align: -2px; }
@media (max-width: 420px) { #hud.has-clock #lvlName { padding: 5px 8px; font-size: 12px; }   /* v6.41: the level number always shows, also on clock levels */
  #hud .chip { padding: 5px 8px; font-size: 12px; } #hud .hbtn { width: 34px; height: 34px; } #hud.has-clock #coinChip { display: none; }   /* v6.41: the whole HUD row fits 360 px portrait */
  #hud { gap: 4px; } #hud .gemc { padding: 4px 6px; gap: 0; } #hud .gemc .ri { width: 15px; height: 15px; } #hud .clockc { padding: 5px 9px; } #hud .clockc .ic { display: none; } #hud.has-clock #oopsChip { padding: 5px 8px; } }

/* level map: world cards with art */
.wcard { padding: 0; overflow: hidden; }
.wcard::before { display: none; }
.whead { position: relative; height: 104px; overflow: hidden; }
.wart { position: absolute; inset: 0; }
.wart img { width: 100%; height: 100%; object-fit: cover; display: block; }
.whead::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 58%; background: linear-gradient(180deg, rgba(30,10,30,0), rgba(30,10,30,.42)); pointer-events: none; }
.wname { position: absolute; left: 14px; bottom: 10px; right: 50px; z-index: 1; display: flex; flex-direction: column; gap: 1px; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.35); }
.wname small { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; opacity: .92; }
.wname b { font: 700 23px/1.05 'Fredoka', system-ui, sans-serif; }
.wcard .ssn-tick { right: 10px; top: 10px; z-index: 2; }
.wlock { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 2; width: 52px; height: 52px; display: grid; place-items: center; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.glock { width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; pointer-events: none; }
.lvt .lvlock { position: absolute; width: 28px; height: 28px; left: 50%; top: 50%; margin: -4px 0 0 -14px; z-index: 2; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.wcard.locked { filter: none; }
.wcard.locked .wart { filter: grayscale(.75) brightness(.92); opacity: .75; }
.wbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.wstats { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.wst { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: #6d4a5e; }
.wst b { font-weight: 700; font-variant-numeric: tabular-nums; }
.wst .ic { width: 16px; height: 16px; color: var(--b); }
.wst .ri { width: 19px; height: 19px; }
.wcard .ssn-foot { margin-top: 0; }
.wtop .whead { height: 76px; }
.wtop .wname b { font-size: 20px; }
.wtop .wbody { padding: 8px 12px 10px; }
.wtop .ssn-tick { display: none; }
.wtop .ssn-all { position: absolute; right: 8px; top: 8px; z-index: 3; display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 6px 12px 6px 9px; min-height: 32px;
  background: rgba(255,255,255,.94); color: var(--b); font: 700 13px/1 'Fredoka', system-ui, sans-serif; box-shadow: 0 2px 0 rgba(0,0,0,.15); cursor: pointer; }
.wtop .ssn-all .ic { width: 15px; height: 15px; }
.wtop .ssn-all:active { transform: translateY(2px); box-shadow: none; }
.wtop .wname { right: 120px; }
/* level map: path nodes */
.ssn-path { --rowh: 96px; --bonh: 70px; grid-auto-rows: auto; }
@media (min-width: 700px) { .ssn-path { --rowh: 112px; --bonh: 80px; } }
.lvs .ri { width: 13px; height: 13px; }
.lvs .ri.off { opacity: .95; }
.lvt.chal .lvc { width: 68px; height: 68px; box-shadow: inset 0 -6px 0 rgba(0,0,0,.12), 0 4px 0 rgba(0,0,0,.18), 0 0 0 4px #ffd34d; }
.lvt.chal .lvc b { font-size: 27px; }
.lvt.boss.face .lvc { width: 74px; height: 74px; border-radius: 24px; transform: none; overflow: hidden; background: linear-gradient(180deg, #fff3c4, #ffc94d); box-shadow: inset 0 -5px 0 rgba(0,0,0,.1), 0 4px 0 rgba(0,0,0,.2), 0 0 0 3px #fff; }
.lvt.boss.face .lvc::after { display: none; }
.lvt.boss.face.lock .lvc { transform: none; background: linear-gradient(180deg, #e9dfe4, #c9b8c1); }
.lvface { width: 92%; height: 92%; object-fit: contain; margin-top: 6%; }
.lvt.boss.face.lock .lvface { filter: grayscale(.85) brightness(.95); opacity: .7; }
.lvb { position: relative; z-index: 1; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; align-self: center; }
.lvb .lvc { width: 50px; height: 50px; background: linear-gradient(180deg, #d9fff3, #7fe0c4); box-shadow: inset 0 -5px 0 rgba(0,0,0,.08), 0 4px 0 rgba(0,0,0,.14), 0 0 0 3px #fff; }
.lvb .lvc .ri { width: 30px; height: 30px; position: relative; z-index: 1; }
.lvb.lock .lvc { background: linear-gradient(180deg, #eef1f0, #cfd8d5); }
.lvb .lvs small { font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; color: #2a8a73; margin-left: 2px; }
.lvb[disabled] { cursor: not-allowed; }
.lvb:active .lvc { transform: translateY(3px) scale(.97); }
.road-bed.side { stroke-width: 10; }
.road-side { fill: none; stroke: #6fd6bb; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 0.1 9; }
#lvGrid.ssn-list, #lvGrid.ssn-map { padding-bottom: 24px; }   /* v6.41: the last row scrolls clear of the bottom nav's rounded top (it overlaps the list box by 14 px, as in v6.40) */
.lvb.lock .lvc { background: linear-gradient(180deg, #eef4f2, #d3e2dd); }
.lvb.lock .lvs small { color: #2f7f6b; }
.lvt.chal.lock .lvc { box-shadow: inset 0 -6px 0 rgba(0,0,0,.08), 0 4px 0 rgba(0,0,0,.12), 0 0 0 4px #f1e3b6; }
/* v6.41 HUD fit: the generic chip padding (0 12px, gap 6px) was beating the gem chip rules; the level pill never shrinks ("Level 7" stays whole) */
#hud .chip.gemc { padding: 0 8px; gap: 1px; }
#hud #lvlName { flex-shrink: 0; }
@media (max-width: 420px) { #hud .chip.gemc { padding: 0 6px; gap: 0; } #hud .chip { padding-left: 9px; padding-right: 9px; } }

/* ===== v6.41.1 linked logins (Settings > Account) + "Join your logins" sheet ===== */
.lk-list { margin: 10px 0 6px; display: grid; gap: 6px; }
.lk-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px 6px 10px; border-radius: 14px; background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 1.5px #f4dbe7; }
.lk-row .cl, .lk-card .cl { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #fff; color: #4285f4; font: 700 17px/1 Arial, sans-serif; box-shadow: inset 0 0 0 1.5px #e3e3e3; }
.lk-row .cl.fb, .lk-card .cl.fb { background: #1877f2; color: #fff; box-shadow: none; }
.lk-n { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; text-align: left; }
.lk-on { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; font-size: 13px; font-weight: 800; color: #168a48; }
.lk-on .ic { width: 16px; height: 16px; }
.lk-btn { min-width: 64px; }
.lk-dlg { position: fixed; inset: 0; z-index: 48; display: grid; place-items: center; padding: 20px; background: rgba(40,10,30,.45); }
.lk-dlg[hidden] { display: none; }
.lk-card { width: 100%; max-width: 340px; border-radius: 24px; background: #fff; padding: 20px 18px 12px; text-align: center; box-shadow: 0 20px 40px rgba(60,10,40,.3); }
.lk-card h3 { margin: 0 0 8px; font-size: 20px; }
.lk-card .small { margin: 0 0 14px; line-height: 1.4; overflow-wrap: anywhere; }
.lk-card .lgbig { width: 100%; min-height: 0; padding: 14px 12px; flex-direction: row; gap: 10px; outline: 0; }
.lk-card .btn.primary { width: 100%; }
.lk-card .lk-err { color: #c2185b; min-height: 0; margin: 8px 0 2px; }
.lk-card .lk-err:empty { display: none; }
.lk-card .linkbtn { margin-top: 6px; min-height: 40px; }

/* ===== v6.41.1 Tournament: Weekly/Monthly switch centred; clean "your rank" bar ===== */
html body #tour { overflow-x: hidden; }
html body #tour.rrt-tab .rrt-top { padding-right: 0; justify-content: center; margin: 6px 0 2px; }
html body #tour.rrt-tab .rrt-hd h2#rrtT { margin-top: 0; }
@media (max-height: 760px) { html body #tour.rrt-tab .rrt-stage { height: 64px; } html body #tour.rrt-tab #rrtEm { height: 56px; } }
html body #tour.rrt-tab .rrt-kinds { flex: 0 1 272px; max-width: 272px; }
html body #tour .rrt-row.me { background: transparent; box-shadow: none; }
html body #tour .rrt-row.me::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 16px; background: #fff; box-shadow: 0 0 0 2px #7b5cff, 0 4px 0 #5a3fd0, 0 10px 22px rgba(60,30,140,.22); pointer-events: none; }
html body #tour .rrt-row.me:not(.rrt-stick) { position: relative; z-index: 1; }
html body #tour .rrt-row.me .nm, html body #tour .rrt-row.me .nm small { color: #2b1a5e; }
html body #tour .rrt-row.me .rrt-rk:not(.mi) { background: linear-gradient(180deg, #8f73ff, #5b3bd6); color: #fff; }
html body #tour .rrt-row.me .rrt-av { background: #efe8ff; }
html body #tour .rrt-row.me .rrt-you { background: #7b5cff; color: #fff; }
html body #tour .rrt-row.me .pt:not(.rrt-pl) { background: linear-gradient(180deg, #5b3bd6, #3f22a8); }
html body #tour .rrt-row.rrt-stick::before { content: ""; position: absolute; left: -12px; right: -12px; top: -6px; bottom: calc(-1 * var(--rrt-pinb, 84px)); z-index: -2; background: linear-gradient(180deg, rgba(255,214,230,0), #ffd6e6 12px); pointer-events: none; }
html body #tour.k-w .rrt-row.rrt-stick::before { background: linear-gradient(180deg, rgba(244,239,255,0), #f4efff 12px); }
html body #tour.k-m .rrt-row.rrt-stick::before { background: linear-gradient(180deg, rgba(255,243,234,0), #fff3ea 12px); }
html body #tour .rrt-row .pt.rrt-nr { display: flex; align-items: center; gap: 8px; flex: none; padding: 0; background: none; box-shadow: none; }
html body #tour .rrt-row .pt.rrt-nr small { display: block; font-size: 12.5px; font-weight: 800; color: #6b5a99; white-space: nowrap; }
html body #tour .rrt-play { height: 34px; min-width: 64px; padding: 0 14px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #5fe08a, #25b865); color: #fff; font: inherit; font-size: 14px; font-weight: 900; box-shadow: 0 3px 0 #168a48; cursor: pointer; }
html body #tour .rrt-play:active { transform: translateY(2px); box-shadow: 0 1px 0 #168a48; }
@media (max-width: 370px) { html body #tour .rrt-row.me .rrt-you { display: none; } }

/* ===== v6.41.1 Premium + Rope Pass headers: shield centred, light rays turn behind it, gentle float ===== */
@keyframes rrRays6411 { to { transform: rotate(360deg); } }
@keyframes rrFloat6411 { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
@keyframes rrGlow6411 { 0%, 100% { opacity: .75; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
html body .sh-hd:before { display: none; }
html body .sh-hero { position: relative; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 4px; margin-top: 4px; min-height: 104px; }
html body .sh-hero::before { content: ""; position: absolute; left: 50%; top: 50px; width: 460px; height: 460px; margin: -230px 0 0 -230px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255,230,140,.17) 0 8deg, transparent 8deg 22.5deg); -webkit-mask-image: radial-gradient(circle, #000 6%, transparent 60%); mask-image: radial-gradient(circle, #000 6%, transparent 60%); animation: rrRays6411 18s linear infinite; pointer-events: none; z-index: 0; }
html body .sh-hero::after { content: ""; position: absolute; left: 50%; top: 50px; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; background: radial-gradient(circle, rgba(255,214,102,.5) 0, rgba(255,214,102,0) 68%); animation: rrGlow6411 3.4s ease-in-out infinite; pointer-events: none; z-index: 0; }
html body .sh-hero .sh-em { position: relative; z-index: 1; width: 96px; height: 96px; margin: 2px 0; animation: rrFloat6411 3.6s ease-in-out infinite; }
html body .sh-hero > div { position: relative; z-index: 1; }
html body .sh-hero > div:not(:has(.sh-hl:not(:empty))):not(:has(.sh-st:not([hidden]))) { display: none; }
html body .rp-hd:before { display: none; }
html body .rp-lv { position: relative; }
html body .rp-lv::before { content: ""; position: absolute; left: 38px; top: 50%; width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255,236,150,.15) 0 8deg, transparent 8deg 22.5deg); -webkit-mask-image: radial-gradient(circle, #000 6%, transparent 58%); mask-image: radial-gradient(circle, #000 6%, transparent 58%); animation: rrRays6411 18s linear infinite; pointer-events: none; z-index: 0; }
html body .rp-lv > * { position: relative; z-index: 1; }
html body .rp-lv .rp-big { animation: rrFloat6411 3.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  html body .sh-hero::before, html body .sh-hero::after, html body .sh-hero .sh-em, html body .rp-lv::before, html body .rp-lv .rp-big { animation: none !important; }
}

/* v6.41.1 Friends: with the Facebook friends list off, "Recent players" sits centred on its own */
html body *:has(> #afFb[hidden]) > #afRecent { grid-column: 1 / -1; justify-self: center; }
html body #afFb[hidden] { display: none !important; }
