/* Mom's Mahjong v2. Phone-first, portrait + landscape + desktop. Lobby-safe gold/green/silver; no purple UI. */
:root{--gold:#f5c542;--gold2:#d99a1c;--green:#1f7a50;--green2:#0f5c45;--silver:#d9dde3;--ink:#1b1b1b;--paper:#fffaf0;
  --mB:#1c4fb8;--mG:#167a3e;--mR:#c8102e;--mK:#16130f;--mI:#fffaf0;--lb-notices-h:28px;--bar-h:52px;--bst-h:78px;--top-h:84px;
  --sheet-top:calc(var(--bar-h) + 12px);--sheet-bot:calc(var(--lb-notices-h) + 8px);}
*{box-sizing:border-box}
html,body{margin:0;height:100%;height:100dvh;max-height:100dvh;background:#1a0f1c;color:#fff;font:17px/1.35 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;-webkit-text-size-adjust:100%}
body{overflow:hidden;touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
body.cb{--mB:#0072b2;--mG:#009e73;--mR:#d55e00;--mK:#000}
button,select,a.pill{font:inherit;color:inherit}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
[hidden]{display:none!important}
/* ---------- animated Pinky background (one loop per 10-level band, still fallback) ---------- */
.bg{position:fixed;inset:0;z-index:0;overflow:hidden;background:#2a1530}
.bg img,.bg video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:72% 40%}
.bg video{opacity:0;transition:opacity .6s}
.bg.vid video{opacity:1}
.bg-veil{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 55%,rgba(0,0,0,0) 35%,rgba(10,4,12,.55) 100%),linear-gradient(180deg,rgba(10,4,12,.55),rgba(10,4,12,0) 22%,rgba(10,4,12,0) 70%,rgba(10,4,12,.6))}
body[data-screen=game] .bg-veil{background:linear-gradient(180deg,rgba(10,4,12,.6),rgba(10,4,12,.15) 30%,rgba(10,4,12,.15) 70%,rgba(10,4,12,.65))}
#app{position:relative;z-index:1;height:100%;height:100dvh;max-height:100dvh;display:flex;flex-direction:column}
.screen{position:absolute;inset:0;bottom:var(--lb-notices-h);display:flex;flex-direction:column;padding-top:env(safe-area-inset-top);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
/* ---------- bars + common controls ---------- */
.bar{display:flex;align-items:center;gap:8px;min-height:var(--bar-h);padding:6px 10px;background:linear-gradient(180deg,rgba(12,6,14,.82),rgba(12,6,14,.55));border-bottom:1px solid rgba(245,197,66,.35)}
.bar h2{flex:1;margin:0;font-size:20px;text-align:center}
.btn-back,.icon,.pill,.tab{min-height:44px;border-radius:12px;border:2px solid rgba(255,255,255,.55);background:rgba(20,10,22,.6);cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 14px;font-weight:700}
.icon{min-width:44px;padding:0;font-size:22px}
.btn-back{font-size:17px;color:#fff;font-weight:800}
.chal{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:999px;background:rgba(0,0,0,.45);border:1.5px solid var(--gold);font-weight:800;margin-left:auto}
.chal img{display:block}
.pill{background:#fff;color:#1b1b1b;border-color:#fff}
.pill.gold{background:linear-gradient(180deg,#ffe07a,var(--gold) 50%,var(--gold2));border-color:#fff3c2;color:#2a1a00;box-shadow:0 3px 0 #8a5a0c}
.pill.ghost{background:transparent;color:#fff}
.pill.big{min-height:56px;font-size:20px;padding:0 22px}
.pill:disabled{opacity:.5;cursor:default}
.pill:focus-visible,.icon:focus-visible,.bst:focus-visible,.mode:focus-visible,.lv:focus-visible{outline:3px solid #fff;outline-offset:2px}
/* ---------- title ---------- */
#title .t-card{margin:auto 12px 18px;padding:18px 16px 16px;border-radius:22px;background:linear-gradient(180deg,rgba(18,8,20,.35),rgba(18,8,20,.82) 30%);text-align:center}
#title h1{margin:0;font:900 clamp(34px,9vw,56px)/1.05 Georgia,"Times New Roman",serif;color:#ffe9a6;text-shadow:0 3px 0 #7a4a08,0 6px 18px rgba(0,0,0,.6)}
.t-score{margin:6px 0 12px;font-size:18px}
.modes{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.mode{position:relative;min-height:150px;border-radius:18px;border:3px solid #fff3c2;background:linear-gradient(180deg,#2f8f62,var(--green2));box-shadow:0 5px 0 #083a2b,0 10px 24px rgba(0,0,0,.4);display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding:10px 8px 12px;cursor:pointer}
.mode[data-mode=tray]{background:linear-gradient(180deg,#c9a23a,#8c6512);box-shadow:0 5px 0 #4f3806,0 10px 24px rgba(0,0,0,.4)}
.m-tiles{display:flex;gap:4px;margin-bottom:auto;padding-top:4px}
.m-tiles .tile{position:relative;transform:none}
.m-name{font:900 26px/1.1 Georgia,serif;color:#fff}
.m-sub{font-size:15px;opacity:.95}
.m-lvl{margin-top:6px;padding:6px 14px;border-radius:999px;background:#fff;color:#1b1b1b;font-weight:900;font-size:19px}
.t-row{display:flex;gap:10px;justify-content:center;margin-top:14px;flex-wrap:wrap}
/* ---------- levels ---------- */
.tabs{display:flex;gap:8px;padding:10px;justify-content:center}
.tab{min-width:130px;background:rgba(20,10,22,.6)}
.tab[aria-selected=true]{background:var(--gold);color:#2a1a00;border-color:#fff3c2}
 .lv-grid{list-style:none;margin:0;padding:6px 12px 28px;display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:10px;overflow:auto;flex:1}
.lv{width:100%;aspect-ratio:1;border-radius:14px;border:2px solid #fff3c2;background:linear-gradient(180deg,#2f8f62,var(--green2));font-weight:900;font-size:22px;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center}
.lv small{font-size:12px;font-weight:700}
.lv.done{background:linear-gradient(180deg,#ffe07a,var(--gold2));color:#2a1a00}
.lv[aria-disabled=true]{background:rgba(40,30,40,.75);border-color:#777;color:#bbb}
.lv-band{grid-column:1/-1;margin:6px 0 0;font-weight:800;color:#ffe9a6}
/* ---------- game layout (portrait default) ---------- */
.g-bar{gap:6px;padding:4px 8px}
.g-lvl{font-weight:900;font-size:16px;white-space:nowrap}
.g-score{font-size:15px;white-space:nowrap;margin-left:auto}
.g-score+.chal{margin-left:0}
.g-main{flex:1;min-height:0;display:grid;grid-template-rows:var(--top-h) 1fr var(--bst-h);grid-template-columns:1fr}
.topbox{display:flex;align-items:center;justify-content:center;gap:10px;padding:6px 8px;position:relative}
.pairbox{display:flex;align-items:center;gap:10px;min-width:220px;height:70px;padding:6px 14px;border-radius:16px;background:linear-gradient(180deg,#fffaf0,#efe3c4);border:3px solid var(--gold);color:#1b1b1b;box-shadow:0 4px 14px rgba(0,0,0,.4)}
.pb-tiles{display:flex;gap:4px;min-width:84px}
.pb-n{font-size:18px}
.tray{display:grid;grid-template-columns:repeat(7,1fr);gap:5px;padding:6px;border-radius:14px;background:linear-gradient(180deg,#fffaf0,#efe3c4);border:3px solid var(--gold);box-shadow:0 4px 14px rgba(0,0,0,.45);width:min(96vw,470px);height:72px}
.slot{border:3px solid #1f7a50;border-radius:9px;background:#fff;display:flex;align-items:center;justify-content:center;position:relative}
.slot:nth-child(n+6){border-color:#b8860b}
.tray.warn .slot:not(.on){border-color:#c8102e;animation:pulse 1s infinite}
.slot .tile{position:relative;transform:scale(.72);transform-origin:center}
.tray-count{position:absolute;right:10px;bottom:-4px;font-size:14px;font-weight:800;background:rgba(0,0,0,.6);padding:1px 8px;border-radius:999px}
body:not(.m-tray) .tray,body:not(.m-tray) .tray-count{display:none}
body.m-tray .pairbox{display:none}
@keyframes pulse{50%{border-color:#ffb3b3}}
.viewport{position:relative;overflow:hidden;min-height:0}
.board{position:absolute;left:0;top:0;transform-origin:0 0;will-change:transform}
.boosters{display:flex;justify-content:center;align-items:center;gap:clamp(10px,4vw,26px);padding:6px 10px calc(6px + env(safe-area-inset-bottom));background:linear-gradient(0deg,rgba(12,6,14,.85),rgba(12,6,14,.35))}
.bst{position:relative;width:62px;height:62px;border-radius:50%;border:3px solid var(--gold);background:radial-gradient(circle at 35% 30%,#3aa576,var(--green2) 70%);box-shadow:0 3px 0 #083a2b;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0}
.bst .bi{font-size:24px;line-height:1}
.bst .bl{font-size:11px;font-weight:800;margin-top:1px}
.badge{position:absolute;right:-8px;top:-8px;min-width:26px;height:26px;padding:0 6px;border-radius:13px;background:#fff;color:#1b1b1b;border:2px solid var(--gold2);font-weight:900;font-size:15px;display:flex;align-items:center;justify-content:center;gap:2px}
.badge.cost{background:#ffe07a;font-size:12px}
.badge.cost img{width:14px;height:14px}
.bst.off{filter:grayscale(.6);opacity:.75}
/* ---------- 3D tiles ---------- */
.tile{position:absolute;width:60px;height:80px;border-radius:9px;background:linear-gradient(155deg,#ffffff 0%,#fbf5e6 45%,#efe3c6 100%);
  box-shadow:inset 0 0 0 1px rgba(150,120,60,.35),1px 1px 0 #e7dabb,2px 2px 0 #dccca6,3px 3px 0 #cdb98c,4px 4px 0 #2e8c5c,5px 5px 0 #237a4d,6px 6px 0 #1a6640,7px 8px 9px rgba(0,0,0,.5);cursor:pointer}
.tile .face{position:absolute;inset:3px 4px 4px 3px}
.tile .face svg{width:100%;height:100%;display:block}
.tile::after{content:"";position:absolute;inset:0;border-radius:9px;pointer-events:none;background:radial-gradient(ellipse 80% 45% at 30% 12%,rgba(255,255,255,.85),rgba(255,255,255,0) 70%)}
.tile.blocked::before{content:"";position:absolute;inset:0;border-radius:9px;background:rgba(40,30,20,.26);z-index:2;pointer-events:none}
/* retired: auto-highlight of free/playable tiles is off. Hint (.tile.hint) is the only match highlight.
body.hl-free .tile.free:not(.belt){box-shadow:inset 0 0 0 2px rgba(245,197,66,.9),1px 1px 0 #e7dabb,2px 2px 0 #dccca6,3px 3px 0 #cdb98c,4px 4px 0 #2e8c5c,5px 5px 0 #237a4d,6px 6px 0 #1a6640,7px 8px 9px rgba(0,0,0,.5)}
*/
.tile.sel{transform:translateY(-8px);box-shadow:0 0 0 4px #ffd23f,0 0 18px 6px rgba(255,210,63,.75),4px 10px 12px rgba(0,0,0,.5)}
.tile.hint{animation:hintGlow .9s ease-in-out infinite}
@keyframes hintGlow{50%{box-shadow:0 0 0 5px #3bceac,0 0 22px 8px rgba(59,206,172,.9)}}
.tile.nope{animation:nope .3s}
@keyframes nope{25%{margin-left:-5px}75%{margin-left:5px}}
.tile.belt{will-change:transform;left:0;top:0}
.belt-track{position:absolute;border-radius:26px;border:3px dashed rgba(245,197,66,.55);background:rgba(10,5,12,.28);pointer-events:none}
.flyer{position:fixed;left:0;top:0;z-index:50;pointer-events:none;transform-origin:0 0}
.pop{position:absolute;left:50%;top:6px;transform:translateX(-50%);font:900 30px/1 Georgia,serif;color:#ffe07a;text-shadow:0 3px 0 #7a4a08,0 0 12px rgba(0,0,0,.7);pointer-events:none;opacity:0;white-space:nowrap;z-index:40}
.pop.show{animation:pop 1.1s ease-out}
@keyframes pop{0%{opacity:0;transform:translate(-50%,14px) scale(.7)}20%{opacity:1;transform:translate(-50%,0) scale(1.08)}75%{opacity:1}100%{opacity:0;transform:translate(-50%,-18px)}}
.spark{position:fixed;width:9px;height:9px;border-radius:50%;background:#ffe07a;z-index:60;pointer-events:none;animation:spark .7s ease-out forwards}
@keyframes spark{to{transform:translate(var(--dx),var(--dy)) scale(.2);opacity:0}}
body.calm .tile.hint{animation:none;box-shadow:0 0 0 5px #3bceac}
body.calm .pop.show{animation:none;opacity:1}
/* ---------- panels ---------- */
.veil{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:80}
.panel{position:fixed;left:50%;top:calc(var(--sheet-top) + (100dvh - var(--sheet-top) - var(--sheet-bot))/2);transform:translate(-50%,-50%);z-index:90;width:min(92vw,460px);max-height:calc(100dvh - var(--sheet-top) - var(--sheet-bot));overflow:auto;padding:16px 18px 14px;border-radius:20px;background:#fffaf0;color:#1b1b1b;border:4px solid var(--gold);box-shadow:0 20px 60px rgba(0,0,0,.6);text-align:center}
.panel h2{margin:4px 0 8px;font:900 24px/1.15 Georgia,serif;color:#0f5c45}
#pSettings,#pHow,#pWin,#pFull,#pStuck,#pReg,#pMore,#pVsLeave{display:flex;flex-direction:column;overflow:hidden}
#pSettings h2,#pHow h2{flex:0 0 auto;margin:0 0 6px}
.panel-scroll{flex:1 1 auto;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;padding-bottom:4px}
#pSettings > button.pill[data-close],#pHow > button.pill[data-close]{flex:0 0 auto;margin-top:8px;position:static}

.panel h3{margin:14px 0 4px;color:#0f5c45}
.panel.guide{text-align:left}
.panel .pill{border-color:#1b1b1b}
.panel .pill.ghost{color:#1b1b1b}
.panel .col{display:flex;flex-direction:column;gap:10px;margin:12px 0}
.panel .row{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:8px 0}
.panel .row .pill{flex:1}
.soft{color:#444}
.fine{font-size:14px;color:#555}
.sw,.sel{display:flex;align-items:center;gap:12px;min-height:44px;padding:5px 2px;border-bottom:1px solid #eadfc4;text-align:left;font-weight:600}
.sw2{align-items:flex-start;min-height:0;padding:6px 2px}
.sw{justify-content:flex-start}
.sel{justify-content:space-between}
.sw input{width:26px;height:26px;flex:0 0 26px;margin:0}
.sel select{min-height:40px;font-size:16px;color:#1b1b1b}
.win-art{height:150px;margin:-18px -18px 8px;border-radius:16px 16px 0 0;background:url(img/mj2/band-still-landscape.webp?v=8ef5ef12) 72% 0%/cover}
.win-time{font:900 30px/1.1 Georgia,serif;margin:4px 0;color:#1b1b1b}
.win-best{margin:0;color:#444}
.win-list{list-style:none;padding:0;margin:10px 0;display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.win-list li{padding:6px 12px;border-radius:999px;background:#efe3c4;font-weight:800}
.toast{position:fixed;left:50%;bottom:calc(var(--lb-notices-h) + var(--bst-h) + 12px);transform:translateX(-50%);z-index:95;background:rgba(10,5,12,.9);border:2px solid var(--gold);padding:10px 16px;border-radius:14px;opacity:0;transition:opacity .25s;pointer-events:none;max-width:90vw;text-align:center}
.toast.show{opacity:1}
.lb-notices{position:fixed;left:0;right:0;bottom:0;z-index:70;min-height:var(--lb-notices-h);padding:4px 10px calc(4px + env(safe-area-inset-bottom));font-size:12px;text-align:center;background:#0b0710;color:#ddd;border-top:1px solid #333}
/* ---------- landscape phones: tray on the left rail, boosters on the right strip ---------- */
@media (orientation:landscape) and (max-height:560px){
  :root{--bar-h:44px;--lb-notices-h:22px}
  .bar{min-height:44px;padding:2px 8px}
  .btn-back,.icon,.pill{min-height:40px}
  .g-main{grid-template-rows:1fr;grid-template-columns:96px 1fr 84px}
  .topbox{flex-direction:column;padding:4px}
  .tray{grid-template-columns:1fr;grid-template-rows:repeat(7,1fr);width:74px;height:100%;max-height:calc(100vh - 80px);gap:3px;padding:4px}
  .slot .tile{transform:scale(.5)}
  .pairbox{flex-direction:column;min-width:0;width:86px;height:auto;padding:6px}
  .pb-tiles{min-width:0}
  .pb-tiles .tile{transform:scale(.6)}
  .tray-count{position:static}
  .boosters{flex-direction:column;gap:8px;padding:4px}
  .bst{width:56px;height:56px}
  #title .t-card{margin:auto 12px 10px;padding:10px 14px;display:grid;grid-template-columns:1fr 1.4fr;align-items:center;gap:6px 16px;text-align:left}
  #title h1{font-size:34px}
  .modes{grid-row:span 3;grid-column:2}
  .mode{min-height:120px}
  .t-row{justify-content:flex-start;margin-top:4px}
  .toast{bottom:calc(var(--lb-notices-h) + 10px)}
}
/* desktop */
@media (min-width:900px) and (min-height:600px){
  :root{--top-h:96px;--bst-h:92px}
  .bst{width:70px;height:70px}
  #title .t-card{width:640px;margin:auto auto 40px}
  .tray{height:84px;width:520px}
}
@media (prefers-reduced-motion:reduce){.tile.hint{animation:none;box-shadow:0 0 0 5px #3bceac}.pop.show{animation:none;opacity:1}.bg video{display:none}}
/* tile face layers from the live engine: v2 uses the classic ivory look (corner index on, extra layers off) */
.face .sbg,.face .simp,.face .lab,.face .bdg{display:none}
body.cb .face .bdg{display:inline;fill:#000;stroke:#fff;stroke-width:1.6px}
.idx{font:900 19px "Avenir Next","Segoe UI",Arial,sans-serif;paint-order:stroke;stroke:#fffef8;stroke-width:3px}
/* portrait: still Pinky scene with a slow drift until the owner's portrait loops arrive */
.bg.kb img{animation:kb 24s ease-in-out infinite alternate;transform-origin:70% 40%}
@keyframes kb{from{transform:scale(1)}to{transform:scale(1.07) translate(-1.2%,.8%)}}
@media (prefers-reduced-motion:reduce){.bg.kb img{animation:none}}
body.calm .bg.kb img{animation:none}

/* short landscape phones: keep every panel button on screen */
@media (max-height:560px){
  .panel{padding:10px 16px;max-height:calc(100dvh - var(--sheet-top) - var(--sheet-bot));width:min(92vw,520px)}
  #pSettings .sw,#pSettings .sel{min-height:40px;padding:2px}
  #pSettings .set-h{margin:6px 0 0}
  .panel h2{font-size:19px;margin:0 0 4px}
  .panel p{margin:3px 0;font-size:14px}
  .panel .col{gap:6px;margin:6px 0}
  .panel .row{margin:4px 0;gap:8px}
  .panel .pill{min-height:44px;padding-top:6px;padding-bottom:6px}
}

.tin{display:inline-block;vertical-align:-3px;margin:0 2px 0 1px}

/* living background: drifting petals + warm lantern glow (no video in this build) */
.bg .petals{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.bg .petals i{position:absolute;top:-6%;width:12px;height:9px;border-radius:70% 0 70% 0;background:radial-gradient(circle at 30% 30%,#ffe3ee,#f49ab9 70%);opacity:.85;
  filter:drop-shadow(0 1px 1px rgba(80,0,30,.25));animation:petal 14s linear infinite}
.bg .petals i:nth-child(1){left:6%;animation-delay:-1s;animation-duration:15s}
.bg .petals i:nth-child(2){left:14%;animation-delay:-7s;animation-duration:12s;transform:scale(.8)}
.bg .petals i:nth-child(3){left:23%;animation-delay:-3s;animation-duration:17s}
.bg .petals i:nth-child(4){left:31%;animation-delay:-10s;animation-duration:13s}
.bg .petals i:nth-child(5){left:42%;animation-delay:-5s;animation-duration:16s}
.bg .petals i:nth-child(6){left:51%;animation-delay:-12s;animation-duration:14s}
.bg .petals i:nth-child(7){left:60%;animation-delay:-2s;animation-duration:18s}
.bg .petals i:nth-child(8){left:68%;animation-delay:-8s;animation-duration:12s}
.bg .petals i:nth-child(9){left:76%;animation-delay:-4s;animation-duration:15s}
.bg .petals i:nth-child(10){left:84%;animation-delay:-11s;animation-duration:13s}
.bg .petals i:nth-child(11){left:91%;animation-delay:-6s;animation-duration:17s}
.bg .petals i:nth-child(12){left:97%;animation-delay:-9s;animation-duration:14s}
@keyframes petal{0%{transform:translate3d(0,0,0) rotate(0)}25%{transform:translate3d(-24px,28vh,0) rotate(120deg)}50%{transform:translate3d(18px,55vh,0) rotate(220deg)}
  75%{transform:translate3d(-14px,80vh,0) rotate(310deg)}100%{transform:translate3d(10px,110vh,0) rotate(400deg)}}
.bg .glow{position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse 30% 22% at 12% 28%,rgba(255,120,60,.22),transparent 70%),radial-gradient(ellipse 26% 20% at 90% 30%,rgba(255,120,60,.18),transparent 70%);
  animation:glow 5s ease-in-out infinite alternate}
@keyframes glow{from{opacity:.55}to{opacity:1}}
@media (prefers-reduced-motion:reduce){.bg .petals{display:none}.bg .glow{animation:none}}
body.calm .bg .petals{display:none}body.calm .bg .glow{animation:none}
/* wide screens: menu card on the left so Pinky (right of the scene) stays in view */
@media (min-width:1000px) and (min-height:561px){#title .t-card{margin:auto auto 40px 6vw;width:min(600px,46vw)}}

.g-timer{font-weight:800;font-variant-numeric:tabular-nums;color:#ffe9a6;background:rgba(10,5,12,.55);border:1px solid rgba(255,233,166,.5);border-radius:10px;padding:2px 8px;margin-right:6px}
.lv .lv-t{display:block;font-style:normal;font-size:11px;font-weight:700;opacity:.9;line-height:1}
.lv{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.bg.t-port img{object-position:50% 0;top:-25%;height:125%}

/* combo, win stats, goals, My Progress (tfMJ5) */
.g-combo{font-weight:900;color:#2a1a00;background:linear-gradient(180deg,#ffe58a,#f5c542);border-radius:10px;padding:2px 8px;margin-right:6px;font-size:14px}
.win-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:4px 0 6px}
.win-stats div{background:#f6ecd2;border-radius:12px;padding:6px 4px;display:flex;flex-direction:column;align-items:center}
.win-stats b{font:900 26px/1.05 Georgia,serif;color:#0f5c45}.win-stats span{font-size:12px;font-weight:700;color:#5a4a2a}
.win-clean{margin:2px 0;font-weight:800;color:#0f5c45}.win-cheer{margin:2px 0 4px;font:800 18px/1.2 Georgia,serif;color:#b0306a}
.panel.win .win-best{margin:0 0 4px;font-size:14px}
.goals{list-style:none;margin:6px 0;padding:0;display:flex;flex-direction:column;gap:6px;text-align:left}
.goal{display:grid;grid-template-columns:1fr 90px 36px;align-items:center;gap:8px;font-size:13px;font-weight:700}
.goal em{font-style:normal;text-align:right;color:#5a4a2a}.goal.done span{color:#0f5c45}
.gbar{display:block;height:9px;border-radius:6px;background:#e4d6b4;overflow:hidden}.gbar i{display:block;height:100%;background:linear-gradient(90deg,#2f8f62,#5fd39a);border-radius:6px}
.goal.ms .gbar i{background:linear-gradient(90deg,#f5c542,#ffdf7a)}
.win-goals{margin-top:4px}
#progress .pg{flex:1;overflow:auto;padding:8px 12px 18px;display:flex;flex-direction:column;gap:10px;max-width:640px;width:100%;margin:0 auto}
.pg-card{background:rgba(255,250,240,.95);color:#1b1b1b;border:3px solid var(--gold);border-radius:16px;padding:10px 12px}
.pg-card h3{margin:0 0 4px;color:#0f5c45;font-size:16px}
.pg-top{display:grid;grid-template-columns:110px 1fr;gap:12px;align-items:center}
.pg-ring{width:104px;height:104px;border-radius:50%;background:radial-gradient(circle,#fffaf0 58%,transparent 59%),conic-gradient(#2f8f62,#f5c542,#e86aa0,#2f8f62);display:flex;flex-direction:column;align-items:center;justify-content:center}
.pg-ring b{font:900 34px/1 Georgia,serif;color:#0f5c45}.pg-ring span{font-size:11px;font-weight:800}
.pg-faster{font-weight:900;color:#b0306a;margin:4px 0}.pg-card .fine{font-size:12px;color:#5a4a2a;margin:4px 0 0}
.pg-row{display:flex;justify-content:space-between;align-items:center}
.seg button{min-height:36px;padding:0 12px;border:2px solid #0f5c45;background:#fff;font-weight:800;border-radius:10px;margin-left:4px;color:#0f5c45}
.seg button[aria-pressed=true]{background:#0f5c45;color:#fff}
.chart{width:100%;height:auto;display:block}.chart .gl{stroke:#e4d6b4;stroke-width:1}.chart .gt,.chart .gx{font-size:10px;fill:#5a4a2a}
.chart .gx{text-anchor:middle}.chart .ln{fill:none;stroke:#b0306a;stroke-width:3;stroke-linejoin:round}.chart .dt{fill:#b0306a}
.pg-bests{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.pg-bests li{background:#f6ecd2;border-radius:10px;padding:6px;display:flex;flex-direction:column;align-items:center;text-align:center}
.pg-bests b{font:900 22px/1.1 Georgia,serif;color:#0f5c45}.pg-bests span{font-size:11px;font-weight:700}
.pg-recent{list-style:none;margin:0;padding:0}.pg-recent li{display:grid;grid-template-columns:1fr 60px 80px;padding:5px 0;border-bottom:1px solid #eadfc3;font-size:14px;font-weight:700}
#title .t-row{flex-wrap:wrap}
.g-combo{white-space:nowrap;font-size:15px}

/* tfMJ6: game bar always fits (combo up to x99, timer on) - level label and score shrink first, gear never clipped */
.g-bar>*{flex-shrink:0}
.g-bar .g-lvl{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
.g-combo{min-width:0;padding:2px 6px;margin-right:0}
.g-timer{margin-right:0}
@media (max-width:480px){.g-lvl .ll{display:none}.g-bar{gap:4px;padding:4px 6px}.g-bar .g-lvl{flex:0 0 auto;font-size:15px}
.g-score{display:flex;flex-direction:column;align-items:center;line-height:1.05;font-size:15px}.g-score .sl{font-size:9px;letter-spacing:.06em;text-transform:uppercase;opacity:.85}
.g-bar .chal{padding:2px 6px;gap:3px;font-size:14px}.g-bar .chal img{width:16px;height:16px}.g-combo,.g-timer{font-size:14px;padding:2px 5px}}
@media (max-width:370px){.g-bar .icon{min-width:40px}.g-bar{gap:3px;padding:4px 4px}}

/* tfMJ6 Vaulted: fee line on the level picker */
.lv-fee{margin:4px 12px 8px;font-size:15px;color:#fff3d6;text-align:center}
.linkish{background:none;border:0;color:#ffe58a;text-decoration:underline;font:inherit;font-weight:800;padding:6px 2px;min-height:44px}
@media (max-width:340px){.g-bar .g-lvl{font-size:13px}.g-combo,.g-timer{font-size:12px;padding:2px 3px}.g-score{font-size:13px}.g-bar .chal{font-size:13px;padding:2px 4px}}

/* t8582: four equal win buttons, one line each, same type at 320-844 */
.btn4{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0 2px}
.btn4 .pill{min-height:50px;padding:0 8px;font-size:17px;font-weight:800;white-space:nowrap;display:flex;align-items:center;justify-content:center;width:100%;box-sizing:border-box;text-decoration:none}
.btn4 .pill[hidden]{display:none}
@media (max-width:340px){.btn4 .pill{font-size:15px;min-height:46px}.btn4{gap:8px}}
/* t8582: title buttons: two equal on top, How to play full width below, one line each */
#title .t-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;justify-content:stretch}
#title .t-row .pill{white-space:nowrap;width:100%;min-height:48px;font-size:17px;font-weight:800;padding:0 8px}
#title .t-row .pill:last-child:nth-child(odd){grid-column:1/-1}
@media (max-width:340px){#title .t-row .pill{font-size:15px}}

/* t8582: level cells: number always centered, small lock badge in the corner; amounts never split from their symbol */
.lv{position:relative}
.lv .lk{position:absolute;top:3px;right:4px;font-size:12px;font-style:normal;line-height:1;opacity:.85}
.lv .ln{line-height:1}
.nw{white-space:nowrap}
.lv-fee{line-height:1.35}
#pMore .pill.big,#pReg .pill.big{white-space:nowrap}
@media (max-width:340px){#pMore .pill.big,#pReg .pill.big{font-size:16px;padding:0 10px}.goal{font-size:12px;grid-template-columns:1fr 70px 30px;gap:6px}#pWin h2{font-size:20px}}

/* Daily puzzle: calendar + badges */
#daily{display:flex;flex-direction:column}
.dy-today{text-align:center}.dy-date{font-size:20px;font-weight:900;margin:2px 0 10px;color:#2a1a00}
.dy-today .pill{width:100%;white-space:nowrap}.dy-best{font-weight:800;color:#0f5c45;margin:8px 0 0;min-height:1em}
.cal-h,.cal{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;list-style:none;margin:0;padding:0}
.cal-h span{text-align:center;font-size:13px;font-weight:800;color:#5a4a2a;padding-bottom:4px}
.cal .day{width:100%;aspect-ratio:1;min-height:38px;border-radius:10px;border:1.5px solid #d9c9a0;background:#fffaf0;color:#2a1a00;font-weight:800;font-size:15px;padding:0;cursor:pointer}
.cal .day.done{background:linear-gradient(180deg,#ffe07a,var(--gold2));border-color:#b8860b}
.cal .day.today{outline:3px solid #0f5c45;outline-offset:1px}
.cal .day:disabled{background:transparent;color:#b9ad90;border-color:#eee3c8;cursor:default}
#daily .pg{flex:1;overflow:auto;padding:8px 12px 28px;display:flex;flex-direction:column;gap:10px;max-width:640px;width:100%;margin:0 auto;box-sizing:border-box}

.btn4.three{grid-template-columns:1fr 1fr 1fr}
@media (max-width:340px){.btn4.three .pill{font-size:14px;padding:0 4px}}
.cal .day{min-height:0;min-width:0}.cal li{min-width:0}@media (max-width:340px){.cal,.cal-h{gap:4px}.cal .day{font-size:13px;border-radius:8px}}

/* header: title always centered on the screen, even when the balance pill is hidden (t8582) */
.screen>.bar:has(>h2){position:relative;justify-content:space-between}
.screen>.bar:has(>h2)>h2{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);flex:none;white-space:nowrap;pointer-events:none;margin:0}
@media (max-width:340px){.screen>.bar:has(>h2)>h2{font-size:17px}.screen>.bar:has(>h2)>.btn-back{padding:0 10px}}
/* Daily Race standings */
.race{list-style:none;margin:6px 0;padding:0;display:flex;flex-direction:column;gap:4px}
.race li{display:grid;grid-template-columns:44px 1fr auto;gap:8px;align-items:center;padding:6px 8px;border-radius:10px;background:#fff3d6;font-weight:700}
.race li.me{background:linear-gradient(180deg,#ffe07a,var(--gold2))}.race em{font-style:normal;font-variant-numeric:tabular-nums}
.dy-race-me{font-weight:800;color:#0f5c45;margin:4px 0}

/* Flip mode (tfMJ10): third mode card, pink side, hidden (face-down) tiles */
.modes{grid-template-columns:repeat(3,1fr);gap:10px}
.mode{min-width:0;padding:10px 4px 12px}
.mode .m-name{font-size:clamp(19px,6vw,26px)}
.mode .m-sub{font-size:clamp(12px,3.6vw,15px);white-space:nowrap}
.mode .m-lvl{font-size:clamp(14px,4.4vw,19px);padding:5px 10px;white-space:nowrap}
.mode[data-mode=flip]{background:linear-gradient(180deg,#e0679b,#a8326a);box-shadow:0 5px 0 #5c1236,0 10px 24px rgba(0,0,0,.4)}
.tabs .tab{min-width:0;flex:1 1 0;max-width:130px}
.tile.pink{background:linear-gradient(155deg,#ffe6f0 0%,#ffbfd8 50%,#f293bb 100%);box-shadow:1px 1px 0 #f0b8cf,2px 2px 0 #e6a1bd,3px 3px 0 #d88aab,4px 4px 0 #b4457a,5px 5px 0 #9c3567,6px 6px 0 #842856,7px 8px 9px rgba(0,0,0,.5)}
/* retired with auto-highlight:
body.hl-free .tile.pink.free:not(.belt){box-shadow:inset 0 0 0 2px rgba(196,40,110,.85),1px 1px 0 #f0b8cf,2px 2px 0 #e6a1bd,3px 3px 0 #d88aab,4px 4px 0 #b4457a,5px 5px 0 #9c3567,6px 6px 0 #842856,7px 8px 9px rgba(0,0,0,.5)}
*/
.tile.hid{background:linear-gradient(155deg,#3aa57a,#1f7a55 55%,#155c3f)}
.tile.hid .face{visibility:hidden}
.tile.hid::after{background:repeating-linear-gradient(45deg,rgba(255,255,255,.10) 0 6px,rgba(255,255,255,0) 6px 12px),radial-gradient(ellipse 80% 45% at 30% 12%,rgba(255,255,255,.45),rgba(255,255,255,0) 70%)}
.tile.hid.blocked::before{background:rgba(10,30,20,.18)}

/* tfMJ11: score pop shows as a clean pill, then is gone (no faded text over the art); board glides when it re-centers */
.pop{top:10px;padding:6px 16px;border-radius:999px;background:linear-gradient(180deg,#7a2a55,#4b1433);border:2px solid #ffe07a;font-size:22px;text-shadow:none;box-shadow:0 4px 12px rgba(0,0,0,.45);visibility:hidden}
.pop.show{visibility:visible;animation:pop2 .95s ease-out both}
@keyframes pop2{0%{opacity:0;transform:translate(-50%,8px) scale(.85)}12%{opacity:1;transform:translate(-50%,0) scale(1)}88%{opacity:1;transform:translate(-50%,0)}100%{opacity:0;transform:translate(-50%,-6px)}}
body.calm .pop.show,body .pop.show.still{animation:none;opacity:1}
@media (prefers-reduced-motion:reduce){.pop.show{animation:none;opacity:1}}
.board{transition:transform .28s ease-out}
body.calm .board{transition:none}
@media (prefers-reduced-motion:reduce){.board{transition:none}}

/* owner t8600: corner numbers and wind letters hidden unless Settings > Tile labels is on */
.face .idx{display:none}
body.idx-on .face .idx{display:inline}
.sw2 .swt{display:flex;flex-direction:column;align-items:flex-start;text-align:left;line-height:1.2;flex:1;min-width:0}
.sw2 .swt small{font-size:13px;font-weight:500;opacity:.8;margin-top:2px}

/* t8600: the balance always shows the Vaulted symbol and the whole number; overflow steps (set by fitBar) */
.g-bar .chal img{display:block!important}
.g-bar.t1 .g-score{display:none}
.g-bar.t2 .g-lvl{font-size:13px}.g-bar.t2 .chal{font-size:13px;padding:2px 4px;gap:2px}.g-bar.t2 .chal img{width:14px;height:14px}.g-bar.t2 .g-combo,.g-bar.t2 .g-timer{font-size:12px;padding:2px 3px}
.g-bar.t1 .chal{margin-left:auto}
/* owner t8602/t8605: Daily Race top 100 in a 10-row window that scrolls inside the card (not the page) */
.race-win{position:relative;margin:6px 0}
.race-win .race{margin:0;height:auto;max-height:calc(10 * 38px + 9 * 4px);overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;scroll-padding:4px;padding-right:2px}
.race-win .race li{min-height:38px;box-sizing:border-box;font-size:17px;flex:0 0 auto}
.race-win .race li b{font-variant-numeric:tabular-nums}
.race-win .race li span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.race-win .race li.me{position:sticky;top:0;bottom:0;z-index:2;box-shadow:0 0 0 2px #b8860b,0 2px 8px rgba(0,0,0,.25)}
.race-fade{position:absolute;left:0;right:0;bottom:0;height:34px;border-radius:0 0 10px 10px;background:linear-gradient(rgba(255,250,238,0),rgba(255,250,238,.95));pointer-events:none;opacity:0;transition:opacity .2s}
.race-win.more .race-fade{opacity:1}
.race-win.more::after{content:"\25BE";position:absolute;left:50%;bottom:2px;transform:translateX(-50%);font-size:16px;color:#8c6512;pointer-events:none}
@media (max-width:340px){.screen>.bar:has(>h2)>.chal{font-size:14px;padding:2px 7px;gap:3px}.screen>.bar:has(>h2)>.chal img{width:16px;height:16px}.screen>.bar:has(>h2)>h2{font-size:16px}}
.bar.h1>.btn-back .bk{display:none}.bar.h1>.btn-back{min-width:48px;padding:0 12px}.bar.h2s>h2{font-size:15px}
.screen>.bar.h2s:has(>h2)>h2{font-size:14px}
.sw2 .swt small{text-wrap:balance}

/* tfMJ12 named heritage layouts */
.offTab{display:none!important}
.tabs .tab{max-width:120px;padding:0 6px}
.lv-grid.ly-grid{grid-template-columns:repeat(2,1fr);gap:12px}
.ly{position:relative;width:100%;min-height:132px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:2px;padding:10px 8px 10px;border-radius:16px;border:2px solid rgba(255,243,194,.8);background:linear-gradient(180deg,rgba(47,143,98,.92),rgba(12,74,52,.95));color:#fff;cursor:pointer;box-shadow:0 4px 0 #083a2b}
.ly.done{border-color:var(--gold)}
.ly .ly-mini{width:86%;height:64px;margin-bottom:auto}
.ly-mini rect{fill:#fbf5e6;stroke:#1a6640;stroke-width:5}
.ly-mini rect.z1{fill:#f3e7c7}.ly-mini rect.z2{fill:#ead9ae}.ly-mini rect.z3{fill:#dfc78f}.ly-mini rect.z4{fill:#f5c542}
.ly-name{font:900 19px/1.1 Georgia,serif;white-space:nowrap}
.ly-sub{font-size:14px;opacity:.92;white-space:nowrap}
.ly small{position:absolute;top:6px;right:8px;font-size:18px;color:#ffe07a}
.lv-grid.ly-grid>li:first-child{grid-column:1/-1}
.lv-grid.ly-grid>li:first-child .ly{min-height:150px;background:linear-gradient(180deg,#e0679b,#a8326a);box-shadow:0 4px 0 #5c1236}
.lv-grid.ly-grid>li:first-child .ly-mini{height:84px}

/* Auto Fit zoom buttons (big boards only) */
.viewport{touch-action:none}
.zoom{position:absolute;left:8px;right:8px;bottom:5px;height:48px;display:flex;justify-content:space-between;z-index:50;pointer-events:none}.zoom .zb{pointer-events:auto}
#zOut{order:-1}
.zb{width:48px;height:48px;border-radius:14px;border:2px solid #fff3c2;background:rgba(20,10,22,.72);color:#fff;font:900 28px/1 Arial,sans-serif;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 10px rgba(0,0,0,.4);cursor:pointer}
.zb:disabled{opacity:.4}
.zb:focus-visible{outline:3px solid #fff;outline-offset:2px}

/* tfMJ13 accessibility pack (expert spec P2): Large tiles, High contrast, Tile names, Calm play */
.set-h{margin:6px 0 0;font:900 17px/1.2 Georgia,serif;color:#0f5c45;text-align:left}
/* Large: the art fills more of the tile; boards start zoomed in (see autoLarge) */
body.a-large .tile .face{inset:1px 2px 2px 1px}
body.a-large .tile.sel{box-shadow:0 0 0 5px #ffd23f,0 0 20px 8px rgba(255,210,63,.8),4px 10px 12px rgba(0,0,0,.5)}
/* High contrast: one bold color per suit, big white symbols, strong free/blocked difference */
body.a-hc .face use,body.a-hc .face .idx{display:none}
body.a-hc .face .sbg,body.a-hc .face .simp{display:inline}
.face .simp{paint-order:stroke;stroke:rgba(0,0,0,.5);stroke-width:2.5px}
.sb-d{fill:#1f5fd1}.sb-b{fill:#118a3c}.sb-c{fill:#d4202a}.sb-w{fill:#6a32b8}.sb-r{fill:#d85f00}.sb-f{fill:#d6337f}.sb-s{fill:#a8297a}
body.cb .sb-d{fill:#0072b2}body.cb .sb-b{fill:#009e73}body.cb .sb-c{fill:#d55e00}body.cb .sb-w{fill:#000}body.cb .sb-r{fill:#7a5a00}body.cb .sb-f{fill:#cc79a7}body.cb .sb-s{fill:#8a4a75}
body.a-hc .tile.blocked::before{background:rgba(0,0,0,.5)}
/* retired with auto-highlight:
body.a-hc.hl-free .tile.free:not(.belt){outline:3px solid #fff;outline-offset:-3px}
*/
body.a-hc .tile.pink .face{outline:4px solid #ff5fa8;outline-offset:-4px;border-radius:6px}
/* Tile names: English name band above a slightly smaller picture */
body.a-lab .face .lab{display:inline}
body.a-lab .face svg.l1 use{transform:translate(6px,14px) scale(.8)}
body.a-lab .face svg.l2 use{transform:translate(9px,25px) scale(.7)}
body.a-lab .face .idx{display:none}
body.a-lab.a-hc .face svg .simp{transform:translate(9px,22px) scale(.7)}
/* Calm play: no score pressure while playing */
body.a-zen .g-score,body.a-zen .t-score,body.a-zen .pop{display:none!important}
body.a-lab .face .bdg{display:none!important}

/* t8599 (TestMu iPhone/Galaxy): the required-notices bar reads easily (13px, brighter). Phones in portrait get two
   balanced lines in a taller bar; wider screens keep one line. */
:root{--lb-notices-h:32px}
.lb-notices{font:600 13px/1.3 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif!important;color:#f3eef6!important;letter-spacing:.1px;display:flex;align-items:center;justify-content:center;text-align:center;text-wrap:balance;padding:5px 10px calc(5px + env(safe-area-inset-bottom))!important}
@media (max-width:520px) and (orientation:portrait){:root{--lb-notices-h:46px}.lb-notices span{max-width:300px}}
@media (orientation:landscape) and (max-height:500px){:root{--lb-notices-h:28px}.lb-notices{white-space:nowrap;padding:4px 8px calc(4px + env(safe-area-inset-bottom))!important}}

/* t8617: short landscape — daily calendar must clear the 18+ bar and stay scrollable */
@media (orientation:landscape) and (max-height:500px){#daily .pg{gap:8px;padding:6px 12px 20px}.dy-today{padding:10px 12px 8px}.dy-today .pill{min-height:48px}}

/* t8618: at 390-wide portrait, fit every Settings row (including Calm play's subtitle) above Done */
@media (max-width:420px) and (orientation:portrait){
  #pSettings{padding:12px 16px}
  #pSettings h2{margin:0 0 4px;font-size:22px}
  #pSettings .sw,#pSettings .sel{min-height:40px;padding:3px 2px}
  #pSettings .sw2{padding:5px 2px}
  #pSettings .sel select{min-height:36px}
  #pSettings > button.pill[data-close]{margin-top:6px}
}

/* ---------- Versus (t8619): humans-only, Vaulted fees, invite by code or link ---------- */
body.m-versus .boosters{display:none!important}
.g-vs{display:none;margin:0;padding:6px 12px;text-align:center;font-weight:800;font-size:15px;letter-spacing:.01em;background:rgba(12,6,14,.62);border-bottom:1px solid rgba(245,197,66,.3);color:#ffe9a6}
body.m-versus .g-vs, .g-vs:not([hidden]){display:block}
#versus .pg,.vs-pg{flex:1;overflow:auto;-webkit-overflow-scrolling:touch;padding:8px 12px 28px;display:flex;flex-direction:column;gap:12px;max-width:720px;width:100%;margin:0 auto;box-sizing:border-box}
.vs-fee{font-weight:800;color:#0f5c45;margin:8px 0}
.vs-fee .nw{white-space:nowrap}
#vsActions{display:flex;flex-direction:column;gap:12px}
#vsActions .pill.big{width:100%}
.vs-join{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center}
.vs-join label{grid-column:1/-1;font-weight:800;color:#0f5c45;margin:2px 0 0}
#vsCode{min-height:52px;width:100%;font:800 22px/1 ui-monospace,Menlo,Consolas,monospace;letter-spacing:.28em;text-align:center;text-transform:uppercase;border:3px solid var(--gold);border-radius:12px;padding:0 12px;color:#1b1b1b;background:#fff;user-select:text;-webkit-user-select:text}
.vs-code{font:900 34px/1.15 ui-monospace,Menlo,Consolas,monospace;letter-spacing:.22em;text-align:center;user-select:text;-webkit-user-select:text;color:#1b1b1b;background:#fff3d6;border:3px solid var(--gold);border-radius:14px;padding:14px 10px;margin:12px 0 8px}
.vs-link{font-size:13px;word-break:break-all;color:#5a4a2a;margin:0 0 8px;text-align:center;user-select:text;-webkit-user-select:text}
.vs-wait-btns{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.dy-boards{display:grid;gap:12px}
@media (min-width:720px){.dy-boards{grid-template-columns:1fr 1fr;align-items:start;gap:12px}}
@media (orientation:landscape) and (max-height:500px){
  .vs-code{font-size:26px;padding:8px;margin:6px 0}
  #vsActions{gap:8px}
  #vsCode{min-height:44px}
  #title .t-row .pill#btnVersus{min-height:40px}
}
@media (max-width:340px){
  .vs-code{font-size:26px;letter-spacing:.14em}
  #vsCode{letter-spacing:.16em;font-size:18px}
}

@media (orientation:landscape) and (max-height:500px){
  #versus .pg,.vs-pg{gap:8px;padding:6px 12px 20px;max-width:none}
  #versus .pg-card{padding:8px 12px}
  #versus .pg-card p{margin:4px 0}
  .vs-fee{margin:4px 0}
  #vsActions{gap:8px}
  #vsActions .pill.big{min-height:48px;font-size:18px}
  #vsCode{min-height:44px}
  .vs-join{gap:8px}
}
@media (max-height:600px) and (orientation:portrait){
  #versus .pg,.vs-pg{gap:8px;padding:6px 10px 24px}
  #versus .pg-card{padding:8px 10px}
  #versus .pg-card p{margin:4px 0}
  .vs-fee{margin:6px 0}
  #vsActions{gap:8px}
  #vsActions .pill.big{min-height:50px}
}

/* t8619: Versus stays hidden unless ?vsbeta=1 (or the localStorage key that param sets) */
body:not(.vs-beta) .vs-only{display:none!important}
body:not(.vs-beta) .dy-boards{display:block}

#pWin .btn4,#pFull>.col,#pStuck>.col,#pReg>.col,#pMore>.col,#pVsLeave>.col{flex:0 0 auto;margin-top:0;padding-top:10px;background:#fffaf0;position:relative;z-index:2;box-shadow:0 -10px 12px #fffaf0}
#pWin h2,#pFull h2,#pStuck h2,#pReg h2{flex:0 0 auto}
@media (orientation:landscape) and (max-height:500px){
  #pWin .win-art{height:72px;margin-top:-10px}
  #pWin .win-stats b{font-size:22px}
  #pWin .btn4{margin-top:6px;gap:8px}
  #pWin .btn4 .pill{min-height:44px}
  #pFull .pill.big{min-height:44px}
}
@media (orientation:landscape) and (max-height:400px){
  #pWin .win-art{display:none}
  #pWin .win-goals{margin-top:0}
}

/* ========== M1 (mj2-tfMJ19-m1) ==========
   Skin layer, Clear Flowers & Seasons overlays, level jump / codes, How to Play,
   five helpers, desktop laptop layout, audio sliders. Auto-highlight stays off. */

/* Skin hook: swap faces / bevels / tray / helper chrome by data-tileset when approved
   art lands (planned path art/tiles-v1/). Do not ship unapproved art. Never use
   pitch-modes concept mocks. */
body[data-tileset] .tile{/* default ivory bevels stay until an approved set is set */}
body[data-tileset="tiles-v1"] .tile .face{/* reserved: approved faces drop in here */}
body[data-tileset="tiles-v1"] .tray{/* reserved: approved 7-slot tray chrome */}
body[data-tileset="tiles-v1"] .bst{/* reserved: approved helper-button chrome */}

.btn-lobby{min-height:44px;border-radius:12px;border:2px solid rgba(255,255,255,.55);background:rgba(20,10,22,.6);color:#fff;font-weight:800;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;padding:0 12px;font-size:16px;white-space:nowrap}
.g-lobby{padding:0 10px;min-width:0;font-size:15px}
.g-code{display:inline-block;margin-left:8px;padding:1px 8px;border-radius:8px;background:rgba(0,0,0,.45);border:1.5px solid var(--gold);color:#ffe9a6;font:800 14px/1.3 ui-monospace,Menlo,Consolas,monospace;letter-spacing:.08em;vertical-align:middle}
.g-lay{font-weight:700;opacity:.95;font-size:.92em}

/* Level jump + codes */
.lv-jump{padding:8px 14px 4px;flex:0 0 auto}
.lv-jump-row{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end;justify-content:center;margin:4px 0}
.lv-jump-row label{display:flex;flex-direction:column;gap:4px;font-weight:800;font-size:15px;color:#ffe9a6}
.lv-jump-row input{min-height:48px;min-width:9ch;padding:6px 12px;border-radius:12px;border:2px solid #fff3c2;background:#fffaf0;color:#1b1b1b;font:800 22px/1.2 ui-monospace,Menlo,Consolas,sans-serif;letter-spacing:.06em}
#lvCode{text-transform:uppercase;min-width:10ch}
.lv-jump .or{align-self:center;font-weight:800;opacity:.85;padding-bottom:8px}
.lv-code-live{text-align:center;margin:6px 0 4px;font-size:17px}
.lv-code-live b{font:800 20px/1.2 ui-monospace,Menlo,Consolas,monospace;color:#ffe9a6;letter-spacing:.12em;padding:2px 10px;border:1.5px solid var(--gold);border-radius:8px;background:rgba(0,0,0,.35)}
.lv-page{display:flex;gap:10px;align-items:center;justify-content:center;margin:6px 0 8px}
.lv-page .pill{min-height:44px}
.lv .lv-code{display:block;font:700 10px/1 ui-monospace,Menlo,Consolas,monospace;letter-spacing:.06em;opacity:.9;margin-top:1px}
.lv{font-size:20px}

/* Five round helpers with counters. Never a dead Reshuffle with no path. */
.boosters{gap:clamp(6px,2.4vw,22px);flex-wrap:wrap}
.bst{width:60px;height:60px}
.bst .bl{font-size:10px}
body.magnet-on #bMagnet{box-shadow:0 0 0 4px #ffe07a,0 0 16px 4px rgba(245,197,66,.7)}
.bst[data-b=shuffle].off{filter:none;opacity:1} /* Reshuffle is never visually dead-ended */

/* Clear Flowers & Seasons — overlay only; never replaces face art. Shape + color. */
.fs-mark,.num-mark{display:none;pointer-events:none;z-index:4}
.fs-mark{position:absolute;inset:-2px -2px -2px -2px}
.fs-mark img{width:100%;height:100%;display:block;filter:drop-shadow(0 1px 1px rgba(0,0,0,.35))}
body.a-clearfs .fs-mark{display:block}
body.a-clearfs .tile[data-suit="f"]{
  border-radius:18px 18px 16px 16px;
  box-shadow:0 0 0 3px #fffef8,0 0 0 7px #c0156a,4px 8px 10px rgba(0,0,0,.45);
}
body.a-clearfs .tile[data-suit="s"]{
  border-radius:4px;
  box-shadow:0 0 0 3px #fffef8,0 0 0 7px #0e6e6c,4px 8px 10px rgba(0,0,0,.45);
}
.num-mark{position:absolute;left:50%;bottom:2px;transform:translateX(-50%);min-width:1.2em;padding:1px 5px;border-radius:6px;
  font:900 20px/1 "Arial Black",Arial,sans-serif;color:#1b1b1b;background:rgba(255,250,240,.9);box-shadow:0 0 0 1.5px #1b1b1b;
  text-align:center}
body.a-clearfs .num-mark{display:flex;align-items:center;justify-content:center}
body.a-large .num-mark{font-size:22px}
body.a-clearfs.a-hc .num-mark{background:#fff;box-shadow:0 0 0 2px #000;font-size:24px}
/* bigger corner numerals too, when labels are on */
body.a-clearfs .idx{font-size:24px}

/* Audio sliders */
#pSettings .vol{display:flex;align-items:center;gap:10px;margin:8px 0;font-weight:800}
#pSettings .vol input[type=range]{flex:1;min-height:32px;accent-color:var(--gold)}
#pSettings .vol span{min-width:2.4em;text-align:right;font-variant-numeric:tabular-nums}
#setHow{margin-top:8px;width:100%}

/* How to Play screen: big readable type for an older first-time player */
#how{background:linear-gradient(180deg,rgba(12,6,14,.55),rgba(12,6,14,.82))}
.how-body{flex:1;overflow:auto;padding:12px 20px 32px;max-width:820px;margin:0 auto;width:100%;font-size:20px;line-height:1.5;text-align:left}
.how-body h3{margin:22px 0 8px;font-size:24px;color:#ffe9a6}
.how-body p,.how-body li{margin:8px 0;font-size:20px;line-height:1.5}
.how-lead{font-size:21px;font-weight:600}
.how-body ul{margin:8px 0 12px 1.15em;padding:0}
.how-helpers li{margin:10px 0}
.how-body .fine{font-size:16px;opacity:.9}

/* Get-another-Reshuffle */
#pShuffle .col{gap:10px;margin:10px 0}

/* 7-slot tray: keep readable, plan for approved chrome */
.tray{grid-template-columns:repeat(7,1fr)}

/* Phone: five helpers still fit */
@media (max-width:430px){
  .bst{width:54px;height:54px}
  .bst .bi{font-size:20px}
  .bst .bl{font-size:9px}
  .boosters{gap:6px;padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
  .g-lobby{padding:0 6px;font-size:13px}
  .g-code{font-size:11px;padding:1px 5px;margin-left:4px}
  .how-body,.how-body p,.how-body li{font-size:18px}
  .how-body h3{font-size:21px}
}

/* Desktop / laptop: a real desktop layout, never a phone stack at 1280×800 or 1440×900 */
@media (min-width:1200px) and (min-height:700px){
  :root{--bar-h:58px;--top-h:108px;--bst-h:108px}
  #title .t-card{width:min(720px,50vw);padding:28px 28px 22px;margin:auto auto 48px 6vw}
  #title h1{font-size:60px}
  .modes{grid-template-columns:1fr 1fr 1fr;gap:16px}
  .mode{min-height:180px}
  .m-name{font-size:28px}
  .m-lvl{font-size:20px}
  .bst{width:80px;height:80px}
  .bst .bi{font-size:30px}
  .bst .bl{font-size:13px}
  .badge{min-width:30px;height:30px;font-size:16px}
  .tray{width:min(92vw,640px);height:96px}
  .how-body{max-width:900px;font-size:22px;padding:18px 28px 48px}
  .how-body h3{font-size:28px}
  .how-body p,.how-body li{font-size:22px}
  .lv-grid{grid-template-columns:repeat(auto-fill,minmax(80px,1fr));max-width:980px;margin:0 auto;width:100%}
  .lv{font-size:24px}
  .lv .lv-code{font-size:11px}
  .g-lvl{font-size:20px}
  .g-code{font-size:16px}
  .btn-lobby{font-size:17px}
  #pSettings{width:min(560px,46vw)}
  #pSettings .vol{font-size:18px}
}
@media (min-width:1280px) and (min-height:800px){
  :root{--top-h:116px;--bst-h:116px}
  .bst{width:86px;height:86px}
  #title .t-card{width:min(760px,48vw)}
  .tray{width:680px;height:104px}
}


/* ========== Sunday Still (mj2-tfMJ20-still) ==========
   Comfort mode: untimed, no score, Large + Clear FS, heritage layout picker.
   No character portraits (Tommy's dealers/tommy.webp smiles — Tommy never smiles;
   that file is not shown. Pitch-mock robots are forbidden). */

.still-enter{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  width:100%;margin:0 0 14px;padding:16px 18px;min-height:88px;
  border-radius:18px;border:2px solid #ffe9a6;background:linear-gradient(180deg,rgba(40,22,28,.75),rgba(18,8,20,.9));
  color:#fff;cursor:pointer;text-align:center;
}
.still-enter .m-name{font:900 28px/1.15 Georgia,serif;color:#ffe9a6}
.still-enter .m-sub{font:700 16px/1.3 system-ui,sans-serif;opacity:.95}
.still-enter:focus-visible,.st-ly:focus-visible{outline:3px solid #ffe07a;outline-offset:3px}

#still{background:linear-gradient(180deg,rgba(12,6,14,.55),rgba(12,6,14,.82))}
.still-body{flex:1;overflow:auto;padding:12px 18px 36px;max-width:980px;margin:0 auto;width:100%}
.still-lead{font-size:21px;line-height:1.5;font-weight:600;margin:8px 0 10px;text-align:left}
.still-motto{font:900 24px/1.3 Georgia,serif;color:#ffe9a6;text-align:center;margin:8px 0 12px}
.still-fine{font-size:18px;line-height:1.5;margin:0 0 16px;text-align:left;opacity:.95}
.st-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:14px;list-style:none;margin:0;padding:0}
.st-ly{width:100%;min-height:160px;padding:10px 10px 12px;border-radius:16px;border:2px solid rgba(255,233,166,.55);
  background:rgba(20,10,22,.7);color:#fff;display:flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer}
.st-ly .ly-mini{width:100%;height:88px}
.st-ly .ly-name{font:900 20px/1.2 Georgia,serif}
.st-ly .ly-sub{font:700 14px/1.2 system-ui,sans-serif;opacity:.9}
.st-ly.start-here{border-color:#ffe9a6;box-shadow:0 0 0 2px rgba(255,233,166,.35)}
.st-ly.done small{font-size:16px;color:#9fefa8}

/* In-game: hide score, combo, and timer. Show the quiet motto. Big Lobby stays. */
body.m-still .g-score,body.m-still .g-combo,body.m-still #gTimer{display:none !important}
#gStillMotto[hidden]{display:none}
body.m-still #gStillMotto{display:inline-block !important;font:700 14px/1.2 Georgia,serif;color:#ffe9a6;padding:2px 8px;white-space:nowrap}

/* Gentle win: last tile in the box. No characters. */
body.m-still #pWin .win-art:not(#winArtStill){display:none}
#winArtStill.still-box{display:flex;align-items:flex-end;justify-content:center;height:88px;margin:8px auto 4px;position:relative;gap:0}
#winArtStill[hidden]{display:none}
.still-box-body{width:86px;height:36px;border:3px solid #6b4423;border-top:none;background:#c4a574;border-radius:0 0 8px 8px;box-shadow:inset 0 6px 0 #a9844f}
.still-box-lid{position:absolute;top:18px;width:96px;height:10px;background:#8a5a2b;border-radius:3px;transform:rotate(-18deg);transform-origin:8px 50%}
.still-box-tile{position:absolute;top:8px;width:28px;height:38px;border-radius:5px;background:#fffaf0;border:2px solid #3b2a14;
  box-shadow:3px 4px 0 rgba(0,0,0,.25);transform:translateY(10px)}
@media (prefers-reduced-motion:reduce){
  .still-box-lid,.still-box-tile{transform:none}
}

/* Desktop / laptop: keep the 3-column Classic/Flip/Tray grid; Still is a full-width comfort card. */
@media (min-width:1200px) and (min-height:700px){
  .still-enter{min-height:110px;padding:22px;margin-bottom:18px}
  .still-enter .m-name{font-size:34px}
  .still-enter .m-sub{font-size:20px}
  .still-lead{font-size:24px}
  .still-motto{font-size:30px}
  .still-fine{font-size:20px}
  .st-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:18px}
  .st-ly{min-height:200px}
  .st-ly .ly-name{font-size:24px}
  .st-ly .ly-sub{font-size:16px}
  .st-ly .ly-mini{height:110px}
  body.m-still #gStillMotto{font-size:17px}
  #still .btn-lobby{font-size:18px;min-height:48px;padding:0 16px}
}
@media (min-width:1280px) and (min-height:800px){
  .still-enter{min-height:120px}
  .st-grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
}
@media (max-width:430px){
  .still-enter{min-height:76px;padding:12px 14px;margin-bottom:12px}
  .still-enter .m-name{font-size:24px}
  .still-enter .m-sub{font-size:15px}
  .still-lead,.still-fine{font-size:18px}
  .still-motto{font-size:20px}
  .st-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}
  .st-ly{min-height:140px}
  .st-ly .ly-name{font-size:18px}
  body.m-still #gStillMotto{font-size:12px;padding:2px 4px}
}


/* ========== Lantern Reveal (mj2-tfMJ21-lantern) ==========
   Face-down tiles show an original lantern back until they become free, then
   they flip (slow, replayable) with a soft glow. Flower and season backs use
   different SHAPES (five-petal vs diamond vs oval), same gold-on-wine palette
   — not color alone. Peek is a limited helper. No portraits (Tommy never
   smiles; pitch-mock robots are forbidden). Mock 02-lantern-reveal.jpg is mood only.
   Server: No. Audio-v1 stays pending approval. */

.lantern-enter{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  width:100%;margin:0 0 14px;padding:16px 18px;min-height:88px;
  border-radius:18px;border:2px solid #e8c36a;background:linear-gradient(180deg,rgba(90,24,42,.82),rgba(28,8,18,.94));
  color:#fff;cursor:pointer;text-align:center;
}
.lantern-enter .m-name{font:900 28px/1.15 Georgia,serif;color:#f0d78a}
.lantern-enter .m-sub{font:700 16px/1.3 system-ui,sans-serif;opacity:.95}
.lantern-enter:focus-visible,.ln-ly:focus-visible{outline:3px solid #ffe07a;outline-offset:3px}

#lantern{background:linear-gradient(180deg,rgba(28,8,16,.55),rgba(16,6,12,.86))}
.lantern-body{flex:1;overflow:auto;padding:12px 18px 36px;max-width:980px;margin:0 auto;width:100%}
.lantern-lead{font-size:21px;line-height:1.5;font-weight:600;margin:8px 0 10px;text-align:left}
.lantern-motto{font:900 24px/1.3 Georgia,serif;color:#f0d78a;text-align:center;margin:8px 0 12px}
.lantern-fine{font-size:18px;line-height:1.5;margin:0 0 16px;text-align:left;opacity:.95}

/* In-game motto. Timer stays off (Tea-Timer is a later mode). Score stays. */
#gLanternMotto[hidden]{display:none}
body.m-lantern #gLanternMotto{display:inline-block !important;font:700 14px/1.2 Georgia,serif;color:#f0d78a;padding:2px 8px;white-space:nowrap}
body.m-lantern #gTimer{display:none !important}

/* Peek helper is Lantern-only. Six buttons wrap on a narrow phone. */
#bPeek{display:none}
body.m-lantern #bPeek{display:flex}
body.m-lantern .boosters{gap:clamp(4px,1.8vw,18px)}
body.peek-on{cursor:help}
body.peek-on #bPeek{box-shadow:0 0 0 3px #f0d78a,0 0 14px 4px rgba(240,215,138,.55)}

/* Covered tiles: lantern back. Face, Clear-FS marks, and rank numerals stay hidden
   until the tile is free or Peeked — rank must not leak. Flower/season distinction
   is the back SHAPE (and the existing Clear-FS outer tile silhouette). */
body.m-lantern .tile .lantern-spin{position:absolute;inset:0;transform-origin:center center}
body.m-lantern .tile .lantern-back{display:none;position:absolute;inset:0;z-index:3;pointer-events:none;border-radius:9px;overflow:hidden}
body.m-lantern .tile .lantern-back img,body.m-lantern .tile .lantern-back svg{width:100%;height:100%;display:block}
body.m-lantern .tile.hid{
  background:#4a1528;
  box-shadow:inset 0 0 0 1px rgba(232,195,106,.45),1px 1px 0 #6b1e36,2px 2px 0 #4a1528,3px 3px 0 #3a1020,4px 4px 0 #2e8c5c,5px 5px 0 #237a4d,6px 6px 0 #1a6640,7px 8px 9px rgba(0,0,0,.5);
}
body.m-lantern .tile.hid::after{background:radial-gradient(ellipse 80% 45% at 30% 12%,rgba(255,233,166,.18),rgba(255,255,255,0) 70%)}
body.m-lantern .tile.hid .face{visibility:hidden}
body.m-lantern .tile.hid .lantern-back{display:block}
body.m-lantern .tile.hid .fs-mark,
body.m-lantern .tile.hid .num-mark{display:none !important}
body.m-lantern .tile.hid.blocked::before{background:rgba(20,6,12,.22)}

/* Slow flip + soft glow. Animation lives on the inner spin so .tile.sel translateY is safe. */
body.m-lantern .tile.revealing .lantern-spin{animation:lanternFlip .8s ease-in-out}
@keyframes lanternFlip{
  0%{transform:scaleX(1)}
  45%{transform:scaleX(.06)}
  55%{transform:scaleX(.06)}
  100%{transform:scaleX(1)}
}
body.m-lantern .tile.revealing{
  box-shadow:0 0 0 3px #ffe07a,0 0 22px 8px rgba(255,200,80,.7),4px 8px 10px rgba(0,0,0,.45);
}
body.m-lantern .tile.peeked:not(.hint){
  box-shadow:0 0 0 3px #f0d78a,0 0 14px 4px rgba(240,215,138,.5),4px 8px 10px rgba(0,0,0,.45);
}
body.calm .tile.revealing .lantern-spin,
body.m-lantern.calm .tile.revealing .lantern-spin{animation:none}
@media (prefers-reduced-motion:reduce){
  body.m-lantern .tile.revealing .lantern-spin{animation:none}
}

/* Once revealed, Clear Flowers & Seasons marks and Large-tile numerals must be readable. */
body.m-lantern.a-clearfs .tile:not(.hid) .fs-mark{display:block}
body.m-lantern.a-clearfs .tile:not(.hid) .num-mark{display:flex;align-items:center;justify-content:center}
body.m-lantern.a-large .tile:not(.hid) .num-mark{font-size:22px}
body.m-lantern.a-large.a-clearfs .tile:not(.hid) .fs-mark{inset:-3px}

/* Win: a lit lantern, no characters. */
body.m-lantern #pWin .win-art:not(#winArtLantern){display:none}
#winArtLantern.lantern-lit{display:flex;align-items:flex-end;justify-content:center;height:96px;margin:8px auto 4px;position:relative}
#winArtLantern[hidden]{display:none}
.ln-lit-glow{position:absolute;bottom:10px;width:70px;height:70px;border-radius:50%;background:radial-gradient(circle,rgba(255,224,122,.75),rgba(255,200,80,0) 70%);pointer-events:none}
.ln-lit-body{position:relative;width:36px;height:52px;border-radius:50%;background:radial-gradient(ellipse at 35% 30%,#ffe9a6,#e8a84a 55%,#b86a16);border:3px solid #f0d78a;box-shadow:0 0 16px 4px rgba(255,210,80,.55)}
.ln-lit-cap{position:absolute;top:6px;width:22px;height:8px;background:#f0d78a;border-radius:2px;z-index:1}
.ln-lit-tassel{position:absolute;bottom:4px;width:2px;height:12px;background:#e8c36a}
@media (prefers-reduced-motion:reduce){
  .ln-lit-glow{opacity:.7}
}

@media (min-width:1200px) and (min-height:700px){
  .lantern-enter{min-height:110px;padding:22px;margin-bottom:18px}
  .lantern-enter .m-name{font-size:34px}
  .lantern-enter .m-sub{font-size:20px}
  .lantern-lead{font-size:24px}
  .lantern-motto{font-size:30px}
  .lantern-fine{font-size:20px}
  body.m-lantern #gLanternMotto{font-size:17px}
  #lantern .btn-lobby{font-size:18px;min-height:48px;padding:0 16px}
}
@media (min-width:1280px) and (min-height:800px){
  .lantern-enter{min-height:120px}
}
@media (max-width:430px){
  .lantern-enter{min-height:76px;padding:12px 14px;margin-bottom:12px}
  .lantern-enter .m-name{font-size:24px}
  .lantern-enter .m-sub{font-size:15px}
  .lantern-lead,.lantern-fine{font-size:18px}
  .lantern-motto{font-size:20px}
  body.m-lantern #gLanternMotto{font-size:12px;padding:2px 4px}
  body.m-lantern .bst{width:50px;height:50px}
  body.m-lantern .bst .bl{font-size:8px}
  body.m-lantern .bst .bi{font-size:18px}
  body.m-lantern .boosters{gap:4px;padding:6px 2px calc(6px + env(safe-area-inset-bottom))}
}


/* ========== Second Glance (mj2-tfMJ22-glance) ==========
   Match-twice Flip rules on heritage layouts. A free ivory pair turns to a
   second original face (large, high-contrast, with a "2" mark) and stays;
   match that face to clear them. Flower and Season marks persist on both
   faces. No new layouts. Untimed. No portraits (Tommy never smiles;
   pitch-mock robots are forbidden). There is no concept mock for this mode.
   Server: No. Audio-v1 stays pending approval. */

.glance-enter{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  width:100%;margin:0 0 14px;padding:16px 18px;min-height:88px;
  border-radius:18px;border:2px solid #f0a0bc;
  background:linear-gradient(180deg,rgba(110,16,52,.88),rgba(36,8,22,.96));
  color:#fff;cursor:pointer;text-align:center;
}
.glance-enter .m-name{font:900 28px/1.15 Georgia,serif;color:#ffe0ea}
.glance-enter .m-sub{font:700 16px/1.3 system-ui,sans-serif;opacity:.95}
.glance-enter:focus-visible,.gl-ly:focus-visible{outline:3px solid #ffe07a;outline-offset:3px}

#glance{background:linear-gradient(180deg,rgba(48,8,24,.58),rgba(18,4,12,.88))}
.glance-body{flex:1;overflow:auto;padding:12px 18px 36px;max-width:980px;margin:0 auto;width:100%}
.glance-lead{font-size:21px;line-height:1.5;font-weight:600;margin:8px 0 10px;text-align:left}
.glance-motto{font:900 24px/1.3 Georgia,serif;color:#ffd0e4;text-align:center;margin:8px 0 12px}
.glance-fine{font-size:18px;line-height:1.5;margin:0 0 16px;text-align:left;opacity:.95}

/* In-game motto. Timer stays off. Score stays. */
#gGlanceMotto[hidden]{display:none}
body.m-glance #gGlanceMotto{display:inline-block !important;font:700 14px/1.2 Georgia,serif;color:#ffd0e4;padding:2px 8px;white-space:nowrap}
body.m-glance #gTimer{display:none !important}

/* Flipped (second) face: large, high-contrast rose frame, clear "2" mark.
   Flower and Season markers stay visible on this face too. */
body.m-glance .tile.pink{
  background:linear-gradient(155deg,#fff8fb 0%,#ffd6e8 42%,#e84886 100%);
  box-shadow:1px 1px 0 #ffd0e4,2px 2px 0 #f5a0c0,3px 3px 0 #e0709a,4px 4px 0 #c4286e,5px 5px 0 #9a1a52,6px 6px 0 #6e0f3a,7px 8px 12px rgba(80,8,36,.55);
  outline:3px solid #4a0a28;
  outline-offset:-3px;
}
body.m-glance .tile.pink .face{
  transform:scale(1.10);
  transform-origin:center 52%;
}
body.m-glance.a-large .tile.pink .face{
  transform:scale(1.14);
}
.glance-mark{display:none}
body.m-glance .tile.pink .glance-mark{
  display:flex;
  position:absolute;
  top:3px;right:3px;
  z-index:6;
  width:22px;height:22px;
  align-items:center;justify-content:center;
  border-radius:50%;
  background:#4a0a28;
  color:#ffe9a6;
  font:900 14px/1 Georgia,serif;
  border:2px solid #ffe9a6;
  box-shadow:0 1px 3px rgba(0,0,0,.45);
  pointer-events:none;
}
body.m-glance.a-large .tile.pink .glance-mark{width:26px;height:26px;font-size:16px}
body.m-glance.a-clearfs .tile .fs-mark{display:block}
body.m-glance.a-clearfs .tile.pink .fs-mark{display:block;z-index:5}
body.m-glance.a-clearfs .tile .num-mark{display:flex;align-items:center;justify-content:center}
body.m-glance.a-large .tile .num-mark{font-size:22px}
body.m-glance.a-large.a-clearfs .tile .fs-mark{inset:-3px}
body.m-glance.a-clearfs .tile.pink .num-mark{
  background:#fff;color:#4a0a28;box-shadow:0 0 0 2px #4a0a28;
}

/* Win: two faces (ivory then rose with a 2), no characters. */
body.m-glance #pWin .win-art:not(#winArtGlance){display:none}
#winArtGlance.glance-faces{display:flex;align-items:center;justify-content:center;height:96px;margin:8px auto 4px;position:relative;gap:10px}
#winArtGlance[hidden]{display:none}
.gl-face{
  width:44px;height:58px;border-radius:8px;position:relative;
  box-shadow:2px 3px 0 #6e0f3a, 3px 5px 8px rgba(0,0,0,.35);
}
.gl-ivory{
  background:linear-gradient(155deg,#fffef8,#f3e6c8 55%,#e6d2a8);
  border:2px solid #c9b48a;
}
.gl-rose{
  background:linear-gradient(155deg,#fff8fb,#ffd0e4 45%,#e84886);
  border:3px solid #4a0a28;
  width:50px;height:66px;
}
.gl-rose .gl-two{
  position:absolute;top:3px;right:3px;
  width:16px;height:16px;border-radius:50%;
  background:#4a0a28;color:#ffe9a6;
  font:900 11px/16px Georgia,serif;text-align:center;
  border:1.5px solid #ffe9a6;
}
.gl-arrow{
  width:0;height:0;
  border-top:7px solid transparent;
  border-bottom:7px solid transparent;
  border-left:14px solid #ffe9a6;
}

@media (min-width:1200px) and (min-height:700px){
  .glance-enter{min-height:110px;padding:22px;margin-bottom:18px}
  .glance-enter .m-name{font-size:34px}
  .glance-enter .m-sub{font-size:20px}
  .glance-lead{font-size:24px}
  .glance-motto{font-size:30px}
  .glance-fine{font-size:20px}
  body.m-glance #gGlanceMotto{font-size:17px}
  #glance .btn-lobby{font-size:18px;min-height:48px;padding:0 16px}
}
@media (min-width:1280px) and (min-height:800px){
  .glance-enter{min-height:120px}
}
@media (max-width:430px){
  .glance-enter{min-height:76px;padding:12px 14px;margin-bottom:12px}
  .glance-enter .m-name{font-size:24px}
  .glance-enter .m-sub{font-size:15px}
  .glance-lead,.glance-fine{font-size:18px}
  .glance-motto{font-size:20px}
  body.m-glance #gGlanceMotto{font-size:12px;padding:2px 4px}
  body.m-glance .bst{width:50px;height:50px}
  body.m-glance .bst .bl{font-size:8px}
  body.m-glance .bst .bi{font-size:18px}
  body.m-glance .boosters{gap:4px;padding:6px 2px calc(6px + env(safe-area-inset-bottom))}
  /* Comfort-mode buttons: keep them compact on a phone. */
  .still-enter,.lantern-enter,.glance-enter,.today-enter{margin-bottom:8px}
}


/* ========== Today's Board (mj2-tfMJ23-today) ==========
   Solo daily: one date-seeded, guaranteed-solvable Classic deal for everyone
   on the America/New_York calendar date. Personal streak and local best.
   Timer optional — shown softly, never a fail. Daily Race is a disabled
   "coming soon" hook (needs a server standings API). No real money.
   Mock 03-todays-board.jpg is mood only: never pitch-mock robots, never
   smiling Tommy. No portraits on this mode. Server: no (to play). */

.today-enter{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  width:100%;margin:0 0 14px;padding:16px 18px;min-height:88px;
  border-radius:18px;border:2px solid #e0b860;
  background:linear-gradient(180deg,rgba(72,44,10,.92),rgba(28,16,4,.96));
  color:#fff;cursor:pointer;text-align:center;
}
.today-enter .m-name{font:900 28px/1.15 Georgia,serif;color:#ffe7b0}
.today-enter .m-sub{font:700 16px/1.3 system-ui,sans-serif;opacity:.95;color:#f6e2b8}
.today-enter:focus-visible,.today-cal .day:focus-visible{outline:3px solid #ffe07a;outline-offset:3px}

#today{background:linear-gradient(180deg,rgba(48,28,8,.55),rgba(18,10,4,.88));display:flex;flex-direction:column}
.today-body{flex:1;overflow:auto;padding:12px 18px 36px;max-width:720px;margin:0 auto;width:100%}
.today-lead{font-size:21px;line-height:1.5;font-weight:600;margin:8px 0 10px;text-align:left}
.today-motto{font:900 24px/1.3 Georgia,serif;color:#ffe7b0;text-align:center;margin:8px 0 6px}
.today-date{font:900 22px/1.3 Georgia,serif;color:#fff4d4;text-align:center;margin:4px 0 8px}
.today-streak{font:700 18px/1.4 system-ui,sans-serif;color:#f0d9a0;text-align:center;margin:0 0 4px}
.today-best{font:700 16px/1.4 system-ui,sans-serif;color:#d8c090;text-align:center;margin:0 0 12px;min-height:1.2em}
.today-actions{display:flex;flex-direction:column;gap:8px;margin:0 0 14px}
.today-actions .pill{width:100%;white-space:nowrap}
.today-fine{font-size:18px;line-height:1.5;margin:0 0 18px;text-align:left;opacity:.95}
.today-cal-card{margin:0 0 16px}
.today-cal .day.today{border-color:#e0b860;box-shadow:0 0 0 2px #e0b860;background:#fff4d4}
.today-cal .day.done{background:#e8f6ee;border-color:#3b8a62}
.today-cal .day.in-progress{background:#fff0d0;border-color:#c4922a}
.today-cal .day[disabled]{opacity:.45;cursor:default}
.today-race.coming{opacity:.95}
.today-race-copy{font-size:17px;line-height:1.45;margin:0 0 12px}
.today-race .pill[disabled]{opacity:.55;cursor:not-allowed;filter:grayscale(.15);pointer-events:none}

/* In-game motto. Timer is optional (Show timer setting) and never a fail. */
#gTodayMotto[hidden]{display:none}
body.m-today #gTodayMotto{display:inline-block !important;font:700 14px/1.2 Georgia,serif;color:#ffe7b0;padding:2px 8px;white-space:nowrap}
body.m-today #gTimer{opacity:.85;font-weight:700}

/* Win art: a little calendar page with a check. No characters. */
body.m-today #pWin .win-art:not(#winArtToday){display:none}
#winArtToday.today-cal-art{display:flex;align-items:center;justify-content:center;height:96px;margin:8px auto 4px;background:none;background-image:none;border-radius:0}
#winArtToday[hidden]{display:none}
.td-cal-page{
  position:relative;width:72px;height:80px;border-radius:8px 8px 6px 6px;
  background:linear-gradient(180deg,#fffaf0,#f3e4c0);
  border:2px solid #8a5a14;box-shadow:2px 3px 0 #5a3a10, 3px 5px 10px rgba(40,20,0,.35);
}
.td-cal-bind{display:block;height:14px;background:linear-gradient(180deg,#b42828,#8a1818);border-radius:6px 6px 0 0;margin:-2px -2px 0}
.td-cal-num{display:block;text-align:center;font:900 32px/1 Georgia,serif;color:#2a1a00;padding-top:10px}
.td-cal-check{position:absolute;right:4px;bottom:4px;font-size:18px;color:#0f5c45;font-weight:900}

#pWin .win-time.soft{font-weight:700;color:#3a2a10;opacity:.95}

@media (min-width:900px){
  .today-enter{min-height:110px;padding:22px;margin-bottom:18px}
  .today-enter .m-name{font-size:34px}
  .today-enter .m-sub{font-size:20px}
  .today-lead,.today-fine{font-size:22px}
  .today-motto{font-size:28px}
  .today-date{font-size:26px}
  body.m-today #gTodayMotto{font-size:17px}
  #today .btn-lobby{font-size:18px;min-height:48px;padding:0 16px}
}
@media (min-width:1280px) and (min-height:800px){
  .today-enter{min-height:120px}
}
@media (max-width:430px){
  .today-enter{min-height:76px;padding:12px 14px;margin-bottom:12px}
  .today-enter .m-name{font-size:24px}
  .today-enter .m-sub{font-size:15px}
  .today-lead,.today-fine{font-size:18px}
  .today-motto{font-size:20px}
  .today-date{font-size:18px}
  .today-streak{font-size:16px}
  body.m-today #gTodayMotto{font-size:12px;padding:2px 4px}
  body.m-today .bst{width:50px;height:50px}
  body.m-today .bst .bl{font-size:8px}
  body.m-today .bst .bi{font-size:18px}
  body.m-today .boosters{gap:4px;padding:6px 2px calc(6px + env(safe-area-inset-bottom))}
}


/* tfPN9h2: Today's Board header — title and date on separate lines, fully
   visible at 360 and 390 wide, never ellipsized, never run together. */
body.m-today .g-bar{flex-wrap:wrap;align-items:center;row-gap:2px}
body.m-today .g-bar > *{order:0}
body.m-today #gLevel,
body.m-today .g-bar .g-lvl{
  order:1;
  flex:1 0 100%;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  min-width:0;
  max-width:100%;
  width:100%;
  white-space:normal;
  overflow:visible;
  text-overflow:unset;
  line-height:1.2;
  font-size:16px;
  font-weight:900;
  box-sizing:border-box;
  padding:1px 0 2px;
}
body.m-today #gLevel .g-lvl-title{
  display:block;
  font-weight:900;
  font-size:16px;
  line-height:1.2;
  white-space:nowrap;
  overflow:visible;
  text-overflow:unset;
  color:inherit;
}
body.m-today #gLevel .g-lvl-sub{
  display:block;
  font-weight:700;
  font-size:13px;
  line-height:1.25;
  white-space:nowrap;
  overflow:visible;
  text-overflow:unset;
  letter-spacing:0;
  opacity:.95;
}
@media (max-width:430px){
  /* Motto is redundant with the two-line title; hiding it frees the top row. */
  body.m-today #gTodayMotto{display:none!important}
  body.m-today #gLevel .g-lvl-title{font-size:15px}
  body.m-today #gLevel .g-lvl-sub{font-size:13px}
}
@media (max-width:360px){
  body.m-today #gLevel .g-lvl-title{font-size:15px}
  body.m-today #gLevel .g-lvl-sub{font-size:12.5px;letter-spacing:0}
}

/* t9382: Mom's Mahjong title menu must scroll above the fixed 18+ footer.
   body stays overflow:hidden for the board; #title is the scrollport (not trapped).
   100dvh is set on html/body/#app above. Flex spacer (::before, order 1) keeps the
   card low on a tall screen, then shrinks to 0 so overflow can scroll from the top. */
#title.screen{
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  scroll-padding-bottom:calc(var(--lb-notices-h) + env(safe-area-inset-bottom, 0px));
  bottom:0;
  padding-bottom:calc(var(--lb-notices-h) + env(safe-area-inset-bottom, 0px));
  justify-content:flex-start;
}
#title .bar{flex:0 0 auto;order:0;position:sticky;top:0;z-index:5}
#title::before{content:"";order:1;flex:1 1 auto;min-height:0}
#title .t-card{order:2;flex:0 0 auto;margin-top:12px}
/* Explicit end spacer: WebKit flex overflow often ignores padding-bottom when computing scrollHeight. */
#title::after{content:"";order:3;flex:0 0 auto;height:calc(var(--lb-notices-h) + env(safe-area-inset-bottom, 0px));pointer-events:none}

/* t9383: Number helper badges are a separate setting, OFF by default (a-numbadges).
   Clear Flowers & Seasons no longer turns the boxed rank numbers on. */
body.a-clearfs .num-mark{display:none}
body.a-numbadges .num-mark{display:flex;align-items:center;justify-content:center}
body.a-numbadges.a-hc .num-mark{background:#fff;box-shadow:0 0 0 2px #000;font-size:24px}
body.m-lantern.a-clearfs .tile:not(.hid) .num-mark{display:none}
body.m-lantern.a-numbadges .tile:not(.hid) .num-mark{display:flex;align-items:center;justify-content:center}
body.m-glance.a-clearfs .tile .num-mark{display:none}
body.m-glance.a-numbadges .tile .num-mark{display:flex;align-items:center;justify-content:center}
body.m-glance.a-clearfs .tile.pink .num-mark{background:rgba(255,250,240,.9);color:#1b1b1b;box-shadow:0 0 0 1.5px #1b1b1b}
body.m-glance.a-numbadges .tile.pink .num-mark{background:#fff;color:#4a0a28;box-shadow:0 0 0 2px #4a0a28}
