:root {
  color-scheme: dark;
  --page: #151515;
  --panel: #202020;
  --panel-2: #262626;
  --panel-3: #2f2f2f;
  --line: #2c2c2c;
  --line-2: #393939;
  --text: #f3f3f0;
  --muted: #9b9b96;
  --faint: #6a6a66;
  --lime: #e6f57c;
  --lime-deep: #cde64a;
  --green: #8fe388;
  --amber: #f6b740;
  --red: #ff5b36;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(90% 60% at 50% 115%, rgba(120, 128, 70, 0.22), transparent 70%),
    var(--page);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 28px; padding: 20px 28px 20px 20px; min-height: 100vh; }
.rail {
  position: sticky; z-index: 20; top: 20px; height: calc(100vh - 40px);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 26px;
}
.rail .logo { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 4px; }
.rail hr { width: 30px; border: 0; border-top: 1px solid var(--line-2); margin: 6px 0; }
.rail .spacer { flex: 1; }
.rail-btn {
  position: relative; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: var(--panel-2); color: var(--muted);
  transition: background .15s, color .15s;
}
.rail-btn:hover { color: var(--text); background: var(--panel-3); }
.rail-btn.on { background: var(--text); color: #141414; }
.rail-btn.off { opacity: .4; cursor: default; }
.rail-btn[data-label]:hover::after {
  content: attr(data-label); position: absolute; left: 54px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: #000; color: var(--text);
  font-size: 12px; pointer-events: none; z-index: 30;
}

.main { min-width: 0; display: flex; flex-direction: column; gap: 22px; }

.topbar { display: flex; align-items: center; gap: 12px; }
.pills { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 999px; background: var(--panel); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
}
.pill svg.i { width: 15px; height: 15px; }
.pill b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.topbar .grow { flex: 1; }
.search {
  display: flex; align-items: center; gap: 10px; width: 280px; height: 38px; padding: 0 6px 0 14px;
  border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 13px; color: var(--text); }
.search input::placeholder { color: var(--faint); }
.kbd { font-size: 11px; padding: 3px 7px; border-radius: 8px; background: var(--panel-3); color: var(--muted); white-space: nowrap; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.icon-btn:hover { color: var(--text); }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 600;
  display: grid; place-items: center;
}
.user { display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: #2b3020; color: var(--lime); font-size: 12.5px; font-weight: 600; border: 1px solid #3a4227;
}
.user b { display: block; font-size: 13px; font-weight: 500; }
.user small { display: block; font-size: 11px; color: var(--faint); }

.popover {
  position: absolute; right: 0; top: 46px; width: 300px; padding: 10px; z-index: 40;
  background: #1c1c1c; border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.popover h4 { margin: 4px 6px 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.popover li { list-style: none; display: flex; gap: 10px; padding: 9px 8px; border-radius: 10px; font-size: 12.5px; }
.popover li:hover { background: var(--panel-2); }
.popover ul { margin: 0; padding: 0; }
.popover .dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--amber); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: -.02em; }
.page-head p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.select {
  appearance: none; height: 38px; padding: 0 36px 0 16px; border-radius: 999px; font-size: 13px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239b9b96' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line); cursor: pointer;
}

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs { display: inline-flex; padding: 5px; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tab { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab .n {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 8px;
  border-radius: 999px; background: var(--panel-3); font-size: 10.5px; color: var(--muted);
}
.tab.on { background: var(--panel-3); color: var(--text); }
.tab.on .n { background: var(--text); color: #141414; }
.toolbar .grow { flex: 1; }
.switch { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; cursor: pointer; user-select: none; }
.switch input {
  appearance: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 999px;
  background: var(--panel-3); cursor: pointer; transition: background .2s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #6d6d6a; transition: left .2s, background .2s, box-shadow .2s;
}
.switch input:checked { background: #26331f; }
.switch input:checked::after { left: 21px; background: var(--green); box-shadow: 0 0 12px rgba(143, 227, 136, .55); }

.status {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 500; white-space: nowrap;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.s-playable { color: var(--green); background: rgba(143, 227, 136, .12); }
.s-ingame { color: var(--lime); background: rgba(230, 245, 124, .12); }
.s-boots { color: var(--amber); background: rgba(246, 183, 64, .13); }
.s-wip { color: #7db7ff; background: rgba(125, 183, 255, .12); }
.s-planned, .s-empty { color: var(--muted); background: rgba(255, 255, 255, .06); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; transition: filter .15s, background .15s;
}
.btn-lime { background: var(--lime); color: #151515; }
.btn-lime:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--panel-3); }

.foot { display: flex; justify-content: space-between; gap: 12px; padding: 0 20px 4px; font-size: 12px; color: var(--faint); }

/* ---------- landing ---------- */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center; gap: 24px; min-height: 560px; padding: 56px 56px 48px;
  background: linear-gradient(180deg, #1f1f1f, #1a1a1a); border: 1px solid var(--line); border-radius: 28px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), rgba(255, 255, 255, .035) calc(12.5% - 1px) 12.5%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.watermark {
  position: absolute; left: 50%; top: -0.08em; transform: translateX(-50%); pointer-events: none;
  font-size: clamp(90px, 17vw, 280px); font-weight: 800; letter-spacing: -.02em; line-height: 1; white-space: nowrap;
  color: rgba(255, 255, 255, .028);
}
.hero-copy { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px;
  background: rgba(230, 245, 124, .08); border: 1px solid rgba(230, 245, 124, .18); color: var(--lime); font-size: 12px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.hero h1 { margin: 22px 0 18px; font-size: clamp(52px, 7.4vw, 112px); line-height: .92; font-weight: 650; letter-spacing: -.045em; }
.hero h1 span { display: block; color: transparent; -webkit-text-stroke: 1.5px rgba(243, 243, 240, .55); }
.hero h1 em { font-style: normal; color: var(--lime); -webkit-text-stroke: 0; }
.hero p.lead { margin: 0 0 30px; max-width: 470px; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-case { position: relative; display: grid; place-items: center; }
.hero-case .case { width: min(270px, 100%); transform: rotate(-3deg); }
.hero-case .case:hover { transform: rotate(0); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; }
.tile .k { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.tile .v { margin-top: 14px; font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 13px; font-weight: 400; color: var(--faint); margin-left: 4px; letter-spacing: 0; }
.meter { margin-top: 12px; height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: repeating-linear-gradient(-45deg, var(--amber) 0 6px, #f9c968 6px 12px); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 8px; }
.section-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.section-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.workshops { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 14px; }
.ws {
  position: relative; display: flex; flex-direction: column; gap: 16px; min-height: 260px; padding: 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
}
.ws.live:hover { border-color: #46502a; }
.ws .ws-top { display: flex; align-items: center; gap: 12px; }
.ws .ws-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: #2b3020; color: var(--lime); }
.ws h3 { margin: 0; font-size: 17px; font-weight: 600; }
.ws .ws-top small { display: block; color: var(--faint); font-size: 12px; }
.ws p { margin: 0; color: var(--muted); font-size: 13.5px; }
.ws .titles { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.ws .row:hover { background: var(--panel-3); }
.ws .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); font-size: 13px; }
.ws .row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws .go { display: inline-flex; align-items: center; gap: 6px; color: var(--lime); font-size: 13px; font-weight: 500; }
.ws.empty { align-items: center; justify-content: center; text-align: center; background: transparent; border: 1.5px dashed var(--line-2); color: var(--faint); }
.ws.empty .plus { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--line-2); }
.ws.empty b { color: var(--muted); font-weight: 500; }
.ws.empty p { font-size: 12.5px; color: var(--faint); max-width: 200px; }

/* ---------- PS2 case ---------- */
.case {
  container-type: inline-size; position: relative; aspect-ratio: 135 / 190; width: 100%;
  padding: 3.5% 3.5% 3.5% 6%; border-radius: 10px; background: linear-gradient(90deg, #050505, #121212 6%, #0c0c0c);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .09);
  transition: transform .2s, box-shadow .2s;
}
.case::before { /* hinge on the spine */
  content: ""; position: absolute; left: 1.8%; top: 4%; bottom: 4%; width: 1.6%; border-radius: 2px;
  background: repeating-linear-gradient(180deg, #2b2b2b 0 6px, #1b1b1b 6px 9px);
}
.case::after { /* plastic sheen */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .13), transparent 32%, transparent 70%, rgba(255, 255, 255, .04));
}
.sleeve { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 1.5cqw; background: #000; }
.band { flex: none; height: 12.5cqw; display: flex; align-items: center; justify-content: space-between; padding: 0 6cqw; background: #000; border-bottom: .6cqw solid #1e1e1e; }
.band .ps { color: #fff; font-size: 6.6cqw; font-weight: 600; font-style: italic; letter-spacing: -.01em; white-space: nowrap; }
.band .ps sup { font-size: .7em; margin-left: .05em; }
.band small { color: #9a9a9a; font-size: 3.6cqw; letter-spacing: .04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.art { position: relative; flex: 1; overflow: hidden; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gen {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 2cqw; padding: 8cqw 7cqw;
  background:
    radial-gradient(120% 70% at 80% 10%, color-mix(in srgb, var(--tint, #888) 55%, transparent), transparent 60%),
    linear-gradient(170deg, color-mix(in srgb, var(--tint, #888) 35%, #0b0b0b), #070707 80%);
}
.gen .big { font-size: 12cqw; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; color: #fff; word-break: break-word; }
.gen .en { font-size: 5cqw; font-weight: 500; color: rgba(255, 255, 255, .75); }
.gen .pub { position: absolute; top: 7cqw; right: 7cqw; font-size: 4cqw; font-weight: 700; letter-spacing: .12em; color: rgba(255, 255, 255, .6); }
.strip { flex: none; height: 6.5cqw; display: flex; align-items: center; justify-content: space-between; padding: 0 6cqw; background: #000; color: #8a8a8a; font-size: 3.2cqw; letter-spacing: .06em; }
.case.has-cover .band, .case.has-cover .strip { display: none; } /* real covers carry their own PS2 band */
.case.empty { background: transparent; box-shadow: none; border: 1.5px dashed var(--line-2); border-radius: 12px; display: grid; place-items: center; padding: 0; }
.case.empty::before, .case.empty::after { display: none; }
.case.empty .add { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; }
.case.empty .add span { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--line-2); }

/* ---------- PS2 library ---------- */
.library { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.shelf {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 26px 22px; padding: 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px; min-height: 420px; align-content: start;
}
.game { display: flex; flex-direction: column; gap: 14px; text-align: left; border-radius: 16px; transition: opacity .2s; }
.game:hover .case { transform: translateY(-4px); }
.game.sel .case { box-shadow: 0 0 0 3px var(--lime), 0 18px 40px rgba(0, 0, 0, .55); }
.game-info { display: flex; flex-direction: column; gap: 6px; padding: 0 2px; }
.game-info b { font-size: 14px; font-weight: 600; line-height: 1.3; }
.game-info small { font-size: 12px; color: var(--faint); }
.game-info .line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.thin { height: 4px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.thin i { display: block; height: 100%; border-radius: inherit; background: var(--lime); }
.no-match { grid-column: 1 / -1; padding: 60px 0; text-align: center; color: var(--faint); }

.info {
  position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; padding: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px;
}
.info h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.info .meta { margin: 4px 0 0; font-size: 12.5px; color: var(--faint); }
.info .orig { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.info h3 { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.box { padding: 14px 16px; background: var(--panel-2); border-radius: 16px; }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.steps .tick { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--panel-3); color: var(--faint); }
.steps .tick svg.i { width: 12px; height: 12px; stroke-width: 2.4; }
.steps li.done .tick { background: rgba(230, 245, 124, .14); color: var(--lime); }
.steps li:not(.done) { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1; }
.howto { font-size: 12.5px; color: var(--muted); }
.howto ol { margin: 0 0 12px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.howto code, .info code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--panel-3); color: var(--text); }
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.keys div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); }
.keys b { color: var(--text); font-size: 12px; }
.keys span { font-size: 11px; }
.info pre { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); font: 11.5px/1.6 ui-monospace, Consolas, monospace; color: var(--muted); overflow-x: auto; }

/* ---------- player ---------- */
.player { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.console { display: flex; flex-direction: column; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; }
.screen { position: relative; height: clamp(380px, calc(100vh - 196px), 920px); background: #000; }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
.msg { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 24px; text-align: center; background: radial-gradient(70% 60% at 50% 45%, #202020, #0c0c0c); }
.msg[hidden] { display: none; }
.msg .inner { max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.msg b { font-size: 18px; font-weight: 600; }
.msg p { margin: 0 0 6px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.msg code, .hint code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--panel-3); color: var(--text); }
.console-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.console-bar .st { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.console-bar .stats { max-width: 45%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--faint); font-variant-numeric: tabular-nums; }
.dot-live { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #4a4a47; }
.dot-live.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.settings { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; }
.set-head { display: flex; gap: 12px; align-items: center; padding: 2px 2px 4px; }
.set-head > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.set-head b { font-size: 15px; font-weight: 600; line-height: 1.25; }
.set-head small { font-size: 12px; color: var(--faint); }
.set-cover { flex: none; width: 52px; aspect-ratio: 512 / 736; border-radius: 6px; overflow: hidden; background: var(--panel-3); box-shadow: 0 6px 14px rgba(0, 0, 0, .4); }
.set-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; background: var(--panel-2); border-radius: 999px; }
.seg button { padding: 8px 0; border-radius: 999px; font-size: 13px; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-3); color: var(--text); }
.pane { display: flex; flex-direction: column; gap: 12px; }
.pane[hidden] { display: none; }
.memcard { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--panel-2); border-radius: 16px; }
.memcard b { display: block; font-size: 14px; font-weight: 600; }
.memcard small { display: block; margin-top: 2px; font-size: 12px; color: var(--faint); }
.mc { position: relative; flex: none; width: 40px; height: 52px; border-radius: 5px 5px 9px 9px; background: linear-gradient(180deg, #3b3b3b, #1d1d1d); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09); }
.mc::before { content: ""; position: absolute; left: 6px; right: 6px; top: 7px; height: 18px; border-radius: 3px; background: linear-gradient(135deg, #2b3020, #1f2318); box-shadow: inset 0 0 0 1px rgba(230, 245, 124, .25); }
.mc::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 6px; height: 5px; background: repeating-linear-gradient(90deg, #8d8d88 0 2px, transparent 2px 4px); opacity: .6; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; padding: 0 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.field .select { width: 100%; color: var(--text); }
.hint { margin: 0; font-size: 12px; line-height: 1.55; color: var(--faint); }
.pad-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); font-size: 13px; color: var(--muted); }
.pad-status.on { color: var(--text); }
.pad-status.on svg.i { color: var(--green); }
.toast { margin: 0; min-height: 18px; font-size: 12.5px; color: var(--lime); opacity: 0; transition: opacity .25s; }
.toast.on { opacity: 1; }

/* ---------- online ---------- */
.seg button { position: relative; }
.seg-dot { position: absolute; top: 7px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.seg-dot[hidden] { display: none; }
.input {
  width: 100%; height: 40px; padding: 0 14px; border-radius: 12px; outline: 0; font-size: 13.5px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line-2);
}
.input:focus { border-color: #5a6332; }
.input.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .2em; text-transform: uppercase; }
.input::placeholder { color: var(--faint); letter-spacing: normal; font-family: var(--font); text-transform: none; }
.join-row, .link-row { display: flex; gap: 8px; }
.join-row .btn { flex: none; }
.link-row .input { font-size: 12px; color: var(--muted); }
.link-row .icon-btn { flex: none; width: 40px; height: 40px; }
.room-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--panel-2); }
.room-code span { display: block; font-size: 12px; color: var(--faint); }
.room-code b { display: block; margin-top: 2px; font: 600 24px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .18em; color: var(--lime); }
.room-code .icon-btn { background: var(--panel-3); }
.share { display: flex; flex-direction: column; gap: 8px; }
.share:empty { display: none; }
.share-k { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.share-k svg.i { width: 16px; height: 16px; color: var(--lime); }
.members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.members li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--panel-2); }
.members li.away { opacity: .5; }
.m-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: #2b3020; color: var(--lime); }
.m-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-name em { font-style: normal; color: var(--faint); }
.m-name small { display: block; font-size: 11.5px; color: var(--faint); }
.role { flex: none; font-size: 10.5px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.r-host { color: var(--lime); background: rgba(230, 245, 124, .12); }
.r-p2 { color: #7db7ff; background: rgba(125, 183, 255, .13); }
.r-watch { color: var(--muted); background: rgba(255, 255, 255, .06); }
.app.guest { grid-template-columns: minmax(0, 1fr); padding: 20px 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; padding-right: 8px; font-weight: 600; font-size: 15px; }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.sound-btn { position: absolute; z-index: 3; left: 50%; bottom: 24px; transform: translateX(-50%); }
.sound-btn[hidden] { display: none; }
.full-btn { position: absolute; z-index: 3; right: 14px; bottom: 14px; background: rgba(20, 20, 20, .7); }

/* ---------- loading strip under the game ---------- */
.load { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.load-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px rgba(230, 245, 124, .6); transition: background .3s, box-shadow .3s; }
.load-label { flex: none; min-width: 112px; color: var(--text); transition: color .3s; }
.load-bar { position: relative; flex: 1; height: 4px; border-radius: 999px; background: var(--panel-3); overflow: hidden; transition: opacity .3s; }
.load-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--lime); transition: width .2s; }
.load.busy .load-bar i { width: 30%; animation: load-slide 1.1s ease-in-out infinite; }
@keyframes load-slide { from { left: -30%; } to { left: 100%; } }
.load-num { flex: none; min-width: 96px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.load.idle .load-dot { background: #4a4a47; box-shadow: none; }
.load.idle .load-label { color: var(--faint); }
.load.idle .load-bar { opacity: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .search { width: 220px; }
  .user div { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workshops { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .workshops .ws.live { grid-column: 1 / -1; }
  .library { grid-template-columns: minmax(0, 1fr) 340px; }
  .player { grid-template-columns: minmax(0, 1fr); }
  .settings { position: static; }
  .screen { height: min(70vh, 640px); }
  .load-label { min-width: 0; }
  .load-num { min-width: 0; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 16px 96px; }
  .rail {
    position: fixed; z-index: 50; top: auto; left: 16px; right: 16px; bottom: 12px; height: 64px;
    flex-direction: row; justify-content: space-around; padding: 0 10px;
  }
  .rail hr, .rail .spacer, .rail .rail-extra { display: none; }
  .rail .logo { margin: 0; }
  .rail-btn[data-label]:hover::after { display: none; }
  .topbar { flex-wrap: wrap; }
  .pills { order: 3; flex-basis: 100%; }
  .topbar .grow { display: none; }
  .search { flex: 1; width: auto; }
  .search .kbd { display: none; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .page-head h1 { font-size: 26px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 32px 22px; min-height: 0; }
  .hero-case { order: -1; }
  .hero-case .case { width: 170px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .v { font-size: 22px; }
  .workshops { grid-template-columns: minmax(0, 1fr); }
  .library { grid-template-columns: minmax(0, 1fr); }
  .info { position: static; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; gap: 20px 14px; min-height: 0; }
  .foot { flex-direction: column; padding: 8px 4px 0; }
}
@media (max-width: 480px) {
  .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
