:root {
  color-scheme: dark;
  --paper: #242638;
  --ink: #f3eee0;
  --gold: #ffd878;
  --status-height: calc(72px + env(safe-area-inset-top, 0px));
  --menu-height: calc(86px + env(safe-area-inset-bottom));
}
/* 번역문은 긴 단어도 줄바꿈하고 언어별 글꼴로 표시한다. */
html:not([lang="ko"]) body { font-family: system-ui, sans-serif; overflow-wrap: anywhere; }
html[lang="ja"] body { font-family: "Noto Sans JP", sans-serif; }
html[lang="zh-TW"] body { font-family: "Noto Sans TC", sans-serif; }
html[lang="th"] body { font-family: "Noto Sans Thai", sans-serif; }
html[lang="vi"] body { font-family: "Noto Sans", sans-serif; }
.translated-title { display: none; }
html:not([lang="ko"]) .title-logo:not([data-l10n="ok"]) { display: none; }
html:not([lang="ko"]) .title-logo[data-l10n="ok"] ~ .translated-title { display: none; }
html:not([lang="ko"]) .title-screen .translated-title { display: block; position: absolute; top: 10%; left: 5%; width: 90%; font-size: 36px; line-height: 1.15; text-shadow: 0 3px 8px #000; pointer-events: none; }
html:not([lang="ko"]) header strong { font-size: 14px; }
html:not([lang="ko"]) .battle-top { flex-wrap: wrap; }
html:not([lang="ko"]) .battle-top button { min-width: 0; white-space: normal; font-size: 13px; }
html:not([lang="ko"]) .story-text { overflow-wrap: anywhere; word-break: normal; }
html:not([lang="ko"]) .inn-scene { overflow-x: clip; }
html:not([lang="ko"]) #cards .portrait strong { font-size: 11px; }
html:not([lang="ko"]) .title-start, html:not([lang="ko"]) .depart-button,
html:not([lang="ko"]) .vs-screen > p { font-family: inherit; }
.title-screen {text-align:center;padding:28px 4px 48px}
.title-screen h1 {font-size:40px;color:var(--gold);margin:24px 0}
.title-mark {width:210px;
  height:210px;
  margin:30px auto;
  border-radius:50%;
  border:6px solid var(--gold);
  background:#b87846;
  display:grid;
  place-items:center;
  font-size:52px;
  font-weight:800;
  color:#242638}
.title-mark img {width:100%;height:100%;object-fit:contain}
.title-screen .primary {width:100%;margin-top:24px;font-size:20px}
.tutorial {padding:14px;
  margin:12px 0;
  border:2px solid var(--gold);
  border-radius:12px;
  background:#493b29;
  color:#fff0c2;
  font-size:16px}
.tutorial button {display:block;margin-top:10px}
#skill-guide {position:relative;margin:8px 0;text-align:center}
#share-panel {width:min(95vw,440px);
  max-height:94dvh;
  background:#242638;
  color:#f3eee0;
  border:2px solid #b87846;
  border-radius:16px;
  padding:16px}
#share-image {display:block;width:100%;height:auto}
#share-actions {display:flex;gap:8px;flex-wrap:wrap}
.guide-link {color:var(--gold);font-size:13px}
.orak-next {margin-top:20px}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #151723;
  color: var(--ink);
  font-family: "Apple SD Gothic Neo","Noto Sans KR","Malgun Gothic",system-ui,sans-serif;
}
main.orak-stage {
  max-width: 520px;
  min-height: 100dvh;
  margin: auto;
  padding: 14px 12px calc(18px + env(safe-area-inset-bottom));
  background: var(--paper);
}
header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}
header a {
  color: var(--gold);
  text-decoration: none;
}
header span {
  margin-left: auto;
  font-size: 12px;
  color: #b6b8c9;
}
#wallet {
  padding: 10px;
  background: #32354a;
  border-radius: 10px;
  font-size: 14px;
}
nav {
  display: flex;
  gap: 5px;
  margin: 12px 0;
  overflow-x: auto;
}
button {
  font: inherit;
  color: inherit;
  background: #41465f;
  border: 1px solid #626b89;
  border-radius: 9px;
  padding: 10px;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button.is-pressing {
  transform: scale(0.97);
}
button.primary {
  background: #665127;
  border-color: var(--gold);
}
h1 {
  font-size: 25px;
}
h2 {
  font-size: 19px;
}
p {
  line-height: 1.6;
}
.hint,
small {
  color: #c1c5d4;
  font-size: 12px;
}
small {
  display: block;
  margin: 4px 0;
}
.row {
  display: flex;
  gap: 9px;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #30344a;
  border-radius: 10px;
  margin: 8px 0;
}
.row > div {
  flex: 1;
}
.row button {
  flex-shrink: 0;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}
.stars {
  color: var(--gold);
}
.slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.slots button {
  font-size: 13px;
  min-height: 64px;
}
.battle-top {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.battle-top span {
  flex: 1;
}
.battle-top button {
  padding: 6px;
}
canvas {
  width: 100%;
  display: block;
  background: #202e3c;
  margin-top: 8px;
  border-radius: 12px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.portrait {
  padding: 8px 4px;
  font-size: 12px;
  min-width: 0;
}
.portrait strong {
  display: block;
}
.portrait small {
  font-size: 10px;
}
.bar {
  height: 6px;
  background: #191b28;
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0;
}
.bar i {
  display: block;
  height: 100%;
  background: #71db9c;
}
.bar.energy i {
  background: #83b9ff;
}
.ready {
  border-color: #ffd878;
  box-shadow: 0 0 12px #ffd87866;
  animation: glow 1s infinite alternate;
}
@keyframes glow {
  to {
    box-shadow: 0 0 20px #ffd878aa;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ready {
    animation: none;
  }
}
#cutin {
  min-height: 26px;
  margin: 5px 0;
  color: var(--gold);
  font-weight: 700;
  text-align: center;
}
dialog {
  max-width: 340px;
  width: 90%;
  background: #30344a;
  color: var(--ink);
  border: 1px solid var(--gold);
  border-radius: 16px;
}
dialog::backdrop {
  background: #0009;
}
[hidden] {
  display: none !important;
}
#notice {
  color: var(--gold);
  min-height: 26px;
}
#screen {
  padding-bottom: 8px;
}
.selected {
  border-color: var(--gold);
}

.locked {
  opacity: 0.45;
}
.portrait:disabled {
  opacity: 0.8;
}
html,
body {
  overscroll-behavior: none;
  touch-action: manipulation;
}
#fight {
  margin: 14px -8px 0;
}
#canvas {
  border: 1px solid #697181;
  border-radius: 14px;
}
.cards {
  gap: 6px;
  margin: 8px 5px;
}
.portrait {
  min-height: 148px;
  background: linear-gradient(#3e455e, #292d40);
}
.face {
  display: flex;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  margin: 0 auto 7px;
  align-items: center;
  justify-content: center;
  color: #19202d;
  font-size: 24px;
  font-weight: 800;
  border: 2px solid #fff5;
  overflow: hidden;
}
.face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portrait.down {
  filter: grayscale(1);
  opacity: 0.45;
}
.settings {
  display: flex;
  gap: 7px;
  margin: 16px 0;
}
.settings button {
  font-size: 12px;
  padding: 6px 12px;
}
body:has(#fight:not([hidden])) #wallet {
  font-size: 12px;
}
.result-stars {
  font-size: 42px;
  color: #ffd878;
}
.result-stars span {
  display: inline-block;
  animation: star-rise 0.4s both;
}
@keyframes star-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.5);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.bracket {
  list-style: none;
  padding: 0 0 0 12px;
}
.bracket li {
  position: relative;
  padding: 13px 10px;
  margin: 0 0 6px;
  border-left: 3px solid #53596d;
  background: #30344a;
  border-radius: 0 9px 9px 0;
  font-size: 14px;
}
.bracket li.current {
  border: 1px solid #ffd878;
  border-left: 4px solid #ffd878;
  background: #5a492c;
}
.bracket li.current:after {
  content: "이번 경기";
  float: right;
  font-size: 10px;
  color: #ffd878;
}
.bracket li.won {
  border-left-color: #71db9c;
}
.bracket li.won:before {
  content: "";
  position: absolute;
  left: -3px;
  top: 100%;
  height: 7px;
  width: 3px;
  background: #71db9c;
}
.raid {
  background: #8f2330;
  padding: 60px 20px;
  text-align: center;
  font: bold 36px serif;
  color: #ffe1bc;
  border-radius: 16px;
  animation: raid-in 0.4s;
}
@keyframes raid-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.gallery canvas {
  margin: 0;
}
.gallery small { display: block; }
.row > .face { flex-shrink: 0; margin: 0 10px 0 0; }
.slots .face { margin-bottom: 5px; }
.gallery small {
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  .result-stars span {
    animation-name: star-appear;
  }
  .raid {
    animation: none;
  }
}
@keyframes star-appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* 결과판도 전투 레이아웃을 유지하여 캔버스 크기를 보존한다. */
#fight.finished #cards, #fight.finished #cutin, #fight.finished > .hint { display: none; }
body.battling header, body.battling #wallet { display: none; }
body.battle-result { overflow-y: auto; }
body.battle-result main.orak-stage { height: auto; min-height: 100dvh; overflow: visible; }
body.battle-result #fight { flex: none; touch-action: pan-y; }
body.battle-result #canvas { flex: none; }
#cards { display: flex; }
#cards .portrait { flex: 1; }
#cards .bar { height: 8px; border: 1px solid #101320; box-sizing: border-box; }
#cards .face { width: 54px; height: 54px; }
body.battling {
  overflow: hidden;
}
body.battling #fight {
  touch-action: none;
}
#canvas {
  height: 50dvh;
}
body.battling main.orak-stage {
  padding-top: 4px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
body.battling header {
  padding: 4px 0;
}
body.battling #fight {
  margin-top: 8px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
body:not(:has(.inn-screen)) .settings,
body.battling .settings,
body.battling #notice,
body.battling .guide-link {
  display: none;
}
body.battling #canvas {
  flex: 1;
  min-height: 0;
  height: 0;
}
body.battling .battle-top,
body.battling #cards,
body.battling header,
body.battling #wallet {
  flex-shrink: 0;
}
body.battling #cutin {
  min-height: 22px;
  margin: 3px 0 0;
  font-size: 12px;
}
body.battling #fight > .hint {
  margin: 2px 5px 0;
  font-size: 11px;
}
body.battling #skill-guide {
  position: absolute;
  bottom: 180px;
  left: 8px;
  right: 8px;
}
@media (max-height: 680px) {
  body.battling .portrait { min-height: 118px; padding: 6px 3px; }
  body.battling .face { width: 38px; height: 38px; margin-bottom: 4px; }
  body.battling #cutin { min-height: 18px; }
  body.battling #skill-guide { bottom: 150px; }
}
body.storying {
  overflow: hidden;
}
#story {
  position: fixed;
  inset: 0;
  z-index: 20;
  max-width: 520px;
  margin: auto;
  padding: max(16px, calc(env(safe-area-inset-top, 0px) + 4px)) 16px calc(20px + env(safe-area-inset-bottom));
  background: #171d2b;
  display: flex;
  flex-direction: column;
}
.story-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--gold);
}
.story-top strong {
  font-size: 18px;
}
.story-top button {
  font-size: 12px;
}
#story-picture {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid #ffffff25;
  border-radius: 20px;
  margin: 16px 0;
  background: #10131c;
}
.story-frame { position: absolute; inset: 0; animation: story-enter .35s ease-out both; }
.story-art { width: 100%; height: 100%; object-fit: cover; animation: story-drift 8s linear .35s forwards; }
.story-backdrop { filter: blur(10px) brightness(.55); transform: scale(1.08); animation: none; }
.story-cutin { position: absolute; inset: 5% 0 0; width: 100%; height: 95%; object-fit: contain; }
.story-loader {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: #10131cf2; color: #ddd3bf; font-size: 14px;
}
.story-brush {
  width: 42px; height: 6px; background: #dcc18a;
  border-radius: 70% 20% 60% 10%; transform: rotate(-14deg);
  animation: story-brush 1.2s ease-in-out infinite;
}
.story-loading #story-dialogue, .story-loading #story-count { visibility: hidden; }
#story-dialogue button {
  width: 100%; min-height: 160px; padding: 18px 20px; text-align: left;
  background: #2c3046; border-color: #b59c65; line-height: 1.8;
}
#story-dialogue strong { display: flex; align-items: center; gap: 10px; color: var(--gold); margin-bottom: 10px; }
.story-speaker-face { width: 32px; height: 32px; object-fit: cover; border-radius: 50%; }
#story-dialogue .story-text { display: block; font-size: 18px; word-break: keep-all; min-height: 65px; }
.story-narration .story-text { font-style: italic; }
#story-count { margin: 10px 0 0; text-align: center; font-size: 12px; color: #dcc18a;
  animation: story-hint 1.2s ease-in-out infinite; }
@keyframes story-enter {
  from { opacity: 0; transform: scale(1.06); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes story-drift { from { transform: scale(1); } to { transform: scale(1.02); } }
@keyframes story-brush { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes story-hint { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .story-frame { animation-name: story-fade; }
  .story-art { animation: none; }
  .story-brush, #story-count { animation: none; }
}
@keyframes story-fade { from { opacity: 0; } to { opacity: 1; } }


.inn-screen { background: linear-gradient(#171c28a8, #171c28df), url("sprites/bg-inn.webp") center top / cover;
   border-radius: 14px;
   }

/* 폰 게임의 공통 상태 띠와 다섯 칸 메뉴는 화면 가장자리에 고정한다. */
main.orak-stage { position: relative; height: auto; overflow: visible; min-height: 100dvh;
  padding: calc(var(--status-height) + 8px) 12px calc(var(--menu-height) + 16px); }
main.orak-stage > header, .guide-link { display: none; }
#wallet { position: fixed; z-index: 12; top: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 520px); height: var(--status-height); border-radius: 0; display: flex; align-items: center;
  gap: 9px; padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px; background: linear-gradient(#2e201cef, #1d1511dc);
  border-bottom: 1px solid #b99656; box-shadow: 0 3px 15px #0005; }
#wallet .face { width: 46px; height: 46px; border: 2px solid #d3ad65; border-radius: 50%; }
.power-value small { margin: 0; color: #dfc99c; font-size: 10px; }
.power-value strong { font-size: 25px; color: #ffe5aa; line-height: 1.2; }
.wallet-resources { margin-left: auto; display: grid; gap: 2px; font-size: 13px; font-weight: 700; }
.wallet-resources > span { display: flex; align-items: center; gap: 6px; }
.wallet-resources .game-icon { width: 25px; height: 25px; font-size: 12px; }
.game-icon { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; }
.game-icon img { width: 100%; height: 100%; object-fit: contain; }
.wood-badge { border-radius: 50%; color: #ffe9b6; font-family: 'Gungsuh', "AppleMyungjo","Noto Serif KR", serif; font-weight: bold;
  background: radial-gradient(ellipse at 35% 28%, #a4773d, #4a2a18 75%);
  border: 2px solid #c89b52; box-shadow: inset 0 0 0 3px #38201477, 0 3px 5px #0006; }
#nav { position: fixed; z-index: 15; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 520px); margin: 0; padding: 8px 5px calc(8px + env(safe-area-inset-bottom));
  height: var(--menu-height); display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; overflow: visible;
  background: linear-gradient(#38271aef, #17110fff); border-top: 2px solid #b78a49; }
#nav .menu-item { position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 0; border: 0; border-radius: 6px; background: transparent; font-size: 11px; }
#nav .selected { background: #c49b4a22; color: #ffe6a9; }
.menu-item.tower-locked .game-icon { opacity: .38; filter: grayscale(.8); }
.menu-lock { position: absolute; top: 15px; font-size: 16px; font-style: normal; }
#hub-back { position: fixed; z-index: 16; top: calc(var(--status-height) + 8px);
  left: max(12px, calc((100vw - 520px) / 2 + 12px)); margin: 0; padding: 4px 9px; min-height: 32px;
  background: #30251be6; color: #ffe6b2; border-color: #98784b; font-size: 12px; }
#notice { position: fixed; z-index: 25; bottom: 90px; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 90vw; pointer-events: none; border-radius: 12px;
  background: #20160ee8; color: #ffe6b2; padding: 8px 12px; font-size: 12px; text-align: center; }
#notice:empty { display: none; }
.selected-stage { outline: 2px solid var(--gold); }
/* 키 아트 전체를 탭할 수 있고 장식은 입력을 가로채지 않는다. */
body.at-title main.orak-stage { padding: 0; }
.title-screen { position: relative; padding: 0; height: 100dvh; overflow: hidden;
  background: url('sprites/ui-title.webp') center / cover; text-align: center; }
.title-logo { position: absolute; width: 88%; left: 6%; top: 9%; height: auto;
  animation: logo-enter .6s ease-out both; pointer-events: none; }
.arcade-back { position: absolute; z-index: 3; top: max(14px, env(safe-area-inset-top)); left: 12px;
  color: #fff0cf; font-size: 12px; text-decoration: none; padding: 9px 12px;
  background: #211914b8; border: 1px solid #c4a27666; border-radius: 20px; }
.title-start { position: absolute; bottom: 13%; left: 10%; width: 80%; border: 0;
  background: transparent; text-shadow: 0 2px 5px #000, 0 0 10px #000; font-size: 23px;
  color: #fff0c7; font-family: 'Gungsuh', "AppleMyungjo","Noto Serif KR", serif; animation: start-blink 2.8s ease-in-out infinite; }
.title-reset { position: absolute; right: 15px; bottom: 25px; font-size: 12px;
  border-color: #d7bf8666; background: #24190daa; color: #e6d1a6; }
.title-petal { position: absolute; top: -5%; left: var(--x); width: 9px; height: 15px;
  border-radius: 80% 0 80% 0; background: #ffd3c2b3; pointer-events: none;
  animation: petal-fall var(--duration) var(--delay) linear infinite; }
@keyframes logo-enter { from { opacity: 0; transform: scale(1.15); } to { opacity: 1; transform: scale(1); } }
@keyframes start-blink { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes petal-fall { to { transform: translate(65px, 110dvh) rotate(310deg); } }
/* 객잔 바닥의 협객과 상자는 목록 없이 장면 위에서 직접 누른다. */
body:has(.inn-screen) main.orak-stage { padding: calc(var(--status-height) + 8px) 0 calc(var(--menu-height) + 16px);
  background: url('sprites/ui-inn.webp') center / cover; }
.inn-screen { background: none; border-radius: 0; }
.inn-scene { position: relative; height: calc(100dvh - 154px - env(safe-area-inset-top, 0px)); min-height: 460px; }
.inn-party { position: absolute; left: 0; right: 0; top: 50%; height: 33%; }
.inn-hero { position: absolute; width: 19%; height: 100%; padding: 0; border: 0;
  left: calc(7% + var(--slot) * 19%); top: calc((var(--slot) / 2) * 13%);
  background: transparent; overflow: visible; }
.inn-hero:nth-child(2n) { top: -20%; }
.inn-hero canvas { position: absolute; top: 14%; left: -20%; width: 200%; height: auto;
  display: block; pointer-events: none; background: transparent; }
.inn-hero > span { position: absolute; left: 50%; transform: translateX(-50%); bottom: -4%;
  font-size: 12px; color: #ffeac0; white-space: nowrap; pointer-events: none;
  text-shadow: 0 2px 4px #000; background: #2d1c1199; padding: 2px 8px; border-radius: 12px; }
.treasure-chest { position: absolute; top: 30%; right: 17%; width: 76px; height: 70px;
  display: grid; place-items: center; background: transparent; border: 0; padding: 0; z-index: 4; }
.treasure-chest .game-icon { width: 70px; height: 64px; border-radius: 12px 12px 6px 6px; }
.treasure-chest .wood-badge { font-size: 20px; border-width: 3px;
  background: linear-gradient(#8d622e 0 33%, #d0a054 34% 40%, #674018 41%); }
.chest-lid { position: absolute; top: 3px; width: 66px; height: 24px; border: 2px solid #e0b86b;
  border-radius: 9px 9px 0 0; background: linear-gradient(#ac7b3f, #5c361c); opacity: 0;
  transform-origin: 50% 100%; pointer-events: none; }
#chest-ad { position: absolute; top: calc(40% + 22px); right: 2%; width: 56%; display: flex; justify-content: center; z-index: 5; }
#chest-ad .orak-ad-btn { min-height: 40px; padding: 6px 10px; font-size: 13px; }
#chest-ad .orak-ad-done { color: #ffe3a0; text-shadow: 0 2px 4px #000; font-size: 12px; }
#chest-time { position: absolute; top: 40%; right: 5%; width: 47%; text-align: center;
  color: #ffe3a0; text-shadow: 0 2px 4px #000; font-size: 11px; }
.chest-ready { animation: chest-bounce 1.8s ease-in-out infinite; filter: drop-shadow(0 0 9px #ffcf67); }
.chest-opening { animation: chest-shake .5s ease-in-out; filter: drop-shadow(0 0 16px #ffd96a); }
.chest-opening .chest-lid { opacity: 1; animation: lid-open .5s .5s ease-out both; }
.depart-button { position: absolute; bottom: 5%; left: 7%; width: 86%; min-height: 64px;
  font: bold 20px Jua, 'Apple SD Gothic Neo', sans-serif; color: #ffecc6; border: 2px solid #d4a54c;
  border-radius: 12px 4px; background: linear-gradient(110deg, #533017, #8b5026, #422714);
  box-shadow: 0 4px 14px #0008, inset 0 0 0 3px #2a190e88; }
body:has(.inn-screen) .settings { position: absolute; top: 80px; right: 10px; margin: 0; opacity: .8; }
body:has(.inn-screen) .settings button { min-height: 30px; padding: 4px 8px; font-size: 10px; }
.reward-flight { position: fixed; z-index: 30; left: calc(50% + 35px); top: 38dvh;
  pointer-events: none; animation: reward-flight .8s ease-in both; }
.flight-iron { animation-delay: .08s; --target-y: -32dvh; }
.flight-silver { --target-y: -35dvh; }
@keyframes chest-bounce { 0%, 65%, 100% { transform: translateY(0); } 80% { transform: translateY(-9px); } }
@keyframes chest-shake { 25%, 75% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes lid-open { from { transform: rotateX(0); } to { transform: translateY(-20px) rotate(-25deg); } }
@keyframes reward-flight {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  20% { opacity: 1; transform: translate(-30px, -50px) scale(1); }
  100% { opacity: 0; transform: translate(95px, var(--target-y)) scale(.4); }
}
body.at-title #wallet, body.at-title #nav { display: none; }
/* 소리 단추는 시작 화면에서도 보인다(톱니 왼쪽) */
body.at-title .settings { display: flex; top: max(14px, env(safe-area-inset-top)); }
body.battling main.orak-stage { padding-top: 76px; }
body.battling #wallet { display: flex; }
@media (prefers-reduced-motion: reduce) {
  .title-logo, .title-start, .title-petal, .chest-ready, .chest-opening,
  .chest-opening .chest-lid, .reward-flight { animation: none; }
  .title-petal { display: none; }
  .chest-opening .chest-lid { transform: translateY(-20px) rotate(-25deg); }
}
/* 타이틀 아래의 밝은 그림을 눌러 읽기 쉬운 시작 글자를 만든다. */
.title-screen::after { content: ''; position: absolute; inset: 75% 0 0;
  background: linear-gradient(transparent, #100b09e8); pointer-events: none; }
.title-start { z-index: 2; font-size: 36.8px; font-weight: 900; line-height: 1.3;
  -webkit-text-stroke: 1.2px #20110b; paint-order: stroke fill;
  text-shadow: 2px 2px 0 #20110b, -2px -2px 0 #20110b, 0 4px 8px #000, 0 0 16px #000;
  animation: none; }
.title-reset { z-index: 2; }
/* 협객 몸 크기를 1.5배로 키워 바닥에 두 줄로 세운다. */
.inn-party { top: 0; height: 100%; }
.inn-hero { width: 50%; height: 254px; left: 0; top: calc(63% - 254px); z-index: 2; }
.inn-hero:nth-child(2n) { left: 50%; top: calc(63% - 254px); }
.inn-hero:nth-child(n+3) { top: calc(85% - 254px); z-index: 3; }
.inn-hero canvas { width: 220px; height: auto; left: calc(50% - 110px); top: 0; }
.inn-hero > span { bottom: -4px; }
/* 설정은 톱니 하나에서 열고 닫는 작은 판에 모은다. */
.settings, body:has(.inn-screen) .settings { position: fixed; z-index: 24; top: calc(var(--status-height) + 8px);
  right: max(10px, calc((100vw - 520px) / 2 + 10px)); margin: 0; opacity: 1; }
#settings-toggle, body:has(.inn-screen) #settings-toggle { width: 46px; height: 46px; border-radius: 14px;
  font-size: 26px; padding: 0; color: #ffe5aa; background: #302016e8; border: 1px solid #a6814a; }
#settings-panel { position: absolute; right: 0; top: 48px; width: 140px; padding: 10px;
  background: #251a13f5; border: 1px solid #bd9856; border-radius: 10px; box-shadow: 0 6px 20px #0008; }
#settings-panel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#settings-panel[hidden] { display: none; }
#settings-panel button:not(.orak-tool) { width: 100%; font-size: 14px; margin: 4px 0; }
/* 장 그림은 화면 폭에 맞춰 고정 비율로 펼치고 길 위 판을 눌러 출정한다. */
body:has(.map-screen) main.orak-stage { padding: calc(var(--status-height) + 8px) 0 calc(var(--menu-height) + 16px);
  overflow: hidden; }
body:has(.map-screen) .settings { display: none; }
.map-header { height: 48px; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding-left: 70px; color: #ffe8b4; background: #302015; border-bottom: 1px solid #bc9655; }
.map-header strong { font-size: 15px; }
.map-header button { padding: 0 6px; font-size: 28px; min-width: 32px; background: transparent; border: 0; }
.map-viewport { position: relative; height: calc(100dvh - var(--status-height) - var(--menu-height) - 72px);
  overflow-y: auto; overflow-x: hidden;
  background: #201b14; touch-action: pan-y; overscroll-behavior: contain; }
.chapter-map { position: relative; width: 100%; aspect-ratio: 2 / 3; margin: 180px 0;
  background-position: center; background-size: 100% 100%; }
.map-trails { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-trails line { stroke-width: 7; stroke-linecap: round; stroke-dasharray: 2 19; }
.trail-cleared { stroke: #ffd573; filter: drop-shadow(0 1px 2px #351b0e); }
.trail-locked { stroke: #d6c9a980; }
.map-node { position: absolute; transform: translate(-50%, -50%); width: 48px; height: 48px;
  min-height: 0; border: 2px solid #bd8c37; border-radius: 50%; padding: 0;
  background: radial-gradient(circle at 35% 25%, #ffe7a5, #ab6924); color: #25170d;
  box-shadow: 0 3px 7px #0009; display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 3; }
.map-node .node-number { font-size: 13px; font-weight: 900; line-height: 1.1; }
.map-node small { font-size: 10px; color: #633308; line-height: 1.3; }
.node-next { width: 58px; height: 58px; border: 3px solid #fff0ad;
  box-shadow: 0 0 18px #ffd469, 0 0 0 5px #ffc96140; animation: node-bounce 1.3s ease-in-out infinite; }
.node-locked { background: #4f453de0; border-color: #968778; color: #ded3c4; opacity: .68; }
.node-locked small { color: #ded3c4; }
.boss-node { width: 96px; height: 96px; border-width: 3px; }
.map-node canvas { width: 100%; height: 100%; border-radius: 50%; position: absolute; inset: 0; }
.map-node:has(canvas) .node-number, .map-node:has(canvas) small { position: relative; z-index: 1;
  background: #28170ce0; color: #ffe5a0; border-radius: 6px; padding: 1px 4px; }
.map-node:has(canvas) .node-number { margin-top: 60%; }
.map-mandu { position: absolute; width: 100px; height: auto; transform: translate(-50%, -90%);
  pointer-events: none; z-index: 4; }
.departure-card { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: 82px;
  width: min(100%, 520px); padding: 20px 20px 14px; border: 2px solid #caa259; border-radius: 22px 22px 0 0;
  color: #ffe9bd; background: linear-gradient(#3c2a1cf5, #21170ffc); box-shadow: 0 -8px 28px #0008;
  animation: card-rise .2s ease-out; }
.departure-card > strong { display: block; padding-right: 28px; font-size: 19px; }
.departure-card p { font-size: 13px; margin: 12px 0; }
.departure-card .power-short { color: #ff8c80; }
.card-close { position: absolute; top: 8px; right: 10px; padding: 0; width: 36px; background: transparent; }
.map-enemies { display: flex; gap: 14px; margin: 12px 0; }
.map-enemies > div { position: relative; width: 84px; text-align: center; }
.map-enemies canvas { width: 56px; height: 56px; border-radius: 50%; background: #dbc48a;
  border: 2px solid #bd9652; }
.map-enemies small { font-size: 10px; display: block; }
.map-enemies .game-icon { position: absolute; right: 0; top: 30px; width: 26px; height: 26px; }
.map-reward { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.map-reward .game-icon { width: 28px; height: 28px; }
.map-actions { display: flex; gap: 10px; margin-top: 12px; }
.map-actions button { flex: 1; }
.bracket-label { position: absolute; left: 50%; transform: translateX(-50%); font-size: 12px;
  color: #ffe7a2; background: #2d190de0; padding: 2px 12px; border-radius: 8px; }
.tournament-map { background-color: #26180c; }
.tournament-map { margin: 0; }
.bracket-winner { position: absolute; top: 32%; left: 50%; transform: translateX(-50%);
  padding: 3px 14px; border: 1px solid #b99154; border-radius: 6px;
  background: #35251ee8; color: #d9bc81; font-size: 12px; font-weight: 900; }
.bracket-winner.champion { background: linear-gradient(#fff0a8, #d8a234); color: #42250c;
  box-shadow: 0 0 14px #ffcc6770; }
.raid-label { position: absolute; top: 1%; left: 5%; color: #ffce92; font-size: 13px;
  background: #431b12e8; padding: 3px 9px; border-radius: 6px; }
.tournament-map .boss-node { width: 72px; height: 72px; }
.tournament-map .raid-node { border-color: #ff842e; background: radial-gradient(#ffd783, #a52f16);
  box-shadow: 0 0 0 3px #ffb12e60, 0 0 14px #ff531d; }
.tournament-map .raid-node.node-locked { background: #4f322be0; }
.tournament-map .map-trails .raid-trail { stroke-dasharray: 2 19; stroke-width: 7; }
.tournament-map::before { content: ''; position: absolute; inset: 0; background: #1c100d50; }
.tournament-map .map-trails line { stroke-dasharray: none; stroke-width: 5; }
.tournament-map .map-mandu { width: 80px; }
.tournament-map .map-node:not(.boss-node) { width: 56px; height: 56px; }
@keyframes node-bounce { 50% { transform: translate(-50%, calc(-50% - 5px)); } }
@keyframes card-rise { from { margin-bottom: -200px; } to { margin-bottom: 0; } }
/* 용봉대전은 북소리와 양쪽 대표의 그림으로 승부를 예고한다. */
.vs-screen { position: fixed; z-index: 21; inset: 0 auto 0 50%;
  transform: translateX(-50%); width: min(100%, 520px); overflow: hidden;
  background: linear-gradient(#110b0966, #110b09aa), url('sprites/ui-arena.webp') center / cover; }
.vs-word { position: absolute; top: 43%; left: 50%; transform: translate(-50%, -50%) rotate(-8deg);
  font: italic 900 58px Georgia, serif; color: #ffe596; -webkit-text-stroke: 2px #6d2710;
  text-shadow: 0 6px 0 #36150e, 0 0 25px #ffb146; z-index: 2; }
.vs-screen > p { position: absolute; top: 72%; width: 100%; margin: 0; text-align: center;
  font: bold 30px 'Gungsuh', serif; color: #ffe6b7; text-shadow: 0 3px 6px #000; }
.vs-names { position: absolute; top: 63%; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  text-align: center; font-size: 22px; font-weight: 900; color: #ffe5b3;
  -webkit-text-stroke: 3px #21130d; paint-order: stroke fill; text-shadow: 0 3px 4px #000; }
.vs-names span { min-width: 0; padding: 0 6px; line-height: 1.25; word-break: keep-all; }
.vs-fighter { position: absolute; top: 20%; height: 42%; width: 48%; }
.vs-fighter.ally { left: 0; animation: vs-left .4s ease-out both; }
.vs-fighter.opponent { right: 0; animation: vs-right .4s ease-out both; }
.vs-fighter img { width: 100%; height: 100%; object-fit: fill; object-position: center bottom;
  filter: drop-shadow(0 8px 10px #0008); }
.vs-fighter.opponent img { transform: scaleX(-1); }
@keyframes vs-left { from { translate: -100% 0; } to { translate: 0 0; } }
@keyframes vs-right { from { translate: 100% 0; } to { translate: 0 0; } }
/* 그림 카드 화면은 상태 띠와 메뉴 사이의 공간을 채운다. */
#screen.cards-screen { padding: 40px 0 0; }
.cards-screen h1 { font-size: 23px; margin: 12px 0 16px; color: #ffe5aa; }
body:has(.cards-screen) .settings { display: none; }
.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hero-tile { position: relative; display: flex; flex-direction: column; align-items: center;
  padding: 12px 8px; min-width: 0; border: 2px solid var(--element); border-radius: 16px;
  background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--element) 35%, #252234), #17151f 80%);
  box-shadow: inset 0 0 20px #0005, 0 5px 10px #0003; overflow: hidden; }
.hero-tile:disabled { opacity: 1; }
.card-sprite { width: 100%; height: 180px; object-fit: cover; object-position: left bottom; pointer-events: none; }
.hero-tile strong { font-size: 19px; }
.hero-tile small { font-size: 11px; margin-top: 4px; }
.silhouette { filter: brightness(0); opacity: .8; }
.stars { color: #ffda72; letter-spacing: 2px; }
.element-badge { position: absolute; top: 9px; left: 9px; width: 34px; height: 34px; object-fit: contain; z-index: 2; }
.hero-level { position: absolute; right: 10px; top: 12px; color: #fff1cf; z-index: 2; }
.red-dot, .has-alert::after { position: absolute; right: 5px; top: 4px; width: 10px; height: 10px;
  background: #ff4b50; border: 2px solid #ffd6ae; border-radius: 50%; box-shadow: 0 0 8px #f33; content: ''; }
.wallet-party { position: relative; padding: 0; min-height: 38px; border: 0; background: transparent; }
.wallet-party .game-icon { width: 30px; height: 30px; }
.power-value strong { font-size: 22px; }
.wallet-resources { font-size: 11px; }
.hero-showcase { position: relative; margin: 0 -12px; height: 330px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, var(--element), #252137 80%); touch-action: pan-y; }
.hero-demonstration { width: 100%; height: 270px; padding: 0; border: 0; background: transparent; }
.detail-cutin { height: 270px; width: 100%; object-fit: contain; }
.detail-action { display: none; height: 270px; object-fit: contain; }
.hero-demonstration:has(.demonstrating) .detail-cutin { display: none; }
.detail-action.demonstrating { display: block; }
.detail-caption { height: 60px; padding: 6px 0; background: #15111ed9; text-align: center; }
.hero-showcase .detail-caption h1 { margin: 0; font-size: 23px; line-height: 28px; }
.detail-caption p { margin: 3px 0 0; font-size: 12px; color: #ffe4b2; }
.detail-prev, .detail-next { position: absolute; top: 45%; background: #17141e88; font-size: 28px;
  width: 36px; padding: 0; border-color: #ffe3a155; }
.detail-prev { left: 9px; } .detail-next { right: 9px; }
.detail-power { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0 8px; }
.detail-power strong { font-size: 32px; color: #ffe0a0; }
.stat-bars { display: grid; gap: 5px; }
.stat-meter { position: relative; display: flex; align-items: center; gap: 8px; height: 27px;
  border-radius: 6px; overflow: hidden; background: linear-gradient(90deg, #987943 var(--fill), #332c3a var(--fill)); }
.stat-meter img { width: 25px; height: 25px; object-fit: contain; }
.stat-meter span { font-size: 12px; text-shadow: 0 1px 3px #000; }
.skill-name { display: block; color: #ffdb87; margin-top: 10px; }
.skill-desc { margin: 4px 0 10px; font-size: 11px; }
.upgrade-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.upgrade-button { width: 100%; padding: 5px 2px; display: flex; flex-direction: column; align-items: center;
  border-color: #b79154; background: linear-gradient(#4d3b30, #251b23); }
.upgrade-button img, .upgrade-button b { width: 35px; height: 35px; object-fit: contain; font-size: 30px; }
.upgrade-button small { font-size: 11px; }
.upgrade-cost { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 10px; }
.upgrade-cost img { width: 18px; height: 18px; object-fit: contain; }
.upgrade-tile.unavailable { opacity: .4; }
.upgrade-beam { position: absolute; inset: 0 18%; pointer-events: none;
  background: linear-gradient(90deg, transparent, #fff6a7cf, #fff, #fff6a7cf, transparent);
  animation: upgrade-light 1.6s ease-out forwards; mix-blend-mode: screen; }
.upgrade-gain { position: absolute; top: 58%; left: 0; width: 100%; text-align: center;
  color: #fff3a7; font-size: 19px; text-shadow: 0 2px 5px #462500; animation: gain-rise 1.6s ease-out forwards; }
@keyframes upgrade-light { 0% { opacity: 0; scale: .2 1; } 25% { opacity: .9; } 100% { opacity: 0; scale: 1.4 1; } }
@keyframes gain-rise { from { translate: 0 25px; opacity: 1; } to { translate: 0 -45px; opacity: 0; } }
.formation-field { position: relative; height: 240px; margin: 0 -12px 10px;
  background-position: center; background-size: cover; border-bottom: 2px solid #a08248; }
.formation-field::before { content: ''; position: absolute; inset: 0;
  background: linear-gradient(#20152511, #20152599); }
.formation-slot { position: absolute; width: 42%; height: 115px; background: transparent; border: 0; padding: 0; }
.formation-slot::before { content: ''; position: absolute; bottom: 17px; left: 10%; width: 80%; height: 28px;
  border: 2px solid #d3b477; border-radius: 50%; background: radial-gradient(#b29c6880, #382b2388); }
.formation-slot.empty::before { border-style: dashed; }
.slot-0 { left: 9%; top: 119px; } .slot-1 { right: 3%; top: 119px; }
.slot-2 { left: 9%; top: 3px; } .slot-3 { right: 3%; top: 6px; }
.formation-slot .card-sprite { position: absolute; bottom: 20px; left: 0; height: 95px; }
.formation-slot strong { position: absolute; bottom: 0; left: 0; width: 100%; text-shadow: 0 2px 3px #000; }
.formation-slot.empty strong { bottom: 18px; font-size: 35px; }
.row-label { position: absolute; left: 6px; writing-mode: vertical-rl; padding: 6px 3px;
  background: #21182bcb; border-left: 2px solid #c7a770; color: #ffecbe; font-size: 11px; }
.row-label.back { top: 48px; } .row-label.front { top: 164px; }
.auto-party { width: 100%; }
.formation-hint { font-size: 12px; text-align: center; margin: 8px 0 2px; }
.face-strip, .album-strip { display: flex; gap: 10px; overflow-x: auto; padding: 6px 0 12px; touch-action: pan-x; }
.face-tile { position: relative; flex: 0 0 110px; min-width: 0; height: 140px; padding: 20px 6px 6px;
  border: 2px solid var(--element);
  background: linear-gradient(#46404d, #211a28); display: flex; flex-direction: column; align-items: center; }
.face-tile:disabled { opacity: .7; } .face-tile.selected { box-shadow: inset 0 0 15px #ffd76966; opacity: 1; }
.face-portrait { width: 76px; height: 76px; object-fit: cover; border-radius: 50%; }
.face-tile .element-badge { width: 24px; height: 24px; left: 3px; top: 3px; }
.face-tile .hero-level { font-size: 10px; top: 5px; right: 5px; }
.face-tile strong { font-size: 13px; margin-top: 4px; }
.affinity { display: flex; gap: 4px; min-height: 14px; font-size: 10px; }
.favorable { color: #8fe0a3; } .unfavorable { color: #ff9393; }
.training-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.training-card { position: relative; min-height: 150px; display: flex; flex-direction: column; justify-content: end;
  gap: 5px; padding: 12px 8px; background: radial-gradient(var(--element), #242638);
  background-position: center; background-size: cover; border: 2px solid var(--element); border-radius: 14px;
  overflow: hidden; text-shadow: 0 2px 5px #000; }
.training-card::before { content: ''; position: absolute; inset: 45% 0 0;
  background: linear-gradient(transparent, #15111ee8); }
.training-card strong, .training-card small { position: relative; z-index: 1; }
.training-card strong { font-size: 16px; } .training-card small { font-size: 10px; }
.training-card.open { grid-column: 1 / -1; min-height: 240px; }
.training-card.locked { filter: grayscale(.8); opacity: .45; }
.training-actors { position: absolute; inset: 20px 0 40px; display: flex; justify-content: center; }
.training-actors .card-sprite { min-width: 0; width: 50%; height: 100%; }
.training-rewards { display: flex; gap: 12px; justify-content: center; padding: 12px; }
.training-reward { position: relative; width: 65px; text-align: center; }
.training-reward img { width: 60px; height: 60px; object-fit: contain; }
.training-reward .flying-scroll { position: absolute; left: 12px; top: 0; width: 35px;
  animation: scroll-flight 1s ease-out forwards; }
@keyframes scroll-flight { from { translate: 0 -130px; opacity: 1; } to { translate: 0 20px; opacity: 0; } }
body:has(.cards-screen.map-screen) main.orak-stage {
  padding: calc(var(--status-height) + 8px) 12px calc(var(--menu-height) + 16px); overflow: visible; }
.tower-scene { position: relative; height: 440px; margin: 0 -12px;
  background-size: cover; background-position: center; }
.tower-scene::before { content: ''; position: absolute; inset: 0; background: #10102133; }
.tower-platform { position: absolute; transform: translate(-50%, -50%); width: 65px; min-height: 32px;
  padding: 3px; border-radius: 50%; background: #363145e8; border: 2px solid #82758f; font-size: 12px; }
.tower-platform.cleared { color: #ffe6a5; background: #765b25e8; border-color: #f2c668; }
.tower-platform.next { box-shadow: 0 0 20px #ffe4a8; border-color: #fff0b0; animation: node-glow 1.5s infinite; }
.tower-platform.boss { border-color: #df8674; }
.tower-platform canvas { width: 35px; height: 35px; display: block; margin: -22px auto 0; }
.tower-platform:disabled { opacity: .7; }
.tower-controls { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
.tower-controls button { padding: 5px 18px; min-height: 34px; }
.tower-challenge { width: 100%; font-size: 17px; }
.tower-scene.locked { background-blend-mode: luminosity; background-color: #252535; opacity: 1; }
.tower-scene.locked::before { background: #161526a0; backdrop-filter: blur(3px); }
.tower-lock { position: absolute; top: 33%; width: 100%; text-align: center; font-size: 70px; }
.tower-lock-message { position: absolute; top: 57%; width: 100%; text-align: center; color: #ffe5aa; }
.album-heading { font-size: 15px; color: #e8c58b; margin: 18px 0 4px; }
.album-card { flex: 0 0 210px; padding: 0; overflow: hidden; background: #271f2c; border-color: #987b4f; }
.album-card > img { width: 210px; height: 120px; object-fit: cover; display: block; }
.album-card > strong { display: block; padding: 9px; font-size: 12px; text-align: left; }
.album-card.locked img { filter: blur(3px) grayscale(1); opacity: .35; }
.album-card:disabled { opacity: .8; }
body.battling #wallet, body.in-versus #wallet, body.in-versus #nav { display: none; }
body.battling main.orak-stage { padding-top: env(safe-area-inset-top, 0px); }
@media (prefers-reduced-motion: reduce) {
  .tower-platform.next, .vs-fighter { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .map-node, .departure-card, .vs-screen img { animation: none; }
}
/* 지도 협객의 투명 캔버스에는 공통 전장 배경색을 적용하지 않는다. */
.map-mandu, .map-node canvas { background: transparent; border: 0; border-radius: 0; }
.map-node canvas { border-radius: 50%; }
.map-node:disabled { opacity: .68; }
/* 타이틀 바탕의 입력 영역은 다른 화면 버튼의 누름 모양과 분리한다. */
.title-touch { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; }
.title-logo { z-index: 1; }
/* 다음 도전 판은 가까운 잠긴 판보다 위에서 터치를 받는다. */
.node-next { z-index: 6; }
/* 전투 조작은 두루마리와 세 개의 원형 단추로 구성한다. */
.battle-top { align-items: center; gap: 8px; padding: 5px 2px; }
.battle-top #wave { display: flex; align-items: center; gap: 8px; margin-right: auto;
  padding: 10px 13px; border: 1px solid #b58c52; border-radius: 16px 5px;
  background: linear-gradient(90deg, #50311c, #b28b4c 7%, #dbc18a 13%, #c9a467 87%, #50311c);
  color: #392515; box-shadow: 0 3px 5px #0008; }
#wave i { width: 9px; height: 9px; border: 1px solid #8c6d49; border-radius: 50%; background: #987b5680; }
#wave i.past { background: #e9b947; border-color: #a77625; }
#wave i.current { width: 13px; height: 13px; background: #fff1c1; border: 2px solid #7b4c23;
  box-shadow: 0 0 6px #fff1b5, 0 0 12px #ffd35b; }
#wave small { margin-left: 3px; font-size: 14px; font-weight: 700; color: #3a2410; }
.battle-top button { position: relative; width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 2px solid #b7955b; border-radius: 50%; font: bold 19px Georgia, serif;
  color: #ffe5a0; background: radial-gradient(at 35% 25%, #65492c, #22180f); }
#auto { font-size: 32px; }
#auto.locked::after { content: '🔒'; position: absolute; right: -3px; bottom: -3px; font-size: 13px; }
#auto.ready, .result-main.ready { box-shadow: 0 0 18px #ffd96a, inset 0 0 12px #ffdf8580; }
/* 멈춘 전장 위에 결과를 한 화면으로 띄운다. */
body.battling.battle-result { overflow: hidden; }
body.battling.battle-result main.orak-stage { height: 100dvh; min-height: 0; overflow: hidden; padding: 0; }
body.battling.battle-result #wallet, body.battling.battle-result #nav { display: none; }
body.battling.battle-result #fight { flex: 1; margin: 0; touch-action: none; }
body.battling.battle-result #canvas { flex: 1; height: 0; }
#fight.finished .battle-top, #fight.finished #cards, #fight.finished #cutin,
#fight.finished > .hint { visibility: hidden; }
.result-next { width: 100%; margin-top: auto; display: flex; justify-content: space-around; gap: 8px; }
.result-next .orak-next-title { display: none; }
.result-next .orak-next-card { display: flex; flex: 1; min-width: 0; flex-direction: column;
  gap: 4px; padding: 3px; background: transparent; border: 0; margin: 0; text-decoration: none; }
.result-next .orak-next-icon { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 14px; }
.result-next .orak-next-icon img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.result-next .orak-next-text { min-width: 0; flex: none; text-align: center; }
.result-next .orak-next-text strong { display: block; max-width: 90px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #ccb992; }
.result-next .orak-next-sub, .result-next .orak-next-arrow { display: none; }
/* 결과·이야기에서도 홈 단추는 한 줄을 차지해 그림과 조작을 가리지 않는다. */
.story-top > .orak-home-button { order: -1; }
.battle-top { margin-left: 8px; margin-right: 8px;
  padding-left: max(2px, env(safe-area-inset-left, 0px));
  padding-right: max(2px, env(safe-area-inset-right, 0px)); }
.battle-top #wave { min-width: 0; gap: 4px; padding-left: 8px; padding-right: 8px; overflow: hidden; }
.battle-top > button { flex-shrink: 0; }
.result-panel > .orak-home-button { align-self: flex-start; }

/* 대결 소개는 fixed 덮개라 그 안에 홈 단추를 넣어야 가려지지 않는다. */
.vs-screen > .orak-home-button { position: absolute; z-index: 1;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: max(12px, env(safe-area-inset-left, 0px)); }
#story-skip-slot button{white-space:nowrap}

/* Star rewards and the shared record book reserve space outside the scrolling map. */
#nav { grid-template-columns:repeat(6,minmax(0,1fr)); }
#nav .menu-item { min-width:44px; min-height:44px; }
#nav .menu-item > span:last-child { max-width:100%; overflow-wrap:normal; word-break:normal; hyphens:auto; }
#nav .game-icon { width:38px; height:38px; }
.star-bar { display:flex; align-items:center; justify-content:space-around; gap:4px; padding:4px 8px; min-height:60px; background:#30251b; color:#ffe1a0; }
.star-bar strong { white-space:nowrap; font-size:14px; }
.star-chest { display:flex; align-items:center; gap:2px; padding:3px; min-width:60px; min-height:48px; font-size:12px; }
.star-chest .game-icon { width:27px; height:27px; }
.star-chest.ready { box-shadow:0 0 10px #ffd86c; border-color:#ffe6a2; }
.star-chest.opened { opacity:.7; }
.map-screen:has(.star-bar) .map-viewport { height:calc(100dvh - var(--status-height) - var(--menu-height) - 140px); }
.star-reward { width:min(320px,90vw); padding:20px; color:#ffe6b0; background:#30251b; border:2px solid #b78a49; border-radius:12px; }
.star-reward::backdrop { background:#0009; }
.title-stamp { border:2px solid #bb7657; padding:10px; color:#ffd089; }
.weekly-rule, #tower-rule-hud { display:block; padding:8px; margin:0; background:#473122; color:#ffe6a9; text-align:center; font-size:12px; }
#tower-rule-hud[hidden] { display:none; }
.tower-week { margin:6px 0; text-align:center; }
#screen .osc-label { word-break:normal; overflow-wrap:normal; hyphens:auto; }
.map-header button, #hub-back, .card-close, .tower-controls button, .tower-platform { min-width:44px; min-height:44px; }

#screen .osc-header { position:static; height:auto; background:none; }

#nav .menu-item > span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#screen .osc-title, #screen .osc-sub { overflow-wrap:normal; word-break:normal; hyphens:auto; }

/* Seven hub entries retain a 44px target at 360px. */
#nav { grid-template-columns:repeat(7,minmax(0,1fr)); }
#nav .menu-item { padding-inline:1px; font-size:10px; }
.duel-screen { margin:12px auto; padding:16px; max-width:480px; background:#261e17ed; border:1px solid #b99a60; border-radius:12px; color:#ffe6b5; text-align:center; overflow-wrap:normal; word-break:normal; hyphens:auto; }
.duel-screen h1 { font-size:24px; margin:8px 0; }
.duel-screen p { margin:14px 0; }
.duel-screen button { min-height:44px; min-width:80px; margin:6px; }
.duel-opponents { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; }
.duel-opponents figure { margin:0; min-width:0; }
.duel-opponents img { width:100%; aspect-ratio:1; object-fit:contain; }
.duel-opponents figcaption { font-size:11px; }

#nav [data-menu="duel"] > span:last-child { white-space:normal; word-break:keep-all; line-height:12px; }

.duel-opponents figcaption { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.battle-tools{display:flex;justify-content:flex-end;gap:6px;flex-shrink:0;padding:2px 8px}.wallet-party{min-width:44px;min-height:44px}

html:not([lang="ko"]) #nav button{white-space:normal;text-overflow:clip;overflow:visible;overflow-wrap:anywhere;font-size:10px;line-height:1.15;min-width:0;padding-inline:1px}

html:not([lang="ko"]) #nav .menu-item>span:last-child{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.4;min-height:28px;font-size:10px}
/* 전투 중 소리·진동: 전장 그림 오른쪽 위에 얹는다(한 줄을 따로 쓰지 않게) */
.battle-tools{position:absolute;right:8px;top:0;z-index:3;padding:0}
#fight{position:relative}
.battle-tools button{opacity:.92;box-shadow:0 2px 8px #0006}
/* 비무 상대 이름: 말줄임 대신 두 줄까지 (문파 · 이름) */
.duel-opponents figcaption { white-space:normal; overflow:visible; text-overflow:clip; font-size:10px; line-height:1.2; word-break:keep-all; text-align:center; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:2.4em; }

/* ===== 3.0 전투 화면 (시안 battle-v1): 나무 현판·원형 나무 단추·죽간 패·두루마리 안내 ===== */
body.battling main.orak-stage { padding-left: 0; padding-right: 0; }
body.battling #fight { margin: 0; background: linear-gradient(#2a1a10, #1c120b); }
body.battling .battle-top { gap: 6px; padding: 6px 8px 6px; background: linear-gradient(#3b2617, #24170e);
  box-shadow: 0 2px 0 #c9993f55, 0 4px 8px #000a; position: relative; z-index: 2; flex-wrap: nowrap; }
.battle-top button, .battle-top .orak-home-button { flex: none; width: 46px; height: 46px; min-height: 46px; min-width: 0;
  padding: 0; border: 0; border-radius: 50%; box-shadow: 0 3px 4px #0009;
  background: url(sprites/ui-hud-btn.webp) center / contain no-repeat; color: #ffe7a8;
  font: 400 20px Jua, Georgia, serif; text-shadow: 0 2px 0 #2a1608; }
.battle-top .orak-home-button { display: grid; place-items: center; font-size: 0;
  background: url(sprites/ui-hud-ico-home.webp) center / 56% no-repeat, url(sprites/ui-hud-btn.webp) center / contain no-repeat; }
.battle-top .orak-home-button > * { display: none; }
#auto { font-size: 0; background: url(sprites/ui-hud-ico-auto.webp) center / 34% no-repeat, url(sprites/ui-hud-btn.webp) center / contain no-repeat; }
#retreat { font-size: 0; background: url(sprites/ui-hud-ico-flag.webp) center / 50% no-repeat, url(sprites/ui-hud-btn.webp) center / contain no-repeat; }
#auto.locked { filter: grayscale(.7) brightness(.8); }
#auto.ready { box-shadow: 0 0 14px #ffd96a, 0 3px 4px #0009; }
.battle-top #wave { flex: 1; min-width: 0; height: 44px; margin: 0; padding: 0 30px; gap: 8px; justify-content: center;
  border: 0; border-radius: 0; box-shadow: none; color: #ffe9b8;
  background: url(sprites/ui-hud-plaque.webp) center / 100% 100% no-repeat; }
#wave .wave-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 16px Jua, 'Apple SD Gothic Neo', sans-serif; letter-spacing: .5px; text-shadow: 0 2px 0 #1d0f06; }
#wave .wave-dots { display: flex; gap: 3px; flex: none; }
#wave .wave-dots i { width: 11px; height: 11px; border-radius: 50%; border: 1px solid #f3d27d; background: #2b190c; }
#wave .wave-dots i.past { background: radial-gradient(circle at 35% 30%, #fff3b8, #e5ac2e 60%, #9a6714); }
#wave .wave-dots i.current { width: 11px; height: 11px; border: 1px solid #fff1bf; box-shadow: 0 0 6px #ffd35b;
  background: radial-gradient(circle at 35% 30%, #fff9df, #f7cf5c 60%, #b47a1c); animation: wave-dot 1.2s ease-in-out infinite; }
@keyframes wave-dot { 50% { box-shadow: 0 0 12px #ffe07a; } }
body.battling #canvas { border-radius: 0; border: 0; box-shadow: none; }
body.battling .battle-tools { right: 8px; }
/* 카드 판: 어두운 나무 판 위 죽간 패 넷 */
.card-deck { position: relative; flex-shrink: 0; padding: 18px 6px 4px;
  background: url(sprites/ui-hud-panel.webp) center / 100% 100% no-repeat, #24160d; }
body.battling #cards { gap: 6px; padding: 0; }
body.battling #cards .portrait { position: relative; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  min-height: 0; height: clamp(140px, 22dvh, 190px); justify-content: center; aspect-ratio: auto; padding: 0 1px; box-sizing: border-box; overflow: visible; container-type: inline-size;
  border-style: solid; border-width: 20px 9px 26px; border-radius: 0; box-shadow: none; background: none;
  border-image: url(sprites/ui-hud-card.webp) 80 40 100 40 fill stretch; color: #3b2412; transition: transform .12s, filter .12s; }
#cards .card-art { display: block; flex: 0 1 auto; min-height: 0; width: 100%; aspect-ratio: 1 / .95; margin-top: 2px; overflow: hidden; border-radius: 3px; }
#cards .card-art img { width: 112%; margin-left: -6%; height: 100%; object-fit: cover; object-position: 50% 0; display: block; }
#cards .portrait strong { margin: 3px 0 4px; text-align: center; font: 400 clamp(15px, 26cqw, 20px) Jua, 'Apple SD Gothic Neo', sans-serif; color: #3b2412; line-height: 1.1;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#cards .bar { width: 100%; border: 1px solid #5a3a1a; border-radius: 4px; background: #3a2413; box-sizing: border-box; overflow: hidden; }
#cards .bar.hp { display: none; }
#cards .bar.hp i { background: linear-gradient(#9fe07a, #4f9d35); }
#cards .bar.energy { height: 12px; border-radius: 6px; border: 2px solid #6b4520; }
#cards .bar.energy i { background: linear-gradient(#fff2a8, #f1bf2e 55%, #b57d14); }
#cards .bar i { display: block; height: 100%; }
#cards .portrait.ready { filter: drop-shadow(0 0 6px #ffd84f) drop-shadow(0 0 12px #ffb92e); animation: card-ready 1s ease-in-out infinite; }
#cards .portrait.combo-ready { filter: drop-shadow(0 0 8px #fff07a) drop-shadow(0 0 18px #ffcf2e); transform: translateY(-6px); }
#cards .portrait.combo-source { filter: drop-shadow(0 0 6px #ff9f3a); }
#cards .portrait.down { filter: grayscale(1) brightness(.6); }
#cards .portrait:disabled { opacity: 1; }
#cards .portrait:active:not(:disabled) { transform: translateY(2px) scale(.97); }
@keyframes card-ready { 50% { transform: translateY(-3px); } }
#combo-tag { position: absolute; z-index: 3; left: 50%; top: -14px; transform: translateX(-50%); margin: 0;
  width: 150px; height: 42px; display: grid; place-items: center; pointer-events: none;
  background: url(sprites/ui-hud-tag.webp) center / 100% 100% no-repeat; animation: combo-tag .5s ease-in-out infinite alternate; }
#combo-tag span { font: 400 18px Jua, 'Apple SD Gothic Neo', sans-serif; color: #fff1c2; text-shadow: 0 2px 0 #4b0d0d; margin-top: -2px; }
#combo-tag i { position: absolute; left: 22%; right: 22%; bottom: 4px; height: 3px; border-radius: 2px; background: #ffe48a;
  transform-origin: left; transform: scaleX(var(--left, 1)); }
@keyframes combo-tag { to { transform: translateX(-50%) scale(1.06); } }
/* 아래 두루마리 안내 */
body.battling #fight > .hint { flex-shrink: 0; margin: 0; padding: 12px 12% 0; height: 66px; box-sizing: border-box; display: grid; place-items: start center;
  background: url(sprites/ui-hud-scroll.webp) center / 100% 100% no-repeat, #24160d; color: #3b2412;
  font: 400 19px Jua, 'Apple SD Gothic Neo', sans-serif; text-align: center; line-height: 1.15; }
body.battling #fight > .hint[data-kind='break'] { color: #8d1018; animation: hint-alert .4s ease-in-out infinite alternate; }
@keyframes hint-alert { to { filter: brightness(1.15); } }
body.battling #cutin { display: none; }
@media (max-height: 700px) {
  body.battling #cards .portrait { height: clamp(120px, 23dvh, 150px); }
  body.battling #fight > .hint { height: 48px; padding-top: 8px; font-size: 15px; }
  .card-deck { padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  #cards .portrait.ready, #combo-tag, #wave .wave-dots i.current, body.battling #fight > .hint[data-kind='break'] { animation: none; }
}

/* 위 줄 홈·소리·진동도 둥근 나무 단추로(공통 단추 모양을 이 화면에서만 덮음) */
body.battling .battle-top a.orak-home-button:not(.btn) { width: 46px !important; min-width: 46px !important; padding: 0 !important;
  border: 0 !important; border-radius: 50% !important; font-size: 0 !important; box-shadow: 0 3px 4px #0009 !important;
  background: url(sprites/ui-hud-ico-home.webp) center / 56% no-repeat, url(sprites/ui-hud-btn.webp) center / contain no-repeat !important; }
body.battling .battle-top a.orak-home-button:not(.btn) > * { display: none !important; }
body.battling .battle-tools button.orak-tool { width: 40px !important; min-width: 40px !important; height: 40px !important; min-height: 40px !important;
  border: 0 !important; border-radius: 50% !important; color: #ffe7a8 !important; opacity: .95;
  background: url(sprites/ui-hud-btn.webp) center / contain no-repeat !important; }
body.battling .battle-tools button.orak-tool .orak-tool-state { display: none !important; }
body.battling .battle-tools button.orak-tool svg { width: 18px !important; height: 18px !important; }
body.battling .battle-tools button.orak-tool.is-off { filter: grayscale(.6) brightness(.8); }
.battle-top #wave { padding: 0 7% 0 8%; gap: 5px; }
#wave .wave-dots i, #wave .wave-dots i.current { width: 8px; height: 8px; }
.battle-top button { width: 38px; height: 38px; min-height: 38px; }
body.battling .battle-top a.orak-home-button:not(.btn) { width: 38px !important; min-width: 38px !important; height: 38px !important; min-height: 38px !important; }
body.battling .battle-top { gap: 4px; }
#wave .wave-label { font-size: 16px; text-overflow: clip; }

/* 전투 중 도전 과제 알림은 위쪽(현판 아래)에 띄워 카드·안내를 가리지 않는다 */
body.battling .osc-toast { top: calc(116px + env(safe-area-inset-top)) !important; bottom: auto !important; }
/* 전투 중에는 화면 높이를 고정해 전장이 남는 높이만 쓰게(360x640에서 아래 안내가 밀려나지 않게) */
body.battling:not(.battle-result) main.orak-stage { height: 100dvh; min-height: 0; overflow: hidden; }

/* ===== 3.0 결과 화면 (result-v1 · lose-v1 시안) ===== */
#fight .result-panel { position: fixed; inset: 0; z-index: 20; width: min(100%, 520px); height: 100dvh;
  margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px; overflow: hidden auto;
  background: radial-gradient(ellipse 120% 90% at 50% 40%, #0000 40%, #1a120c99 100%), linear-gradient(#0000 55%, #20160e80);
  border: 0; border-radius: 0; font-family: Jua, 'Apple SD Gothic Neo', sans-serif; }
#fight .result-panel[data-outcome='lose'] { background: radial-gradient(ellipse 120% 90% at 50% 40%, #2a1a2a40 30%, #140c14c0 100%); }
.result-panel > .orak-home-button { position: absolute; left: 12px; top: max(10px, env(safe-area-inset-top)); z-index: 3; }
.result-head { width: 100%; display: flex; flex-direction: column; align-items: center; flex: none; }
#fight .result-title { width: min(92%, 400px); aspect-ratio: 529 / 130; margin: 0; display: grid; place-items: center;
  background: url(sprites/ui-res-title.webp) center / 100% 100% no-repeat;
  color: #ffe08a; font: 58px/1 Jua, 'Apple SD Gothic Neo', sans-serif; letter-spacing: 6px;
  -webkit-text-stroke: 7px #5b2a0e; paint-order: stroke fill; text-shadow: 0 4px 0 #3a1708, 0 0 18px #ffcf6a;
  animation: result-reveal .45s cubic-bezier(.2,1.5,.5,1) both; }
#fight [data-outcome='lose'] .result-title { background-image: url(sprites/ui-res-splash-lose.webp); aspect-ratio: 461 / 120;
  color: #eef0f2; -webkit-text-stroke-color: #3b1a22; text-shadow: 0 4px 0 #1e0b10, 0 0 10px #0008; }
.result-stage { margin: -10px 0 0; min-width: 62%; max-width: 92%; padding: 9px 30px 11px; text-align: center;
  background: url(sprites/ui-hud-plaque.webp) center / 100% 100% no-repeat; color: #fff1cf; font-size: 19px;
  -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-party { position: relative; width: 100%; flex: 1 1 0; min-height: 110px; max-height: 270px;
  display: flex; justify-content: center; align-items: flex-end; }
.result-hero { height: 86%; width: calc(100% / var(--n, 4) * 1.12); margin: 0 -2.5%; object-fit: contain; object-position: 50% 100%;
  filter: drop-shadow(0 5px 3px #0007); transform-origin: 50% 100%;
  animation: hero-bow 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
.result-hero.mvp { height: 100%; z-index: 2; width: calc(100% / var(--n, 4) * 1.35); }
[data-outcome='lose'] .result-hero { height: 74%; animation-name: hero-slump; }
[data-outcome='lose'] .result-hero.mvp { height: 84%; }
@keyframes hero-bow { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(2px) rotate(-1.2deg) scaleY(.985); } }
@keyframes hero-slump { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.975) translateY(1px); } }
.result-stars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; margin-top: -40px; z-index: 3; flex: none; }
.result-stars img { width: 66px; height: 66px; object-fit: contain; filter: drop-shadow(0 4px 3px #0008);
  animation: star-pop .5s cubic-bezier(.2,1.6,.5,1) both; }
.result-stars img:nth-child(2) { width: 78px; height: 78px; margin-bottom: 6px; }
@keyframes star-pop { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
.result-scroll { width: 100%; flex: none; margin: 0; padding: 18px 15% 20px; list-style: none;
  background: url(sprites/ui-res-scroll.webp) center / 100% 100% no-repeat; color: #4a2c14; }
.result-goals { margin-top: -8px; display: flex; flex-direction: column; justify-content: center; gap: 3px; min-height: 132px; }
.result-goals li { display: flex; align-items: center; gap: 10px; font-size: 20px; line-height: 1.25; }
.result-goals li + li { border-top: 1px solid #b89a6c80; padding-top: 3px; }
.result-goals img { width: 30px; height: 30px; flex: none; }
.result-goals li.miss { color: #8d7a62; }
.result-goals li.miss img { filter: grayscale(1) brightness(1.1); opacity: .45; }
.defeat-advice { padding: 12px 13% 16px; text-align: left; }
.advice-head { display: block; margin: 0 auto 6px; width: fit-content; max-width: 100%; padding: 4px 22px;
  background: url(sprites/ui-hud-tag.webp) center / 100% 100% no-repeat; color: #fff1cf; font-size: 19px;
  -webkit-text-stroke: 4px #6b1d12; paint-order: stroke fill; text-align: center; }
.defeat-advice ul { margin: 0; padding: 0; list-style: none; }
.defeat-advice li { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; line-height: 1.2; }
.defeat-advice li + li { border-top: 1px solid #b89a6c80; }
.defeat-advice li > img { width: 32px; height: 32px; object-fit: contain; flex: none; }
.defeat-advice li > span { flex: 1; min-width: 0; }
#fight .advice-go { flex: none; min-width: 56px; min-height: 38px; margin: 0; padding: 4px 10px; border: 0;
  background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat; color: #fff1cf; font: 15px Jua, sans-serif;
  -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; box-shadow: none; animation: none; }
#fight .advice-go.upgrade-action { animation: upgrade-glow 2.4s ease-in-out infinite; border-radius: 12px; }
.result-rewards { width: 100%; flex: none; min-height: 58px; display: flex; align-items: center; justify-content: space-evenly;
  gap: 0; padding: 6px 7%; background: url(sprites/ui-res-bar.webp) center / 100% 100% no-repeat; }
.result-rewards span { display: flex; align-items: center; gap: 6px; color: #4a2c14; flex: 1; justify-content: center; }
.result-rewards span + span { border-left: 1px solid #b89a6c; }
.result-rewards img { width: 34px; height: 34px; object-fit: contain; }
.result-rewards b { font: 22px Jua, sans-serif; }
.result-buttons { width: 100%; flex: none; display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }
#fight .result-buttons button { width: 100%; min-height: 0; height: 60px; margin: 0; padding: 0 8px; border: 0; border-radius: 14px;
  background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat; box-shadow: none;
  color: #fff1cf; font: 21px Jua, sans-serif; -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill; white-space: nowrap; }
#fight .result-buttons .result-main { background-image: url(sprites/ui-res-btn-red.webp); font-size: 23px; color: #ffe08a;
  -webkit-text-stroke-color: #5b1208; animation: main-glow 2.2s ease-in-out infinite; }
@keyframes main-glow { 0%, 100% { filter: drop-shadow(0 0 0 #ffd96a00); } 50% { filter: drop-shadow(0 0 8px #ffd96acc); } }
.result-small { display: flex; justify-content: center; gap: 10px; flex: none; }
#fight .result-small button { display: flex; align-items: center; gap: 6px; min-height: 40px; margin: 0; padding: 4px 18px 4px 10px;
  border: 2px solid #c9a15a; border-radius: 22px; background: linear-gradient(#5e3a1f, #3a2312); color: #fff1cf; font: 16px Jua, sans-serif; }
.result-small img { width: 26px; height: 26px; object-fit: contain; }
.result-panel .orak-ad-slot { flex: none; width: 100%; }
.result-panel .result-next { flex: none; margin-top: 4px; }
.result-panel .tower-rank { margin: 0; color: #ffe08a; flex: none; }
/* 꽃잎(승리)·낙엽(패배)이 천천히 떨어진다: 가만히 있어도 움직이는 것. */
.result-panel::before, .result-panel::after { content: ''; position: absolute; z-index: 0; pointer-events: none; width: 16px; height: 12px;
  border-radius: 70% 0 70% 0; background: #f6b6c8; top: -20px; left: 18%; animation: petal-fall 7s linear infinite; }
.result-panel::after { left: 74%; background: #f9c9d6; animation-duration: 9s; animation-delay: -4s; }
[data-outcome='lose'].result-panel::before, [data-outcome='lose'].result-panel::after { background: #c9542e; }
@keyframes petal-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 10% { opacity: .9; }
  100% { transform: translate(-60px, 105dvh) rotate(540deg); opacity: .8; } }
.result-panel > * { position: relative; z-index: 1; }
@media (max-height: 700px) {
  #fight .result-panel { gap: 5px; }
  #fight .result-title { width: min(78%, 330px); font-size: 46px; }
  .result-stage { font-size: 16px; padding: 7px 26px 9px; margin-top: -8px; }
  .result-stars { margin-top: -30px; }
  .result-stars img { width: 50px; height: 50px; } .result-stars img:nth-child(2) { width: 60px; height: 60px; }
  .result-goals { min-height: 108px; padding: 12px 15% 14px; } .result-goals li { font-size: 17px; }
  .result-goals img { width: 26px; height: 26px; }
  .defeat-advice { padding: 8px 12% 10px; } .defeat-advice li { min-height: 38px; font-size: 14px; }
  .result-rewards { min-height: 48px; } .result-rewards img { width: 28px; height: 28px; } .result-rewards b { font-size: 19px; }
  #fight .result-buttons button { height: 52px; font-size: 19px; }
  #fight .result-small button { min-height: 34px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .result-title, .result-stars img, .result-hero, #fight .result-buttons .result-main, #fight .advice-go.upgrade-action { animation: none; }
  .result-panel::before, .result-panel::after { display: none; } }
.result-panel .result-next { display: flex; justify-content: space-around; gap: 8px; margin-top: auto; padding-top: 4px; }
#fight.finished .card-deck { visibility: hidden; }
body.battling.battle-result .osc-toast { top: auto !important; bottom: calc(12px + env(safe-area-inset-bottom)) !important; }
.result-goals li.miss { color: #7a6550; }
/* 결과판 2차 다듬기: 시안 대비 글자·협객·단추 크기 맞춤 */
body.battle-result .battle-tools { display: none; }
#fight .result-title { width: min(96%, 420px); font-size: 74px; letter-spacing: 4px; -webkit-text-stroke-width: 8px; }
#fight [data-outcome='lose'] .result-title { width: min(92%, 400px); }
.result-stage { font-size: 21px; margin-top: -14px; }
.result-party { max-height: 300px; }
.result-hero { height: 92%; width: calc(100% / var(--n, 4) * 1.34); margin: 0 -4.5%; }
.result-hero.mvp { height: 100%; width: calc(100% / var(--n, 4) * 1.55); }
[data-outcome='lose'] .result-hero { height: 80%; width: calc(100% / var(--n, 4) * 1.5); margin: 0 -6.5%; }
[data-outcome='lose'] .result-hero.mvp { height: 92%; width: calc(100% / var(--n, 4) * 1.7); }
.result-goals { min-height: 156px; padding: 20px 15% 26px; }
.result-goals li { font-size: 22px; }
.result-goals img { width: 32px; height: 32px; }
.defeat-advice li { font-size: 16px; }
.result-rewards { min-height: 70px; }
.result-rewards img { width: 44px; height: 44px; }
.result-rewards b { font-size: 25px; }
#fight .result-buttons button { height: 66px; font-size: 24px; }
#fight .result-buttons .result-main { font-size: 26px; }
@media (max-height: 700px) {
  #fight .result-title { width: min(80%, 330px); font-size: 54px; -webkit-text-stroke-width: 6px; }
  .result-stage { font-size: 17px; margin-top: -10px; }
  .result-goals { min-height: 118px; padding: 13px 15% 18px; } .result-goals li { font-size: 18px; }
  .result-goals img { width: 26px; height: 26px; }
  .defeat-advice li { font-size: 14px; }
  .result-rewards { min-height: 52px; } .result-rewards img { width: 32px; height: 32px; } .result-rewards b { font-size: 20px; }
  #fight .result-buttons button { height: 54px; font-size: 20px; } #fight .result-buttons .result-main { font-size: 21px; }
}
.result-scroll { padding: 22px 11% 18px; }
.result-goals { min-height: 140px; padding: 24px 12% 18px; margin-top: -10px; }
.defeat-advice { padding: 16px 10% 14px; }
.defeat-advice .advice-head { margin-top: -4px; }
.result-party { flex: 1 0 230px; max-height: 320px; margin-bottom: -6px; }
@media (max-height: 700px) {
  .result-party { flex: 1 0 150px; }
  .result-goals { min-height: 112px; padding: 18px 12% 12px; }
  .defeat-advice { padding: 12px 9% 10px; }
}
#fight .result-title { font-size: 84px; height: 96px; aspect-ratio: auto; background-size: 100% 88%; }
@media (max-height: 700px) { #fight .result-title { font-size: 58px; height: 66px; } }

/* ===== 3.0 공통 틀: 나무 위 띠 · 아래 메뉴 · 뒤로 단추 (inn-v1 · detail-v1 · party-v2 시안) ===== */
#wallet { background: transparent; border: 0; box-shadow: none; padding: env(safe-area-inset-top) 10px 0;
  font-family: Jua, 'Apple SD Gothic Neo', sans-serif; }
#wallet::before { content: ''; position: absolute; inset: env(safe-area-inset-top) 0 0; z-index: -1;
  border-style: solid; border-width: 22px 40px; border-image: url(sprites/ui-hud-panel.webp) 50 110 fill stretch;
  filter: drop-shadow(0 3px 4px #0008); }
#wallet .face { width: 52px; height: 52px; border: 3px solid #e2b54f; box-shadow: 0 0 0 2px #5a3416, 0 2px 4px #0008; }
#wallet .power-value small { color: #f1d9a6; font-size: 12px; }
#wallet .power-value strong { color: #fff3d2; font-size: 26px; -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill; }
#wallet .wallet-resources { color: #fff3d2; font-size: 15px; -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; }
#wallet .wallet-party { background: transparent; border: 0; box-shadow: none; }
/* 객잔 밖: 뒤로 · 현판 제목 · 은/철 알약 */
#wallet.sub-bar { gap: 8px; }
#wallet.sub-bar .sub-title { flex: 1 1 auto; min-width: 0; max-width: 46%; padding: 8px 26px 10px; text-align: center;
  background: url(sprites/ui-hud-plaque.webp) center / 100% 100% no-repeat; color: #fff1cf; font-size: 21px; font-weight: normal;
  -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#wallet.sub-bar .wallet-resources { margin-left: auto; flex-direction: row; gap: 4px; }
#wallet.sub-bar .wallet-resources > span { display: flex; align-items: center; gap: 3px; padding: 3px 9px 3px 4px; border-radius: 16px;
  background: #2a1a10d0; border: 1.5px solid #b98d45; font-size: 14px; }
#wallet.sub-bar .wallet-resources .game-icon, #wallet.sub-bar .wallet-resources img { width: 24px; height: 24px; }
.wood-back { flex: none; width: 46px; height: 46px; min-width: 46px !important; min-height: 46px !important; margin: 0; padding: 0;
  border: 0 !important; border-radius: 50%; box-shadow: 0 2px 4px #0008 !important;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M23 9 11 20l12 11M12 20h18' fill='none' stroke='%233a2010' stroke-width='8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M23 9 11 20l12 11M12 20h18' fill='none' stroke='%23fff1cf' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 58% no-repeat,
    url(sprites/ui-hud-btn.webp) center / 100% 100% no-repeat !important; }
#hub-back { display: none !important; }
/* 아래 메뉴: 나무 판 위 그림 단추, 이름은 짙은 나무 패 */
#nav { background: transparent; border: 0; box-shadow: none; padding: 6px 6px env(safe-area-inset-bottom); gap: 2px; }
#nav::before { content: ''; position: absolute; inset: 0; z-index: -1; border-style: solid; border-width: 22px 40px;
  border-image: url(sprites/ui-hud-panel.webp) 50 110 fill stretch; filter: drop-shadow(0 -3px 4px #0007); }
#nav .menu-item { background: transparent; border: 0; box-shadow: none; color: #fff1cf; font-family: Jua, sans-serif; gap: 0; justify-content: flex-end; }
#nav .menu-item .game-icon { width: 42px; height: 42px; filter: drop-shadow(0 2px 2px #0009); margin-bottom: -4px; }
#nav .menu-item > span:last-child { padding: 1px 4px; border-radius: 6px; background: #2a1a10; border: 1px solid #8a6534;
  font-size: 12px; -webkit-text-stroke: 0; line-height: 1.3; }
#nav .menu-item.selected { background: radial-gradient(closest-side, #ffd56a55, transparent); }
#nav .menu-item.selected > span:last-child { background: #7a2414; border-color: #e2b54f; }

/* ===== 3.0 객잔 밖 화면 바탕: 객잔 그림을 어둡게 깔고 제목은 위 현판으로 ===== */
body:has(#screen.cards-screen) main.orak-stage, body:has(#screen.map-screen) main.orak-stage {
  background: linear-gradient(#1b110bd9, #1b110be6), url(sprites/ui-inn.webp) center top / cover fixed; }
#screen.cards-screen > h1:first-child { display: none; }
#screen.cards-screen { font-family: Jua, 'Apple SD Gothic Neo', sans-serif; }
/* 동료 목록: 걸개 나무 패 카드 (heroes-v2) */
.hero-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px 6px !important; }
.hero-grid .hero-tile { position: relative; aspect-ratio: 300 / 500; min-height: 0; height: auto; padding: 16% 8% 22%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0;
  background: url(sprites/ui-hud-card.webp) center / 100% 100% no-repeat !important; border: 0 !important; box-shadow: none !important;
  color: #4a2c14; border-radius: 0; overflow: visible; }
.hero-grid .hero-tile .card-sprite { position: absolute; left: 10%; right: 10%; top: 14%; bottom: 30%; width: 80%; height: 56%;
  object-fit: contain; object-position: 50% 100%; }
.hero-grid .hero-tile > strong { position: relative; z-index: 1; padding: 1px 10px; background: #3a2414; color: #fff1cf; border-radius: 6px;
  border: 1px solid #c9a15a; font-size: 14px; font-weight: normal; }
.hero-grid .hero-tile > .stars { color: #f0b52a; font-size: 12px; -webkit-text-stroke: 2px #5a3416; paint-order: stroke fill; margin-top: 1px; }
.hero-grid .hero-tile > small:last-of-type:not(.stars) { display: none; }
.hero-grid .hero-tile .element-badge { left: 4%; top: 9%; width: 28%; height: auto; }
.hero-grid .hero-tile .hero-level { right: 9%; top: 11%; color: #4a2c14; font-size: 12px; background: none; }
.hero-grid .hero-tile:disabled { opacity: 1; filter: brightness(.75); }
.hero-grid .hero-tile:disabled > strong { display: none; }
.hero-grid .hero-tile:disabled > .stars { font-size: 11px; color: #fff1cf; -webkit-text-stroke: 3px #3a2010; text-align: center; }
.hero-grid .silhouette { filter: brightness(0) opacity(.75); }
/* 협객 상세 (detail-v1) */
.cards-screen .hero-showcase { border-radius: 14px; border: 3px solid #b98d45; box-shadow: 0 4px 10px #0009;
  background: url(sprites/bg-2-far.webp) center / cover !important; }
.cards-screen .detail-caption { background: url(sprites/ui-hud-plaque.webp) center / 100% 100% no-repeat; padding: 6px 30px 8px; }
.cards-screen .detail-caption h1 { color: #fff1cf; font-size: 26px; font-weight: normal; -webkit-text-stroke: 5px #3a2010; paint-order: stroke fill; margin: 0; }
.cards-screen .detail-caption p { color: #f1d9a6; font-size: 13px; margin: 0; }
.cards-screen .detail-prev, .cards-screen .detail-next { width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: url(sprites/ui-hud-btn.webp) center / 100% 100% no-repeat; color: #fff1cf; font-size: 26px; -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; }
.cards-screen .detail-power { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px auto; width: fit-content;
  padding: 6px 26px; background: url(sprites/ui-res-btn-red.webp) center / 100% 100% no-repeat; }
.cards-screen .detail-power small { color: #ffe08a; font-size: 15px; }
.cards-screen .detail-power strong { color: #ffe08a; font-size: 26px; font-weight: normal; -webkit-text-stroke: 4px #5b1208; paint-order: stroke fill; }
.cards-screen .stat-bars { padding: 16px 13% 14px; background: url(sprites/ui-res-scroll.webp) center / 100% 100% no-repeat; display: grid; gap: 2px; }
.cards-screen .stat-meter { background: none !important; border: 0; border-bottom: 1px solid #b89a6c80; border-radius: 0; color: #4a2c14; font-size: 18px; min-height: 34px; }
.cards-screen .stat-meter::before { display: none; }
.cards-screen .stat-meter img { width: 28px; height: 28px; }
.cards-screen .skill-name, .cards-screen .skill-desc { display: block; margin: 0; padding: 0 18px; background: #e9d6a8; color: #4a2c14; border-inline: 6px solid #6e8a3a; }
.cards-screen .skill-name { margin-top: 10px; padding-top: 10px; font-size: 20px; border-top: 6px solid #6e8a3a; border-radius: 8px 8px 0 0; }
.cards-screen .skill-desc { padding-bottom: 10px; font-size: 14px; border-bottom: 6px solid #6e8a3a; border-radius: 0 0 8px 8px; }
.cards-screen .upgrade-grid { gap: 5px; }
.cards-screen .upgrade-button { border: 0 !important; border-radius: 10px; color: #fff1cf;
  background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat !important; box-shadow: 0 3px 4px #0007 !important; }
.cards-screen .upgrade-button small { font-size: 15px; -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; }
.cards-screen .upgrade-tile.unavailable .upgrade-button { filter: grayscale(.7) brightness(.8); }
.cards-screen .upgrade-cost { color: #fff1cf; -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; }
/* 출정 편성 (party-v2) */
.party-screen .formation-field { border-radius: 14px; border: 3px solid #b98d45; box-shadow: 0 4px 10px #0009; }
.party-screen .formation-slot strong { color: #fff1cf; font-weight: normal; -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill; }
.party-screen .row-label { background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat; color: #fff1cf; padding: 4px 12px; border: 0; }
.party-screen .auto-party { border: 0 !important; height: 52px; color: #fff1cf; font-size: 19px; -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill;
  background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat !important; box-shadow: none !important; }
.party-screen .formation-hint { padding: 12px 12%; color: #4a2c14; font-size: 16px; background: url(sprites/ui-hud-scroll.webp) center / 100% 100% no-repeat; text-align: center; }
.party-screen .face-tile { flex: 0 0 96px; height: 160px; padding: 18% 8% 12%; border: 0 !important; border-radius: 0; box-shadow: none !important;
  background: url(sprites/ui-hud-card.webp) center / 100% 100% no-repeat !important; color: #4a2c14; justify-content: flex-end; }
.party-screen .face-tile.selected { background-image: url(sprites/ui-hud-card-glow.webp) !important; }
.party-screen .face-tile .face-portrait { width: 70px; height: 70px; border-radius: 8px; }
.party-screen .face-tile strong { padding: 0 8px; background: #3a2414; color: #fff1cf; border-radius: 6px; font-size: 13px; font-weight: normal; }
.party-screen .face-tile .element-badge { left: 8%; top: 12%; }
.party-screen .face-tile .hero-level { right: 12%; top: 13%; color: #4a2c14; }
.party-screen .affinity { font-size: 11px; }
.party-screen .next-foe { padding: 12px 11% 14px; background: url(sprites/ui-res-scroll.webp) center / 100% 100% no-repeat; color: #4a2c14; }
.party-screen .foe-title { display: block; text-align: center; font-size: 17px; font-weight: normal; }
.party-screen .foe-faces { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.party-screen .foe-faces canvas { width: 50px; height: 50px; border-radius: 50%; background: #d9c08e; border: 2px solid #8a6534; }
.party-screen .foe-tip { flex: 1; display: flex; align-items: center; gap: 6px; margin: 0 0 0 6px; font-size: 14px; line-height: 1.2; }
.party-screen .foe-el { width: 36px; height: 36px; }
.party-screen .formation-hint { display: none; }
.party-screen .party-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; margin-top: 10px; }
.party-screen .party-actions button { margin: 0; height: 60px; }
.party-screen .party-go { border: 0 !important; color: #ffe08a; font-size: 26px; -webkit-text-stroke: 5px #5b1208; paint-order: stroke fill;
  background: url(sprites/ui-res-btn-red.webp) center / 100% 100% no-repeat !important; box-shadow: none !important; }
.hero-grid .hero-tile .card-sprite { position: absolute !important; left: 10% !important; top: 15% !important; width: 80% !important; height: 55% !important;
  max-width: none !important; max-height: none !important; margin: 0 !important; }
.cards-screen .stat-meter, .cards-screen .stat-meter span { font-size: 18px !important; }
.hero-grid .hero-tile .card-sprite { left: -21% !important; top: -4% !important; width: 196% !important; height: auto !important; object-fit: fill; pointer-events: none; }
#screen.cards-screen > h1 { display: none; }
/* ===== 3.0 객잔 (inn-v1) ===== */
.inn-hero > span { bottom: -6%; padding: 4px 14px 6px; border-radius: 0; font: 15px Jua, sans-serif; color: #fff1cf;
  background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat; -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; text-shadow: none; }
#chest-time { top: 41%; right: 8%; width: auto; padding: 3px 12px; border-radius: 10px; background: #2a1a10d9; border: 1.5px solid #b98d45;
  font: 13px Jua, sans-serif; color: #fff1cf; text-shadow: none; }
.depart-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  left: 6%; width: 88%; min-height: 0; height: 104px; border: 0; border-radius: 0; box-shadow: none; padding: 0 0 6px;
  background: url(sprites/ui-res-btn-red.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 5px 6px #000a);
  animation: main-glow 2.4s ease-in-out infinite; }
.depart-button strong { font: 44px/1.05 Jua, sans-serif; color: #ffe08a; -webkit-text-stroke: 7px #5b1208; paint-order: stroke fill; letter-spacing: 4px; }
.depart-button small { font: 17px Jua, sans-serif; color: #fff1cf; -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill;
  max-width: 86%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 700px) { .depart-button { height: 80px; } .depart-button strong { font-size: 34px; } .depart-button small { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .depart-button { animation: none; } }
/* ===== 3.0 지도 (map-v2) ===== */
body:has(.map-screen) .map-header { height: 58px; padding: 0 8px; gap: 8px; background: transparent; border: 0; justify-content: flex-start; }
.map-header .map-plaque { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; height: 52px; padding: 0 30px;
  background: url(sprites/ui-hud-plaque.webp) center / 100% 100% no-repeat; }
.map-header .map-plaque strong { color: #fff1cf; font: 20px Jua, sans-serif; -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill; white-space: nowrap; }
.map-header .map-plaque button { color: #ffe08a; font: 26px Jua, sans-serif; -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; min-width: 30px !important; }
.map-header .map-plaque button:disabled { opacity: .35; }
.star-bar { margin: 0 8px; min-height: 64px; padding: 6px 13%; background: url(sprites/ui-hud-scroll.webp) center / 100% 100% no-repeat; color: #4a2c14; }
.star-bar strong { font: 20px Jua, sans-serif; color: #4a2c14; }
.star-bar button { background: transparent !important; border: 0 !important; box-shadow: none !important; color: #4a2c14; font: 13px Jua, sans-serif; }
.chapter-map { margin: 0 !important; }
.map-viewport { background: #201b14; }
.map-node { width: 54px; height: 54px; border: 3px solid #c9a15a; font-family: Jua, sans-serif;
  background: radial-gradient(circle at 40% 30%, #f4ead2, #c9b48a 55%, #8d7650); color: #3a2010; }
.map-node .node-number { font-size: 15px; font-weight: normal; }
.map-node small { color: #e0a321; font-size: 11px; -webkit-text-stroke: 2px #5a3416; paint-order: stroke fill; letter-spacing: -1px; }
.node-next { width: 66px; height: 66px; border: 3px solid #fff0ad; background: radial-gradient(circle at 40% 30%, #fff6c8, #f3c44b 55%, #b07a1e);
  box-shadow: 0 0 22px #ffd469, 0 0 0 6px #ffc96150; }
.node-next small { color: #fff1cf; -webkit-text-stroke: 3px #5b1208; font-size: 12px; letter-spacing: 0; }
.node-locked { background: radial-gradient(circle at 40% 30%, #9a948a, #625b52); border-color: #7d7468; color: #e5ded3; opacity: .85; }
.boss-node { width: 92px; height: 92px; border: 4px solid #d8402a; box-shadow: 0 0 0 3px #f3c44b, 0 4px 10px #000a; background: #3a1a14; }
.departure-card { bottom: calc(var(--menu-height) - 6px); width: min(100%, 520px); padding: 16px 12% 18px; border: 0; border-radius: 0; box-shadow: none;
  background: url(sprites/ui-res-scroll.webp) center / 100% 100% no-repeat; color: #4a2c14; font-family: Jua, sans-serif; }
.departure-card > strong { padding: 0; text-align: center; font-size: 21px; font-weight: normal; color: #4a2c14; }
.departure-card .card-close { top: 6px; right: 9%; color: #4a2c14; }
.departure-card .dep-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.departure-card .map-enemies { margin: 0; gap: 4px; flex: 1; min-width: 0; }
.departure-card .map-enemies > div { width: 52px; }
.departure-card .map-enemies canvas { width: 48px; height: 48px; }
.departure-card .map-enemies small { display: none; }
.departure-card .map-enemies .game-icon { top: 28px; right: -2px; width: 22px; height: 22px; }
.departure-card .map-actions { margin: 0; flex-direction: column; gap: 4px; }
.departure-card .map-actions button { flex: none; min-width: 104px; height: 52px; margin: 0; border: 0 !important; box-shadow: none !important;
  background: url(sprites/ui-res-btn-red.webp) center / 100% 100% no-repeat !important; color: #ffe08a; font: 24px Jua, sans-serif;
  -webkit-text-stroke: 5px #5b1208; paint-order: stroke fill; }
.departure-card .map-actions button + button { height: 38px; font-size: 16px; background-image: url(sprites/ui-res-btn.webp) !important; color: #fff1cf; -webkit-text-stroke-color: #3a2010; }
.departure-card .dep-info { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: 12px; }
.departure-card .dep-info p { margin: 0; font-size: 12px; }
.departure-card .map-reward { font-size: 12px; gap: 3px; }
.departure-card .map-reward .game-icon { width: 18px; height: 18px; }
body:has(.map-screen:not(.tower-screen)) main.orak-stage:has(.map-header .wood-back) { padding-top: calc(6px + env(safe-area-inset-top)); }
.map-screen:has(.map-header .wood-back):has(.star-bar) .map-viewport { height: calc(100dvh - 6px - env(safe-area-inset-top) - var(--menu-height) - 58px - 70px); }
.departure-card > strong { padding: 0 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.departure-card .power-short { color: #b3261e; }
.inn-hero { top: calc(54% - 254px); }
.inn-hero:nth-child(2n) { top: calc(54% - 254px); }
.inn-hero:nth-child(n+3) { top: calc(75% - 254px); }
@media (max-height: 700px) { .inn-hero, .inn-hero:nth-child(2n) { top: calc(52% - 254px); } .inn-hero:nth-child(n+3) { top: calc(72% - 254px); } }
.treasure-chest { top: 21%; }
#chest-time { top: 31%; }
@media (max-height: 700px) {
  .inn-hero, .inn-hero:nth-child(2n) { height: 190px; top: calc(51% - 190px); }
  .inn-hero:nth-child(n+3) { top: calc(73% - 190px); }
  .inn-hero canvas { width: 160px; left: calc(50% - 80px); }
  .treasure-chest { top: 14%; right: 6%; } #chest-time { top: 19%; right: calc(6% + 84px); white-space: nowrap; }
}
.cards-screen .detail-namebar { display: flex; align-items: center; gap: 4px; margin: -22px 0 8px; position: relative; z-index: 2; }
.cards-screen .detail-namebar .detail-caption { position: static; flex: 1.3; min-width: 0; text-align: left; padding: 8px 18px 10px 26px;
  background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat; transform: none; }
.cards-screen .detail-namebar .detail-caption h1 { font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards-screen .detail-namebar .detail-caption p { font-size: 13px; color: #fff1cf; -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; }
.cards-screen .detail-namebar .detail-power { flex: 1; margin: 0; padding: 12px 10px; flex-direction: row; gap: 6px; }
.cards-screen .detail-power strong { font-size: 24px; }
.cards-screen .detail-stars { position: absolute; top: 10px; right: 12px; z-index: 2; color: #f3c44b; font-size: 24px; letter-spacing: -2px;
  -webkit-text-stroke: 4px #5a3416; paint-order: stroke fill; }
.cards-screen .hero-showcase .element-badge { width: 54px !important; height: 54px !important; left: 8px !important; top: 8px !important; }
.cards-screen .hero-showcase .hero-level { display: none; }
/* ===== 3.0 수련 (training-v1) ===== */
.cards-screen .training-banner { margin: 0 0 8px; padding: 6px 13% 20px; text-align: center; color: #4a2c14; font-size: 17px;
  background: url(sprites/ui-hud-scroll.webp) center / 100% 100% no-repeat; }
.cards-screen .training-grid { grid-template-columns: 1fr; gap: 8px; }
.cards-screen .training-card, .cards-screen .training-card.open { grid-column: auto; min-height: 0; height: 118px; padding: 0; border-radius: 12px;
  border: 4px solid #7a4a22; box-shadow: inset 0 0 0 2px #c9a15a, 0 4px 8px #0008; background-size: cover; background-position: center; justify-content: flex-end; align-items: center; }
.cards-screen .training-card.open { border-color: #e2b54f; box-shadow: inset 0 0 0 2px #fff0ad, 0 0 14px #ffd46988, 0 4px 8px #0008; }
.cards-screen .training-card::before { display: none; }
.cards-screen .training-card .element-badge { position: absolute; left: 6px; top: 6px; width: 46px; height: 46px; }
.cards-screen .training-card > strong { margin-bottom: 6px; padding: 5px 30px 7px; background: url(sprites/ui-hud-plaque.webp) center / 100% 100% no-repeat;
  color: #fff1cf; font-size: 18px; font-weight: normal; -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill; }
.cards-screen .training-card > small { position: absolute; left: 58px; top: 10px; padding: 2px 8px; border-radius: 8px; background: #2a1a10c0; color: #fff1cf; font-size: 11px; }
.cards-screen .training-card .train-go { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 2; padding: 8px 14px;
  border-radius: 12px; border: 2px solid #7a4a10; background: linear-gradient(#ffe48a, #e0a521); color: #5b2a08; font-size: 18px; box-shadow: 0 3px 0 #7a4a10; }
.cards-screen .training-card.locked { filter: grayscale(.75) brightness(.7); opacity: 1; }
/* ===== 3.0 오늘의 비무 (duel-v1) ===== */
.cards-screen .duel-screen:not(.duel-result) { margin: 0 auto; padding: 0; background: none; border: 0; color: #4a2c14; }
.cards-screen .duel-screen .duel-date { margin: 0; padding: 8px 13% 22px; font-size: 18px; color: #4a2c14; background: url(sprites/ui-hud-scroll.webp) center / 100% 100% no-repeat; }
.cards-screen .duel-opponents { position: relative; margin-top: 4px; height: 270px; align-items: end; gap: 0; padding: 0 2px 6px;
  border-radius: 12px; border: 3px solid #b98d45; background: url(sprites/ui-arena.webp) center 30% / cover; box-shadow: 0 4px 10px #0009; }
.cards-screen .duel-opponents figure { display: flex; flex-direction: column; align-items: center; }
.cards-screen .duel-opponents img { width: 135%; max-width: none; aspect-ratio: auto; height: 150px; object-fit: contain; object-position: 50% 100%;
  filter: drop-shadow(0 4px 3px #0008); animation: hero-bow 2.6s ease-in-out infinite; }
.cards-screen .duel-opponents figure:nth-child(2n) img { animation-delay: -1.2s; }
.cards-screen .duel-opponents figcaption { margin-top: 2px; padding: 2px 3px; border-radius: 6px; background: #3a2414; color: #fff1cf; font-size: 10px; border: 1px solid #c9a15a; }
.cards-screen .duel-board { margin-top: 8px; padding: 18px 13% 16px; background: url(sprites/ui-res-scroll.webp) center / 100% 100% no-repeat; }
.cards-screen .duel-board p { margin: 4px 0; }
.cards-screen .duel-board .duel-score { font-size: 24px; color: #4a2c14; }
.cards-screen .duel-board .duel-rank { display: inline-block; padding: 4px 22px; background: url(sprites/ui-hud-tag.webp) center / 100% 100% no-repeat;
  color: #fff1cf; font-size: 17px; -webkit-text-stroke: 3px #6b1d12; paint-order: stroke fill; }
.cards-screen .duel-board .duel-rule { font-size: 14px; color: #6a4a2a; }
.cards-screen .duel-go { width: 76%; height: 74px; margin: 10px auto 0 !important; display: block; border: 0 !important; box-shadow: none !important;
  background: url(sprites/ui-res-btn-red.webp) center / 100% 100% no-repeat !important; color: #ffe08a; font: 34px Jua, sans-serif;
  -webkit-text-stroke: 6px #5b1208; paint-order: stroke fill; letter-spacing: 6px; animation: main-glow 2.2s ease-in-out infinite; }
.cards-screen .duel-screen > h1 { display: none; }
/* ===== 3.0 기록장 (book-v1): 공통 기록장 틀을 만두 그림으로 입힌다 ===== */
.osc-book { background: linear-gradient(#1b110bd0, #1b110be0), url(sprites/ui-inn.webp) center / cover; font-family: Jua, sans-serif; }
.osc-book .osc-header { border: 0; padding: 8px 10px; justify-content: center; position: relative; }
.osc-book .osc-back { position: absolute; left: 10px; width: 46px; height: 46px; min-width: 46px; padding: 0; border: 0; border-radius: 50%; font-size: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M23 9 11 20l12 11M12 20h18' fill='none' stroke='%233a2010' stroke-width='8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M23 9 11 20l12 11M12 20h18' fill='none' stroke='%23fff1cf' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 58% no-repeat, url(sprites/ui-hud-btn.webp) center / 100% 100% no-repeat; }
.osc-book .osc-title { padding: 8px 44px 10px; background: url(sprites/ui-hud-plaque.webp) center / 100% 100% no-repeat; color: #fff1cf; font-size: 24px;
  -webkit-text-stroke: 5px #3a2010; paint-order: stroke fill; }
.osc-book .osc-heading { width: fit-content; margin: 16px auto 8px; padding: 4px 30px 6px; background: url(sprites/ui-hud-plaque.webp) center / 100% 100% no-repeat;
  color: #fff1cf; font-size: 19px; -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill; }
.osc-book .osc-records { grid-template-columns: 1fr; gap: 0; padding: 14px 18px; border-radius: 8px 18px 18px 8px; background: #efe0bf;
  border: 3px solid #8a5a2b; border-left: 14px solid #7a2414; box-shadow: 0 5px 12px #000a, inset 0 0 18px #c9a46a88; }
.osc-book .osc-record { flex-direction: row; align-items: center; justify-content: space-between; padding: 7px 4px; border: 0; border-bottom: 1px dashed #b89a6c;
  border-radius: 0; background: none; color: #4a2c14; }
.osc-book .osc-record:last-child { border-bottom: 0; }
.osc-book .osc-record .osc-label { font-size: 16px; }
.osc-book .osc-record-value { font-size: 20px; color: #7a2414; }
.osc-book .osc-tier { color: #ffe08a; -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; font-size: 16px; }
.osc-book .osc-challenge { border: 0; border-radius: 12px; padding: 12px 16px; color: #fff1cf; background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat;
  -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; }
.osc-book .osc-challenge .osc-sub, .osc-book .osc-date { color: #f1d9a6; }
.osc-book .osc-done-stamp { color: #ff6b5a; font-size: 16px; border: 2px solid #ff6b5a; border-radius: 6px; padding: 0 6px; transform: rotate(-10deg); -webkit-text-stroke: 3px #3a2010; }
body .osc-book { background: linear-gradient(#1b110bd0, #1b110be0), url(sprites/ui-inn.webp) center / cover; }
/* ===== 3.0 무림탑 (tower-v1) ===== */
#screen.cards-screen:has(.tower-scene) { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 0; }
#screen.cards-screen:has(.tower-scene) > * { width: 100%; }
.cards-screen .weekly-rule { order: 0; margin: 0; padding: 8px 13% 20px; text-align: center; color: #4a2c14; font: 15px Jua, sans-serif; border: 0;
  background: url(sprites/ui-hud-scroll.webp) center / 100% 100% no-repeat !important; }
.cards-screen .tower-scene { order: 1; border-radius: 12px; border: 3px solid #b98d45; box-shadow: 0 4px 10px #0009; }
#screen.cards-screen > h1.tower-best { display: block; }
.cards-screen .tower-week, .cards-screen .tower-best { order: 2; width: 48.5% !important; margin: 0; padding: 10px 6px; text-align: center;
  background: url(sprites/ui-res-bar.webp) center / 100% 100% no-repeat; color: #4a2c14; font: 18px Jua, sans-serif; }
.cards-screen .tower-best { color: #7a2414; }
.cards-screen .tower-controls { order: 3; }
.cards-screen .tower-challenge { order: 4; height: 70px; border: 0 !important; box-shadow: none !important;
  background: url(sprites/ui-res-btn-red.webp) center / 100% 100% no-repeat !important; color: #ffe08a; font: 26px Jua, sans-serif;
  -webkit-text-stroke: 5px #5b1208; paint-order: stroke fill; animation: main-glow 2.2s ease-in-out infinite; }
.cards-screen .tower-platform { width: 74px; height: 34px; min-height: 0 !important; border: 0 !important; border-radius: 6px; box-shadow: 0 3px 5px #0008 !important;
  background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat !important; color: #fff1cf; font: 15px Jua, sans-serif; }
.cards-screen .tower-platform strong { -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; font-weight: normal; }
.cards-screen .tower-platform.next { background-image: url(sprites/ui-res-btn-red.webp) !important; width: 86px; height: 40px; filter: drop-shadow(0 0 8px #ffd469); }
.cards-screen .tower-platform.next strong { color: #ffe08a; -webkit-text-stroke-color: #5b1208; font-size: 17px; }
.cards-screen .tower-platform.locked { filter: grayscale(.6) brightness(.75); opacity: 1; }
.cards-screen .tower-platform.boss { width: 74px; height: 74px; border-radius: 50%; background: #3a1a14 !important; border: 3px solid #d8402a !important; }
.cards-screen .tower-controls button { border: 0; border-radius: 50%; background: url(sprites/ui-hud-btn.webp) center / 100% 100% no-repeat; color: #fff1cf; }
.cards-screen .tower-controls span { color: #fff1cf; font: 17px Jua, sans-serif; }
/* ===== 3.0 이야기 앨범 (story-v1) ===== */
.cards-screen .album-heading { margin: 14px 0 6px; width: fit-content; padding: 4px 28px 6px; background: url(sprites/ui-hud-plaque.webp) center / 100% 100% no-repeat;
  color: #fff1cf; font: 17px Jua, sans-serif; -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill; }
.cards-screen .album-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; overflow: visible; padding: 8px; border-radius: 10px;
  background: #3a2414; border: 3px solid #8a5a2b; box-shadow: inset 0 0 0 2px #c9a15a55; }
.cards-screen .album-card { flex: none; width: auto; height: auto; aspect-ratio: 4 / 3.6; padding: 4px 4px 0; border: 0 !important; border-radius: 4px;
  background: #efe0bf !important; box-shadow: 0 2px 4px #0008 !important; display: flex; flex-direction: column; }
.cards-screen .album-card img { width: 100%; flex: 1; min-height: 0; object-fit: cover; border-radius: 2px; }
.cards-screen .album-card strong { font-size: 12px; color: #4a2c14; padding: 2px 0; line-height: 1.2; font-weight: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: static; background: none; }
.cards-screen .album-card.locked img { filter: blur(3px) grayscale(1) brightness(.6); }
body:has(#screen.cards-screen) main.orak-stage, body:has(#screen.map-screen) main.orak-stage, body .osc-book {
  background: linear-gradient(#1b110b8c, #1b110bb8), url(sprites/ui-inn.webp) center top / cover fixed; }
.cards-screen .tower-scene { height: calc(100dvh - var(--status-height) - var(--menu-height) - 250px); min-height: 300px; }
.cards-screen .tower-platform { width: 62px; height: 28px; font-size: 13px; }
.cards-screen .tower-platform.next { width: 76px; height: 36px; }
.cards-screen .tower-platform.boss { width: 62px; height: 62px; }
.cards-screen .tower-controls { margin: 0; }
.cards-screen .tower-week, .cards-screen .tower-best { padding: 6px; font-size: 16px; }
.cards-screen .tower-challenge { height: 60px; font-size: 23px; }
@media (max-height: 700px) { .cards-screen .tower-scene { min-height: 0; height: calc(100dvh - var(--status-height) - var(--menu-height) - 262px); }
  .cards-screen .tower-controls { min-height: 0; } .cards-screen .tower-controls button { width: 36px; height: 36px; min-height: 36px !important; }
  .cards-screen .tower-challenge { height: 50px; font-size: 20px; } .cards-screen .weekly-rule { padding: 4px 13% 14px; font-size: 13px; } }
@media (max-height: 700px) { .cards-screen .tower-platform { width: 50px; height: 22px; font-size: 11px; } .cards-screen .tower-platform strong { font-size: 11px; -webkit-text-stroke-width: 2px; }
  .cards-screen .tower-platform.next { width: 60px; height: 28px; } .cards-screen .tower-platform.boss { width: 48px; height: 48px; } }
.cards-screen .album-heading .album-count { margin-left: 10px; padding: 1px 8px; border-radius: 8px; background: #2a1a10cc; color: #ffe08a;
  font: 14px Jua, sans-serif; -webkit-text-stroke: 0; vertical-align: 2px; }
.cards-screen .album-card.locked strong { text-align: center; }
.cards-screen .album-heading { display: flex; align-items: center; white-space: nowrap; }
/* 3.0 글자 맞춤: 한 줄로 줄이고, 최소 크기에서도 넘치면 두 줄까지 허용 */
.fit-line { white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; min-width: 0; }
.fit-line.fit-wrap { white-space: normal !important; overflow-wrap: normal !important; word-break: keep-all; line-height: 1.1; }
html:not([lang="ko"]) #nav .menu-item > span:last-child { overflow-wrap: normal; hyphens: none; line-height: 1.1; min-height: 0; max-width: 100%; }
.map-header .map-plaque { min-width: 0; }
.departure-card .dep-info p:last-child { white-space: nowrap; }
#nav .menu-item > span.fit-wrap { white-space: normal !important; overflow: visible !important; word-break: keep-all; line-height: 1.05; }
.cards-screen .album-card strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.4em; }
.result-panel .result-next strong { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-overflow: clip; line-height: 1.15; }
.cards-screen .album-heading { max-width: 100%; box-sizing: border-box; } .cards-screen .album-heading .album-count { flex: none; }
.cards-screen .duel-opponents figure { min-width: 0; } .cards-screen .duel-opponents figcaption { max-width: 100%; box-sizing: border-box; word-break: normal; overflow-wrap: break-word; }
html:not([lang="ko"]) .cards-screen .duel-opponents figcaption { -webkit-line-clamp: 3; min-height: 3.6em; font-size: 9.5px; }
html:not([lang="ko"]) #nav .menu-item { overflow: visible; }
html:not([lang="ko"]) #nav .menu-item > span:last-child { padding: 1px 2px; letter-spacing: -0.2px; }
#nav .menu-item.tower-locked > span:last-child { opacity: .8; }
#fight .result-panel .result-title { padding: 0 72px; box-sizing: border-box; }
/* 3.0 편성 전장 크기: 시안(협객 키 화면 14%)에 맞춰 전장과 협객을 키운다 */
.party-screen .formation-field { height: clamp(170px, calc(100dvh - 520px), 400px); }
.party-screen .formation-slot { width: 46%; height: 50%; }
.party-screen .slot-2 { left: 5%; top: 1%; } .party-screen .slot-3 { right: 3%; left: auto; top: 1%; }
.party-screen .slot-0 { left: 5%; top: 49%; } .party-screen .slot-1 { right: 3%; left: auto; top: 49%; }
.party-screen .formation-slot .card-sprite { height: 118%; width: auto; aspect-ratio: 440 / 300; left: 50%; bottom: 6%; transform: translateX(-34%); max-width: none; }
.party-screen .formation-slot::before { bottom: 9%; height: 16%; }
.party-screen .formation-slot strong { bottom: 0; font-size: 15px; }
.party-screen .row-label.back { top: 30%; } .party-screen .row-label.front { top: 76%; }
.party-screen .face-tile { flex: 0 0 76px; height: 108px; padding: 14% 8% 8%; }
.party-screen .face-tile .face-portrait { width: 50px; height: 50px; }
.party-screen .party-actions button { height: 54px; }
/* 3.0 패배 장면: 시안처럼 서로 겹쳐 크게(협객 키 화면 18~20%) */
#fight [data-outcome='lose'] .result-hero { height: 100%; width: calc(100% / var(--n, 4) * 1.9); margin: 0 -11%; }
#fight [data-outcome='lose'] .result-hero.mvp { height: 100%; width: calc(100% / var(--n, 4) * 2); }
/* 3.0 대기 움직임: 하위 화면에 객잔 등불 먼지가 천천히 떠오르고, 상세 협객은 숨 쉰다 */
body:has(#screen.cards-screen) main.orak-stage::after { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle, #ffd98acc 0 1.6px, transparent 2.4px), radial-gradient(circle, #ffe7b0aa 0 1.2px, transparent 2px),
    radial-gradient(circle, #ffcf7099 0 2px, transparent 3px);
  background-size: 97px 131px, 151px 173px, 211px 197px; background-position: 0 0, 40px 60px, 120px 20px;
  animation: inn-dust 9s linear infinite; opacity: .75; }
@keyframes inn-dust { from { background-position: 0 0, 40px 60px, 120px 20px; } to { background-position: 18px -131px, 10px -113px, 150px -177px; } }
#screen.cards-screen { position: relative; z-index: 1; }
.hero-showcase .detail-action { transform-origin: 50% 92%; animation: hero-breathe 2.4s ease-in-out infinite; }
@keyframes hero-breathe { 0%, 100% { scale: 1 1; } 50% { scale: 1.015 .985; } }
@media (prefers-reduced-motion: reduce) { body:has(#screen.cards-screen) main.orak-stage::after, .hero-showcase .detail-action { animation: none; } }
body .osc-book::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, #ffd98acc 0 1.6px, transparent 2.4px), radial-gradient(circle, #ffe7b0aa 0 1.2px, transparent 2px), radial-gradient(circle, #ffcf7099 0 2px, transparent 3px);
  background-size: 97px 131px, 151px 173px, 211px 197px; animation: inn-dust 9s linear infinite; opacity: .75; }
body .osc-book > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { body .osc-book::after { animation: none; } }
.cards-screen .train-go { animation: main-glow 2.2s ease-in-out infinite; } @media (prefers-reduced-motion: reduce) { .cards-screen .train-go { animation: none; } }
/* 기록장은 전체 덮개라 아래 메뉴가 보이기만 하고 눌리지 않았다: 메뉴를 덮개 위로 올리고 내용 아래에 메뉴 높이만큼 비운다 */
body:has(.osc-book) #nav { z-index: 101; }
body .osc-book .osc-book-scroll { padding-bottom: calc(var(--menu-height, 76px) + 12px); }
/* 3.0 상세: 390x844에서 강화 단추 줄이 아래 메뉴에 가리지 않게 진열대를 화면 높이에 맞춘다 */
.cards-screen .hero-showcase { height: clamp(240px, calc(100dvh - 590px), 330px); }
.cards-screen .hero-showcase .detail-cutin, .cards-screen .hero-showcase .detail-action { height: calc(clamp(240px, calc(100dvh - 590px), 330px) - 44px); }
.cards-screen .stat-bars { padding-block: 15px 9px; }
.cards-screen .detail-namebar .detail-caption p { white-space: nowrap; overflow: hidden; }
.cards-screen .upgrade-button small { max-width: 100%; white-space: nowrap; overflow: hidden; }
.cards-screen .skill-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cards-screen .detail-namebar .detail-caption { padding: 5px 18px 13px 26px; }
.cards-screen .detail-namebar .detail-caption h1 { line-height: 27px; }
.cards-screen .detail-namebar .detail-power { padding-inline: 20px 14px; min-width: 0; }
.cards-screen .detail-namebar .detail-caption p, .cards-screen .detail-namebar .detail-caption h1 { padding-inline-end: 4px; }
@media (max-width: 380px) { #fight .result-panel .result-title { padding: 0 62px 0 86px; letter-spacing: .02em; }
  #fight [data-outcome='lose'] .result-title { padding: 0 86px 0 106px; } }

/* ===== 3.0 이야기 장면 (fix-plan-v2 #4): 남색 상자 → 객잔 나무 · 금테 액자 · 한지 두루마리 =====
   두루마리(ui-res-scroll 541x291) 안쪽 종이 = 가로 10~90%, 세로 14~92% (격자 실측). 붉은 대만 테두리로 쓰고 종이만 늘인다. */
#story { background: linear-gradient(#1b120ad9, #140d07f0), url(sprites/bg-inn.webp) center top / cover; font-family: Jua, 'Apple SD Gothic Neo', sans-serif; }
.story-top { min-height: 52px; gap: 6px; }
.story-top a.orak-home-button:not(.btn), .story-top > .orak-home-button { flex: none; width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important;
  padding: 0 !important; border: 0 !important; border-radius: 50% !important; font-size: 0 !important; box-shadow: 0 3px 4px #0009 !important;
  background: url(sprites/ui-hud-ico-home.webp) center / 56% no-repeat, url(sprites/ui-hud-btn.webp) center / contain no-repeat !important; }
.story-top a.orak-home-button:not(.btn) > *, .story-top > .orak-home-button > * { display: none !important; }
/* 현판(ui-hud-plaque) 안쪽 판 = 가로 15~84%, 세로 15~78% → 글자 중심을 판 중심(49.5%, 46.5%)에 */
.story-top strong#story-title { flex: 1 1 auto; min-width: 0; max-width: 68%; margin: 0 auto; box-sizing: border-box; aspect-ratio: 524 / 116;
  display: flex; align-items: center; justify-content: center; padding: 0 16% 2.2% 15%; text-align: center;
  background: url(sprites/ui-hud-plaque.webp) center / 100% 100% no-repeat; color: #fff1cf; font-size: 18px; font-weight: normal; line-height: 1.1;
  -webkit-text-stroke: 4px #3a2010; paint-order: stroke fill; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 건너뛰기: 나무 단추(ui-res-btn 안쪽 판 가로 4~96%, 세로 12~86%) */
#story-skip-slot button { min-width: 70px; height: 40px; min-height: 40px; padding: 0 12px 2px; border: 0 !important; border-radius: 0 !important;
  background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat !important; box-shadow: none !important;
  color: #fff1cf !important; font: 400 15px Jua, 'Apple SD Gothic Neo', sans-serif !important; -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; }
#story-picture { border: 4px solid #c99a4a; border-radius: 14px; margin: 12px 0 14px;
  box-shadow: 0 0 0 2px #5a3416, inset 0 0 18px #000a, 0 6px 12px #000a; background: #1a120b; }
.story-loader { background: #1a120bf2; color: #f1d9a6; font-family: Jua, 'Apple SD Gothic Neo', sans-serif; }
#story-dialogue { position: relative; padding-top: 16px; }
#story-dialogue button { position: relative; box-sizing: border-box; min-height: 150px; padding: 26px 34px 24px; margin: 0;
  border-style: solid !important; border-color: transparent !important; border-width: 20px 28px 22px !important; border-radius: 0 !important;
  border-image: url(sprites/ui-res-scroll.webp) 42 54 26 54 fill stretch !important; background: none !important; box-shadow: 0 6px 10px #0008 !important;
  color: #4a2c14; line-height: 1.6; font-family: Jua, 'Apple SD Gothic Neo', sans-serif; }
#story-dialogue button { padding: 6px 14px 4px; display: flex; flex-direction: column; justify-content: center; }
/* 화자 이름: 붉은 이름패(ui-hud-tag 안쪽 판 가로 16~84%, 세로 18~82%)를 두루마리 위에 걸친다 */
#story-dialogue strong { position: absolute; z-index: 2; top: -36px; left: 4px; height: 38px; aspect-ratio: auto; min-width: 120px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 0 22px 1px;
  background: url(sprites/ui-hud-tag.webp) center / 100% 100% no-repeat; color: #fff1cf; font-size: 17px; font-weight: normal;
  -webkit-text-stroke: 3px #4a1208; paint-order: stroke fill; white-space: nowrap; }
#story-dialogue .story-speaker-face { display: none; }
#story-dialogue .story-text { font-size: 18px; color: #4a2c14; min-height: 58px; }
.story-narration .story-text { font-style: normal; color: #6b4a2a; }
#story-count { color: #f1d9a6; font-family: Jua, 'Apple SD Gothic Neo', sans-serif; }
/* 이야기 제목: 현판 안 판에 한 줄, 길면 두 줄까지 작게(현판 밖으로 나가지 않게) */
#story-title > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; max-width: 100%;
  white-space: normal; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.05; }
html:not([lang="ko"]) .story-top strong#story-title { font-size: 14px; -webkit-text-stroke-width: 3px; }
html:not([lang="ko"]) #story-title > span { word-break: normal; overflow-wrap: normal; }
/* ===== 전투 카드 판 (fix-plan-v2 #1·#2) =====
   카드는 협객 수와 상관없이 4명 기준 폭으로 고정하고 가운데 모은다(1~3명일 때 얼굴이 귀만 보이던 것).
   아래 안내 두루마리(ui-hud-scroll) 종이 = 가로 7~93%, 세로 12~52% → 한 줄만, 종이 세로 중심(32%)에 맞춘다. */
body.battling #cards { justify-content: center; }
body.battling #cards .portrait { flex: 0 0 calc((100% - 18px) / 4); max-width: calc((100% - 18px) / 4); }
body.battling #fight > .hint { display: flex; align-items: flex-start; justify-content: center; padding: 0 10%;
  padding-top: calc(66px * .32 - .6em); }
body.battling #fight > .hint > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-height: 700px) { body.battling #fight > .hint { padding-top: calc(48px * .32 - .6em); } }
/* ===== 지도 판 (fix-plan-v2 #8, map-v2 시안): 깬 판 = 금테 나무 원판 + 별, 다음 판 = 금빛, 잠긴 판 = 돌 원판 + 자물쇠. 흐리게 하지 않는다 ===== */
.map-node, .map-node:disabled { opacity: 1 !important; }
.map-node { border: 3px solid #f0c75a; box-shadow: 0 0 0 2px #5a3416, 0 4px 6px #000b;
  background: radial-gradient(circle at 40% 30%, #d9a066, #9a5f2e 58%, #5e3517); color: #fff1cf; }
.map-node .node-number { -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; font-size: 16px; }
.map-node small { -webkit-text-stroke: 2px #3a2010; }
.node-locked { background: radial-gradient(circle at 40% 30%, #c9c2b5, #8a8275 58%, #4d473f); border-color: #5b544a;
  box-shadow: 0 0 0 2px #2e2a25, 0 4px 6px #000b; color: #fbf7ef; }
.node-locked .node-number { -webkit-text-stroke-color: #2e2a25; }
.node-locked small { font-size: 12px; -webkit-text-stroke: 0; filter: grayscale(.2); }
.node-next { border-color: #fff0ad; background: radial-gradient(circle at 40% 30%, #fff6c8, #f3c44b 55%, #b07a1e); }
.node-next .node-number { -webkit-text-stroke-color: #5b1208; }
/* 다음 판이 두루마리에 가리지 않게 아래, 머리띠에 붙지 않게 위에 여백 */
.map-screen .chapter-map { margin-top: 36px !important; }
.map-screen:has(.departure-card) .chapter-map { margin-bottom: 110px !important; }
/* ===== 출정 두루마리 (fix-plan-v2 #7): 붉은 대는 늘이지 않고 종이(가로 10~90%, 세로 14~92%)만 늘인다. 글자·적·단추는 모두 종이 안 ===== */
.departure-card { box-sizing: border-box; display: block; padding: 2px 4px 0 !important; background: none !important;
  border-style: solid; border-color: transparent; border-width: 24px 34px 20px; border-image: url(sprites/ui-res-scroll.webp) 42 54 26 54 fill stretch;
  filter: drop-shadow(0 4px 6px #000a); }
.departure-card > strong { display: block; width: 100%; box-sizing: border-box; padding: 0 30px !important; margin: 0 0 4px;
  white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; font-size: 20px; line-height: 1.2; }
.departure-card .card-close { position: absolute; top: -6px; right: -6px; width: 34px !important; height: 34px !important; min-width: 0 !important; min-height: 0 !important;
  padding: 0 0 2px !important; border: 0 !important; border-radius: 50% !important; box-shadow: 0 2px 3px #0008 !important; outline: none;
  background: url(sprites/ui-hud-btn.webp) center / contain no-repeat !important; color: #fff1cf !important; font: 400 16px Jua, sans-serif !important;
  -webkit-text-stroke: 2px #3a2010; paint-order: stroke fill; }
.departure-card .dep-row { display: flex !important; flex-wrap: nowrap !important; align-items: center; gap: 6px; }
.departure-card .map-enemies { display: flex !important; flex-wrap: nowrap !important; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.departure-card .map-enemies > div { flex: none; }
.departure-card .map-actions { display: flex !important; flex: none; }
.departure-card .dep-info { display: flex !important; flex-wrap: nowrap; align-items: center; }
.departure-card .dep-info p { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.departure-card .map-reward { flex: none; display: inline-flex; align-items: center; }
.map-node small { white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: clip; }
html:not([lang="ko"]) .node-next small { font-size: 9px; -webkit-text-stroke-width: 2px; }
.departure-card .map-enemies > div { width: clamp(40px, 12.5vw, 52px) !important; }
.departure-card .map-enemies canvas { width: 100% !important; height: auto !important; aspect-ratio: 1; }
.departure-card .map-actions button { min-width: 92px !important; padding-inline: 12px !important; }
/* ===== 결과 협객 크기 (fix-plan-v2 #5·#6): 인원이 적어도 한 명 크기는 3~4명일 때와 같게(1~2명이면 거대해지던 것) ===== */
#fight .result-hero { width: calc(100% / max(var(--n, 4), 3) * 1.34); }
#fight .result-hero.mvp { width: calc(100% / max(var(--n, 4), 3) * 1.55); }
#fight [data-outcome='lose'] .result-hero { width: calc(100% / max(var(--n, 4), 4) * 1.9); }
#fight [data-outcome='lose'] .result-hero.mvp { width: calc(100% / max(var(--n, 4), 4) * 2); }
/* 결과 화면: 오락실 알림이 큰 '승리/패배' 제목과 홈 단추를 덮지 않게 아래로(아래 다음 게임 칸 위에 잠깐) */
body.battle-result .orak-hub-toast { top: auto !important; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important; }
body.battle-result .osc-toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important; }
/* ===== 앨범 잠긴 칸 (fix-plan-v2 #9, story-v1 시안): 흐린 회색 → 어두운 종이 위 협객 실루엣 + 금빛 자물쇠 ===== */
.cards-screen .album-card.locked { position: relative; background: linear-gradient(#5a4632, #3a2a1c) !important; }
.cards-screen .album-card.locked img.album-silhouette { filter: brightness(0) opacity(.55) !important; object-fit: contain; object-position: 50% 100%; }
.cards-screen .album-card .album-lock { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); font-size: 26px; line-height: 1;
  filter: drop-shadow(0 2px 2px #000a) sepia(1) saturate(4) hue-rotate(-8deg); }
.cards-screen .album-card.locked strong { min-height: 1.2em; }
/* 객잔 (fix-plan-v2 #11): 수련 시간 패를 상자 왼쪽(겹침)에서 상자 바로 아래로 */
@media (max-height: 700px) { #chest-time { top: calc(14% + 74px); right: 3%; } }
.party-screen .formation-field { height: clamp(124px, calc(100dvh - 505px), 400px); }
html[lang="ko"] #story-title > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards-screen .album-card.locked { background: linear-gradient(#8a7556, #5a4430) !important; }
.cards-screen .album-card.locked img.album-silhouette { filter: brightness(0) opacity(.72) !important; }
/* ===== 글자-바탕 맞춤 (artcheck) ===== */
/* 지도 별 두루마리: 종이는 그림 높이 17~55%뿐이라 글자를 그 띠 가운데로 */
.star-bar { min-height: 72px; height: 72px; box-sizing: border-box; padding: 0 13% 22px; }
.star-bar strong { font-size: 18px; line-height: 1; }
.star-bar button { min-height: 0 !important; height: 30px; padding: 0 2px !important; font-size: 13px; line-height: 1; }
.star-bar button:disabled { opacity: 1 !important; }
.star-bar .star-chest .game-icon { width: 22px; height: 22px; }
.star-bar .star-chest:not(.ready):not(.opened) .game-icon { filter: saturate(.55) brightness(.9); }
.map-screen:has(.map-header .wood-back):has(.star-bar) .map-viewport { height: calc(100dvh - 6px - env(safe-area-inset-top) - var(--menu-height) - 58px - 78px); }
/* 앨범 장 현판: 양끝 구름 장식 안쪽에서 글자 시작 */
.cards-screen .album-heading { padding: 4px 2.1em 6px 2.2em; }
/* 동료 카드: 레벨은 종이 안쪽 모서리, 잠긴 카드는 레벨 숨김, '합류' 글은 이름표처럼 종이 안에 */
.hero-grid .hero-tile .hero-level { right: 13%; top: 15%; font: 13px Jua, sans-serif; color: #4a2c14; z-index: 3; }
.hero-grid .hero-tile:disabled .hero-level { display: none; }
.hero-grid .hero-tile:disabled > .stars { position: relative; z-index: 1; padding: 2px 8px; border-radius: 6px; background: #3a2414e6; color: #fff1cf;
  -webkit-text-stroke: 0; font: 12px Jua, sans-serif; letter-spacing: 0; white-space: nowrap; margin-bottom: 18%; }
/* 작은 글자 키움 (10.5px 미만 없앰) */
.cards-screen .duel-opponents figcaption { font-size: 11px; padding: 2px 2px; letter-spacing: -.02em; }
html:not([lang="ko"]) .cards-screen .duel-opponents figcaption { font-size: 10.5px; }
.face-tile .hero-level, .party-screen .face-tile .hero-level { font-size: 11px; }
/* 이야기 대사: 두루마리 종이 가운데로 (아래 산 그림 위로 내려가지 않게 살짝 위) */
#story-dialogue .story-text { text-align: center; word-break: keep-all; padding-bottom: 8px; }
/* 알림: 아래 메뉴 위로 띄우고, 나무판 색·Jua 글꼴로 화면과 맞춤 */
body:not(.battling):not(.at-title):not(.storying) .osc-toast, body:not(.battling):not(.at-title):not(.storying) .orak-hub-toast { top: auto !important; bottom: calc(var(--menu-height) + 8px) !important; height: auto !important; }
body.storying .osc-toast, body.storying .orak-hub-toast { top: auto !important; bottom: calc(env(safe-area-inset-bottom, 0px) + 2px) !important; padding: 6px 14px !important; }
.osc-toast { background: #3a2414f2 !important; border: 2px solid #c9a15a !important; font-family: Jua, sans-serif !important; color: #fff1cf !important; }
/* 출정 단추: 붉은 판(세로 12~80%) 가운데에 두 줄이 들어가게 아래 여백을 더 둠 */
.depart-button { padding-top: 6px !important; padding-bottom: 18px !important; box-sizing: border-box; }
@media (max-height: 700px) { .depart-button { height: 92px; } .depart-button strong { font-size: 32px; } }
/* 전투 중 알림: 판 이름 현판(캔버스) 위가 아니라 맨 위 HUD 바로 아래, 작게 */
body.battling:not(.battle-result) .osc-toast { top: calc(58px + env(safe-area-inset-top)) !important; padding: 5px 12px !important; font-size: 12.5px !important; max-width: 62% !important; }
/* ===== 현판(ui-hud-plaque) 9분할: 양끝 구름은 고정 크기, 가운데 판만 늘림 → 글자가 항상 안쪽 판(가로 15~84%, 세로 15~78%) 안 =====
   잘라 쓰는 선: 위 17 · 오른 84 · 아래 26 · 왼 79 (524x116) */
#wallet.sub-bar .sub-title, .cards-screen .album-heading, .result-stage, .osc-book .osc-heading {
  background: none !important; border-style: solid !important; border-color: transparent !important; border-radius: 0 !important;
  border-width: 7px 32px 10px 30px !important; border-image: url(sprites/ui-hud-plaque.webp) 17 84 26 79 fill stretch !important; box-sizing: border-box; }
#wallet.sub-bar .sub-title { max-width: none; flex: 1 1 auto; padding: 4px 2px 3px; line-height: 1.25; }
.cards-screen .album-heading { padding: 1px 2px 2px; max-width: 100%; }
.result-stage { padding: 3px 4px 2px; }
.osc-book .osc-heading { padding: 2px 4px 2px; max-width: 100%; }
/* 다른 언어: 긴 판 이름은 두 줄까지(작게 줄이지 않음) */
html:not([lang="ko"]) .result-stage, html:not([lang="ko"]) .cards-screen .album-heading { white-space: normal !important; text-overflow: clip; line-height: 1.1;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 16px; text-align: center; }
html:not([lang="ko"]) .cards-screen .album-heading { display: flex; -webkit-line-clamp: unset; overflow: visible; }
/* 편성 얼굴 카드: 이름은 한 줄(다른 언어에서 글자마다 세로로 쪼개지던 것), 얼굴은 줄어들지 않게 */
.party-screen .face-tile .face-portrait { flex: none; }
.party-screen .face-tile strong { flex: none; max-width: 100%; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  overflow-wrap: normal; word-break: normal; padding: 0 4px; }
.party-screen .face-tile .affinity span { white-space: nowrap; font-size: 11px; }
/* 아래 메뉴 글자 11px */
html:not([lang="ko"]) #nav .menu-item > span:last-child { font-size: 11px; }
/* 출정 카드 제목: 다른 언어는 두 줄까지 */
html:not([lang="ko"]) .departure-card > strong { white-space: normal !important; font-size: 16px; line-height: 1.1;
  display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; text-overflow: clip; }
/* 큰 출정 단추: 다른 언어는 글자를 작게 해 붉은 판 안에 */
html:not([lang="ko"]) .depart-button strong { font-size: 30px; letter-spacing: 1px; }
html:not([lang="ko"]) .depart-button small { font-size: 13px; max-width: 76%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 이야기 제목 현판도 9분할: 긴 제목은 판이 아래로 늘어 두 줄 */
.story-top strong#story-title { aspect-ratio: auto !important; height: auto !important; min-height: 44px; background: none !important;
  border-style: solid; border-color: transparent; border-width: 7px 32px 10px 30px; border-image: url(sprites/ui-hud-plaque.webp) 17 84 26 79 fill stretch;
  padding: 2px 2px 1px !important; display: flex; align-items: center; justify-content: center; }
html:not([lang="ko"]) .story-top strong#story-title { max-width: 72%; }
/* 편성 얼굴 카드 여백을 px로(% 여백은 줄 전체 폭 기준이라 안쪽이 22px까지 좁아졌음) */
.party-screen .face-tile { padding: 26px 8px 14px; justify-content: flex-start; gap: 2px; }
.party-screen .face-tile .hero-level { top: 10px; right: 10px; }
@media (max-height: 700px) {
  .party-screen .face-tile { flex-basis: 78px; height: 112px; padding: 17px 7px 10px; }
  .party-screen .face-tile .face-portrait { width: 46px; height: 46px; }
  .party-screen .face-tile .hero-level { top: 7px; right: 8px; font-size: 10.5px; }
  .party-screen .face-tile strong { font-size: 12px; }
  .party-screen .face-tile .affinity span { font-size: 10.5px; }
}
/* 잠긴 동료 카드 '합류' 표: 종이 안쪽에, 길면 두 줄 */
.hero-grid .hero-tile:disabled > .stars { white-space: normal; max-width: 80%; text-align: center; line-height: 1.1; font-size: 11px; margin-bottom: 24%; }
/* 수련 칸 현판도 9분할 */
.cards-screen .training-card > strong { background: none !important; border-style: solid; border-color: transparent; border-width: 6px 28px 9px 26px;
  border-image: url(sprites/ui-hud-plaque.webp) 17 84 26 79 fill stretch; padding: 1px 2px 0; }
/* 비무 날짜: 한 줄(넘치면 글자만 줄임) */
.cards-screen .duel-screen .duel-date { white-space: nowrap; }
html:not([lang="ko"]) .cards-screen .duel-screen .duel-date { font-size: 15px; }
/* 탑 이번 주 규칙: 다른 언어는 두 줄 → 두루마리를 키워 종이 띠(높이 17~55%) 안에 */
html:not([lang="ko"]) .cards-screen .weekly-rule { font-size: 13px; line-height: 1.15; padding: 15px 13% 40px !important; }
/* 상세 이름판: 역할은 한 줄(줄임), 전투력 판은 다른 언어에서 숫자만 크게 */
.cards-screen .detail-namebar .detail-caption p { font-size: 12px; }
html:not([lang="ko"]) .cards-screen .detail-namebar .detail-power small { display: none; }
html:not([lang="ko"]) .cards-screen .detail-namebar .detail-power strong::before { content: '⚔ '; font-size: .7em; }
/* 패배 조언: 다른 언어는 글자를 줄여 두루마리 종이 안에 */
html:not([lang="ko"]) .defeat-advice li { font-size: 12.5px; line-height: 1.15; min-height: 36px; }
html:not([lang="ko"]) .defeat-advice li button { font-size: 13px; padding-inline: 8px; }
/* 결과 보상 숫자: 줄임표 없이 */
.result-rewards b { white-space: nowrap; overflow: visible; text-overflow: clip; }
@media (max-width: 380px) { .result-rewards span { gap: 3px; } .result-rewards img { width: 26px; height: 26px; } .result-rewards b { font-size: 17px; } }
/* 결과 제목: 좌우 같은 여백으로 붓글씨 띠 가운데 (홈 단추 폭만큼 양쪽을 비움) */
@media (max-width: 380px) { #fight .result-panel .result-title { padding: 0 90px; } #fight [data-outcome='lose'] .result-title { padding: 0 100px; } }
/* 이름표(ui-hud-tag) 9분할: 잘라 쓰는 선 위 18 · 좌우 58 · 아래 18 (360x100) */
.advice-head { background: none !important; border-style: solid; border-color: transparent; border-width: 6px 20px 6px 20px;
  border-image: url(sprites/ui-hud-tag.webp) 18 58 18 58 fill stretch; padding: 1px 2px !important; }
/* 편성 '다음 상대' 두루마리: 막대는 그대로, 종이만 늘림 */
.party-screen .next-foe { background: none !important; border-style: solid; border-color: transparent; border-width: 18px 26px 16px;
  border-image: url(sprites/ui-res-scroll.webp) 42 54 26 54 fill stretch; padding: 0 4px !important; }
/* 무림탑 잠김: 자물쇠 아래에 안내 글 */
.tower-lock { top: 22%; line-height: 1; }
.tower-lock-message { top: 60%; padding: 0 12px; box-sizing: border-box; }
/* 다음 판 표시: 다른 언어는 긴 '도전' 글 대신 ▶ */
html:not([lang="ko"]) .node-next small { font-size: 0 !important; }
html:not([lang="ko"]) .node-next small::after { content: '▶'; font-size: 13px; }
/* 편성 카드 이름 칸 넓힘 */
@media (max-height: 700px) { .party-screen .face-tile { flex-basis: 80px; padding-inline: 5px; } .party-screen .face-tile strong { padding: 0 3px; } }
/* 상세 역할: 다른 언어는 두 줄까지 */
html:not([lang="ko"]) .cards-screen .detail-namebar .detail-caption p { white-space: normal !important; font-size: 11px; line-height: 1.1;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; text-overflow: clip; }
/* 비무 상대 이름: 다른 언어는 하이픈 나눔·네 줄까지 */
html:not([lang="ko"]) .cards-screen .duel-opponents figcaption { hyphens: auto; -webkit-line-clamp: 4; min-height: 0; line-height: 1.1; }
/* 상세 이름판(ui-res-btn) 9분할: 잘라 쓰는 선 위 10 · 좌우 14 · 아래 12 (257x84) → 이름이 위 테두리에 걸리지 않게 */
.cards-screen .detail-namebar .detail-caption { background: none !important; border-style: solid; border-color: transparent;
  border-width: 9px 13px 11px; border-image: url(sprites/ui-res-btn.webp) 10 14 12 14 fill stretch; padding: 3px 6px 3px 10px !important;
  display: flex; flex-direction: column; justify-content: center; min-height: 66px; box-sizing: border-box; }
.cards-screen .detail-namebar .detail-caption h1 { line-height: 1.1; }
/* 지도 장 현판 9분할 + 화살표는 판 안 양끝 */
.map-header .map-plaque { background: none !important; border-style: solid; border-color: transparent; border-width: 8px 34px 12px 32px;
  border-image: url(sprites/ui-hud-plaque.webp) 17 84 26 79 fill stretch; padding: 0 !important; height: 52px; box-sizing: border-box; }
.map-header .map-plaque strong { flex: 1 1 auto; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.map-header .map-plaque button { flex: none; min-width: 22px !important; padding: 0 !important; font-size: 22px; }
/* 편성 얼굴 카드: 네 장이 줄 폭을 채움, 레벨은 종이 안 작은 패, 유리·불리는 세로로 */
.party-screen .face-strip { gap: 6px; }
.party-screen .face-tile { flex: 0 0 calc((100% - 18px) / 4) !important; max-width: 104px; }
.party-screen .face-tile .hero-level { top: 22% !important; right: 13% !important; padding: 0 3px; border-radius: 4px; background: #3a2414d9; color: #fff1cf !important; line-height: 1.3; }
.party-screen .face-tile .affinity { flex-direction: column; align-items: center; gap: 0; }
/* 결과 보상 숫자: 칸 안에서 줄어들지 않게(줄임표 없이) */
.result-rewards b { flex: none; overflow: visible !important; text-overflow: clip !important; }
.result-rewards span { min-width: 0; gap: 4px; }
.result-rewards img { flex: none; }
/* 결과 제목: 어느 폭이든 홈 단추 폭만큼 양쪽을 비워 가운데에 */
#fight .result-panel .result-title { padding-inline: 92px !important; }
/* 패배 조언 두루마리: 막대는 그대로, 종이만 글 길이만큼 늘림 */
.result-scroll.defeat-advice { background: none !important; border-style: solid; border-color: transparent; border-width: 20px 30px 16px;
  border-image: url(sprites/ui-res-scroll.webp) 42 54 26 54 fill stretch; padding: 4px 2px 0 !important; height: auto !important; }
/* 한자·가나는 Jua에 없어 다른 글꼴로 그려지므로 굵은 테두리가 글자 속을 메움 → 테두리를 얇게 */
html:is([lang="ja"], [lang="zh-TW"], [lang="th"]) .depart-button strong { -webkit-text-stroke-width: 4px; }
/* 오늘 점수: 다른 언어는 두 줄까지 */
html:not([lang="ko"]) .duel-score.fit-line { white-space: normal !important; text-overflow: clip !important; line-height: 1.1; }
/* 지도 장 현판: 다른 언어는 두 줄까지 */
html:not([lang="ko"]) .map-header .map-plaque strong.fit-line { white-space: normal !important; text-overflow: clip !important; font-size: 14px; line-height: 1.05;
  display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* 편성 카드 유리·불리: 글 대신 화살표만 종이 안(레벨 아래)에 */
.party-screen .face-tile .affinity { position: absolute; top: 40%; right: 12%; min-height: 0; z-index: 3; }
.party-screen .face-tile .affinity span { display: block; font-size: 0 !important; line-height: 1; }
.party-screen .face-tile .affinity span::first-letter { font-size: 15px; -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; }
/* 결과 화면 알림: 글자·단추가 없는 협객 그림 자리(화면 위 1/4쯤)에 */
body.battle-result .osc-toast, body.battle-result .orak-hub-toast { top: auto !important; bottom: calc(env(safe-area-inset-bottom, 0px) + 4px) !important; padding: 5px 12px !important; font-size: 12.5px !important; }
/* 상세 이름판: 어느 높이에서든 두 줄(이름 / 역할)이 판 안에 */
.cards-screen .detail-namebar .detail-caption { min-height: 64px !important; height: auto !important; }
html:not([lang="ko"]) .cards-screen .detail-namebar .detail-caption p { display: block !important; white-space: nowrap !important; -webkit-line-clamp: unset; }
/* 탑 층 표시: 한 줄 */
.cards-screen .tower-platform, .cards-screen .tower-platform strong { white-space: nowrap; letter-spacing: -.02em; }
/* 이야기 제목: 다른 언어는 세 줄까지 작게 */
html:not([lang="ko"]) #story-title > span { -webkit-line-clamp: 3; font-size: 13px; }
/* 붉은 단추 글자: 판(세로 12~80%) 가운데로 살짝 위 */
.cards-screen .tower-platform.next { padding-bottom: 5px !important; }
html:not([lang="ko"]) .depart-button { padding-top: 10px !important; }
/* 이야기가 결과 위에 뜰 때는 알림을 맨 아래로 */
body.storying.battle-result .osc-toast, body.storying.battle-result .orak-hub-toast { top: auto !important; bottom: calc(env(safe-area-inset-bottom, 0px) + 2px) !important; }
/* 상세 이름판 좌우 테두리 얇게(긴 일본어 이름) */
.cards-screen .detail-namebar .detail-caption { border-left-width: 10px; border-right-width: 10px; padding-left: 6px !important; padding-right: 4px !important; }
/* 편성 카드 이름: 자간을 좁혀 긴 이름도 한 줄 */
.party-screen .face-tile strong, .hero-grid .hero-tile > strong { letter-spacing: -.04em; }
/* 객잔 수련 말풍선은 협객 그림 위에 */
#chest-time { z-index: 6; }
/* 오락실 알림도 나무판 색·Jua 글꼴 */
.orak-hub-toast { background: #3a2414f2 !important; border: 2px solid #c9a15a !important; font-family: Jua, sans-serif !important; font-weight: normal !important; color: #fff1cf !important; }
/* 결과 화면에서는 알림을 띄우지 않음(계획 v2 6번: 큰 제목·협객·단추를 가리지 않게). 엽전·도전 과제는 오락실·기록장에 그대로 쌓임 */
body.battle-result:not(.storying) .osc-toast, body.battle-result:not(.storying) .orak-hub-toast { visibility: hidden !important; }
/* ===== 3.0 v3: 객잔 출정 패 (inn-v1 시안: 짙은 나무판·금테·양옆 매듭 술) =====
   ui-depart 1446x449 실측 안쪽 판: 제목 칸 가로 26.1~73.9%·세로 19~52%, 지명 칸 가로 30.7~88%·세로 54~79%
   (오른쪽 위·왼쪽 아래 금구름과 금테를 피한 영역). 글자는 이 칸 안 가운데에만 놓는다. */
.depart-button { left: 5% !important; width: 90% !important; height: auto !important; min-height: 0 !important; aspect-ratio: 1446 / 449;
  padding: 0 !important; display: block !important; container-type: size;
  background: url(sprites/ui-depart.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 5px 6px #000a); }
.depart-button strong, .depart-button small { position: absolute; display: block; text-align: center;
  margin: 0; max-width: none !important; white-space: nowrap; overflow: hidden; }
.depart-button strong { left: 26.1%; right: 26.1%; top: 19%; height: 33%; font-family: Jua, sans-serif !important; line-height: 33cqh !important;
  color: #ffd86e; -webkit-text-stroke: 2.4cqh #4a1c06 !important; paint-order: stroke fill; letter-spacing: .06em !important;
  text-shadow: 0 .8cqh 0 #2a0f04; }
.depart-button small { left: 30.7%; right: 12%; top: 54%; height: 25%; font-family: Jua, sans-serif !important; line-height: 25cqh !important;
  color: #fff1cf; -webkit-text-stroke: 1.6cqh #2e1608 !important; paint-order: stroke fill; text-overflow: ellipsis; }
html body .depart-button strong { font-size: 30cqh; }
html body .depart-button small { font-size: 15cqh; }
html:not([lang="ko"]) body .depart-button strong { font-size: 25cqh; letter-spacing: .02em !important; }
html:not([lang="ko"]) body .depart-button small { font-size: 13.5cqh; }
/* ===== 3.0 v3: 아래 메뉴 (inn-v1 시안: 짙은 띠, 그림 위 · 이름 패 아래, 겹치지 않음) =====
   칸 86px = 위 7px + 그림 40px + 사이 3px + 이름 패 24px + 아래 여백. 이름 패는 ui-nav-tab(161x65, 2.48:1) 을 통째로 늘린다. */
#nav { padding: 7px 4px env(safe-area-inset-bottom) !important; gap: 3px !important; align-items: start; }
#nav::before { border: 0 !important; border-image: none !important; inset: 0 !important;
  background: linear-gradient(#3a2414 0, #2a190e 40%, #1c110a 100%) !important;
  box-shadow: inset 0 2px 0 #c9a24e, inset 0 4px 0 #5a3a1c, 0 -3px 6px #0008; filter: none !important; }
#nav .menu-item { justify-content: flex-start !important; gap: 3px !important; padding: 0 !important; min-width: 0; overflow: visible; height: 70px; }
#nav .menu-item.selected { background: none !important; }
#nav .menu-item .game-icon { width: 40px !important; height: 40px !important; margin: 0 !important; flex: none; }
#nav .menu-item.selected .game-icon { filter: drop-shadow(0 0 6px #ffd56a) drop-shadow(0 2px 2px #0009); }
#nav .menu-item > span:last-child { display: block; box-sizing: border-box; width: 100% !important; max-width: 100% !important; height: 24px; min-height: 0 !important;
  margin: 0; padding: 0 5px !important; border: 0 !important; border-radius: 0 !important;
  background: url(sprites/ui-nav-tab.webp) center / 100% 100% no-repeat !important;
  font-family: Jua, sans-serif !important; line-height: 24px !important; color: #fff1cf; text-align: center; letter-spacing: -.02em;
  white-space: nowrap !important; overflow: hidden !important; text-overflow: clip !important; -webkit-text-stroke: 0 !important; text-shadow: 0 1px 1px #000a; }
#nav .menu-item.selected > span:last-child { background-image: url(sprites/ui-nav-tab-on.webp) !important; color: #ffe9a8; }
html body #nav .menu-item > span:last-child { font-size: 12px; }
html:not([lang="ko"]) body #nav .menu-item > span:last-child { font-size: 11px; padding: 0 3px !important; }
/* ===== 3.0 v3: 편성 · 동료 카드 글자 자리 (party-v2 / heroes-v2 시안) ===== */
/* 진형: 이름은 발밑 원 아래 작은 명패로(발을 덮지 않음) */
.party-screen .formation-slot::before { bottom: 21% !important; }
.party-screen .formation-slot .card-sprite { bottom: 18% !important; }
.party-screen .formation-slot strong { left: 50% !important; width: auto !important; max-width: 92%; transform: translateX(-50%); bottom: 0 !important;
  padding: 0 9px; border-radius: 9px; background: #2a1a10e6; border: 1.5px solid #b98d45; box-sizing: border-box;
  font: 13px/19px Jua, sans-serif !important; -webkit-text-stroke: 0 !important; text-shadow: none !important; white-space: nowrap; color: #fff1cf; }
.party-screen .formation-slot.empty strong { background: none; border: 0; font-size: 30px !important; line-height: 1 !important; bottom: 24% !important; }
/* 얼굴 패: 레벨은 액자 위 장식 가운데 작은 패, 상성 화살표는 오른쪽 위 — 얼굴을 가리지 않음 */
.party-screen .face-tile .hero-level { top: 0 !important; bottom: auto !important; right: auto !important; left: 50% !important; transform: translateX(-50%); z-index: 3;
  border: 1px solid #c9a24e;
  font: 10.5px/15px Jua, sans-serif !important; padding: 0 4px !important; border-radius: 5px; background: #2a1a10e6 !important; color: #ffe9a8 !important; }
.party-screen .face-tile .affinity { top: 17% !important; right: 10% !important; }
/* 동료 목록: 레벨은 종이 위쪽 띠의 짙은 작은 패(그림 위에 올림) */
.hero-grid .hero-tile .hero-level { top: 10% !important; right: 11% !important; z-index: 5 !important; padding: 0 5px; border-radius: 6px;
  background: #2a1a10e0; color: #ffe9a8 !important; font: 11.5px/17px Jua, sans-serif !important; }
.hero-grid .hero-tile .red-dot { top: 1% !important; right: 2% !important; }
/* 편성 아래 버튼 줄: 메뉴 바로 위에 붙여 늘 보이게 */
.party-screen .party-actions { position: sticky; bottom: calc(var(--menu-height) + 4px); z-index: 6; margin-top: 8px;
  padding: 6px 0 2px; background: linear-gradient(#0000, #1c110acc 30%); }
.party-screen .foe-tip > span { word-break: keep-all; text-wrap: balance; }
/* ===== 3.0 v3: 수련 버튼 = 붉은 칠 + 금테 + 밝은 글자 (금 바탕에 금 글자 대비 부족 해결) ===== */
.cards-screen .training-card .train-go { padding: 6px 16px 8px !important; border-radius: 12px !important; border: 2px solid #e2b54f !important;
  background: linear-gradient(#c8432a, #9a2414 55%, #7a1a0e) !important; color: #fff1cf !important;
  font: 19px/1.1 Jua, sans-serif !important; -webkit-text-stroke: 3px #4a1206; paint-order: stroke fill;
  box-shadow: inset 0 1px 0 #ffb08a88, inset 0 0 0 1px #5a1408, 0 3px 0 #4a1206, 0 4px 8px #0009 !important; }
.cards-screen .training-card .train-go:disabled { filter: grayscale(.6) brightness(.8); }
/* ===== 3.0 v3: 지도 글자 ===== */
/* 장 이름 패 양끝 화살표: 금테 두른 짙은 나무 동그라미, 못 가는 쪽은 숨김 */
.map-header .map-plaque button { width: 28px !important; height: 28px !important; min-width: 28px !important; min-height: 28px !important; flex: none;
  border-radius: 50%; border: 2px solid #d9ad55 !important; background: radial-gradient(#5a3418, #2a1608) !important; box-shadow: 0 2px 3px #0008;
  color: #ffe08a !important; font: 22px/24px Jua, sans-serif !important; -webkit-text-stroke: 0 !important; padding: 0 !important; opacity: 1 !important; }
.map-header .map-plaque button:disabled { visibility: hidden; }
/* 출정 카드 전투력: 종이 위 짙은 글자 13px, 모자랄 때만 짙은 빨강 */
.departure-card .dep-info p { font: 13px Jua, sans-serif !important; color: #4a2c14 !important; -webkit-text-stroke: 0 !important; }
.departure-card .dep-info p.power-short { color: #8e1a0c !important; }
/* 지도 마디 '도전' 글자: 금 바탕 위 짙은 갈색, 12px */
.map-node small { font: 12px/1.2 Jua, sans-serif !important; color: #5a1a08 !important; -webkit-text-stroke: 0 !important; letter-spacing: 0 !important; }
/* ===== 3.0 v3: 객잔 위 소리·설정 단추 = 금테 두른 둥근 나무 단추 (노란 공통 단추를 이 게임 그림체로) ===== */
.settings .orak-tool, #settings-toggle, body:has(.inn-screen) #settings-toggle { width: 46px !important; height: 46px !important; min-height: 46px !important;
  border-radius: 50% !important; padding: 0 !important; border: 2px solid #d9ad55 !important;
  background: radial-gradient(circle at 50% 38%, #6a4020, #3a2010 70%, #2a1608) !important; color: #ffe08a !important;
  box-shadow: 0 3px 5px #000a, inset 0 1px 0 #ffd88a55 !important; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.settings .orak-tool svg { width: 20px; height: 20px; }
.settings .orak-tool .orak-tool-state { font: 10px/1 Jua, sans-serif; color: #fff1cf; }
.settings .orak-tool.is-off { color: #b9a58a !important; filter: saturate(.6); }
/* ===== 3.0 v3: 결과 작은 버튼(다시·자랑하기)과 패배 조언 버튼, 무림탑 기록 패 = 다른 나무·칠 버튼과 같은 모양 ===== */
#fight .result-small button { border: 0 !important; border-radius: 0 !important; padding: 4px 18px 6px 12px !important;
  background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat !important; color: #fff1cf !important;
  -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; filter: drop-shadow(0 2px 3px #0009); }
.defeat-advice li button, .advice-go { min-width: 64px; padding: 5px 12px 7px !important; border-radius: 11px !important; border: 2px solid #e2b54f !important;
  background: linear-gradient(#c8432a, #9a2414 55%, #7a1a0e) !important; color: #fff1cf !important; font: 15px/1.1 Jua, sans-serif !important;
  -webkit-text-stroke: 3px #4a1206; paint-order: stroke fill; box-shadow: 0 2px 0 #4a1206, 0 3px 6px #0008 !important; white-space: nowrap; }
.cards-screen .tower-week, .cards-screen .tower-best { background: url(sprites/ui-res-btn.webp) center / 100% 100% no-repeat !important;
  color: #fff1cf !important; -webkit-text-stroke: 3px #3a2010; paint-order: stroke fill; padding: 8px 6px 10px !important; }
.cards-screen .tower-best { color: #ffe08a !important; }
/* ===== 3.0 v3: 알림은 화면 위쪽(머리띠 바로 아래)에 — 아래쪽은 출정·편성 버튼 자리라 가리면 안 된다 ===== */
body:not(.battling):not(.at-title):not(.storying) .osc-toast, body:not(.battling):not(.at-title):not(.storying) .orak-hub-toast {
  top: calc(var(--status-height) + 10px) !important; bottom: auto !important; height: auto !important; }
/* 비무 도전 버튼: 다른 언어는 글자 사이를 붙이고 양끝 금구름을 피한다 */
html:not([lang="ko"]) body .cards-screen .duel-go { letter-spacing: 0; font-size: 24px; -webkit-text-stroke-width: 4px; padding: 0 15% 4px; }
/* v3 검수: 동료 카드 별은 액자 아래 막대가 아니라 종이 안, 이름패 바로 위 작은 패 */
.hero-grid .hero-tile:not(:disabled) > .stars { position: absolute; left: 50%; transform: translateX(-50%); bottom: 30.5%; margin: 0; z-index: 4;
  padding: 0 5px; border-radius: 6px; background: #2a1a10d9; font: 10.5px/15px Jua, sans-serif; -webkit-text-stroke: 0; color: #ffcf4a; white-space: nowrap; }
/* v3 검수: 상세 강화 줄. 못 사는 칸도 또렷하게(흐리게 하지 않고 회색 판), 값은 짙은 패 안 12px 한 줄 */
.cards-screen .upgrade-tile.unavailable { opacity: 1; }
.cards-screen .upgrade-tile.unavailable .upgrade-button { filter: grayscale(.85) brightness(.72); }
.cards-screen .upgrade-costs { display: flex; flex-direction: column; align-items: center; gap: 0; margin: 3px auto 0; padding: 1px 4px;
  border-radius: 6px; background: #2a1a10d9; border: 1px solid #8a6a3a; width: max-content; max-width: 100%; }
.cards-screen .upgrade-costs .upgrade-cost { font: 12px/16px Jua, sans-serif; color: #ffe9a8; -webkit-text-stroke: 0; gap: 2px; white-space: nowrap; }
.cards-screen .upgrade-costs .upgrade-cost img { width: 15px; height: 15px; }
.cards-screen .upgrade-tile.unavailable .upgrade-cost { color: #f0d9a8; }
.cards-screen .upgrade-tile:not(.unavailable) .upgrade-costs { border-color: #e0b84e; }
/* v3 검수: 이름패 글자는 판 가운데 */
.cards-screen .detail-namebar .detail-caption { align-items: center !important; text-align: center !important; padding-left: 4px !important; }
.cards-screen .detail-namebar .detail-caption h1, .cards-screen .detail-namebar .detail-caption p { text-align: center !important; width: 100%; padding-inline: 0 !important; }
/* v3 검수: 패배 조언 버튼은 온전한 말. 긴 말은 두 줄까지, 버튼 폭은 모든 줄 같게 */
.defeat-advice li > span { word-break: keep-all; overflow-wrap: anywhere; }
#fight .defeat-advice li .advice-go { width: 38%; max-width: 132px; min-width: 0; white-space: normal !important; text-align: center; line-height: 1.05 !important;
  font-size: 14px !important; word-break: keep-all; padding: 5px 6px 7px !important; }
html:not([lang="ko"]) #fight .defeat-advice li .advice-go { font-size: 12.5px !important; }
/* v3 검수: 기록장 도전 과제 판. 글자는 금테 안쪽에서 띄우고, 달성 도장은 판 안, 날짜 12px */
.osc-book .osc-challenge { padding: 12px 24% 14px 8% !important; }
.osc-book .osc-date { font-size: 12px !important; }
/* v3 검수: 알림은 내용(협객·버튼)을 가리지 않게 위 머리띠 위에 잠깐 얹는다. 이야기 중에는 제목 패 위(건너뛰기 단추는 비킴) */
body:not(.battling):not(.at-title):not(.storying) .osc-toast, body:not(.battling):not(.at-title):not(.storying) .orak-hub-toast {
  top: calc(env(safe-area-inset-top, 0px) + 14px) !important; bottom: auto !important; max-width: 60% !important; padding: 7px 14px !important;
  font-size: 13px !important; line-height: 1.2 !important; z-index: 60 !important; }
body.storying .osc-toast, body.storying .orak-hub-toast { top: calc(env(safe-area-inset-top, 0px) + 12px) !important; bottom: auto !important;
  max-width: 52% !important; font-size: 12.5px !important; padding: 6px 12px !important; z-index: 60 !important; }
/* v3 검수: 승리·패배 글자가 붓 띠 위아래로 삐져나오지 않게 붓 띠를 글자 칸 높이에 꽉 채운다 */
#fight .result-panel .result-title { background-size: 100% 104% !important; background-position: center !important; }
.hero-grid .hero-tile:not(:disabled) > strong { margin-bottom: 17px; white-space: nowrap; }
.hero-grid .hero-tile:not(:disabled) > .stars { display: none !important; }
.hero-grid .hero-tile .star-count { margin-left: 4px; color: #ffcf4a; font-size: .82em; }
/* v3 검수: 결과판 배경은 화면 맨 위부터 전장 그림(시안처럼). 어두운 위 띠 없음 */
#fight .result-panel { background: radial-gradient(ellipse 120% 90% at 50% 40%, #0000 40%, #1a120c99 100%), linear-gradient(#0000 55%, #20160e80),
  var(--result-bg, none) center top / cover no-repeat, #1c140e !important; }
#fight .result-panel[data-outcome='lose'] { background: radial-gradient(ellipse 120% 90% at 50% 40%, #2a1a2a40 30%, #140c14c0 100%),
  var(--result-bg, none) center top / cover no-repeat, #1c140e !important; }
/* v3 검수: 장 넘김 화살표는 이름 패 바깥 양옆 둥근 나무 단추 */
.map-header .map-turn { width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important; flex: none; margin: 0 !important;
  border-radius: 50%; border: 2px solid #d9ad55 !important; background: radial-gradient(#6a3e1c, #2a1608) !important; box-shadow: 0 2px 4px #0009;
  color: #ffe08a !important; font: 26px/28px Jua, sans-serif !important; -webkit-text-stroke: 0 !important; padding: 0 0 3px !important; opacity: 1 !important; }
.map-header .map-turn:disabled { visibility: hidden; }
body:has(.map-screen) .map-header { gap: 4px; }
.map-header .map-plaque { padding-inline: 6px !important; }
#fight .result-panel .result-title { line-height: .8 !important; }
.hero-grid .hero-tile .hero-level { top: 12.5% !important; }
/* 글자 실제 획(위아래 끝)이 붓 띠 안쪽에 들도록: 조금 작게, 획 가운데를 띠 가운데로 */
#fight .result-panel .result-title { font-size: 74px; padding-top: 12px !important; padding-bottom: 0 !important; }
@media (max-height: 700px) { #fight .result-panel .result-title { font-size: 51px; padding-top: 8px !important; } }
/* v3 검수(다국어): 상세 이름패. 이름은 금테에서 띄우고, 직업 줄은 말줄임 없이 두 줄까지 */
html:not([lang="ko"]) body .cards-screen .detail-namebar .detail-caption h1 { font-size: 19px; line-height: 1.05 !important; margin-top: 2px; }
html:not([lang="ko"]) .cards-screen .detail-namebar .detail-caption p { white-space: normal !important; text-overflow: clip !important; overflow: visible !important;
  font-size: 11px !important; line-height: 1.1 !important; display: block !important; -webkit-line-clamp: unset !important; }
.cards-screen .detail-namebar .detail-power { padding-inline: 16px !important; justify-content: center; text-align: center; }
html:not([lang="ko"]) .cards-screen .detail-namebar .detail-caption { padding-top: 3px !important; padding-bottom: 7px !important; }
/* v3 검수(다국어): 지도 출정 단추 글자는 양끝 금구름 장식 안쪽(판 12~88%)에 */
html:not([lang="ko"]) body .departure-card .map-actions button.primary { min-width: 118px !important; padding: 0 17% 3px !important; font-size: 17px; letter-spacing: 0; }
/* 편성 출정: 다른 언어는 조금 작게 */
html:not([lang="ko"]) body .party-screen .party-go { font-size: 23px; }
/* 무림탑 두 패: 글자는 세로 가운데 */
.cards-screen .tower-week, .cards-screen .tower-best { display: flex !important; align-items: center; justify-content: center; text-align: center; }
/* v3 검수(다국어): 동료 이름패는 종이 폭 안에서 글자를 줄인다(별 포함) */
.hero-grid .hero-tile:not(:disabled) > strong { max-width: 74%; overflow: hidden; box-sizing: border-box; }
/* 전투 중 알림은 오른쪽 위 소리·진동 단추를 피한다 */
body.battling:not(.battle-result) .osc-toast { max-width: 52% !important; }
/* 패배 조언 글: 다른 언어는 조금 작게, 줄 간격 촘촘히 */
html:not([lang="ko"]) .defeat-advice li > span { font-size: 12.5px; line-height: 1.15; }
/* 결과 아래 다른 게임 이름은 세 줄까지(말줄임 없음) */
.result-panel .result-next strong { -webkit-line-clamp: 3 !important; }
/* v3 검수(다국어): 둥근 단추의 화살표는 글꼴(언어마다 기준선이 다름) 대신 선으로 그려 늘 한가운데 */
.cards-screen .detail-prev, .cards-screen .detail-next, .map-header .map-turn, .cards-screen .tower-controls > button:first-child, .cards-screen .tower-controls > button:last-child {
  font-size: 0 !important; color: transparent !important; display: grid !important; place-items: center; }
.cards-screen .detail-prev::before, .cards-screen .detail-next::before, .map-header .map-turn::before,
.cards-screen .tower-controls > button:first-child::before, .cards-screen .tower-controls > button:last-child::before {
  content: ''; width: 9px; height: 9px; border: solid #fff1cf; border-width: 0 0 3px 3px; border-radius: 1px; filter: drop-shadow(0 1px 0 #3a2010); }
.cards-screen .detail-prev::before, .map-header .map-turn:first-child::before { transform: translateX(2px) rotate(45deg); }
.cards-screen .detail-next::before { transform: translateX(-2px) rotate(-135deg); }
.map-header .map-turn::before { border-color: #ffe08a; transform: translateX(-2px) rotate(-135deg); }
.map-header .map-turn:not(:last-child)::before { transform: translateX(2px) rotate(45deg); }
.cards-screen .tower-controls > button:first-child::before { transform: translateY(-2px) rotate(-45deg); }
.cards-screen .tower-controls > button:last-child::before { transform: translateY(2px) rotate(135deg); }
/* 비무 점수는 한 줄(글자 크기를 줄여 맞춤), 수련 띠 다른 언어는 조금 작게 */
.cards-screen .duel-score { white-space: nowrap; }
html:not([lang="ko"]) .cards-screen .training-banner { font-size: 15px; }
.hero-grid .hero-tile:not(:disabled) > strong { max-width: 78%; }
.hero-grid .hero-tile .hero-level .star-count { margin: 0; font-size: 1em; color: #ffcf4a; }
html:not([lang="ko"]) body .departure-card .map-actions button.primary { min-width: 134px !important; padding: 0 15% 3px !important; }
.hero-grid .hero-tile:not(:disabled) > strong { max-width: 74%; padding: 1px 5px !important; text-overflow: clip !important; }
html:not([lang="ko"]) .hero-grid .hero-tile:not(:disabled) > strong { padding: 1px 2px !important; letter-spacing: -.06em; }
html:not([lang="ko"]) .hero-grid .hero-tile:not(:disabled) > strong { max-width: 77%; }
/* v3 검수(대비·작은 글자): 붕어빵 대비 도구 기준 4.5:1, 11.5px 이상 */
.result-panel > .orak-home-button { background: #2a1a10d9 !important; border-color: #e0b84e !important; color: #fff1cf !important; }
.result-panel > .orak-home-button * { color: #fff1cf !important; }
.cards-screen .skill-desc { color: #2e1a0a !important; }
.departure-card .map-reward, .departure-card .map-reward * { color: #2e1a0a !important; font-size: 12.5px; }
.departure-card .dep-info p.power-short { color: #7a1206 !important; }
.cards-screen .training-card small { font-size: 12px !important; }
.duel-screen .duel-opponents figcaption { font-size: 11.5px !important; }
.party-screen .face-tile .hero-level { font-size: 11.5px !important; }
.hero-grid .hero-tile:disabled > .stars { font-size: 12px !important; }
html:not([lang="ko"]) body #nav .menu-item > span:last-child { font-size: 12px; padding: 0 2px !important; letter-spacing: -.02em; }
.settings .orak-tool .orak-tool-state { font-size: 11.5px !important; }
.result-panel .result-next strong { font-size: 11.5px !important; }
.result-goals li.miss { color: #5e4a36 !important; }
/* v3 검수(다국어 2차) */
/* 전투력 숫자를 판 가운데에, ⚔ 아이콘은 숫자 왼쪽 바깥에 붙임 */
html:not([lang="ko"]) .cards-screen .detail-namebar .detail-power strong { position: relative; }
html:not([lang="ko"]) .cards-screen .detail-namebar .detail-power strong::before { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); margin-right: 2px; }
/* 무림탑 다음 층 붉은 패: 글자가 금테 안쪽에 들게 패를 글자보다 넓게 */
.cards-screen .tower-platform.next { width: auto !important; min-width: 64px; padding-inline: 13px !important; box-sizing: border-box; white-space: nowrap; }
/* 결과 주 단추(무림탑 ▶ 등): 다른 언어는 양끝 구름 장식 안쪽으로 */
html:not([lang="ko"]) #fight .result-buttons .result-main { padding-inline: 14% !important; font-size: 19px; }
/* 상세 강화 화살표 글자 크기 */
.cards-screen .upgrade-button b { font-size: 24px !important; line-height: 30px; }
/* 일본어·태국어·중국어 이름패: 글꼴 줄 높이가 커서 두 줄이 겹치지 않게 */
html:not([lang="ko"]) .cards-screen .detail-namebar .detail-caption h1 { line-height: 1.22 !important; margin: 0 !important; }
html:not([lang="ko"]) .cards-screen .detail-namebar .detail-caption p { line-height: 1.25 !important; margin: 0 !important; }
/* 비무 점수: 다른 언어는 두 줄까지 허용하고 작게 */
html:not([lang="ko"]) body .cards-screen .duel-board .duel-score { white-space: normal !important; font-size: 20px; line-height: 1.15; }
/* 이야기 중 알림은 건너뛰기 단추를 비키도록 더 좁게 */
body.storying .osc-toast, body.storying .orak-hub-toast { max-width: 46% !important; font-size: 12px !important; }
/* 전투 중 알림: 왼쪽에 붙여 오른쪽 소리·진동 단추와 떨어지게 */
body.battling:not(.battle-result) .osc-toast { left: 10px !important; right: auto !important; transform: none !important; max-width: calc(100% - 124px) !important; }
html:not([lang="ko"]) body .cards-screen .detail-namebar .detail-caption h1 { overflow: visible !important; text-overflow: clip !important; }
.cards-screen .tower-platform.next { height: auto !important; min-height: 28px; padding-block: 3px 6px !important; }
.cards-screen .upgrade-button b { height: 28px !important; }
body.storying .osc-toast, body.storying .orak-hub-toast { max-width: 40% !important; }
html:not([lang="ko"]) body .cards-screen .detail-namebar .detail-power strong { overflow: visible !important; }
/* 화살표 선은 단추 정가운데에 절대 위치(글자 칸과 줄이 나뉘지 않게) */
.map-header .map-turn, .cards-screen .tower-controls > button:first-child, .cards-screen .tower-controls > button:last-child { position: relative; }
.cards-screen .detail-prev::before, .cards-screen .detail-next::before, .map-header .map-turn::before,
.cards-screen .tower-controls > button:first-child::before, .cards-screen .tower-controls > button:last-child::before {
  position: absolute; left: 50%; top: 50%; margin: -6px 0 0 -6px; box-sizing: content-box; }
