/* 회장님 키우기 — 시대별 신문 지면 톤
 * 종이색과 잉크색을 기본으로 두고, 사건 연도가 올라갈수록 사진과 강조색의 채도를 높인다.
 * 가독성: 본문 17~18px, 줄간격 1.7 이상, 본문 대비 7:1 이상, 터치 영역 48px 이상.
 */
:root {
  --ink: #2d2923;
  --ink-2: #494238;
  --grey: #6c6256;
  --grey-2: #a39684;
  --paper: #f0eadc;
  --paper-2: #e2d8c6;
  --cream: #fffaf0;
  --line: rgba(67, 57, 45, .22);
  --line-strong: #655b4d;
  --seal: #a33b30;
  --era-accent: #7c5140;
  --era-accent-soft: rgba(124, 81, 64, .10);
  --era-saturation: 0;
  --era-sepia: .22;
  --shadow: 0 12px 28px rgba(67, 57, 45, .10);
  --serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", "Apple Myungjo", Georgia, "Times New Roman", serif;
  --sans: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
@media (min-width: 900px) { :root { font-size: 18px; } }

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; background: var(--paper); transition: background-color .8s ease; }
body[data-era-tone="mono"] { --era-accent: #795343; --era-accent-soft: rgba(121,83,67,.10); --era-saturation: 0; --era-sepia: .24; }
body[data-era-tone="early-color"] { --era-accent: #8b553d; --era-accent-soft: rgba(139,85,61,.11); --era-saturation: .28; --era-sepia: .18; }
body[data-era-tone="broadcast-color"] { --era-accent: #446c70; --era-accent-soft: rgba(68,108,112,.11); --era-saturation: .66; --era-sepia: .08; }
body[data-era-tone="full-color"] { --era-accent: #23647a; --era-accent-soft: rgba(35,100,122,.10); --era-saturation: 1; --era-sepia: 0; }
button, input { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--ink); }

/* 필름 입자 */
.paper-noise {
  position: fixed; inset: 0; pointer-events: none; opacity: .08; z-index: 0; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ───────── 상단·하단 ───────── */
.topbar, .footer, #app { position: relative; z-index: 1; }
.topbar {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(16px, 4vw, 60px); background: rgba(255, 250, 240, .96); backdrop-filter: blur(8px);
  border-bottom: 3px double var(--line-strong); box-shadow: 0 4px 14px rgba(67,57,45,.07); position: sticky; top: 0; z-index: 20;
}
.brand { border: 0; background: transparent; display: flex; gap: 12px; align-items: center; cursor: pointer; text-align: left; padding: 0; min-height: 48px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; background: transparent; color: var(--seal); border: 2px solid var(--seal); transform: rotate(-2deg); font-family: var(--serif); font-size: 24px; }
.brand strong { display: block; font-size: 17px; font-family: var(--serif); letter-spacing: -.02em; line-height: 1.2; }
.brand small { display: block; font-size: 10px; letter-spacing: .16em; color: var(--grey); margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 44px; height: 44px; border: 1.5px solid var(--line-strong); border-radius: 50%; background: transparent; cursor: pointer; transition: .15s; font-size: 18px; }
.icon-button:hover { background: var(--era-accent-soft); border-color: var(--era-accent); color: var(--era-accent); }
.icon-button.muted { color: var(--seal); border-color: var(--seal); }
.music-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--grey); max-width: 200px; white-space: nowrap; overflow: hidden; }
.music-status span:last-child { overflow: hidden; text-overflow: ellipsis; }
.music-bars { display: inline-flex; height: 14px; align-items: end; gap: 2px; }
.music-bars i { width: 3px; height: 5px; background: var(--ink); animation: beat .8s infinite alternate; }
.music-bars i:nth-child(2) { animation-delay: .2s; height: 10px; }
.music-bars i:nth-child(3) { animation-delay: .4s; height: 7px; }
.music-status.paused .music-bars i { animation-play-state: paused; height: 2px; }
@keyframes beat { to { height: 13px; } }

#app { width: min(1180px, calc(100% - 28px)); min-height: calc(100vh - 150px); margin: 0 auto; padding: 32px 0 56px; }
.footer { min-height: 64px; padding: 18px clamp(16px, 4vw, 60px); display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line-strong); color: var(--grey); font-size: 12px; letter-spacing: .06em; }

/* ───────── 공통 ───────── */
.screen { animation: enter .4s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.eyebrow { color: var(--grey); letter-spacing: .12em; font-weight: 700; font-size: 13px; }
.display { margin: 14px 0 12px; font-family: var(--serif); font-size: clamp(48px, 8vw, 104px); line-height: .94; letter-spacing: -.05em; font-weight: 900; }
.display span { display: block; }
.display em { display: inline-block; margin-top: .15em; padding: .12em .28em .15em .38em; border-left: .13em solid var(--ink); background: var(--seal); color: var(--cream); box-shadow: .09em .09em 0 rgba(67,57,45,.16); font-size: .58em; font-style: normal; line-height: 1; letter-spacing: .16em; transform: rotate(-1deg); }
.lead { max-width: 680px; font-size: clamp(17px, 1.9vw, 20px); line-height: 1.8; color: var(--ink-2); word-break: keep-all; }
.hint { color: var(--grey); font-size: 14px; line-height: 1.65; margin: 12px 0 0; word-break: keep-all; }
.hint a { color: var(--ink); }

.btn { min-height: 52px; border: 2px solid var(--ink); padding: 0 22px; background: var(--cream); color: var(--ink); font-weight: 800; font-size: 16px; cursor: pointer; transition: .15s; letter-spacing: -.01em; }
.btn:hover { background: var(--era-accent-soft); color: var(--ink); border-color: var(--era-accent); }
.btn.gold { background: var(--era-accent); border-color: var(--era-accent); color: var(--cream); }
.btn.gold:hover { background: var(--ink-2); color: var(--cream); }
.btn.secondary { border: 1.5px solid var(--grey-2); color: var(--ink); background: transparent; font-weight: 700; }
.btn.secondary:hover { border-color: var(--ink); background: rgba(20,20,20,.05); color: var(--ink); }
.btn.small { min-height: 42px; padding: 0 14px; font-size: 14px; }
.btn.wide { width: 100%; margin-top: 14px; }
.btn small { display: block; font-weight: 400; font-size: 12px; opacity: .8; margin-top: 2px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--cream); color: var(--ink); }
.founder-wiki { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-color: var(--seal); background: rgba(168,54,42,.07); color: var(--seal); text-decoration: none; }
.founder-wiki:hover { background: var(--seal); border-color: var(--seal); color: var(--cream); }
.founder-wiki span { font-size: 1.05em; }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.button-row.center { justify-content: center; }
.file-label { display: inline-flex; align-items: center; cursor: pointer; }
h1[tabindex="-1"]:focus, .modal:focus { outline: none; }
.choice:focus-visible, .btn:focus-visible, .select-card:focus-visible, .industry-card:focus-visible, .recovery-option:focus-visible, .sector-card:focus-visible, .founder-card:focus-visible, .icon-button:focus-visible, .brand:focus-visible { outline: 3px solid var(--seal); outline-offset: 2px; }

.panel { background: rgba(255, 250, 240, .94); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }

/* ───────── 시작 화면 ───────── */
.hero { min-height: 640px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 48px; }
.hero-art { position: relative; min-height: 480px; border: 1px solid var(--line-strong); background: #cfc4b2; overflow: hidden; box-shadow: var(--shadow); }
.hero-art .photo { position: absolute; inset: 0; }
.hero-art .photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(var(--era-saturation)) sepia(var(--era-sepia)) contrast(1.03); transition: filter 1s ease; }
.hero-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(45,41,35,.02) 42%, rgba(45,41,35,.58)); z-index: 1; }
.hero-banner { position: absolute; left: 4%; right: 4%; top: 5%; z-index: 2; }
.hero-stamp { position: absolute; right: 6%; top: 34%; border: 3px solid var(--seal); color: var(--seal); padding: 6px 12px; transform: rotate(-8deg); font-weight: 900; letter-spacing: .16em; font-size: 14px; z-index: 2; background: rgba(250,248,242,.75); }
.hero-caption { position: absolute; left: 6%; right: 6%; bottom: 6%; color: var(--cream); display: flex; justify-content: space-between; align-items: end; gap: 12px; z-index: 2; }
.hero-caption strong { font-size: 26px; font-family: var(--serif); line-height: 1.2; white-space: nowrap; }
.hero-caption small { max-width: 200px; text-align: right; line-height: 1.5; font-size: 13px; color: rgba(250,248,242,.85); word-break: keep-all; }
.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 34px; background: var(--line); border-top: 3px double var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.feature-strip div { background: var(--paper); padding: 16px; }
.feature-strip b { display: block; font-size: 26px; font-family: var(--serif); }
.feature-strip span { display: block; font-size: 13px; color: var(--grey); margin-top: 4px; }

/* ───────── 설정 화면 ───────── */
.setup { max-width: 900px; margin: 12px auto; padding: clamp(22px, 5vw, 56px); }
.setup h1, .collection h1 { font-family: var(--serif); font-size: clamp(32px, 6vw, 54px); margin: 8px 0 24px; letter-spacing: -.03em; line-height: 1.15; }
.form-section { padding: 22px 0; border-top: 1px solid var(--line-strong); }
.form-section h2 { font-size: 17px; margin: 0 0 6px; font-family: var(--serif); }
.form-section p { color: var(--grey); font-size: 14px; margin: 0 0 14px; line-height: 1.6; word-break: keep-all; }
.name-row { display: flex; gap: 8px; }
.name-row .name-input { flex: 1; min-width: 0; }
.name-input { width: 100%; min-height: 56px; border: 1.5px solid var(--ink); background: white; padding: 0 16px; font-size: 20px; font-weight: 800; outline: none; font-family: var(--serif); }
.name-input:focus { box-shadow: 0 0 0 3px rgba(168,54,42,.18); border-color: var(--seal); }
.choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.select-card { min-height: 56px; background: white; border: 1.5px solid var(--line); cursor: pointer; padding: 10px 12px; text-align: left; transition: .15s; font-size: 16px; }
.select-card:hover { border-color: var(--ink); }
.select-card.selected { border-color: var(--era-accent); background: var(--era-accent); color: var(--cream); }
.select-card b { display: block; }
.select-card small { display: block; margin-top: 3px; color: inherit; opacity: .75; font-size: 12px; }
.industry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.industry-card { min-height: 130px; background: white; border: 1.5px solid var(--line); cursor: pointer; padding: 18px; text-align: left; transition: .15s; }
.industry-card:hover { border-color: var(--ink); }
.industry-card.selected { border: 2px solid var(--era-accent); background: var(--era-accent-soft); }
.industry-card .icon { font-size: 26px; display: block; margin-bottom: 10px; }
.industry-card b { display: block; font-size: 17px; }
.industry-card small { display: block; line-height: 1.55; color: var(--grey); margin-top: 6px; font-size: 14px; word-break: keep-all; }

/* ───────── 게임 레이아웃 ───────── */
.game-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 240px; gap: 18px; align-items: start; }
.side-panel { padding: 18px; position: sticky; top: 90px; }
.company-title { padding-bottom: 12px; border-bottom: 3px double var(--line-strong); }
.company-title small { color: var(--grey); font-size: 13px; }
.company-title h2 { font-family: var(--serif); margin: 4px 0 0; font-size: 26px; line-height: 1.2; }
.stat { margin-top: 14px; }
.stat-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--grey); margin-bottom: 5px; }
.stat-label b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--paper-2); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: var(--ink); transition: width .5s; }
.bar.gold i { background: repeating-linear-gradient(90deg, var(--ink) 0 4px, var(--ink-2) 4px 6px); }
.bar.red i { background: var(--seal); }
.business-list { margin-top: 12px; }
.business-tag { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.business-tag span:first-child { white-space: nowrap; }
.business-tag span:last-child { color: var(--grey); text-align: right; }
.business-tag em { font-style: normal; color: var(--seal); font-size: 11px; }
.era-progress { display: flex; gap: 3px; margin-top: 16px; }
.era-progress i { height: 5px; flex: 1; background: var(--paper-2); border: 1px solid var(--line); }
.era-progress i.done { background: var(--line-strong); }
.era-progress i.now { background: var(--era-accent); border-color: var(--era-accent); }
.record-panel .company-title { margin-top: 6px; }
.record-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.record-item { font-size: 13px; line-height: 1.5; padding-left: 10px; border-left: 2px solid var(--ink); color: var(--ink-2); word-break: keep-all; }
.record-item strong { display: block; color: var(--ink); margin-bottom: 2px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.badge { display: inline-flex; flex-direction: column; padding: 6px 10px; border: 1px solid var(--ink); background: white; font-size: 13px; font-weight: 700; line-height: 1.3; }
.badge small { font-weight: 400; color: var(--grey); font-size: 11px; letter-spacing: .04em; }
.badge.bad { border-color: var(--seal); color: var(--seal); }
.badge.warn { border-style: dashed; }

/* ───────── 사건 카드 ───────── */
.event-card { min-height: 560px; padding: clamp(20px, 4vw, 40px); position: relative; overflow: hidden; background-image: linear-gradient(90deg, rgba(67,57,45,.018) 1px, transparent 1px); background-size: 5px 100%; }
.event-card::after { content: attr(data-year); position: absolute; right: -6px; top: -18px; font: 900 clamp(70px, 10vw, 130px)/1 var(--serif); color: rgba(20,20,20,.05); pointer-events: none; }
.event-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: .08em; padding-bottom: 12px; border-bottom: 3px double var(--line-strong); }
.scene { margin: 18px 0 0; background: white; padding: 8px; border: 1px solid var(--line-strong); box-shadow: 0 8px 20px rgba(20,20,20,.12); }
.scene .photo { position: relative; overflow: hidden; background: #cfc4b2; aspect-ratio: 20 / 7; }
.scene .photo img, .scene .photo svg { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(var(--era-saturation)) sepia(var(--era-sepia)) contrast(1.03); transition: filter 1s ease; }
.scene .photo::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 42px rgba(67,57,45,.24); pointer-events: none; }
.scene figcaption { display: flex; justify-content: space-between; gap: 10px; padding: 8px 4px 2px; font-size: 12px; color: var(--grey); letter-spacing: .04em; }
.banner { margin: 12px 0 0; }
.banner-svg, .scene-svg { width: 100%; height: auto; display: block; }
.aftershock { margin: 20px 0 0; padding: 14px 18px; border: 1px solid var(--seal); border-left-width: 6px; background: rgba(168,54,42,.06); }
.aftershock b { display: block; font-size: 13px; letter-spacing: .1em; color: var(--seal); margin-bottom: 6px; }
.aftershock p { margin: 4px 0 0; font-size: 16px; line-height: 1.65; word-break: keep-all; }
.event-kicker { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--grey); font-size: 14px; word-break: keep-all; }
.event-card h1 { margin: 8px 0 14px; padding-bottom: 12px; border-bottom: 3px double var(--line-strong); font-family: var(--serif); font-size: clamp(28px, 5vw, 46px); line-height: 1.2; letter-spacing: -.03em; word-break: keep-all; }
.event-story { font-size: 18px; line-height: 1.85; margin: 0 0 24px; word-break: keep-all; color: var(--ink); }
.era-quote { margin: 0 0 24px; padding: 14px 18px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); font-family: var(--serif); }
.era-quote p { margin: 0; font-size: 16px; line-height: 1.75; word-break: keep-all; color: var(--ink-2); }
.era-quote cite { display: block; margin-top: 8px; font-style: normal; font-size: 13px; color: var(--grey); font-family: var(--sans); }
.maturity { margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--line-strong); background: white; font-size: 14px; }
.maturity b { display: block; font-size: 13px; letter-spacing: .1em; margin-bottom: 8px; }
.maturity table, .table { width: 100%; border-collapse: collapse; font-size: 14px; }
.maturity th, .maturity td, .table th, .table td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.maturity p { margin: 8px 0 0; color: var(--grey); font-size: 13px; line-height: 1.6; }
.maturity small { color: var(--seal); }

.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { width: 100%; min-height: 76px; display: grid; grid-template-columns: 40px 1fr 24px; align-items: center; gap: 14px; border: 1.5px solid var(--ink); background: white; padding: 14px 16px; text-align: left; cursor: pointer; transition: .15s; }
.choice:hover { background: var(--era-accent-soft); color: var(--ink); border-color: var(--era-accent); }
.choice:hover .choice-copy small { color: var(--grey); }
.choice:hover .choice-number { background: var(--era-accent); color: var(--cream); }
.choice:hover .choice-arrow { color: var(--era-accent); }
.choice-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--era-accent); color: var(--cream); font: 800 15px var(--serif); }
.choice-copy b { display: block; line-height: 1.45; font-size: 17px; word-break: keep-all; }
.choice-copy small { display: block; color: var(--grey); margin-top: 5px; line-height: 1.5; font-size: 14px; word-break: keep-all; }
.choice-arrow { color: var(--ink); font-size: 20px; }
.choice.disabled { opacity: .55; cursor: not-allowed; border-style: dashed; background: var(--paper); }
.choice.disabled:hover { background: var(--paper); color: var(--ink); }
.choice.disabled:hover .choice-copy small { color: var(--grey); }
.choice.disabled:hover .choice-number { background: var(--ink); color: var(--cream); }
.choice.disabled .choice-copy small { color: var(--seal); }
.choice.negative .choice-number { background: var(--grey); }

/* 업종 선택 */
.sector-picker h2 { font-family: var(--serif); font-size: 24px; margin: 0 0 10px; }
.mode-toggle { display: flex; gap: 6px; margin: 8px 0; }
.mode-toggle button { flex: 1; min-height: 46px; border: 1.5px solid var(--ink); background: white; cursor: pointer; font-size: 14px; font-weight: 700; }
.mode-toggle button.on { background: var(--era-accent); border-color: var(--era-accent); color: var(--cream); }
.sector-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.sector-card { min-height: 100px; border: 1.5px solid var(--ink); background: white; padding: 14px; text-align: left; cursor: pointer; transition: .15s; }
.sector-card:hover { background: var(--era-accent-soft); border-color: var(--era-accent); color: var(--ink); }
.sector-card:hover small { color: var(--grey); }
.sector-card .icon { font-size: 24px; display: block; margin-bottom: 6px; }
.sector-card b { display: block; font-size: 17px; }
.sector-card small { display: block; margin-top: 5px; color: var(--grey); line-height: 1.5; font-size: 14px; word-break: keep-all; }
.sector-card.disabled { opacity: .55; cursor: not-allowed; border-style: dashed; }
.sector-card.disabled:hover { background: white; color: var(--ink); }
.sector-card.disabled small { color: var(--seal); }

/* ───────── 결과 ───────── */
.result-card { max-width: 760px; margin: 28px auto; padding: clamp(26px, 6vw, 60px); text-align: center; }
.result-icon { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; font-size: 26px; }
.result-card h1 { font: 700 clamp(26px, 4.5vw, 40px)/1.25 var(--serif); margin: 8px 0 16px; word-break: keep-all; letter-spacing: -.02em; }
.result-copy { font-size: 18px; line-height: 1.85; max-width: 600px; margin: 0 auto; word-break: keep-all; }
.result-copy b { font-variant-numeric: tabular-nums; }
.deltas { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
.delta { display: inline-flex; flex-direction: column; min-width: 104px; text-align: left; border: 1px solid var(--ink); background: white; padding: 9px 12px; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.delta small { font-size: 12px; color: var(--grey); font-weight: 400; letter-spacing: .04em; }
.delta span { font-weight: 400; color: var(--grey); font-size: 13px; }
.delta.good span { color: var(--ink); font-weight: 700; }
.delta.bad { border-color: var(--seal); }
.delta.bad span { color: var(--seal); font-weight: 700; }
.breakdown { margin: 8px auto 0; max-width: 520px; text-align: left; font-size: 15px; }
.breakdown summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.breakdown table { width: 100%; border-collapse: collapse; }
.breakdown td, .breakdown th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.breakdown td:last-child, .breakdown th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.contracts { margin: 18px auto 0; max-width: 520px; text-align: left; padding: 12px 16px; border: 1px solid var(--line-strong); background: white; font-size: 15px; }
.contracts b { display: block; font-size: 13px; letter-spacing: .1em; margin-bottom: 6px; }
.contracts ul, .reason-ul { margin: 0; padding-left: 20px; line-height: 1.65; }
.reason-ul { text-align: left; font-size: 16px; max-width: 560px; margin: 0 auto; word-break: keep-all; }
.recovery-card { border: 2px solid var(--seal); }
.recovery-card .result-icon, .recovery-result .result-icon { border-color: var(--seal); color: var(--seal); }
.recovery-options { display: grid; gap: 10px; margin: 24px 0; text-align: left; }
.recovery-option { border: 1.5px solid var(--ink); background: white; padding: 16px; cursor: pointer; transition: .15s; }
.recovery-option:hover { background: var(--era-accent-soft); color: var(--ink); border-color: var(--era-accent); }
.recovery-option:hover small { color: var(--grey); }
.recovery-option:hover small.cost { color: #f1b3a9; }
.recovery-option b { display: block; font-size: 17px; }
.recovery-option small { display: block; color: var(--grey); line-height: 1.55; margin-top: 5px; font-size: 14px; word-break: keep-all; }
.recovery-option small.cost { color: var(--seal); }
.recovery-option.negative { border-style: dashed; }

/* ───────── 명언 ───────── */
.quote-screen { min-height: 620px; display: grid; place-items: center; text-align: center; position: relative; overflow: hidden; }
.quote-bg { position: absolute; inset: 0; z-index: 0; opacity: .12; }
.quote-bg img { width: 100%; height: 100%; object-fit: cover; filter: saturate(var(--era-saturation)) sepia(var(--era-sepia)) blur(2px); }
.quote-screen .quote-inner { position: relative; z-index: 1; }
.quote-inner { max-width: 780px; padding: 0 8px; }
.quote-era { color: var(--grey); font-size: 14px; letter-spacing: .12em; margin-bottom: 8px; }
.quote-mark { font: 110px/0.7 var(--serif); color: var(--ink); opacity: .35; }
.quote-mark.opening { text-align: center; }
.quote-mark.closing { width: min(88%, 700px); margin: 8px auto -24px; text-align: right; }
.quote-text { font: 700 clamp(26px, 5.5vw, 52px)/1.5 var(--serif); word-break: keep-all; letter-spacing: -.02em; margin: 8px 0 0; }
.quote-hint { margin-top: 26px; color: var(--grey); font-size: 14px; letter-spacing: .06em; }

/* ───────── 엔딩 ───────── */
.ending { max-width: 980px; margin: 8px auto; }
.ending-hero { display: grid; grid-template-columns: .85fr 1.15fr; min-height: 560px; overflow: hidden; }
.portrait { position: relative; display: grid; place-items: center; min-height: 430px; background: linear-gradient(145deg, #e5dccb, #cfc3ae); color: var(--ink); overflow: hidden; }
.portrait::before { content: ""; position: absolute; inset: 22px; border: 3px double rgba(67,57,45,.62); }
.portrait::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 4px, rgba(67,57,45,.022) 4px 5px); }
.portrait-letter { position: relative; z-index: 2; display: grid; place-items: center; text-align: center; }
.portrait-initial { position: relative; z-index: 2; font: 900 150px/1 var(--serif); text-shadow: 0 4px 14px rgba(67,57,45,.20); }
.portrait-letter small { display: block; margin-top: 14px; letter-spacing: .2em; color: var(--grey); font-size: 13px; }
.portrait-slot { position: relative; z-index: 2; display: grid; place-items: center; text-align: center; width: 100%; padding: 36px 24px; }
.portrait-image { position: relative; z-index: 2; width: min(72%, 300px); aspect-ratio: 3/4; object-fit: cover; object-position: 50% 20%; border: 6px solid #fffaf0; outline: 1px solid rgba(67,57,45,.42); box-shadow: 0 12px 24px rgba(67,57,45,.24); }
.portrait-name { display: block; margin-top: 9px; letter-spacing: .16em; color: var(--ink-2); font-size: 12px; }
.founder-logo { position: relative; z-index: 3; width: min(68%, 250px); height: 64px; margin-top: 12px; display: flex; align-items: center; justify-content: center; overflow: visible; background: transparent; border: 0; }
.founder-logo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.founder-logo.compact { width: 100px; height: 38px; margin: 0 0 10px; background: transparent; }
.founder-detail .portrait-slot { padding: 16px; }
.founder-detail .portrait-image { width: 80%; }
.mini-portrait { overflow: hidden; }
.mini-photo { display: block; width: 56px; height: 56px; object-fit: cover; object-position: 50% 20%; border-radius: 50%; }
.ending-copy { padding: clamp(24px, 5vw, 56px); background: var(--cream); }
.grade { color: var(--seal); font: 900 18px var(--serif); letter-spacing: .1em; }
.ending-copy h1 { font: 700 clamp(30px, 6vw, 62px)/1.15 var(--serif); margin: 10px 0; word-break: keep-all; letter-spacing: -.03em; }
.ending-copy h2 { font-size: 16px; margin: 0 0 22px; color: var(--grey); font-weight: 400; line-height: 1.6; word-break: keep-all; }
.ending-copy h3 { font-size: 13px; letter-spacing: .1em; color: var(--grey); margin: 22px 0 8px; }
.ending-quote { padding: 18px 0; border-top: 3px double var(--line-strong); border-bottom: 1px solid var(--line-strong); font: 700 19px/1.7 var(--serif); word-break: keep-all; }
.ending-quote small { display: block; margin-top: 8px; font: 400 13px/1.5 var(--sans); color: var(--grey); }
.ending-explain { font-size: 16px; line-height: 1.8; word-break: keep-all; color: var(--ink-2); }
.reason-list { margin: 6px 0 20px; display: grid; gap: 8px; }
.reason-list div { padding-left: 18px; position: relative; font-size: 15px; line-height: 1.6; word-break: keep-all; }
.reason-list div::before { content: ""; width: 7px; height: 7px; background: var(--ink); position: absolute; left: 0; top: 9px; }
.ending-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0; }
.ending-stat { background: var(--paper); border: 1px solid var(--line); padding: 12px; text-align: center; }
.ending-stat b { display: block; font: 700 22px var(--serif); font-variant-numeric: tabular-nums; }
.ending-stat span { font-size: 12px; color: var(--grey); word-break: keep-all; white-space: nowrap; }
.life-line { padding: 14px 16px; background: var(--paper); border-left: 4px solid var(--ink); font-size: 15px; line-height: 1.65; word-break: keep-all; }
.life-line b { display: block; font-size: 12px; letter-spacing: .1em; color: var(--grey); margin-bottom: 4px; }
.retro { margin-top: 18px; font-size: 14px; line-height: 1.65; word-break: keep-all; }
.retro h3 { margin-top: 0; }
.retro p { margin: 6px 0; color: var(--ink-2); }
.share-row { margin: 18px 0 6px; padding-top: 14px; border-top: 1px solid var(--line-strong); }
.share-row label { font-size: 14px; color: var(--grey); display: block; margin-bottom: 8px; }
.share-row .button-row { margin-top: 6px; }
.headline { position: absolute; z-index: 4; top: 0; left: 0; right: 0; padding: 8px 12px; background: var(--cream); color: var(--ink); font: 900 13px/1.4 var(--serif); letter-spacing: .04em; border-bottom: 3px double var(--ink); text-align: center; word-break: keep-all; }
.portrait i { position: absolute; bottom: -10px; width: 5px; height: 5px; border-radius: 50%; background: var(--era-accent); box-shadow: 0 0 8px rgba(255,255,255,.7); opacity: 0; animation: rise 3s linear infinite; z-index: 1; }
@keyframes rise { 0% { transform: translateY(0); opacity: 0 } 10% { opacity: .9 } 100% { transform: translateY(-460px); opacity: 0 } }
.ending.grade-C .portrait { background: linear-gradient(145deg, #ddd4c4, #bfb3a0); color: var(--ink); }
.ending.grade-C .portrait::before { border-color: rgba(67,57,45,.38); }
.ending.grade-C .portrait-initial { opacity: .9; }
.ending.grade-B .portrait { background: linear-gradient(145deg, #e7dece, #c9bda9); }
.ending.grade-B .portrait::before { border: 3px double rgba(67,57,45,.55); }
.ending.grade-A .portrait { background: linear-gradient(145deg, #efe5cf, #cbb890); }
.ending.grade-A .portrait::before { border: 2px solid #8d7245; box-shadow: 0 0 0 5px rgba(141,114,69,.14); }
.ending.grade-A .portrait::after { background: radial-gradient(circle, rgba(255,255,255,.28), transparent 62%); }
.ending.grade-S .portrait { background: radial-gradient(circle at 50% 30%, #fff4d8, #c9ad75 78%); }
.ending.grade-S .portrait::before { border: 2px solid #8d672e; box-shadow: 0 0 0 6px rgba(141,103,46,.16), 0 0 42px rgba(141,103,46,.22); }
.ending.grade-S .portrait-initial { color: var(--ink); text-shadow: 0 0 24px rgba(255,255,255,.8); animation: swell 2.5s ease both; }
@keyframes swell { from { transform: scale(.7); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.ending .ending-hero { animation: enter 1.2s ease both; }
.ending.grade-S .ending-hero { animation-duration: 2.5s; box-shadow: 0 30px 80px rgba(20,20,20,.35); }
.sequel { margin-top: 18px; padding: 26px; background: #e0d4bd; color: var(--ink); border: 3px double var(--line-strong); text-align: center; font-family: var(--serif); line-height: 1.85; font-size: 17px; word-break: keep-all; }
.sequel .eyebrow { color: var(--grey); margin-bottom: 8px; }

/* ───────── 도산 ───────── */
.bankrupt-card { border: 2px solid var(--ink); }
.signboard { max-width: 320px; margin: 0 auto 10px; }
.signboard-svg { width: 100%; height: auto; }
.sign-swing { transform-origin: 160px 18px; animation: swing 2.4s ease-in-out both; }
@keyframes swing { 0% { transform: rotate(0) } 30% { transform: rotate(-8deg) } 60% { transform: rotate(6deg) } 100% { transform: rotate(-3deg) } }
.bankrupt-card h3 { font-size: 13px; letter-spacing: .1em; color: var(--seal); margin: 22px 0 8px; }

/* ───────── 도감 ───────── */
.collection { max-width: 1040px; margin: auto; }
.collection h1 small { font-size: 16px; color: var(--grey); font-family: var(--sans); font-weight: 400; }
.collection-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.founder-card { min-height: 190px; padding: 18px; padding-bottom: 50px; border: 1.5px solid var(--ink); background: white; position: relative; overflow: hidden; text-align: left; cursor: pointer; transition: .15s; }
button.founder-card:hover { background: var(--era-accent-soft); color: var(--ink); border-color: var(--era-accent); }
button.founder-card:hover p { color: var(--grey); }
.founder-card.locked { filter: grayscale(1); opacity: .55; cursor: default; border-style: dashed; }
.founder-card .mini-portrait { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-2); color: var(--ink); border: 1px solid var(--line-strong); font: 700 26px var(--serif); margin-bottom: 14px; }
.founder-card .mini-portrait .silhouette-svg { width: 56px; height: 56px; }
.founder-card h3 { margin: 0; font-family: var(--serif); font-size: 19px; }
.founder-card p { color: var(--grey); font-size: 13px; line-height: 1.5; }
.grade-dots { display: flex; gap: 4px; position: absolute; bottom: 15px; }
.grade-dots i { width: 24px; height: 24px; border: 1px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; }
.grade-dots i.earned { background: var(--seal); color: white; border-color: var(--seal); }
.founder-detail { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: start; }
.founder-detail .portrait { min-height: 200px; }
.founder-detail .portrait-initial { font-size: 80px; }
.founder-detail h2 { font-family: var(--serif); margin: 4px 0 8px; }
.founder-detail p { font-size: 15px; line-height: 1.7; word-break: keep-all; }
.founder-detail p small { color: var(--grey); font-size: 13px; }
.founder-links { margin: 18px 0 2px; }

/* ───────── 모달·토스트 ───────── */
#modal-root { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; }
#modal-root[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,20,20,.6); }
.modal { position: relative; width: min(760px, 100%); max-height: 88vh; overflow: auto; padding: clamp(18px, 4vw, 32px); background: var(--cream); }
.modal h2 { font-family: var(--serif); margin: 0 0 14px; font-size: 24px; }
.modal h3 { font-size: 13px; letter-spacing: .1em; color: var(--grey); margin: 20px 0 8px; }
.modal .ending-stats { grid-template-columns: repeat(3, 1fr); margin: 10px 0; }
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--cream); padding: 12px 18px; font-size: 14px; animation: toast 2.4s both; max-width: min(90vw, 440px); text-align: center; border: 1px solid rgba(255,255,255,.2); }
@keyframes toast { 0%, 100% { opacity: 0; transform: translate(-50%, 10px) } 12%, 85% { opacity: 1; transform: translate(-50%, 0) } }

/* ───────── 반응형 ───────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 16px; min-height: auto; gap: 26px; }
  .hero-art { min-height: 360px; order: -1; }
  .game-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .game-layout > .side-panel:last-child { display: none; }
  .side-panel .stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .side-panel .stat { margin-top: 10px; }
  .business-list { display: none; }
  .side-panel .btn.wide { display: none; }
  .choice-grid { grid-template-columns: repeat(3, 1fr); }
  .collection-grid { grid-template-columns: repeat(3, 1fr); }
  .founder-detail { grid-template-columns: 1fr; }
  .founder-detail .portrait { min-height: 160px; }
}
@media (max-width: 620px) {
  .topbar { min-height: 64px; padding: 8px 14px; }
  .brand-mark { width: 38px; height: 38px; font-size: 20px; }
  .brand strong { font-size: 15px; }
  .music-status { display: none; }
  #app { width: min(100% - 20px, 1180px); padding-top: 18px; }
  .footer { flex-direction: column; gap: 4px; }
  .hero-art { min-height: 300px; }
  .hero-banner { top: 6%; }
  .hero-caption strong { font-size: 20px; }
  .feature-strip { margin-top: 22px; }
  .feature-strip div { padding: 12px; }
  .feature-strip b { font-size: 20px; }
  .choice-grid { grid-template-columns: repeat(2, 1fr); }
  .industry-grid { grid-template-columns: 1fr; }
  .industry-card { min-height: 92px; }
  .side-panel { padding: 14px; }
  .side-panel .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-label { font-size: 12px; }
  .stat-label b { font-size: 15px; }
  .event-card { padding: 18px 16px; min-height: 0; }
  .event-story { font-size: 17px; }
  .choice { grid-template-columns: 34px 1fr 12px; padding: 12px 10px; gap: 10px; }
  .choice-copy b { font-size: 16px; }
  .sector-grid { grid-template-columns: 1fr; }
  .delta { min-width: 46%; }
  .ending-hero { grid-template-columns: 1fr; }
  .portrait { min-height: 340px; }
  .ending-stats { grid-template-columns: repeat(3, 1fr); }
  .modal .ending-stats { grid-template-columns: repeat(2, 1fr); }
  .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .display { font-size: 56px; }
  .name-row { flex-direction: column; }
  .headline { font-size: 11px; }
  .banner-svg text { font-size: 22px; }
  .scene figcaption span:last-child { display: none; }
  .ending-stat b { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
