/* 기본 초기화 */
*, *::before, *::after { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
img { max-width: 100%; }
/* 레이아웃: 밤하늘 아래 로마 수도교 실루엣. 돌판 액자 속 게임판, 오른쪽에 파피루스 규칙 두루마리와 청동 계기판 */
:root {
  --night: #0f0d19;
  --night-2: #1b1733;
  --stone: #2a2433;
  --stone-hi: #40374b;
  --stone-lo: #15111c;
  --bronze: #cf9c4f;
  --bronze-hi: #f1c47a;
  --bronze-lo: #7a5526;
  --parch: #eadcbc;
  --parch-lo: #c9b48a;
  --ink-dark: #2c1f16;
  --ink: #efe5d1;
  --muted: #a99d8c;
  --torch: #f0ad4e;
  --legion: #b9443a;
  --olive: #9bab72;
  --f-title: "Song Myung", "Gowun Batang", serif;
  --f-body: "Gowun Batang", "Apple SD Gothic Neo", "Noto Serif KR", serif;
  --f-latin: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --f-pixel: "Silkscreen", "Courier New", monospace;
  color-scheme: dark;
}
html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 32px;
  -webkit-tap-highlight-color: transparent;
  background-color: var(--night);
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 8%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 22%, #fffa 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 12%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 30%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 46% 40%, #fff4 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 46%, #fff5 50%, transparent 51%),
    linear-gradient(180deg, var(--night-2) 0%, var(--night) 520px);
  background-repeat: no-repeat;
}
.wrap { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }

/* ---------- 머리 ---------- */
.masthead { position: relative; padding-top: calc(14px + env(safe-area-inset-top, 0px)); display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.moon { position: absolute; right: 2%; top: calc(10px + env(safe-area-inset-top, 0px)); width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fff6dc 0 40%, #e9d9a8 70%, #c9b680 100%);
  box-shadow: 0 0 40px 10px rgba(255, 236, 180, 0.18); }
.aqueduct { position: absolute; left: 40%; right: 0; top: calc(14px + env(safe-area-inset-top, 0px)); height: 36px; opacity: 0.45; pointer-events: none; }
.brand, .road { position: relative; z-index: 1; }
.aqueduct svg { width: 100%; height: 100%; display: block; }
.brand { position: relative; display: flex; align-items: center; gap: 12px; }
.brand > div { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.emblem { width: 34px; height: 34px; flex: none; image-rendering: pixelated; }
h1 { font-family: var(--f-title); font-weight: 400; font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: 0.02em;
  text-shadow: 0 2px 0 #000, 0 0 22px rgba(240, 173, 78, 0.35); text-wrap: balance; }
.sub { font-family: var(--f-latin); font-size: 11px; letter-spacing: 0.34em; color: var(--bronze); }

/* 이정표 길 (스테이지 선택) */
.road { position: relative; display: flex; gap: 6px; padding: 2px 2px 6px; }
.road { flex-wrap: wrap; }
.road button { flex: none; width: 38px; font-size: 12px; }
.road button {
  position: relative; z-index: 1;
  font-family: var(--f-latin); font-weight: 700; font-size: 13px; letter-spacing: 0.04em;
  min-width: 0; height: 34px; padding: 0 2px;
  color: var(--ink); cursor: pointer;
  background: linear-gradient(180deg, var(--stone-hi), var(--stone));
  border: 2px solid var(--stone-lo); border-radius: 6px 6px 3px 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 3px 0 var(--stone-lo);
  transition: transform 0.08s;
}
.road button:hover:not(:disabled) { transform: translateY(-1px); }
.road button.done { color: var(--olive); }
.road button.done::after { content: ""; position: absolute; right: 3px; top: 3px; width: 5px; height: 5px; background: var(--olive); box-shadow: 0 0 6px var(--olive); }
.road button[aria-current="true"] {
  color: var(--ink-dark);
  background: linear-gradient(180deg, var(--bronze-hi), var(--bronze));
  border-color: var(--bronze-lo); box-shadow: 0 3px 0 var(--bronze-lo), 0 0 18px rgba(240, 173, 78, 0.45);
}
.road button:disabled { color: #6e6378; background: #1d1825; box-shadow: 0 3px 0 #0e0b13; cursor: not-allowed; }
.road button:disabled::before { content: ""; position: absolute; left: 50%; bottom: -1px; width: 8px; height: 3px; margin-left: -4px; background: #4a4256; }

/* ---------- 본문 ---------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
@media (max-width: 780px) { .game { grid-template-columns: minmax(0, 1fr); } }
.boardbox { min-width: 0; display: grid; justify-items: center; gap: 10px; }

.plaque {
  display: inline-flex; align-items: baseline; gap: 12px; padding: 4px 16px 5px;
  background: linear-gradient(180deg, var(--bronze-hi), var(--bronze) 55%, var(--bronze-lo));
  color: var(--ink-dark); border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(60, 35, 10, 0.5), 0 4px 0 #3c2610, 0 8px 20px rgba(0,0,0,0.5);
}
.plaque h2 { margin: 0; font-family: var(--f-title); font-weight: 400; font-size: 22px; line-height: 1.2; }
.plaque .latin { font-family: var(--f-latin); font-weight: 700; font-size: 11px; letter-spacing: 0.28em; opacity: 0.75; }

.frame {
  position: relative; max-width: 100%; padding: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.18) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #5a4a42, #3c312d);
  border-radius: 8px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.12), inset 0 -3px 0 rgba(0,0,0,0.4), 0 6px 0 #1b1416, 0 18px 40px rgba(0,0,0,0.6);
}
.frame::before, .frame::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 2px; background: var(--bronze); box-shadow: inset -2px -2px 0 var(--bronze-lo); top: 3px; left: 3px; }
.frame::after { left: auto; right: 3px; }
canvas { display: block; max-width: 100%; height: auto; border-radius: 3px; touch-action: auto; background: var(--stone-lo);
  image-rendering: pixelated; box-shadow: 0 0 0 2px var(--stone-lo), 0 0 0 3px var(--bronze-lo); }

/* ---------- 오른쪽: 두루마리와 계기판 ---------- */
aside { display: grid; gap: 16px; min-width: 0; }
.scroll {
  position: relative; color: var(--ink-dark); padding: 16px 18px 14px;
  background:
    radial-gradient(circle at 20% 30%, rgba(140, 100, 50, 0.12) 0 30%, transparent 31%),
    radial-gradient(circle at 80% 70%, rgba(140, 100, 50, 0.1) 0 25%, transparent 26%),
    linear-gradient(180deg, var(--parch), #e2d1ab);
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}
.scroll::before, .scroll::after { content: ""; position: absolute; left: -6px; right: -6px; height: 10px; border-radius: 6px;
  background: linear-gradient(180deg, #a07a46, #6b4c26); box-shadow: 0 2px 0 rgba(0,0,0,0.35); }
.scroll::before { top: -6px; } .scroll::after { bottom: -6px; }
.scroll .tag { font-family: var(--f-latin); font-weight: 700; font-size: 11px; letter-spacing: 0.25em; color: #8a3a2a; }
.scroll h4 { margin: 2px 0 6px; font-family: var(--f-title); font-weight: 400; font-size: 22px; line-height: 1.25; }
.scroll p { margin: 0; font-size: 14px; color: #4a3828; }

.stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; font-variant-numeric: tabular-nums; }
.stats div {
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding: 8px 10px;
  background: linear-gradient(180deg, var(--stone-hi), var(--stone)); border: 2px solid var(--stone-lo); border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.stats svg { grid-row: span 2; width: 22px; height: 22px; shape-rendering: crispEdges; }
.stats span { font-size: 11px; color: var(--muted); line-height: 1.1; }
.stats b { font-family: var(--f-pixel); font-weight: 400; font-size: 18px; line-height: 1.1; color: var(--bronze-hi); }

.toast { min-height: 22px; font-size: 14px; color: var(--torch); text-align: center; }

.controls { display: grid; gap: 14px; justify-items: center; }
.pad { display: grid; grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(3, 54px); gap: 6px; }
.key {
  font-family: var(--f-body); color: var(--ink); cursor: pointer; touch-action: manipulation;
  background: linear-gradient(180deg, var(--stone-hi), var(--stone));
  border: 2px solid var(--stone-lo); border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 4px 0 var(--stone-lo);
  transition: transform 0.05s, box-shadow 0.05s;
}
.key:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 1px 0 var(--stone-lo); }
.key:disabled { opacity: 0.4; cursor: not-allowed; }
.pad .key { font-size: 18px; }
.pad .up { grid-area: 1 / 2; } .pad .left { grid-area: 2 / 1; } .pad .right { grid-area: 2 / 3; } .pad .down { grid-area: 3 / 2; }
.pad .wait { grid-area: 2 / 2; font-size: 14px; font-weight: 700; color: var(--muted); border-radius: 50%; }
.pad.throwing .key.aim { background: linear-gradient(180deg, #ffe7b0, #ffbf5e); box-shadow: 0 4px 0 var(--bronze-lo), 0 0 14px rgba(255,190,90,0.8); }
.pad.throwing .key:not(.wait) { color: var(--ink-dark); background: linear-gradient(180deg, var(--bronze-hi), var(--bronze)); border-color: var(--bronze-lo); box-shadow: 0 4px 0 var(--bronze-lo); }
.acts { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; min-width: 0; width: 100%; }
.acts .key { white-space: nowrap; }
.acts .key { font-size: 14px; font-weight: 700; padding: 11px 6px; }
.acts #bthrow { grid-column: 1 / -1; color: var(--ink-dark); background: linear-gradient(180deg, var(--bronze-hi), var(--bronze)); border-color: var(--bronze-lo); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 4px 0 var(--bronze-lo); }
.acts #bthrow[aria-pressed="true"] { background: linear-gradient(180deg, #ffd98a, var(--torch)); box-shadow: 0 4px 0 var(--bronze-lo), 0 0 16px rgba(240,173,78,0.6); }
.acts #breset { grid-column: 1 / -1; color: var(--muted); }
button:focus-visible { outline: 2px solid var(--torch); outline-offset: 2px; }

.keys { font-size: 12px; color: var(--muted); }
.keys kbd { font-family: var(--f-pixel); font-size: 10px; padding: 1px 5px; border: 1px solid var(--stone-hi); border-bottom-width: 2px; border-radius: 3px; color: var(--ink); }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; font-size: 13px; color: var(--muted); }
.legend div { display: flex; gap: 8px; align-items: center; min-width: 0; line-height: 1.35; }
.legend canvas, .legend i { flex: none; width: 28px; height: 28px; image-rendering: pixelated; box-shadow: none; background: transparent; border-radius: 0; }
.legend i { display: block; background: rgba(255, 196, 96, 0.38); outline: 1px solid rgba(255,214,140,0.6); outline-offset: -3px; }

/* ---------- 카드(오버레이) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(15,13,25,0.65), rgba(8,6,14,0.9));
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.card {
  position: relative; max-width: 360px; text-align: center; display: grid; gap: 10px; justify-items: center;
  color: var(--ink-dark); padding: 26px 22px 22px;
  background: linear-gradient(180deg, var(--parch), #e0cda5);
  border-radius: 3px; box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.card::before, .card::after { content: ""; position: absolute; left: -8px; right: -8px; height: 12px; border-radius: 7px; background: linear-gradient(180deg, #a07a46, #6b4c26); }
.card::before { top: -7px; } .card::after { bottom: -7px; }
.card .mark { font-family: var(--f-latin); font-weight: 700; letter-spacing: 0.3em; font-size: 12px; color: #8a3a2a; }
.card h3 { margin: 0; font-family: var(--f-title); font-weight: 400; font-size: 28px; line-height: 1.2; }
.card p { margin: 0; color: #4a3828; }
.card .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.btn {
  font-family: var(--f-body); font-weight: 700; font-size: 15px; cursor: pointer;
  padding: 11px 20px; border-radius: 6px; color: var(--ink-dark);
  background: linear-gradient(180deg, var(--bronze-hi), var(--bronze)); border: 2px solid var(--bronze-lo);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 4px 0 var(--bronze-lo);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--bronze-lo); }
.btn.ghost { background: transparent; border-color: #9a7f5a; box-shadow: 0 3px 0 #9a7f5a; }

/* 스테이지 고르기 */
.chip { display: none; }
.picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; }
.pick { display: grid; gap: 1px; justify-items: center; padding: 8px 4px; border-radius: 5px; cursor: pointer;
  background: rgba(120, 90, 50, 0.12); border: 1px solid rgba(120, 90, 50, 0.3); color: var(--ink-dark); font-family: var(--f-body); }
.pick em { font-style: normal; font-family: var(--f-latin); font-weight: 700; font-size: 14px; }
.pick span { font-size: 12px; line-height: 1.25; }
.pick small { font-size: 10px; color: #8a6420; min-height: 13px; }
.pick.cur { background: #8a3a2a; color: var(--parch); border-color: #5e2219; }
.pick.cur small { color: #f1c47a; }
.pick:disabled { opacity: 0.4; cursor: not-allowed; }
.acts #breset.armed { color: var(--parch); background: linear-gradient(180deg, #c4553f, #8a3a2a); border-color: #5e2219; box-shadow: 0 4px 0 #5e2219; font-size: 12px; }



.hbtns { display: flex; gap: 8px; align-items: center; }
.snd { width: 36px; height: 34px; padding: 6px; cursor: pointer; color: var(--bronze-hi);
  background: linear-gradient(180deg, var(--stone-hi), var(--stone)); border: 2px solid var(--stone-lo); border-radius: 6px; box-shadow: 0 3px 0 var(--stone-lo); }
.snd svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.snd[aria-pressed="false"] { color: var(--muted); }
@media (min-width: 781px) { .masthead > .hbtns { order: 3; } }


/* 이야기 장면 */
.cine { position: fixed; inset: 0; z-index: 30; background: #000; display: grid; align-content: center; justify-items: center; gap: 22px; cursor: pointer;
  padding: calc(20px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  animation: cinein 0.6s ease-out; }
@keyframes cinein { from { opacity: 0; } to { opacity: 1; } }
.cine:focus { outline: none; }
.cine canvas { width: min(100%, 880px, calc((100vh - 300px) * 16 / 9)); height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; border-radius: 2px; box-shadow: none; background: #000; }
.cine-text { max-width: 560px; text-align: center; display: grid; gap: 8px; }
.cine-zone { font-family: var(--f-latin); font-weight: 700; font-size: 12px; letter-spacing: 0.32em; color: var(--bronze); }
.cine h2 { margin: 0; font-family: var(--f-title); font-weight: 400; font-size: 32px; color: var(--ink); text-shadow: 0 0 18px rgba(240,173,78,0.35); }
.cine p { margin: 0; min-height: 5.4em; font-size: 17px; line-height: 1.8; color: #d9cfbd; text-wrap: pretty; }
.cine-hint { font-family: var(--f-pixel); font-size: 11px; color: var(--muted); opacity: 0; transition: opacity 0.4s; }
.cine-hint.ready { opacity: 1; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }


.menu { display: grid; gap: 8px; width: 100%; max-width: 240px; }
.menu .btn { width: 100%; }
.savenote { margin: 0; font-size: 12px; color: #6b5a44; max-width: 240px; }
.help { margin: 0; padding: 0; list-style: none; text-align: left; display: grid; gap: 8px; font-size: 14px; color: #4a3828; }
.help b { color: #8a3a2a; }


.frame { position: relative; }
.banner { position: absolute; left: 0; right: 0; top: 22%; display: grid; justify-items: center; gap: 2px; pointer-events: none; z-index: 2;
  padding: 14px 10px 16px; background: linear-gradient(90deg, transparent, rgba(8,6,14,0.82) 18%, rgba(8,6,14,0.82) 82%, transparent); }
.banner small { font-family: var(--f-latin); font-weight: 700; font-size: 11px; letter-spacing: 0.3em; color: var(--bronze); }
.banner b { font-family: var(--f-title); font-weight: 400; font-size: clamp(26px, 6vw, 44px); line-height: 1.15; color: var(--ink); text-shadow: 0 0 20px rgba(240,173,78,0.4); }
.banner span { font-family: var(--f-latin); font-size: 11px; letter-spacing: 0.4em; color: var(--muted); }
.banner.play { animation: bannerin var(--dur, 2.6s) ease both; }
.banner em { font-style: normal; margin-top: 6px; padding: 3px 12px; font-size: 14px; font-weight: 700; color: var(--ink-dark); background: var(--bronze-hi); border-radius: 3px; }
@keyframes bannerin { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }


/* 엔딩 뒤 여정 돌아보기 */
.epi { position: fixed; inset: 0; z-index: 25; overflow-y: auto; background-color: #0b0912; background-image: radial-gradient(ellipse at 50% 0%, #2a2038 0%, #0b0912 70%);
  padding: calc(28px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  animation: cinein 0.8s ease-out; }
.epi-in { max-width: 720px; margin: 0 auto; display: grid; gap: 18px; justify-items: center; text-align: center; }
.epi h2 { margin: 0; font-family: var(--f-title); font-weight: 400; font-size: clamp(30px, 7vw, 44px); color: var(--ink); text-shadow: 0 0 22px rgba(240,173,78,0.45); }
.epi .lead { margin: 0; color: #d9cfbd; font-size: 16px; }
.route { width: 100%; overflow-x: auto; padding-bottom: 4px; }
.route .zrow, .route ol { display: grid; grid-template-columns: repeat(12, minmax(52px, 1fr)); min-width: 640px; }
.route .zrow div { font-family: var(--f-latin); font-size: 10px; letter-spacing: 0.15em; color: var(--bronze); border-bottom: 1px solid rgba(207,156,79,0.4); padding-bottom: 4px; margin: 0 3px; }
.route ol { list-style: none; margin: 0; padding: 10px 0 0; position: relative; }
.route ol::before { content: ""; position: absolute; left: 4%; right: 4%; top: 25px; border-top: 2px dashed rgba(207,156,79,0.5); }
.route li { position: relative; display: grid; justify-items: center; gap: 4px; }
.route li i { font-style: normal; font-family: var(--f-latin); font-weight: 700; font-size: 11px; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; color: var(--ink-dark); background: linear-gradient(180deg, var(--bronze-hi), var(--bronze)); box-shadow: 0 2px 0 var(--bronze-lo); }
.route li:last-child i { background: linear-gradient(180deg, #d8e6b0, var(--olive)); box-shadow: 0 0 14px rgba(155,171,114,0.7); }
.route li span { font-size: 11px; line-height: 1.3; color: #cfc3ad; word-break: keep-all; }
.estats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 480px; }
.estats div { display: grid; gap: 2px; padding: 12px 8px; border-radius: 6px; background: linear-gradient(180deg, var(--stone-hi), var(--stone)); border: 2px solid var(--stone-lo); }
.estats b { font-family: var(--f-pixel); font-weight: 400; font-size: 24px; color: var(--bronze-hi); }
.estats span { font-size: 12px; color: var(--muted); }
.facts { width: 100%; text-align: left; color: var(--ink-dark); padding: 18px 20px; border-radius: 3px; background: linear-gradient(180deg, var(--parch), #e0cda5); display: grid; gap: 10px; }
.facts h3 { margin: 0; font-family: var(--f-title); font-weight: 400; font-size: 22px; }
.facts p { margin: 0; font-size: 14px; color: #4a3828; line-height: 1.7; }
.facts b { color: #8a3a2a; margin-right: 6px; }
.ebtns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btn.ghost.light { color: var(--ink); border-color: var(--stone-hi); box-shadow: 0 3px 0 var(--stone-lo); }


/* 첫 화면 */
.title { position: fixed; inset: 0; z-index: 40; background: #07060f; display: grid; grid-template-rows: 1fr auto; align-items: start; justify-items: center; overflow: hidden;
  padding: calc(20px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.title canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; box-shadow: none; border-radius: 0; background: #07060f; }
.title::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,6,15,0.75) 0%, rgba(7,6,15,0.2) 38%, transparent 55%, rgba(7,6,15,0.8) 100%); pointer-events: none; }
.title-in { position: relative; z-index: 1; display: grid; gap: 10px; justify-items: center; text-align: center; margin-top: 9vh; }
.tname { margin: 0; font-family: var(--f-title); font-weight: 400; font-size: clamp(44px, 12vw, 76px); line-height: 1; color: var(--ink);
  text-shadow: 0 3px 0 #000, 0 0 30px rgba(240,173,78,0.55); white-space: nowrap; }
.tsub { margin: 0 0 10px; color: #d9cfbd; font-size: 15px; text-shadow: 0 1px 4px #000; }
.tbtns { position: relative; z-index: 1; display: grid; gap: 10px; justify-items: center; }
.tbtns .btn { min-width: 220px; font-size: 17px; padding: 13px 24px; }
.tbtns .play { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 4px 0 var(--bronze-lo), 0 0 26px rgba(240,173,78,0.6); } }

/* ---------- 폰 ---------- */
@media (min-width: 781px) { .moon { display: none; } }
@media (max-width: 780px) {
  .cine h2 { font-size: 26px; }
  .cine p { font-size: 15px; }
  .road { display: none; }
  .moon, .aqueduct { display: none; }
  .chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; cursor: pointer;
    font-family: var(--f-body); color: var(--ink-dark); border-radius: 6px;
    background: linear-gradient(180deg, var(--bronze-hi), var(--bronze)); border: 2px solid var(--bronze-lo); box-shadow: 0 3px 0 var(--bronze-lo); }
  .chip em { font-style: normal; font-family: var(--f-latin); font-weight: 700; font-size: 15px; }
  .chip span { font-family: var(--f-latin); font-size: 11px; opacity: 0.7; }
  .chip b { font-size: 12px; }
  .masthead { flex-wrap: nowrap; }
  h1 { white-space: nowrap; }
  .chip { white-space: nowrap; flex: none; }
  body { padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px)); }
  .masthead { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  h1 { font-size: 24px; }
  .emblem { width: 28px; height: 28px; }
  .moon { width: 28px; height: 28px; }
  .road button { height: 32px; font-size: 12px; }
  .sub { display: none; }
  .wrap { gap: 12px; }
  .plaque h2 { font-size: 17px; }
  .boardbox { gap: 8px; }
  .frame { padding: 5px; }
  .frame::before, .frame::after { display: none; }
  .controls {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; flex-wrap: nowrap; gap: 12px;
    background: linear-gradient(180deg, #2c2535, #1a1521);
    border-top: 3px solid var(--bronze-lo);
    box-shadow: 0 -8px 24px rgba(0,0,0,0.5);
    padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  .pad { grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(3, 50px); gap: 5px; }
  .acts { grid-template-columns: 1fr 1fr; }
  .aqueduct { left: 45%; top: calc(20px + env(safe-area-inset-top, 0px)); height: 34px; }
  .acts .key { font-size: 13px; padding: 13px 4px; }
  .keys { display: none; }
  .stats b { font-size: 15px; }
  .stats div { padding: 6px 8px; column-gap: 6px; }
  .stats svg { width: 18px; height: 18px; }
  .toast { position: fixed; left: 0; right: 0; bottom: calc(196px + env(safe-area-inset-bottom, 0px)); z-index: 11; pointer-events: none; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
