/* Make Room — The 212 GB Purge. Neon-sunset identity. */
:root {
  --bg: #140a24;
  --bg2: #1f1036;
  --card: #26143f;
  --card2: #311a50;
  --line: #4a2f6e;
  --ink: #fbf1ff;
  --ink2: #d7c4ea;
  --muted: #a690c0;
  --pink: #ff4f9a;
  --pink-ink: #ff7db5;
  --orange: #ffad4d;
  --teal: #2fe0cf;
  --violet: #9b7bff;
  --good: #3ee08f;
  --bad: #ff5a5a;
  --free: #2fe0cf;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --font-display: "Bungee", "Impact", system-ui, sans-serif;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sunset: linear-gradient(180deg, #ffd36b 0%, #ff9a4d 35%, #ff4f9a 70%, #9b3bff 100%);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #fff4ea;
  --bg2: #ffe7d6;
  --card: #ffffff;
  --card2: #fff0f6;
  --line: #f0cbd9;
  --ink: #2a1238;
  --ink2: #4b2f5e;
  --muted: #74597f;
  --pink: #d61f6f;
  --pink-ink: #b8135c;
  --orange: #b85d00;
  --teal: #00796f;
  --violet: #5b3fd1;
  --good: #11804a;
  --bad: #c62828;
  --free: #00a493;
  --shadow: 0 8px 24px rgba(120,40,80,.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255,79,154,.25), transparent 60%),
    linear-gradient(transparent 0 0);
  background-attachment: fixed;
}
[data-theme="light"] body {
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255,150,80,.25), transparent 60%);
}
[hidden] { display: none !important; }
img, svg, canvas { max-width: 100%; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--pink-ink); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--orange); color: #000; padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: .5rem; padding: .55rem 1rem; }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-size: 1rem; letter-spacing: .02em; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.brand span b { color: var(--pink-ink); font-weight: 400; }
.nav-links { display: flex; gap: .15rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--ink2); text-decoration: none; padding: .4rem .6rem; border-radius: 10px; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--card2); color: var(--ink); }
.icon-btn { background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: 10px; width: 38px; height: 38px; display: inline-grid; place-items: center; cursor: pointer; font-size: 1.05rem; flex: none; }
.icon-btn:hover { border-color: var(--pink); }
@media (max-width: 720px) {
  .nav { flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; margin-left: 0; }
  .nav .icon-btn { margin-left: auto; }
}

main { max-width: 1120px; margin: 0 auto; padding: 1rem; }
.site-footer { max-width: 1120px; margin: 2rem auto 0; padding: 1.5rem 1rem 2.5rem; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
.site-footer a { color: var(--ink2); }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 7vw, 3.6rem); letter-spacing: .01em; }
h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.35rem, 4vw, 1.9rem); }
h3 { font-size: 1.1rem; }
.sun-text { background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="light"] .sun-text { background: linear-gradient(90deg, #c2410c, #d61f6f 60%, #6d28d9); -webkit-background-clip: text; background-clip: text; }
.lede { font-size: 1.12rem; color: var(--ink2); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mono { font-family: var(--mono); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: 700 1rem var(--font); padding: .75rem 1.15rem; border-radius: 12px;
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  background: var(--pink); color: #fff; transition: transform .12s ease, filter .12s ease;
  min-height: 44px;
}
.btn:hover { filter: brightness(1.08); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.alt { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.alt:hover { border-color: var(--pink); color: var(--ink); }
.btn.teal { background: var(--teal); color: #08202a; }
[data-theme="light"] .btn.teal { color: #fff; }
.btn.small { padding: .45rem .75rem; font-size: .9rem; min-height: 36px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); }
.grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid.four { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) and (max-width: 899px) { .grid.four { grid-template-columns: 1fr 1fr; } }
.pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); font-size: .8rem; font-weight: 700; color: var(--ink2); }
.pill.hot { background: var(--pink); color: #fff; border-color: transparent; }

/* Hero */
.hero { padding: 1.5rem 0 1rem; position: relative; }
.hero .kicker { font-family: var(--mono); color: var(--orange); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .5rem; }
.hero-grid { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.15fr 1fr; } }
.tv {
  background: #07040d; border-radius: 22px; padding: 1.1rem; border: 2px solid var(--line);
  box-shadow: 0 0 0 6px var(--card), 0 20px 60px rgba(255,79,154,.25);
  color: #f5ecff; font-family: var(--mono); position: relative; overflow: hidden;
}
.tv::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 2px, transparent 2px 4px); pointer-events: none; }
.tv .warn { color: #ff7db5; font-weight: 700; display: flex; gap: .5rem; align-items: center; }
.tv .row { display: flex; justify-content: space-between; font-size: .85rem; color: #c9b5e5; margin-top: .4rem; }
.countdowns { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 1rem; }
.cd { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .65rem .8rem; }
.cd .lbl { font-size: .78rem; color: var(--muted); font-weight: 600; }
.cd .val { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.cd.live .val { color: var(--good); }

/* Storage bar */
.drive { margin-top: .6rem; }
.drive-bar {
  display: flex; height: 34px; border-radius: 10px; overflow: hidden; background: #1b1129;
  border: 2px solid #3d2a58; gap: 2px; padding: 2px;
}
[data-theme="light"] .drive-bar { background: #f3e6ee; border-color: #e3c8d6; }
.drive-bar .seg { height: 100%; border-radius: 4px; min-width: 2px; transition: flex-grow .5s ease, opacity .3s; position: relative; }
.drive-bar .seg.other { background: repeating-linear-gradient(45deg, #5a4a6e 0 6px, #4a3b5c 6px 12px); }
.drive-bar .seg.free { background: transparent; border: 2px dashed var(--free); }
.drive-bar .seg.need { background: repeating-linear-gradient(135deg, rgba(255,79,154,.35) 0 6px, transparent 6px 12px); border: 2px dashed var(--pink); }
.drive-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; margin-top: .45rem; color: var(--ink2); }
.drive-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: .3rem; }

/* Mode cards */
.modes { margin: 1.5rem 0; }
.mode { display: flex; flex-direction: column; gap: .4rem; text-decoration: none; color: var(--ink); transition: transform .15s, border-color .15s; }
.mode:hover { transform: translateY(-3px); border-color: var(--pink); color: var(--ink); }
.mode .ico { font-size: 1.8rem; }
.mode p { margin: 0; color: var(--ink2); font-size: .95rem; }
.mode .go { margin-top: auto; color: var(--pink-ink); font-weight: 700; }

/* Facts strip */
.facts { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 1.5rem 0; }
.fact { border-left: 4px solid var(--orange); padding: .4rem .8rem; background: var(--card); border-radius: 0 12px 12px 0; }
.fact b { font-family: var(--mono); font-size: 1.4rem; display: block; color: var(--ink); }
.fact span { color: var(--ink2); font-size: .9rem; }

/* Level select */
.levels { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.lvl { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .85rem; color: var(--ink); cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: .25rem; transition: transform .12s, border-color .12s; }
.lvl:hover { transform: translateY(-2px); border-color: var(--pink); }
.lvl .num { font-family: var(--display, var(--font-display)); color: var(--pink-ink); font-size: .85rem; }
.lvl .t { font-weight: 800; font-size: 1.05rem; }
.lvl .meta { color: var(--muted); font-size: .85rem; }
.lvl .stars { color: var(--orange); letter-spacing: .1em; font-size: 1rem; }
.lvl.shuffle { background: linear-gradient(135deg, var(--card2), var(--card)); border-style: dashed; }

.seg-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.seg-ctl button { background: none; border: 0; color: var(--ink2); font: 700 .92rem var(--font); padding: .55rem .9rem; cursor: pointer; min-height: 40px; }
.seg-ctl button[aria-pressed="true"] { background: var(--pink); color: #fff; }

/* Game */
.hud { position: sticky; top: 56px; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: .6rem 0 .7rem; border-bottom: 1px solid var(--line); margin: 0 -1rem 1rem; padding-left: 1rem; padding-right: 1rem; }
@media (max-width: 720px) { .hud { top: 92px; } }
.hud-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.hud-stat { display: flex; flex-direction: column; line-height: 1.1; }
.hud-stat .l { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.hud-stat .v { font-family: var(--mono); font-weight: 700; font-size: 1.1rem; }
.hud-stat .v.ok { color: var(--good); }
.hud-stat .v.warn { color: var(--orange); }
.hud-stat .v.bad { color: var(--bad); }
.hud .grow { flex: 1; }
.intro { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; margin-bottom: 1rem; }
.intro b { color: var(--pink-ink); }
.items { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .85rem; display: flex; flex-direction: column; gap: .45rem; position: relative; transition: opacity .3s, transform .3s, border-color .2s; }
.item .top { display: flex; gap: .65rem; align-items: flex-start; }
.cover { width: 46px; height: 58px; border-radius: 8px; flex: none; display: grid; place-items: center; font-family: var(--font-display); font-size: .95rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.item .name { font-weight: 800; line-height: 1.2; }
.item .who { font-size: .75rem; font-weight: 700; color: var(--orange); }
.item .size { font-family: var(--mono); font-weight: 700; color: var(--teal); font-size: 1.05rem; }
.item .stats { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .82rem; color: var(--ink2); }
.note { font-family: "Caveat", "Comic Sans MS", cursive; font-size: 1.15rem; line-height: 1.15; background: #fff59d; color: #3b2c00; padding: .35rem .55rem; border-radius: 4px; transform: rotate(-1deg); box-shadow: 2px 3px 0 rgba(0,0,0,.2); }
.item .acts { display: flex; gap: .4rem; margin-top: auto; flex-wrap: wrap; }
.item .acts .btn { flex: 1; }
.btn.del { background: var(--bad); }
.btn.usb { background: var(--violet); }
.item.deleted { opacity: .55; border-style: dashed; }
.item.deleted .cover { filter: grayscale(1); }
.item.moved { border-color: var(--violet); }
.item .tag { position: absolute; top: .55rem; right: .6rem; font-size: .72rem; font-weight: 800; padding: .15rem .45rem; border-radius: 6px; }
.item.deleted .tag { background: var(--bad); color: #fff; }
.item.moved .tag { background: var(--violet); color: #fff; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }

/* Result */
.result { text-align: center; }
.result .stars-big { font-size: 2.6rem; letter-spacing: .15em; color: var(--orange); }
.result .stars-big .off { color: var(--line); }
.reactions { text-align: left; display: grid; gap: .5rem; margin: 1rem 0; }
.reaction { background: var(--card2); border-radius: 12px; padding: .55rem .75rem; border-left: 4px solid var(--pink); }
.reaction.okish { border-left-color: var(--good); }
.reaction.moved { border-left-color: var(--violet); }
.reaction small { color: var(--muted); display: block; font-weight: 700; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin: 1rem 0; }
.score-grid div { background: var(--card2); border-radius: 12px; padding: .55rem; }
.score-grid b { display: block; font-family: var(--mono); font-size: 1.3rem; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(8,3,16,.72); display: grid; place-items: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal .card { width: min(640px, 100%); max-height: 92vh; overflow: auto; }

.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%) translateY(150%); background: var(--ink); color: var(--bg); padding: .65rem 1rem; border-radius: 12px; font-weight: 700; z-index: 80; transition: transform .25s ease; max-width: 90vw; text-align: center; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* Mine */
.picker { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: .4rem .75rem; font: 600 .88rem var(--font); cursor: pointer; min-height: 36px; }
.chip[aria-pressed="true"] { background: var(--teal); color: #08202a; border-color: transparent; }
[data-theme="light"] .chip[aria-pressed="true"] { color: #fff; }
.chip .gb { font-family: var(--mono); opacity: .75; margin-left: .3rem; font-size: .8rem; }
input[type="search"], input[type="text"], input[type="number"], select {
  font: 1rem var(--font); padding: .6rem .75rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); min-height: 44px; width: 100%;
}
label { font-weight: 700; font-size: .92rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.lib { display: grid; gap: .5rem; }
.lib-row { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem; }
.lib-row.del { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--card)); }
.lib-row .n { font-weight: 700; line-height: 1.2; }
.lib-row .n small { display: block; font-family: var(--mono); color: var(--teal); font-weight: 700; }
.hearts { display: flex; gap: 0; }
.hearts button { background: none; border: 0; cursor: pointer; font-size: 1.15rem; padding: .2rem; color: var(--line); min-width: 30px; min-height: 36px; }
.hearts button.on { color: var(--pink); }
.lib-row .x { min-width: 86px; }
.sac-card { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); display: block; }
@media (max-width: 520px) {
  .lib-row { grid-template-columns: 1fr auto; }
  .lib-row .x { grid-column: 1 / -1; display: flex; gap: .4rem; }
  .lib-row .x .btn { flex: 1; }
}

/* Bigger or smaller */
.duel { display: grid; gap: .8rem; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 700px) { .duel { grid-template-columns: 1fr auto 1fr; } }
.contender { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.2rem; text-align: center; display: flex; flex-direction: column; gap: .5rem; justify-content: center; min-height: 210px; }
.contender .big { font-family: var(--mono); font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 800; color: var(--teal); }
.contender .what { font-weight: 800; font-size: 1.25rem; }
.contender .sub { color: var(--muted); font-size: .9rem; }
.vs { align-self: center; justify-self: center; font-family: var(--font-display); font-size: 1.5rem; color: var(--pink-ink); }
.contender.right.win { border-color: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 40%, transparent); }
.contender.right.lose { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 40%, transparent); }
.order-list { display: grid; gap: .5rem; }
.order-item { display: flex; align-items: center; gap: .6rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .65rem .8rem; cursor: pointer; font: 600 1rem var(--font); color: var(--ink); text-align: left; width: 100%; min-height: 48px; }
.order-item .rank { width: 28px; height: 28px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-family: var(--mono); font-weight: 800; flex: none; }
.order-item.picked .rank { background: var(--pink); color: #fff; }
.order-item.right { border-color: var(--good); }
.order-item.wrong { border-color: var(--bad); }
.order-item .sz { margin-left: auto; font-family: var(--mono); color: var(--teal); }

/* Lab */
.calc-out { font-family: var(--mono); font-size: clamp(2rem, 8vw, 3.2rem); font-weight: 800; color: var(--teal); }
input[type="range"] { width: 100%; accent-color: var(--pink); min-height: 32px; }
.equiv { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.eq { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .8rem; }
.eq .e { font-size: 1.6rem; }
.eq b { display: block; font-family: var(--mono); font-size: 1.35rem; color: var(--ink); }
.eq span { font-size: .85rem; color: var(--ink2); }
.chart { width: 100%; }
.chart .bar-row { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: .6rem; align-items: center; margin: .35rem 0; }
.chart .bar-lbl { font-size: .85rem; color: var(--ink2); line-height: 1.2; }
.chart .bar-lbl b { color: var(--ink); display: block; }
.chart .bar-track { position: relative; height: 22px; }
.chart .bar { height: 100%; border-radius: 0 4px 4px 0; background: var(--pink); min-width: 3px; transition: width .6s ease; }
.chart .bar.hl { background: var(--orange); }
.chart .bar-val { position: absolute; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: .8rem; color: var(--ink); white-space: nowrap; padding-left: .4rem; }
.tip { position: fixed; pointer-events: none; z-index: 90; background: var(--ink); color: var(--bg); padding: .35rem .6rem; border-radius: 8px; font-size: .82rem; font-weight: 600; max-width: 240px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: .5rem .4rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
td.num { font-family: var(--mono); text-align: right; }
.table-wrap { overflow-x: auto; }
.meter { height: 10px; background: var(--card2); border-radius: 5px; overflow: hidden; min-width: 70px; }
.meter i { display: block; height: 100%; background: var(--pink); border-radius: 0 4px 4px 0; }
details summary { cursor: pointer; font-weight: 700; color: var(--ink2); }
section { margin: 2rem 0; }
.prose { max-width: 70ch; }
.prose li { margin: .3rem 0; }
.banner { background: linear-gradient(90deg, var(--pink), var(--violet)); color: #fff; padding: .8rem 1rem; border-radius: 14px; margin-bottom: 1rem; font-weight: 600; }
.banner a { color: #fff; }

@keyframes pop { 0% { transform: scale(.9); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
@keyframes blink { 50% { opacity: .35 } }
.pop { animation: pop .3s ease both; }
.shake { animation: shake .3s ease; }
.blink { animation: blink 1.2s steps(2) infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
