/* NullerGames portal — "PRESS PLAY": saturated glow + glass + thick NW-pressed buttons.
   Every colour lives in tokens; dark and light are the same layout with two palettes. */
:root {
  color-scheme: dark;
  --page: #15113a;
  --page-2: #1c1650;
  --ink: #f5f2ff;
  --muted: #b7aedb;
  --faint: #7f75ad;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-2: rgba(255, 255, 255, 0.11);
  --glass-line: rgba(255, 255, 255, 0.14);
  --glass-line-2: rgba(255, 255, 255, 0.26);
  --base: rgba(0, 0, 0, 0.55);
  --press: #ff3d9a;
  --press-ink: #ffffff;
  --press-base: #8f0f4f;
  --mark: #ffd23f;
  --mark-ink: #2a1c00;
  --glow-a: #ff4fa3;
  --glow-b: #38d9ff;
  --glow-c: #ffd23f;
  --hexa: #22c7e6;
  --pick: #ff9b2f;
  --gas: #86d63a;
  --life: #2fd39a;
  --rebirth: #8b6bff;
  --ok: #4ade80;
  --wip: #ffb020;
  --shadow: 0 18px 50px rgba(6, 3, 30, 0.45);
  --pop-bg: #2a2464;
  --radius: 20px;
  --radius-s: 14px;
  --font: Pretendard, "Pretendard Variable", "Noto Sans KR", "Noto Sans CJK KR", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #fff3cf;
  --page-2: #ffe9b0;
  --ink: #1d1738;
  --muted: #5d557f;
  --faint: #8e87ab;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-2: rgba(255, 255, 255, 0.78);
  --glass-line: rgba(255, 255, 255, 0.9);
  --glass-line-2: rgba(29, 23, 56, 0.16);
  --base: rgba(29, 23, 56, 0.28);
  --press: #f0207f;
  --press-ink: #ffffff;
  --press-base: #8a0c48;
  --mark: #f0207f;
  --mark-ink: #ffffff;
  --glow-a: #ff8fc3;
  --glow-b: #7fe7ff;
  --glow-c: #c8ff8a;
  --shadow: 0 18px 44px rgba(90, 60, 10, 0.16);
  --pop-bg: #fff9e8;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --page: #fff3cf;
    --page-2: #ffe9b0;
    --ink: #1d1738;
    --muted: #5d557f;
    --faint: #8e87ab;
    --glass: rgba(255, 255, 255, 0.58);
    --glass-2: rgba(255, 255, 255, 0.78);
    --glass-line: rgba(255, 255, 255, 0.9);
    --glass-line-2: rgba(29, 23, 56, 0.16);
    --base: rgba(29, 23, 56, 0.28);
    --press: #f0207f;
    --press-ink: #ffffff;
    --press-base: #8a0c48;
    --mark: #f0207f;
    --mark-ink: #ffffff;
    --glow-a: #ff8fc3;
    --glow-b: #7fe7ff;
    --glow-c: #c8ff8a;
    --shadow: 0 18px 44px rgba(90, 60, 10, 0.16);
    --pop-bg: #fff9e8;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  word-break: keep-all;
  overflow-wrap: anywhere;
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--press); outline-offset: 3px; border-radius: 8px; }
.skip { position: fixed; top: -80px; left: 16px; padding: 12px 16px; background: var(--ink); color: var(--page); border-radius: 12px; z-index: 50; font-weight: 700; }
.skip:focus { top: 16px; }

/* Static ambient light preserves the saturated theme without six full-screen
   animated layers invalidating every glass surface on each frame. Soft edges
   live in gradients; no blur texture or permanent will-change is required. */
.glow {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, var(--page) 0%, var(--page-2) 100%);
  contain: strict;
}
.glow i {
  position: absolute; display: block; border-radius: 50%;
  width: 46vmax; height: 46vmax; margin: -23vmax 0 0 -23vmax;
  background: radial-gradient(closest-side, var(--c) 0%, color-mix(in srgb, var(--c) 55%, transparent) 30%, transparent 72%);
  opacity: .48;
}
.glow i:nth-child(1) { --c: var(--glow-a); left: 14%; top: 12%; }
.glow i:nth-child(2) { --c: var(--glow-b); left: 88%; top: 20%; }
.glow i:nth-child(3) { --c: var(--glow-c); left: 58%; top: 96%; }
.glow i:nth-child(4) { --c: var(--glow-b); left: 30%; top: 70%; width: 34vmax; height: 34vmax; margin: -17vmax 0 0 -17vmax; }
.glow i:nth-child(5) { --c: var(--glow-a); left: 76%; top: 62%; width: 30vmax; height: 30vmax; margin: -15vmax 0 0 -15vmax; }
.glow i:nth-child(6) { --c: var(--glow-c); left: 6%; top: 48%; width: 26vmax; height: 26vmax; margin: -13vmax 0 0 -13vmax; }
:root[data-theme="light"] .glow i { mix-blend-mode: multiply; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .glow i { mix-blend-mode: multiply; } }
.glow::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(70% 55% at 50% 0%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 55% at 50% 0%, #000 20%, transparent 100%);
}

.shell { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Top bar: brand + pill controls (reference: brand left, two pill dropdowns right). */
.topbar { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--page) 62%, transparent); border-bottom: 1px solid var(--glass-line); }
.topbar .shell { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.7px; white-space: nowrap; }
.brand svg { width: 28px; height: 28px; }
.brand b { color: var(--press); font-weight: 800; }
.controls { display: flex; align-items: center; gap: 8px; }
@media (max-width: 480px) { .controls .pill:not(.theme-pill):not(.fullscreen-pill):not(.share-pill) { display: none; } .topbar .shell { min-height: 58px; } }
@media (max-width: 360px) { .topbar .shell { gap: 4px; } .brand { gap: 6px; font-size: 17px; } .controls { gap: 4px; } .controls .theme-pill { min-width: 40px; justify-content: center; padding: 8px 11px; font-size: 0; } .controls .theme-pill svg { width: 18px; height: 18px; } }

/* Pills: glass face, thick base offset to the south-east, so the face reads as raised toward the north-west. */
.pill, .btn, .chip, .tab {
  --face: var(--glass-2);
  --line: var(--glass-line-2);
  --depth: 4px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px;
  background: var(--face); color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--depth) var(--depth) 0 var(--base);
  transform: translate(0, 0);
  transition: transform 120ms ease, box-shadow 120ms ease, background 160ms ease;
  cursor: pointer; user-select: none; white-space: nowrap;
  font-weight: 700; font-size: 14px; line-height: 1.2;
}
.pill:hover, .btn:hover, .chip:hover, .tab:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--base); }
.pill:active, .btn:active, .chip:active, .tab:active { transform: translate(var(--depth), var(--depth)); box-shadow: 0 0 0 var(--base); }
.pill svg, .btn svg, .tab svg { width: 16px; height: 16px; flex: none; }
.btn { border-radius: 14px; padding: 11px 16px; }
/* Icon-only pill (fullscreen toggle on app pages). portal.js hides it without the Fullscreen API. */
.pill.icon-only { padding: 8px 11px; font-size: 17px; line-height: 1; min-width: 40px; justify-content: center; }
.fullscreen-pill[hidden] { display: none; }
:fullscreen .fullscreen-pill, :-webkit-full-screen .fullscreen-pill { --face: var(--ink); color: var(--page); --line: transparent; }
.btn.primary { --face: var(--press); --line: transparent; color: var(--press-ink); box-shadow: var(--depth) var(--depth) 0 var(--press-base); }
.btn.primary:hover { box-shadow: 2px 2px 0 var(--press-base); }
.btn.primary:active { box-shadow: 0 0 0 var(--press-base); }
.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 12px; --depth: 3px; }
.chip { padding: 8px 12px; font-size: 13px; --depth: 3px; }
.chip .emoji { font-size: 15px; line-height: 1; }
.chip[aria-current="true"], .chip.on { --face: var(--ink); color: var(--page); --line: transparent; }

/* Icon tab pills under the top bar (reference: 직업 수명 / 전공 수명 / 전체 순위). */
.tabbar { position: sticky; top: 64px; z-index: 29; display: flex; justify-content: center; gap: 8px; padding: 10px 20px; background: color-mix(in srgb, var(--page) 92%, transparent); border-bottom: 1px solid var(--glass-line); }
.tab { flex-direction: column; gap: 4px; border-radius: 14px; padding: 8px 14px; font-size: 11px; min-width: 76px; --depth: 3px; }
.tab svg { width: 18px; height: 18px; }
.tab.on { --face: var(--press); --line: transparent; color: var(--press-ink); box-shadow: 3px 3px 0 var(--press-base); }
.tab.on:hover { box-shadow: 2px 2px 0 var(--press-base); }
/* Home: the tabbar row is a slim category jump bar (chips → sections; the one on screen is `.on`). */
.jumpbar { padding: 8px 20px; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.jumpbar::-webkit-scrollbar { display: none; }
.jumpbar .chip { padding: 6px 12px; font-size: 13px; }
/* Share toast (portal.js, 2 s) */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 12px); padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--page); font-size: 14px; font-weight: 800; box-shadow: 0 12px 30px rgba(6, 3, 30, .35); opacity: 0; pointer-events: none; transition: opacity 160ms ease, transform 160ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 899px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom)); } }

/* In-app browsers that reject native fullscreen can still give the test more room. */
.is-expanded-view > .bottombar, .is-expanded-view > .tabbar, .is-expanded-view .footer { display: none; }
.is-expanded-view .topbar .shell { min-height: 44px; }
.is-expanded-view .app-session > .app, .is-expanded-view .app-identity .shell { max-width: 1600px; }
.is-expanded-view .fullscreen-pill { --face: var(--ink); color: var(--page); --line: transparent; }
.is-expanded-view .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }

/* Hero */
.hero { padding: 54px 0 34px; }
.hero h1 { font-size: clamp(32px, 5.2vw, 54px); line-height: 1.18; letter-spacing: -1.6px; margin: 0 0 14px; font-weight: 800; max-width: 760px; }
.hero h1 .mark { display: inline-block; background: var(--mark); color: var(--mark-ink); padding: 0 10px; border-radius: 12px; box-shadow: 4px 4px 0 var(--base); transform: rotate(-1.2deg); }
.identity-mark { --mark: #ffdd62; --mark-ink: #2a1c00; }
button.tactile-mark, button.identity-mark { display: inline-block; border: 0; padding: 0 10px; color: var(--mark-ink); background: var(--mark); border-radius: 12px; font: inherit; letter-spacing: inherit; line-height: inherit; vertical-align: baseline; cursor: pointer; box-shadow: 4px 4px 0 var(--base); transform: rotate(-1.2deg); transform-origin: center; touch-action: manipulation; }
button.tactile-mark:active, button.identity-mark:active, .hero h1 button.tactile-mark:active { transform: translate(3px, 3px) rotate(-3deg) scale(.96); box-shadow: 0 0 0 var(--base); }
.hero p { margin: 0 0 22px; font-size: clamp(15px, 1.8vw, 18px); color: var(--muted); max-width: 620px; }
/* Sections */
.section { padding: 26px 0 8px; scroll-margin-top: 130px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.section-head h2 { font-size: 26px; letter-spacing: -0.6px; margin: 0; font-weight: 800; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.section-head .more { font-size: 14px; font-weight: 700; color: var(--press); padding: 6px 0; white-space: nowrap; }
.section-head .count { margin-left: 8px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; vertical-align: 4px; background: color-mix(in srgb, var(--ink) 12%, transparent); color: var(--muted); }
/* Home: the one H1 is a small single line above the first grid, never a hero. */
.sr-title { margin: 18px 0 -8px; font-size: 13px; font-weight: 700; color: var(--faint); letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Game cards: glass panel, preview on top, accent glow per title, thick button at the bottom. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); } }
.card {
  --accent: var(--press);
  position: relative; display: flex; flex-direction: column;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--base), var(--shadow);
  overflow: hidden; transition: border-color 160ms ease;
}
.card::before { content: ""; position: absolute; inset: -40% -20% auto; height: 70%; background: radial-gradient(50% 60% at 50% 40%, var(--accent) 0%, color-mix(in srgb, var(--accent) 40%, transparent) 32%, transparent 75%); opacity: 0.35; pointer-events: none; transition: opacity 200ms ease; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 70%, var(--glass-line-2)); }
.card:hover::before { opacity: 0.5; }
.card .preview { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0b0a1e; border-bottom: 1px solid var(--glass-line); }
.card .preview img { width: 100%; height: 100%; object-fit: cover; }
.card .preview:not(.has-hover) > img { transform: scale(1); transition: transform 380ms cubic-bezier(.2,.7,.2,1); }
.card .preview:not(.has-hover):focus-visible > img { transform: scale(1.15); }
.card .preview.has-hover img { transition: opacity 420ms ease; }
.card .preview.has-hover .preview-hover { position: absolute; inset: 0; opacity: 0; }
.card .preview.has-hover.hover-ready:focus-visible > img:first-child { opacity: 0; }
.card .preview.has-hover.hover-ready:focus-visible .preview-hover { opacity: 1; }
@media (hover: hover) {
  .card:hover .preview:not(.has-hover) > img { transform: scale(1.15); }
  .card:hover .preview.has-hover.hover-ready > img:first-child { opacity: 0; }
  .card:hover .preview.has-hover.hover-ready .preview-hover { opacity: 1; }
}

.card .preview.contain { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, #0b0a1e), #0b0a1e); display: grid; place-items: center; }
.card .preview.contain img { width: auto; height: 62%; object-fit: contain; }
.card[data-slug="rebirth"] .preview.contain img { position: absolute; inset: 0; width: 100%; height: 95%; object-fit: contain; object-position: center top; margin-top: 1%; }
.card .body { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 18px; flex: 1; }
.card .title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h3 { margin: 0; font-size: 19px; letter-spacing: -0.4px; font-weight: 800; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.card .actions { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card .actions .hint { font-size: 12px; color: var(--faint); font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.2px; border: 1px solid transparent; }
.tag.genre { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--ink); }
.tag.wip { background: var(--wip); color: #2a1c00; }
.tag.live { background: var(--ok); color: #05260f; }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.card.hexa { --accent: var(--hexa); }
.card.pick { --accent: var(--pick); }
.card.gas { --accent: var(--gas); }
.card.life { --accent: var(--life); }
.card.press { --accent: var(--press); }
.card.rebirth { --accent: var(--rebirth); }
.card.wide { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
.card.wide .preview { width: 42%; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--glass-line); }
@media (max-width: 720px) { .card.wide { flex-direction: column; } .card.wide .preview { width: 100%; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1px solid var(--glass-line); } }

/* Wide promo rows (reference: icon tile · title/sub · arrow). */
.row-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius-s); box-shadow: 5px 5px 0 var(--base); transition: border-color 140ms ease; }
.row-card:hover { border-color: color-mix(in srgb, var(--accent, var(--press)) 70%, var(--glass-line-2)); }
.row-card .tile { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, var(--press)) 24%, transparent); border: 1px solid color-mix(in srgb, var(--accent, var(--press)) 45%, transparent); font-size: 22px; flex: none; }
.row-card .text { flex: 1; min-width: 0; }
.row-card .text b { display: block; font-size: 15px; }
.row-card .text span { display: block; font-size: 13px; color: var(--muted); }
.row-card .arrow { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--glass-2); border: 1px solid var(--glass-line-2); flex: none; }

/* Ranked list card (reference: rankings table). */
.list { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--base); overflow: hidden; }
.list .head, .list .row { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 12px; padding: 12px 16px; }
.list .head { font-size: 12px; color: var(--faint); font-weight: 700; border-bottom: 1px solid var(--glass-line); }
.list .row { border-bottom: 1px solid var(--glass-line); transition: background 120ms ease; }
.list .row:nth-child(odd) { background: color-mix(in srgb, var(--glass-2) 40%, transparent); }
.list .row:last-child { border-bottom: 0; }
.list .row:hover { background: var(--glass-2); }
.list .rank { font-size: 20px; font-weight: 800; color: var(--muted); }
.list .row:nth-child(-n+3) .rank { color: var(--ink); }
.list .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.list .who .tile { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, var(--press)) 22%, transparent); border: 1px solid color-mix(in srgb, var(--accent, var(--press)) 45%, transparent); font-size: 19px; flex: none; overflow: hidden; }
.list .who .tile img { width: 100%; height: 100%; object-fit: cover; }
.list .who b { display: block; font-size: 15px; letter-spacing: -0.2px; }
.list .who span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .status { text-align: right; }
@media (max-width: 560px) { .list .head, .list .row { grid-template-columns: 28px 1fr auto; } .list .status { display: none; } }

/* Filter chips row (reference: 전체 / IT·개발 / 디자인 …) */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.segment { display: inline-flex; padding: 4px; gap: 4px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 14px; }
.segment button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.segment button.on { background: var(--ink); color: var(--page); box-shadow: 3px 3px 0 var(--base); }

/* Home v3 rows: every card list is one horizontal scroll row (`.row-scroller`, also the app pages'
   「다른 테스트 더 보기」 which keeps its `grid` class for common.js). 2.2 cards visible below 700px,
   2.8 to 1023px, 3.8 from 1024px — the last card is always cut so the row is obviously scrollable.
   The row bleeds into the shell gutters (negative inline margins + padding) so cards align with the
   heading at rest and slide under the edge fades; `scroll-padding` keeps snap positions on the gutter.
   Vertical padding + negative margins (`--bleed`) give the hover popup (×4/3 from the card's centre,
   i.e. 1/6 of a card past its top and bottom) room inside the scroll container's clip — for the
   bottom row of a two-row section as much as for a single row. */
.landing { display: block; }
.row-scroller {
  --cols: 2.2; --gap: 12px; --gutter: 20px; --bleed: 48px;
  --card: calc((100% - var(--gap) * (var(--cols) - 1)) / var(--cols));
  list-style: none; margin: calc(var(--bleed) * -1) calc(var(--gutter) * -1); padding: var(--bleed) var(--gutter);
  display: flex; gap: var(--gap); align-items: stretch;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  /* The padding box overlaps the section head (negative margins); only the cards take the pointer. */
  pointer-events: none;
}
.row-scroller::-webkit-scrollbar { display: none; }
.row-scroller > * { pointer-events: auto; flex: 0 0 auto; width: var(--card); min-width: 0; scroll-snap-align: start; }
.row-scroller > [hidden] { display: none; }
.row-scroller.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.row-scroller.is-dragging > * { cursor: grabbing; }
.row-scroller.is-nudging, .row-scroller.is-free { scroll-snap-type: none; }
/* Edge fades only on the side that still has cards (portal.js toggles the classes on scroll). */
.row-scroller.has-right { mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.row-scroller.has-left { mask-image: linear-gradient(90deg, transparent, #000 48px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px); }
.row-scroller.has-left.has-right { mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
@media (min-width: 700px) { .row-scroller { --cols: 2.8; --gap: 14px; } }
@media (min-width: 1024px) { .row-scroller { --cols: 3.8; } }
/* Two rows at once for big categories (build.py row_mode → `data-rows`; portal.js recomputes it
   from the published cards): `2` = 8+ titles always, `narrow` = 6–7 titles only while ≤3 columns
   fit (<1024px). A column-flow grid keeps the same card width, gaps, snap points (every column
   start), drag, ‹ › and edge fades as the flex row; the idle nudge still moves one column. */
.row-scroller[data-rows="2"] { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, minmax(0, 1fr)); grid-auto-columns: var(--card); align-items: stretch; }
.row-scroller[data-rows="2"] > * { width: auto; }
@media (max-width: 1023px) {
  .row-scroller[data-rows="narrow"] { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, minmax(0, 1fr)); grid-auto-columns: var(--card); align-items: stretch; }
  .row-scroller[data-rows="narrow"] > * { width: auto; }
}
/* TOP carousel while portal.js drives it (`is-flowing`): a continuous rAF scroll with a seamless
   loop (clones of the leading cards, `data-clone`, are appended after the last card), so native
   snapping must stay out of the way; hover stops the flow and glides to a card boundary (JS). */
.row-scroller.is-flowing { scroll-snap-type: none; }
/* Section head tools: 「전체 →」 + round ‹ › page buttons (right side). */
.section-head .head-tools { display: flex; align-items: center; gap: 12px; flex: none; }
.row-nav { position: relative; z-index: 8; display: inline-flex; gap: 6px; transition: transform 180ms cubic-bezier(.2,.8,.2,1); }
.row-nav.is-popup-raised { transform: translateY(calc(-1 * var(--popup-lift, 30px))); }
@media (prefers-reduced-motion: reduce) { .row-nav { transition: none; } }
.row-btn { --face: var(--glass-2); --line: var(--glass-line-2); --depth: 3px; width: 34px; height: 34px; padding: 0 0 2px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--face); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--depth) var(--depth) 0 var(--base); font-size: 22px; font-weight: 800; line-height: 1; cursor: pointer; user-select: none; transition: transform 120ms ease, box-shadow 120ms ease, opacity 160ms ease; }
.row-btn:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--base); }
.row-btn:active { transform: translate(var(--depth), var(--depth)); box-shadow: 0 0 0 var(--base); }
.row-btn:disabled { opacity: .32; cursor: default; transform: none; box-shadow: var(--depth) var(--depth) 0 var(--base); }
@media (hover: none), (max-width: 699px) { .row-nav { display: none; } }
.top { --accent: var(--press); }
.top .section-head p b { color: var(--ink); font-weight: 800; }
.top .section-head p .sep { color: var(--faint); }
/* Mini card: the <a> is only a layout box (the single hit target); `.mini-visual` carries the panel
   and is what grows on hover. In the category rows the popup ignores the pointer (`pointer-events:
   none`) so the neighbour's box under it hovers/clicks at once; the TOP carousel uses the same fixed hit target with a smaller
   visual scale. A class set by real pointer movement owns the popup state. portal.js sets `--pop` and the transform-origin (clamped to the row). */
.mini { --accent: var(--press); --pop: 1.3333; position: relative; display: block; height: 100%; color: var(--ink); overflow: visible; border-radius: 0; }
.mini-visual {
  position: relative; display: flex; flex-direction: column; gap: 7px; height: 100%;
  padding: 8px 8px 11px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--glass-line);
  box-shadow: 4px 4px 0 var(--base); transform: translate(0, 0); transform-origin: 50% 50%;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 160ms ease;
  pointer-events: none;
}
.mini-visual * { pointer-events: none; }
.mini:active .mini-visual { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--base); }
@media (hover: hover) {
  .mini.is-hovered .mini-visual { border-color: color-mix(in srgb, var(--accent) 70%, var(--glass-line-2)); }
  .row-scroller:not(.is-dragging):not(.carousel) .mini.is-hovered { z-index: 6; }
  .row-scroller:not(.is-dragging):not(.carousel) > li:has(.mini.is-hovered) { position: relative; z-index: 6; }
  .row-scroller:not(.is-dragging):not(.carousel) .mini.is-hovered .mini-visual { transform: scale(var(--pop)); background: var(--pop-bg); box-shadow: 0 22px 44px rgba(6, 3, 30, .45), 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); pointer-events: none; }
  .row-scroller.carousel:not(.is-dragging) > li:has(.mini.is-hovered) { position: relative; z-index: 6; }
  .row-scroller.carousel:not(.is-dragging) .mini.is-hovered .mini-visual { transform: scale(1.06); box-shadow: 0 14px 30px rgba(6, 3, 30, .4); }
  .row-scroller:not(.is-dragging) .mini:active .mini-visual { transform: scale(var(--pop)) translate(2px, 2px); }
  .row-scroller.carousel:not(.is-dragging) .mini:active .mini-visual { transform: scale(1.03); }
}
.mini .preview { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 11px; background: #0b0a1e; border: 1px solid var(--glass-line); }
.mini .preview img { width: 100%; height: 100%; object-fit: cover; }
.mini .preview .preview-hover { display: none; }
.mini b { display: block; font-size: 14.5px; line-height: 1.3; letter-spacing: -0.3px; font-weight: 800; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mini .line { display: flex; align-items: center; gap: 5px; margin-top: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .line .tag { padding: 1px 7px; font-size: 10px; }
.mini .badge-new { position: absolute; top: 14px; left: 14px; z-index: 1; }
.mini .preview img { -webkit-user-drag: none; user-select: none; }
/* Rank badge 1–10 on the TOP thumbs; portal.js renumbers after a visits reorder. */
.mini .rank { position: absolute; z-index: 1; left: 0; top: 0; min-width: 30px; padding: 4px 8px 5px; border-radius: 0 0 12px 0; background: var(--ink); color: var(--page); font-size: 14px; font-weight: 900; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.top li:nth-child(-n+3) .rank, .top .rank.top3 { background: var(--mark); color: var(--mark-ink); }
/* Live ranking tags (filled by portal.js from /portal-api/visits.php). */
.mini .move { position: absolute; z-index: 2; top: 14px; right: 14px; pointer-events: none; font-size: 9px; line-height: 1.25; font-weight: 800; padding: 2px 6px; border-radius: 999px; background: var(--page); border: 1px solid var(--glass-line-2); color: var(--muted); white-space: nowrap; box-shadow: 0 2px 5px #0002; }
.mini .move.up { color: #35e08a; border-color: color-mix(in srgb, #35e08a 50%, transparent); }
.mini .move.down { color: #ff7a7a; border-color: color-mix(in srgb, #ff7a7a 50%, transparent); }
.mini .move.new { background: var(--mark); color: var(--mark-ink); border-color: transparent; }
.mini.hexa { --accent: var(--hexa); } .mini.pick { --accent: var(--pick); } .mini.life { --accent: var(--life); } .mini.press { --accent: var(--press); } .mini.rebirth { --accent: var(--rebirth); }
@media (min-width: 700px) { .mini b { font-size: 15px; } }
/* Skeleton (`is-loading`, shipped on every mini card): one translucent white rounded box of the
   card's final size — no thumbnail, name, meta, badges or hover — until catalog.js has settled the
   name/picture/order and the picture has loaded. The card keeps its layout box, so nothing shifts
   when it appears; a slow shimmer (none with reduced motion) says "loading", not "empty". */
.mini.is-loading .mini-visual { background: var(--skeleton, rgba(255, 255, 255, .09)); border-color: transparent; box-shadow: none; overflow: hidden; }
.mini.is-loading .mini-visual > * { visibility: hidden; }
.mini.is-loading .mini-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, var(--skeleton-shine, rgba(255, 255, 255, .07)) 50%, transparent 70%) no-repeat; background-size: 260% 100%; opacity: .45; }
:root[data-theme="light"] { --skeleton: rgba(255, 255, 255, .5); --skeleton-shine: rgba(255, 255, 255, .55); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --skeleton: rgba(255, 255, 255, .5); --skeleton-shine: rgba(255, 255, 255, .55); } }
@keyframes skeleton-shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (hover: hover) { .row-scroller .mini.is-loading:hover .mini-visual { transform: none; background: var(--skeleton, rgba(255, 255, 255, .09)); box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .mini.is-loading .mini-visual::after { animation: none; } }
/* One-set reveal (catalog.js revealRow): a row's section ships `data-row-pending`; its count badge
   is part of the skeleton set, and the first-screen cards appear together with one short fade. */
.row-section[data-row-pending] .section-head .count { visibility: hidden; }
.mini.is-revealing .mini-visual > * { animation: mini-reveal 140ms ease-out both; }
@keyframes mini-reveal { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mini.is-revealing .mini-visual > * { animation: none; } }

/* NEW badge on cards and rows (build-time fallback; portal.js expires it by data-added). */
.badge-new { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 10px; line-height: 1.3; font-weight: 900; letter-spacing: .4px; background: var(--mark); color: var(--mark-ink); box-shadow: 2px 2px 0 var(--base); }

/* App pages: 「다른 테스트 더 보기」 under the result. Hidden until the app shows its result
   (common.js toggles `hidden`); `.is-empty` when the catalog left nothing to recommend. */
.recs { max-width: 1040px; padding: 22px 20px 34px; }
.recs[hidden], .recs.is-empty { display: none; }
.recs .section-head { margin-bottom: 12px; }
.recs .section-head h2 { font-size: 20px; }

/* Trust strip: three short facts and the /about/ link. */
.trust { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 14px 16px; margin-top: 26px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--base); }
.trust ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px 20px; flex: 1 1 520px; }
.trust li { display: flex; flex-direction: column; gap: 2px; }
.trust li b { font-size: 13.5px; }
.trust li span { font-size: 12px; color: var(--muted); }
.trust .more { font-size: 14px; font-weight: 700; color: var(--press); white-space: nowrap; }
@media (min-width: 640px) { .trust ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Store panel */
.panel { padding: 22px; background: var(--glass); border: 1px dashed var(--glass-line-2); border-radius: var(--radius); text-align: center; color: var(--muted); }
.panel b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* Footer */
.footer { margin: 44px 0 0; padding: 26px 0 110px; border-top: 1px solid var(--glass-line); color: var(--muted); font-size: 13px; }
.footer .shell { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer .links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer .links a:hover { color: var(--ink); }
@media (min-width: 900px) { .footer { padding-bottom: 40px; } }

/* Mobile bottom tab bar (reference). Hidden on wide screens where the top tabs serve. */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--page) 93%, transparent); border-top: 1px solid var(--glass-line); }
.bottombar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; border-radius: 12px; font-size: 11px; font-weight: 700; color: var(--muted); }
.bottombar a svg { width: 20px; height: 20px; }
.bottombar a.on { background: var(--press); color: var(--press-ink); box-shadow: 3px 3px 0 var(--press-base); }
/* A real keyboard, not mere input focus, temporarily removes site navigation. */
body.is-soft-keyboard-open .bottombar { display: none !important; }
@media (min-width: 900px) { .bottombar { display: none; } }
/* Phones: no backdrop blur on the sticky bars (compositing cost on every scroll); near-opaque backgrounds keep the glass look. Desktop keeps blur on .topbar only. */
@media (max-width: 899px) { .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--page) 92%, transparent); } }
@media (max-width: 899px) { .tabbar { display: none; } .section { scroll-margin-top: 80px; } }

/* Theme pill states */
.theme-pill .when-dark, .theme-pill .when-light { display: none; }
:root[data-theme="dark"] .theme-pill .when-dark { display: inline; }
:root[data-theme="light"] .theme-pill .when-light { display: inline; }
:root:not([data-theme]) .theme-pill .when-auto { display: inline; }
:root[data-theme] .theme-pill .when-auto { display: none; }

@media (prefers-reduced-motion: reduce) {
  .pill, .btn, .chip, .tab, .card, .row-card, .card .preview img { transition: none; }
  html { scroll-behavior: auto; }
}

.tag.time { color: var(--ink); border-color: color-mix(in srgb, var(--press) 55%, transparent); background: color-mix(in srgb, var(--press) 16%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .mini-visual, .row-btn { transition: none; }
  /* No hover enlarge: !important outranks the (hover: hover) row selectors above. */
  .row-scroller .mini.is-hovered .mini-visual, .row-scroller .mini:active .mini-visual { transform: none !important; }
  .row-scroller { scroll-behavior: auto; }
  .card .preview.has-hover img { transition: none; }
  .card .preview:not(.has-hover) > img { transition: none; }
  button.tactile-mark:active, button.identity-mark:active, .hero h1 button.tactile-mark:active { transform: rotate(-1.2deg); }
}

/* Shared catalog tags keep their registered color across content accents. */
.content-tags { display:contents; }
.tag.genre.content-tag { background:color-mix(in srgb,var(--tag-color,#ff3294) 18%,transparent); border-color:color-mix(in srgb,var(--tag-color,#ff3294) 60%,transparent); }
.tag.genre.content-tag::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--tag-color,#ff3294); flex:none; }
/* Mini cards: compact chips after 「⏱ N분」 on the one meta line (build.py mini_tags, filled by
   catalog.js). The line never wraps: the chip box is one chip tall and wraps internally, so a chip
   that does not fit drops to the clipped second row (the visible chips are always a prefix; 「+N」
   shows only when everything before it fits). The first chip ellipsizes; a sliver of space hides
   the chips altogether. ⏱ and the category never shrink. */
.mini .line { min-height: 16px; }
.mini .line > span:not(.mini-tags) { flex: none; }
.mini .mini-tags { flex: 1 1 0; min-width: 0; height: 16px; display: flex; flex-wrap: wrap; gap: 3px; overflow: hidden; container-type: inline-size; }
.mini .mini-tags:empty { display: none; }
.mini .mini-tags .tag { display: block; flex: none; max-width: 100%; min-width: 0; padding: 0 6px; font-size: 11px; line-height: 14px; font-weight: 800; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .mini-tags .tag.content-tag::before { display: inline-block; width: 5px; height: 5px; margin: 0 4px 1px 0; vertical-align: middle; }
.mini .mini-tags .tag.mini-more { color: var(--muted); border-color: var(--glass-line-2); background: transparent; }
@container (max-width: 34px) { .mini-tags > .tag { visibility: hidden; } }

/* Collapsed per-title explanation on the category pages. */
.page-guide { border-radius: 18px; }
.page-guide .guide-lead { margin: 0 0 12px; color: var(--muted); }
.guide-item { border-top: 1px solid var(--glass-line); }
.guide-item:last-child { border-bottom: 1px solid var(--glass-line); }
.guide-item > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 15px 2px; font-weight: 800; font-size: 16px; color: var(--ink); word-break: keep-all; }
.guide-item > summary::-webkit-details-marker { display: none; }
.guide-item > summary::after { content: "＋"; margin-left: auto; font-weight: 400; font-size: 18px; color: var(--muted); }
.guide-item[open] > summary::after { content: "−"; }
.guide-item > summary:hover { color: var(--press); }
.guide-status { flex: 0 0 auto; font-size: 11px; font-weight: 800; letter-spacing: .4px; padding: 3px 8px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-line-2); color: var(--muted); }
.guide-body { padding: 0 2px 16px; color: var(--muted); font-size: 14.5px; line-height: 1.85; }
.guide-body p { margin: 0 0 12px; word-break: keep-all; }
.guide-body p:last-child { margin-bottom: 0; }
.guide-link { color: var(--press); font-weight: 800; }

/* Info pages (about / privacy / terms / contact): long-form prose in one glass sheet. */
.doc { max-width: 820px; padding: 26px 28px; background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--muted); font-size: 15.5px; line-height: 1.85; }
.doc h2 { margin: 30px 0 10px; color: var(--ink); font-size: 20px; line-height: 1.4; word-break: keep-all; }
.doc h2:first-child, .doc .doc-meta + h2, .doc > p:first-child + h2 { margin-top: 6px; }
.doc h3 { margin: 20px 0 6px; color: var(--ink); font-size: 16px; }
.doc p, .doc li { word-break: keep-all; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 14px; padding-left: 20px; }
.doc li { margin: 0 0 6px; }
.doc b { color: var(--ink); }
.doc a { color: var(--press); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.doc a.btn { text-decoration: none; }
.doc .doc-meta { color: var(--muted); font-size: 13px; }
.doc-callout { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 20px; padding: 16px 18px; border-radius: 16px; background: var(--glass-2); border: 1px solid var(--glass-line-2); }
.doc-callout > span { color: var(--muted); font-size: 13px; font-weight: 800; }
.doc .doc-mail { color: var(--ink); font-size: 18px; font-weight: 800; text-decoration: none; word-break: break-all; }
.doc-callout .btn { margin-left: auto; }
@media (max-width: 560px) { .doc { padding: 20px 18px; font-size: 15px; } .doc-callout .btn { margin-left: 0; } }
.footer .links b { font-weight: 800; color: var(--ink); }

/* 이용 안내 pages (/guide/…): the .doc sheet plus steps, FAQ and related-guide lists. */
.doc ol { margin: 0 0 14px; padding-left: 22px; }
.doc .guide-cta { margin: 0 0 18px; }
.doc .guide-cta .btn { display: inline-flex; }
.doc .guide-faq { margin: 0 0 8px; }
.doc .guide-faq h3 { margin: 18px 0 4px; font-size: 16px; line-height: 1.5; word-break: keep-all; }
.doc .guide-faq p { margin: 0 0 6px; }
.doc .guide-related { list-style: none; padding: 0; display: grid; gap: 8px; }
.doc .guide-related li { margin: 0; }
.doc .guide-related a { display: block; padding: 11px 14px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--glass-line-2); text-decoration: none; }
.doc .guide-related a span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.6; }
.doc .guide-crumbs { margin: 0 0 12px; font-size: 13px; }
.guide-index { display: grid; gap: 22px; }
.guide-index h2 { margin: 6px 0 8px; font-size: 20px; }
.guide-index ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.guide-index li a { display: block; height: 100%; padding: 12px 14px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--glass-line-2); text-decoration: none; color: var(--ink); font-weight: 800; line-height: 1.5; word-break: keep-all; }
.guide-index li a span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.65; }
.page-guide .guide-more { margin: 12px 0 0; font-size: 14px; }
.page-guide .guide-more a { color: var(--press); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* A missing route has a short recovery path at every viewport size. */
.not-found { min-height: calc(100svh - 180px); display: grid; place-items: center; padding-block: 48px; }
.not-found-panel { width: min(100%, 620px); text-align: center; padding: clamp(24px, 5vw, 52px) 20px; border: 1px solid var(--glass-line-2); border-radius: 24px; background: var(--glass); }
.not-found-code { display: block; color: var(--press); font-size: clamp(72px, 18vw, 130px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.not-found h1 { font-size: clamp(22px, 4vw, 32px); word-break: keep-all; }
.not-found p { color: var(--muted); line-height: 1.65; word-break: keep-all; }
.not-found-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; margin-top: 28px; }
.not-found-actions .utility-link { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
