/* =====================================================================
 * Giggleland – platform design system (header, sidebar, home, cards,
 * game pages, profile, settings). Game screens keep style.css.
 * Colours: midnight violet base, bright "play" accents.
 * ===================================================================== */
:root {
  --tp-bg: #0e0b2b; --tp-bg2: #15113c; --tp-surface: #1c1850; --tp-surface2: #26206a; --tp-surface3: #322a85;
  --tp-line: rgba(255, 255, 255, .09); --tp-line2: rgba(255, 255, 255, .16);
  --tp-text: #f5f3ff; --tp-muted: #aaa4d8; --tp-dim: #7d77b3;
  --tp-yellow: #ffd23f; --tp-pink: #ff5fa2; --tp-violet: #7b5cff; --tp-blue: #4d9bff; --tp-green: #2ee59d; --tp-orange: #ff8a3d;
  --tp-font: "Nunito", "Baloo 2", system-ui, sans-serif; --tp-display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --tp-top: 64px; --tp-sw: 248px; --tp-sw-mini: 84px; --tp-sw-cur: var(--tp-sw);
  --card-w: 196px; --tp-short: 0;
  --tp-shadow: 0 10px 30px rgba(4, 2, 24, .45);
}
body.tp-on {
  background: radial-gradient(1100px 620px at 8% -12%, #2c1d78 0, transparent 60%), radial-gradient(900px 520px at 105% -5%, #4a1461 0, transparent 55%), radial-gradient(800px 600px at 50% 120%, #10305f 0, transparent 60%), var(--tp-bg) fixed;
  padding-top: var(--tp-top);
}
body.tp-on.tp-collapsed { --tp-sw-cur: var(--tp-sw-mini); }
body.tp-on #app { padding-left: calc(var(--tp-sw-cur) + 20px + env(safe-area-inset-left)); padding-right: 20px; padding-bottom: 28px; transition: padding-left .2s; }
body.tp-on .tiko { left: calc(var(--tp-sw-cur) + 14px); }
.tp-screen, .tp-topbar, .tp-side, .tp-panel, .tp-drop { color: var(--tp-text); font-family: var(--tp-font); }
.tp-i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tp-screen button, .tp-topbar button, .tp-side button, .tp-panel button, .tp-drop button { font-family: var(--tp-font); color: inherit; }
.tp-screen :focus-visible, .tp-topbar :focus-visible, .tp-side :focus-visible { outline: 3px solid var(--tp-yellow); outline-offset: 2px; }

/* ---------------------------------------------------------------- header */
.tp-topbar { position: fixed; z-index: 40; top: 0; left: 0; right: 0; height: var(--tp-top); display: flex; align-items: center; gap: 12px;
  padding: 0 16px 0 calc(12px + env(safe-area-inset-left)); background: rgba(14, 11, 43, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--tp-line); }
.tp-icon-btn { position: relative; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: transparent; border: 0; cursor: pointer; flex: none; transition: background .15s; }
.tp-icon-btn:hover { background: rgba(255, 255, 255, .08); }
.tp-icon-btn .tp-i { width: 24px; height: 24px; }
.tp-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--tp-text); flex: none; }
.tp-logo-mark svg { width: 38px; height: 38px; display: block; filter: drop-shadow(0 4px 10px rgba(255, 95, 162, .45)); }
.tp-logo-txt { font-family: var(--tp-display); font-weight: 800; font-size: 25px; letter-spacing: -.3px; line-height: 1; }
.tp-logo-txt b { color: var(--tp-yellow); margin: 0 1px; }
.tp-links { display: flex; gap: 2px; margin-left: 8px; }
.tp-links button { background: none; border: 0; padding: 9px 13px; border-radius: 12px; font-weight: 800; font-size: 15px; color: var(--tp-muted); cursor: pointer; transition: color .15s, background .15s; }
.tp-links button:hover { color: var(--tp-text); background: rgba(255, 255, 255, .06); }
.tp-links button.active { color: var(--tp-text); background: rgba(255, 255, 255, .1); }
.tp-search { position: relative; flex: 1 1 auto; max-width: 460px; min-width: 150px; margin: 0 auto; }
.tp-search-box { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid var(--tp-line); color: var(--tp-muted); transition: border-color .15s, background .15s; }
.tp-search-box:focus-within { border-color: var(--tp-violet); background: rgba(255, 255, 255, .12); color: var(--tp-text); }
.tp-search-box .tp-i { width: 19px; height: 19px; }
.tp-search-box input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--tp-text); font: 700 15px var(--tp-font); }
.tp-search-box input::placeholder { color: var(--tp-dim); }
.tp-search-box input::-webkit-search-cancel-button { filter: invert(1); }
.tp-top-right { display: flex; align-items: center; gap: 8px; flex: none; }
.tp-only-small { display: none; }
.tp-pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--tp-line2); background: rgba(255, 255, 255, .06); font-weight: 800; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, transform .1s; }
.tp-pill:hover { background: rgba(255, 255, 255, .12); }
.tp-pill:active, .tp-coins:active, .tp-me:active { transform: scale(.95); }
.tp-room { background: linear-gradient(135deg, #6a4bff, #a64bff); border-color: transparent; box-shadow: 0 4px 14px rgba(123, 92, 255, .35); }
.tp-room.in { background: linear-gradient(135deg, #12c27a, #2ee59d); color: #06301f; }
.tp-coins { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 6px; border-radius: 999px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #ffe27a, #ffbf1f); color: #5a3600; font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 #c98a00, 0 6px 14px rgba(255, 191, 31, .3); }
.tp-coin { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .45); font-size: 17px; }
.tp-me { display: flex; align-items: center; gap: 9px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid var(--tp-line2); background: rgba(255, 255, 255, .06); cursor: pointer; }
.tp-me-ring { --xp: 0%; width: 42px; height: 42px; border-radius: 50%; padding: 3px; flex: none; background: conic-gradient(var(--tp-yellow) var(--xp), rgba(255, 255, 255, .15) 0); display: grid; place-items: center; }
.tp-me .tp-me-ring { --xp: inherit; }
.tp-me { --xp: 0%; }
.tp-me-ring canvas { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(160deg, #7cc8ff, #b28dff); display: block; }
.tp-me-txt { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.tp-me-txt b { font-size: 14px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-me-txt small { font-size: 12px; color: var(--tp-yellow); font-weight: 800; }
.tp-dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tp-pink); color: #fff; font: 900 11px/18px var(--tp-font); box-shadow: 0 0 0 2px var(--tp-bg); }
.tp-topbar .net-dot { width: 9px; height: 9px; }
.tp-members { display: flex; gap: 4px; }
.tp-members .member { width: 38px; height: 38px; box-shadow: 0 0 0 2px var(--tp-violet); }
.tp-members .member canvas { width: 34px; height: 34px; }
.tp-members:empty { display: none; }

/* drop-down panels */
.tp-panel { position: fixed; z-index: 60; top: calc(var(--tp-top) + 6px); right: 12px; width: 340px; max-height: min(70vh, 560px); overflow-y: auto; border-radius: 20px;
  background: var(--tp-surface); border: 1px solid var(--tp-line2); box-shadow: var(--tp-shadow); padding: 8px; animation: tpDrop .18s ease-out; }
.tp-drop { position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; right: 0; min-width: 280px; border-radius: 18px; background: var(--tp-surface); border: 1px solid var(--tp-line2); box-shadow: var(--tp-shadow); padding: 8px; animation: tpDrop .18s ease-out; }
@keyframes tpDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tp-panel-h { padding: 8px 10px 6px; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--tp-muted); }
.tp-panel-empty { padding: 18px; text-align: center; color: var(--tp-muted); font-weight: 700; }
.tp-note, .tp-me-item, .tp-sres { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 14px; background: none; cursor: pointer; text-align: left; }
.tp-note:hover, .tp-me-item:hover, .tp-sres:hover { background: rgba(255, 255, 255, .07); }
.tp-note.unread { background: rgba(123, 92, 255, .16); }
.tp-note-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .08); font-size: 21px; }
.tp-note-txt { display: flex; flex-direction: column; gap: 2px; font-weight: 700; font-size: 14px; line-height: 1.25; }
.tp-note-txt small { color: var(--tp-dim); font-size: 12px; }
.tp-me-top { display: flex; gap: 12px; align-items: center; padding: 10px 10px 14px; border-bottom: 1px solid var(--tp-line); margin-bottom: 6px; }
.tp-me-top canvas { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(160deg, #7cc8ff, #b28dff); }
.tp-me-top > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.tp-me-top small { color: var(--tp-yellow); font-weight: 800; }
.tp-me-item { font-weight: 800; font-size: 15px; }
.tp-me-item span:first-child { width: 28px; text-align: center; font-size: 19px; }
.tp-sres img { width: 46px; height: 46px; border-radius: 12px; flex: none; }
.tp-sres div { display: flex; flex-direction: column; }
.tp-sres small { color: var(--tp-muted); font-weight: 700; }
.tp-sall { width: 100%; margin-top: 4px; padding: 11px; border: 0; border-radius: 12px; background: rgba(123, 92, 255, .22); font-weight: 800; cursor: pointer; }

/* ---------------------------------------------------------------- sidebar */
.tp-side { position: fixed; z-index: 35; top: var(--tp-top); bottom: 0; left: 0; width: var(--tp-sw-cur); padding: 12px 10px 20px calc(10px + env(safe-area-inset-left)); box-sizing: content-box;
  overflow-y: auto; overflow-x: hidden; scrollbar-width: none; background: rgba(14, 11, 43, .7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-right: 1px solid var(--tp-line); transition: width .2s; }
.tp-side { box-sizing: border-box; }
.tp-side::-webkit-scrollbar { display: none; }
.tp-nav { display: flex; flex-direction: column; gap: 2px; }
.tp-nav-item { --c: #fff; position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 10px 7px 7px; border-radius: 14px; border: 0; background: none; cursor: pointer; font-weight: 800; font-size: 15px; color: #dcd8ff; text-align: left; transition: background .15s, color .15s; }
.tp-nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.tp-nav-item.active { background: linear-gradient(90deg, rgba(123, 92, 255, .38), rgba(123, 92, 255, .1)); color: #fff; }
.tp-nav-item.active::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.tp-nav-ico { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); }
.tp-nav-item.active .tp-nav-ico { background: var(--c); color: #160f3d; }
.tp-nav-ico .tp-i { width: 21px; height: 21px; }
.tp-nav-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--tp-pink); color: #fff; font-size: 12px; line-height: 22px; text-align: center; }
.tp-nav-badge.done { background: var(--tp-green); color: #053; }
.tp-sep { margin: 14px 10px 6px; font-size: 11px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--tp-dim); }
.tp-side-foot { margin: 16px 6px 0; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); color: var(--tp-muted); font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.tp-side-game { display: none; }
/* collapsed: icons with a tiny label underneath */
.tp-collapsed .tp-nav-item { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 10.5px; text-align: center; }
.tp-collapsed .tp-nav-txt { max-width: 100%; white-space: normal; line-height: 1.1; }
.tp-collapsed .tp-nav-badge { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; padding: 0 4px; }
.tp-collapsed .tp-sep { height: 1px; margin: 10px 8px; background: var(--tp-line); font-size: 0; }
.tp-collapsed .tp-side-foot { display: none; }
.tp-collapsed .tp-nav-item.active::before { left: -10px; }
.tp-scrim { display: none; }

/* ---------------------------------------------------------------- pages */
.tp-page { max-width: 1500px; margin: 0 auto; padding-top: 18px; }
.tp-page-head { margin: 4px 2px 14px; }
.tp-page-head h1 { font: 800 clamp(28px, 3.2vw, 40px)/1.1 var(--tp-display); margin: 0; }
.tp-page-head p { color: var(--tp-muted); font-weight: 700; margin-top: 2px; }
.tp-panel-card { background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .025)); border: 1px solid var(--tp-line); border-radius: 22px; padding: 18px 20px; }
.tp-panel-card h2 { font: 800 21px/1.2 var(--tp-display); margin-bottom: 10px; }
.tp-panel-card h3 { font-weight: 900; font-size: 15px; color: var(--tp-muted); text-transform: uppercase; letter-spacing: .6px; margin: 16px 0 8px; }

/* buttons */
.tp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 15px; border: 0; cursor: pointer; font-weight: 900; font-size: 16px; white-space: nowrap; transition: transform .12s cubic-bezier(.2, 1.8, .4, 1), filter .15s, background .15s; }
.tp-btn:hover { filter: brightness(1.08); }
.tp-btn:active { transform: scale(.94); }
.tp-btn svg { width: 22px; height: 22px; }
.tp-btn .tp-i { fill: none; }
.tp-btn-play { background: linear-gradient(180deg, #3dffb0, #11c57d); color: #032e1d !important; box-shadow: 0 4px 0 #0a8a57, 0 10px 24px rgba(46, 229, 157, .35); }
.tp-btn-play.big { height: 62px; min-width: 210px; font-size: 22px; border-radius: 18px; }
.tp-btn-play.big svg { width: 28px; height: 28px; }
.tp-btn-ghost { background: rgba(255, 255, 255, .1); border: 1px solid var(--tp-line2); color: var(--tp-text); }
.tp-btn-ghost:hover { background: rgba(255, 255, 255, .16); }
.tp-btn-soft { background: rgba(123, 92, 255, .25); color: #fff; border: 1px solid rgba(123, 92, 255, .5); }
.tp-fav-btn.on { background: rgba(255, 95, 162, .22); border-color: rgba(255, 95, 162, .7); color: #ff8fc0; }
.tp-fav-btn.on .tp-i { fill: currentColor; }
.tp-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 8px; font-weight: 900; font-size: 11.5px; letter-spacing: .4px; color: #fff; text-transform: uppercase; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.tp-badge.new { background: linear-gradient(135deg, #ff5fa2, #ff8a3d); }
.tp-badge.hot { background: linear-gradient(135deg, #ff4757, #ff8a3d); }
.tp-badge.feat { background: linear-gradient(135deg, #ffd23f, #ffa41b); color: #4a2b00; }
.tp-badge.pop { background: linear-gradient(135deg, #7b5cff, #4d9bff); }
.tp-badge.mp { background: rgba(14, 11, 43, .7); padding: 0 6px; backdrop-filter: blur(4px); }
.tp-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-weight: 800; font-size: 12px; color: #fff; backdrop-filter: blur(6px); }
.tp-live { display: inline-flex; align-items: center; gap: 5px; color: #6effc4; font-weight: 800; }
.tp-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2ee59d; box-shadow: 0 0 0 0 rgba(46, 229, 157, .7); animation: tpPulse 1.6s infinite; }
@keyframes tpPulse { 70% { box-shadow: 0 0 0 7px rgba(46, 229, 157, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 229, 157, 0); } }
.tp-xp { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.tp-xp i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #ffd23f, #ff8a3d, #ff5fa2); transition: width .6s; }
.tp-xp.big { height: 14px; border-radius: 8px; }

/* ---------------------------------------------------------------- hero */
.tp-top-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: stretch; }
.tp-hero { position: relative; width: 100%; align-self: start; aspect-ratio: 2.5 / 1; min-height: 260px; max-height: 470px; border-radius: 28px; overflow: hidden; background: #120e3a; box-shadow: var(--tp-shadow); isolation: isolate; }
.tp-hero-track { position: absolute; inset: 0; }
@media (min-width: 1181px) { .tp-top-grid .tp-hero { aspect-ratio: auto; align-self: stretch; min-height: 380px; max-height: none; } }
.tp-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .7s, visibility .7s; }
.tp-slide.on { opacity: 1; visibility: visible; }
.tp-hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; transform-origin: 70% 50%; }
.tp-slide.on .tp-hero-art { animation: tpKen 9s ease-out both; }
@keyframes tpKen { from { transform: scale(1.0); } to { transform: scale(1.07); } }
.tp-hero-body { position: absolute; left: 0; top: 0; bottom: 0; width: min(58%, 560px); padding: clamp(18px, 3vw, 40px); display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.tp-slide.on .tp-hero-body > * { animation: tpRise .6s both; }
.tp-slide.on .tp-hero-body > :nth-child(2) { animation-delay: .06s; } .tp-slide.on .tp-hero-body > :nth-child(3) { animation-delay: .12s; } .tp-slide.on .tp-hero-body > :nth-child(n+4) { animation-delay: .18s; }
@keyframes tpRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tp-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-hero-title { font: 800 clamp(30px, 4.2vw, 58px)/1 var(--tp-display); letter-spacing: -.5px; text-shadow: 0 4px 24px rgba(0, 0, 0, .45); margin: 0; }
.tp-hero-desc { font-weight: 700; font-size: clamp(15px, 1.35vw, 19px); color: #e8e4ff; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); max-width: 460px; }
.tp-hero-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 800; font-size: 13.5px; color: #cfc9ff; }
.tp-hero-btns { display: flex; gap: 10px; margin-top: 6px; }
.tp-hero-btns .tp-btn-play { height: 56px; padding: 0 28px; font-size: 20px; border-radius: 17px; }
.tp-hero-btns .tp-btn-ghost { height: 56px; backdrop-filter: blur(8px); }
.tp-hero-btns .tp-fav-btn { width: 56px; padding: 0; }
.tp-hero-dots { position: absolute; z-index: 2; right: 22px; bottom: 18px; display: flex; gap: 7px; }
.tp-dot-btn { width: 10px; height: 10px; padding: 0; border-radius: 6px; border: 0; background: rgba(255, 255, 255, .4); cursor: pointer; transition: width .3s, background .3s; }
.tp-dot-btn.on { width: 30px; background: #fff; }
.tp-hero-arrow { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(14, 11, 43, .55); backdrop-filter: blur(6px); color: #fff; opacity: 0; transition: opacity .2s; }
.tp-hero:hover .tp-hero-arrow { opacity: 1; }
.tp-hero-arrow.l { left: 12px; } .tp-hero-arrow.r { right: 12px; }

/* player card next to the hero */
.tp-pcard { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 28px; background: linear-gradient(160deg, #2d2380, #1a1550 55%, #24124e); border: 1px solid var(--tp-line2); box-shadow: var(--tp-shadow); min-width: 0; }
.tp-pcard-top { display: flex; gap: 12px; align-items: center; }
.tp-pcard-av { width: 86px; height: 98px; flex: none; border-radius: 22px; background: radial-gradient(circle at 50% 35%, #8fd3ff, #6a4bff); display: grid; place-items: end center; overflow: hidden; }
.tp-pcard-av canvas { width: 100px; height: 100px; margin-bottom: -6px; }
.tp-pcard-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tp-pcard-hi { font: 800 22px/1.1 var(--tp-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-pcard-lv { font-weight: 900; color: var(--tp-yellow); font-size: 14px; }
.tp-xp-txt { font-size: 12px; color: var(--tp-muted); font-weight: 700; }
.tp-pcard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tp-pstat { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 14px; border: 1px solid var(--tp-line); background: rgba(255, 255, 255, .06); cursor: pointer; }
.tp-pstat b { font-size: 15px; font-weight: 900; white-space: nowrap; }
.tp-pstat span { font-size: 11.5px; color: var(--tp-muted); font-weight: 800; }
.tp-pstat:hover { background: rgba(255, 255, 255, .11); }
.tp-pcard-h { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .8px; color: var(--tp-muted); margin-bottom: -4px; }
.tp-pquests { display: flex; flex-direction: column; gap: 6px; }
.tp-pq { display: flex; gap: 10px; align-items: center; padding: 7px 9px; border-radius: 13px; border: 0; background: rgba(255, 255, 255, .06); text-align: left; cursor: pointer; }
.tp-pq.done { background: rgba(46, 229, 157, .14); }
.tp-pq-ico { font-size: 20px; width: 26px; text-align: center; }
.tp-pq-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: 12.5px; line-height: 1.2; }
.tp-pq-bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.tp-pq-bar i { display: block; height: 100%; background: var(--tp-green); }
.tp-pcard .tp-btn-soft { height: 42px; margin-top: auto; }

/* category chips under the hero */
.tp-chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 18px 2px 4px; }
.tp-chips::-webkit-scrollbar { display: none; }
.tp-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 8px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 900; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 6px 16px color-mix(in srgb, var(--c1) 35%, transparent); transition: transform .15s; }
.tp-chip .e { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .25); font-size: 17px; }
.tp-chip:hover { transform: translateY(-2px); }

/* ---------------------------------------------------------------- rows & cards */
.tp-row { margin-top: 26px; }
.tp-row-head { display: flex; align-items: flex-end; gap: 12px; margin: 0 2px 10px; }
.tp-row-titles { flex: 1; min-width: 0; }
.tp-row-titles h2 { font: 800 23px/1.15 var(--tp-display); margin: 0; }
.tp-row-titles p { color: var(--tp-muted); font-weight: 700; font-size: 14px; }
.tp-row-tools { display: flex; align-items: center; gap: 6px; }
.tp-viewall { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--tp-line2); background: none; font-weight: 800; font-size: 13.5px; color: var(--tp-muted) !important; cursor: pointer; }
.tp-viewall:hover { color: #fff !important; background: rgba(255, 255, 255, .08); }
.tp-arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--tp-line2); background: rgba(255, 255, 255, .05); display: grid; place-items: center; cursor: pointer; }
.tp-arrow:hover { background: rgba(255, 255, 255, .14); }
.tp-arrow .tp-i { width: 18px; height: 18px; }
.tp-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: var(--card-w); gap: 16px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; padding: 6px 4px 12px; margin: -6px -4px 0; scroll-padding: 4px; }
.tp-scroll::-webkit-scrollbar { display: none; }
.tp-card { position: relative; scroll-snap-align: start; cursor: pointer; border-radius: 20px; outline: none; transition: transform .25s cubic-bezier(.2, 1.4, .4, 1); }
.tp-thumb { position: relative; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: var(--tp-surface2); box-shadow: 0 8px 18px rgba(4, 2, 24, .4); transition: box-shadow .25s; }
.tp-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .45s cubic-bezier(.2, .8, .3, 1); }
.tp-card:hover, .tp-card:focus-visible { transform: translateY(-5px); }
.tp-card:hover .tp-thumb, .tp-card:focus-visible .tp-thumb { box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 16px 30px rgba(4, 2, 24, .55); }
.tp-card:hover .tp-thumb img { transform: scale(1.09); }
.tp-badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 5px; }
.tp-fav { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(14, 11, 43, .55); backdrop-filter: blur(6px); color: #fff;
  opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s, background .2s; }
.tp-fav .tp-i { width: 19px; height: 19px; }
.tp-fav.on { opacity: 1; transform: none; color: #ff5fa2; background: rgba(255, 255, 255, .92); }
.tp-fav.on .tp-i { fill: currentColor; }
.tp-card:hover .tp-fav, .tp-card:focus-within .tp-fav { opacity: 1; transform: none; }
.tp-playfab { position: absolute; right: 10px; bottom: 12px; width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(180deg, #3dffb0, #11c57d); color: #032e1d !important; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(8px) scale(.8); transition: opacity .2s, transform .25s cubic-bezier(.2, 1.6, .4, 1); }
.tp-playfab svg { width: 24px; height: 24px; margin-left: 3px; }
.tp-card:hover .tp-playfab, .tp-card:focus-within .tp-playfab { opacity: 1; transform: none; }
.tp-playfab:hover { transform: scale(1.1) !important; }
.tp-prog { position: absolute; left: 10px; right: 10px; bottom: 8px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .4); overflow: hidden; }
.tp-prog i { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, #ff8a3d); }
.tp-card:hover .tp-prog { opacity: 0; }
.tp-card-body { padding: 9px 4px 0; }
.tp-card-title { font-weight: 900; font-size: 15.5px; line-height: 1.2; margin: 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tp-card-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; font-size: 12.5px; font-weight: 800; color: var(--tp-muted); }
.tp-card-meta .tp-stars { color: var(--tp-yellow); }
.tp-card-meta .tp-plays { color: #ffb38a; }
/* touch screens have no hover: show the play button and filled hearts always */
@media (hover: none) {
  .tp-playfab { opacity: 1; transform: none; width: 44px; height: 44px; right: 8px; bottom: 8px; }
  .tp-card:hover { transform: none; }
  .tp-card:hover .tp-thumb img { transform: none; }
  .tp-row-tools .tp-arrow, .tp-hero-arrow { display: none; }
  .tp-prog { right: 58px; }
}

/* discover */
.tp-filter { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 14px; }
.tp-filter::-webkit-scrollbar { display: none; }
.tp-fchip { flex: none; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--tp-line2); background: rgba(255, 255, 255, .05); font-weight: 800; font-size: 14px; cursor: pointer; }
.tp-fchip:hover { background: rgba(255, 255, 255, .1); }
.tp-fchip.on { background: #fff; color: #1b1550 !important; border-color: #fff; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 22px 16px; }
.tp-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tp-cat { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 150px; padding: 18px; border-radius: 24px; border: 0; cursor: pointer; text-align: left; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 10px 24px color-mix(in srgb, var(--c1) 35%, transparent); transition: transform .2s; }
.tp-cat:hover { transform: translateY(-4px) rotate(-.4deg); }
.tp-cat-ico { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.tp-cat b { font: 800 23px/1.1 var(--tp-display); }
.tp-cat small { font-weight: 800; opacity: .85; max-width: 60%; }
.tp-cat-pics { position: absolute; right: -6px; bottom: -10px; display: flex; }
.tp-cat-pics img { width: 72px; height: 72px; border-radius: 16px; border: 3px solid rgba(255, 255, 255, .85); margin-left: -26px; box-shadow: 0 6px 14px rgba(0, 0, 0, .3); }
.tp-cat-pics img:nth-child(1) { transform: rotate(-10deg) translateY(4px); } .tp-cat-pics img:nth-child(2) { transform: rotate(4deg) translateY(-6px); } .tp-cat-pics img:nth-child(3) { transform: rotate(12deg); }
.tp-empty { text-align: center; padding: 40px 20px 10px; color: var(--tp-muted); font-weight: 800; font-size: 17px; }
.tp-empty .e { font-size: 60px; }

/* ---------------------------------------------------------------- game page */
.tp-gbanner { position: relative; width: 100%; aspect-ratio: 2.5 / 1; min-height: 250px; max-height: 440px; border-radius: 28px; overflow: hidden; box-shadow: var(--tp-shadow); }
.tp-gbanner-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; animation: tpKen 12s ease-out both; }
.tp-gbanner-body { position: absolute; left: 0; bottom: 0; top: 0; width: min(60%, 620px); padding: clamp(18px, 3vw, 40px); display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.tp-back { position: absolute; z-index: 2; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 14px 0 8px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 800; background: rgba(14, 11, 43, .55); backdrop-filter: blur(6px); }
.tp-crumbs { display: flex; gap: 6px; align-items: center; font-weight: 800; font-size: 13.5px; color: #cfc9ff; }
.tp-crumbs button { background: none; border: 0; padding: 0; font-weight: 800; color: var(--tp-yellow) !important; cursor: pointer; }
.tp-crumbs .sep { opacity: .5; }
.tp-gby { font-weight: 800; color: #cfc9ff; font-size: 14px; }
.tp-gpage { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; margin-top: 18px; align-items: start; }
.tp-gmain { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tp-gbtns { display: flex; flex-wrap: wrap; gap: 10px; }
.tp-gbtns .tp-btn-ghost { height: 62px; border-radius: 18px; padding: 0 22px; }
.tp-gprog { display: flex; flex-direction: column; gap: 8px; font-weight: 800; color: var(--tp-muted); }
.tp-desc { font-size: 16.5px; font-weight: 700; line-height: 1.55; color: #e3dfff; }
.tp-how { counter-reset: how; display: flex; flex-direction: column; gap: 8px; }
.tp-how li { counter-increment: how; display: flex; gap: 12px; align-items: center; font-weight: 800; font-size: 15.5px; }
.tp-how li::before { content: counter(how); flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(123, 92, 255, .35); color: #fff; font-weight: 900; }
.tp-gside { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tp-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid var(--tp-line); min-width: 0; }
.tp-stat span { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--tp-dim); }
.tp-stat b { font-size: 16px; font-weight: 900; overflow-wrap: anywhere; }
.tp-stat.live b { color: #6effc4; }
.tp-modes { grid-column: 1 / -1; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid var(--tp-line); }
.tp-modes h3 { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--tp-dim); margin-bottom: 6px; }
.tp-mode { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-weight: 800; }
.tp-mode .e { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); font-size: 17px; }

/* ---------------------------------------------------------------- profile */
.tp-prof-head { --pad: 24px; --avw: 200px; --avh: 220px; position: relative; display: flex; gap: 30px; align-items: center; padding: var(--pad); border-radius: 28px; overflow: hidden;
  background: radial-gradient(500px 260px at 10% 0, rgba(255, 210, 63, .25), transparent 60%), linear-gradient(135deg, #3b2a9e, #1c1650 60%, #3a1352); border: 1px solid var(--tp-line2); box-shadow: var(--tp-shadow); }
.tp-prof-av { width: var(--avw); height: var(--avh); flex: none; border-radius: 26px; display: grid; place-items: end center; overflow: hidden; background: radial-gradient(circle at 50% 35%, #8fd3ff, #6a4bff 75%); box-shadow: inset 0 -30px 40px rgba(0, 0, 0, .15); }
.tp-prof-av canvas { width: 230px; height: 230px; margin-bottom: -10px; }
.tp-lvbadge { position: absolute; left: calc(var(--pad) + var(--avw) - 48px); top: calc(var(--pad) + var(--avh) - 52px); width: 66px; height: 66px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #ffe27a, #ffb31f); color: #4a2b00; box-shadow: 0 0 0 4px #1c1650, 0 8px 18px rgba(0, 0, 0, .4); }
.tp-lvbadge b { font: 800 28px/1 var(--tp-display); }
.tp-lvbadge span { font-size: 9.5px; font-weight: 900; letter-spacing: 1px; }
.tp-prof-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tp-prof-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-prof-name h1 { font: 800 clamp(30px, 3.6vw, 46px)/1 var(--tp-display); margin: 0; }
.tp-prof-sub { color: #d6d1ff; font-weight: 800; }
.tp-prof-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tp-prof-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 16px; }
.tp-prof-stats .tp-stat { align-items: center; text-align: center; }
.tp-prof-stats .tp-stat b { font-size: 20px; }
.tp-prof-stats .tp-stat span { order: 2; }
#tpAchv { margin-top: 26px; scroll-margin-top: calc(var(--tp-top) + 12px); }
.tp-achv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tp-ach { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 14px 10px; border-radius: 18px; background: rgba(255, 255, 255, .04); border: 1px solid var(--tp-line); }
.tp-ach .e { font-size: 38px; filter: grayscale(1) opacity(.35); }
.tp-ach b { font-size: 14px; } .tp-ach small { font-size: 12px; color: var(--tp-dim); font-weight: 700; line-height: 1.25; }
.tp-ach.got { background: linear-gradient(180deg, rgba(255, 210, 63, .16), rgba(255, 210, 63, .04)); border-color: rgba(255, 210, 63, .35); }
.tp-ach.got .e { filter: none; animation: tpBob 3s ease-in-out infinite; }
.tp-ach.got small { color: var(--tp-yellow); }
@keyframes tpBob { 50% { transform: translateY(-3px) rotate(-4deg); } }

/* ---------------------------------------------------------------- settings */
.tp-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.tp-set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--tp-line); font-weight: 800; flex-wrap: wrap; }
.tp-set-row:first-of-type { border-top: 0; }
.tp-set-row small { display: block; color: var(--tp-dim); font-weight: 700; font-size: 12.5px; }
.tp-input { height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--tp-line2); background: rgba(255, 255, 255, .07); color: var(--tp-text); font: 800 17px var(--tp-font); outline: none; min-width: 0; width: 220px; }
.tp-input:focus { border-color: var(--tp-violet); }
.tp-settings .age-row { display: flex; gap: 6px; }
.tp-settings .age-btn { background: rgba(255, 255, 255, .08); color: var(--tp-text); border-color: var(--tp-line2); }
.tp-settings .age-btn.active { background: var(--tp-yellow); color: #4a2b00; border-color: var(--tp-yellow); }
.tp-switch { position: relative; width: 60px; height: 34px; border-radius: 17px; border: 0; background: rgba(255, 255, 255, .18); cursor: pointer; transition: background .2s; flex: none; }
.tp-switch i { position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.2, 1.6, .4, 1); }
.tp-switch.on { background: var(--tp-green); }
.tp-switch.on i { transform: translateX(26px); }
.tp-set-family .family-box { margin: 0; background: #fff; color: var(--ink); border-radius: 18px; }
.tp-safety ul { display: flex; flex-direction: column; gap: 10px; }
.tp-safety li { font-weight: 700; line-height: 1.45; color: #ddd8ff; padding-left: 26px; position: relative; }
.tp-safety li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--tp-green); color: #053; font-size: 12px; font-weight: 900; display: grid; place-items: center; margin-top: 3px; }

/* ---------------------------------------------------------------- welcome */
.welcome-bg { background: radial-gradient(800px 500px at 20% 10%, #4a2bbf 0, transparent 60%), radial-gradient(700px 500px at 90% 90%, #7a1f7a 0, transparent 60%), #0e0b2b !important; }
.tp-welcome-card { border-radius: 30px; }
.tp-welcome-logo { display: flex; align-items: center; justify-content: center; gap: 10px; }
.tp-welcome-logo svg { width: 64px; height: 64px; filter: drop-shadow(0 6px 14px rgba(255, 95, 162, .4)); }
.tp-welcome-logo span { font: 800 46px/1 var(--tp-display); color: #1b1550; letter-spacing: -.5px; }
.tp-welcome-logo b { color: #ff5fa2; font-weight: 800; }
.tp-welcome-sub { color: #6b6798; font-weight: 700; margin: 6px 0 4px; }

/* ---------------------------------------------------------------- in-game */
body.tp-ingame #app > .screen:not(.tp-screen) { padding-top: 6px; }
body.tp-on #hubHint button { color: #fff; font-weight: 800; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) { .tp-links button:nth-child(n+4) { display: none; } }
@media (max-width: 1180px) {
  .tp-links { display: none; }
  .tp-top-grid { grid-template-columns: 1fr; }
  .tp-pcard { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 16px; row-gap: 10px; }
  .tp-pcard-top { grid-column: 1; } .tp-pcard-stats { grid-column: 1; }
  .tp-pcard-h { grid-column: 2; grid-row: 1; align-self: end; }
  .tp-pquests { grid-column: 2; grid-row: 2 / span 2; }
  .tp-pcard .tp-btn-soft { grid-column: 1; }
  .tp-gpage { grid-template-columns: 1fr; }
  .tp-gside { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tp-prof-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1000px) { .tp-me-txt { display: none; } .tp-me { padding: 3px; } :root { --card-w: 172px; } }
@media (max-width: 900px) { .tp-room #hdrRoom, .tp-hide-sm { display: none; } .tp-room { width: 40px; padding: 0; justify-content: center; } }
@media (max-width: 720px) {
  .tp-search { display: none; } .tp-only-small { display: grid; }
  body.tp-searching .tp-search { display: block; position: fixed; left: 8px; right: 8px; top: 8px; max-width: none; z-index: 70; }
  body.tp-searching .tp-search-box { height: 48px; background: var(--tp-surface); }
  .tp-logo-txt { display: none; }
}

/* ---- every phone & tablet held sideways (the app is landscape-only): rail + compact header ---- */
@media (orientation: landscape) and (max-height: 860px) {
  :root { --tp-short: 1; --tp-top: 56px; --tp-sw-mini: var(--rail, 104px); --card-w: 168px; }
  body.tp-on { --tp-sw-cur: var(--tp-sw-mini); }
  .tp-topbar { gap: 8px; padding-right: 10px; }
  .tp-logo-mark svg { width: 34px; height: 34px; }
  .tp-logo-txt { font-size: 22px; }
  /* the rail: icons with tiny labels, always */
  .tp-side { padding: 8px 6px 100px calc(6px + env(safe-area-inset-left)); }
  .tp-side .tp-nav-item { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 10.5px; text-align: center; }
  .tp-side .tp-nav-txt { white-space: normal; line-height: 1.05; }
  .tp-side .tp-nav-ico { width: 40px; height: 40px; border-radius: 13px; }
  .tp-side .tp-nav-badge { position: absolute; top: 0; right: 6px; min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; padding: 0 4px; }
  .tp-side .tp-sep { height: 1px; margin: 8px 6px; background: var(--tp-line); font-size: 0; }
  .tp-side .tp-side-foot { display: none; }
  .tp-side .tp-nav-item.active::before { left: -6px; }
  /* ☰ opens the full menu as a drawer over the page */
  body.tp-drawer .tp-side { width: 270px; z-index: 75; background: var(--tp-bg2); box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  body.tp-drawer .tp-side .tp-nav-item { flex-direction: row; gap: 12px; padding: 7px 10px 7px 7px; font-size: 15px; text-align: left; }
  body.tp-drawer .tp-side .tp-nav-badge { position: static; margin-left: auto; }
  body.tp-drawer .tp-side .tp-sep { height: auto; background: none; font-size: 11px; margin: 12px 10px 4px; }
  body.tp-drawer .tp-scrim { display: block; position: fixed; inset: 0; z-index: 74; background: rgba(5, 3, 20, .55); }
  /* inside a game the header steps aside so the board gets the whole height; the rail carries Home, room and coins */
  body.tp-ingame { padding-top: 0; }
  body.tp-ingame .tp-topbar { display: none; }
  body.tp-ingame .tp-side { top: 0; }
  body.tp-ingame .tp-nav { display: none; }
  body.tp-ingame .tp-side-game { display: flex; flex-direction: column; gap: 6px; }
  body.tp-ingame #app { padding-left: calc(var(--tp-sw-cur) + 8px + env(safe-area-inset-left)); padding-right: 8px; padding-bottom: 8px; }
  body.tp-ingame #app > .screen:not(.tp-screen) { padding-top: 0; }
  .tp-gbtn { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px; border-radius: 18px; border: 1px solid var(--tp-line2); background: rgba(255, 255, 255, .07); cursor: pointer; color: #fff; font-weight: 900; }
  .tp-gbtn:active { transform: scale(.93); }
  .tp-gico { font-size: 30px; line-height: 1.1; }
  .tp-glbl { font-size: 12.5px; line-height: 1.1; }
  .tp-g-home { background: linear-gradient(135deg, #6a4bff, #a64bff); border-color: transparent; }
  .tp-g-coins { background: linear-gradient(180deg, #ffe27a, #ffbf1f); color: #5a3600; border-color: transparent; }
  .tp-g-members { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .tp-g-members .tp-members { flex-direction: column; }
  body.tp-on #app { padding-left: calc(var(--tp-sw-cur) + 12px + env(safe-area-inset-left)); padding-right: 12px; }
  body.tp-on .tiko { left: calc(env(safe-area-inset-left) + 13px); }
  .tp-page { padding-top: 10px; }
  .tp-hero { aspect-ratio: auto; height: clamp(230px, calc(var(--vh100, 100vh) - var(--tp-top) - 96px), 400px); min-height: 0; border-radius: 22px; }
  .tp-hero-body { width: 62%; gap: 7px; }
  .tp-hero-btns .tp-btn-play, .tp-hero-btns .tp-btn-ghost { height: 52px; }
  .tp-hero-btns .tp-fav-btn { width: 52px; }
  .tp-gbanner { aspect-ratio: auto; height: clamp(210px, calc(var(--vh100, 100vh) - var(--tp-top) - 120px), 380px); min-height: 0; border-radius: 22px; }
  .tp-row { margin-top: 20px; }
  .tp-row-titles h2 { font-size: 21px; }
  .tp-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 12px; }
  .tp-prof-head { --pad: 16px; --avw: 150px; --avh: 170px; }
  .tp-prof-av canvas { width: 180px; height: 180px; }
  .tp-lvbadge { width: 58px; height: 58px; } .tp-lvbadge b { font-size: 24px; }
  .tp-settings { grid-template-columns: 1fr 1fr; }
  .tp-settings .age-btn { min-height: 48px; }
}
@media (orientation: landscape) and (max-height: 720px) {
  :root { --card-w: 150px; }
  .tp-gico { font-size: 25px; }
  .tp-gbtn { padding: 6px 2px; border-radius: 15px; }
  .tp-side .tp-nav-ico { width: 34px; height: 34px; }
  .tp-side .tp-nav-item .tp-nav-txt { font-size: 9.5px; }
  .tp-quests, .tp-topbar .net-dot { display: none; }
  .tp-hero-desc { display: none; }
  .tp-hero-title { font-size: clamp(26px, 5vw, 40px); }
  .tp-hero-meta { font-size: 12px; }
  .tp-pcard { grid-template-columns: 1fr 1fr; padding: 12px; }
  .tp-pcard-av { width: 66px; height: 76px; } .tp-pcard-av canvas { width: 80px; height: 80px; }
  .tp-chips { padding-top: 12px; }
  .tp-chip { height: 42px; font-size: 14px; }
  .tp-card-title { font-size: 14.5px; }
  .tp-prof-head { gap: 24px; }
  .tp-prof-stats { grid-template-columns: repeat(6, 1fr); }
  .tp-prof-stats .tp-stat { padding: 8px 4px; } .tp-prof-stats .tp-stat b { font-size: 16px; }
  .tp-settings { grid-template-columns: 1fr; }
  .tp-gbanner-body { width: 70%; }
}
@media (prefers-reduced-motion: reduce) {
  .tp-slide.on .tp-hero-art, .tp-gbanner-art, .tp-slide.on .tp-hero-body > *, .tp-ach.got .e { animation: none; }
  .tp-card, .tp-thumb img, .tp-slide { transition: none; }
}

/* ---------------------------------------------------------------- Giggleland brand bits */
.tp-welcome-tag { font: 800 15px/1 var(--tp-display); letter-spacing: 2.5px; text-transform: uppercase; color: #ff7a1f; margin-top: 6px; }
.tp-logo-txt b { background: linear-gradient(90deg, #ffe14d, #ff9f2e 55%, #ff6fae); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tp-welcome-logo b { background: linear-gradient(90deg, #ff9f2e, #ff4f9a); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* =====================================================================
 * Giggleland Plaza (3D) – canvas + HUD
 * ===================================================================== */
.gl-wrap { position: fixed; z-index: 20; top: var(--tp-top); right: 0; bottom: 0; left: calc(var(--tp-sw-cur) + env(safe-area-inset-left)); background: linear-gradient(#9fd3ff, #ffe0f0); overflow: hidden; font-family: var(--tp-font); color: #fff; }
.gl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; }
.gl-canvas:active { cursor: grabbing; }
body.gl-on .tiko { display: none; }
body.gl-on #app { padding-bottom: 0; }
.gl-hud { position: absolute; inset: 0; pointer-events: none; }
.gl-hud > * { pointer-events: auto; }
.gl-hud .hidden { display: none !important; }
.gl-top { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.gl-top > * { pointer-events: auto; }
.gl-me { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; border: 0; cursor: pointer; background: rgba(20, 14, 60, .62); backdrop-filter: blur(8px); color: #fff; text-align: left; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.gl-me canvas { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(160deg, #ffe14d, #ff9f2e); }
.gl-me span { display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.gl-me b { font: 800 16px/1 var(--tp-display); }
.gl-me small { font-size: 12px; font-weight: 900; color: #ffd23f; }
.gl-xp { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.gl-xp i { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, #ff6fae); }
.gl-chips { display: flex; flex-direction: column; gap: 6px; }
.gl-chip { padding: 6px 12px; border-radius: 999px; background: rgba(20, 14, 60, .62); backdrop-filter: blur(8px); font-weight: 900; font-size: 14px; white-space: nowrap; }
.gl-place { margin: 0 auto; padding: 8px 18px; border-radius: 999px; background: rgba(255, 255, 255, .85); color: #2b1d6e; font: 800 16px/1 var(--tp-display); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); white-space: nowrap; }
.gl-btns { display: flex; gap: 6px; }
.gl-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 58px; padding: 7px 8px 5px; border-radius: 16px; border: 0; cursor: pointer; background: rgba(20, 14, 60, .62); backdrop-filter: blur(8px); color: #fff; font-size: 22px; line-height: 1; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); transition: transform .12s; }
.gl-btn span { font: 800 11px var(--tp-font); }
.gl-btn:hover { background: rgba(60, 40, 150, .75); }
.gl-btn:active { transform: scale(.92); }
.gl-btn.sm { flex-direction: row; gap: 6px; font-size: 16px; min-width: 0; padding: 7px 12px; }
.gl-btn.sm span { font-size: 13px; }
.gl-prompt { --c: #7b5cff; position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 22px; border-radius: 22px; background: rgba(20, 14, 60, .78); backdrop-filter: blur(10px); box-shadow: 0 0 0 3px var(--c), 0 10px 30px rgba(0, 0, 0, .3); animation: glPop .25s cubic-bezier(.2, 1.6, .4, 1); }
.gl-prompt #glPromptTxt { display: flex; flex-direction: column; }
.gl-prompt b { font: 800 22px/1.1 var(--tp-display); }
.gl-key kbd { display: inline-block; min-width: 26px; padding: 1px 7px; margin: 0 2px; border-radius: 7px; background: #fff; color: #1b1550; font: 900 14px var(--tp-font); box-shadow: 0 2px 0 #b6aee6; }
.gl-key { font-weight: 800; font-size: 14px; color: #dcd6ff; }
.gl-enter { display: none; height: 54px; padding: 0 22px; border-radius: 16px; border: 0; cursor: pointer; font: 900 18px var(--tp-font); color: #1b1550; background: linear-gradient(180deg, #ffe14d, #ffb020); box-shadow: 0 4px 0 #c98a00; }
@keyframes glPop { from { opacity: 0; transform: translate(-50%, 12px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0); } }
.gl-say { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); max-width: min(560px, 80%); padding: 10px 18px; border-radius: 18px; background: #fff; color: #2b1d6e; font-weight: 800; font-size: 16px; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); animation: glPop .25s ease-out; }
.gl-obbybar { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; border-radius: 999px; background: rgba(20, 14, 60, .72); backdrop-filter: blur(8px); font-weight: 900; white-space: nowrap; }
.gl-hud.obby .gl-btns [data-act="games"], .gl-hud.obby .gl-btns [data-act="friends"] { display: none; }
.gl-help, .gl-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 92%); max-height: 86%; overflow-y: auto; padding: 22px; border-radius: 26px; background: rgba(28, 22, 84, .94); backdrop-filter: blur(12px); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); border: 1px solid rgba(255, 255, 255, .15); text-align: center; }
.gl-help h3, .gl-panel h3 { font: 800 28px/1.1 var(--tp-display); margin-bottom: 8px; }
.gl-help ul { text-align: left; display: flex; flex-direction: column; gap: 8px; margin: 12px 0 16px; font-weight: 700; font-size: 16px; }
.gl-panel p { color: #d6d1ff; font-weight: 700; }
.gl-ok { height: 52px; padding: 0 26px; margin: 6px; border-radius: 16px; border: 0; cursor: pointer; font: 900 18px var(--tp-font); color: #032e1d; background: linear-gradient(180deg, #3dffb0, #11c57d); box-shadow: 0 4px 0 #0a8a57; }
.gl-ok.ghost { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
.gl-row { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.gl-big { font-size: 46px; letter-spacing: 4px; margin: 6px 0; }
.gl-reward { font: 800 26px var(--tp-display) !important; color: #ffd23f !important; }
.gl-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.gl-level { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; padding: 12px; border-radius: 18px; border: 0; cursor: pointer; text-align: left; color: #1b1550; background: linear-gradient(160deg, var(--b), var(--a)); box-shadow: 0 6px 14px rgba(0, 0, 0, .2); transition: transform .15s; }
.gl-level:hover { transform: translateY(-3px); }
.gl-level small { font-weight: 900; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; opacity: .75; }
.gl-level b { font: 800 17px/1.1 var(--tp-display); }
.gl-level span { font-weight: 800; font-size: 13px; }
.gl-level.locked { filter: grayscale(.8) brightness(.8); cursor: not-allowed; }
.gl-fade { --c: #7b5cff; position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, #fff 0, var(--c) 45%, #1b1550 100%); transition: opacity .35s; }
.gl-fade.on { opacity: 1; pointer-events: auto; }
.gl-fade div { display: flex; flex-direction: column; align-items: center; color: #fff; text-shadow: 0 3px 14px rgba(0, 0, 0, .35); transform: scale(.85); transition: transform .5s cubic-bezier(.2, 1.4, .4, 1); }
.gl-fade.on div { transform: scale(1); }
.gl-fade small { font-weight: 900; font-size: 16px; letter-spacing: 2px; text-transform: uppercase; }
.gl-fade b { font: 800 clamp(34px, 6vw, 64px)/1 var(--tp-display); }
/* touch controls */
.gl-stick, .gl-jump { display: none; }
@media (pointer: coarse), (hover: none) {
  .gl-stick { display: block; position: absolute; left: 22px; bottom: 22px; width: 132px; height: 132px; border-radius: 50%; background: rgba(255, 255, 255, .22); border: 3px solid rgba(255, 255, 255, .55); backdrop-filter: blur(4px); touch-action: none; }
  .gl-knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px; border-radius: 50%; background: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); pointer-events: none; }
  .gl-jump { display: grid; place-items: center; position: absolute; right: 26px; bottom: 30px; width: 92px; height: 92px; border-radius: 50%; border: 0; font: 900 40px var(--tp-font); color: #1b1550; background: linear-gradient(180deg, #ffe14d, #ffb020); box-shadow: 0 6px 0 #c98a00, 0 10px 24px rgba(0, 0, 0, .25); touch-action: none; }
  .gl-jump.on { transform: translateY(4px); box-shadow: 0 2px 0 #c98a00; }
  .gl-key { display: none; }
  .gl-enter { display: block; }
  .gl-prompt { bottom: 24px; max-width: calc(100% - 330px); padding-left: 16px; }
  .gl-prompt b { font-size: 19px; }
}
/* loading + no-WebGL screens */
.gl-loading, .gl-nogl { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px;
  background: radial-gradient(700px 400px at 30% 20%, #6a4bff 0, transparent 60%), radial-gradient(600px 400px at 80% 90%, #ff6fae 0, transparent 60%), #2a1d7a; }
.gl-wrap.loading .gl-loading, .gl-wrap.nogl .gl-nogl { display: flex; }
.gl-load-logo { font-size: 74px; animation: tpBob 1.4s ease-in-out infinite; }
.gl-loading b, .gl-nogl b { font: 800 44px/1 var(--tp-display); }
.gl-nogl b { font-size: 28px; }
.gl-loading b span { color: #ffd23f; }
.gl-loading small, .gl-nogl small { font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #ffd6ef; max-width: 460px; }
.gl-nogl small { letter-spacing: 0; text-transform: none; font-size: 16px; }
.gl-bar { display: block; width: 220px; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .2); overflow: hidden; margin-top: 10px; }
.gl-bar i { display: block; height: 100%; width: 40%; border-radius: 6px; background: linear-gradient(90deg, #ffd23f, #ff6fae); animation: glLoad 1.1s ease-in-out infinite alternate; }
@keyframes glLoad { from { transform: translateX(-60%); } to { transform: translateX(210%); } }
.gl-loading em { font-style: normal; font-weight: 700; color: #cfc9ff; font-size: 14px; }
.tp-seg { display: inline-flex; padding: 3px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid var(--tp-line2); }
.tp-seg button { height: 38px; padding: 0 14px; border: 0; border-radius: 11px; background: none; font-weight: 800; cursor: pointer; }
.tp-seg button.on { background: var(--tp-yellow); color: #4a2b00 !important; }
@media (orientation: landscape) and (max-height: 860px) {
  body.tp-ingame .gl-wrap { top: 0; }
  .gl-btn span { display: none; }
  .gl-btn { min-width: 48px; padding: 9px; font-size: 22px; }
  .gl-place { display: none; }
  .gl-me span { min-width: 90px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .gl-stick { width: 112px; height: 112px; left: 14px; bottom: 14px; }
  .gl-jump { width: 78px; height: 78px; right: 18px; bottom: 18px; font-size: 32px; }
  .gl-chips { display: none; }
  .gl-prompt { bottom: 16px; max-width: calc(100% - 250px); }
  .gl-say { top: 66px; font-size: 14px; padding: 7px 14px; }
  .gl-me canvas { width: 38px; height: 38px; }
}
/* Avatar Studio 3D turntable (inside the Avatar Creator) */
.creator-stage { position: relative; }
.cr-3d { width: 100%; max-width: 360px; aspect-ratio: 420 / 480; max-height: calc(100% - 60px); cursor: grab; touch-action: none; }
.cr-3d.hidden, #crPreview.hidden { display: none !important; }
.cr-3d canvas { width: 100% !important; height: 100% !important; max-height: none !important; display: block; }
.cr-3d-toggle { position: absolute; top: 10px; right: 10px; z-index: 2; height: 38px; padding: 0 12px; border-radius: 12px; border: 2px solid #e9e2ff; background: #fff; font: 800 14px var(--tp-font); color: #5f3dc4; cursor: pointer; }
@media (max-height: 520px) and (orientation: landscape) { .cr-3d { width: auto; height: 210px; } }
/* room members in the header sit in a row (an old rule for the former side header stacked them) */
.tp-topbar #membersStrip { flex-direction: row !important; align-items: center; }

/* =====================================================================
 * Phones (and small tablets) held upright – added Nov 2026 when the app stopped being landscape-only
 * ===================================================================== */
.tp-bottom { display: none; }
@media (orientation: portrait) and (max-width: 820px) {
  :root { --tp-drawer: 1; --tp-top: 56px; --card-w: 148px; }
  body.tp-on, body.tp-on.tp-collapsed { --tp-sw-cur: 0px; }
  body.tp-on #app, body.tp-on.tp-ingame #app { padding-left: calc(10px + env(safe-area-inset-left)); padding-right: calc(10px + env(safe-area-inset-right)); padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  body.tp-on.tp-ingame #app { padding-bottom: 12px; }
  body.tp-on .tiko { left: 10px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.tp-on.tp-ingame .tiko { bottom: 10px; }
  .tp-topbar { gap: 6px; padding: 0 8px 0 calc(6px + env(safe-area-inset-left)); }
  .tp-logo-mark svg { width: 34px; height: 34px; }
  .tp-quests, .tp-topbar .net-dot, .tp-members-slot { display: none !important; }
  .tp-coins { padding: 0 10px 0 4px; font-size: 14px; }
  .tp-me { padding: 2px; } .tp-me-txt { display: none; }
  /* sidebar = slide-out menu */
  .tp-side { width: 280px !important; transform: translateX(-105%); transition: transform .25s ease; z-index: 75; background: var(--tp-bg2); box-shadow: 20px 0 60px rgba(0, 0, 0, .5); top: 0; padding-top: 14px; }
  body.tp-drawer .tp-side { transform: none; }
  body.tp-drawer .tp-scrim { display: block; position: fixed; inset: 0; z-index: 74; background: rgba(5, 3, 20, .55); }
  .tp-side .tp-side-game { display: none !important; }
  .tp-side .tp-nav { display: flex !important; }
  .tp-collapsed .tp-nav-item, .tp-side .tp-nav-item { flex-direction: row !important; gap: 12px !important; padding: 7px 10px 7px 7px !important; font-size: 15px !important; text-align: left !important; }
  .tp-side .tp-nav-badge { position: static !important; margin-left: auto; }
  .tp-side .tp-sep { height: auto !important; background: none !important; font-size: 11px !important; margin: 12px 10px 4px !important; }
  /* bottom bar */
  .tp-bottom { display: flex; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(14, 11, 43, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--tp-line); }
  body.tp-ingame .tp-bottom { display: none; }
  .tp-bnav { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; border: 0; background: none; color: var(--tp-muted); font: 800 11.5px var(--tp-font); cursor: pointer; border-radius: 14px; }
  .tp-bnav .tp-i { width: 26px; height: 26px; }
  .tp-bnav.active { color: #fff; background: rgba(123, 92, 255, .28); }
  .tp-bnav.active .tp-i { color: var(--tp-yellow); }
  .tp-bnav .tp-nav-badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; padding: 0 4px; }
  /* pages */
  .tp-page { padding-top: 10px; }
  .tp-top-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .tp-hero { aspect-ratio: 1 / 1.08 !important; max-height: none !important; min-height: 0 !important; border-radius: 22px; }
  .tp-hero-art, .tp-gbanner-art { object-position: 80% 40%; }
  .tp-hero-body, .tp-gbanner-body { top: auto !important; width: 100% !important; padding: 18px !important; justify-content: flex-end; background: linear-gradient(0deg, rgba(11, 10, 36, .92) 0, rgba(11, 10, 36, .55) 60%, rgba(11, 10, 36, 0) 100%); }
  .tp-hero-title { font-size: 34px !important; }
  .tp-hero-desc { display: block !important; font-size: 15px; }
  .tp-hero-btns .tp-btn-play { flex: 1; }
  .tp-hero-dots { top: 14px; bottom: auto; right: 16px; }
  .tp-pcard { display: flex !important; flex-direction: column; }
  .tp-gbanner { aspect-ratio: 1 / .95 !important; max-height: none !important; min-height: 0 !important; }
  .tp-gbtns .tp-btn-play.big { flex: 1 1 100%; }
  .tp-gside { grid-template-columns: 1fr 1fr !important; }
  .tp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 16px 10px; }
  .tp-cats { grid-template-columns: 1fr !important; }
  .tp-prof-head { flex-direction: column; text-align: center; --avw: 170px; --avh: 190px; --pad: 18px; }
  .tp-lvbadge { left: calc(50% + 50px) !important; }
  .tp-prof-name, .tp-prof-acts { justify-content: center; }
  .tp-prof-stats { grid-template-columns: repeat(3, 1fr) !important; }
  .tp-settings { grid-template-columns: 1fr !important; }
  .tp-input { width: 100%; }
  .tp-panel { left: 8px; right: 8px; width: auto; }
  .tp-row-tools .tp-arrow { display: none; }
  .tp-chip { height: 42px; font-size: 14px; }
  /* 3D Plaza held upright */
  .gl-top { flex-wrap: wrap; gap: 8px; }
  .gl-place { display: none; }
  .gl-chips { flex-direction: row; }
  .gl-btns { width: 100%; justify-content: flex-start; }
  .gl-btn span { display: none; }
  .gl-btn { min-width: 46px; padding: 9px; }
  .gl-obbybar { top: 128px; max-width: calc(100% - 20px); overflow-x: auto; }
  .gl-say { top: 128px; }
  .gl-prompt { bottom: 170px !important; max-width: calc(100% - 24px) !important; }
}
@media (orientation: portrait) and (max-width: 820px) {
  /* Avatar Creator: preview on top, choices underneath */
  .creator { padding: 8px; align-items: stretch; }
  .creator-card { grid-template-columns: 1fr !important; grid-template-rows: auto minmax(0, 1fr) !important; width: 100%; height: 100%; max-height: none; }
  .creator-stage { flex-direction: row !important; justify-content: center; gap: 12px; padding: 8px 10px !important; }
  .creator-stage > div { flex-direction: column; }
  .creator-stage canvas, .cr-3d { width: auto !important; height: 30vh !important; max-height: 260px !important; aspect-ratio: 420 / 480; }
  .cr-3d canvas { width: 100% !important; height: 100% !important; }
  .cr-3d-toggle { top: 6px; right: 6px; }
  .creator-side { padding: 10px 12px !important; }
  .cr-tab { min-width: 64px; }
  .cr-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  /* Memory Match fits the width */
  .mem-grid { width: 100% !important; max-width: 100%; }
  /* Tiko steps aside inside games so it never covers buttons */
  body.tp-ingame .tiko { display: none; }
  .world-head { flex-wrap: wrap; }
}
/* Block Party HUD */
.gl-partybar { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 16px; border-radius: 999px; background: rgba(20, 14, 60, .78); backdrop-filter: blur(8px); font-weight: 900; white-space: nowrap; }
.gl-call { --c: #ff4d6d; position: absolute; left: 50%; top: 120px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 34px 12px; border-radius: 24px; background: var(--c); color: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .85), 0 14px 40px rgba(0, 0, 0, .35); animation: glPop .25s cubic-bezier(.2, 1.6, .4, 1); text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.gl-call small { font: 900 14px var(--tp-font); letter-spacing: 3px; text-transform: uppercase; }
.gl-call b { font: 800 46px/1 var(--tp-display); letter-spacing: 1px; }
.gl-call > i { display: block; width: 160px; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.gl-call > i > i { display: block; height: 100%; width: 100%; background: #fff; }
.gl-podium { list-style: none; margin: 10px auto 6px; padding: 0; max-width: 360px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.gl-podium li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .08); font-weight: 800; }
.gl-podium li.me { background: rgba(255, 210, 63, .25); }
.gl-podium li b { flex: 1; }
@media (orientation: portrait) and (max-width: 820px) { .gl-partybar { top: 128px; gap: 8px; } .gl-call { top: 180px; } .gl-call b { font-size: 38px; } }
/* sideways phones: game boards sit at the TOP of their column (they were centred against the tall control column and slid off-screen) */
@media (orientation: landscape) and (max-height: 720px) {
  .screen .world-card > .cat-panel > *, .screen .world-card > .cat-panel > .draw-grid > * { align-self: start !important; }
}
/* Plaza: player card + play-together panel */
.gl-card-head { display: flex; justify-content: center; margin-bottom: 4px; }
.gl-card-head canvas { border-radius: 50%; background: rgba(255, 255, 255, .1); }
.gl-code { display: inline-block; margin-left: 6px; padding: 2px 12px; border-radius: 10px; background: #ffd23f; color: #2a1a5e; font: 800 22px var(--tp-display); letter-spacing: 3px; }
.gl-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.gl-person { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border-radius: 16px; border: 0; background: rgba(255, 255, 255, .1); color: inherit; font: 800 15px var(--tp-font); cursor: pointer; }
.gl-person:disabled { cursor: default; opacity: .85; }
.gl-person.on { background: rgba(255, 210, 63, .28); box-shadow: inset 0 0 0 2px #ffd23f; }
.gl-person small { font-weight: 700; opacity: .75; font-size: 12px; }
/* Avatar Creator 2.0: draw your own picture */
.cr-draw { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.cr-art { display: grid; grid-template-columns: repeat(8, 1fr); width: min(210px, 56vw); aspect-ratio: 1; border-radius: 14px; overflow: hidden; touch-action: none; user-select: none;
  background: repeating-conic-gradient(#f1f3f5 0 25%, #fff 0 50%) 0 0 / 25% 25%; box-shadow: 0 0 0 4px #7b5cff, 0 8px 22px rgba(60, 30, 140, .25); cursor: crosshair; }
.cr-px { border: 1px solid rgba(0, 0, 0, .06); }
.cr-draw-side { flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 8px; }
.cr-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-eraser { display: grid; place-items: center; background: #fff; font-size: 18px; }
/* emotes */
.gl-emotes { position: absolute; right: 12px; top: 74px; display: grid; grid-template-columns: repeat(5, auto); gap: 6px; padding: 8px; border-radius: 20px; background: rgba(20, 14, 60, .82); backdrop-filter: blur(8px); pointer-events: auto; animation: glPop .2s cubic-bezier(.2, 1.6, .4, 1); z-index: 5; }
.gl-emote { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; padding: 6px 4px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .1); color: #fff; font: 800 12px var(--tp-font); cursor: pointer; }
.gl-emote b { font-size: 28px; line-height: 1; }
.gl-emote:active { transform: scale(.92); }
@media (orientation: portrait) and (max-width: 820px) { .gl-emotes { top: 128px; grid-template-columns: repeat(3, auto); } }
/* Giggle Kart HUD */
.gl-kartbar { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 6px 8px 6px 14px; border-radius: 999px; background: rgba(20, 14, 60, .78); backdrop-filter: blur(8px); font-weight: 900; white-space: nowrap; }
.gl-kartbar b { font: 800 30px/1 var(--tp-display); color: #ffd60a; text-shadow: 0 2px 0 #b8860b; min-width: 54px; text-align: center; }
.gl-kartbar b[data-p="1"] { color: #ffd60a; } .gl-kartbar b[data-p="2"] { color: #e9ecef; text-shadow: 0 2px 0 #868e96; } .gl-kartbar b[data-p="3"] { color: #ffa94d; text-shadow: 0 2px 0 #a0522d; } .gl-kartbar b[data-p="4"] { color: #a5d8ff; text-shadow: 0 2px 0 #1c7ed6; }
.gl-item { position: absolute; right: 18px; top: 140px; width: 78px; height: 78px; border-radius: 22px; border: 4px solid rgba(255, 255, 255, .7); background: rgba(20, 14, 60, .6); font-size: 40px; pointer-events: auto; cursor: pointer; opacity: .55; }
.gl-item.full { opacity: 1; border-color: #ffd60a; background: linear-gradient(180deg, #7b5cff, #4b2bd1); animation: glPop .3s cubic-bezier(.2, 1.6, .4, 1); box-shadow: 0 0 22px rgba(255, 214, 10, .6); }
.gl-map { position: absolute; left: 14px; bottom: 150px; width: 120px; height: 120px; border-radius: 18px; background: rgba(20, 14, 60, .45); pointer-events: none; }
.gl-tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.gl-track { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; border: 0; border-radius: 18px; color: #fff; cursor: pointer; background: linear-gradient(160deg, var(--a), var(--b)); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .2); font: 800 17px var(--tp-font); text-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
.gl-track b { font-size: 40px; line-height: 1.1; }
.gl-track small { font-size: 12px; font-weight: 800; opacity: .95; }
.gl-track.locked { filter: grayscale(.85) brightness(.75); }
.gl-track:active { transform: scale(.96); }
@media (pointer: fine) { .gl-map { bottom: 20px; } }
@media (orientation: portrait) and (max-width: 820px) { .gl-kartbar { top: 128px; } .gl-item { top: 190px; } .gl-map { bottom: 140px; width: 96px; height: 96px; } }
@media (pointer: coarse) { .gl-hud.kart .gl-item { display: none; } } /* on touch the big yellow button is the item button */
/* Sideways phones: Tiko's bubble was sitting on top of game buttons (Start, boards). In a game, Tiko steps aside –
   badges and tips still arrive as toasts. Speed Race's set-up gets compact so the track is visible before you start. */
@media (orientation: landscape) and (max-height: 500px) {
  body.tp-ingame .tiko { display: none; }
  body.tp-ingame .toasts { top: 6px !important; bottom: auto !important; }
  #raceIdle { gap: 4px; margin-bottom: 4px; }
  #raceIdle > span.font-bold { display: none; }
  #raceIdle .btn-sm, #raceIdle .chip { padding: 3px 10px; font-size: 13px; min-height: 0; }
  #raceIdle > .btn-kid:not(.btn-sm) { padding: 6px 14px; font-size: 15px; }
  #mathRace:has(#raceIdle:not(.hidden)) > .flex.justify-center { display: none; }
  #raceTrack { max-height: 26vh; object-fit: contain; }
}
/* =====================================================================
 * Immersive game screens (gameplay audit, 21 Nov 2026)
 * Inside a game the game is the screen: the platform rail/header step away on phones, the white frame goes edge-to-edge
 * and the row of sibling-game tabs is gone (choosing a game happens on the Games page, not mid-game).
 * ===================================================================== */
body.tp-ingame .world-head .cat-bar { display: none !important; }
body.tp-ingame .world-head { margin-bottom: 4px; }
@media (orientation: landscape) and (max-height: 520px) {
  body.tp-on.tp-ingame:not(.tp-in3d) { --tp-sw-cur: 0px; }
  body.tp-ingame:not(.tp-in3d) .tp-side { display: none; }
  body.tp-on.tp-ingame:not(.tp-in3d) #app { padding: 0 calc(4px + env(safe-area-inset-right)) 0 calc(4px + env(safe-area-inset-left)); }
  body.tp-ingame #app > .screen > .world-card { margin: 0 !important; border-radius: 0 0 18px 18px; padding: 4px 6px; min-height: var(--vh100, 100vh); }
  /* wide boards (river, arcade, hop, towers…): board on the left as tall as the screen, a slim column of status + buttons on the right */
  body.tp-ingame .screen .world-card.wide { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); column-gap: 8px; align-items: start; align-content: start; }
  body.tp-ingame .world-card.wide > .cat-panel > * { grid-column: 2; order: 4; flex: none !important; max-width: 100%; }
  body.tp-ingame .world-card.wide > .cat-panel > .status-line { order: 1; }
  body.tp-ingame .world-card.wide > .cat-panel > .justify-center, body.tp-ingame .world-card.wide > .cat-panel > .text-center { order: 2; flex-wrap: wrap !important; }
  body.tp-ingame .world-card.wide > .cat-panel > .lvl-row, body.tp-ingame .world-card.wide > .cat-panel > .flex-wrap:not(.justify-center) { order: 3; flex-wrap: wrap !important; overflow: visible; }
  body.tp-ingame .world-card.wide > .cat-panel > .wide-board { grid-column: 1; grid-row: 1 / span 30; width: 100%; margin: 0 auto !important; max-width: min(100%, calc((var(--vh100, 100vh) - 12px) * var(--ratio, 1.9))) !important; position: sticky; top: 4px; z-index: 1; }
  body.tp-ingame .world-card.wide > .cat-panel > .obby-wrap { grid-column: 1; grid-row: 1 / span 30; position: sticky; top: 4px; }
  body.tp-ingame .world-card.wide > .world-head { grid-column: 2; order: 5; margin: 0; }
}
@media (orientation: portrait) and (max-width: 820px) {
  body.tp-on.tp-ingame:not(.tp-in3d) { padding-top: 0; }
  body.tp-on.tp-ingame:not(.tp-in3d) .tp-topbar { display: none; }
  body.tp-on.tp-ingame:not(.tp-in3d) #app { padding: calc(4px + env(safe-area-inset-top)) calc(4px + env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) calc(4px + env(safe-area-inset-left)); }
  body.tp-ingame #app > .screen > .world-card { margin: 0 !important; padding: 6px; min-height: calc(var(--vh100, 100vh) - 8px); }
}
/* Pizza Shop on sideways phones: order | pizza | toppings side by side, so the toppings you tap are never below the screen */
@media (orientation: landscape) and (max-height: 520px) {
  #mathPizza > .grid { grid-template-columns: minmax(130px, .55fr) minmax(0, 1.6fr); gap: 8px; align-items: start; }
  #mathPizza .market-counter { padding: 8px; }
  #mathPizza #pizCustomer { font-size: 3rem; line-height: 1.1; }
  #mathPizza > .grid > div:last-child { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: start; }
  #mathPizza > .grid > div:last-child > * { grid-column: 2; margin-top: 0; }
  #mathPizza > .grid > div:last-child > .pizza-board { grid-column: 1; grid-row: 1 / span 5; width: min(300px, calc(var(--vh100, 100vh) - 24px)); }
  #mathPizza #pizzaToppings { justify-content: flex-start; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
  #mathPizza #pizzaToppings .prop-btn { width: 100%; height: auto; aspect-ratio: 1; min-height: 44px; font-size: 1.7rem; padding: 0; margin: 0; }
  #mathPizza > .grid > div:last-child > p { font-size: 13px; line-height: 1.15; }
  body.tp-ingame #screen-math .world-card { grid-template-columns: minmax(0, 1fr) auto; }
  body.tp-ingame #screen-math .world-head .world-exit { padding: .2rem .55rem; min-height: 44px; font-size: .95rem; }
  #mathPizza #pizzaToppings + div { justify-content: flex-start; }
}
/* Pixel Art on upright phones: the picture to copy sits beside the grid (it used to be below it, off the screen) */
@media (orientation: portrait) and (max-width: 640px) {
  .pixel-area { flex-wrap: nowrap; gap: 8px; align-items: flex-start; }
  .pixel-area > .pixel-grid { flex: 1 1 auto; min-width: 0; width: auto; }
  .pixel-area > .pixel-side { flex: 0 0 78px; width: 78px; }
  .pixel-area > .pixel-side p { font-size: 12px; line-height: 1.1; margin-bottom: 3px; }
}
/* Sea Battle: in the battle the enemy sea (the one you tap) is big and first; your own sea becomes a small map beside it */
.sea-boards.battle { grid-template-columns: minmax(0, 1fr) minmax(110px, .42fr); align-items: start; }
.sea-boards.battle > .sea-wrap:last-child { order: -1; }
.sea-boards.battle > .sea-wrap:first-child .sea-grid { width: 100%; gap: 2px; padding: 4px; border-radius: 10px; }
.sea-boards.battle > .sea-wrap:first-child .sea-cell { border-radius: 3px; font-size: .7rem; }
.sea-boards.battle > .sea-wrap:first-child p { font-size: 12px; }
.sea-boards.battle > .sea-wrap:last-child .sea-grid { width: min(100%, calc(var(--vh100, 100vh) - 60px)); }
@media (orientation: portrait) {
  .sea-boards.battle { grid-template-columns: 1fr; }
  .sea-boards.battle > .sea-wrap:first-child .sea-grid { width: min(55%, 220px); }
}
.sea-battle-on .sea-settings { display: none !important; }
/* while hiding ships, only your own sea matters */
.sea-boards.placing > .sea-wrap:last-child { display: none; }
.sea-boards.placing { grid-template-columns: 1fr !important; }
.sea-boards.placing .sea-grid { width: min(100%, 460px, calc(var(--vh100, 100vh) - 60px)); }
/* Pizza Shop on upright phones: compact order card and a slightly smaller pizza, so the toppings and Serve fit under it */
@media (orientation: portrait) and (max-width: 640px) {
  #mathPizza > .grid { gap: 6px; }
  #mathPizza .market-counter { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; padding: 8px; }
  #mathPizza #pizCustomer { font-size: 2.8rem; line-height: 1; }
  #mathPizza #pizOrder { flex: 1 1 60%; margin: 0; }
  #mathPizza .market-counter > p { flex: 0 0 100%; margin: 0; font-size: 13px; }
  #mathPizza .pizza-board { width: min(250px, 64vw); }
  #mathPizza #pizzaToppings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  #mathPizza #pizzaToppings .prop-btn { width: 100%; height: auto; aspect-ratio: 1.25; min-height: 48px; font-size: 1.8rem; padding: 0; margin: 0; }
}
#mathPizza.paying .pizza-board + p, #mathPizza.paying #pizzaToppings, #mathPizza.paying #pizzaToppings + div { display: none !important; }
#mathPizza.paying #pizzaPay { margin-top: 4px; animation: popIn .25s ease-out; }
@media (orientation: landscape) and (max-height: 520px) { #mathPizza #pizzaPay p { font-size: 15px; line-height: 1.2; } #mathPizza #pizzaPay .btn-kid { min-height: 50px; } }
