/* CUBEPHONE platform design system (R-022). Three worlds own a colour each; graphite is the stage, milk the light.
   Scale: one huge thing per screen (world title, hero), big tiles you can steer with the cube, small calm chrome.
   No glow, no borders as decoration; sticker squares (rounded 3x3 grid) and the banner's step / wave edges. */
@font-face { font-family: Handjet; src: url(../fonts/Handjet.ttf); font-display: swap; }
:root {
  --arcade: #DF4D56; --edu: #288267; --music: #EFC54B; --orange: #F09560; --blue: #4E69C1;
  --milk: #F8F6F0; --ink: #23262E; --ink2: #1B1D23; --ink3: #15171B; --card: #2B2F38; --card2: #343944;
  --muted: rgba(248,246,240,.66); --faint: rgba(248,246,240,.1);
  --arcade-ink: #fbe9ea; --edu-ink: #e3f1ec; --music-ink: #3a2f12;
  --world: var(--blue); --world-ink: var(--milk);
  --r: 22px; --r-sm: 14px;
  --t-hero: clamp(44px, 7.4vw, 120px); --t-h1: clamp(30px, 4.2vw, 58px); --t-h2: clamp(20px, 2.2vw, 28px);
  --focus: 0 0 0 4px var(--ink), 0 0 0 9px var(--milk);
  --ease: cubic-bezier(.2,.9,.25,1.15);
}
[data-world="arcade"] { --world: var(--arcade); --world-ink: var(--arcade-ink); }
[data-world="edu"] { --world: var(--edu); --world-ink: var(--edu-ink); }
[data-world="music"] { --world: var(--music); --world-ink: var(--music-ink); }
[data-world="util"] { --world: var(--blue); --world-ink: var(--milk); }

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--ink); color: var(--milk); font: 400 16px/1.55 Rubik, system-ui, sans-serif; min-height: 100vh; -webkit-font-smoothing: antialiased; }
body.big { font-size: 19px; } body.contrast { --muted: rgba(248,246,240,.94); --card: #0d0e11; --ink: #000; }
body.calm .rank, body.calm .timer-big { display: none !important; }
body.power *, body.noanim * { animation: none !important; transition: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3 { font-family: Unbounded, sans-serif; font-weight: 800; letter-spacing: .005em; margin: 0; }
h1 { font-size: var(--t-h1); line-height: 1.04; }
h2 { font-size: var(--t-h2); line-height: 1.15; margin: 40px 0 16px; }
h3 { font-size: 17px; line-height: 1.2; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.pixel { font-family: Handjet, monospace; font-weight: 700; letter-spacing: .04em; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ chrome */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 22px; background: rgba(21,23,27,.92); backdrop-filter: blur(10px); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 15px Unbounded, sans-serif; letter-spacing: .05em; margin-right: 8px; }
.logo img { width: 30px; height: 30px; }
.worlds { display: flex; gap: 6px; }
.worlds a { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 12px; text-decoration: none; font: 800 13px Unbounded, sans-serif; letter-spacing: .03em; color: var(--muted); transition: background .2s, color .2s; }
.worlds a i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.worlds a:hover { color: var(--milk); background: var(--faint); }
.worlds a.on { background: var(--c); color: var(--ci); } .worlds a.on i { background: var(--ci); }
.chips { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chip { display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 12px; background: var(--card); font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap; }
.chip .led { width: 9px; height: 9px; border-radius: 3px; background: var(--muted); }
.chip.cube-on .led { background: #5fd39b; } .chip.cube-busy .led { animation: blink .8s steps(2) infinite; background: var(--music); }
.chip.cube-off { background: var(--music); color: var(--ink); font-weight: 700; } .chip.cube-off .led { background: var(--ink); }
.chip.ava { padding: 4px 12px 4px 4px; } .chip.ava b { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--world); font-size: 15px; }
.chip.icon { width: 38px; height: 38px; justify-content: center; padding: 0; font-size: 18px; }
.chip.founder { background: var(--orange); color: var(--ink); font-weight: 700; }
@keyframes blink { 50% { opacity: .2; } }
.subnav { display: flex; gap: 6px; padding: 0 22px 10px; background: rgba(21,23,27,.92); position: sticky; top: 58px; z-index: 19; overflow-x: auto; }
.subnav a { text-decoration: none; padding: 6px 12px; border-radius: 10px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.subnav a.on, .subnav a:hover { color: var(--milk); background: var(--faint); }

main { min-height: calc(100vh - 100px); }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 28px; }
.pad { padding-top: 28px; padding-bottom: 90px; }

/* ------------------------------------------------------------------ focus (cube / keyboard / pad navigation) */
[data-nav] { outline: none; transition: transform .18s var(--ease), box-shadow .18s; }
[data-nav]:focus-visible, [data-nav].focus { box-shadow: var(--focus); transform: scale(1.035); z-index: 2; }
.navhint { position: fixed; right: 18px; bottom: 16px; z-index: 30; display: flex; gap: 6px; padding: 8px 10px; border-radius: 12px; background: rgba(21,23,27,.92); font-size: 12px; color: var(--muted); }
.navhint b { font: 800 12px Unbounded, sans-serif; color: var(--milk); background: var(--card2); border-radius: 6px; padding: 2px 6px; }

/* ------------------------------------------------------------------ home hero: the banner, alive */
.hero3 { position: relative; height: min(74vh, 720px); min-height: 460px; overflow: hidden; background: var(--music); }
.hero3 svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero3 .zone { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; text-decoration: none; padding: 0 3vw; }
.hero3 .zone[data-w="arcade"] { left: 0; width: 34%; align-items: flex-end; text-align: right; color: var(--arcade-ink); }
.hero3 .zone[data-w="edu"] { left: 36%; width: 28%; align-items: center; text-align: center; color: var(--edu-ink); }
.hero3 .zone[data-w="music"] { right: 0; width: 34%; align-items: flex-start; color: var(--music-ink); }
.hero3 .zone .name { font: 800 clamp(30px, 4.3vw, 70px)/1 Unbounded, sans-serif; display: flex; align-items: center; gap: .3em; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; color: var(--milk); }
.hero3 .zone[data-w="music"] .name { color: #3b3320; -webkit-text-stroke: 0; }
.hero3 .zone .tag { font-weight: 700; font-size: clamp(13px, 1.1vw, 17px); margin-top: 10px; }
.hero3 .zone .live { margin-top: 18px; display: inline-flex; gap: 8px; align-items: center; padding: 9px 14px; border-radius: 12px; background: rgba(0,0,0,.16); font-weight: 500; font-size: 14px; }
.hero3 .zone[data-w="music"] .live { background: rgba(35,38,46,.1); }
.hero3 .zone:focus-visible, .hero3 .zone.focus { box-shadow: none; transform: none; }
.hero3 .zone:focus-visible .name, .hero3 .zone.focus .name { transform: scale(1.06); }
.hero3 .zone .name { transition: transform .25s var(--ease); }
.hero3 .slogan { position: absolute; right: 6vw; bottom: 9%; text-align: right; font-size: clamp(22px, 2.6vw, 44px); line-height: 1.05; color: #3b3320; pointer-events: none; }
.glyph { display: inline-grid; grid-template-columns: repeat(3, .22em); gap: .05em; }
.glyph i { width: .22em; height: .22em; border-radius: .05em; background: currentColor; opacity: .25; }
.glyph i.on { opacity: 1; }

/* ------------------------------------------------------------------ tiles (Switch row) */
.row { display: flex; gap: 18px; overflow-x: auto; padding: 14px 6px 22px; scroll-snap-type: x proximity; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.tile { position: relative; flex: 0 0 auto; width: 230px; height: 230px; border-radius: var(--r); background: var(--world); color: var(--world-ink); padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; text-decoration: none; overflow: hidden; scroll-snap-align: start; }
.tile.big { width: 330px; height: 330px; }
.tile h3 { font-size: 20px; position: relative; }
.tile .k { position: relative; font-size: 13px; opacity: .85; margin-top: 4px; }
.tile .art { position: absolute; inset: 0; background-size: cover; background-position: center; }
.tile .art + .shade { position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.55)); }
.tile.has-art { color: var(--milk); }
.tile .lock { position: absolute; top: 14px; right: 14px; padding: 4px 9px; border-radius: 8px; background: rgba(0,0,0,.28); font-size: 12px; font-weight: 700; }
.tile.soon { filter: saturate(.35) brightness(.8); }
.tile .stk { position: absolute; top: 18px; left: 18px; display: grid; grid-template-columns: repeat(3, 16px); gap: 5px; }
.tile .stk i { width: 16px; height: 16px; border-radius: 5px; background: currentColor; opacity: .22; }
.tile .stk i.on { opacity: .9; }
.tile.small { width: 190px; height: 120px; background: var(--card); color: var(--milk); }
.tile.small h3 { font-size: 15px; }
.focusinfo { min-height: 54px; padding: 0 6px; }
.focusinfo b { font: 800 18px Unbounded, sans-serif; } .focusinfo span { color: var(--muted); margin-left: 10px; }

/* second row (smaller: Creation, Streaming, Competitions, Collection) */
.second { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.second a { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r-sm); background: var(--card); text-decoration: none; }
.second a b { font: 800 15px Unbounded, sans-serif; display: block; } .second a span { color: var(--muted); font-size: 13px; }
.second a .ic { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--card2); }

/* home lower: feed + friends (Battle.net) */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.post { background: var(--card); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.post .img { aspect-ratio: 16/7; background: var(--world); background-size: cover; background-position: center; }
.post .body { padding: 18px 20px; } .post h3 { font-size: 19px; margin-bottom: 6px; } .post .meta { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.friends { background: var(--ink2); border-radius: var(--r); padding: 18px; position: sticky; top: 120px; }
.friend { display: flex; gap: 10px; align-items: center; padding: 8px 0; } .friend b { width: 34px; height: 34px; border-radius: 10px; background: var(--card2); display: grid; place-items: center; }
.friend span { font-size: 13px; color: var(--muted); display: block; }

/* ------------------------------------------------------------------ world page */
.worldhead { background: var(--world); color: var(--world-ink); position: relative; overflow: hidden; }
.worldhead .wrap { padding-top: 46px; padding-bottom: 34px; position: relative; }
.worldhead h1 { font-size: var(--t-hero); line-height: .95; }
.worldhead p { font-size: 19px; margin-top: 12px; max-width: 34em; opacity: .9; }
.worldhead .steps { position: absolute; right: 0; bottom: 0; width: 42%; height: 100%; opacity: .25; }
.panel { background: var(--card); border-radius: var(--r); padding: 20px 22px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; align-items: start; }

/* ------------------------------------------------------------------ game page (Steam) */
.ghero { position: relative; height: min(54vh, 520px); min-height: 320px; background: var(--world); background-size: cover; background-position: center; overflow: hidden; }
.ghero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, var(--ink)); }
.ghero .logoimg { position: absolute; left: 6%; bottom: 22%; max-width: 40%; max-height: 40%; z-index: 1; }
.ghero .title { position: absolute; left: 6%; bottom: 18%; z-index: 1; font-size: var(--t-hero); color: var(--milk); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.gbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: -60px; position: relative; z-index: 2; }
.play { display: inline-flex; align-items: center; gap: 10px; padding: 16px 30px; border-radius: 16px; background: var(--world); color: var(--world-ink); font: 800 17px Unbounded, sans-serif; text-decoration: none; }
.play.ghost { background: var(--card); color: var(--milk); }
.req { display: flex; flex-wrap: wrap; gap: 6px; } .req span { padding: 5px 10px; border-radius: 9px; background: var(--card2); font-size: 13px; }

/* ------------------------------------------------------------------ generic controls */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 13px; background: var(--card2); font-weight: 500; text-decoration: none; }
.btn:hover { background: #3e4451; }
.btn.main { background: var(--world); color: var(--world-ink); font: 800 14px Unbounded, sans-serif; }
.btn.warn { background: var(--arcade); color: var(--milk); }
.btn[disabled] { opacity: .45; cursor: default; }
.pick { padding: 9px 14px; border-radius: 12px; background: var(--card); } .pick.on { background: var(--milk); color: var(--ink); }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea, .input { padding: 13px 15px; border-radius: 12px; border: 0; background: var(--ink2); color: var(--milk); font-size: 16px; min-width: 0; width: 100%; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { outline: 2px solid var(--world); }
.form { display: grid; gap: 14px; max-width: 560px; }
.line { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.note { padding: 16px 18px; border-radius: var(--r-sm); background: var(--ink2); color: var(--muted); }
.note.warn { background: var(--arcade); color: var(--milk); }
.note.ok { background: var(--edu); color: var(--milk); }
.toggle { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--faint); }
.toggle input { width: 20px; height: 20px; accent-color: var(--world); }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; justify-items: center; }
.toast { padding: 12px 18px; border-radius: 14px; background: var(--milk); color: var(--ink); font-weight: 500; animation: pop .35s var(--ease); }
.toast.warn { background: var(--arcade); color: var(--milk); }
@keyframes pop { from { transform: translateY(14px) scale(.96); opacity: 0; } }

/* ------------------------------------------------------------------ profile (the soul) */
.soul { position: relative; padding: 40px 0 28px; background: linear-gradient(115deg, var(--arcade) 0 33%, var(--edu) 33% 66%, var(--music) 66%); }
.soul .wrap { display: flex; gap: 26px; align-items: flex-end; }
.soul .ava { width: 140px; height: 140px; border-radius: 34px; background: var(--ink); display: grid; place-items: center; font-size: 70px; box-shadow: 0 0 0 6px var(--ink); }
.soul .who { background: var(--ink); border-radius: 22px; padding: 18px 22px; flex: 1; }
.soul h1 { font-size: clamp(28px, 3.6vw, 48px); }
.lvlbar { height: 12px; border-radius: 6px; background: var(--card2); margin: 10px 0 6px; max-width: 420px; overflow: hidden; } .lvlbar i { display: block; height: 100%; background: var(--music); border-radius: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--card); border-radius: var(--r-sm); padding: 16px; } .stat b { display: block; font: 800 26px Unbounded, sans-serif; } .stat span { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ collection cards (rarity by TPS) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.acard { position: relative; aspect-ratio: 5/7; border-radius: 18px; padding: 10px; background: var(--rar, var(--card2)); text-decoration: none; }
.acard .in { height: 100%; border-radius: 12px; background: var(--ink2); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.acard .set { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.acard h3 { font-size: 15px; }
.acard .alg { font-family: Handjet, monospace; font-size: 19px; line-height: 1.05; color: var(--milk); flex: 1; overflow: hidden; }
.acard .foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.acard.locked { --rar: var(--card); } .acard.locked .in { opacity: .45; }
.rar-bronze { --rar: linear-gradient(140deg, #b77a4b, #6b432a); } .rar-silver { --rar: linear-gradient(140deg, #dfe3ea, #7c8392); }
.rar-gold { --rar: linear-gradient(140deg, #f6d36a, #a8781d); } .rar-platinum { --rar: linear-gradient(140deg, #bff1ef, #4c8f9a 60%, #d5f7ff); }
.rar-diamond { --rar: conic-gradient(from 30deg, #9ad7ff, #c9a8ff, #ffb3d1, #a8ffe0, #9ad7ff); }
.rarity { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; background: var(--rar); color: var(--ink); }

/* ------------------------------------------------------------------ lesson / 3D */
.stage { position: relative; background: var(--ink2); border-radius: var(--r); overflow: hidden; min-height: 420px; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage .hint { position: absolute; left: 22px; bottom: 20px; right: 22px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; pointer-events: none; }
.bigmove { font: 800 clamp(48px, 7vw, 96px)/1 Unbounded, sans-serif; color: var(--milk); }
.seq { display: flex; gap: 8px; flex-wrap: wrap; }
.seq span { min-width: 52px; padding: 10px 12px; text-align: center; border-radius: 12px; background: var(--card); font: 800 17px Unbounded, sans-serif; color: var(--muted); }
.seq span.now { background: var(--music); color: var(--ink); } .seq span.done { background: var(--edu); color: var(--milk); }
.progress { height: 10px; border-radius: 5px; background: var(--card); overflow: hidden; } .progress i { display: block; height: 100%; background: var(--edu); transition: width .3s; }

/* ------------------------------------------------------------------ frame for Cubophone modules */
.frame { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--ink3); }
.frame[hidden] { display: none; }
.framebar { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--world); color: var(--world-ink); }
.framebar b { font: 800 15px Unbounded, sans-serif; } .framebar button { padding: 8px 14px; border-radius: 10px; background: rgba(0,0,0,.2); font-weight: 700; }
.framebar .fine { margin-left: auto; font-size: 12px; opacity: .8; }
.frame iframe { flex: 1; width: 100%; border: 0; background: #000; }

/* ------------------------------------------------------------------ founder mode */
.founderbar { position: sticky; top: 58px; z-index: 18; background: var(--orange); color: var(--ink); padding: 8px 22px; font-weight: 700; display: flex; gap: 14px; align-items: center; }
.founderbar a { text-decoration: none; padding: 4px 10px; border-radius: 8px; background: rgba(0,0,0,.12); }
.edit { position: absolute; top: 10px; right: 10px; z-index: 3; padding: 6px 10px; border-radius: 9px; background: var(--orange); color: var(--ink); font-weight: 700; font-size: 13px; text-decoration: none; }
.cms { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.cms nav { display: grid; gap: 6px; align-content: start; } .cms nav a { padding: 10px 14px; border-radius: 12px; text-decoration: none; background: var(--card); } .cms nav a.on { background: var(--orange); color: var(--ink); font-weight: 700; }
.list { display: grid; gap: 8px; } .list .it { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--card); }
.list .it .th { width: 56px; height: 56px; border-radius: 10px; background: var(--world); background-size: cover; flex: 0 0 56px; }
.list .it b { flex: 1; } .imgpick { display: flex; gap: 12px; align-items: center; } .imgpick .pv { width: 160px; height: 90px; border-radius: 12px; background: var(--card2); background-size: cover; background-position: center; }

/* ------------------------------------------------------------------ connect wizard */
.wizard { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(21,23,27,.82); padding: 16px; }
.wizard .box { width: min(620px, 100%); background: var(--ink); border-radius: 26px; padding: 30px; border-top: 10px solid var(--music); }
.wizard ol { padding-left: 20px; display: grid; gap: 10px; } .wizard li b { color: var(--music); }
.wizard .shot { background: var(--ink2); border-radius: 14px; padding: 14px; font-size: 14px; }

@media (max-width: 900px) {
  .split, .cms { grid-template-columns: 1fr; } .friends { position: static; }
  .worlds a span { display: none; } .top { padding: 8px 12px; } .wrap { padding: 0 16px; }
  .hero3 { height: auto; min-height: 0; } .hero3 svg { display: none; }
  .hero3 .zone { position: static; width: auto !important; padding: 34px 20px; align-items: flex-start !important; text-align: left !important; }
  .hero3 .zone[data-w="arcade"] { background: var(--arcade); } .hero3 .zone[data-w="edu"] { background: var(--edu); } .hero3 .zone[data-w="music"] { background: var(--music); }
  .hero3 .slogan { display: none; } .tile { width: 180px; height: 180px; } .tile.big { width: 240px; height: 240px; }
  .soul .wrap { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------------ community blocks (from the prototype) */
.legacy h2 { margin-top: 30px; }
.legacy .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.legacy .card { background: var(--card); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; position: relative; overflow: hidden; }
.legacy .card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 6px; background: var(--world); }
.legacy .card.c-arcade::before { background: var(--arcade); } .legacy .card.c-edu::before { background: var(--edu); } .legacy .card.c-music::before { background: var(--music); } .legacy .card.c-util::before { background: var(--blue); }
.legacy .card h3 { font-size: 17px; } .legacy .card p { color: var(--muted); font-size: 14px; flex: 1; }
.legacy .card .play, .legacy .card .cta { align-self: flex-start; padding: 10px 16px; font-size: 13px; border-radius: 12px; }
.legacy .cta { display: inline-flex; padding: 13px 20px; border-radius: 14px; background: var(--world); color: var(--world-ink); font: 800 14px Unbounded, sans-serif; text-decoration: none; border: 0; cursor: pointer; }
.legacy .tags { display: flex; gap: 6px; flex-wrap: wrap; } .legacy .tags span { font-size: 12px; padding: 4px 9px; border-radius: 8px; background: var(--card2); color: var(--muted); }
.legacy .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; overflow: visible; padding: 6px 0; }
.legacy .form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.legacy .form input, .legacy .form select, .legacy .form textarea, .legacy .search, .legacy .chat input { padding: 13px 15px; border-radius: 12px; border: 0; background: var(--ink2); color: var(--milk); font-size: 16px; min-width: 0; }
.legacy .form.row { display: flex; max-width: none; }
.legacy .fine { font-size: 13px; color: var(--muted); }
.legacy .task { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--card); margin: 6px 0; flex-wrap: wrap; }
.legacy .task span { flex: 1; } .legacy .task em { color: var(--music); font-style: normal; } .legacy .task.done { opacity: .55; }
.legacy .lane { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.legacy .lane span { min-width: 54px; padding: 14px; text-align: center; border-radius: 12px; background: var(--card); font: 800 18px Unbounded, sans-serif; color: var(--muted); }
.legacy .lane span.now { background: var(--music); color: var(--ink); } .legacy .lane span.perfect { background: var(--edu); color: var(--milk); }
.legacy .lane span.good { background: var(--blue); color: var(--milk); } .legacy .lane span.ok { background: var(--orange); color: var(--ink); } .legacy .lane span.miss { background: var(--arcade); color: var(--milk); opacity: .6; }
.legacy .stepbox { display: grid; gap: 8px; background: var(--card); border-radius: 14px; padding: 14px; }
.legacy .bracket { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 14px; overflow-x: auto; }
.legacy .bracket > div { display: grid; gap: 12px; align-content: space-around; }
.legacy .match { background: var(--card); border-radius: 12px; overflow: hidden; display: grid; } .legacy .match span { padding: 8px 12px; } .legacy .match.final { background: var(--music); color: var(--ink); font-weight: 700; }
.legacy .chat { background: var(--ink2); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; } .legacy .chat .msgs { height: 340px; overflow-y: auto; display: grid; align-content: end; gap: 4px; }
.legacy .chat form { display: flex; gap: 8px; } .legacy .chat input { flex: 1; }
.net { display: grid; grid-template-columns: repeat(4, 84px); gap: 6px; margin: 10px 0 18px; } .net .face { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; } .net .face i { aspect-ratio: 1; border-radius: 5px; }
.legacy .top { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; max-width: 560px; }
.legacy .top li { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--card); } .legacy .top li b { width: 28px; color: var(--muted); } .legacy .top li em { margin-left: auto; font-style: normal; color: var(--muted); }
.legacy .top li.me { background: var(--music); color: var(--ink); }
.legacy .tier { min-height: 280px; } .legacy .tier ul { margin: 0; padding-left: 18px; color: var(--muted); flex: 1; }
.legacy .tier.premium { background: var(--blue); } .legacy .tier.edu { background: var(--edu); } .legacy .price { font: 800 28px Unbounded, sans-serif; } .legacy .price small { font: 400 14px Rubik, sans-serif; color: var(--muted); }
.legacy .card.owned { outline: 3px solid var(--edu); }
.legacy .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

/* ------------------------------------------------------------------ back button, cube dock, calibration */
.backbtn { width: 42px; height: 42px; border-radius: 12px; background: var(--card); font: 800 20px Unbounded, sans-serif; display: grid; place-items: center; }
.backbtn:hover { background: var(--card2); } .backbtn[disabled] { opacity: .3; cursor: default; }
.dock { position: fixed; right: 18px; bottom: 18px; z-index: 44; width: 176px; border-radius: 22px; background: rgba(21,23,27,.94); padding: 10px; display: grid; gap: 8px; }
.dock-cube { height: 150px; border-radius: 16px; background: var(--ink2); overflow: hidden; }
.dock-cal { padding: 10px; border-radius: 13px; background: var(--music); color: var(--ink); font: 800 13px Unbounded, sans-serif; display: flex; justify-content: center; gap: 8px; align-items: center; }
.dock-cal b { background: rgba(0,0,0,.14); border-radius: 6px; padding: 1px 7px; }
.dock-hide { position: absolute; top: 6px; right: 8px; width: 26px; height: 26px; border-radius: 8px; background: var(--card); z-index: 1; font-weight: 700; }
.dock-show { position: fixed; right: 18px; bottom: 18px; z-index: 44; width: 52px; height: 52px; border-radius: 16px; background: var(--music); color: var(--ink); font-size: 24px; }
.calib { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(21,23,27,.82); padding: 16px; }
.calib .box { width: min(560px, 100%); background: var(--ink); border-radius: 26px; padding: 30px; border-top: 10px solid var(--music); text-align: center; }
.calib .steps2 { display: flex; gap: 12px; justify-content: center; margin: 22px 0; }
.calib .steps2 span { width: 92px; height: 92px; border-radius: 22px; background: var(--card); display: grid; place-items: center; font: 800 38px Unbounded, sans-serif; color: var(--muted); }
.calib .steps2 span.now { background: var(--music); color: var(--ink); } .calib .steps2 span.done { background: var(--edu); color: var(--milk); }
body.has-dock .toasts { bottom: 24px; }
@media (max-width: 720px) { .dock { width: 132px; } .dock-cube { height: 110px; } }

/* tiles: the focused / hovered tile grows (Switch), the others stay the same size */
.row { align-items: center; min-height: 300px; }
.tile { transition: width .22s var(--ease), height .22s var(--ease), box-shadow .18s, transform .18s; }
.tile.big { width: 230px; height: 230px; }
.row .tile.focus, .row .tile:focus-visible, .row .tile:hover { width: 290px; height: 290px; transform: none; }
@media (max-width: 900px) { .row { min-height: 230px; } .row .tile.focus, .row .tile:hover { width: 220px; height: 220px; } }

/* profile: avatar (emoji or own image) in its frame, showcase pins; a stronger second row on the home page */
.soul .ava { width: 150px; height: 150px; border-radius: 36px; background: var(--ink); display: grid; place-items: center; font-size: 74px; overflow: hidden; position: relative; flex: 0 0 auto; box-shadow: 0 0 0 6px var(--ink); }
.soul .ava[style*="--frame"]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 9px; background: var(--frame); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.soul .ava img { width: 100%; height: 100%; object-fit: cover; }
.chip.ava b { overflow: hidden; } .chip.ava b img { width: 100%; height: 100%; object-fit: cover; }
.acard.pinned { outline: 4px solid var(--music); outline-offset: 3px; }
.second a { padding: 22px; min-height: 104px; border-radius: var(--r); }
.second a .ic { width: 58px; height: 58px; flex-basis: 58px; font-size: 28px; border-radius: 16px; }
.second a:nth-child(1) .ic { background: var(--edu); } .second a:nth-child(2) .ic { background: var(--arcade); } .second a:nth-child(3) .ic { background: var(--music); color: var(--ink); } .second a:nth-child(4) .ic { background: var(--blue); }
.second a b { font-size: 17px; }

/* ================================================================== REDESIGN (design session 1, 2026-11-29) */
/* console scale */
:root { --t-hero: clamp(52px, 8vw, 132px); --t-h1: clamp(34px, 4.6vw, 64px); --t-h2: clamp(22px, 2.4vw, 32px); }
body { font-size: 18px; padding-bottom: 110px; }
.ico { font-size: 22px; } .glyph.ico i { opacity: .28; }

/* tall header that shrinks on scroll */
.top { padding: 14px 28px; gap: 16px; height: 92px; transition: height .25s, padding .25s; background: rgba(21,23,27,.94); }
body.scrolled .top { height: 64px; padding: 6px 28px; }
.backbtn { width: 52px; height: 52px; border-radius: 16px; font-size: 0; }
.backbtn .ico { font-size: 26px; }
body.scrolled .backbtn { width: 42px; height: 42px; }
.logo { gap: 14px; font-size: 24px; letter-spacing: .06em; margin-right: 14px; }
.logo img { width: 54px; height: 54px; transition: width .25s, height .25s; }
body.scrolled .logo img { width: 38px; height: 38px; } body.scrolled .logo { font-size: 19px; }
.worlds { gap: 10px; }
.worlds a { padding: 12px 22px; border-radius: 16px; font-size: 16px; gap: 12px; color: var(--milk); background: var(--card); }
.worlds a .ico { font-size: 26px; color: var(--c); } .worlds a .ico i.on { background: var(--c); }
.worlds a.on { background: var(--c); color: var(--ci); } .worlds a.on .ico i.on { background: var(--ci); }
body.scrolled .worlds a { padding: 8px 16px; font-size: 14px; }
.chip.icon { width: 52px; height: 52px; border-radius: 16px; } .chip.icon .ico { font-size: 24px; }
.player { display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 6px 14px 6px 6px; border-radius: 18px; background: var(--card); min-width: 220px; }
.pava { position: relative; width: 52px; height: 52px; border-radius: 15px; background: var(--ink2); display: grid; place-items: center; font-size: 28px; overflow: hidden; flex: 0 0 52px; }
.pava img { width: 100%; height: 100%; object-fit: cover; }
.pava[style*="--frame"]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 4px; background: var(--frame); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.pinfo { display: grid; gap: 3px; } .pinfo b { font: 800 15px Unbounded, sans-serif; }
.pbar { height: 6px; border-radius: 3px; background: var(--ink2); overflow: hidden; width: 140px; } .pbar i { display: block; height: 100%; background: var(--music); }
.pstats { font-size: 16px; color: var(--muted); line-height: 1; }
body.scrolled .player { min-width: 0; } body.scrolled .pava { width: 40px; height: 40px; flex-basis: 40px; } body.scrolled .pbar { display: none; }
.chip.cube-off, .chip { font-size: 15px; padding: 12px 16px; border-radius: 15px; }
.pixel, .stat b, .acard .foot, .lvlbar + span { font-family: Handjet, monospace; font-weight: 700; letter-spacing: .03em; }
.stat b { font-size: 34px; }

/* Switch bottom bar: round buttons, always there (desktop) */
.switchbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30; display: flex; gap: 14px; padding: 10px 16px; border-radius: 30px; background: rgba(21,23,27,.94); }
.switchbar a { display: grid; justify-items: center; gap: 6px; text-decoration: none; font-size: 12px; color: var(--muted); width: 74px; }
.switchbar a .ico { width: 58px; height: 58px; border-radius: 50%; background: var(--card); display: grid; grid-template-columns: repeat(3, 9px); place-content: center; gap: 3px; font-size: 0; }
.switchbar a .ico i { width: 9px; height: 9px; border-radius: 3px; }
.switchbar a:hover .ico, .switchbar a.on .ico { background: var(--milk); } .switchbar a:hover .ico i.on, .switchbar a.on .ico i.on { background: var(--ink); }
.switchbar a.on { color: var(--milk); }
.switchbar a:nth-child(1) .ico i.on { background: var(--edu); } .switchbar a:nth-child(2) .ico i.on { background: var(--arcade); }
.switchbar a:nth-child(3) .ico i.on { background: var(--music); } .switchbar a:nth-child(4) .ico i.on { background: var(--blue); } .switchbar a:nth-child(5) .ico i.on { background: var(--orange); }
.tabbar { display: none; }
.dock { bottom: 128px; } .dock-show { bottom: 128px; }
.second { display: none; }   /* the second row lives in the bottom bar now */

/* a world fills the whole screen with its colour */
body[data-world="arcade"], body[data-world="edu"], body[data-world="music"] { background: var(--world); color: var(--world-ink); transition: background .35s; }
body[data-world="arcade"] .top, body[data-world="edu"] .top, body[data-world="music"] .top { background: color-mix(in srgb, var(--world) 78%, black); }
body[data-world] main .panel, body[data-world] main .post, body[data-world] main .note, body[data-world] main .legacy .card, body[data-world] main .legacy .task, body[data-world] main .stat { background: rgba(21,23,27,.86); color: var(--milk); }
body[data-world="music"] main .worldhead, body[data-world] main .worldhead { background: transparent; }
body[data-world] .focusinfo b, body[data-world] main h2 { color: inherit; }
body[data-world="music"] .top .player, body[data-world="music"] .top .chip { color: var(--milk); }

/* transitions between worlds: steps (arcade), stickers (education), wave (music) */
.wipe { position: fixed; inset: 0; z-index: 70; pointer-events: none; visibility: hidden; }
.wipe.go { visibility: visible; animation: wipeout .5s steps(1, end) forwards; }
.wipe.go::before { content: ""; position: absolute; inset: 0; background: var(--c, var(--blue)); }
.wipe.arcade { --c: var(--arcade); } .wipe.edu { --c: var(--edu); } .wipe.music { --c: var(--music); }
.wipe.go.arcade::before { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); animation: steps-in .5s steps(8, end) forwards; }
.wipe.go.edu::before { -webkit-mask: radial-gradient(circle, #000 46%, transparent 48%) 0 0 / 60px 60px; animation: stick-in .5s ease forwards; }
.wipe.go.music::before { animation: wave-in .5s cubic-bezier(.6,0,.4,1) forwards; border-radius: 0 50% 50% 0 / 0 40% 40% 0; }
@keyframes steps-in { 0% { clip-path: inset(0 100% 0 0); } 50% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }
@keyframes stick-in { 0% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.4); } 100% { opacity: 0; transform: scale(2); } }
@keyframes wave-in { 0% { transform: translateX(-100%); } 50% { transform: translateX(0); } 100% { transform: translateX(100%); } }
@keyframes wipeout { to { visibility: hidden; } }

@media (max-width: 900px) {
  body { padding-bottom: 86px; font-size: 16px; }
  .top { height: auto; padding: 8px 12px; } .worlds, .switchbar, #founderChip { display: none; }
  .logo span { display: none; } .logo img { width: 40px; height: 40px; }
  .player { min-width: 0; padding: 4px; } .pinfo { display: none; } .pava { width: 44px; height: 44px; flex-basis: 44px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(21,23,27,.96); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 4px; text-decoration: none; font-size: 11px; color: var(--muted); }
  .tabbar a .ico { font-size: 22px; } .tabbar a.on { color: var(--milk); } .tabbar a.on .ico i.on { background: var(--music); }
  .dock { bottom: 84px; } .dock-show { bottom: 84px; }
}

/* tiles: «all games» */
.tile.all { background: var(--card); color: var(--milk); align-items: center; justify-content: center; gap: 12px; }
.tile.all .ico { font-size: 46px; }

/* home: the game in focus fills the screen */
.stagehome { position: relative; min-height: calc(100vh - 92px); display: grid; grid-template-rows: 1fr auto; overflow: hidden; }
.stagehome .bg, .stagehome .pv { position: absolute; inset: 0; width: 100%; height: 100%; background-size: cover; background-position: center; }
.stagehome .bg svg { width: 100%; height: 100%; display: block; }
.stagehome .pv { object-fit: cover; opacity: 0; transition: opacity .6s; } .stagehome .pv.on { opacity: 1; }
.stagehome .veil { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(21,23,27,.88) 0%, rgba(21,23,27,.55) 38%, transparent 70%), linear-gradient(transparent 55%, rgba(21,23,27,.92)); }
.stagehome .info { position: relative; align-self: center; padding-top: 40px; max-width: 1320px; width: 100%; }
.stagehome .info h1 { font-size: var(--t-hero); line-height: .95; margin: 14px 0 12px; max-width: 9em; color: var(--milk); }
.stagehome .info p { font-size: 22px; color: rgba(248,246,240,.85); max-width: 26em; margin-bottom: 22px; }
.wtag { display: inline-flex; gap: 10px; align-items: center; padding: 8px 14px; border-radius: 12px; background: var(--world); color: var(--world-ink); font: 800 14px Unbounded, sans-serif; }
.wtag .ico i.on { background: currentColor; }
.stagehome .play { font-size: 20px; padding: 18px 34px; border-radius: 18px; }
.stagehome .play .ico { font-size: 22px; }
.stagehome .shelf { position: relative; width: 100%; max-width: none; padding-bottom: 8px; }
.stagehome .row { min-height: 320px; }
.stagehome { grid-template-columns: minmax(0, 1fr); padding-bottom: 96px; }
.stagehome .info, .stagehome .shelf { min-width: 0; }
.stagehome .info { justify-self: center; }
.glyph.ico i.on { opacity: 1; }

/* game page */
.ghero2 { position: relative; min-height: min(70vh, 680px); display: grid; align-items: end; overflow: hidden; }
.ghero2 .bg { position: absolute; inset: 0; background-size: cover; background-position: center; } .ghero2 .bg svg { width: 100%; height: 100%; display: block; }
.ghero2 .veil { position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(21,23,27,.92)), linear-gradient(90deg, rgba(21,23,27,.7), transparent 60%); }
.gtitle { position: relative; padding-bottom: 36px; width: 100%; }
.gtitle h1 { font-size: var(--t-hero); line-height: .95; color: var(--milk); margin-bottom: 10px; outline: none; }
.gtitle p { font-size: 22px; color: rgba(248,246,240,.88); margin-bottom: 20px; max-width: 30em; outline: none; }
.gtitle .logoimg { max-width: min(560px, 70%); max-height: 220px; display: block; margin-bottom: 14px; }
[contenteditable="true"] { border-radius: 10px; } [contenteditable="true"]:hover, [contenteditable="true"]:focus { box-shadow: 0 0 0 3px var(--orange); }
.gdesc { font-size: 20px; max-width: 42em; line-height: 1.6; outline: none; }
.trailer video { width: 100%; border-radius: var(--r); background: #000; margin-bottom: 22px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.shot { aspect-ratio: 16/9; border-radius: 14px; background-size: cover; background-position: center; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.9); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 14px; }
.founder-edit { background: var(--orange); color: var(--ink); }
body[data-world] main .gtitle, body[data-world] main .gdesc { color: var(--milk); }
body[data-world] main .gdesc { background: rgba(21,23,27,.86); padding: 20px 22px; border-radius: var(--r); }

/* collection card: the case before the algorithm */
.acard .case { width: 96px; margin: 2px auto 4px; } .acard .case svg { width: 100%; display: block; }
.acard .alg { font-size: 17px; }

/* profile: a room — your visual as the background, avatar, your cube on a shelf */
.soul.room { position: relative; overflow: hidden; padding: 46px 0 40px; background: var(--ink2); }
.room .roombg { position: absolute; inset: 0; }
.room[data-room="worlds"] .roombg { background: linear-gradient(115deg, var(--arcade) 0 33%, var(--edu) 33% 66%, var(--music) 66%); }
.room[data-room="galaxy"] .roombg { background: radial-gradient(circle at 70% 40%, #8a6cff55, transparent 40%), radial-gradient(circle at 20% 70%, #4E69C166, transparent 45%), radial-gradient(1px 1px at 10% 20%, #fff, transparent), radial-gradient(1px 1px at 40% 60%, #fff, transparent), radial-gradient(1px 1px at 80% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 60% 80%, #fff, transparent), #0b0d1a; }
.room[data-room="water"] .roombg { background: repeating-radial-gradient(circle at 30% 120%, #4E69C1 0 18px, #3d58ad 18px 36px), #4E69C1; opacity: .95; }
.room[data-room="fire"] .roombg { background: radial-gradient(ellipse at 50% 120%, #EFC54B, #F09560 35%, #DF4D56 60%, #2a1414 85%); }
.room[data-room="stickers"] .roombg { background: radial-gradient(circle, var(--edu) 40%, transparent 42%) 0 0 / 46px 46px, var(--ink2); opacity: .9; }
.room .wrap { position: relative; display: flex; gap: 26px; align-items: center; }
.room .who { background: rgba(21,23,27,.9); }
.roomcube { width: 230px; height: 230px; flex: 0 0 230px; border-radius: 26px; background: rgba(21,23,27,.55); }
@media (max-width: 900px) { .roomcube { width: 100%; height: 200px; flex-basis: auto; } }
.tile .tedit { position: absolute; top: 10px; left: 10px; z-index: 3; width: 34px; height: 34px; border-radius: 10px; background: var(--orange); color: var(--ink); display: grid; place-items: center; font-weight: 800; }
.tile.dragging { opacity: .4; }

/* balance (owner, 2026-11-29): graphite stays the background — a full-screen world colour tires the eyes and takes
   away focus. The world's colour is one block behind the row of tiles you choose from; the rest stays calm. */
body[data-world="arcade"], body[data-world="edu"], body[data-world="music"] { background: var(--ink); color: var(--milk); }
body[data-world="arcade"] .top, body[data-world="edu"] .top, body[data-world="music"] .top { background: rgba(21,23,27,.94); }
body[data-world] main .panel, body[data-world] main .post, body[data-world] main .note, body[data-world] main .legacy .card, body[data-world] main .legacy .task, body[data-world] main .stat { background: var(--card); }
body[data-world] main .gdesc { background: none; padding: 0; }
.worldhead { background: transparent !important; color: var(--milk); }
.worldhead h1 .glyph i.on { background: var(--world); }
.worldhead p { color: var(--muted); }
/* the colour block behind the tiles */
main [data-world] > .row, .stagehome .shelf { position: relative; }
main .wrap[data-world] > .row::before { content: ""; position: absolute; left: -28px; right: -28px; top: 34px; bottom: 34px; border-radius: 28px; background: var(--world); z-index: -1; }
main .wrap[data-world] > .row { isolation: isolate; padding-left: 22px; padding-right: 22px; }
main .wrap[data-world] > .focusinfo { padding: 0 22px; }
.worlds a.on { box-shadow: inset 0 -4px 0 var(--ci); }

/* the five buttons (Creation … Shop) stand vertically on the left (owner, 2026-11-29) */
@media (min-width: 901px) {
  .switchbar { left: 14px; top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column; padding: 14px 8px; gap: 12px; border-radius: 28px; }
  .switchbar a { width: 76px; }
  body { padding-bottom: 40px; padding-left: 104px; }
  .top { margin-left: -104px; padding-left: 132px; }
  .stagehome { padding-bottom: 24px; }
  .dock, .dock-show { bottom: 18px; }
}
