@font-face { font-family: "M PLUS 1p"; font-weight: 300; font-display: swap; src: url("../fonts/mplus1p-300.woff2") format("woff2"); }
@font-face { font-family: "M PLUS 1p"; font-weight: 400; font-display: swap; src: url("../fonts/mplus1p-400.woff2") format("woff2"); }
@font-face { font-family: "M PLUS 1p"; font-weight: 500; font-display: swap; src: url("../fonts/mplus1p-500.woff2") format("woff2"); }
@font-face { font-family: "M PLUS 1p"; font-weight: 700; font-display: swap; src: url("../fonts/mplus1p-700.woff2") format("woff2"); }

:root {
  /* theme colours, set from JS */
  --deep: #331703;
  --base: #b4610b;
  --glow: #f6ba5e;
  /* menu geometry, set from JS */
  --ax: 240px;
  --ay: 200px;
  --gap: 150px;

  --ink: #05070b;
  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 0 14px rgba(0, 0, 0, 0.25);
  --bronze: #e0a070;
  --silver: #dbe3ec;
  --gold: #f7cd5a;
  --platinum: #a9ddff;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; overflow: hidden; }

body {
  /* stands in for the shader when WebGL is unavailable */
  background:
    radial-gradient(120% 70% at 60% 58%, var(--base), transparent 70%),
    var(--deep);
  color: #fff;
  font-family: "M PLUS 1p", "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus { outline: none; }
p { margin: 0; }
kbd {
  display: inline-grid; place-items: center;
  min-width: 24px; height: 22px; padding: 0 7px; margin-right: 7px;
  border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 6px;
  font: inherit; font-size: 11px; letter-spacing: 0.04em; line-height: 1;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

svg { fill: currentColor; display: block; }
svg .line { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
svg .cut { fill: rgba(0, 0, 0, 0.42); }
svg .cut-line { fill: none; stroke: rgba(0, 0, 0, 0.42); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

#wave { position: fixed; inset: 0; width: 100%; height: 100%; }

#app {
  position: fixed; inset: 0; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: opacity 0.4s, transform 0.5s var(--ease), filter 0.4s;
}
body[data-mode="detail"] #app { opacity: 0; transform: scale(1.06); }
body[data-mode="dialog"] #app { filter: blur(3px); }

/* ───────── top bar ───────── */

#topbar {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 3vw, 36px) 0;
  text-shadow: var(--shadow);
  transition: opacity 0.8s 0.2s;
}
.owner { display: flex; align-items: baseline; gap: 10px; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; }
.owner strong { font-weight: 500; }
.owner span { opacity: 0.7; }
.status { display: flex; align-items: center; gap: 14px; font-size: 14px; white-space: pre; font-variant-numeric: tabular-nums; }
#mute { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; opacity: 0.9; }
#mute:hover { background: rgba(255, 255, 255, 0.16); }
#mute svg { width: 19px; height: 19px; }
#battery svg { width: 30px; height: 14px; }

/* ───────── cross menu ───────── */

#xmb { position: absolute; inset: 0; transition: opacity 0.35s; }
body[data-mode="options"] #xmb { opacity: 0.45; }
body[data-mode="options"] #info { visibility: hidden; }

.cat {
  position: absolute; left: var(--ax); top: var(--ay);
  width: 104px; height: 104px; margin: -52px 0 0 -52px;
  display: grid; place-items: center;
  opacity: var(--op, 0.6);
  transform: translateX(calc(var(--d, 0) * var(--gap)));
  transition: transform 0.34s var(--ease), opacity 0.3s;
}
.cat > svg {
  width: 78px; height: 78px;
  transform: scale(0.62);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  transition: transform 0.34s var(--ease), filter 0.3s;
}
.cat:hover { opacity: 1; }
.cat:hover > svg { transform: scale(0.68); }
.cat.active > svg, .cat.active:hover > svg {
  transform: scale(1);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 12px rgba(255, 255, 255, 0.55));
}
.cat-label {
  position: absolute; top: calc(100% - 8px); left: 50%;
  transform: translateX(-50%);
  font-size: 15px; font-weight: 500; letter-spacing: 0.04em; white-space: nowrap;
  text-shadow: var(--shadow);
  opacity: 0; transition: opacity 0.25s;
}
.cat.active .cat-label { opacity: 1; }

.col {
  position: absolute; left: 0; top: 0;
  transform: translateX(calc(var(--ax) + var(--d, 0) * var(--gap)));
  opacity: 0; pointer-events: none;
  transition: transform 0.34s var(--ease), opacity 0.22s;
}
.col.active { opacity: 1; pointer-events: auto; }

.item {
  --iw: 72px;
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center;
  opacity: var(--op, 0);
  transform: translateY(var(--y, 0px)) translateY(-50%);
  transition: transform 0.32s var(--ease), opacity 0.28s;
  text-align: left; white-space: nowrap;
}
.item.gone { pointer-events: none; }
.item:not(.sel):not(.gone):hover { opacity: min(1, calc(var(--op, 0) + 0.3)); }
.wide .item { --iw: 132px; }

.item-ico {
  flex: none; display: grid; place-items: center;
  width: var(--iw); height: 74px; margin-left: calc(var(--iw) / -2);
}
.item-ico > svg {
  width: 58px; height: 58px;
  transform: scale(0.6);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  transition: transform 0.32s var(--ease), filter 0.3s;
}
.item-ico > svg.cover {
  width: 132px; height: 74px; border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 6px 18px rgba(0, 0, 0, 0.4);
  filter: none;
}
.item.sel .item-ico > svg { transform: scale(1); }
.item.sel .item-ico > svg:not(.cover) { animation: breathe 2.4s ease-in-out infinite; }
.item.sel .item-ico > svg.cover { animation: breathe-cover 2.4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.3)); }
  50% { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 13px rgba(255, 255, 255, 0.75)); }
}
@keyframes breathe-cover {
  0%, 100% { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85), 0 0 14px color-mix(in srgb, var(--focus, #fff) 45%, transparent), 0 8px 22px rgba(0, 0, 0, 0.45); }
  50% { box-shadow: 0 0 0 1.5px #fff, 0 0 34px color-mix(in srgb, var(--focus, #fff) 85%, transparent), 0 8px 22px rgba(0, 0, 0, 0.45); }
}

.item-text {
  position: relative; margin-left: 16px;
  transform-origin: left center;
  transform: translateX(calc(var(--iw) * -0.16)) scale(0.72);
  transition: transform 0.32s var(--ease);
  text-shadow: var(--shadow);
}
.item-title { max-width: calc(100vw - var(--ax) - var(--iw) / 2 - 36px); }
.item.sel .item-text { transform: translateY(-11px); }
.item-title { display: block; font-size: 27px; font-weight: 500; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.item.sel .item-title { animation: pulse 2.4s ease-in-out infinite; }
.item-sub {
  position: absolute; top: 100%; left: 1px; margin-top: 1px;
  font-size: 14px; letter-spacing: 0.02em;
  opacity: 0; transition: opacity 0.25s;
  width: max-content; max-width: calc(100vw - var(--ax) - var(--iw) / 2 - 36px);
  overflow: hidden; text-overflow: ellipsis;
}
.item.sel .item-sub { opacity: 0.88; }

@keyframes pulse {
  0%, 100% { text-shadow: var(--shadow), 0 0 6px rgba(255, 255, 255, 0.2); }
  50% { text-shadow: var(--shadow), 0 0 16px rgba(255, 255, 255, 0.85); }
}

/* trophy colours (menu items and toasts) */
[data-cls="grade-bronze"] svg { color: var(--bronze); }
[data-cls="grade-silver"] svg { color: var(--silver); }
[data-cls="grade-gold"] svg { color: var(--gold); }
[data-cls="grade-platinum"] svg { color: var(--platinum); }
[data-cls="locked"] svg { opacity: 0.55; }

/* ───────── info pane (wide screens) ───────── */

#info {
  position: absolute;
  left: max(54vw, calc(var(--ax) + 430px)); right: clamp(24px, 5vw, 80px);
  top: calc(var(--ay) + 48px);
  max-width: 468px;
  padding: 14px 14px 20px; border-radius: 22px;
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--focus, transparent) 16%, transparent), transparent 70%),
    rgba(8, 10, 16, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 26px 60px rgba(0, 0, 0, 0.28),
    0 0 60px color-mix(in srgb, var(--focus, transparent) 14%, transparent);
  backdrop-filter: blur(26px) saturate(1.35); -webkit-backdrop-filter: blur(26px) saturate(1.35);
  opacity: 0; transform: translateX(14px);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
}
#info:empty { display: none; }
#info > :not(.info-cover) { margin-left: 8px; margin-right: 8px; }
#info > :first-child:not(.info-cover) { margin-top: 6px; }
#info.show { opacity: 1; transform: none; transition: opacity 0.45s, transform 0.5s var(--ease); }
@media (min-width: 760px) and (max-width: 1099px), (max-height: 599px) { #info { display: none; } }

.info-cover, .detail-cover { position: relative; }
.info-cover::after, .detail-cover::after {
  /* gloss, like light across a game case */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(112deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03) 34%, transparent 46%);
  background-position: var(--gx, 50%) 0; background-size: 220% 100%;
}
.info-cover {
  aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; margin-bottom: 16px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 10px 26px rgba(0, 0, 0, 0.4);
}
.info-cover .cover { width: 100%; height: 100%; }
.info-kicker { font-size: 12px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.85; margin-bottom: 8px; }
.info-text { font-size: 17px; line-height: 1.55; }
.info-note { font-size: 13px; opacity: 0.8; margin-top: 10px; }
.info-cta { display: flex; align-items: center; font-size: 13px; margin-top: 18px; opacity: 0.9; }

/* cover art comes alive only where it is shown large */
.live .cv-sweep { transform-box: view-box; transform-origin: 160px 84px; animation: cv-spin 7s linear infinite; }
.live .cv-scroll { animation: cv-scroll 10s linear infinite; }
.live .cv-cursor { animation: cv-cursor 5s linear infinite; }
.live .cv-blink { animation: cv-blink 1.1s steps(1) infinite; }
.live .cv-march { animation: cv-march 1.6s linear infinite; }
.live .cv-pulse { animation: cv-pulse 1.5s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -0.17s); }
.live .cv-bar { transform-box: fill-box; transform-origin: center; animation: cv-bar 0.9s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -0.23s); }
@keyframes cv-spin { to { transform: rotate(360deg); } }
@keyframes cv-scroll { to { transform: translateX(163.4px); } }
@keyframes cv-cursor { to { transform: translateX(320px); } }
@keyframes cv-blink { 50% { opacity: 0; } }
@keyframes cv-march { to { stroke-dashoffset: -9; } }
@keyframes cv-pulse { from { opacity: 0.25; } }
@keyframes cv-bar { from { transform: scaleY(0.3); } }

.cover-title { font-family: inherit; font-size: 21px; font-weight: 700; letter-spacing: 0.02em; text-shadow: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; }
.chips li {
  padding: 3px 12px; border-radius: 999px; font-size: 12.5px; letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
  text-shadow: none;
}

.rows { margin: 0; display: grid; gap: 10px; }
.rows > div { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: baseline; }
.rows dt { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.7; }
.rows dd { margin: 0; font-size: 15.5px; }

.progress { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); margin-top: 20px; overflow: hidden; }
.progress span { display: block; height: 100%; background: #fff; border-radius: 3px; }

/* ───────── hints ───────── */

#hints {
  position: fixed; z-index: 45; right: clamp(18px, 3vw, 36px); bottom: max(18px, env(safe-area-inset-bottom));
  display: flex; gap: 22px; font-size: 13px; text-shadow: var(--shadow); opacity: 0.92;
  transition: opacity 0.8s 0.4s;
}
#hints span { display: flex; align-items: center; }
#hints:empty { display: none; }
body[data-mode="detail"] #hints {
  padding: 7px 16px; border-radius: 999px;
  background: rgba(12, 16, 23, 0.72); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.compact body[data-mode="detail"] #hints { display: none; }

/* phones: the info pane becomes a short summary strip above the hints */
.compact #info {
  left: 14px; right: 14px; top: auto; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 40px);
  max-width: none; padding: 12px 8px 13px; border-radius: 16px; transform: translateY(10px);
}
.compact #info.show { transform: none; }
.compact #info > .info-cover, .compact #info > .chips, .compact #info > .info-cta, .compact #info > .rows, .compact #info > .progress { display: none; }
.compact #info > :first-child:not(.info-cover) { margin-top: 0; }
.compact .info-kicker { font-size: 10.5px; margin-bottom: 4px; }
.compact .info-text { font-size: 14px; line-height: 1.45; }
.compact .info-note { font-size: 12px; margin-top: 4px; }
.compact #detail-pager { left: 50%; transform: translateX(-50%); }
.compact #detail-pager button span { display: none; }

/* ───────── options panel ───────── */

#options {
  position: fixed; z-index: 20; top: 0; right: 0; bottom: 0;
  width: min(380px, 88vw);
  display: flex; flex-direction: column; justify-content: center;
  padding: 70px 0 70px 56px;
  background: linear-gradient(90deg, transparent, rgba(5, 7, 11, 0.78) 26%);
  transform: translateX(100%); visibility: hidden;
  transition: transform 0.34s var(--ease), visibility 0s 0.34s;
}
#options.open { transform: none; visibility: visible; transition: transform 0.34s var(--ease), visibility 0s; }
#options h2 { margin: 0 0 14px 22px; font-size: 12px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.7; }
#options-list { overflow-y: auto; scrollbar-width: none; padding-right: 20px; }
#options-list::-webkit-scrollbar { display: none; }
.opt {
  position: relative; display: flex; align-items: baseline; gap: 12px; width: 100%;
  padding: 7px 14px 7px 22px; border-radius: 10px; text-align: left;
  font-size: 18px; opacity: 0.6; transition: opacity 0.15s, background 0.15s;
}
.opt small { font-size: 12.5px; opacity: 0.75; }
.opt .swatch { flex: none; align-self: center; width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.7); }
.opt.current::before { content: ""; position: absolute; left: 7px; top: 50%; width: 7px; height: 7px; margin-top: -3px; border-radius: 50%; background: #fff; }
.opt:hover { opacity: 0.85; }
.opt.sel { opacity: 1; background: rgba(255, 255, 255, 0.14); text-shadow: 0 0 12px rgba(255, 255, 255, 0.6); }

/* ───────── detail screen ───────── */

@property --accent { syntax: "<color>"; inherits: true; initial-value: #f6ba5e; }

#detail {
  --ox: 50vw; --oy: 50vh;
  position: fixed; inset: 0; z-index: 30;
  background:
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    radial-gradient(70% 60% at 0% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    linear-gradient(180deg, #0c1017, var(--ink));
  clip-path: circle(0px at var(--ox) var(--oy));
  visibility: hidden;
  transition: clip-path 0.5s cubic-bezier(0.5, 0, 0.3, 1), visibility 0s 0.5s, --accent 0.5s;
}
#detail.open {
  clip-path: circle(150vmax at var(--ox) var(--oy));
  visibility: visible;
  transition: clip-path 0.75s cubic-bezier(0.3, 0, 0.2, 1), visibility 0s, --accent 0.5s;
}
#detail-back {
  position: absolute; z-index: 2; top: max(16px, env(safe-area-inset-top)); left: clamp(14px, 3vw, 32px);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  font-size: 14px; background: rgba(12, 16, 23, 0.7); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#detail-back::before { content: ""; width: 8px; height: 8px; border-left: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); margin-left: 4px; }
#detail-back:hover { background: rgba(255, 255, 255, 0.16); }
#detail-scroll {
  position: absolute; inset: 0; display: flex; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain;
  padding: 84px clamp(20px, 6vw, 96px) 84px;
}
#detail-body {
  display: grid; grid-template-columns: minmax(260px, 480px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px); align-items: start;
  width: 100%; max-width: 1160px; margin: auto;
}
.detail-art { transform-origin: 0 0; transition: transform 0.7s cubic-bezier(0.2, 0.85, 0.25, 1); }
.detail-copy { opacity: 0; transform: translateY(16px); transition: opacity 0.2s, transform 0.2s; }
#detail.open .detail-copy { opacity: 1; transform: none; transition: opacity 0.5s 0.3s, transform 0.6s 0.3s var(--ease); }
#detail-body.plain { grid-template-columns: 160px minmax(0, 1fr); max-width: 900px; }
/* flipping between entries: slide out one way, come in from the other */
#detail.open #detail-body[data-swap] { opacity: 0; transition: opacity 0.16s, transform 0.16s ease-in; }
#detail.open #detail-body[data-swap="next"] { transform: translateX(-36px); }
#detail.open #detail-body[data-swap="prev"] { transform: translateX(36px); }
#detail.open #detail-body[data-swap="from-next"] { transform: translateX(36px); transition: none; }
#detail.open #detail-body[data-swap="from-prev"] { transform: translateX(-36px); transition: none; }
#detail.open #detail-body:not([data-swap]) { transition: opacity 0.4s, transform 0.5s var(--ease); }

#detail-pager {
  position: absolute; z-index: 2; left: clamp(14px, 3vw, 32px); bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 4px; padding: 4px;
  border-radius: 999px; font-size: 13.5px;
  background: rgba(12, 16, 23, 0.72); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#detail-pager[hidden] { display: none; }
#detail-pager button { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px; max-width: 30vw; }
#detail-pager button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#detail-pager button:hover { background: rgba(255, 255, 255, 0.16); }
#detail-pager button:disabled { opacity: 0.28; pointer-events: none; }
#pager-prev::before, #pager-next::after { content: ""; flex: none; width: 7px; height: 7px; border-left: 2px solid; border-bottom: 2px solid; }
#pager-prev::before { transform: rotate(45deg); margin-left: 3px; }
#pager-next::after { transform: rotate(-135deg); margin-right: 3px; }
#pager-count { padding: 0 8px; font-size: 12px; letter-spacing: 0.08em; opacity: 0.7; font-variant-numeric: tabular-nums; white-space: nowrap; }

.detail-art { perspective: 1100px; }
@media (min-width: 760px) {
  /* a mirror-floor reflection, where there is room for one */
  .detail-cover { -webkit-box-reflect: below 10px linear-gradient(transparent 55%, rgba(255, 255, 255, 0.3)); }
}
.detail-cover {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.35s ease-out;
  aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 80px color-mix(in srgb, var(--accent) 16%, transparent);
}
.detail-cover .cover { width: 100%; height: 100%; }
.detail-cover .cover-title, .detail-cover .cover-bar, .detail-cover .cover-fade,
.item-ico .cover-title, .item-ico .cover-bar, .item-ico .cover-fade { display: none; }
.detail-tile {
  aspect-ratio: 1; border-radius: 28px; display: grid; place-items: center;
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 42%, #10141c), #10141c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 24px 50px rgba(0, 0, 0, 0.5);
}
.detail-tile svg { width: 54%; height: 54%; }

.detail-kicker { font-size: 13px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.detail-copy h1 { margin: 6px 0 0; font-size: clamp(34px, 5vw, 60px); font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
.detail-meta { margin-top: 12px; font-size: 14.5px; color: #aeb7c6; }
.detail-meta span { margin: 0 9px; opacity: 0.5; }
.detail-text { margin-top: 26px; max-width: 62ch; color: #d5dbe6; font-size: 17px; line-height: 1.7; }
.detail-text p + p { margin-top: 14px; }
.detail-text .rows { gap: 16px; }
.detail-text p + .rows { margin-top: 26px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.12); gap: 10px; }
.detail-text .rows dd { font-size: 17px; color: #fff; }
.detail-copy .chips { margin-top: 26px; }
.detail-copy .chips li { background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); color: color-mix(in srgb, var(--accent) 60%, #fff); font-size: 13.5px; padding: 4px 14px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 500; color: #fff; text-decoration: none;
  background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.18); }
.btn.focus { background: #fff; color: var(--ink); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.22), 0 0 26px rgba(255, 255, 255, 0.3); }

/* ───────── dialog ───────── */

#dialog {
  position: fixed; inset: 0; z-index: 40; display: grid; align-items: center;
  background: rgba(5, 7, 11, 0.5);
  opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0s 0.25s;
}
#dialog.open { opacity: 1; visibility: visible; transition: opacity 0.25s, visibility 0s; }
.dialog-band {
  padding: 34px 24px 36px; text-align: center;
  background: linear-gradient(180deg, rgba(10, 13, 20, 0.86), rgba(10, 13, 20, 0.94));
  border-block: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transform: scaleY(0.9); transition: transform 0.3s var(--ease);
}
#dialog.open .dialog-band { transform: none; }
.dialog-band h2 { margin: 0 0 14px; font-size: 22px; font-weight: 500; }
#dialog-body { max-width: 560px; margin: 0 auto; color: #d5dbe6; }
#dialog-body .dim { margin-top: 8px; font-size: 13.5px; opacity: 0.7; }
#dialog-body .rows { text-align: left; }
#dialog-body .rows > div { grid-template-columns: 150px 1fr; }
#dialog-buttons { display: flex; justify-content: center; gap: 12px; margin-top: 26px; }
#dialog-buttons .btn { min-width: 120px; justify-content: center; }

/* ───────── trophy toast ───────── */

#toasts { position: fixed; z-index: 50; top: max(58px, calc(env(safe-area-inset-top) + 48px)); right: clamp(14px, 3vw, 36px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px 10px 12px; border-radius: 16px;
  background: rgba(10, 13, 20, 0.88); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 14px 34px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: translateX(30px);
  transition: opacity 0.4s, transform 0.5s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast svg { width: 34px; height: 34px; }
.toast small { display: block; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.7; }
.toast strong { font-size: 16px; font-weight: 500; }

/* ───────── boot ───────── */

#boot {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: #000; cursor: pointer;
  animation: boot-bg 1.5s 0.3s ease-in-out forwards;
  transition: opacity 0.7s;
}
#boot.short { animation-duration: 0.9s; animation-delay: 0.1s; }
#boot.done { opacity: 0; pointer-events: none; }
#boot.instant { display: none; }
.boot-mark { text-align: center; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35); }
.boot-name {
  display: block; font-size: clamp(26px, 5vw, 50px); font-weight: 300; text-transform: uppercase;
  letter-spacing: 0.5em; margin-right: -0.5em; opacity: 0;
  animation: boot-name 2.2s 0.6s var(--ease) forwards;
}
.boot-sub {
  display: block; margin-top: 14px; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0;
  animation: boot-sub 1.2s 1.5s ease forwards;
}
#boot.short .boot-name { animation-duration: 1.2s; animation-delay: 0.15s; }
#boot.short .boot-sub { animation-delay: 0.6s; animation-duration: 0.8s; }
@keyframes boot-bg { to { background: rgba(0, 0, 0, 0); } }
@keyframes boot-name { from { opacity: 0; letter-spacing: 0.9em; margin-right: -0.9em; } to { opacity: 1; letter-spacing: 0.34em; margin-right: -0.34em; } }
@keyframes boot-sub { to { opacity: 0.75; } }

body[data-state="boot"] #topbar, body[data-state="boot"] #hints { opacity: 0; }
body[data-state="boot"] #xmb { opacity: 0; transform: translateX(70px); }
body[data-state="ready"] #xmb { transition: opacity 0.9s 0.15s, transform 1.1s 0.15s var(--ease); }
body[data-state="ready"][data-mode="options"] #xmb { transition: opacity 0.35s; }

.noscript { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; gap: 10px; padding: 24px; text-align: center; background: #0b0e14; }
.noscript a { color: #f6ba5e; }

/* ───────── small screens ───────── */

.compact .cat { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
.compact .cat > svg { width: 62px; height: 62px; }
.compact .cat-label { font-size: 13.5px; }
.compact .item { --iw: 60px; }
.compact .wide .item { --iw: 104px; }
.compact .item-ico { height: 60px; }
.compact .item-ico > svg { width: 48px; height: 48px; }
.compact .item-ico > svg.cover { width: 104px; height: 58.5px; }
.compact .item-text { margin-left: 12px; }
.compact .item-title { font-size: 21px; }
.compact .item-sub { font-size: 12.5px; line-height: 1.35; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.compact .owner span { display: none; }
.compact .owner { font-size: 12px; }
.compact #hints { left: 0; right: 0; justify-content: center; font-size: 12px; }

@media (max-width: 759px) {
  #detail-body, #detail-body.plain { grid-template-columns: 1fr; }
  #detail-body.plain .detail-tile { width: 96px; border-radius: 20px; }
  .rows > div, #dialog-body .rows > div { grid-template-columns: 1fr; gap: 0; }
  #options { padding-left: 34px; }
  .dialog-band h2 { font-size: 19px; }
}

/* ───────── reduced motion ───────── */

[data-motion="reduced"] *, [data-motion="reduced"] *::before {
  transition-duration: 0.01ms !important; transition-delay: 0s !important;
  animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
}
