@font-face {
  font-family: Inter;
  src: url("assets/inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #100b1b;
  --panel: #1a1128;
  --raised: #211533;
  --outline: #392750;
  --line: #30203f;
  --text: #fbf8ff;
  --muted: #c3b5d2;
  --dim: #a897bb;
  --purple: #c096ff;
  --pink: #ffa4db;
  --blue: #a7dcff;
  --focus: #a6dcff;
  --accent: #c096ff;
  --accent-rgb: 192, 150, 255;
  --max: 1240px;
  font-family: Inter, system-ui, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  background: radial-gradient(ellipse at 17% 1%, #211132 0, transparent 39rem),
    radial-gradient(ellipse at 88% 58%, #1c102b 0, transparent 36rem), var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}
body:has(dialog[open]) { overflow: hidden; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
svg.icon { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; vertical-align: middle; }
[data-icon] { display: inline-flex; align-items: center; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.shell:focus, .result-content h1:focus { outline: none; }
.skip-link { position: fixed; left: 1rem; top: -7rem; background: white; color: #170c26; padding: 0.8rem 1rem; border-radius: 10px; z-index: 12; }
.skip-link:focus { top: 1rem; }
.shell, .topbar-inner { width: min(var(--max), calc(100% - 88px)); margin-inline: auto; }
main.shell { flex: 1 0 auto; padding: 28px 0 50px; scroll-margin-top: 68px; }

.topbar {
  background: #100b19f5;
  border-bottom: 1px solid #2c1f3b;
  position: sticky;
  top: 0;
  z-index: 8;
}
.topbar-inner { height: 70px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 11px; line-height: 1; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(145deg, #e596ff, #a458ee 56%, #6c30d4);
  border: 1px solid #dfadff; color: #fff;
  box-shadow: inset 0 1px 1px #fff6, 0 0 20px #b35dff3c;
}
.brand-mark .icon { width: 25px; height: 25px; }
.brand-name { display: grid; gap: 3px; font-weight: 900; letter-spacing: 0.052em; font-size: 0.94rem; }
.brand-name span { color: #d8acf9; font-size: 0.64rem; letter-spacing: 0.25em; font-weight: 760; }
.site-nav {
  display: flex; gap: 5px; align-items: center; padding: 4px;
  border: 1px solid #312040; background: #191124; border-radius: 14px;
}
.site-nav a {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  color: #c1b2d1; line-height: 1; white-space: nowrap; padding: 10px 15px; min-height: 37px;
  font-size: .82rem; font-weight: 710; border: 1px solid transparent; border-radius: 10px;
  transition: background .18s ease, color .18s ease;
}
.site-nav a:hover { color: white; background: #251935; }
.site-nav a[aria-current] { color: #f8eaff; border-color: #543578; background: #372153; }
.site-nav .icon { width: 16px; height: 16px; color: #d7a9ff; }
.top-actions { display: flex; align-items: center; gap: 9px; justify-self: end; }
.sound-button, .star-wallet, .icon-button {
  display: inline-flex; min-width: 42px; min-height: 42px; align-items: center; justify-content: center; gap: 7px;
  background: #1d1329; color: #ead5fa; border: 1px solid #3b294e; border-radius: 12px;
  transition: background .18s ease, border .18s ease;
}
.sound-button:hover, .star-wallet:hover, .icon-button:hover { background: #311e49; border-color: #8454b0; }
.star-wallet { min-width: 61px; padding-inline: 11px; font-weight: 830; font-size: 0.96rem; color: #fff2fc; font-variant-numeric: tabular-nums; }
.star-wallet .icon { color: #ffd1f4; width: 16px; height: 16px; filter: drop-shadow(0 0 5px #fd82e18a); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 17px;
  border: 1px solid transparent; border-radius: 12px; font-size: 0.91rem; font-weight: 830; line-height: 1.16;
  width: fit-content; text-align: center;
  transition: background .18s ease, transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.43; }
.btn-primary {
  background: linear-gradient(105deg, #ec9ffe, #f3a7e4);
  border-color: #f8c5f3; color: #2a1138;
  box-shadow: 0 7px 25px #d46bf42f, inset 0 1px 1px #fff6;
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(105deg, #f4b0ff, #ffc7f1); box-shadow: 0 8px 29px #d46bf44c; }
.btn-secondary { color: #f3e4ff; background: #2a1a3d; border-color: #523469; }
.btn-secondary:hover:not(:disabled) { background: #3c2355; border-color: #9764b4; }
.btn-plain { color: var(--muted); background: transparent; border-color: var(--line); }
.btn-plain:hover:not(:disabled) { background: #302044; color: white; }
.btn .icon { width: 18px; height: 18px; }

.hero {
  height: clamp(414px, 34vw, 456px);
  isolation: isolate; overflow: hidden; position: relative; display: flex; align-items: center;
  border: 1px solid #624080; border-radius: 26px;
  background: radial-gradient(ellipse at 55% 61%, #511c67, #240e3b 52%, #191027);
  box-shadow: 0 17px 56px #06030e55, inset 0 0 0 1px #e1aeff0c;
}
.hero-art { width: min(83%, 743px); height: 100%; position: absolute; inset: 0 0 0 auto; object-fit: cover; object-position: 66% 48%; mask-image: linear-gradient(90deg, transparent, #000 26%); z-index: -3; }
.hero-shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(90deg, #1b1028 1%, #1b0c2cfa 13%, #220e35dc 28%, #260c3b64 48%, #230d3000 66%), linear-gradient(0deg, #170b2b52, transparent 32%); }
.hero-content { padding: 30px 0 34px clamp(27px, 4.5vw, 65px); max-width: 61%; }
.hero-level {
  width: fit-content; display: flex; align-items: center; gap: 8px;
  border: 1px solid #a065c85d; color: #efcaff; border-radius: 30px; background: #332046b8;
  min-height: 31px; padding: 5px 11px; font-weight: 760; font-size: .75rem; letter-spacing: .045em;
}
.hero-level .icon { width: 15px; height: 15px; }
.hero h1 {
  display: grid; width: fit-content; margin: 20px 0 17px; font-size: clamp(3.3rem, 6.5vw, 6.32rem);
  line-height: .87; letter-spacing: -.079em; font-weight: 930; transform: skewX(-5deg);
}
.hero h1 span:first-child { color: #fff8ff; filter: drop-shadow(1px 4px 12px #08021260); }
.hero h1 span:last-child {
  color: #efa7fb; background: linear-gradient(111deg, #fa89d7 4%, #ecabff 44%, #aebcff 96%);
  background-clip: text; -webkit-text-fill-color: transparent; padding-right: 0.1em;
}
.hero-description { color: #e4d4ed; font-size: 1rem; line-height: 1.54; max-width: 350px; text-wrap: pretty; }
.hero-button { margin-top: 22px; gap: 10px; min-height: 49px; padding-inline: 15px; font-size: .94rem; }
.hero-button .button-arrow { width: 16px; height: 16px; margin-left: 7px; }

.games-section { margin-top: 29px; scroll-margin-top: 90px; }
.section-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; }
.section-icon {
  display: grid; place-items: center; width: 47px; height: 47px; border-radius: 14px; flex: 0 0 auto;
  color: #dcb2ff; background: #2c1a44; border: 1px solid #503271; box-shadow: inset 0 0 17px #ae67ff16;
}
.section-icon .icon { width: 24px; height: 24px; }
.section-heading h2, .badge-section h2 { font-weight: 870; letter-spacing: -.05em; font-size: clamp(1.65rem, 2.3vw, 2.1rem); line-height: 1.16; }
.section-heading p { color: var(--muted); margin-top: 4px; font-size: .89rem; line-height: 1.35; }
.card-grid, .badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.skate { --accent: #caa4ff; --accent-rgb: 192, 140, 255; }
.hoops { --accent: #ff9dd6; --accent-rgb: 255, 139, 202; }
.draw { --accent: #abe0ff; --accent-rgb: 153, 211, 255; }
.game-card {
  min-width: 0; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid rgba(var(--accent-rgb), .3); border-radius: 19px; background: #1b1329;
  box-shadow: 0 9px 22px #06030e39; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.game-card:hover { transform: translateY(-4px); border-color: rgba(var(--accent-rgb), .72); box-shadow: 0 9px 33px rgba(var(--accent-rgb), .15); }
.card-art { aspect-ratio: 2.34; width: 100%; position: relative; overflow: hidden; background: #271737; flex: none; }
.card-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #1b1329aa 0%, transparent 26%); pointer-events: none; }
.card-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 50%; transition: transform .35s ease; }
.skate .card-art img { object-position: center 56%; }
.draw .card-art img { object-position: center 54%; }
.game-card:hover img { transform: scale(1.045); }
.subject {
  position: absolute; z-index: 1; top: 11px; left: 11px; display: flex; align-items: center; gap: 5px;
  color: #fff6ff; background: #1b112cde; border: 1px solid rgba(var(--accent-rgb), .58);
  border-radius: 25px; padding: 5px 9px; font-weight: 760; font-size: .71rem;
}
.subject .icon { width: 13px; height: 13px; color: var(--accent); }
.card-content { display: flex; flex-direction: column; gap: 9px; flex: 1; padding: 13px 16px 15px; background: linear-gradient(145deg, rgba(var(--accent-rgb), .07), transparent 60%); }
.card-title { display: flex; gap: 9px; align-items: center; min-height: 31px; }
.card-mode-icon {
  display: grid; place-items: center; flex: 0 0 31px; height: 31px; border-radius: 9px;
  background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-rgb), .24); color: var(--accent);
}
.card-mode-icon .icon { width: 18px; height: 18px; }
.card-title h3 { font-size: clamp(1.12rem, 2vw, 1.43rem); letter-spacing: -.045em; font-weight: 830; line-height: 1.14; }
.card-content p { color: var(--muted); font-size: .88rem; line-height: 1.45; flex: 1; text-wrap: pretty; }
.card-action { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--accent); font-size: .87rem; font-weight: 820; border-top: 1px solid rgba(var(--accent-rgb), .13); padding-top: 9px; }
.card-action span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: rgba(var(--accent-rgb), .10); }
.card-action .icon { width: 15px; height: 15px; }

.footer { min-height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); color: var(--dim); font-size: .79rem; }
.footer-name, .text-button { display: inline-flex; align-items: center; gap: 6px; }
.footer-name .icon, .text-button .icon { width: 14px; height: 14px; }
.text-button { min-height: 40px; border: 0; padding: 0 1px 0 8px; color: #ccb9e0; background: none; font-weight: 700; }
.text-button:hover { color: white; }

.back-link { display: inline-flex; align-items: center; gap: 7px; min-height: 35px; margin-bottom: 8px; color: #d9b9f4; font-weight: 760; font-size: .88rem; }
.back-link:hover { color: white; }
.back-link .icon { width: 16px; height: 16px; }
.game-heading { margin-bottom: 17px; }
.game-title-row { display: flex; align-items: center; gap: 13px; }
.game-title-icon {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; flex: none;
  color: var(--accent); background: rgba(var(--accent-rgb), .13); border: 1px solid rgba(var(--accent-rgb), .32);
}
.game-title-icon .icon { width: 29px; height: 29px; }
.game-title-row h1, .progress-hero h1 { font-size: clamp(2.1rem, 4.3vw, 3rem); font-weight: 890; line-height: 1.04; letter-spacing: -.062em; }
.game-title-row p { color: var(--muted); font-size: .94rem; margin-top: 5px; line-height: 1.4; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: stretch; gap: 14px; }
.play-panel, .challenge-panel, .studio-note, .studio-canvas-panel, .caption-panel {
  min-width: 0; border: 1px solid rgba(var(--accent-rgb), .28); background: var(--panel); border-radius: 19px;
}
.play-panel { overflow: hidden; }
.scene {
  position: relative; isolation: isolate; overflow: hidden; background: #1d1233; min-height: 365px;
  aspect-ratio: 1.64; border-radius: 18px 18px 0 0; display: grid; place-items: center;
}
.scene-world { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 48%; z-index: -3; }
.scene::after { content: ""; position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, #1209236e, transparent 29%, transparent 64%, #12092382); pointer-events: none; }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.scene-stats { display: flex; flex-wrap: wrap; gap: 6px; position: absolute; left: 10px; top: 10px; z-index: 1; }
.scene-badge {
  min-height: 30px; padding: 5px 8px; display: inline-flex; align-items: center; gap: 5px;
  color: #fff4ff; font-size: .72rem; font-weight: 820; background: #160e25df;
  border: 1px solid rgba(var(--accent-rgb), .46); border-radius: 9px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.scene-badge .icon { width: 14px; height: 14px; color: var(--accent); }
.scene-banner {
  position: absolute; z-index: 2; left: 50%; top: 22%; transform: translateX(-50%) scale(.94);
  padding: 8px 15px; border-radius: 30px; white-space: nowrap; font-weight: 870;
  color: #fff4ff; border: 1px solid var(--accent); background: #2a163bdd; box-shadow: 0 0 22px rgba(var(--accent-rgb), .44);
  opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none;
}
.scene-banner.show { opacity: 1; transform: translateX(-50%) scale(1); }
.play-controls { padding: 11px 13px; background: linear-gradient(135deg, #231633, #1b1227); border-top: 1px solid rgba(var(--accent-rgb), .22); }
.lane-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.lane-button {
  display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; min-height: 43px; padding: 3px;
  border: 1px solid #4b3363; background: #281b3a; color: #e3d0f6; font-size: .81rem; font-weight: 790;
}
.lane-button:hover:not(:disabled) { background: #483064; border-color: #9f6eca; }
.lane-button[aria-pressed="true"] { background: #482e66; color: white; border-color: #b78ce9; }
.lane-button.star-lane:not(:disabled) { color: #ffe3f7; border-color: #f9a1e0; box-shadow: inset 0 0 14px #d272f050; }
.lane-button:disabled { opacity: .59; }
.control-key {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid #7b5895; border-radius: 5px;
  color: #f0ddff; font-size: .7rem; font-weight: 800;
}
.controls-caption { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 8px; font-size: .74rem; line-height: 1.35; color: var(--muted); text-align: center; }
.controls-caption .icon { width: 15px; height: 15px; color: var(--accent); }

.challenge-panel {
  padding: clamp(14px, 1.9vw, 24px); display: flex; flex-direction: column; align-self: start;
  background: radial-gradient(ellipse at 94% 0%, rgba(var(--accent-rgb), .11), transparent 68%), #1a1228;
}
.challenge-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.challenge-count { font-weight: 820; color: #ddcdeb; font-size: .78rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.topic { color: var(--accent); font-size: .75rem; font-weight: 780; border: 1px solid rgba(var(--accent-rgb), .29); background: rgba(var(--accent-rgb), .08); padding: 4px 8px; border-radius: 25px; }
.round-track { display: flex; gap: 4px; margin: 11px 0 17px; }
.round-track span { height: 4px; border-radius: 6px; background: #473455; flex: 1; }
.round-track .done { background: var(--accent); }
.round-track .current { background: rgba(var(--accent-rgb), .53); }
.challenge-prompt { font-size: clamp(1.35rem, 2.45vw, 2.02rem); letter-spacing: -.041em; line-height: 1.17; font-weight: 860; text-wrap: pretty; }
.hoops .challenge-prompt { font-size: clamp(1.23rem, 1.9vw, 1.54rem); }
.passage { font-size: .92rem; line-height: 1.46; color: #f1e7fa; margin-bottom: 11px; padding: 9px 11px; background: #2c1a3d; border-left: 3px solid var(--accent); border-radius: 0 7px 7px 0; }
.passage:empty { display: none; }
.choice-grid { display: grid; gap: 7px; margin: 12px 0; }
.skate .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice {
  font-weight: 820; font-size: 1.05rem; line-height: 1.24; color: white; min-height: 48px; min-width: 0; overflow-wrap: anywhere; padding: 7px;
  background: #2b1e3e; border: 1px solid #5a4174; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 7px;
}
.hoops .choice { font-size: .92rem; justify-content: flex-start; text-align: left; padding: 7px 10px; min-height: 41px; }
.choice:hover:not(:disabled) { background: #46305d; border-color: var(--accent); }
.choice.selected, .choice.correct { background: rgba(var(--accent-rgb), .24); border-color: var(--accent); }
.choice.correct::after { content: "✓"; color: white; font-weight: 870; }
.choice.wrong { background: #3d203e; color: #efaed9; border-color: #714272; text-decoration: line-through; }
.choice-index {
  display: grid; place-items: center; flex: none; width: 21px; height: 21px;
  border: 1px solid #775385; border-radius: 6px; color: #ebcffa; font-size: .71rem;
}
.challenge-actions { display: flex; align-items: stretch; gap: 7px; margin-top: auto; }
.challenge-actions .btn { min-height: 43px; padding-inline: 11px; font-size: .84rem; }
.challenge-actions .btn-primary { flex: 1; }
.challenge-feedback {
  min-height: 48px; color: #f1ddff; line-height: 1.38; font-size: .89rem; margin: 0 0 10px;
  border-radius: 10px; padding: 8px 10px; background: #21152f; border: 1px solid #38234b;
}
.challenge-feedback:empty { min-height: 0; padding: 0; border: 0; margin-bottom: 0; }
.challenge-feedback.good { border-color: rgba(var(--accent-rgb), .45); background: rgba(var(--accent-rgb), .1); }
.challenge-footer { min-height: 39px; color: var(--muted); font-size: .78rem; padding-top: 8px; line-height: 1.35; }
.power-box { display: grid; gap: 8px; }
.power-label { display: flex; justify-content: space-between; gap: 8px; color: #f6d4ee; font-weight: 760; font-size: .77rem; }
.power-track { position: relative; height: 16px; background: #110b19; border: 1px solid #58375d; border-radius: 20px; box-shadow: inset 0 1px 5px #090410; }
.power-target { position: absolute; top: 1px; bottom: 1px; border-radius: 16px; background: linear-gradient(90deg, #a778f6, #ed9fe9, #b9abff); box-shadow: 0 0 10px #ec73d866; }
.power-marker { position: absolute; top: -3px; bottom: -3px; width: 4px; border-radius: 8px; left: 50%; transform: translateX(-50%); background: white; box-shadow: 0 0 9px #fff9; }
.power-actions { display: flex; gap: 7px; margin: 1px 0 0; align-items: center; }
.power-actions .btn { flex: 1; padding: 0 8px; min-height: 40px; font-size: .83rem; }
.power-actions .btn .icon { width: 16px; height: 16px; }
.power-actions .help-link { font-size: .74rem; color: #e9bde1; cursor: pointer; padding: 5px 3px; background: transparent; border: 0; text-align: right; min-width: 61px; min-height: 40px; }
.power-actions .help-link[aria-pressed="true"] { color: white; }
.power-actions .help-link:hover { text-decoration: underline; }

.studio-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.studio-canvas-panel { padding: 10px; overflow: hidden; }
.studio-side { display: grid; gap: 14px; }
.studio-note, .caption-panel { padding: clamp(14px, 1.8vw, 21px); }
.studio-note { position: relative; overflow: hidden; background: radial-gradient(ellipse at 96% -7%, #8155ac57, transparent 60%), #201632; }
.studio-note::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #201632 47%, #201632c0 75%, #20163288), url("assets/draw.webp") 100% 38% / 70% auto no-repeat; pointer-events: none; }
.studio-note > * { position: relative; }
.studio-note h2, .caption-panel h2 { font-size: 1.36rem; font-weight: 840; letter-spacing: -.044em; line-height: 1.12; }
.studio-note p { font-size: .92rem; line-height: 1.45; min-height: 64px; margin: 8px 0 11px; max-width: 31ch; color: #f0e7fa; text-wrap: pretty; }
.studio-note .topic { width: fit-content; margin-bottom: 8px; color: #cfeaff; }
.studio-prompt-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.studio-prompt-actions .btn { min-height: 37px; padding-inline: 9px; font-size: .79rem; background: #291d3ce6; }
.studio-prompt-actions .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.studio-prompt-actions .icon { width: 15px; height: 15px; }
.drawing-surface { position: relative; overflow: hidden; border-radius: 12px; background: #fcf8ff; aspect-ratio: 16 / 10; }
.draw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; display: block; touch-action: none; }
.drawing-surface .mirror-line { position: absolute; width: 0; top: 0; bottom: 0; left: 50%; border-right: 1px dashed #40166c73; pointer-events: none; }
.drawing-surface .mirror-line[hidden] { display: none; }
.draw-toolbar, .draw-palette { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 9px; }
.draw-toolbar { padding-bottom: 7px; border-bottom: 1px solid #392948; }
.tool-button {
  min-height: 38px; min-width: 37px; border-radius: 8px; border: 1px solid #4b365d; color: #e9d8fa; background: #2a1d3b;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 6px; font-weight: 760; font-size: .76rem;
}
.tool-button .icon { width: 16px; height: 16px; }
.tool-button:hover:not(:disabled) { background: #432d57; border-color: var(--accent); }
.tool-button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: #29304b; }
.tool-button:disabled { opacity: .39; }
.tool-divider { width: 1px; height: 19px; margin-inline: 3px; background: #5c426d; }
.size-label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .76rem; white-space: nowrap; padding-left: 3px; }
.size-label input { width: clamp(62px, 8vw, 99px); accent-color: #cfa4ff; }
.swatch { width: 33px; height: 33px; border-radius: 50%; border: 2px solid #ffffff3f; background: var(--ink); position: relative; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch:hover { border-color: white; }
.colour-label { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: .75rem; margin-left: 3px; }
.colour-label input { width: 29px; height: 30px; border-radius: 6px; padding: 1px; background: #322141; border: 1px solid #74588a; cursor: pointer; }
.caption-panel { background: #1b1329; }
.caption-panel label { display: block; color: var(--muted); font-size: .88rem; margin: 7px 0; line-height: 1.36; }
.caption-panel textarea {
  width: 100%; resize: vertical; min-height: 73px; max-height: 230px; border: 1px solid #634985; border-radius: 9px; padding: 8px 10px; display: block;
  background: #110c1b; color: white; line-height: 1.35; font-size: .92rem;
}
.caption-panel textarea::placeholder { color: #ae9bc4; }
.caption-tip { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; color: #d3c3e2; font-size: .76rem; line-height: 1.37; }
.caption-tip .icon { color: var(--accent); width: 14px; height: 14px; }
.caption-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.caption-actions .btn { min-height: 40px; padding: 0 9px; font-size: .82rem; }
.caption-feedback { color: #cfe9ff; font-size: .82rem; margin-top: 9px; line-height: 1.33; }
.caption-feedback:empty { display: none; }

.progress-hero {
  display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: clamp(17px, 4vw, 36px);
  border: 1px solid #5d3d79; border-radius: 20px;
  background: radial-gradient(ellipse at 83% 48%, #64368c88 0%, transparent 62%), linear-gradient(135deg, #231436, #26143d);
}
.progress-hero h1 { margin: 9px 0 6px; }
.progress-hero p:last-child, .progress-footer p { color: var(--muted); font-size: .93rem; }
.progress-hero-star { color: #efb3ff; transform: rotate(13deg); filter: drop-shadow(0 0 24px #db9fff9c); }
.progress-hero-star .icon { width: clamp(42px, 12vw, 112px); height: clamp(42px, 12vw, 112px); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin: 15px 0 25px; }
.stat { display: grid; justify-items: start; gap: 5px; border: 1px solid #48335e; background: var(--panel); border-radius: 14px; padding: 13px; color: var(--muted); font-size: .82rem; font-weight: 680; }
.stat strong { color: white; font-size: 1.62rem; font-weight: 880; letter-spacing: -.05em; }
.stat-icon { color: #ebbeff; }
.badge-section h2 { margin-bottom: 10px; }
.badge { padding: 11px; border: 1px solid rgba(var(--accent-rgb), .21); background: var(--panel); border-radius: 13px; display: flex; align-items: flex-start; gap: 10px; }
.badge.earned { background: rgba(var(--accent-rgb), .09); border-color: rgba(var(--accent-rgb), .49); }
.badge-icon { height: 39px; flex: 0 0 39px; color: var(--accent); background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-rgb), .24); display: grid; place-items: center; border-radius: 10px; }
.badge h3 { font-size: .97rem; font-weight: 830; }
.badge p { font-size: .8rem; margin-top: 4px; color: var(--muted); line-height: 1.32; min-height: 2em; }
.badge-state { font-size: .71rem; display: flex; align-items: center; gap: 4px; margin-top: 5px; color: var(--accent); font-weight: 770; }
.badge-state .icon { width: 13px; height: 13px; }
.progress-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.progress-footer p { font-size: .77rem; }

.round-result {
  position: relative; overflow: hidden; isolation: isolate; min-height: 440px;
  border: 1px solid rgba(var(--accent-rgb), .45); border-radius: 22px;
  padding: 14px 20px 24px;
  background: linear-gradient(90deg, #150c23de, #1d102de8, #150c23de), var(--result-art) center 55% / cover;
}
.round-result.skate { --result-art: url("assets/skate.webp"); }
.round-result.hoops { --result-art: url("assets/hoops.webp"); }
.result-content { margin: 12px auto; max-width: 680px; text-align: center; position: relative; }
.result-medal { margin: 0 auto 14px; color: var(--accent); border-radius: 24px; display: grid; place-items: center; width: 76px; height: 76px; background: rgba(var(--accent-rgb), .14); border: 1px solid var(--accent); box-shadow: 0 0 28px rgba(var(--accent-rgb), .37); }
.result-medal .icon { width: 44px; height: 44px; }
.result-kicker { color: var(--accent); font-weight: 790; font-size: .83rem; }
.result-content h1 { color: white; font-size: clamp(2.05rem, 7vw, 4rem); font-weight: 900; letter-spacing: -.064em; margin: 2px 0 8px; line-height: 1.05; }
.result-content > p:not(.result-kicker) { color: #e4d2ef; line-height: 1.41; }
.result-stars { width: fit-content; margin: 12px auto 6px; display: flex; align-items: center; color: #ffdafa; gap: 7px; font-size: 1.28rem; font-weight: 860; }
.result-detail { font-size: .81rem; }
.result-actions { margin-top: 16px; display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; }
.confetti { pointer-events: none; position: absolute; inset: 0; overflow: hidden; z-index: 5; }
.confetti i { position: absolute; width: 7px; height: 11px; top: 56%; left: 50%; border-radius: 2px; background: var(--paper-colour); opacity: 0; animation: confetti 850ms var(--delay) ease-out forwards; }
@keyframes confetti {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  14% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--spin)); }
}
.arcade-dialog {
  max-width: min(510px, calc(100% - 26px)); width: 100%; border: 1px solid #7c52a1; border-radius: 18px;
  padding: 17px; background: #241631; color: white; box-shadow: 0 22px 88px #000a;
}
.arcade-dialog::backdrop { background: #0d0718bd; backdrop-filter: blur(4px); }
.dialog-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.dialog-title h2 { font-size: 1.36rem; font-weight: 850; letter-spacing: -.035em; }
.dialog-title .icon-button { min-height: 36px; min-width: 36px; }
.dialog-copy p { color: #e6d8ee; line-height: 1.5; font-size: .92rem; margin-bottom: 8px; }
.dialog-copy .source-links { display: flex; flex-wrap: wrap; gap: 8px 13px; font-size: .82rem; }
.dialog-copy .source-links a { color: #dcb6ff; text-decoration: underline; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; margin-top: 13px; }
.dialog-actions:empty { display: none; }
.picture-preview { max-height: 51vh; border-radius: 10px; margin: 8px auto 12px; object-fit: contain; }
.picture-download { display: flex; margin-left: auto; }

@media (max-width: 1020px) {
  .shell, .topbar-inner { width: calc(100% - 48px); }
  .game-layout, .studio-layout { grid-template-columns: minmax(0, 1.37fr) minmax(0, 1fr); }
  .scene { min-height: 330px; }
  .hero-art { width: 83%; object-position: 69% 43%; }
}
@media (max-width: 770px) {
  .shell, .topbar-inner { width: calc(100% - 32px); }
  main.shell { padding: 18px 0 36px; }
  .topbar-inner { height: 60px; }
  .top-actions { gap: 5px; }
  .star-wallet, .sound-button { min-height: 37px; min-width: 37px; padding-inline: 6px; }
  .star-wallet { min-width: 45px; }
  .site-nav a { padding: 7px 8px; font-size: .75rem; min-height: 34px; }
  .site-nav .icon { width: 14px; height: 14px; }
  .brand { gap: 6px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 11px; }
  .brand-mark .icon { width: 22px; height: 22px; }
  .brand-name { font-size: .78rem; }
  .brand-name span { font-size: .55rem; }
  .hero { height: 395px; border-radius: 20px; }
  .hero-art { width: 100%; object-position: 68% 46%; }
  .hero-content { max-width: 67%; }
  .hero h1 { font-size: clamp(3.2rem, 9vw, 5rem); }
  .hero-description { font-size: .91rem; max-width: 280px; }
  .games-section { margin-top: 22px; scroll-margin-top: 76px; }
  .card-grid, .badge-grid { gap: 8px; }
  .card-content { padding: 9px 8px; }
  .card-mode-icon { display: none; }
  .card-title { min-height: 23px; }
  .card-content p { font-size: .78rem; }
  .card-action { font-size: .75rem; }
  .card-action span { width: 21px; height: 21px; }
  .card-action .icon { width: 12px; height: 12px; }
  .game-layout, .studio-layout { grid-template-columns: 1fr; }
  .scene { min-height: 245px; aspect-ratio: 1.72; }
  .challenge-panel { padding: 14px; }
  .challenge-prompt { font-size: 1.55rem; }
  .hoops .challenge-prompt { font-size: 1.32rem; }
  .studio-side { gap: 9px; }
}
@media (max-width: 510px) {
  .shell, .topbar-inner { width: calc(100% - 24px); }
  .topbar-inner { gap: 5px; }
  .brand-name { display: none; }
  .site-nav { gap: 1px; padding: 3px; }
  .site-nav a { gap: 4px; }
  .star-wallet { font-size: .82rem; }
  .star-wallet .icon { width: 14px; }
  .hero { height: 453px; align-items: flex-end; border-radius: 16px; }
  .hero-art { height: 76%; object-position: 70% 47%; mask-image: none; }
  .hero-shade { background: linear-gradient(0deg, #1b1029 6%, #1b1029 20%, #1b1029e9 35%, #210d3572 57%, #190b2d00 79%), linear-gradient(90deg, #1a0d285e, transparent 58%); }
  .hero-content { padding: 0 14px 16px; max-width: 100%; }
  .hero-level { min-height: 24px; padding: 3px 7px; font-size: .67rem; gap: 5px; }
  .hero-level .icon { width: 13px; height: 13px; }
  .hero h1 { margin: 10px 0 8px; font-size: clamp(2.7rem, 11.6vw, 3.72rem); }
  .hero-description { max-width: 285px; font-size: .87rem; line-height: 1.36; }
  .hero-button { min-height: 40px; margin-top: 12px; font-size: .84rem; padding-inline: 10px; gap: 6px; }
  .hero-button .button-arrow { margin-left: 0; }
  .section-heading { gap: 8px; margin-bottom: 10px; }
  .section-icon { width: 38px; height: 38px; border-radius: 11px; }
  .section-icon .icon { width: 20px; height: 20px; }
  .section-heading h2 { font-size: 1.42rem; }
  .section-heading p { margin-top: 2px; font-size: .76rem; }
  .card-grid, .badge-grid { grid-template-columns: 1fr; gap: 10px; }
  .game-card { border-radius: 14px; }
  .card-art { aspect-ratio: 2.42; }
  .card-content { padding: 9px 10px 10px; flex: 1; }
  .card-mode-icon { display: grid; flex-basis: 27px; height: 27px; }
  .card-mode-icon .icon { width: 15px; height: 15px; }
  .card-content p { font-size: .84rem; }
  .card-action { font-size: .82rem; }
  .game-title-icon { width: 43px; height: 43px; border-radius: 12px; }
  .game-title-icon .icon { width: 23px; height: 23px; }
  .game-title-row { gap: 8px; }
  .game-title-row h1 { font-size: 1.96rem; }
  .game-title-row p { font-size: .82rem; }
  .game-heading { margin-bottom: 11px; }
  .scene-stats { top: 7px; left: 7px; }
  .scene-badge { font-size: .65rem; padding: 3px 6px; min-height: 25px; }
  .scene-badge .icon { width: 12px; height: 12px; }
  .scene-banner { font-size: .84rem; }
  .scene { min-height: 228px; }
  .play-controls { padding: 7px 8px; }
  .controls-caption { margin-top: 5px; }
  .studio-canvas-panel { padding: 7px; }
  .size-label { padding-left: 0; }
  .tool-divider { margin: 0 1px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .stat { padding: 9px; }
  .progress-hero { gap: 7px; padding: 11px; }
  .progress-hero h1 { font-size: 1.87rem; }
  .progress-hero p:last-child { font-size: .83rem; }
  .badge p { min-height: auto; }
  .footer { font-size: .73rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

[hidden] { display: none !important; }
.power-actions .btn[data-steady] { flex: 0 0 auto; }
.power-actions .btn[data-steady][aria-pressed="true"] { border-color: #ffc0e3; color: #fff0fc; background: #512c57; }
.level-intro{margin:15px 0 24px;color:var(--muted);line-height:1.6}.level-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.level-card{text-align:left;color:white;background:radial-gradient(ellipse at 100% 0%,#69418a66,transparent 70%),#21132f;border:1px solid #77509a;border-radius:20px;padding:23px;min-height:180px;transition:transform .2s,box-shadow .2s}.level-card:hover:enabled{transform:translateY(-4px);box-shadow:0 10px 35px #bb65ef35}.level-card:disabled{opacity:.48}.level-number{display:grid;place-items:center;width:42px;height:42px;background:#c78bf4;color:#251134;border-radius:13px;font-weight:900;margin-bottom:14px}.level-card h2{font-size:1.2rem;margin-bottom:12px}.level-card p{font-size:.85rem;color:#f4b5df}.level-ribbon{display:flex;justify-content:space-between;align-items:center;color:#dbb7f5;font-size:.84rem;margin-bottom:8px}.draw-palette{gap:9px;padding:6px}.swatch{width:34px;height:34px}.hero-art{width:80%;object-position:70% 40%}.hero h1{letter-spacing:-.055em}@media(max-width:770px){.level-grid{grid-template-columns:repeat(2,1fr)}.hero-art{width:100%}}@media(max-width:450px){.level-grid{grid-template-columns:1fr}.level-ribbon{font-size:.72rem}.hero-art{object-position:75% 35%}}
