/* css/space.css — the Space tab (js/space/space-view.js) */
.space-main { padding: 0 12px 24px; }
/* inside a game: the navbar floats over the game (like Motion), the game reaches the top of the screen under it */
body.rxa-game .navbar { position: fixed; left: 0; right: 0; top: 0; }
body.rxa-game #rxUpsell { display: none !important; }
body.rxa-game .space-main { padding: 0; }
.space-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.space-wrap h1, .space-wrap h2, .space-wrap h3, .space-wrap h4 { margin: 0; color: var(--text-primary); }
.space-wrap h3 { font-size: 1rem; margin-bottom: 8px; }
.sp-muted { color: var(--text-secondary); font-size: 0.85rem; margin: 4px 0; }
.sp-center { text-align: center; }
.sp-mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; word-break: break-all; }
.sp-card { background: var(--card-bg); border: 1px solid var(--border-light); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-sm); }
.sp-row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* hero */
.sp-hero { margin-top: 6px; padding: 20px 18px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #00796b 0%, #009688 55%, #26a69a 100%); box-shadow: 0 10px 28px rgba(0, 121, 107, 0.28); display: flex; flex-direction: column; gap: 12px; }
.sp-hero h1 { color: #fff; font-size: 1.7rem; letter-spacing: -0.02em; }
.sp-hero p { margin: 4px 0 0; opacity: 0.92; font-size: 0.92rem; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-chip { background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px; padding: 5px 11px; font-size: 0.8rem; font-weight: 600; }

/* daily case banner */
.sp-daily { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--text-primary);
  background: var(--card-bg); border: 1.5px solid var(--accent); border-radius: 18px; padding: 16px 14px; box-shadow: 0 6px 20px rgba(0, 150, 136, 0.15); }
.sp-daily-badge { position: absolute; top: -9px; left: 14px; background: var(--accent); color: #fff; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 999px; }
.sp-daily-emoji { font-size: 2rem; }
.sp-daily-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sp-daily-text span { color: var(--text-secondary); font-size: 0.82rem; }
.sp-arrow { font-size: 1.6rem; color: var(--accent); }

/* games grid */
.sp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sp-game { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; cursor: pointer; font: inherit; color: var(--text-primary);
  background: var(--card-bg); border: 1px solid var(--border-light); border-radius: 18px; padding: 14px 12px; box-shadow: var(--shadow-sm); transition: transform 0.15s ease, border-color 0.15s ease; }
.sp-game:hover { transform: translateY(-2px); border-color: var(--accent); }
.sp-game-emoji { font-size: 1.7rem; }
.sp-game strong { font-size: 0.95rem; line-height: 1.25; }
.sp-game-desc { color: var(--text-secondary); font-size: 0.76rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sp-tag { margin-top: auto; padding-top: 4px; font-size: 0.7rem; font-weight: 700; color: var(--accent); }
.sp-soon h3 { color: var(--text-secondary); }
.sp-soon-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-soon-list span { font-size: 0.78rem; padding: 5px 10px; border-radius: 999px; border: 1px dashed var(--border-light); color: var(--text-secondary); }

/* screens */
.sp-head { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; }
.sp-head h2 { font-size: 1.2rem; }
.sp-back { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-light); background: var(--card-bg); color: var(--text-primary); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.sp-btn { font: inherit; font-weight: 600; font-size: 0.9rem; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border-light); background: var(--card-bg); color: var(--text-primary); cursor: pointer; }
.sp-btn.sp-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(0, 150, 136, 0.28); }
.sp-btn:disabled { opacity: 0.5; cursor: default; }
.sp-wide { width: 100%; margin-top: 10px; }
.sp-link { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.sp-big-emoji { font-size: 2.6rem; }
.sp-score { font-size: 2.8rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.sp-score small { font-size: 1.1rem; color: var(--text-secondary); font-weight: 600; }
.sp-q { font-size: 1.02rem; font-weight: 600; line-height: 1.45; margin: 10px 0 12px; color: var(--text-primary); }
.sp-case { line-height: 1.6; color: var(--text-primary); }
.sp-options { display: grid; gap: 8px; }
.sp-opt { text-align: left; font: inherit; font-size: 0.9rem; line-height: 1.35; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--border-light); background: var(--surface, var(--card-bg)); color: var(--text-primary); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.sp-opt:hover:not(:disabled) { border-color: var(--accent); }
.sp-opt.right { border-color: #10b981; background: rgba(16, 185, 129, 0.14); }
.sp-opt.wrong { border-color: #ef4444; background: rgba(239, 68, 68, 0.12); }
.sp-opt.picked { border-color: var(--accent); background: rgba(0, 150, 136, 0.12); }
.sp-opt:disabled { cursor: default; }
.sp-explain { margin-top: 12px; padding: 12px; border-radius: 12px; background: rgba(0, 150, 136, 0.08); font-size: 0.86rem; line-height: 1.5; color: var(--text-primary); }
.sp-timer { height: 6px; border-radius: 6px; background: var(--border-light); overflow: hidden; }
.sp-timer > div { height: 100%; width: 100%; background: linear-gradient(90deg, #f59e0b, var(--accent)); transition: width 0.2s linear; }
.sp-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.85rem; }
.sp-table th, .sp-table td { padding: 6px; border-bottom: 1px solid var(--border-light); text-align: left; color: var(--text-primary); }

/* goniometer */
.sp-joint { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.sp-figure { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; }
.sp-limb { stroke: #b07f55; stroke-linecap: round; }
.sp-limb.body { stroke: #ecdac9; }
.sp-limb-fill { fill: #b07f55; } .sp-limb-fill.body { fill: #ecdac9; }
[data-theme="dark"] .sp-limb { stroke: #c09068; } [data-theme="dark"] .sp-limb.body { stroke: #4a3d32; }
[data-theme="dark"] .sp-limb-fill { fill: #c09068; } [data-theme="dark"] .sp-limb-fill.body { fill: #4a3d32; }
.sp-ground { stroke: var(--border-light); stroke-width: 2; }
.sp-pivot { fill: var(--text-primary); opacity: 0.55; }
.sp-zero-arm { stroke: var(--text-secondary); stroke-width: 3; stroke-dasharray: 6 5; }
.sp-true-arm { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.sp-guess-arm { stroke: #f59e0b; stroke-width: 3; stroke-dasharray: 2 4; stroke-linecap: round; }
.sp-arc { fill: none; stroke: var(--accent); stroke-width: 3; }
.sp-arc-label { fill: var(--accent); font-weight: 800; font-size: 16px; text-anchor: middle; }
.sp-guess { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; }
.sp-guess output { min-width: 90px; font-size: 2rem; font-weight: 800; color: var(--text-primary); text-align: center; }
.sp-step { width: 44px; height: 38px; border-radius: 12px; border: 1px solid var(--border-light); background: var(--card-bg); color: var(--text-primary); font: inherit; font-weight: 700; cursor: pointer; }
.sp-range { width: 100%; accent-color: var(--accent); margin-top: 8px; }
.sp-verdict { margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 0.9rem; }
.sp-verdict.good { background: rgba(16, 185, 129, 0.14); } .sp-verdict.ok { background: rgba(245, 158, 11, 0.16); } .sp-verdict.bad { background: rgba(239, 68, 68, 0.12); }
.sp-verdict strong { margin-right: 6px; }

/* boards, rooms, duels */
.sp-board { list-style: none; margin: 0; padding: 0; }
.sp-board li { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--border-light); font-size: 0.9rem; color: var(--text-primary); }
.sp-board li.me { background: rgba(0, 150, 136, 0.1); border-radius: 10px; font-weight: 700; }
.sp-rank { width: 28px; text-align: center; font-weight: 700; }
.sp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-xp { font-weight: 700; color: var(--accent); white-space: nowrap; }
.sp-tier { font-size: 0.68rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.sp-tier-bronze { background: #f4e2d3; color: #8a4b1f; } .sp-tier-silver { background: #e8edf2; color: #475569; }
.sp-tier-gold { background: #fdf0c2; color: #8a6200; } .sp-tier-diamond { background: #dbf4ff; color: #0369a1; }
.sp-chip.sp-tier-bronze, .sp-chip.sp-tier-silver, .sp-chip.sp-tier-gold, .sp-chip.sp-tier-diamond { border: 0; }
.sp-tabs { display: flex; gap: 6px; }
.sp-tab { flex: 1; font: inherit; font-weight: 600; font-size: 0.85rem; padding: 9px; border-radius: 999px; border: 1px solid var(--border-light); background: var(--card-bg); color: var(--text-secondary); cursor: pointer; }
.sp-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sp-join { display: flex; gap: 8px; }
.sp-join input { flex: 1; min-width: 0; font: inherit; font-size: 1.2rem; font-weight: 800; letter-spacing: 0.25em; text-transform: uppercase; text-align: center; padding: 10px; border-radius: 14px; border: 1.5px solid var(--border-light); background: var(--surface, var(--card-bg)); color: var(--text-primary); }
.sp-code { font-size: 2.6rem; font-weight: 900; letter-spacing: 0.22em; color: var(--accent); margin: 6px 0; }
.sp-players { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-players span { padding: 6px 12px; border-radius: 999px; background: rgba(0, 150, 136, 0.1); font-size: 0.85rem; color: var(--text-primary); }
.sp-podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.sp-pod { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px; border-radius: 14px; background: rgba(0, 150, 136, 0.08); min-width: 86px; }
.sp-pod span { font-size: 1.6rem; } .sp-pod.p1 { order: 2; padding-bottom: 22px; } .sp-pod.p2 { order: 1; } .sp-pod.p3 { order: 3; }
.sp-pod strong { font-size: 0.85rem; color: var(--text-primary); max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-duels { list-style: none; margin: 0; padding: 0; }
.sp-duels li { display: flex; justify-content: space-between; gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--border-light); cursor: pointer; color: var(--text-primary); }
.sp-vs { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0 12px; }
.sp-vs > div { display: flex; flex-direction: column; align-items: center; }
.sp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sp-two ul { padding-left: 18px; margin: 6px 0; font-size: 0.86rem; color: var(--text-primary); }
/* a game invitation while the app is open */
.rx-invite-banner { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 84px); transform: translateX(-50%); z-index: 3000; width: min(440px, calc(100% - 24px)); box-sizing: border-box;
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 18px; background: var(--card-bg, #fff); color: var(--text-primary);
  border: 1px solid var(--border-light); box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: rxInviteIn 0.35s cubic-bezier(.2, 1.3, .4, 1); }
.rx-invite-banner .emo { font-size: 1.8rem; }
.rx-invite-banner div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rx-invite-banner div span { font-size: 0.8rem; color: var(--text-secondary); }
.rx-invite-banner .join { border: none; border-radius: 12px; padding: 9px 16px; font-weight: 800; color: #fff; background: var(--accent); cursor: pointer; }
.rx-invite-banner .no { border: none; background: transparent; color: var(--text-secondary); font-size: 1rem; cursor: pointer; padding: 6px; }
@keyframes rxInviteIn { from { transform: translate(-50%, -20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.sp-answer-box { position: relative; }
.sp-mic { position: absolute; right: 10px; bottom: 16px; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 1rem; box-shadow: 0 4px 12px rgba(0, 150, 136, 0.3); transition: transform .15s; }
.sp-mic:hover { transform: scale(1.06); }
.sp-mic.recording { background: #e11d48; animation: spMicPulse 1.2s ease-in-out infinite; }
@keyframes spMicPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.45); } 50% { box-shadow: 0 0 0 10px rgba(225, 29, 72, 0); } }
#spAnswer { width: 100%; box-sizing: border-box; font: inherit; font-size: 0.95rem; line-height: 1.5; padding: 12px 12px 56px;border-radius: 14px; border: 1.5px solid var(--border-light); background: var(--surface, var(--card-bg)); color: var(--text-primary); resize: vertical; margin: 6px 0; }
.space-wrap details { margin: 12px 0; } .space-wrap summary { cursor: pointer; font-weight: 600; color: var(--accent); }
@media (max-width: 480px) { .sp-two { grid-template-columns: 1fr; } .sp-code { font-size: 2.1rem; } }

/* ---------- (2026-11-09) the colourful 3D hub (the cards themselves: js/space/arcade/arcade.css .rxa-hub-card) ---------- */
.sp-hub { margin: 4px 0 18px; }
/* (2026-11-09) the hub has no panel of its own: the app's background shows through; text uses the app's theme colours */
.rxa.sp-hub { background: transparent; box-shadow: none; padding: 4px 2px 18px; border-radius: 0; overflow: visible; --ink: var(--text-primary); --ink-2: var(--text-secondary); }
.rxa.sp-hub::before { display: none; }
.rxa-nocm .rxa.sp-hub { background: transparent; }
.sp-hub-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 6px 2px 14px; }
.sp-hub .sp-chip { background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--glass-border, var(--border-light)); }
.sp-hub .sp-hub-h { font-family: 'Rehablix Brand', system-ui, sans-serif; font-size: 1.05rem; font-weight: 800; margin: 22px 2px 10px; color: var(--text-primary) !important; }
.sp-daily-3d {
  position: relative; width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px; border: 0; border-radius: 22px; cursor: pointer; text-align: left; color: #fff; font: inherit;
  background: linear-gradient(135deg, #f43f5e 0%, #d946ef 50%, #6366f1 100%);
  box-shadow: 0 8px 0 #4c1d95, 0 18px 34px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.12s;
}
.sp-daily-3d:active { transform: translateY(5px); box-shadow: 0 3px 0 #4c1d95, 0 8px 16px rgba(0, 0, 0, 0.3); }
.sp-daily-3d .emo { font-size: 2.6rem; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35)); animation: rxa-bob 3s ease-in-out infinite; }
.sp-daily-3d .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sp-daily-3d .txt b { font-family: 'Rehablix Brand', system-ui, sans-serif; font-size: 1.15rem; }
.sp-daily-3d .txt span { font-size: 0.82rem; opacity: 0.92; }
.sp-daily-3d .sp-daily-badge { position: absolute; top: -9px; left: 16px; padding: 2px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.08em; background: #fbbf24; color: #3b2405; }
.sp-daily-3d .sp-arrow { font-size: 1.6rem; opacity: 0.9; }
.sp-hub-league { margin-top: 20px; padding: 14px 16px; }
.sp-hub .sp-hub-league.rxa-glass { background: var(--card-bg); border: 1px solid var(--glass-border, var(--border-light)); box-shadow: var(--shadow-sm); }
.sp-hub-league h3 { color: var(--text-primary); }
.sp-hub-league .sp-link { color: var(--accent); }
.sp-hub .sp-board li { color: var(--text-primary); }
