:root {
  --violet: #7c5cff;
  --violet-d: #5a3fe0;
  --mint: #2fd3a7;
  --pink: #ff6fa5;
  --sun: #ffc83d;
  --ink: #2b2340;
  --muted: #6e6787;
  --bg: #f5f2ff;
  --card: #ffffff;
  --line: #e7e1fb;
  --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Nunito', system-ui, sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3, .logo, .btn { font-family: 'Baloo 2', 'Nunito', sans-serif; }
h2 { margin: 0 0 12px; font-size: 1.4rem; }
h3 { margin: 0 0 8px; font-size: 1.1rem; }
.hidden { display: none !important; }
.error { color: #e0245e; font-weight: 700; min-height: 1.2em; margin: 6px 0 0; }
.hint { color: var(--muted); font-size: .9rem; margin: 6px 0; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
a { color: var(--violet-d); }

/* ---------- buttons & inputs ---------- */
.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-size: 1rem; font-weight: 700; cursor: pointer;
       transition: transform .08s, box-shadow .15s, background .15s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--violet); color: #fff; box-shadow: 0 4px 0 var(--violet-d); }
.btn.primary:hover { background: #8a6cff; }
.btn.dark { background: var(--ink); color: #fff; box-shadow: 0 4px 0 #120d22; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn.ghost:hover { background: #fff; }
.btn.ghost.light { color: #fff; border-color: rgba(255,255,255,.3); }
.btn.ghost.light:hover { background: rgba(255,255,255,.1); }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn.big { width: 100%; padding: 14px; font-size: 1.15rem; margin-top: 6px; }
.btn.round { width: 44px; height: 44px; padding: 0; font-size: 1.3rem; background: #fff; border: 2px solid var(--line); }
.btn.ok { background: var(--mint); color: #fff; }
.btn.no { background: #ffe1ea; color: #c2185b; }
input, select { font: inherit; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--violet); }
label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 10px; }
label input, label select { margin-top: 4px; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: 0 6px 24px rgba(76, 52, 170, .08); }

/* ---------- landing ---------- */
#landing { min-height: 100vh; background: radial-gradient(circle at 10% 10%, #e3dbff 0, transparent 40%),
           radial-gradient(circle at 90% 20%, #d0fff2 0, transparent 40%), var(--bg); padding: 40px 20px 0; }
.hero { text-align: center; }
.logo { font-size: 2.8rem; font-weight: 800; color: var(--violet-d); display: inline-flex; align-items: center; gap: 10px; }
.logo.small { font-size: 1.5rem; }
.logo .tld { color: var(--pink); font-size: .6em; align-self: flex-end; margin-bottom: .35em; margin-left: -6px; }
.topbar.dark .logo .tld { color: var(--sun); }
.logo-bubble { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 40% 40% 40% 10%;
               background: linear-gradient(135deg, var(--violet), var(--pink)); font-size: .7em; }
.tagline { font-size: 1.2rem; color: var(--muted); margin: 4px 0 18px; }
.hero-avatars { display: flex; justify-content: center; gap: 10px; margin-bottom: 26px; }
.hero-avatars > div { animation: bob 3s ease-in-out infinite; }
.hero-avatars > div:nth-child(2n) { animation-delay: -1.5s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.login-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 380px)); gap: 22px; justify-content: center; }
.login-card h2 { font-size: 1.6rem; }
.kid-card { border-top: 8px solid var(--mint); }
.parent-card { border-top: 8px solid var(--ink); }
.safety-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 32px 0; }
.safety-strip span { background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: .9rem; color: var(--muted); }

/* ---------- top bar ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: #fff;
          border-bottom: 2px solid var(--line); }
.topbar.dark { background: var(--ink); color: #fff; border: 0; }
.topbar.dark .logo { color: #fff; }
.pill { font-size: .8rem; background: var(--sun); color: var(--ink); border-radius: 999px; padding: 2px 10px; }
.me { display: flex; align-items: center; gap: 12px; }
.me-avatar { border: 3px solid var(--violet); border-radius: 50%; padding: 0; background: none; cursor: pointer; line-height: 0;
             position: relative; transition: transform .15s; }
.me-avatar:hover { transform: scale(1.06) rotate(-4deg); }
.me-avatar::after { content: '✏️'; position: absolute; right: -6px; bottom: -4px; font-size: 14px; background: #fff; border-radius: 50%; padding: 2px; line-height: 1; }
.me-name { font-family: 'Baloo 2'; font-weight: 800; font-size: 1.2rem; }
.me-code { color: var(--muted); font-size: .85rem; }
.me-code b { color: var(--violet-d); letter-spacing: 2px; }
.banner { background: var(--sun); text-align: center; padding: 10px; font-weight: 700; }

/* ---------- kid layout ---------- */
.kid-main { display: grid; grid-template-columns: 320px 1fr; gap: 18px; padding: 18px; height: calc(100vh - 78px); }
.sidebar { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.add-friend input { text-transform: uppercase; letter-spacing: 3px; font-weight: 800; }
.section-title { margin: 6px 4px 0; }
.friend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.friend { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: #fff; cursor: pointer;
          border: 2px solid transparent; transition: border .15s, transform .1s; }
.friend:hover { transform: translateX(2px); }
.friend.active { border-color: var(--violet); background: #f1edff; }
.friend .meta { flex: 1; min-width: 0; }
.friend .name { font-weight: 800; }
.friend .last { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend .unread { width: 12px; height: 12px; border-radius: 50%; background: var(--pink); }
.req { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: #fff7d6; margin-bottom: 8px; }
.req .meta { flex: 1; }
.req .status { font-size: .82rem; color: var(--muted); }
.req.waiting { background: #fff; opacity: .8; }
.empty-note { color: var(--muted); font-size: .9rem; padding: 4px; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); padding: 30px; }
.chat-pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 2px solid var(--line); }
.chat-with { flex: 1; display: flex; flex-direction: column; font-size: 1.15rem; }
.typing { font-size: .85rem; color: var(--violet); }
.messages { list-style: none; margin: 0; padding: 16px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
            background: linear-gradient(#fbfaff, #f6f3ff); }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 75%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { padding: 10px 14px; border-radius: 20px 20px 20px 6px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.05);
          word-wrap: break-word; overflow-wrap: anywhere; position: relative; }
.msg.mine .bubble { background: var(--violet); color: #fff; border-radius: 20px 20px 6px 20px; }
.bubble.sticker { background: none !important; box-shadow: none; font-size: 3.2rem; padding: 0; animation: pop .3s; }
@keyframes pop { from { transform: scale(.3); } }
.bubble .time { display: block; font-size: .7rem; opacity: .6; margin-top: 2px; }
.bubble .flag { font-size: .72rem; opacity: .8; display: block; }
.report { opacity: 0; border: 0; background: none; cursor: pointer; font-size: .9rem; }
.msg:hover .report { opacity: .6; }
.report:hover { opacity: 1 !important; }
.notice { margin: 0 16px; padding: 8px 12px; background: #fff3c4; border-radius: 12px; font-weight: 700; font-size: .9rem; }
.sticker-tray { display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 6px; padding: 10px 16px; border-top: 2px solid var(--line); }
.sticker-tray button { font-size: 2rem; background: #fff; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; transition: transform .1s; }
.sticker-tray button:hover { transform: scale(1.15) rotate(-6deg); }
.send-row { display: flex; gap: 8px; padding: 12px 16px 0; }
.send-row input { border-radius: 999px; }

/* ---------- modal & avatar builder ---------- */
.modal { position: fixed; inset: 0; background: rgba(28, 20, 60, .45); display: grid; place-items: center; z-index: 10; padding: 16px; }
.modal-box { background: #fff; border-radius: 26px; padding: 22px; width: min(900px, 100%); max-height: 92vh; overflow-y: auto; }
.avatar-builder { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
.builder-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; position: sticky; top: 0; align-self: start; }
.builder-options { display: flex; flex-direction: column; gap: 14px; }
.opt-group h4 { margin: 0 0 6px; font-family: 'Baloo 2'; font-size: 1rem; }
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--violet); }
.chip { padding: 6px 12px; border-radius: 999px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; text-transform: capitalize; }
.chip.on { border-color: var(--violet); background: #f1edff; color: var(--violet-d); }
.modal-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- parent ---------- */
.parent-main { max-width: 1000px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.alerts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.alerts li { padding: 8px 12px; border-radius: 12px; background: #f7f5ff; display: flex; gap: 10px; }
.alerts li.new { background: #fff3c4; font-weight: 700; }
.alerts .when { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.kid-card-p { display: grid; grid-template-columns: 120px 1fr; gap: 18px; margin-bottom: 18px; }
.kid-card-p .controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; margin: 10px 0; }
.toggle { display: flex; align-items: center; gap: 8px; }
.toggle input { width: auto; }
.pfriends { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.pfriends li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 14px; background: #f7f5ff; }
.pfriends .meta { flex: 1; }
.pfriends .status { color: var(--muted); font-size: .85rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.viewer .msg { max-width: 100%; }

/* ---------- 16+ landing ---------- */
.member-card { border-top: 8px solid var(--violet); max-width: 420px; width: 100%; }
.tabs { display: flex; gap: 6px; background: var(--bg); padding: 4px; border-radius: 999px; margin-bottom: 14px; }
.tab { flex: 1; border: 0; background: none; padding: 8px; border-radius: 999px; font: 700 1rem 'Baloo 2', sans-serif; color: var(--muted); cursor: pointer; }
.tab.on { background: #fff; color: var(--violet-d); box-shadow: 0 2px 8px rgba(76, 52, 170, .12); }
.family-section { max-width: 820px; margin: 26px auto 0; }
.family-section summary { cursor: pointer; text-align: center; font-weight: 700; color: var(--muted); padding: 10px; list-style: none; }
.family-section summary::-webkit-details-marker { display: none; }
.family-section summary::after { content: ' ▾'; }
.family-section[open] summary::after { content: ' ▴'; }
.family-section .login-cards { margin-top: 10px; }

/* ---------- filters ---------- */
.hidden-source { position: fixed; left: -9999px; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
#cameraVideo { position: absolute; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.camera-stage canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-canvas { display: block; width: 100%; max-height: 60vh; object-fit: contain; background: #000; border-radius: 18px; cursor: pointer; }
.filter-strip { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; scrollbar-width: thin; }
.filter-chip { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none;
               cursor: pointer; font: 700 .78rem 'Nunito', sans-serif; color: var(--muted); padding: 0; }
.filter-thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 14px; border: 3px solid transparent; background: #ddd; }
.filter-chip.on { color: var(--violet-d); }
.filter-chip.on .filter-thumb { border-color: var(--violet); }

.preview-wrap { position: relative; }
.beauty-btn { border: 0; border-radius: 999px; padding: 7px 14px; font: 800 .88rem 'Nunito', sans-serif; cursor: pointer;
              background: rgba(20, 14, 40, .55); color: #fff; backdrop-filter: blur(6px); }
.beauty-btn.overlay { position: absolute; top: 10px; right: 10px; z-index: 2; }
.beauty-btn.on { background: linear-gradient(135deg, var(--pink), var(--violet)); box-shadow: 0 4px 14px rgba(255, 111, 165, .45); }

/* ---------- Connect Four ---------- */
.msg.system { align-self: center; max-width: 90%; background: #fff7d6; color: var(--ink); font-weight: 700; font-size: .85rem;
              padding: 6px 14px; border-radius: 999px; text-align: center; }
.game-panel { margin: 10px 16px 0; padding: 12px; border-radius: 20px; background: linear-gradient(160deg, #f1edff, #e6fbf5);
              border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.game-head { width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.game-title { font: 800 1.05rem 'Baloo 2', sans-serif; }
.game-players { font-size: .88rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.game-close { margin-left: auto; border: 0; background: none; font-size: 1rem; cursor: pointer; color: var(--muted); }
.game-status { font-weight: 800; }
.game-status.my-turn { color: var(--violet-d); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.game-actions { display: flex; gap: 8px; }
.disc { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.disc.red, .c4-cell.red { background: radial-gradient(circle at 35% 35%, #ff8a8a, #e53950 60%, #b8233a); }
.disc.yellow, .c4-cell.yellow { background: radial-gradient(circle at 35% 35%, #fff3a8, #ffc83d 60%, #d99a00); }
.c4-board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 8px; border-radius: 16px;
            background: linear-gradient(160deg, #5a3fe0, #7c5cff); box-shadow: inset 0 -4px 0 rgba(0,0,0,.18);
            width: min(100%, 340px); }
.c4-col { display: grid; grid-template-rows: repeat(6, 1fr); gap: 4px; border: 0; background: none; padding: 2px; border-radius: 10px; cursor: default; }
.c4-board.playable .c4-col:not(:disabled) { cursor: pointer; }
.c4-board.playable .c4-col:not(:disabled):hover { background: rgba(255,255,255,.18); }
.c4-cell { width: 100%; aspect-ratio: 1; border-radius: 50%; background: #2b2340; box-shadow: inset 0 3px 4px rgba(0,0,0,.45); }
.c4-cell.drop { animation: drop .35s cubic-bezier(.5, 0, .7, 1.4); }
@keyframes drop { from { transform: translateY(calc(var(--rows) * -115%)); } }
.c4-cell.win { box-shadow: 0 0 0 3px #fff, 0 0 14px 4px #fff; animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { to { filter: brightness(1.25); } }

/* ---------- game picker ---------- */
.game-picker { position: fixed; z-index: 30; background: #fff; border-radius: 18px; padding: 8px; width: 270px;
               box-shadow: 0 10px 32px rgba(43, 35, 64, .25); animation: pop .15s; }
.picker-title { font: 800 .9rem 'Baloo 2', sans-serif; color: var(--muted); padding: 4px 8px; }
.game-picker button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none;
                      padding: 8px; border-radius: 12px; cursor: pointer; font: inherit; color: var(--ink); }
.game-picker button:hover { background: #f1edff; }
.pk-icon { font-size: 1.6rem; }
.game-picker b { display: block; }
.game-picker small { color: var(--muted); }
.game-body { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.game-invite { font-size: 3rem; animation: bob 2s ease-in-out infinite; }
.game-panel { max-height: 62vh; overflow-y: auto; }

/* ---------- Sea Strike ---------- */
.sea-boards { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.sea-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sea-label { font-size: .85rem; }
.sea-label small { color: var(--muted); }
.sea-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; padding: 6px; border-radius: 12px;
            background: linear-gradient(160deg, #1e5aa8, #2f8fd8); width: min(300px, 80vw); }
.sea-wrap.small .sea-grid { width: min(180px, 46vw); }
.sea-cell { aspect-ratio: 1; border: 0; border-radius: 3px; background: rgba(255,255,255,.14); padding: 0; position: relative; }
.sea-grid.playable .sea-cell:not(:disabled) { cursor: crosshair; }
.sea-grid.playable .sea-cell:not(:disabled):hover { background: rgba(255,255,255,.45); }
.sea-cell.ship { background: #8a94a6; }
.sea-cell.sunk { background: #3b3f4a; }
.sea-cell.miss::after { content: ''; position: absolute; inset: 35%; border-radius: 50%; background: rgba(255,255,255,.85); }
.sea-cell.hit { background: #ff7a3d; }
.sea-cell.sunk.hit { background: #c0392b; }
.sea-cell.hit::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: .7em; }

/* ---------- Mystery Friend ---------- */
.my-secret { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 4px 14px 4px 4px; font-size: .88rem; }
.mystery-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: min(100%, 470px); }
.mystery-card { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 4px 2px; cursor: pointer;
                display: flex; flex-direction: column; align-items: center; font: 700 .72rem 'Nunito', sans-serif; color: var(--ink);
                transition: transform .15s, opacity .2s, filter .2s; }
.mystery-card .avatar-svg { width: 100%; height: auto; max-width: 54px; }
.mystery-card.out { opacity: .3; filter: grayscale(1); transform: scale(.92); }
.mystery-grid.guessing .mystery-card:not(.out) { border-color: var(--pink); animation: pulse 1.2s ease-in-out infinite; }
.mystery-card.reveal { border-color: var(--sun); box-shadow: 0 0 0 3px var(--sun); opacity: 1; filter: none; transform: scale(1.05); }
.mystery-ask { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; }
.mystery-ask select { width: auto; flex: 1 1 200px; padding: 6px 10px; }
.mystery-log { list-style: none; margin: 0; padding: 0; font-size: .8rem; color: var(--muted); text-align: center; }
@media (max-width: 520px) { .mystery-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- squishies ---------- */
.squish-btn { display: inline-flex; align-items: center; gap: 6px; }
.coin-pill { background: #fff3c4; color: #8a6200; border-radius: 999px; padding: 2px 10px; font: 800 .88rem 'Nunito', sans-serif; }
.coin-pill.big { font-size: 1.05rem; padding: 4px 14px; }
.squish-box { width: min(980px, 100%); }
.squish-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.squish-head h2 { margin: 0; flex: 1; }
.squish-tabs { max-width: 520px; }
.squish-body { min-height: 300px; }
.sq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.sq-card { position: relative; background: #fff; border: 3px solid color-mix(in srgb, var(--rc, #ddd) 40%, #fff); border-radius: 20px;
           padding: 10px 8px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
           font: inherit; color: var(--ink); box-shadow: 0 4px 14px rgba(76, 52, 170, .08); }
.sq-card.r-common { --rc: #8a8fa3; } .sq-card.r-rare { --rc: #3d8bff; } .sq-card.r-epic { --rc: #9b5cf6; } .sq-card.r-legendary { --rc: #e0a400; }
.sq-card.r-epic { background: linear-gradient(170deg, #fff, #f3ecff); }
.sq-card.r-legendary { background: linear-gradient(170deg, #fffdf2, #fff1c2); box-shadow: 0 0 0 2px #ffe08a, 0 6px 22px rgba(224, 164, 0, .3); }
.sq-card.is-shiny { background: linear-gradient(135deg, #fff0fa, #eafaff, #fffbe6, #f2edff); }
.sq-art { cursor: pointer; line-height: 0; }
.sq-art.squish { animation: squish .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes squish { 0% { transform: scale(1, 1); } 30% { transform: scale(1.25, .7); } 55% { transform: scale(.88, 1.15); } 75% { transform: scale(1.06, .95); } 100% { transform: scale(1, 1); } }
.squishy-svg.shiny .holo { animation: holo 3s linear infinite; }
@keyframes holo { 50% { opacity: .2; } }
.squishy-svg.shiny .sparkles { animation: twinkle 1.6s ease-in-out infinite; transform-origin: center; }
@keyframes twinkle { 50% { opacity: .2; } }
.sq-name { font: 800 .95rem 'Baloo 2', sans-serif; line-height: 1.1; }
.sq-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.sq-rarity { font-size: .7rem; font-weight: 800; color: #fff; background: var(--rc); border-radius: 999px; padding: 1px 8px; }
.sq-shiny { font-size: .7rem; font-weight: 800; color: #7a3fd0; background: #f1e7ff; border-radius: 999px; padding: 1px 8px; }
.sq-count { font-size: .7rem; font-weight: 800; background: var(--ink); color: #fff; border-radius: 999px; padding: 1px 8px; }
.sq-recycle { margin-top: 4px; }
.sq-card.unknown .sq-art { filter: brightness(0) opacity(.18); }
.sq-card.unknown .sq-tags { opacity: .5; }
.sq-card.small { padding: 6px 4px 4px; border-radius: 14px; border-width: 2px; }
.sq-card.small .sq-name { font-size: .72rem; }
.sq-card.small .sq-tags { display: none; }
button.sq-card { cursor: pointer; }
button.sq-card.selected { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet); transform: translateY(-2px); }
.sq-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; font-weight: 700;
            padding: 10px 18px; border-radius: 999px; z-index: 40; opacity: 0; pointer-events: none; }
.sq-toast.show { animation: toast 2.6s ease; }
@keyframes toast { 10%, 80% { opacity: 1; transform: translate(-50%, 0); } 0%, 100% { opacity: 0; transform: translate(-50%, 10px); } }

.capsule-wrap { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(260px, 1.1fr); gap: 18px; align-items: start; }
.capsule-side { display: flex; flex-direction: column; gap: 10px; }
.capsule-side .card { padding: 12px 16px; }
.capsule-side ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.odds li { display: flex; justify-content: space-between; align-items: center; }
.capsule-machine { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 10px; }
.machine-dome { width: 200px; height: 170px; border-radius: 100px 100px 20px 20px; background: rgba(200, 230, 255, .45);
                border: 6px solid #c7d6ff; position: relative; overflow: hidden; box-shadow: inset 0 0 30px rgba(255,255,255,.8); }
.balls { position: absolute; inset: auto 10px 6px; display: flex; flex-wrap: wrap-reverse; gap: 4px; justify-content: center; }
.balls span { width: 40px; height: 40px; border-radius: 50%; box-shadow: inset -6px -6px 0 rgba(0,0,0,.08), inset 6px 6px 0 rgba(255,255,255,.5); }
.machine-base { width: 220px; height: 70px; background: linear-gradient(160deg, var(--pink), var(--violet)); border-radius: 18px 18px 26px 26px;
                display: grid; place-items: center; color: #fff; font: 800 1.3rem 'Baloo 2', sans-serif; letter-spacing: 4px; }
.capsule-stage { min-height: 220px; display: flex; align-items: center; justify-content: center; width: 100%; padding-top: 10px; }
.capsule { width: 86px; height: 86px; animation: wobble .35s ease-in-out infinite; }
.cap-top { height: 43px; border-radius: 43px 43px 0 0; background: linear-gradient(135deg, #ff9ad5, #b9a2ff); }
.cap-bottom { height: 43px; border-radius: 0 0 43px 43px; background: #fff; border: 3px solid #eee; border-top: 0; }
@keyframes wobble { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.capsule-reveal { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.capsule-reveal.r-legendary .sq-card, .capsule-reveal.r-epic .sq-card { animation: glow 1s ease-in-out infinite alternate; }
.reveal-msg { font: 800 1.15rem 'Baloo 2', sans-serif; }

.trade-panel { margin: 10px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.trade-offer { background: linear-gradient(160deg, #fff7fb, #f1edff); border: 2px solid #ffd1e8; border-radius: 18px; padding: 10px 12px; }
.trade-title { font: 800 .95rem 'Baloo 2', sans-serif; margin-bottom: 4px; }
.trade-sides { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trade-sides small { color: var(--muted); font-weight: 700; }
.trade-arrow { font-size: 1.4rem; color: var(--violet); }
.trade-items { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.trade-items .sq-card { width: 78px; }
.trade-btns { display: flex; gap: 8px; margin-top: 8px; }
.trade-box { width: min(900px, 100%); }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trade-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; max-height: 46vh; overflow-y: auto; padding: 4px; }
.trade-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .capsule-wrap, .trade-cols { grid-template-columns: 1fr; }
  .sq-label { display: none; }
}

/* ---------- reactions ---------- */
.bubble-col { display: flex; flex-direction: column; min-width: 0; }
.msg.mine .bubble-col { align-items: flex-end; }
.reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: -6px; padding: 0 8px; position: relative; z-index: 1; }
.reactions:empty { display: none; }
.reaction-chip { border: 2px solid #fff; background: #f1edff; border-radius: 999px; padding: 1px 8px; font-size: .9rem; cursor: pointer;
                 box-shadow: 0 1px 4px rgba(0,0,0,.08); line-height: 1.5; }
.reaction-chip.mine { background: var(--violet); color: #fff; }
.msg-actions { display: flex; flex-direction: column; gap: 2px; align-self: center; }
.react-btn { opacity: 0; border: 0; background: none; cursor: pointer; font-size: 1rem; padding: 2px; }
.react-btn small { font-size: .65rem; font-weight: 800; color: var(--muted); }
.msg:hover .react-btn { opacity: .6; }
.react-btn:hover { opacity: 1 !important; }
@media (hover: none) { .react-btn, .report { opacity: .45; } }
.react-picker { position: fixed; z-index: 30; display: flex; gap: 2px; background: #fff; border-radius: 999px; padding: 6px 8px;
                box-shadow: 0 8px 28px rgba(43, 35, 64, .25); animation: pop .15s; }
.react-picker button { border: 0; background: none; font-size: 1.6rem; cursor: pointer; border-radius: 50%; width: 42px; height: 42px; transition: transform .1s; }
.react-picker button:hover { transform: scale(1.25); }
.react-picker button.on { background: #f1edff; }

/* ---------- media in chat ---------- */
.bubble.media { padding: 4px; background: #fff; overflow: hidden; }
.msg.mine .bubble.media { background: var(--violet); }
.bubble.media img, .bubble.media video { display: block; max-width: min(320px, 60vw); max-height: 360px; border-radius: 16px; background: #000; }
.bubble.media img { cursor: zoom-in; }
.bubble.media .time { padding: 2px 8px 4px; }
.upload-bar { position: relative; margin: 6px 16px 0; height: 26px; border-radius: 999px; background: var(--line); overflow: hidden; }
.upload-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--mint); transition: width .15s; }
.upload-text { position: relative; display: block; text-align: center; font-size: .82rem; font-weight: 700; line-height: 26px; }

.camera-box, .preview-box { width: min(560px, 100%); }
.camera-stage { position: relative; background: #000; border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 3; }
.camera-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-badge { position: absolute; top: 10px; left: 10px; background: #e0245e; color: #fff; font-weight: 800; padding: 4px 10px; border-radius: 999px; font-size: .9rem; }
.camera-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.btn.recording { background: #e0245e; box-shadow: 0 4px 0 #a3123f; }
.preview-stage img, .preview-stage video { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 18px; background: #000; }
.lightbox { background: rgba(0, 0, 0, .85); cursor: zoom-out; }
.lightbox img { max-width: 95vw; max-height: 92vh; border-radius: 12px; }

@media (max-width: 780px) {
  .kid-main { grid-template-columns: 1fr; height: auto; }
  .chat { min-height: 70vh; }
  .avatar-builder { grid-template-columns: 1fr; }
  .builder-preview { position: static; }
  .kid-card-p { grid-template-columns: 1fr; }
  .me-code { display: none; }
}

/* Squishydex series headings */
.dex-series { margin: 18px 4px 8px; font-size: 1.1rem; }
.dex-series:first-of-type { margin-top: 4px; }

/* ---------- squishy marketplace ---------- */
.squish-tabs { max-width: 640px; }
.market-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.market-bar input { flex: 1 1 160px; width: auto; padding: 7px 12px; }
.market-bar select { width: auto; padding: 7px 10px; }
.sq-card.listing { gap: 6px; }
.listing-info { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.price-tag { background: #fff3c4; color: #8a6200; font-weight: 800; border-radius: 999px; padding: 2px 10px; }
.swap-tag { font-size: .75rem; font-weight: 800; color: var(--violet-d); }
.want-mini { line-height: 0; }
.want-name { font-size: .75rem; font-weight: 700; }
.listing-meta { font-size: .72rem; color: var(--muted); }
.sq-listed { font-size: .7rem; font-weight: 800; background: #e6f4ff; color: #1e5aa8; border-radius: 999px; padding: 1px 8px; }
.sell-form { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.sell-form > .sq-card { width: 170px; }
.sell-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.sell-mode { margin-bottom: 4px; }
.shop-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.shop-item { background: linear-gradient(170deg, #fff, #f0fbff); }

/* =====================================================================
   MOBILE VIEW (phones and small tablets)
   ===================================================================== */
.back-btn, .my-code-mobile { display: none; }

@media (max-width: 700px) {
  html, body { overscroll-behavior: none; }
  input, select, textarea { font-size: 16px; }          /* stops iPhone zooming into fields */

  /* landing */
  #landing { padding: 24px 12px 0; }
  .logo { font-size: 2.1rem; }
  .tagline { font-size: 1rem; }
  .hero-avatars > div:nth-child(n+4) { display: none; }
  .login-cards { grid-template-columns: 1fr; gap: 14px; }
  .safety-strip { gap: 6px; padding: 20px 0; }
  .safety-strip span { font-size: .78rem; padding: 6px 10px; }

  /* top bar */
  .topbar { padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); gap: 6px; }
  .logo.small { font-size: 1.1rem; gap: 6px; }
  .logo.small .tld { display: none; }
  .me { gap: 6px; }
  .me > div { display: none; }                          /* name + code move into the page */
  .me-avatar .avatar-svg { width: 40px; height: 40px; }
  .topbar .btn { padding: 7px 10px; font-size: .85rem; }
  .squish-btn .sq-label { display: none; }
  .my-code-mobile { display: block; }
  .my-code-mobile b { color: var(--violet-d); letter-spacing: 2px; }

  /* friends list vs. full-screen chat */
  .kid-main { display: block; height: auto; padding: 10px; }
  body:not(.chat-open) #kid .chat { display: none; }
  body.chat-open #kid .sidebar { display: none; }
  body.chat-open #kid .chat {
    position: fixed; inset: 0; z-index: 5; border-radius: 0; height: 100dvh; min-height: 0;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  }
  body.chat-open #chatBlocked { position: fixed; top: 0; left: 0; right: 0; z-index: 6; }
  .back-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; font-size: 1.2rem; flex: 0 0 auto; }
  .chat-head { padding: 8px 10px; gap: 6px; }
  .chat-head .avatar-svg { width: 38px; height: 38px; }
  .chat-with { font-size: 1rem; min-width: 0; }
  .chat-with b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-head .btn.small { padding: 6px 8px; font-size: .78rem; }
  .messages { padding: 10px; }
  .msg { max-width: 92%; }
  .msg .avatar-svg { width: 28px; height: 28px; }
  .bubble.media img, .bubble.media video { max-width: 68vw; max-height: 300px; }
  .send-row { padding: 8px 8px 0; gap: 5px; }
  .send-row .btn.round { width: 38px; height: 38px; font-size: 1.1rem; flex: 0 0 auto; }
  .send-row .btn.primary { padding: 10px 14px; }
  .send-row input { min-width: 0; padding: 9px 12px; }
  #chatHint { font-size: .72rem; margin: 4px 0 6px; }
  .react-btn, .report { opacity: .5; }
  .friend { padding: 8px; }

  /* games + trades inside the chat */
  .game-panel, .trade-panel { margin: 8px 8px 0; }
  .game-panel { max-height: 58vh; padding: 10px 8px; }
  .c4-board { width: 100%; }
  .sea-boards { gap: 8px; }
  .sea-grid { width: min(300px, 88vw); }
  .sea-wrap.small .sea-grid { width: min(220px, 60vw); }
  .mystery-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .mystery-card { font-size: .66rem; }
  .trade-sides { gap: 6px; }
  .trade-items .sq-card { width: 64px; }

  /* every pop-up window becomes full-screen */
  .modal { padding: 0; align-items: stretch; }
  .modal-box { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 14px 12px;
               padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .lightbox { align-items: center; }
  .avatar-builder { grid-template-columns: 1fr; }
  .builder-preview .avatar-svg { width: 160px; height: 160px; }
  .camera-stage { aspect-ratio: 3 / 4; }
  .camera-actions .btn { padding: 9px 12px; }
  .preview-canvas { max-height: 50vh; }

  /* squishies */
  .squish-head h2 { font-size: 1.2rem; }
  .squish-tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .squish-tabs .tab { flex: 0 0 auto; white-space: nowrap; padding: 8px 12px; font-size: .9rem; }
  .sq-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .sq-card { padding: 8px 4px 6px; border-radius: 16px; }
  .sq-card .squishy-svg { width: 70px; height: 70px; }
  .sq-name { font-size: .85rem; }
  .capsule-wrap, .trade-cols { grid-template-columns: 1fr; }
  .machine-dome { width: 170px; height: 140px; }
  .machine-base { width: 190px; height: 56px; font-size: 1.1rem; }
  .market-bar input { flex-basis: 100%; }
  .market-bar select { flex: 1 1 30%; font-size: 14px; }
  .sell-form > .sq-card { width: 140px; margin: 0 auto; }
  .trade-pick { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); max-height: 32vh; }
  .game-picker { width: calc(100vw - 20px); left: 10px !important; }

  /* family hub */
  .parent-main { padding: 10px; }
  .kid-card-p .controls { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .chat-head .btn-label { display: none; }
  .chat-head .btn.small { width: 38px; height: 38px; padding: 0; font-size: 1.05rem; flex: 0 0 auto; }
}

/* ---------- Bobby's Sky Dash ---------- */
.runner-box { width: min(760px, 100%); display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.run-stage { position: relative; width: 100%; height: min(72vh, 620px); border-radius: 18px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: #6fc0ff; }
.run-stage #runCanvas { display: block; width: 100%; height: 100%; }
.run-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(28, 20, 60, .45); overflow-y: auto; padding: 12px; }
.run-card { background: #fff; border-radius: 22px; padding: 16px 20px; width: min(420px, 100%); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.run-card.small { width: auto; }
.run-card h2 { margin: 4px 0 8px; font-size: 1.35rem; }
.run-card h3 { margin: 14px 0 6px; font-size: 1rem; }
.run-card canvas { display: block; margin: 0 auto; }
.run-how { line-height: 1.6; font-size: .95rem; color: #4a3f6b; }
.btn.big { font-size: 1.15rem; padding: 12px 28px; }
.run-stats { display: flex; justify-content: center; gap: 18px; margin: 6px 0; }
.run-stats div { display: flex; flex-direction: column; }
.run-stats b { font: 900 1.5rem 'Nunito', sans-serif; color: #5b3fd6; }
.run-stats span { font-size: .8rem; color: #7a7290; }
.run-earned { background: #fff3c4; color: #8a6200; border-radius: 12px; padding: 8px 10px; font-weight: 700; }
.run-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.run-board { list-style: none; padding: 0; margin: 0; text-align: left; max-height: 180px; overflow-y: auto; }
.run-board li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 10px; }
.run-board li.me { background: #efe9ff; }
.run-board .rb-rank { width: 26px; text-align: center; font-weight: 800; }
.run-board .avatar-svg { width: 30px; height: 30px; }
.run-board .rb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runner-btn { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 700px) {
  .runner-box { padding: 0 !important; gap: 0; }
  .runner-box .squish-head { padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .run-stage { flex: 1; height: auto; border-radius: 0; }
  .runner-btn .sq-label { display: none; }
}
.run-maps { font-size: .85rem; color: #5b3fd6; background: #f3efff; border-radius: 12px; padding: 8px; }
.run-level { margin: 4px 0 8px; color: #4a3f6b; }
.run-tabs { justify-content: center; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.run-tabs .tab { font-size: .8rem; padding: 5px 10px; }
.run-board .rb-name small { display: block; font-size: .72rem; color: #7a7290; font-weight: 600; }
.run-board.mine li { border-bottom: 1px solid #f0ecfa; }
.get-android { display: block; width: fit-content; margin: 18px auto 0; background: #3ddc84; color: #073b1f; font-weight: 800; padding: 12px 22px; border-radius: 999px; text-decoration: none; }
.get-android.hidden { display: none; }

/* "Ava Kate's Designer App" line under the logo */
.logo-sub { font: 800 1.05rem 'Nunito', sans-serif; color: var(--pink); letter-spacing: .5px; margin-top: -2px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.brand .logo-sub { font-size: .78rem; margin: 2px 0 0 4px; }
.topbar.dark .brand .logo-sub { color: #ffb3d9; }
@media (max-width: 700px) {
  .logo-sub { font-size: .95rem; }
  .brand .logo-sub { font-size: .68rem; margin-left: 2px; }
}

/* ---------- online dots + notifications ---------- */
.av-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
#chatWithAvatar { position: relative; }
.online-dot { position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px; border-radius: 50%; background: #c9c3d8; border: 2.5px solid #fff; display: none; }
.online-dot.on { display: block; background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
.online-label { display: block; font-size: .75rem; font-weight: 700; color: #16a34a; }
.online-label:empty { display: none; }
.notify-btn { position: relative; }
.notify-btn.needs::after { content: ''; position: absolute; top: 5px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #ff4d8d; }
.notify-box { width: min(480px, 100%); }
.notify-status { background: #f3efff; border-radius: 14px; padding: 10px 12px; }
.notify-kinds { display: flex; flex-direction: column; gap: 8px; }
.notify-kind { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: #faf8ff; cursor: pointer; }
.notify-kind input { width: 20px; height: 20px; margin-top: 2px; accent-color: #7c5cff; }
.notify-kind small { display: block; color: #7a7290; font-size: .8rem; }
#toasts { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100vw - 24px)); }
.toast { text-align: left; border: 0; cursor: pointer; background: #2b1d55; color: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: toastIn .25s ease-out; transition: opacity .4s, transform .4s; font: inherit; }
.toast b { display: block; }
.toast span { font-size: .85rem; opacity: .85; }
.toast-online { background: #15803d; }
.toast-leaderboard { background: #b45309; }
.toast-trade { background: #7c3aed; }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) { #toasts { left: 12px; right: 12px; width: auto; } }

/* ---------- board games: Tic-Tac-Toe, Flip Side, Checkers, Chess, Color Code, What's the Word? ---------- */
.game-picker { max-height: min(70vh, 560px); overflow-y: auto; }
.game-legend { text-align: center; font-size: .85rem; color: var(--muted); margin: 6px 0 0; display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; }
.ttt-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: min(240px, 80%); margin: 0 auto; }
.ttt-cell { aspect-ratio: 1; border: 0; border-radius: 14px; background: #f3efff; font: 900 2.4rem 'Nunito', sans-serif; cursor: pointer; }
.ttt-cell:disabled { cursor: default; }
.ttt-cell:not(:disabled):hover { background: #e7e0ff; }
.ttt-cell.x { color: #ff4d6d; } .ttt-cell.o { color: #4d7cff; }
.ttt-cell.win { background: #fff3c4; }
.ttt-cell.last { box-shadow: inset 0 0 0 3px #d9cfff; }

.b8 { display: grid; grid-template-columns: repeat(8, 1fr); width: min(380px, 100%); aspect-ratio: 1; margin: 0 auto; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 14px rgba(40, 20, 90, .18); }
.b8-sq { position: relative; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer; min-width: 0; }
.b8-sq:disabled { cursor: default; }
.flip-board .b8-sq { background: #2f9e6a; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.25); }
.checkers-board .b8-sq.light { background: #f6e7cf; } .checkers-board .b8-sq.dark { background: #8c5a3c; }
.chess-board .b8-sq.light { background: #efe7ff; } .chess-board .b8-sq.dark { background: #9b86d6; }
.b8-sq.last { box-shadow: inset 0 0 0 100px rgba(255, 214, 64, .35); }
.chess-board .b8-sq.sel { box-shadow: inset 0 0 0 100px rgba(47, 211, 167, .45); }
.chess-board .b8-sq.check { box-shadow: inset 0 0 0 100px rgba(255, 77, 109, .55); }
.fdisc { width: 80%; height: 80%; border-radius: 50%; display: block; box-shadow: 0 2px 3px rgba(0,0,0,.35); transition: background .3s; }
.fdisc.dark { background: radial-gradient(circle at 35% 30%, #5b4a7a, #1d1430); }
.fdisc.light { background: radial-gradient(circle at 35% 30%, #fff, #d9d2ea); }
.fdisc.last { outline: 2px solid #ffd23f; outline-offset: 1px; }
.fdisc.mini, .ck.mini { width: 14px; height: 14px; display: inline-block; vertical-align: middle; }
.fhint { width: 26%; height: 26%; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.ck { width: 78%; height: 78%; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 3px 0 rgba(0,0,0,.35), inset 0 0 0 3px rgba(255,255,255,.35); }
.ck.red { background: #ff4d6d; } .ck.yellow { background: #ffd23f; }
.ck.king::after { content: '👑'; font-size: clamp(.7rem, 3vw, 1.1rem); font-style: normal; }
.ck.can { outline: 2px dashed rgba(255,255,255,.8); outline-offset: 1px; }
.ck.sel { outline: 3px solid #2fd3a7; outline-offset: 2px; }
.mvhint { width: 28%; height: 28%; border-radius: 50%; background: rgba(47, 211, 167, .85); position: absolute; }
.caphint { position: absolute; inset: 6%; border-radius: 50%; border: 4px solid rgba(47, 211, 167, .9); }
.cp { font-size: clamp(1.5rem, 7.2vw, 2.4rem); line-height: 1; font-family: 'Segoe UI Symbol', 'DejaVu Sans', 'Noto Sans Symbols 2', serif; }
.cp.w { color: #fff; text-shadow: 0 0 2px #2b2340, 0 0 1px #2b2340, 0 1px 0 #2b2340; }
.cp.b { color: #1d1430; }
.check-txt { color: #e11d48; }

.code-game h4 { margin: 0 0 6px; font-size: .95rem; }
.code-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.code-secret { display: flex; gap: 5px; align-items: center; background: #2b2340; padding: 6px 8px; border-radius: 12px; width: fit-content; margin-bottom: 8px; }
.code-secret .qmark { color: #fff; font-weight: 900; margin-left: 4px; }
.code-rows { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.code-row { display: flex; align-items: center; gap: 5px; background: #faf8ff; border-radius: 10px; padding: 4px 6px; }
.cnum { width: 18px; font-size: .75rem; color: var(--muted); font-weight: 800; }
.cpeg { width: 22px; height: 22px; border-radius: 50%; display: inline-block; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.cpeg.small { width: 18px; height: 18px; }
.cfb { display: grid; grid-template-columns: repeat(2, 9px); gap: 2px; margin-left: 6px; }
.fb { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #e3ddf2; }
.fb.ex { background: #1d1430; } .fb.nr { background: #fff; box-shadow: 0 0 0 1.5px #1d1430; }
.code-draft { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.code-slots, .code-palette { display: flex; gap: 6px; }
.cslot, .cpal { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.cslot { box-shadow: inset 0 0 0 2px #d9cfff; }
.cpal:hover { transform: scale(1.1); }

.word-rows { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.word-row { display: flex; gap: 4px; align-items: center; }
.word-row .who { width: 52px; font-size: .75rem; color: var(--muted); font-weight: 800; text-align: right; margin-right: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; font: 900 1.2rem 'Nunito', sans-serif; font-style: normal; color: #fff; }
.wt.g { background: #22c55e; } .wt.y { background: #eab308; } .wt.n { background: #9b94ad; }
.word-keys { display: flex; flex-direction: column; gap: 3px; align-items: center; margin: 8px 0; }
.word-keys > div { display: flex; gap: 3px; }
.wk { width: 24px; height: 28px; display: grid; place-items: center; border-radius: 5px; background: #efeaff; font-weight: 800; font-size: .8rem; }
.wk.g { background: #22c55e; color: #fff; } .wk.y { background: #eab308; color: #fff; } .wk.n { background: #c9c3d6; color: #fff; opacity: .6; }
.word-form { display: flex; gap: 8px; justify-content: center; }
.word-form input { width: 150px; text-transform: uppercase; letter-spacing: 3px; font-weight: 800; text-align: center; }
@media (max-width: 700px) {
  .code-cols { grid-template-columns: 1fr; }
  .wt { width: 34px; height: 34px; }
  .wk { width: 22px; }
}

/* ---------- Arcade + Hoppy Crossing ---------- */
.arcade-box { width: min(560px, 100%); }
.arcade-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.arcade-card { border: 0; border-radius: 22px; padding: 18px 14px; cursor: pointer; color: #fff; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; font: inherit; box-shadow: 0 6px 0 rgba(0,0,0,.18); transition: transform .12s; }
.arcade-card:hover { transform: translateY(-3px); }
.arcade-card.skydash { background: linear-gradient(160deg, #6fc0ff, #7c5cff); }
.arcade-card.hop { background: linear-gradient(160deg, #7ed46f, #2f9e6a); }
.arcade-card .ac-icon { font-size: 3rem; }
.arcade-card b { font: 800 1.15rem 'Baloo 2', 'Nunito', sans-serif; }
.arcade-card small { opacity: .9; }
.hop-stage { background: #7ed46f; }
.run-stage #hopCanvas { display: block; width: 100%; height: 100%; }
.hop-hero { font-size: 4rem; line-height: 1; }
@media (max-width: 700px) { .arcade-list { grid-template-columns: 1fr; } }

/* ---------- phone top bar: must never be wider than the screen ---------- */
.logout-btn { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 700px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  .topbar { gap: 6px; }
  .topbar .brand { min-width: 0; flex: 0 1 auto; }
  .me { gap: 4px; min-width: 0; flex: 0 0 auto; }
  .me-avatar .avatar-svg { width: 36px; height: 36px; }
  .topbar .btn { padding: 6px 8px; }
  .notify-btn, .runner-btn, .logout-btn { width: 36px; height: 36px; padding: 0 !important; justify-content: center; }
  .logout-btn .sq-label { display: none; }
  .squish-btn { padding: 6px 7px !important; gap: 4px; }
  .squish-btn .coin-pill { padding: 1px 7px; font-size: .78rem; }
}
/* very narrow phones, or phones with large text turned on */
@media (max-width: 400px) {
  .topbar .logo.small { font-size: 0; gap: 0; }
  .topbar .logo.small .logo-bubble { font-size: 1.15rem; }
  .topbar .logo.small .pill { font-size: .7rem; }
  .topbar .brand .logo-sub { font-size: .6rem; max-width: 84px; line-height: 1.15; margin-left: 0; }
}
@media (max-width: 340px) {
  .topbar .brand .logo-sub { display: none; }
  .me-avatar { display: none; }
}
@media (max-width: 700px) {
  /* keep room for messages when a game and a trade are both open */
  .game-panel { max-height: 50dvh; overflow-y: auto; }
  .trade-panel { max-height: 26dvh; overflow-y: auto; }
  body.chat-open #kid .chat { width: 100%; max-width: 100vw; }
}
@media (max-width: 700px) {
  /* message box + Send across the full width, sticker / camera / gallery underneath */
  .send-row { flex-wrap: wrap; align-items: center; row-gap: 6px; padding: 8px 8px 0; }
  .send-row #msgInput { order: 1; flex: 1 1 calc(100% - 96px); min-width: 0; }
  .send-row .btn.primary { order: 2; flex: 0 0 auto; }
  .send-row .btn.round { order: 3; width: 40px; height: 40px; }
  .send-row #stickerBtn { margin-left: 2px; }
}

/* Chat history: load older messages */
.older-row { list-style: none; align-self: center; margin: 2px 0 6px; }
.older-btn { font-size: .85rem; padding: 6px 14px; }
.older-note { font-size: .75rem; color: #8a84a8; text-align: center; display: block; }
.bubble .text.expired { font-style: italic; opacity: .75; }

/* Bible verse: left of the avatar on wide screens, full-width strip under the top bar otherwise */
.verse { display: flex; gap: 6px; align-items: flex-start; font-size: .8rem; line-height: 1.3; color: #5b4f8f; }
.verse-ic { flex: 0 0 auto; }
.verse-ref { color: var(--violet-d); white-space: nowrap; font-weight: 700; }
.verse-side { flex: 0 1 460px; min-width: 240px; margin-left: auto; margin-right: 4px;
              background: #f4f0ff; border-radius: 12px; padding: 6px 10px; }
.verse-side .verse-ref { display: block; }
.verse-strip { display: none; padding: 6px 14px; background: #f4f0ff; border-bottom: 1px solid var(--line); font-size: .78rem; }
@media (min-width: 781px) {
  /* the top bar / verse strip can grow to fit the whole verse; the chat area takes the rest of the screen */
  #kid:not(.hidden) { display: flex; flex-direction: column; height: 100vh; }
  #kid .kid-main { flex: 1 1 auto; min-height: 0; height: auto; }
}
@media (min-width: 1200px) {
  #kid .topbar { gap: 20px; }
  #kid .topbar .brand, #kid .me > :not(.verse-side) { flex-shrink: 0; }
  #kid .me { flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 1199px) {
  .verse-side { display: none; }
  .verse-strip { display: flex; }
}
@media (max-width: 900px) { body.chat-open .verse-strip { display: none; } }

/* ---------- Emoji Word Race ---------- */
.race { position: relative; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.race-intro { text-align: center; max-width: 420px; }
.race-demo { font-size: 1.3rem; margin: 4px 0 8px; } .race-demo span { font-size: 1.6rem; }
.race-score { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; align-items: center; width: 100%; max-width: 460px; }
.rs { display: flex; flex-direction: column; align-items: center; background: #f4f0ff; border-radius: 14px; padding: 4px 8px; line-height: 1.1; }
.rs b { font: 800 1.5rem 'Baloo 2', sans-serif; color: var(--violet-d); }
.rs.them b { color: #e05297; }
.rs small { font-size: .7rem; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-timer { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rt-num { font: 800 1.6rem 'Baloo 2', sans-serif; }
.rt-bar { display: block; width: 100%; height: 8px; border-radius: 99px; background: #ece7fb; overflow: hidden; }
.rt-bar > i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #22c55e, #7c5cff); transition: width .2s linear; }
.race.hurry .rt-num { color: #ef4444; animation: racepulse .5s infinite alternate; }
.race.hurry .rt-bar > i { background: #ef4444; }
.race-clue { display: flex; flex-direction: column; align-items: center; background: #fff; border-radius: 18px; padding: 8px 18px;
             box-shadow: 0 3px 10px rgba(80,50,160,.1); position: relative; min-width: 200px; }
.rc-num { position: absolute; left: 10px; top: 6px; font-size: .7rem; font-weight: 800; color: var(--muted); }
.rc-emoji { font-size: 2.4rem; letter-spacing: 4px; }
.race-clue small { color: var(--muted); font-size: .78rem; }
.race-slots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.rslot { width: 36px; height: 40px; border-radius: 9px; border: 2px dashed #c9bdf5; background: #fbfaff; font: 900 1.25rem 'Nunito', sans-serif; color: var(--violet-d); cursor: pointer; padding: 0; }
.rslot.filled { border-style: solid; border-color: var(--violet); background: #efe9ff; }
.race-slots.shake { animation: shake .4s; } .race-slots.shake .rslot { border-color: #ef4444; background: #ffe4e4; }
.race-tiles { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 380px; }
.rtile { width: 42px; height: 44px; border-radius: 10px; border: 0; background: var(--violet); color: #fff; font: 900 1.3rem 'Nunito', sans-serif;
         box-shadow: 0 3px 0 #5a3fd6; cursor: pointer; transition: transform .08s; padding: 0; }
.rtile:active { transform: translateY(2px); box-shadow: 0 1px 0 #5a3fd6; }
.rtile:disabled { opacity: .2; box-shadow: none; cursor: default; }
.race-tools { display: flex; gap: 6px; }
.race-go { position: absolute; inset: 0; display: grid; place-items: center; font: 800 4rem 'Baloo 2', sans-serif; color: var(--violet);
           background: rgba(255,255,255,.85); border-radius: 16px; z-index: 2; }
.race-done { font-weight: 800; }
.race-review { list-style: none; padding: 0; margin: 0; width: 100%; max-width: 460px; display: grid; gap: 4px; }
.race-review li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: #f7f4ff; border-radius: 10px; padding: 4px 10px; font-size: .85rem; }
.rv-clue { font-size: 1.1rem; } .rv-who { font-size: .72rem; color: var(--muted); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes racepulse { to { transform: scale(1.12); } }
@media (max-width: 700px) {
  .rc-emoji { font-size: 2rem; }
  .rtile { width: 38px; height: 40px; font-size: 1.15rem; }
  .rslot { width: 30px; height: 36px; font-size: 1.1rem; }
}
/* While a race runs it gets the room it needs; the trade box waits until the race is over. */
.game-panel[data-kind="wordrace"][data-status="active"], .game-panel[data-kind="dots"]:not(.hidden) { flex-shrink: 0; max-height: none !important; overflow: visible; }
.chat-pane:has(.game-panel[data-kind="wordrace"][data-status="active"]) .trade-panel,
.chat-pane:has(.game-panel[data-kind="dots"][data-status="active"]) .trade-panel { display: none !important; }
@media (max-width: 700px) {
  .game-panel[data-kind="wordrace"][data-status="active"] .game-head { margin-bottom: 2px; }
  .race { gap: 7px; }
  .race-score .rt-num { font-size: 1.3rem; }
  .rs b { font-size: 1.2rem; }
}

/* ---------- Dots and Boxes ---------- */
.dots-game { display: flex; flex-direction: column; align-items: center; gap: 8px; --p1: #7c5cff; --p2: #ff5fa2; }
.dots-score { display: flex; gap: 14px; font-weight: 800; }
.ds { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 99px; background: #fff; }
.ds:last-child { padding: 3px 4px 3px 10px; }
.ds b { font: 800 1.3rem 'Baloo 2', sans-serif; }
.ds.p1 b { color: var(--p1); } .ds.p2 b { color: var(--p2); }
.ds .avatar-svg { width: 28px; height: 28px; }
.dots-board { width: min(330px, 86vw); aspect-ratio: 1; padding: 16px; background: #fff; border-radius: 18px; box-shadow: 0 3px 12px rgba(80,50,160,.1); box-sizing: border-box; }
.dots-inner { position: relative; width: 100%; height: 100%; }
.ddot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #2b2350; z-index: 3; pointer-events: none; }
.dbox { position: absolute; display: grid; place-items: center; animation: dboxin .3s ease-out; }
.dbox.p1 { background: color-mix(in srgb, var(--p1) 22%, transparent); }
.dbox.p2 { background: color-mix(in srgb, var(--p2) 22%, transparent); }
.dbox .avatar-svg { width: 62%; height: 62%; }
.dline { position: absolute; padding: 0; border: 0; background: none; z-index: 2; cursor: pointer; }
.dline.h { height: 22px; margin-top: -11px; }
.dline.v { width: 22px; margin-left: -11px; }
.dline i { position: absolute; border-radius: 4px; background: transparent; transition: background .15s; }
.dline.h i { left: 6px; right: 6px; top: 8px; height: 6px; }
.dline.v i { top: 6px; bottom: 6px; left: 8px; width: 6px; }
.dots-board.playable .dline:not([disabled]):hover i { background: #d9d0fb; }
.dline[disabled] { cursor: default; }
.dline.drawn i { background: var(--p1); }
.dline.drawn.p2 i { background: var(--p2); }
.dline.last i { box-shadow: 0 0 0 3px #ffe58a; }
@keyframes dboxin { from { transform: scale(.4); opacity: 0; } }
@media (max-width: 700px) { .dots-board { padding: 12px; } }

/* ---------- Squishy Lab (mix and match) ---------- */
.lab { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.lab-preview { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; background: linear-gradient(160deg, #fff0f8, #eef6ff);
               border-radius: 20px; padding: 14px; text-align: center; }
.lab-stage { width: 180px; height: 180px; display: grid; place-items: center; background: radial-gradient(circle, #fff 55%, transparent 70%); border-radius: 50%; }
.lab-stage .squishy-svg { animation: labbounce 2.4s ease-in-out infinite; }
.lab-name { width: 100%; text-align: center; font: 800 1.05rem 'Baloo 2', sans-serif; border: 2px solid #e6dcff; border-radius: 12px; padding: 6px 10px; }
.lab-buy { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.lab-preview .hint { font-size: .75rem; margin: 0; }
.lab-parts { display: flex; flex-direction: column; gap: 12px; }
.lab-group h4 { margin: 0 0 6px; font-size: .85rem; }
.lab-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-opt { display: flex; flex-direction: column; align-items: center; width: 64px; padding: 4px 2px 3px; border: 2px solid transparent; border-radius: 12px; background: #f7f4ff; cursor: pointer; }
.lab-opt small { font-size: .62rem; font-weight: 700; color: var(--muted); }
.lab-opt.on { border-color: var(--violet); background: #efe9ff; }
.lab-opt:hover { background: #efe9ff; }
.lab-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #e6dcff; cursor: pointer; padding: 0; }
.lab-sw.on { outline: 3px solid var(--violet); outline-offset: 2px; }
.lab-pick { display: grid; place-items: center; font-size: .85rem; background: #fff; position: relative; overflow: hidden; }
.lab-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
@keyframes labbounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 45% { transform: translateY(-6px) scale(.97, 1.03); } 55% { transform: translateY(0) scale(1.05, .95); } }
@media (max-width: 700px) {
  .lab { grid-template-columns: 1fr; }
  .lab-preview { position: static; }
  .lab-opt { width: 56px; }
}

/* ---------- Squishy Closet ---------- */
.squish-tabs { max-width: 100% !important; overflow-x: auto; scrollbar-width: none; }
.squish-tabs .tab { white-space: nowrap; flex: 0 0 auto; }
.closet { display: flex; flex-direction: column; gap: 12px; }
.cl-row, .show-picks { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.cl-pick { flex: 0 0 auto; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 14px; border: 2px solid transparent; background: #f7f4ff; cursor: pointer; padding: 0; }
.cl-pick.on { border-color: var(--violet); background: #efe9ff; }
.cl-main { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.cl-stage { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; border-radius: 22px; padding: 18px 10px 14px;
            background: radial-gradient(ellipse at 50% 85%, #fff 30%, transparent 60%), linear-gradient(170deg, #ffe3f1, #e6eaff); }
.cl-mirror { width: 200px; height: 200px; display: grid; place-items: center; }
.cl-mirror .squishy-svg { animation: labbounce 2.6s ease-in-out infinite; }
.cl-name { font: 800 1.1rem 'Baloo 2', sans-serif; }
.cl-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cl-slots { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; }
.cl-slots .tab { white-space: nowrap; flex: 0 0 auto; font-size: .82rem; padding: 6px 10px; }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.cl-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 14px; border: 2px solid transparent; background: #f7f4ff; cursor: pointer; }
.cl-item .squishy-svg { overflow: visible; }
.cl-item small { font-size: .7rem; font-weight: 800; text-align: center; line-height: 1.1; }
.cl-item.on { border-color: var(--violet); background: #efe9ff; }
.cl-item.locked { opacity: .8; }
.cl-price { font-size: .68rem; font-weight: 800; color: var(--violet-d); }
.cl-item.locked .cl-price { color: #b7791f; }

/* ---------- Fashion Show ---------- */
.show { display: flex; flex-direction: column; gap: 12px; }
.show-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; color: #fff;
             background: linear-gradient(120deg, #7c5cff, #ff5fa2); }
.show-head h3 { margin: 0; font: 800 1.5rem 'Baloo 2', sans-serif; }
.show-head small { opacity: .85; font-size: .75rem; }
.show-clock { text-align: right; } .show-clock b { display: block; font-size: 1.05rem; }
.show-cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; align-items: start; }
.show h4 { margin: 0 0 6px; } .show h4 small { color: var(--muted); font-weight: 700; }
.show-enter { display: flex; flex-direction: column; gap: 8px; }
.show-card { display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 18px; background: linear-gradient(170deg, #fff3fa, #eef0ff); }
.show-card .squishy-svg { overflow: visible; }
.big-runway { width: 100%; padding: 12px; font-size: 1rem; margin-bottom: 8px; }
.show-rank { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; counter-reset: r; }
.show-rank li { display: grid; grid-template-columns: 22px 48px 1fr auto; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 12px; background: #f7f4ff; counter-increment: r; }
.show-rank li::before { content: counter(r); font-weight: 800; color: var(--muted); text-align: center; }
.show-rank li.me { background: #efe9ff; }
.show-rank .who { display: flex; flex-direction: column; line-height: 1.15; } .show-rank .who small { color: var(--muted); font-size: .72rem; }
.show-rank .hs { font-weight: 800; }
.show-podium { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.pod { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 8px; border-radius: 14px; background: #fff8e1; }
.pod.p1 { background: #ffefb0; } .pod b { font-size: .78rem; } .pod small { font-size: .7rem; color: var(--muted); }
.pod .crown { position: absolute; top: -12px; font-size: 1.2rem; }

/* Runway overlay */
.runway { position: fixed; inset: 0; z-index: 3000; overflow: hidden; color: #fff; display: flex; flex-direction: column; align-items: center;
          background: radial-gradient(ellipse at 50% 0%, #4b2a8a 0%, #1d1240 55%, #0d0820 100%); }
.rw-floor { position: absolute; left: 50%; bottom: 0; width: 70vmin; height: 70vh; transform: translateX(-50%); clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
            background: repeating-linear-gradient(180deg, #ff8fc8 0 6px, #ff6fb0 6px 40px); opacity: .9; }
.rw-lights i { position: absolute; top: -10vh; width: 30vmin; height: 90vh; background: linear-gradient(#fff8, #fff0); clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%); animation: sweep 4s ease-in-out infinite alternate; }
.rw-lights i:nth-child(1) { left: 5%; transform-origin: top; } .rw-lights i:nth-child(2) { left: 40%; animation-delay: -1.5s; } .rw-lights i:nth-child(3) { right: 5%; animation-delay: -3s; }
@keyframes sweep { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
.rw-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 14px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff3; color: #fff; font-size: 1.1rem; cursor: pointer; }
.rw-theme { position: relative; z-index: 2; margin-top: max(18px, env(safe-area-inset-top)); font: 800 1.4rem 'Baloo 2', sans-serif; text-shadow: 0 2px 10px #0008; }
.rw-model { position: relative; z-index: 2; flex: 1; width: 100%; display: flex; justify-content: center; align-items: flex-end; min-height: 0; }
.rw-walk { animation: catwalk 1.5s cubic-bezier(.3,.7,.4,1) both; transform-origin: bottom center; filter: drop-shadow(0 10px 18px #0008); }
.rw-walk .squishy-svg { overflow: visible; width: min(220px, 50vw); height: auto; animation: strut .5s ease-in-out 1.5s infinite alternate; }
@keyframes catwalk { 0% { transform: translateY(-42vh) scale(.25); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(0) scale(1); } }
@keyframes strut { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(4deg) translateY(-6px); } }
.rw-tag { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; margin: 8px 0 4px; padding: 6px 18px; border-radius: 99px; background: #0006; }
.rw-tag b { font: 800 1.2rem 'Baloo 2', sans-serif; } .rw-tag small { opacity: .8; }
.rw-vote { position: relative; z-index: 2; min-height: 96px; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: max(18px, env(safe-area-inset-bottom)); }
.rw-hearts { display: flex; gap: 6px; }
.rw-hearts button { font-size: 2.1rem; background: none; border: 0; cursor: pointer; filter: grayscale(1) brightness(1.6); opacity: .6; transition: transform .12s, filter .12s; padding: 2px; }
.rw-hearts button.on, .rw-hearts button.hover { filter: none; opacity: 1; transform: scale(1.15); }
.rw-vote .btn.ghost { color: #fff; border-color: #fff6; }
.rw-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.rw-confetti i { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; animation: fall 2.2s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); } }

@media (max-width: 700px) {
  .cl-main, .show-cols { grid-template-columns: 1fr; }
  .cl-stage { position: static; }
  .cl-mirror { width: 160px; height: 160px; } .cl-mirror .squishy-svg { width: 150px; height: 150px; }
  .show-head h3 { font-size: 1.2rem; }
}
.cl-main > *, .show-cols > *, .closet, .show { min-width: 0; }
.cl-filters { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 8px; }
.cl-filters .chip { border: 1.5px solid #e6dcff; background: #fff; border-radius: 99px; padding: 3px 10px; font-size: .74rem; font-weight: 700; cursor: pointer; }
.cl-filters .chip.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.cl-mine { margin-left: auto; font-size: .78rem; font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.cl-mirror { position: relative; }
.spa-step { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); background: #fff; border-radius: 99px; padding: 3px 10px; font-size: .78rem; font-weight: 800; box-shadow: 0 2px 8px #0002; white-space: nowrap; }

/* ---------- Earn coins ---------- */
.earn-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: #ef4444; color: #fff; font: 800 .68rem 'Nunito', sans-serif; font-style: normal; margin-left: 3px; }
#squishBtn { position: relative; }
#squishBtn.has-earn::after { content: ''; position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
.earn { display: flex; flex-direction: column; gap: 12px; }
.earn-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.earn-card { background: #fbfaff; border: 2px solid #efe9ff; border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.earn-card h4 { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.earn-card h4 small { color: var(--muted); font-weight: 700; font-size: .78rem; }
.earn-card .hint { margin: 0; font-size: .75rem; }
.streak { background: linear-gradient(160deg, #fff4e0, #ffe9f3); border-color: #ffe0b8; }
.streak-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.sd { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 12px; background: #fff; border: 2px solid transparent; }
.sd small { font-size: .62rem; font-weight: 800; color: var(--muted); } .sd b { font-size: 1.1rem; } .sd span { font-size: .72rem; font-weight: 800; }
.sd.got { background: #e8fbe9; } .sd.now { border-color: #ff9f43; animation: racepulse .7s infinite alternate; }
.spin { align-items: center; background: linear-gradient(160deg, #eef6ff, #f3eaff); border-color: #dde6ff; }
.wheel { position: relative; width: 190px; height: 190px; }
.wheel-rot { width: 100%; height: 100%; }
.wheel-svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 10px #7c5cff33); }
.wheel-pin { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 22px solid #2b2340; }
.quests { display: flex; flex-direction: column; gap: 6px; }
.quest { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; background: #fff; border-radius: 14px; padding: 8px 10px; border: 2px solid transparent; }
.quest.ready { border-color: #4ade80; background: #f0fff4; } .quest.claimed { opacity: .6; }
.quest.bonus { background: #fff8e1; }
.q-icon { font-size: 1.5rem; text-align: center; }
.q-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .q-main small { font-size: .7rem; color: var(--muted); }
.q-bar { height: 7px; border-radius: 99px; background: #ece7fb; overflow: hidden; } .q-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7c5cff, #ff5fa2); border-radius: 99px; }
.q-done { font-size: 1.3rem; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ach { display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center; background: #fff; border-radius: 14px; padding: 10px 8px; border: 2px solid transparent; }
.ach .a-icon { font-size: 1.6rem; filter: grayscale(.8); opacity: .7; }
.ach.ready, .ach.claimed { } .ach.ready { border-color: #4ade80; background: #f0fff4; } .ach.ready .a-icon, .ach.claimed .a-icon { filter: none; opacity: 1; }
.ach b { font-size: .85rem; } .ach small { font-size: .7rem; color: var(--muted); line-height: 1.2; } .ach .q-bar { width: 100%; }
.ach .btn { font-size: .72rem; padding: 4px 8px; } .a-got { font-size: .75rem; font-weight: 800; color: #16a34a; }
.earn-card.more ul { margin: 0; padding-left: 18px; font-size: .82rem; display: grid; gap: 3px; }
@media (max-width: 700px) {
  .earn-top { grid-template-columns: 1fr; }
  .streak-days { gap: 3px; } .sd { padding: 4px 1px; }
}
/* Squishy window tabs: wrap onto more rows instead of running off the edge. */
.squish-tabs { flex-wrap: wrap; overflow: visible !important; border-radius: 22px; justify-content: flex-start; }
.squish-tabs .tab { flex: 1 0 auto; padding: 6px 12px; font-size: .92rem; }
@media (max-width: 700px) { .squish-tabs .tab { font-size: .82rem; padding: 6px 9px; } }
/* Market button sits left of the coins; its tab in the row stays hidden (it still drives the page). */
.squish-tabs [data-tab="market"] { display: none !important; }
.squish-head { gap: 8px; }
.squish-head h2 { margin-right: auto; }
.market-head { background: #fff; border: 2px solid #e6dcff; color: var(--violet-d); font-weight: 800; }
.market-head.on { background: var(--violet); border-color: var(--violet); color: #fff; }

/* ---------- Fashion Challenge ---------- */
.chal-zone { display: flex; flex-direction: column; gap: 8px; }
.chal-start { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 16px; background: linear-gradient(120deg, #fff4d6, #ffe3f1); border: 2px solid #ffd9a0; }
.chal-start div { display: flex; flex-direction: column; } .chal-start small { color: var(--muted); font-size: .75rem; }
.chal-card { border-radius: 16px; padding: 10px 12px; background: #fff; border: 2px solid #efe9ff; display: flex; flex-direction: column; gap: 8px; }
.chal-card.ph-joining { border-color: #ffb347; background: #fffaf0; } .chal-card.ph-voting { border-color: #ff5fa2; background: #fff3fa; }
.chal-card.ph-done { border-color: #f5c542; } .chal-card.ph-cancelled { opacity: .7; }
.ch-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.ch-theme { font: 800 1.05rem 'Baloo 2', sans-serif; } .ch-host { color: var(--muted); font-size: .78rem; } .ch-phase { margin-left: auto; font-size: .85rem; }
.ch-entries { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.ch-entry { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; padding: 4px 6px; border-radius: 12px; background: #f7f4ff; }
.ch-entry.mine { background: #efe9ff; } .ch-entry small { font-size: .68rem; font-weight: 700; } .ch-entry b { font-size: .75rem; }
.ch-entry .squishy-svg { overflow: visible; }
.ch-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.chal-card .hint { margin: 0; font-size: .78rem; }
.chal-banner { position: fixed; z-index: 2500; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%); width: min(460px, calc(100vw - 20px));
               display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 40px 12px 14px; border-radius: 18px; color: #fff;
               background: linear-gradient(120deg, #7c5cff, #ff5fa2); box-shadow: 0 10px 30px #7c5cff55; animation: cbIn .35s ease-out; }
.chal-banner .cb-text { flex: 1 1 220px; font-size: .92rem; } .chal-banner small { opacity: .9; }
.chal-banner .cb-btns { display: flex; gap: 6px; } .chal-banner .btn.ghost { color: #fff; border-color: #fff8; } .chal-banner .btn.primary { background: #fff; color: var(--violet-d); }
.chal-banner .cb-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: #fff; font-size: 1rem; cursor: pointer; }
@keyframes cbIn { from { transform: translate(-50%, -30px); opacity: 0; } }
@media (max-width: 700px) { .chal-start { flex-direction: column; align-items: stretch; } }
