/* 화면 구성과 가독성: 기존 카드 그림·미니게임의 좌표는 유지합니다. */
@font-face {
  font-family: "Pretendard Variable";
  src: url("../assets/fonts/pretendard/PretendardVariable.woff2") format("woff2");
  font-style: normal; font-weight: 45 920; font-display: swap;
}
:root { --bg: #193b3e; --bg2: #10282d; --card: #fcfbf7; --ink: #263b3b; --muted: #667674; --accent: #28665c; --line: #e0e7e1; --gold: #dfbd86; }
html, body { height: auto; min-height: 100%; overflow-x: clip; }
body { min-height: 100svh; background: radial-gradient(ellipse at 15% 0%, #294d4e, transparent 65%), var(--bg2);
  font-family: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 15px; line-height: 1.6; letter-spacing: -.015em; -webkit-font-smoothing: antialiased; }
button, input { font-family: inherit; letter-spacing: inherit; }
b, strong { font-weight: 650; }
h1, h2, h3 { font-weight: 650; text-wrap: balance; }
.stage, .lifestats, .mg-time, .practice-score { font-variant-numeric: tabular-nums; }
button, input, summary { outline-offset: 4px; }
button:focus-visible, input:focus-visible, summary:focus-visible, .mg:focus-visible { outline: 3px solid #edbc6b; }
[hidden] { display: none !important; }
button.mini { padding: 0; background: transparent; color: inherit; text-align: left; }
#app { max-width: 520px; min-height: 100svh; padding: 0 16px calc(24px + var(--safe-b)); }
.eyebrow { display: block; color: #dfc9a3; font-size: 11px; font-weight: 600; letter-spacing: .1em; line-height: 1.7; }
.setup { padding: 28px 0; }
.setup h1 { text-align: left; font-size: clamp(34px, 8.8vw, 48px); font-weight: 650; line-height: 1.25; letter-spacing: -.04em; margin: 20px 0 18px; }
.setup h1 em { font-style: normal; color: #edc683; }
.setup .sub { text-align: left; color: #c6d7d4; font-size: 15px; line-height: 1.8; margin: 0; }
.journey-art { display: flex; align-items: end; gap: 10px; margin: 26px 0 20px; padding: 0 12px; }
.journey-art > div { flex: 1; min-width: 0; position: relative; background: #32544d; border: 1px solid #ffffff26; border-radius: 12px; overflow: hidden; padding: 9px 6px 0; transform: rotate(-4deg); box-shadow: 0 12px 24px #0002; }
.journey-art > div:nth-child(2) { transform: translateY(-10px); z-index: 1; background: #45584c; }
.journey-art > div:nth-child(3) { transform: rotate(4deg); background: #455348; }
.journey-art img { display: block; width: 100%; height: 144px; object-fit: contain; image-rendering: pixelated; }
.journey-art span { display: block; text-align: center; color: #354a42; background: #f5efdf; margin: 0 -6px; padding: 9px 0; font-size: 12px; font-weight: 500; }
.setup-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.setup-links button { background: #ffffff08; border: 1px solid #ffffff26; border-radius: 13px; color: #f2f1e9; padding: 16px 12px; font-size: 14px; font-weight: 500; text-align: left; }
.setup-links button span { display: block; color: #b8ccca; font-size: 12px; margin-top: 6px; }
.intro-note { font-size: 12px; color: #b7cac6; line-height: 1.7; margin: 16px 0 28px; }
.setup-form { background: var(--card); padding: 26px 22px; border-radius: 20px; color: var(--ink); border: 1px solid #ffffff70; box-shadow: 0 18px 48px #0002; }
.setup-form .eyebrow { color: #846539; }
.setup-form h2 { font-size: 25px; letter-spacing: -.035em; margin: 6px 0 10px; }
.form-note { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0; }
.setup-form label, .setup-form h3 { font-size: 14px; font-weight: 600; margin-top: 24px; }
.setup-form input { background: #fff; border: 1px solid #d5dfd9; color: var(--ink); padding: 13px 14px; font-size: 16px; border-radius: 11px; }
.setup-form input::placeholder { color: #7c8985; }
.setup-form .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.setup-form #spec { grid-template-columns: 1fr 1fr; }
.setup-form .chip { color: #50645f; background: #f0f3ef; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 500; padding: 12px 6px; }
.setup-form .chip small { color: #617160; font-size: 12px; line-height: 1.6; }
.setup-form .chip.on { background: #e5f0e9; color: #215748; border-color: #638f7c; box-shadow: inset 0 0 0 1px #638f7c; }
.setup-form .chip.on small { color: #456659; }
.setup-form .hint { color: #697565; grid-column: 1 / -1; }
.setup-form .big { border-radius: 12px; font-size: 16px; font-weight: 600; box-shadow: none; }
.setup-form .big:disabled { background: #d7dbd1; color: #606b60; box-shadow: none; cursor: default; }
.save-note { margin-top: 14px; text-align: center; font-size: 12px; }
.setup .bonus { padding: 12px; font-size: 12px; line-height: 1.7; border: 1px solid #d7b475; background: #ffffff08; border-radius: 8px; }
.top { padding: 18px 0 14px; background: #19383aeF; gap: 12px; backdrop-filter: blur(12px); }
.stage { font-size: 14px; line-height: 1.6; }
.stage small { color: #b8cdca; font-size: 12px; margin-top: 3px; }
.menu { background: #ffffff08; border: 1px solid #ffffff26; border-radius: 13px; flex-shrink: 0; font-size: 18px; }
.life { grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 8px; }
.life .mini .art { border-width: 1px; border-radius: 7px; }
.mini.empty { min-height: 96px; border: 1px dashed #729081; border-radius: 7px; color: #c0d2c1; line-height: 1.65; }
.lifestats { background: #ffffff07; border: 1px solid #ffffff1f; border-radius: 13px; padding: 10px; font-size: 12px; gap: 9px; }
.lifestats .row { gap: 3px 8px; }
.lifestats > .row:first-child { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 8px; }
.lifestats > .row:first-child > span { display: flex; justify-content: space-between; gap: 3px; white-space: nowrap; font-size: 12px; }
.lifestats .common { color: #bdcfcb; font-size: 12px; line-height: 1.6; }
.lifestats .bar { width: 30px; margin: 0 3px; height: 4px; }
.money { min-height: 36px; padding: 7px 10px; border-radius: 8px; font-size: 12px; font-weight: 550; }
.chapter { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin: 16px 0 2px; padding: 14px 0; border-top: 1px solid #ffffff21; }
.chapter .eyebrow { font-size: 11px; letter-spacing: .04em; }
.chapter p { margin: 4px 0 0; color: #c4d4cf; font-size: 12px; line-height: 1.7; }
.chapter button { flex-shrink: 0; color: #eee3cd; background: #ffffff08; border: 1px solid #ffffff26; border-radius: 11px; min-height: 44px; padding: 10px; font-size: 12px; }
.table { flex: none; padding: 0; margin: 0 0 14px; overflow: visible; }
.story-column { min-width: 0; }
.card3d { display: grid; min-height: 0; }
.face { position: relative; grid-area: 1 / 1; inset: auto; overflow: hidden; border: 1px solid #ffffff55; border-radius: 18px; box-shadow: 0 10px 30px #0002; }
.face.back:empty { min-height: 0; }
.banner, .banner.small { height: 188px; min-height: 0; border-radius: 17px 17px 0 0; }
.banner.small { height: 152px; }
.txt { padding: 22px; }
.txt h2 { font-size: 23px; font-weight: 650; letter-spacing: -.025em; line-height: 1.4; margin: 12px 0; }
.txt p { font-size: 16px; font-weight: 400; line-height: 1.85; margin: 8px 0 2px; word-break: keep-all; overflow-wrap: anywhere; color: #42534e; }
.tag { font-size: 11px; font-weight: 550; border-radius: 6px; padding: 4px 9px; background: #eaf0e9; color: #546c5d; }
.actions { gap: 8px; padding: 0; }
.choice-heading { color: #baccc6; font-size: 12px; padding: 4px 2px 6px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 16px 14px; border: 1px solid #dfe6df; border-radius: 13px; font-size: 15px; font-weight: 500; line-height: 1.6; box-shadow: 0 3px 12px #00000008; }
.option-body { flex: 1; min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.option-no { align-self: flex-start; flex-shrink: 0; color: #617b6f; background: #edf2ed; border-radius: 7px; min-width: 25px; text-align: center; font-size: 11px; line-height: 25px; font-variant-numeric: tabular-nums; }
.option-arrow { color: #81978c; font-size: 16px; }
.choice-hint { display: block; color: #85533c; font-size: 12px; font-weight: 400; margin-top: 6px; }
.actions .big { font-size: 16px; font-weight: 600; border-radius: 12px; box-shadow: none; }
.sheet { border: 1px solid #ffffff70; border-radius: 24px 24px 0 0; padding: 26px 22px calc(26px + var(--safe-b)); box-shadow: 0 -12px 60px #0002; }
.sheet h2 { font-size: 23px; letter-spacing: -.035em; }
.sheet p { line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
.sheet-close, .close { background: #e4e8dc; color: #344734; }
.menu-list button { font-size: 14px; border: 1px solid var(--line); box-shadow: none; }
.menu-list .danger { color: #a94235; }
.tag.ng { background: #b65443; }
.shop-item.off { opacity: 1; background: #f1f0e7; }
.shop-item .shop-price { display: block; margin-top: 6px; color: #856124; font-weight: 700; }
.shop-item button { font-size: 11px; min-width: 68px; }
.shop-item button:disabled { background: #dde0d5; color: #5d695d; }
.practice-sheet { max-width: 520px; }
.practice-sheet .eyebrow { color: #856124; }
.practice-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 20px 0; }
.practice-tabs button { background: #eff3ed; color: #4c6258; border: 1px solid transparent; border-radius: 11px; padding: 13px 4px; font-size: 14px; font-weight: 500; }
.practice-tabs button[aria-pressed="true"] { background: #e2eee5; border-color: #638f7c; color: #215748; box-shadow: inset 0 0 0 1px #638f7c; }
/* 추가 미니게임: 색과 글자를 함께 써서 신호를 구분합니다. */
.steal-field { background: linear-gradient(#173e35 45%, #42734d 45%); }
.steal-route { position: absolute; left: 15%; right: 15%; top: 68%; border-top: 14px solid #bc935e; }
.steal-base { position: absolute; top: 64%; padding: 6px; background: #fff7df; color: #213d32; border-radius: 3px; font-size: 12px; font-weight: 900; }
.steal-base.first { left: 10%; } .steal-base.second { right: 10%; }
.steal-runner { position: absolute; left: 18%; top: 55%; color: #ffd773; font-size: 32px; transition: left .7s ease-out; }
.steal-runner.running { left: 80%; }
.steal-signal { position: absolute; left: 6%; right: 6%; top: 15%; border: 2px solid #78988d; border-radius: 10px; padding: 16px 4px; font-size: 21px; font-weight: 900; background: #152f2b; }
.steal-signal.feint { color: #ffd184; border-color: #ffd184; }
.steal-signal.go { color: #163323; background: #b9ed9e; border-color: #b9ed9e; }
.mini-instruction { position: absolute; bottom: 14px; width: 100%; font-size: 12px; color: #e5ecd8; }
.throw-field { background: repeating-linear-gradient(110deg, #28563d 0 32px, #305f43 32px 64px); }
.throw-diamond { position: absolute; width: 58%; height: 58%; left: 21%; top: 21%; border: 2px solid #c1a974; transform: rotate(45deg); background: #aa885455; }
.throw-target { position: absolute; width: 46px; height: 46px; display: grid; place-items: center; transform: translate(-50%, -50%); background: #fff7db; color: #183e32; border: 3px solid #ffd16e; border-radius: 50%; font-weight: 900; box-shadow: 0 0 0 8px #ffd16e33; }
.throw-x, .throw-y { position: absolute; pointer-events: none; background: #ffd46a; }
.throw-x { top: 12%; bottom: 12%; width: 3px; transform: translateX(-50%); }
.throw-y { left: 12%; right: 12%; height: 3px; transform: translateY(-50%); }
.throw-x.locked { background: #a3e6cc; }
.throw-dot { position: absolute; width: 14px; height: 14px; border: 3px solid white; border-radius: 50%; transform: translate(-50%, -50%); }
.throw-ball { position: absolute; left: 50%; top: 95%; width: 26px; height: 26px; opacity: 0; transform: translate(-50%, -50%); transition: left .35s, top .35s, opacity .1s; }
.throw-ball.thrown { opacity: 1; } .throw-ball svg { width: 100%; }
.sign-field { background: radial-gradient(ellipse at top, #335271, #142437); padding: 20px 12px; }
.sign-display { min-height: 66px; display: grid; place-items: center; font-size: 21px; font-weight: 900; color: #ffe0a0; }
.sign-progress, .sign-slots { font-size: 12px; color: #dfe8ee; min-height: 22px; }
.sign-answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.sign-answers button { padding: 10px 2px; min-height: 58px; border-radius: 8px; background: #f1ead6; color: #203a44; font-size: 13px; font-weight: 800; touch-action: manipulation; }
.sign-answers small { display: block; opacity: .7; margin-bottom: 4px; }
.sign-answers button:disabled { opacity: .35; }
.sign-field .mg-big { top: 22%; font-size: 30px; background: #142437ed; padding: 8px 0; }
@media (prefers-reduced-motion: reduce) { .steal-runner, .throw-ball { transition: none; } }
.practice-instructions { padding: 24px 18px; border: 1px solid #e2e8dc; border-radius: 16px; text-align: center; background: #f1f5ee; }
.practice-icon { display: block; font-size: 36px; }
.practice-instructions p { margin: 8px 0; font-size: 14px; }
.practice-instructions small { color: #687760; font-size: 12px; }
.practice-score { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 18px; font-size: 11px; color: #58684c; }
.practice-last { padding: 12px; background: #e7eddb; border-left: 3px solid #647e4a; font-size: 12px; }
.practice-start { border-radius: 12px; font-size: 16px; font-weight: 600; margin-top: 20px; box-shadow: none; }
.practice-help { margin: 18px 0; font-size: 12px; color: #64705b; }
.practice-help p { margin: 8px 0; }
.mg-wrap { flex-direction: column; gap: 12px; padding: 12px 0; overflow-y: auto; }
.mg-wrap .mg { flex-shrink: 0; }
.mg { border: 1px solid #c0d7be66; background: linear-gradient(160deg, #1d443b, #15332e); border-radius: 22px; box-shadow: 0 20px 60px #0004; }
.mg-title { font-size: 23px; font-weight: 650; letter-spacing: -.02em; }
.mg-sub { line-height: 1.7; color: #c6dace; word-break: keep-all; overflow-wrap: anywhere; }
.mg-big { font-weight: 700; text-shadow: 0 2px 12px #0006; }
.mg-result { font-size: 14px; }
.practice-stop { background: #f9f5e9; color: #2d4232; border-radius: 7px; padding: 12px 20px; font-size: 13px; min-height: 44px; flex-shrink: 0; }
.big, .opt, .chip, .practice-tabs button, .setup-links button { transition: background-color .16s, border-color .16s, box-shadow .16s; }
.big:active, .opt:active { transform: translateY(1px); box-shadow: none; }
.sheet-close, .close, .practice-stop { border-radius: 12px; font-weight: 500; }
.sheet h2 { padding-right: 28px; line-height: 1.4; }
.fx { font-weight: 550; border-radius: 6px; }
.news, .note { border-radius: 10px; font-weight: 400; }
.ending .end-title { font-weight: 650; }
.ending-story { margin: 24px 0; }
.ending-story .eyebrow, .career-summary .eyebrow { color: #6b795c; text-align: center; }
.ending-story p { font-size: 16px; line-height: 1.9; word-break: keep-all; overflow-wrap: anywhere; color: #42534e; }
.ending-highlight { padding: 4px 14px; margin: 18px 0; background: #edf2eb; border-radius: 12px; }
.ending-highlight summary { font-size: 14px; font-weight: 550; }
.ending-highlight p { font-size: 14px; line-height: 1.8; }
.career-invite, .career-summary { padding: 20px; margin: 24px 0; border: 1px solid #d9e4d8; border-radius: 14px; background: #f0f5ed; }
.career-invite p { font-size: 14px; line-height: 1.8; color: #556951; }
.career-invite .big { margin: 16px 0 12px; border-radius: 12px; font-size: 15px; font-weight: 600; box-shadow: none; }
.career-invite > small { display: block; font-size: 12px; color: #677960; }
.career-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.career-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 16px 12px; border: 1px solid #dbe4da; border-radius: 13px; background: #fff; color: var(--ink); text-align: left; word-break: keep-all; overflow-wrap: anywhere; }
.career-icon { font-size: 24px; } .career-choice b { font-size: 15px; }
.career-choice small { font-size: 13px; color: #647463; line-height: 1.7; }
.career-choice em { font-style: normal; font-size: 11px; color: #536b46; background: #edf3e5; border-radius: 5px; padding: 3px 5px; }
.career-pick { margin-top: auto; padding-top: 8px; font-size: 12px; color: #28665c; font-weight: 600; }
.career-choice:hover { border-color: #638f7c; background: #f7faf4; }
.career-summary small { line-height: 1.9; font-size: 14px; word-break: keep-all; overflow-wrap: anywhere; }
.career-summary .eyebrow { text-align: left; margin-bottom: 9px; }
@media (max-width: 359px) { .career-grid { grid-template-columns: 1fr; } }
@media (hover: hover) {
  .opt:hover { background: #f2f7ef; border-color: #8da793; box-shadow: 0 4px 16px #0001; }
  .setup-links button:hover, .chapter button:hover { background: #ffffff16; }
}
@media (min-width: 850px) {
  #app.is-setup { max-width: 1060px; padding: 0 36px; }
  .setup { display: grid; grid-template-columns: 1fr 440px; align-items: center; gap: 60px; min-height: 100vh; padding: 40px 0; }
  .setup h1 { font-size: 48px; }
  .setup .sub { font-size: 15px; }
  .setup-form { padding: 30px; }
  .journey-art { margin: 40px 0 26px; }
  .journey-art img { height: 182px; }
  #app.is-game { max-width: 920px; display: grid; grid-template-columns: 244px minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 16px 28px; align-content: start; padding: 0 24px 36px; }
  .top { grid-column: 1 / -1; position: relative; border-bottom: 1px solid #476353; }
  .life { grid-column: 1; grid-row: 2; grid-template-columns: 1fr 1fr; gap: 14px; }
  .life .hero-mini { grid-column: 1; grid-row: 1; }
  .life .heroine-mini, .life .empty { grid-column: 2; grid-row: 1; }
  .life .lifestats { grid-column: 1 / -1; padding: 14px; font-size: 12px; gap: 12px; }
  .life .common { font-size: 11px; }
  .chapter { grid-column: 1; grid-row: 3; flex-direction: column; align-items: stretch; align-self: start; margin: 0; }
  .chapter button { margin-top: 8px; }
  .story-column { grid-column: 2; grid-row: 2 / 4; }
  .banner { height: 244px; }
  .txt { padding: 22px; }
  .opt { font-size: 15px; }
  .sheet { margin-bottom: 24px; border-radius: 24px; }
}
@media (max-width: 359px) {
  #app { padding-left: 10px; padding-right: 10px; }
  .life { grid-template-columns: 54px minmax(0, 1fr) 54px; gap: 6px; }
  .lifestats { padding: 7px 6px; font-size: 11px; }
  .lifestats > .row:first-child { gap: 5px; }
  .setup-form { padding: 18px 12px; }
  .setup-links button { font-size: 13px; }
  .txt { padding: 20px 16px; }
  .opt { padding: 14px 12px; gap: 9px; }
  .mini.empty { min-height: 81px; }
}
@media (max-height: 600px) {
  .mg-wrap { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .mg-big, .pf-mitt.pop { animation: none; }
  .mg-ball, .mg-ball span { animation: none; }
}
/* Short baseball-only picture inside the existing resolved-result interval. */
.baseball-art-host{position:relative}
.baseball-result-art{position:absolute;left:50%;top:50%;width:min(86%,240px);aspect-ratio:1354/1161;max-height:82%;transform:translate(-50%,-50%);z-index:9;border:2px solid #fff0c5;border-radius:12px;overflow:hidden;background:#173e36;pointer-events:none}
.baseball-result-art img{display:block;width:100%;height:100%;object-fit:contain}.baseball-result-art strong{position:absolute;left:6%;top:7%;max-width:88%;font-size:clamp(18px,4vw,26px);color:#fff5b3;text-shadow:1px 2px #153951,0 0 4px #153951;line-height:1.15}
html[data-reduced-motion="true"] .baseball-result-art{display:none}
.journal-entry { padding: 12px 16px; margin: 10px 0; border: 1px solid #37504c; border-radius: 12px; background: #ffffff05; }
.journal-entry p { margin: 0; line-height: 1.8; overflow-wrap: anywhere; }

/* Save transfer controls remain reachable on narrow phones. */
.save-modal .sheet { width: min(100%, 540px); overflow-wrap: anywhere; }
.save-modal button, .save-file { display: block; width: 100%; min-height: 48px; margin: 10px 0; }
.save-file input { display: block; max-width: 100%; margin-top: 8px; }
.save-preview:not(:empty) { border: 1px solid var(--line, #ccd3cc); border-radius: 12px; padding: 12px; }
#save-error { position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; right: 12px; z-index: 100; padding: 12px; border-radius: 12px; background: #722d25; color: white; pointer-events: none; }

.save-transition { position: fixed; inset: 0; z-index: 10000; }

.outcome { border-top: 1px solid #d6dfd8; margin-top: 16px; padding-top: 8px; }
.outcome h3 { font-size: 16px; }
.outcome-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 5px 0; }
.outcome-row small { display: block; font-size: 12px; }
.direct-effects { margin-top: 12px; }
.career-progress { padding: 12px; border-radius: 12px; background: #f0f3ec; overflow-wrap: anywhere; }
.mini-guide .sheet { width: min(100%, 520px); overflow-wrap: anywhere; }
.mini-guide button { display: block; width: 100%; min-height: 48px; margin-top: 12px; }
