/* Life of — 사이트 공통 스타일. 게임 화면의 나무 테두리 픽셀 카드와 밤의 놀이공원 색을 따른다. */
@font-face {
  font-family: "Open Sans";
  src: url("/fonts/OpenSans.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans KR";
  src: url("/fonts/NotoSansKR.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #14151d;
  --bg-2: #1b1c26;
  --card: #23242f;
  --line: #3b3644;
  --frame: #9c7455;
  --frame-dark: #5a4334;
  --ink: #0b0c11;
  --paper: #f4e7cf;
  --text: #e9dfcf;
  --muted: #a99d8e;
  --amber: #e9a94b;
  --amber-hi: #ffd68a;
  --rust: #c4673f;
  --wrap: 1120px;
  --font-game: "Open Sans", "Noto Sans KR", system-ui, sans-serif;
  --pixel-grid: conic-gradient(at 2px 2px, transparent 75%, #f4e7cf0b 0) 0 0 / 16px 16px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--pixel-grid) var(--bg); color: var(--text);
  font-family: var(--font-game); font-size: 1rem; font-weight: 600; line-height: 1.7;
  word-break: keep-all; overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
.pixel, .sprite, canvas { image-rendering: pixelated; }
.sprite { display: inline-block; background-repeat: no-repeat; flex: none; }
a { color: var(--amber-hi); text-underline-offset: 3px; }
a:hover { color: var(--paper); }
:focus-visible { outline: 3px solid var(--amber-hi); outline-offset: 3px; }
button { font: inherit; }

h1, h2, h3 { line-height: 1.25; color: var(--paper); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.wrap.narrow { --wrap: 760px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg-2);
  border-bottom: 3px solid var(--ink); box-shadow: 0 2px 0 var(--frame-dark);
}
.topbar-inner { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.brand { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; font-weight: 800; white-space: nowrap; text-shadow: 0 2px 0 var(--ink); }
.brand-life { color: var(--amber-hi); font-size: 1.15rem; }
.brand-game { color: var(--paper); font-size: 1.15rem; }
.gamenav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.gamenav::-webkit-scrollbar { display: none; }
.gamenav a { color: var(--muted); text-decoration: none; padding: 6px 11px; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.gamenav a:hover { color: var(--paper); background: var(--card); }
.gamenav a:focus-visible { outline-offset: -3px; }
.gamenav a[aria-current="page"] { color: var(--bg); background: var(--amber); box-shadow: inset 0 -3px 0 #b9782a; }
.gamenav a.nav-play { color: var(--amber-hi); box-shadow: inset 0 0 0 2px var(--frame-dark); margin-left: 6px; }
.gamenav a.nav-play[aria-current="page"] { color: var(--bg); box-shadow: inset 0 -3px 0 #b9782a; }
.lang { margin-left: auto; color: var(--text); text-decoration: none; font-size: .9rem; border: 2px solid var(--line); padding: 4px 10px; white-space: nowrap; }
.gamenav + .lang { margin-left: 8px; }
.lang:hover { border-color: var(--amber); color: var(--paper); }
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 4px 12px; padding-block: 8px; }
  .gamenav { order: 3; width: 100%; flex-wrap: wrap; margin-left: 0; overflow: visible; }
  .gamenav a { padding: 5px 6px; font-size: .875rem; }
  .gamenav a.nav-play { margin-left: 0; }
  .gamenav + .lang { margin-left: auto; }
}

/* ---------- 공통 블록 ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section.alt { background: var(--pixel-grid) var(--bg-2); border-block: 2px solid var(--line); }
.page-head { padding-bottom: 40px; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); margin-bottom: 10px; }
html:lang(ko) .eyebrow { letter-spacing: .04em; }
.lead { font-size: 1.15rem; max-width: 62ch; }
.muted { color: var(--muted); }
.section-head { max-width: 68ch; margin-bottom: 36px; }
.card { background: var(--card); border: 3px solid var(--frame-dark); box-shadow: 0 0 0 2px var(--ink), 4px 4px 0 2px var(--ink), inset 0 2px 0 #f4e7cf12; }
.frame { border: 3px solid var(--frame); box-shadow: 0 0 0 3px var(--ink); background: var(--ink); overflow: hidden; display: block; }
.frame img { width: 100%; }
.frame.flat { border-width: 0 0 3px; box-shadow: none; border-color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; border: 0;
  font-weight: 700; text-decoration: none; padding: 12px 20px; background: var(--amber); color: #1a1209;
  box-shadow: 0 0 0 3px var(--ink), inset 0 2px 0 #ffffff40, inset 0 -4px 0 #b9782a;
}
.btn:hover { color: #1a1209; background: var(--amber-hi); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 3px var(--ink), inset 0 3px 0 #b9782a; }
.btn.ghost { background: transparent; color: var(--paper); box-shadow: 0 0 0 3px var(--line); }
.btn.ghost:hover { box-shadow: 0 0 0 3px var(--amber); }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.btn-row.center { justify-content: center; }
.badge { font-size: .8rem; font-weight: 700; padding: 4px 10px; background: var(--ink); color: var(--amber-hi); border: 2px solid var(--line); }

/* ---------- 바닥글 ---------- */
.footer { border-top: 2px solid var(--line); background: #101118; padding-top: 48px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-brand p { margin: 8px 0 0; max-width: 28ch; }
.footer-col { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.footer-col h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 4px; font-weight: 700; }
.footer-col a { color: var(--text); text-decoration: none; }
.footer-col a:hover { color: var(--amber-hi); text-decoration: underline; }
.footer-col a[aria-current] { color: var(--amber-hi); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 40px; padding-block: 20px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- 허브 ---------- */
.hub-section { padding-top: clamp(24px, 5vw, 48px); }
.hub-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; }
.hub-card { display: flex; flex-direction: column; text-decoration: none; color: var(--text); transition: transform .12s ease; }
a.hub-card:hover { transform: translateY(-3px); border-color: var(--frame); color: var(--text); }
.hub-cover { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 3px solid var(--ink); background: var(--ink); }
.hub-cover img { width: 100%; height: 100%; object-fit: cover; }
.hub-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.hub-body p { margin: 0; }
.hub-logo { width: min(320px, 80%); }
.hub-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; gap: 12px; flex-wrap: wrap; }
.hub-open { font-weight: 700; color: var(--amber-hi); }
.hub-empty { opacity: .8; }
.hub-door { aspect-ratio: 16 / 9; display: grid; place-items: center; font: 800 4rem var(--font-game); color: var(--line); background: repeating-linear-gradient(90deg, #1b1c26 0 22px, #191a23 22px 24px); border-bottom: 3px solid var(--ink); }
@media (max-width: 820px) { .hub-grid { grid-template-columns: 1fr; } }

/* ---------- Dotheg 소개 ---------- */
.hero { position: relative; min-height: min(78vh, 720px); display: grid; align-items: end; overflow: hidden; background: var(--ink); }
.hero-art { position: absolute; inset: 0; }
.hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 40%; }
.hero-art .blink { opacity: 0; animation: blink 5.2s steps(1) infinite; }
@keyframes blink { 0%, 92% { opacity: 0; } 93%, 96% { opacity: 1; } 97% { opacity: 0; } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0b0c1100 30%, #0b0c11cc 62%, #0b0c11f2), linear-gradient(#0b0c1100 60%, #14151d); }
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; padding-block: 48px 64px; padding-left: min(50%, 560px); }
.hero-logo { width: min(440px, 100%); margin-bottom: 8px; filter: drop-shadow(0 4px 0 #0b0c11); }
.hero .lead { color: var(--paper); text-shadow: 0 2px 0 #0b0c11; }
.status { color: var(--muted); font-size: .9rem; font-weight: 600; margin: 16px 0 0; }
@media (max-width: 820px) {
  .hero { min-height: 0; display: block; }
  .hero-art { position: relative; aspect-ratio: 16 / 9; }
  .hero::after { background: linear-gradient(#0b0c1100 30%, #14151d calc(min(56vw, 600px))); }
  .hero-copy { padding: 0 0 40px; margin-top: -40px; }
}
.intro-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.intro-text { font-size: 1.15rem; margin: 0; }
.facts { margin: 0; padding: 8px 20px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 2px dashed var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 600; color: var(--paper); }
@media (max-width: 820px) { .intro-grid { grid-template-columns: 1fr; } }

.loop { list-style: none; padding: 0; margin: 0; display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
.loop-step { display: flex; flex-direction: column; }
.loop-body { padding: 20px; position: relative; }
.loop-body p { margin: 0; }
.loop-n { position: absolute; top: -22px; right: 16px; width: 40px; height: 40px; display: grid; place-items: center; background: var(--amber); color: #1a1209; font: 800 1.1rem var(--font-game); box-shadow: 0 0 0 3px var(--ink); }
@media (max-width: 900px) { .loop { grid-template-columns: 1fr; } }


.play-cta { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; padding: 28px; }
.play-faces { display: flex; }
.play-faces .sprite { margin-left: -40px; }
.play-faces .sprite:first-child { margin-left: 0; }
.play-cta p { max-width: 56ch; }
@media (max-width: 820px) {
  .play-cta { grid-template-columns: 1fr; }
  .play-cta > * { min-width: 0; }
  .play-faces .sprite:nth-child(n + 3) { display: none; }
}

.trailer { max-width: 960px; margin-top: clamp(32px, 6vw, 56px); }
.gameplay-trailer { width: 100%; height: auto; aspect-ratio: 16 / 9; }

.shots { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.shots .frame { transition: transform .12s ease; }
.shots .frame:hover { transform: scale(1.02); }
@media (max-width: 720px) { .shots { grid-template-columns: repeat(2, 1fr); } }

html:has(.screenshot-viewer[open]) { overflow: hidden; }
.screenshot-viewer {
  width: min(966px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 24px); padding: 0;
  color: var(--text); background: var(--ink); border: 3px solid var(--frame); box-shadow: 0 0 0 3px var(--ink);
}
.screenshot-viewer[open] { display: flex; flex-direction: column; }
.screenshot-viewer::backdrop { background: #0b0c11e6; }
.screenshot-viewer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; background: var(--bg-2); border-bottom: 2px solid var(--frame-dark);
}
.screenshot-viewer-bar h3 { margin: 0; font-size: 1rem; }
.screenshot-viewer-bar .btn { min-height: 44px; padding: 6px 12px; white-space: nowrap; }
.screenshot-viewer img { min-height: 0; width: 100%; object-fit: contain; }

.explore { display: grid; gap: 24px; grid-template-columns: repeat(4, 1fr); margin-top: 24px; }
.explore-card { padding: 20px; text-decoration: none; color: var(--text); transition: transform .12s ease; }
.explore-card:hover { transform: translateY(-3px); border-color: var(--frame); color: var(--text); }
.explore-card p { margin: 0; }
.explore-art { position: relative; height: 140px; display: flex; align-items: center; justify-content: center; margin: -20px -20px 16px; background: var(--ink); overflow: hidden; border-bottom: 3px solid var(--ink); }
.explore-art img { width: 100%; height: 100%; object-fit: cover; }
.faces { gap: 4px; background: #1d1a24; }
.endings-peek .shot { position: absolute; inset: 0; background-repeat: no-repeat; filter: blur(6px) saturate(.6); transform: scale(1.1); }
.eq { gap: 6px; align-items: flex-end; padding-bottom: 28px; background: #1d1a24; }
.eq i { width: 10px; background: var(--amber); box-shadow: 0 0 0 2px var(--ink); height: 30px; animation: eq 1.1s ease-in-out infinite alternate; }
.eq i:nth-child(2n) { animation-delay: -.4s; background: var(--rust); }
.eq i:nth-child(3n) { animation-delay: -.8s; }
@keyframes eq { from { height: 12px; } to { height: 70px; } }
@media (max-width: 1000px) { .explore { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .explore { grid-template-columns: 1fr; } }

.closing { position: relative; background: var(--ink); }
.closing img { width: 100%; max-height: 520px; object-fit: cover; opacity: .55; }
.closing-copy { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 20px; }
.closing-copy p { font-size: clamp(1.15rem, 2.6vw, 1.6rem); font-weight: 700; color: var(--paper); max-width: 30ch; margin: 0; text-shadow: 0 2px 0 #0b0c11; }

/* ---------- 등장인물 ---------- */
.people { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); margin-top: 24px; }
.person { display: flex; flex-direction: column; }
.portrait { display: grid; place-items: end center; padding-top: 20px; background: var(--pixel-grid) #29222a; border-bottom: 3px solid var(--ink); min-height: 170px; }
.person-body { padding: 20px; }
.person-body p:last-child { margin: 0; }
.quote { color: var(--amber-hi); font-weight: 600; }
@media (max-width: 900px) { .people { grid-template-columns: 1fr; } }
.guests { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.guest { display: flex; flex-direction: column; }
.guest-face { display: grid; place-items: end center; height: 150px; overflow: hidden; background: #e7c9a0; border-bottom: 3px solid var(--ink); }
.guest-face .sprite { transform: scale(.9); transform-origin: center bottom; }
.guest-body { padding: 14px 16px 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.guest-body h3 { font-size: 1rem; width: 100%; margin: 0 0 4px; }
.habit { font-size: .75rem; font-weight: 700; padding: 2px 8px; border: 2px solid currentColor; }
.habit-regular { color: #8fb6c2; } .habit-focused { color: #e98d6b; } .habit-athlete { color: #e9a94b; }
.habit-child { color: #9fcf8a; } .habit-drunk { color: #c49be0; }
.redirect { color: var(--paper); background: var(--rust); border-color: var(--rust); }
.hidden-note { margin-top: 16px; }
.habits-title { margin-top: 48px; }
.habits { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 16px 0 0; }
.habits div { padding: 16px; }
.habits dd { margin: 8px 0 0; }

/* ---------- 스토리 ---------- */
.premise { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.tone { border-left: 3px solid var(--amber); padding-left: 14px; }
@media (max-width: 860px) { .premise { grid-template-columns: 1fr; } }
.chapters { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-direction: column; gap: 40px; }
.chapter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; align-items: center; }
.chapter:nth-child(even) .frame { order: 2; }
.chapter .frame img { aspect-ratio: 16 / 9; object-fit: cover; }
.chapter-n { font: 700 .85rem var(--font-game); color: var(--amber); text-transform: uppercase; letter-spacing: .1em; }
html:lang(ko) .chapter-n { letter-spacing: .02em; }
.chapter-body h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: 6px; }
.need { font-weight: 600; color: var(--paper); }
.need span { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--bg); background: var(--amber-hi); padding: 1px 8px; margin-right: 8px; vertical-align: 2px; }
@media (max-width: 760px) { .chapter { grid-template-columns: 1fr; gap: 16px; } .chapter:nth-child(even) .frame { order: 0; } }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin: 0; }
.stats div { padding: 18px; }
.stats dt { font-weight: 800; color: var(--amber-hi); font-size: 1.1rem; }
.stats dd { margin: 6px 0 0; font-size: .95rem; }
.after-stats { margin-top: 32px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }

/* ---------- 엔딩 ---------- */
.rules { display: flex; gap: 12px; align-items: flex-start; max-width: 70ch; }
.rules img { width: 32px; margin-top: 2px; flex: none; }
.toggle { display: flex; align-items: center; gap: 16px; padding: 16px 20px; cursor: pointer; margin-bottom: 28px; max-width: 640px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle small { display: block; font-size: .85rem; }
.switch { width: 52px; height: 28px; flex: none; background: var(--ink); border: 2px solid var(--line); position: relative; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: var(--muted); transition: transform .12s ease; }
.toggle:has(input:checked) .switch { border-color: var(--amber); }
.toggle:has(input:checked) .switch::after { transform: translateX(24px); background: var(--amber-hi); }
.toggle:has(input:focus-visible) { outline: 3px solid var(--amber-hi); outline-offset: 3px; }
.endings { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.ending { display: flex; flex-direction: column; overflow: hidden; }
.thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink); border-bottom: 3px solid var(--ink); }
.shot { position: absolute; inset: 0; background-repeat: no-repeat; image-rendering: pixelated; }
.no { position: absolute; top: 8px; left: 8px; min-width: 32px; height: 32px; padding: 0 6px; display: grid; place-items: center; background: var(--amber); color: #1a1209; font: 800 1rem var(--font-game); box-shadow: 0 0 0 3px var(--ink); }
.ending-body { padding: 16px 18px 18px; }
.mood { font-size: .78rem; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: .08em; }
html:lang(ko) .mood { letter-spacing: .02em; }
.ending-title { font-size: 1.15rem; margin: 4px 0 8px; }
.line { margin: 0; color: var(--muted); font-size: .95rem; }
.thumb .shot, .line { transition: filter .2s ease; }
.endings-wrap:not(:has(#spoilers:checked)) .thumb .shot { filter: blur(10px) brightness(.6) saturate(.4); }
.endings-wrap:not(:has(#spoilers:checked)) .line { filter: blur(6px); user-select: none; }
.is-hidden .mask { display: none; }
.endings-wrap:not(:has(#spoilers:checked)) .is-hidden .real { display: none; }
.endings-wrap:not(:has(#spoilers:checked)) .is-hidden .mask { display: inline; }
.is-hidden { border-color: var(--rust); }
.is-hidden .no { background: var(--rust); color: var(--paper); }

/* ---------- 사운드 ---------- */
.tracks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.track { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; padding: 16px; }
.track-btn { width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer; border: 0; background: var(--amber); color: #1a1209; box-shadow: 0 0 0 3px var(--ink), inset 0 -4px 0 #b9782a; }
.track-btn svg { width: 18px; height: 18px; fill: currentColor; }
.track-btn .i-pause, .track.is-playing .track-btn .i-play { display: none; }
.track.is-playing .track-btn .i-pause { display: inline; }
.track.is-playing { border-color: var(--frame); }
.track-info h3 { font-size: 1.05rem; margin: 0 0 4px; }
.track-info p { margin: 0; font-size: .92rem; }
.track-n { font: 700 .75rem var(--font-game); color: var(--amber); }
.track-len { font-variant-numeric: tabular-nums; font-size: .9rem; }
.track-bar { height: 4px; background: var(--ink); margin-top: 12px; }
.track-bar span { display: block; height: 100%; width: 0; background: var(--amber); }
@media (max-width: 820px) { .tracks { grid-template-columns: 1fr; } }
.fx-group { font-size: 1rem; color: var(--muted); margin: 28px 0 12px; }
.fx-group:first-of-type { margin-top: 0; }
.fx { display: flex; flex-wrap: wrap; gap: 12px; }
.fx-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; color: var(--text); background: var(--card); border: 2px solid var(--frame-dark); box-shadow: 0 0 0 2px var(--ink); font-weight: 600; font-size: .95rem; }
.fx-btn:hover { border-color: var(--frame); color: var(--paper); }
.fx-btn.is-playing { border-color: var(--amber); color: var(--amber-hi); }
.fx-wave { display: inline-flex; gap: 2px; align-items: center; height: 14px; }
.fx-wave i { width: 3px; height: 6px; background: currentColor; }
.fx-wave i:nth-child(2) { height: 12px; }
.fx-btn.is-playing .fx-wave i { animation: eq .25s ease-in-out infinite alternate; }
.fx-btn.is-playing .fx-wave i:nth-child(2) { animation-delay: -.1s; }

/* ---------- 약관 ---------- */
.legal h2 { font-size: 1.2rem; margin-top: 2em; }
.legal ul { padding-left: 1.2em; margin: 0 0 1em; }
.legal li { margin-bottom: .3em; }

/* ---------- 게임 ---------- */
.play-page { padding-top: 40px; }
.play-head { display: flex; justify-content: space-between; align-items: end; gap: 12px 32px; flex-wrap: wrap; margin-bottom: 20px; }
.play-head h1 { margin: 0; }
.play-head > p { margin: 0; max-width: 46ch; }
.game { --hud: 52px; }
.hud { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px 24px; align-items: center; padding: 10px 16px; background: var(--pixel-grid) var(--card); border: 3px solid var(--frame); border-bottom: 0; box-shadow: 0 0 0 3px var(--ink); }
.hud-item, .hud-time { display: flex; align-items: baseline; gap: 8px; }
.hud-k { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.hud-v { font: 800 1.35rem var(--font-game); color: var(--paper); font-variant-numeric: tabular-nums; min-width: 2ch; }
.hud-combo { font: 800 .95rem var(--font-game); color: var(--rust); }
.timebar { position: relative; flex: 1; height: 8px; background: var(--ink); align-self: center; min-width: 60px; }
.timebar i { display: block; height: 100%; background: var(--amber); transform-origin: left; }
.timebar::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 8px, var(--ink) 8px 10px); }
.hud-mute { cursor: pointer; padding: 6px 10px; font-size: .85rem; font-weight: 700; color: var(--text); background: transparent; border: 2px solid var(--line); }
.hud-mute[aria-pressed="true"] { color: var(--muted); }
.stage { position: relative; display: flex; justify-content: center; background: var(--ink); border: 3px solid var(--frame); box-shadow: 0 0 0 3px var(--ink), 0 5px 0 3px var(--ink); }
.stage canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; touch-action: manipulation; outline: none; cursor: none; -webkit-tap-highlight-color: transparent; }
.game[data-phase="title"] canvas, .game[data-phase="over"] canvas, .game[data-phase="paused"] canvas { cursor: default; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: #0b0c1166; }
.overlay[hidden] { display: none; }
.overlay-card { width: min(100%, 460px); text-align: center; padding: 24px; background: var(--pixel-grid) var(--card); border: 3px solid var(--frame); box-shadow: 0 0 0 3px var(--ink), 4px 4px 0 3px var(--ink); max-height: 100%; overflow: auto; }
.overlay-card h2 { font-size: 1.5rem; }
.overlay.over { align-items: center; }
.result { width: min(100%, 780px); display: grid; grid-template-columns: 1fr 1.35fr; gap: 20px; align-items: center; text-align: left; }
.result-main { text-align: center; }
.result-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.result-score { font: 800 3rem/1 var(--font-game); color: var(--amber-hi); margin: 0; }
.result-best { font-weight: 700; margin: 4px 0 6px; }
.result-stats { font-size: .9rem; }
.payslip { text-align: left; background: #f4e7cf; color: #2a2230; padding: 14px 16px; margin: 0; box-shadow: 0 0 0 3px var(--ink); background-image: repeating-linear-gradient(#0000 0 27px, #d9c8a8 27px 28px); }
.payslip h3 { color: #2a2230; font-size: 1rem; margin: 0 0 6px; }
.payslip p { margin: 0 0 8px; font-size: .92rem; line-height: 1.6; }
.payslip .muted { color: #6a5a55; }
.slips-k { font-size: .75rem !important; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6a5a55; }
.slips { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.slips li { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 0 6px; padding: 4px 0; font-size: .75rem; font-weight: 700; background: #e7d6b6; }
.slips .slip-face { grid-column: 1 / -1; }
.slip-b, .slip-c { display: inline-flex; align-items: center; gap: 3px; }
.slip-b::before { content: ""; width: 12px; height: 12px; background: url(/games/dotheg/art/home/bandage.png) center / contain no-repeat; image-rendering: pixelated; }
.slip-c::before { content: ""; width: 12px; height: 13px; background: url(/games/dotheg/art/work/work_sprites.png) -318px -40px no-repeat; image-rendering: pixelated; }
.slips li.is-dotheg { background: #e9a94b; }
.slip-face { width: 40px; height: 36px; background-image: url(/games/dotheg/art/work/crew_tools.png); background-repeat: no-repeat; image-rendering: pixelated; margin: 0 auto; }
.payslip-close { font-weight: 700; margin: 0 !important; }
.play-note { margin-top: 16px; font-size: .9rem; }
@media (max-width: 900px) {
  .overlay { position: static; background: none; padding: 0; }
  .stage { flex-direction: column; }
  .overlay-card { width: 100%; border-width: 3px 0 0; box-shadow: none; }
  .result { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hud { grid-template-columns: auto auto 1fr; gap: 6px 14px; }
  .hud-time { grid-column: 1 / -1; order: 3; }
  .hud-v { font-size: 1.1rem; }
  .slips { grid-template-columns: repeat(3, 1fr); }
}

.notfound { text-align: center; }
.notfound img { width: 96px; margin: 0 auto 24px; }
.notfound .lead { margin-inline: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
