.mr { margin: 8px 0 28px; }
.mr-stage { container-type: size; position: relative; width: 100%; aspect-ratio: 16 / 10; max-height: 78vh; border-radius: 22px; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #6d7bff 0%, #3b2f9e 45%, #1c1646 100%); box-shadow: 0 18px 44px rgba(40, 30, 120, .3); isolation: isolate; }
.mr-stage:fullscreen { max-height: none; border-radius: 0; aspect-ratio: auto; }
.mr-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mr-nogl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: #fff; }
.mr-time { position: absolute; left: 14px; top: 12px; font: 800 20px/1 system-ui, sans-serif; color: #fff; background: rgba(15, 12, 50, .55); padding: 8px 12px; border-radius: 12px; font-variant-numeric: tabular-nums; }
.mr-board { position: absolute; right: 12px; top: 12px; margin: 0; padding: 8px; list-style: none; background: rgba(15, 12, 50, .55); border-radius: 14px; color: #fff; min-width: 90px; backdrop-filter: blur(4px); }
.mr-board li { display: flex; align-items: center; gap: 7px; padding: 3px 4px; font: 600 13px/1.2 system-ui, sans-serif; }
.mr-board li b { width: 14px; opacity: .8; }
.mr-board em { font-style: normal; }
.mr-count { position: absolute; inset: 0; display: grid; place-items: center; font: 900 clamp(70px, 16vw, 170px)/1 system-ui, sans-serif; color: #fff; text-shadow: 0 6px 30px rgba(0, 0, 0, .45); pointer-events: none; }
.mr-count[hidden], .mr-time[hidden], .mr-board[hidden] { display: none; }
.mr-tools { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; }
.mr-tools button { border: 0; border-radius: 12px; padding: 9px 13px; font: 700 13px/1 system-ui, sans-serif; background: rgba(255, 255, 255, .9); color: #1b1b22; cursor: pointer; }
.mr-tools button:hover { background: #fff; }
.mr-panel { margin-top: 16px; padding: 18px; border-radius: 20px; background: #fff; border: 1px solid rgba(27, 27, 34, .1); box-shadow: 0 8px 26px rgba(27, 27, 34, .06); display: grid; gap: 14px; }
.mr-tabs { display: inline-flex; gap: 4px; padding: 4px; background: #eef0fb; border-radius: 14px; justify-self: start; }
.mr-tabs button { border: 0; background: transparent; padding: 9px 16px; border-radius: 10px; font: 700 14px/1 system-ui, sans-serif; color: #4b4b63; cursor: pointer; }
.mr-tabs button[aria-selected="true"] { background: #fff; color: #3a2bd6; box-shadow: 0 2px 8px rgba(40, 30, 120, .15); }
.mr-q { margin: 0 0 10px; font-weight: 700; display: block; }
.mr-nums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-width: 520px; }
.mr-nums button { aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent; background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55), transparent 40%), var(--c); color: var(--t); font: 800 clamp(20px, 4vw, 28px)/1 system-ui, sans-serif; cursor: pointer; box-shadow: 0 5px 12px rgba(0, 0, 0, .2); transition: transform .15s; }
.mr-nums button:hover { transform: translateY(-2px) scale(1.05); }
.mr-nums button[aria-pressed="true"] { border-color: #1b1b22; transform: scale(1.12); box-shadow: 0 0 0 4px rgba(109, 102, 245, .35), 0 8px 16px rgba(0, 0, 0, .25); }
#mrList { width: 100%; max-width: 520px; padding: 12px; border-radius: 12px; border: 1px solid rgba(27, 27, 34, .2); font: 16px/1.4 system-ui, sans-serif; resize: vertical; }
.mr-hint { margin: 8px 0 0; color: #5a5a70; font-size: 14px; }
.mr-go { justify-self: start; border: 0; border-radius: 14px; padding: 15px 28px; font: 800 17px/1 system-ui, sans-serif; color: #fff; background: linear-gradient(135deg, #4f46e5, #9d5cf8); cursor: pointer; box-shadow: 0 10px 22px rgba(79, 70, 229, .35); }
.mr-go:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.mr-score { margin: 0; color: #5a5a70; font-size: 14px; }
.mr-score:empty { display: none; }
.mr-result { margin-top: 16px; padding: 20px; border-radius: 20px; background: linear-gradient(160deg, #fff8e1, #ffe9f3); border: 1px solid rgba(27, 27, 34, .08); }
.mr-result[hidden] { display: none; }
.mr-win { display: flex; align-items: center; gap: 16px; }
.mr-win h2 { margin: 0 0 4px; font-size: clamp(22px, 4vw, 30px); }
.mr-win p { margin: 0; }
.mr-chip { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; flex: none; background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55), transparent 40%), var(--c); color: var(--t); font: 800 26px/1 system-ui, sans-serif; box-shadow: 0 5px 12px rgba(0, 0, 0, .2); }
.mr-chip.s { width: 24px; height: 24px; font-size: 13px; box-shadow: none; }
.mr-pod { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0 0; padding: 0; list-style: none; font-weight: 600; }
.mr-pod li { display: flex; align-items: center; gap: 7px; }
.mr-pod b { opacity: .6; }
.mr-wheelbox { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 16px; }
.mr-wheelbox canvas { width: min(100%, 360px); height: auto; aspect-ratio: 1; }
.mr-wres { font-size: 22px; margin: 14px 0 0; }
.mr-groups { margin-top: 14px; }
.mr-groups summary { cursor: pointer; font-weight: 700; }
.mr-groups ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.mr-groups li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.mr-groups li.w { font-weight: 700; }
@media (max-width: 640px) { .mr-stage { aspect-ratio: 4 / 5; max-height: 80vh; border-radius: 16px; } .mr-win { flex-direction: column; align-items: flex-start; } .mr-board { min-width: 0; } }
.mr-players { display: grid; gap: 12px; }
.mr-pl { padding: 12px; border-radius: 16px; background: #f6f7fe; border: 1px solid rgba(27, 27, 34, .08); }
.mr-plhead { display: flex; gap: 8px; margin-bottom: 10px; }
.mr-plhead input { flex: 1; min-width: 0; max-width: 360px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(27, 27, 34, .2); font: 16px system-ui, sans-serif; }
.mr-rm { border: 0; width: 38px; border-radius: 10px; background: #fde2e2; color: #b91c1c; font: 700 20px/1 system-ui; cursor: pointer; }
.mr-rm[hidden] { display: none; }
.mr-pl .mr-nums { grid-template-columns: repeat(10, 1fr); gap: 6px; max-width: 520px; }
.mr-pl .mr-nums button { font-size: clamp(12px, 2.6vw, 17px); border-width: 2px; }
.mr-add { justify-self: start; margin-top: 10px; border: 2px dashed #9d96f5; background: #fff; color: #3a2bd6; border-radius: 12px; padding: 10px 16px; font: 700 14px system-ui; cursor: pointer; }
.mr-add[hidden] { display: none; }
@media (max-width: 520px) { .mr-pl .mr-nums { grid-template-columns: repeat(5, 1fr); gap: 8px; } .mr-pl .mr-nums button { font-size: 18px; } }
.mr-out { margin: 14px 0 0; font-weight: 600; color: #b45309; }
.mr-over { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 14px; background: radial-gradient(55% 50% at 50% 46%, rgba(255, 190, 60, .34), transparent 72%), radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.6px) 0 0 / 22px 22px, linear-gradient(160deg, #1c1b48, #2a1a05 70%, #0b0a1e); animation: mrOverIn .5s ease; overflow: auto; }
@keyframes mrOverIn { from { opacity: 0; transform: scale(1.04); } }
.mr-overbox { display: grid; justify-items: center; gap: 10px; color: #fff; text-align: center; max-width: 560px; }
.mr-overhead { display: flex; align-items: center; gap: 14px; text-align: left; }
.mr-overhead h3 { margin: 0; font-size: clamp(20px, 3.6vw, 30px); color: #fff; }
.mr-overhead p { margin: 4px 0 0; opacity: .9; }
.mr-overbox canvas { position: static; inset: auto; display: block; width: min(100%, 400px, 54cqh); height: auto; aspect-ratio: 1; filter: drop-shadow(0 12px 28px rgba(0, 0, 0, .5)); }
.mr-overbox .mr-wres { margin: 0; min-height: 1.4em; font-size: clamp(20px, 3.4vw, 28px); }
.mr-overbtns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.mr-ghost { border: 2px solid rgba(255, 255, 255, .5); background: transparent; color: #fff; border-radius: 14px; padding: 13px 22px; font: 700 15px system-ui, sans-serif; cursor: pointer; }

.mr-overbox .mr-go { background: linear-gradient(135deg, #f7e08a, #c9971c); color: #2a1a02; box-shadow: 0 10px 22px rgba(201, 151, 28, .4); }
.mr-overhead h3 { color: #f7e08a; font-family: Georgia, 'Times New Roman', serif; }
.mr-overbox .mr-wres strong { color: #f7e08a; font-family: Georgia, 'Times New Roman', serif; }
.mr-wheelbox canvas { filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .3)); }
.mr-overbox .mr-wres { color: #fff; }
.mr-overhead p { color: rgba(255, 255, 255, .9); }

.mr-asg { width: min(100%, 520px); max-height: 100%; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.mr-asg h3 { margin: 0; color: #f7e08a; font: 700 clamp(20px, 3.4vw, 28px) Georgia, 'Times New Roman', serif; }
.mr-asg p { margin: 0; opacity: .9; font-size: 14px; }
.mr-asg-list { list-style: none; margin: 4px 0 0; padding: 0 4px 0 0; display: grid; gap: 7px; width: 100%; max-height: 46cqh; overflow: auto; text-align: left; }
.mr-asg-list li { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 14px; background: rgba(255, 255, 255, .09); }
.mr-asg-list .mr-chip { width: 36px; height: 36px; font-size: 18px; }
.mr-asg-names { font-weight: 600; font-size: 16px; line-height: 1.3; }
.mr-asg-names, .mr-asg-list li { color: #fff; }
.mr-overbox .mr-go { justify-self: center; }
.mr-asg-list { max-height: 36cqh; }
@container (max-height: 460px) { .mr-asg p { display: none; } .mr-asg { gap: 6px; } .mr-asg-list li { padding: 4px 8px; } .mr-asg-list .mr-chip { width: 28px; height: 28px; font-size: 14px; } .mr-asg-list { max-height: 48cqh; } }

.mr-find { width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid rgba(247, 224, 138, .6); background: rgba(255, 255, 255, .95); font: 16px system-ui, sans-serif; color: #1b1b22; }
.mr-asg-list .more { background: none; justify-content: center; font-size: 13px; opacity: .8; }
.mr-asg-count { font-size: 13px !important; display: flex; flex-wrap: wrap; gap: 4px 6px; justify-content: center; align-items: center; }
.mr-asg-count .mr-chip.s { width: 20px; height: 20px; font-size: 11px; }
.mr-tick { opacity: .75; }
.mr-asg p, .mr-asg-count { color: rgba(255, 255, 255, .9) !important; }

.mr-asg:has(.mr-asg-big) { width: min(100%, 940px); }
.mr-asg-big { display: block !important; columns: 3 220px; column-gap: 10px; max-height: 50cqh !important; }
.mr-asg-big li { break-inside: avoid; margin-bottom: 6px; }
.mr-asg-big .mr-chip { width: 30px; height: 30px; font-size: 15px; }
.mr-asg-big .mr-asg-names { font-size: 17px; }
.mr-asg-hint { font-size: 13px !important; opacity: .8; margin: 0; }
@container (max-height: 460px) { .mr-asg-big { max-height: 42cqh !important; } }

.mr-asg:has(.mr-asg-fit) { width: min(100%, 1120px); }
.mr-asg-big.mr-asg-fit { columns: 5 150px; column-gap: 8px; max-height: 58cqh !important; --fs: 16px; }
.mr-asg-fit li { padding: 2px 6px; margin-bottom: 3px; gap: 6px; border-radius: 9px; }
.mr-asg-fit .mr-chip { width: calc(var(--fs) * 1.7); height: calc(var(--fs) * 1.7); font-size: calc(var(--fs) * .9); }
.mr-asg-fit .mr-asg-names { font-size: var(--fs); line-height: 1.15; }
.mr-asg-big.mr-asg-fit { display: grid !important; grid-auto-flow: column; columns: auto !important; gap: 3px 8px; align-content: start; }
.mr-asg-fit li { margin-bottom: 0; }

/* up to 100 names: the list uses the whole screen */
.mr-over:has(.mr-asg-fit) { padding: 10px 14px; place-items: stretch; }
.mr-asg:has(.mr-asg-fit) { width: 100%; max-width: none; height: 100%; max-height: none; display: flex !important; flex-direction: column; align-items: stretch; gap: 8px; }
.mr-asg:has(.mr-asg-fit) > p:not(.mr-asg-hint), .mr-asg:has(.mr-asg-fit) .mr-asg-count { display: none; }
.mr-asg:has(.mr-asg-fit) h3 { font-size: clamp(18px, 3cqh, 34px); }
.mr-asg:has(.mr-asg-fit) .mr-find { max-width: 560px; align-self: center; padding: 8px 12px; }
.mr-asg:has(.mr-asg-fit) .mr-go { align-self: center; padding: 11px 26px; }
.mr-asg-big.mr-asg-fit { flex: 1 1 auto; min-height: 0; max-height: none !important; overflow: auto; align-content: space-evenly; }
.mr-asg-fit li { align-self: center; }
.mr-over:has(.mr-asg-fit) { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.mr-asg:has(.mr-asg-fit) { min-height: 0; overflow: hidden; }

/* ===== the game fills the whole page below the menu: course left, plain panel right ===== */
body[data-tool="marbles"] { overflow-x: clip; }
body[data-tool="marbles"] main.wrap { max-width: none; padding: 0; }
body[data-tool="marbles"] main.wrap > .ad { max-width: 1000px; margin-left: auto; margin-right: auto; }
.mr { --mh: max(520px, calc(100vh - 66px)); display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0; margin: 0; width: var(--vw, 100vw); position: relative; margin-left: calc(50% - var(--vw, 100vw) / 2); background: #0f0c32; }
.mr > noscript { grid-column: 1 / -1; color: #fff; padding: 20px; }
.mr-stage { aspect-ratio: auto; height: var(--mh); max-height: none; border-radius: 0; box-shadow: none; }
.mr-stage:fullscreen { height: auto; }
.mr-side { height: var(--mh); overflow: auto; padding: 18px; background: var(--card-solid, #fff); border-left: 1px solid var(--border); color: var(--text); display: flex; flex-direction: column; gap: 14px; }
.mr-side .mr-panel { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.mr-side .mr-tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.mr-side .mr-plhead input { max-width: none; }
.mr-side .mr-pl .mr-nums { grid-template-columns: repeat(5, 1fr); gap: 7px; }
.mr-side .mr-pl .mr-nums button { font-size: 16px; }
.mr-side .mr-go { width: 100%; justify-self: stretch; margin-top: 4px; background: var(--accent); box-shadow: none; border-radius: 10px; }
.mr-side #mrList { max-width: none; }
.mr-side .mr-result { margin: 0; }
@media (max-width: 960px) {
  .mr { grid-template-columns: 1fr; }
  .mr-stage { height: calc(100vh - 66px); min-height: 420px; }
  .mr-side { height: auto; overflow: visible; border-left: 0; }
  .mr-side .mr-pl .mr-nums { grid-template-columns: repeat(10, 1fr); gap: 5px; }
  .mr-side .mr-pl .mr-nums button { font-size: 13px; }
}
@media (max-width: 520px) { .mr-side .mr-pl .mr-nums { grid-template-columns: repeat(5, 1fr); gap: 8px; } .mr-side .mr-pl .mr-nums button { font-size: 18px; } }
.mr-below { padding-top: 10px; }
.mr-below > .content, .mr-below > .ad { max-width: 1000px; margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }
body[data-tool="marbles"] main.wrap > .ad:last-child, .mr-below > .ad { max-width: 968px; padding: 0; }

/* ===== space theme for the whole page ===== */
body[data-tool="marbles"] {
  --bg: #070a1c; --card: rgba(18, 24, 52, .78); --card-solid: #0d1230; --text: #e8ecff; --muted: #9aa4d0; --soft-text: #cfd6f5;
  --border: rgba(140, 160, 255, .22); --accent: #7c8cff; --accent-2: #5b6bff; --accent-text: #07102e; --glass: rgba(7, 10, 28, .82); --glass-2: #0d1230;
  --input-bg: rgba(255, 255, 255, .07); --tint: rgba(124, 140, 255, .14); --edge: rgba(255, 255, 255, .08); --lift: rgba(0, 0, 0, .6); --th-bg: rgba(124, 140, 255, .16); --th-ink: #c9d1ff;
  --glow1: transparent; --glow2: transparent; --cone: transparent; --dots: transparent; --footer-g: transparent; color-scheme: dark;
  background-color: #070a1c;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 27% 62%, #cfd8ff, transparent), radial-gradient(1.4px 1.4px at 43% 33%, #fff, transparent),
    radial-gradient(1px 1px at 58% 78%, #ffe9c4, transparent), radial-gradient(1.2px 1.2px at 71% 24%, #fff, transparent), radial-gradient(1px 1px at 86% 55%, #cfd8ff, transparent),
    radial-gradient(1.3px 1.3px at 93% 88%, #fff, transparent), radial-gradient(1px 1px at 5% 84%, #fff, transparent),
    radial-gradient(60% 40% at 80% 8%, rgba(70, 60, 190, .28), transparent 70%), radial-gradient(50% 35% at 10% 55%, rgba(30, 90, 170, .2), transparent 70%);
  background-size: 320px 320px, 260px 260px, 410px 410px, 350px 350px, 290px 290px, 380px 380px, 450px 450px, 300px 300px, auto, auto;
  background-attachment: scroll;
}
body[data-tool="marbles"] .site-header { background: rgba(7, 10, 28, .85); border-bottom-color: rgba(140, 160, 255, .2); }
body[data-tool="marbles"] .logo { color: #fff; }
body[data-tool="marbles"] .nav a { color: #b8c1ee; }
body[data-tool="marbles"] .nav a:hover, body[data-tool="marbles"] .nav a[aria-current] { color: #fff; background: rgba(124, 140, 255, .2); }
body[data-tool="marbles"] .site-footer { background: rgba(4, 6, 18, .7); border-top-color: rgba(140, 160, 255, .2); color: var(--muted); }
body[data-tool="marbles"] .site-footer a { color: #b8c1ee; }
body[data-tool="marbles"] .content :is(h1, h2, h3) { color: #fff; }
body[data-tool="marbles"] .answer { background: rgba(18, 24, 52, .7); border: 1px solid var(--border); border-left: 4px solid #7c8cff; color: var(--text); }
body[data-tool="marbles"] .crumbs, body[data-tool="marbles"] .crumbs a { color: var(--muted); }
.mr { background: transparent; }
.mr-side { background: rgba(10, 14, 38, .92); }
.mr-side .mr-tabs { background: rgba(255, 255, 255, .07); }
.mr-side .mr-tabs button { color: #aeb8ea; }
.mr-side .mr-tabs button[aria-selected="true"] { background: #7c8cff; color: #07102e; box-shadow: none; }
.mr-side .mr-q { color: #fff; }
.mr-side .mr-hint, .mr-side .mr-score { color: var(--muted); }
.mr-side .mr-pl { background: rgba(255, 255, 255, .05); border-color: rgba(140, 160, 255, .18); }
.mr-side .mr-plhead input, .mr-side #mrList { background: rgba(0, 0, 0, .35); border-color: rgba(140, 160, 255, .3); color: #fff; }
.mr-side .mr-nums button[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px rgba(124, 140, 255, .6); }
.mr-side .mr-add { background: transparent; color: #aeb8ff; border-color: rgba(140, 160, 255, .5); }
.mr-side .mr-rm { background: rgba(255, 120, 120, .15); color: #ffb4b4; }
.mr-side .mr-go { background: #7c8cff; color: #07102e; }
.mr-side .mr-out { color: #ffd27a; }
.mr-side .mr-result { color: #1b1b22; }
.mr-stage { background: radial-gradient(120% 90% at 50% 0%, #1b2158 0%, #0a0e2e 55%, #04061a 100%); }
body[data-tool="marbles"] .answer { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 18px 0 0; font-size: 1.05rem; color: var(--soft-text); }
body[data-tool="marbles"] .answer strong { color: #fff; }

/* ===== space animation: drifting stars that twinkle, and a shooting star now and then ===== */
body[data-tool="marbles"]::before, body[data-tool="marbles"]::after { content: ""; position: fixed; pointer-events: none; z-index: -1; }
body[data-tool="marbles"]::before {
  inset: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 20px 30px, #fff, transparent), radial-gradient(1.2px 1.2px at 140px 90px, #dbe3ff, transparent), radial-gradient(1.8px 1.8px at 90px 190px, #fff, transparent),
    radial-gradient(1.2px 1.2px at 210px 40px, #ffe9c4, transparent), radial-gradient(1.4px 1.4px at 260px 150px, #fff, transparent), radial-gradient(1px 1px at 50px 120px, #cfd8ff, transparent);
  background-size: 300px 240px;
  animation: spStars 160s linear infinite, spTwinkle 4.5s ease-in-out infinite alternate;
}
body[data-tool="marbles"]::after {
  top: 12vh; left: 100vw; width: 140px; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff);
  transform: rotate(18deg);
  animation: spShoot 11s ease-in infinite 3s;
}
@keyframes spStars { to { background-position: -300px 240px; } }
@keyframes spTwinkle { from { opacity: .45; } to { opacity: 1; } }
@keyframes spShoot { 0% { transform: translate(0, 0) rotate(18deg); opacity: 0; } 2% { opacity: 1; } 12% { transform: translate(-80vw, 26vw) rotate(18deg); opacity: 0; } 100% { transform: translate(-80vw, 26vw) rotate(18deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { body[data-tool="marbles"]::before, body[data-tool="marbles"]::after { animation: none; } }

/* ===== deeper space: drifting nebulae, a ringed planet, a moon, more shooting stars ===== */
.sp-sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.sp-sky i { position: absolute; display: block; }
.sp-sky::before, .sp-sky::after { content: ""; position: absolute; inset: 0; }
.sp-sky::before { background-image: radial-gradient(1px 1px at 30px 40px, #fff, transparent), radial-gradient(1px 1px at 110px 150px, #cfd8ff, transparent), radial-gradient(1px 1px at 170px 70px, #fff, transparent), radial-gradient(1px 1px at 70px 200px, #ffe9c4, transparent); background-size: 200px 230px; animation: spStars 90s linear infinite, spTwinkle 3s ease-in-out infinite alternate-reverse; opacity: .8; }
.sp-sky::after { background-image: radial-gradient(2.2px 2.2px at 60px 80px, #fff, transparent), radial-gradient(2px 2px at 280px 200px, #bcd0ff, transparent), radial-gradient(2.4px 2.4px at 190px 310px, #fff, transparent); background-size: 360px 380px; animation: spStars 240s linear infinite, spTwinkle 6s ease-in-out infinite alternate; }
.sp-neb { border-radius: 50%; filter: blur(70px); opacity: .55; }
.sp-neb.a { width: 60vw; height: 50vh; left: -15vw; top: 20vh; background: radial-gradient(closest-side, rgba(110, 70, 220, .6), transparent); animation: spDrift 50s ease-in-out infinite alternate; }
.sp-neb.b { width: 55vw; height: 45vh; right: -15vw; top: 55vh; background: radial-gradient(closest-side, rgba(30, 130, 210, .5), rgba(200, 60, 160, .18) 70%, transparent); animation: spDrift 65s ease-in-out infinite alternate-reverse; }
@keyframes spDrift { from { transform: translate(0, 0) scale(1); } to { transform: translate(9vw, -6vh) scale(1.2); } }
.sp-planet { width: clamp(150px, 20vw, 300px); aspect-ratio: 1; right: -4vw; bottom: 10vh; border-radius: 50%; background: radial-gradient(circle at 30% 28%, #ffd9a0 0%, #e0875a 32%, #8e3d66 62%, #2a1448 100%); box-shadow: inset -22px -18px 40px rgba(0, 0, 0, .55), 0 0 60px rgba(224, 135, 90, .22); animation: spFloat 14s ease-in-out infinite alternate; }
.sp-planet::before { content: ""; position: absolute; left: -38%; right: -38%; top: 42%; height: 16%; border-radius: 50%; border: 5px solid rgba(255, 220, 170, .55); border-bottom-color: rgba(255, 220, 170, .25); transform: rotate(-16deg); box-shadow: 0 0 14px rgba(255, 200, 140, .3); }
.sp-moon { width: clamp(34px, 4vw, 60px); aspect-ratio: 1; left: 7vw; top: 22vh; border-radius: 50%; background: radial-gradient(circle at 32% 30%, #fff 0%, #c9cfe6 45%, #6b7396 100%); box-shadow: inset -8px -6px 14px rgba(0, 0, 0, .45), 0 0 24px rgba(200, 210, 255, .25); animation: spFloat 9s ease-in-out infinite alternate-reverse; }
@keyframes spFloat { from { transform: translateY(-14px) rotate(0); } to { transform: translateY(14px) rotate(4deg); } }
.sp-shoot { width: 150px; height: 2px; border-radius: 2px; left: 100vw; opacity: 0; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff); }
.sp-shoot.s1 { top: 10vh; animation: spShoot 9s ease-in infinite 2s; }
.sp-shoot.s2 { top: 38vh; animation: spShoot 13s ease-in infinite 6s; }
.sp-shoot.s3 { top: 70vh; animation: spShoot 17s ease-in infinite 11s; }
body[data-tool="marbles"]::after { display: none; }
@media (prefers-reduced-motion: reduce) { .sp-sky *, .sp-sky::before, .sp-sky::after { animation: none !important; } }
@media (max-width: 700px) { .sp-planet { opacity: .5; } }

/* ===== younger and louder: bright neon colors, chunky sticker buttons, a UFO and a rocket ===== */
body[data-tool="marbles"] { --accent: #ffd23f; --accent-text: #1a1040; background-color: #0b0626; }
.sp-neb.a { background: radial-gradient(closest-side, rgba(255, 60, 170, .6), transparent); opacity: .6; }
.sp-neb.b { background: radial-gradient(closest-side, rgba(0, 220, 255, .5), rgba(120, 80, 255, .25) 70%, transparent); opacity: .6; }
.sp-planet { background: radial-gradient(circle at 30% 28%, #fff1a8 0%, #ff8a3d 30%, #ff3d8b 62%, #5a1a9e 100%); box-shadow: inset -22px -18px 40px rgba(40, 0, 80, .5), 0 0 70px rgba(255, 90, 160, .35); }
.sp-planet::before { border-color: rgba(120, 240, 255, .75); border-bottom-color: rgba(120, 240, 255, .35); box-shadow: 0 0 16px rgba(120, 240, 255, .5); }
.sp-planet2 { width: clamp(60px, 8vw, 120px); aspect-ratio: 1; left: 3vw; bottom: 8vh; border-radius: 50%; background: radial-gradient(circle at 32% 30%, #c8ffd8 0%, #2fe0a0 38%, #0a8fa8 75%, #063a66 100%); box-shadow: inset -10px -8px 18px rgba(0, 20, 60, .5), 0 0 40px rgba(47, 224, 160, .35); animation: spFloat 11s ease-in-out infinite alternate; }
.sp-ufo, .sp-rocket { font-size: clamp(30px, 4vw, 54px); line-height: 1; left: 0; filter: drop-shadow(0 0 14px rgba(255, 255, 255, .35)); }
.sp-ufo { top: 30vh; animation: spUfo 26s ease-in-out infinite; }
.sp-rocket { top: 80vh; animation: spRocket 19s linear infinite 4s; }
@keyframes spUfo { 0% { transform: translate(-10vw, 0) rotate(-6deg); } 25% { transform: translate(30vw, -8vh) rotate(6deg); } 50% { transform: translate(60vw, 6vh) rotate(-6deg); } 75% { transform: translate(85vw, -6vh) rotate(6deg); } 100% { transform: translate(112vw, 4vh) rotate(-6deg); } }
@keyframes spRocket { 0% { transform: translate(-8vw, 10vh) rotate(60deg); } 100% { transform: translate(112vw, -80vh) rotate(60deg); } }
.sp-sky::after { background-image: radial-gradient(2.4px 2.4px at 60px 80px, #ffd23f, transparent), radial-gradient(2.2px 2.2px at 280px 200px, #5ff0ff, transparent), radial-gradient(2.6px 2.6px at 190px 310px, #ff7ad0, transparent); }
.sp-shoot { background: linear-gradient(90deg, rgba(255, 255, 255, 0), #5ff0ff); height: 3px; }
.sp-shoot.s2 { background: linear-gradient(90deg, rgba(255, 255, 255, 0), #ff7ad0); }
.sp-shoot.s3 { background: linear-gradient(90deg, rgba(255, 255, 255, 0), #ffd23f); }
/* panel and buttons: chunky stickers */
.mr-side { background: rgba(20, 10, 60, .88); border-left: 3px solid #ff5fb5; }
.mr-side .mr-tabs { background: rgba(255, 255, 255, .1); border-radius: 14px; }
.mr-side .mr-tabs button { font-weight: 800; border-radius: 10px; }
.mr-side .mr-tabs button[aria-selected="true"] { background: #5ff0ff; color: #0a1440; box-shadow: 0 3px 0 #0a8fa8; }
.mr-side .mr-go { background: #ffd23f; color: #1a1040; border: 3px solid #1a1040; border-radius: 16px; font-weight: 900; font-size: 19px; padding: 15px 20px; box-shadow: 0 5px 0 #c98a00, 0 0 0 3px #ffd23f; transition: transform .12s, box-shadow .12s; }
.mr-side .mr-go:hover:not(:disabled) { transform: translateY(-2px) rotate(-1deg); box-shadow: 0 7px 0 #c98a00, 0 0 0 3px #ffd23f; }
.mr-side .mr-go:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #c98a00, 0 0 0 3px #ffd23f; }
.mr-side .mr-add { border-color: #ff7ad0; color: #ffb3e4; font-weight: 800; }
.mr-side .mr-nums button { transition: transform .15s; }
.mr-side .mr-nums button[aria-pressed="true"] { box-shadow: 0 0 0 3px #ffd23f, 0 0 16px rgba(255, 210, 63, .7); }
.mr-tools button { font-weight: 800; border-radius: 999px; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
body[data-tool="marbles"] .content h1 { font-weight: 900; letter-spacing: -.01em; background: linear-gradient(90deg, #fff, #ffd23f 45%, #ff7ad0); -webkit-background-clip: text; background-clip: text; color: transparent; }
body[data-tool="marbles"] .content h2 { font-weight: 900; }
body[data-tool="marbles"] .content h2::before { background: linear-gradient(90deg, #ff5fb5, #5ff0ff); height: 4px; width: 56px; }
body[data-tool="marbles"] .content strong { color: #fff; }
body[data-tool="marbles"] .nav a[aria-current] { background: #ff5fb5; color: #1a0630; font-weight: 800; }
body[data-tool="marbles"] a { color: #7ff3ff; }
.mr-stage { background: radial-gradient(120% 90% at 50% 0%, #3a1c8c 0%, #170a4a 55%, #0a0630 100%); }
@media (prefers-reduced-motion: reduce) { .sp-ufo, .sp-rocket { display: none; } }

/* ===== calmer and more current: near-black space, one lime accent, flat shapes, no gimmicks ===== */
body[data-tool="marbles"] { --accent: #c8ff3d; --accent-text: #0b0d14; background-color: #07080f; }
.sp-neb.a { background: radial-gradient(closest-side, rgba(90, 70, 220, .45), transparent); opacity: .5; }
.sp-neb.b { background: radial-gradient(closest-side, rgba(40, 90, 200, .4), transparent); opacity: .5; }
.sp-planet { background: radial-gradient(circle at 30% 28%, #3b3f66 0%, #1b1e3a 55%, #0c0e22 100%); box-shadow: inset -20px -16px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08); opacity: .9; }
.sp-planet::before { border: 1.5px solid rgba(255, 255, 255, .28); border-bottom-color: rgba(255, 255, 255, .1); box-shadow: none; }
.sp-moon { background: radial-gradient(circle at 32% 30%, #e8ebf7 0%, #9aa1bd 55%, #4c5273 100%); box-shadow: inset -6px -5px 12px rgba(0, 0, 0, .5); }
.sp-planet2, .sp-ufo, .sp-rocket { display: none; }
.sp-sky::after { background-image: radial-gradient(2.2px 2.2px at 60px 80px, #fff, transparent), radial-gradient(2px 2px at 280px 200px, #c8d4ff, transparent), radial-gradient(2.4px 2.4px at 190px 310px, #fff, transparent); }
.sp-shoot, .sp-shoot.s2, .sp-shoot.s3 { height: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff); }
.mr-side { background: #0e1018; border-left: 1px solid rgba(255, 255, 255, .1); }
.mr-side .mr-tabs { background: rgba(255, 255, 255, .06); border-radius: 12px; }
.mr-side .mr-tabs button { font-weight: 700; }
.mr-side .mr-tabs button[aria-selected="true"] { background: #fff; color: #0b0d14; box-shadow: none; }
.mr-side .mr-go { background: #c8ff3d; color: #0b0d14; border: 0; border-radius: 12px; font-weight: 800; font-size: 17px; padding: 15px 20px; box-shadow: none; transition: transform .15s, filter .15s; }
.mr-side .mr-go:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: none; }
.mr-side .mr-go:active:not(:disabled) { transform: none; box-shadow: none; }
.mr-side .mr-add { border-color: rgba(255, 255, 255, .3); color: #fff; font-weight: 700; }
.mr-side .mr-nums button[aria-pressed="true"] { box-shadow: 0 0 0 2px #0e1018, 0 0 0 4px #fff; }
.mr-tools button { box-shadow: none; border-radius: 999px; font-weight: 700; }
body[data-tool="marbles"] .content h1 { background: none; color: #fff; -webkit-text-fill-color: #fff; font-weight: 800; letter-spacing: -.02em; }
body[data-tool="marbles"] .content h2 { font-weight: 800; letter-spacing: -.01em; }
body[data-tool="marbles"] .content h2::before { background: #c8ff3d; height: 3px; width: 32px; }
body[data-tool="marbles"] .nav a[aria-current] { background: #fff; color: #0b0d14; font-weight: 700; }
body[data-tool="marbles"] a { color: #fff; }
.mr-stage { background: radial-gradient(120% 90% at 50% 0%, #1c2050 0%, #0b0d24 60%, #06070f 100%); }

/* ===== picture cards under the game ===== */
.mb-steps, .mb-cards, .mb-ideas { list-style: none; padding: 0 !important; margin: 18px 0; display: grid; gap: 14px; }
.mb-steps { grid-template-columns: repeat(3, 1fr); }
.mb-cards { grid-template-columns: repeat(3, 1fr); }
.mb-ideas { grid-template-columns: repeat(4, 1fr); }
.mb-steps li, .mb-cards li, .mb-ideas li, .mb-flow > div { position: relative; margin: 0 !important; max-width: none !important; padding: 14px 16px 18px; border-radius: 18px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); transition: transform .2s, border-color .2s, background .2s; }
.mb-steps li:hover, .mb-cards li:hover, .mb-ideas li:hover, .mb-flow > div:hover { transform: translateY(-4px); border-color: rgba(200, 255, 61, .6); background: rgba(255, 255, 255, .08); }
.mb-art { border-radius: 12px; background: #0b0d1c; margin-bottom: 12px; overflow: hidden; }
.mb-art svg { display: block; width: 100%; height: auto; }
.mb-steps b { position: absolute; left: 24px; top: 22px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #c8ff3d; color: #0b0d14; font-size: 15px; }
.mb-cards li > span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #c8ff3d; font-weight: 700; }
.mb-steps h3, .mb-cards h3, .mb-ideas h3, .mb-flow h3 { margin: 2px 0 4px !important; font-size: 1.08rem; }
.mb-steps p, .mb-cards p, .mb-ideas p, .mb-flow p { margin: 0 !important; max-width: none !important; font-size: .95rem; line-height: 1.5; color: var(--muted); }
.mb-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 12px; align-items: center; margin: 20px 0; }
.mb-flow > i { font-style: normal; font-size: 28px; color: #c8ff3d; }
.mb-faq { display: grid; gap: 10px; margin-top: 14px; max-width: 760px; }
.mb-faq .faq { border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; background: rgba(255, 255, 255, .04); padding: 0 16px; }
.mb-faq .faq[open] { border-color: rgba(200, 255, 61, .5); }
.mb-faq summary { cursor: pointer; padding: 14px 0; list-style: none; }
.mb-faq summary::-webkit-details-marker { display: none; }
.mb-faq summary h3 { display: inline; margin: 0 !important; font-size: 1rem; }
.mb-faq p { margin: 0 0 14px !important; }
body[data-tool="marbles"] .mr-below > .content { max-width: 1100px; }
@media (max-width: 900px) { .mb-steps, .mb-cards { grid-template-columns: 1fr 1fr; } .mb-ideas { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .mb-steps, .mb-cards, .mb-ideas { grid-template-columns: 1fr; } .mb-flow { grid-template-columns: 1fr; } .mb-flow > i { transform: rotate(90deg); justify-self: center; } }
