/* ===== 4차: 시안 그대로 (inn-v1 · heroes-v2). 이 파일은 style.css 뒤에 읽어 이전 규칙을 덮는다.
   좌표는 시안(390x693)을 잰 값. 위 띠 56px, 아래 메뉴 90px, 그 사이가 장면. ===== */
:root { --status-height: calc(56px + env(safe-area-inset-top, 0px)); --menu-height: calc(90px + env(safe-area-inset-bottom, 0px)); }

/* ---- 위 띠 (객잔): 짙은 나무 띠 · 만두 메달 · 전투력 · 은/철 · 깃발 ---- */
html body #wallet { height: var(--status-height); padding: env(safe-area-inset-top, 0px) 8px 0; gap: 8px; align-items: center; }
html body #wallet::before { inset: 0; border: 0; border-image: none; background: url(sprites/ui-v4-topbar.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 3px 4px #0009); }
html body #wallet.sub-bar::before { background: linear-gradient(#1a0f08e0, #1a0f0890 70%, transparent); filter: none; }
html body #wallet > .game-icon:first-child { width: 50px; height: 50px; margin-left: 10px; }
html body #wallet .power-value { display: grid; justify-items: center; min-width: 88px; }
html body #wallet .power-value small { font-size: 12px; color: #f6e2b4; -webkit-text-stroke: 3px #2a1608; paint-order: stroke fill; line-height: 1; }
html body #wallet .power-value strong { font-size: 26px; color: #ffd86e; -webkit-text-stroke: 5px #3a1a08; paint-order: stroke fill; line-height: 1.05; }
html body #wallet:not(.sub-bar) .wallet-resources { margin-left: auto; padding-left: 12px; border-left: 2px solid #8a653480; display: grid; gap: 0; font-size: 14px; }
html body #wallet:not(.sub-bar) .wallet-resources .game-icon { width: 24px; height: 20px; }
html body #wallet .wallet-party { margin-right: 12px; }
html body #wallet .wallet-party .game-icon { width: 34px; height: 40px; }
/* ---- 위 띠 (객잔 밖): 둥근 뒤로 단추 · 현판 · 은/철 알약 한 줄 (heroes-v2) ---- */
html body #wallet.sub-bar { gap: 6px; }
html body #wallet.sub-bar .wood-back { width: 44px; height: 44px; min-width: 44px !important; min-height: 44px !important;
  background: url(sprites/ui-v4-back.webp) center / 100% 100% no-repeat !important; box-shadow: none !important; filter: drop-shadow(0 2px 3px #0009); }
html body #wallet.sub-bar .sub-title { max-width: none; flex: 0 0 auto; min-width: 120px; padding: 3px 4px 4px !important; text-align: center;
  background: none !important; border-style: solid !important; border-color: transparent !important; border-width: 7px 30px 8px 30px !important;
  border-image: url(sprites/ui-v4-title-plaque.webp) 22 64 22 64 fill stretch !important;
  color: #ffe08a; font-size: 19px; line-height: 1.2; -webkit-text-stroke: 4px #3a1a08; paint-order: stroke fill; letter-spacing: .02em;
  overflow: visible !important; text-overflow: clip !important; white-space: nowrap; }
html body #wallet.sub-bar .wallet-resources { display: flex !important; flex-direction: row !important; gap: 5px; margin-left: auto; }
html body #wallet.sub-bar .wallet-resources > span { display: flex !important; align-items: center; gap: 3px; }
html body #wallet.sub-bar .wallet-resources > span { background: url(sprites/ui-v4-pill.webp) center / 100% 100% no-repeat; border: 0;
  padding: 3px 9px 3px 4px; min-width: 70px; height: 26px; font-size: 13.5px; }
html body #wallet.sub-bar .wallet-resources .game-icon, html body #wallet.sub-bar .wallet-resources img { width: 24px; height: 20px; }

/* ---- 소리 · 설정: 네모 단추 (inn-v1 오른쪽 위, 노란색 = 소리 켬) ---- */
html body:has(.inn-screen) .settings { position: fixed; top: calc(var(--status-height) + 10px); right: max(12px, calc(50% - 260px + 12px)); left: auto;
  display: flex; gap: 8px; opacity: 1; margin: 0; }
html body:has(.inn-screen) .settings > #mute, html body:has(.inn-screen) .settings > #settings-toggle { width: 40px !important; height: 38px !important; min-width: 40px !important; min-height: 38px !important;
  padding: 0 !important; border: 0 !important; border-radius: 10px !important; box-shadow: none !important; font-size: 0 !important; color: transparent !important;
  background: url(sprites/ui-v4-btn-settings.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 2px 3px #0009) !important; }
html body:has(.inn-screen) .settings > #mute > *, html body:has(.inn-screen) .settings > #settings-toggle > * { display: none !important; }
html body:has(.inn-screen) .settings > #mute { background-image: url(sprites/ui-v4-btn-sound-on.webp) !important; }
html body:has(.inn-screen) .settings > #mute.is-off { background-image: url(sprites/ui-v4-btn-sound-off.webp) !important; }
html body:has(.inn-screen) .settings > #mute::before, html body:has(.inn-screen) .settings > #mute::after,
html body:has(.inn-screen) .settings > #settings-toggle::before, html body:has(.inn-screen) .settings > #settings-toggle::after { display: none !important; }

/* ---- 아래 메뉴: 큰 그림 · 나무 이름 패 · 고른 칸은 금빛 테 (inn-v1 · heroes-v2) ---- */
html body #nav { height: var(--menu-height); padding: 6px 3px env(safe-area-inset-bottom, 0px) !important; gap: 1px !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important; align-items: stretch; }
html body #nav::before { border: 0; border-image: none; background: linear-gradient(#3a2214, #24150c); border-top: 2px solid #8a6534; filter: drop-shadow(0 -3px 4px #0008); }
html body #nav .menu-item { position: relative; display: flex !important; flex-direction: column; align-items: center; justify-content: flex-start !important;
  padding: 2px 0 0 !important; background: none !important; min-height: 0 !important; }
html body #nav .menu-item .game-icon { width: 46px !important; height: 44px !important; margin: 0 0 -3px !important; opacity: 1 !important; filter: drop-shadow(0 2px 2px #000a) !important; }
html body #nav .menu-item > span:last-child { display: block; width: 100%; max-width: 54px; min-height: 0 !important; height: 24px; padding: 0 2px !important;
  background: url(sprites/ui-v4-nav-tab.webp) center / 100% 100% no-repeat !important; border: 0 !important; border-radius: 0;
  color: #fff3d6 !important; font: 15.5px/24px Jua, sans-serif !important; text-align: center; white-space: nowrap !important; overflow: hidden; text-overflow: clip;
  -webkit-text-stroke: 0 !important; }
html body #nav .menu-item.selected::before { content: ''; position: absolute; z-index: -1; left: 50%; top: -3px; width: 58px; height: 80px; transform: translateX(-50%);
  background: url(sprites/ui-v4-nav-sel.webp) center / 100% 100% no-repeat; }
html body #nav .menu-item.selected > span:last-child { color: #ffe08a !important; background-image: url(sprites/ui-v4-nav-tab.webp) !important; }
html body #nav .menu-item > span:last-child { position: relative; z-index: 2; }
html body #nav .menu-item .game-icon { position: relative; z-index: 1; }
html body #nav .menu-item.selected .game-icon { transform: translateY(-1px) scale(1.06); }
html:not([lang="ko"]) body #nav .menu-item > span:last-child { font-size: 10.5px !important; line-height: 22px !important; letter-spacing: -.02em; }

/* ---- 객잔 장면 (inn-v1): 빈 배경 위에 벽보 · 상자 · 협객 넷 · 출정 패 ---- */
html body:has(.inn-screen) { background: #2a1a10 url(sprites/bg-v4-inn.webp) center top / cover no-repeat fixed; }
html body:has(.inn-screen) main.orak-stage { background: url(sprites/bg-v4-inn.webp) center top / cover no-repeat; padding: var(--status-height) 0 var(--menu-height) !important; }
html body .inn-screen { background: none !important; }
html body .inn-scene { height: calc(100dvh - var(--status-height) - var(--menu-height)) !important; min-height: 440px; }
html body .inn-poster { position: absolute; z-index: 3; left: 74%; top: 11%; width: 18%; aspect-ratio: 370 / 365; padding: 6% 3% 2% !important;
  border: 0 !important; box-shadow: none !important; transform: rotate(-4deg);
  background: url(sprites/ui-v4-poster.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 3px 3px #0008);
  display: grid; place-items: center; }
html body .inn-poster strong { font: 18px/1.05 Jua, sans-serif; color: #c4241a; word-break: keep-all; text-align: center; }
html:not([lang="ko"]) body .inn-poster strong { font-size: 10.5px; padding: 0 3px; overflow-wrap: anywhere; }
html body .treasure-chest { left: 70% !important; right: auto !important; top: 21% !important; width: 24% !important; height: auto !important; aspect-ratio: 396 / 313;
  padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
html body .treasure-chest .game-icon { width: 100% !important; height: 100% !important; border: 0 !important; background: none !important; }
html body #chest-time { left: 68% !important; right: auto !important; top: 32% !important; width: 28% !important; height: 22px; padding: 0 6px !important;
  background: url(sprites/ui-v4-inn-label.webp) center / 100% 100% no-repeat !important; border: 0 !important; border-radius: 0 !important;
  box-shadow: none !important; color: #3a2010 !important; font: 11.5px/22px Jua, sans-serif !important; text-align: center; white-space: nowrap; overflow: hidden;
  -webkit-text-stroke: 0 !important; text-shadow: none !important; }
/* 협객: 캔버스 260x300 을 0.72배(187x216), 발끝은 캔버스 위에서 204px · 가로 94px. 시안 발 위치(장면 높이 기준) 앞줄 53% · 뒷줄 75.5% */
html body .inn-party { position: absolute; inset: 0 !important; height: auto !important; }
html body .inn-hero { position: absolute !important; width: 187px !important; height: 240px !important; padding: 0 !important; background: none !important; border: 0 !important;
  box-shadow: none !important; left: calc(29% - 94px) !important; top: calc(53% - 204px) !important; z-index: 2; }
html body .inn-hero:nth-child(2) { left: calc(64% - 94px) !important; top: calc(53% - 204px) !important; }
html body .inn-hero:nth-child(3) { left: calc(31% - 94px) !important; top: calc(75.5% - 204px) !important; z-index: 3; }
html body .inn-hero:nth-child(4) { left: calc(67% - 94px) !important; top: calc(75.5% - 204px) !important; z-index: 3; }
html body .inn-hero canvas { position: absolute !important; left: 0 !important; top: 0 !important; width: 187px !important; height: 216px !important; filter: saturate(1.12) contrast(1.06); }
html body .inn-hero > span { position: absolute !important; left: 50% !important; top: 199px !important; bottom: auto !important; transform: translateX(-50%) !important;
  min-width: 60px; height: 21px; padding: 0 10px !important; background: url(sprites/ui-v4-inn-name.webp) center / 100% 100% no-repeat !important;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  color: #3a2010 !important; font: 14px/21px Jua, sans-serif !important; -webkit-text-stroke: 0 !important; text-shadow: none !important; white-space: nowrap; }
html body .depart-button { top: auto !important; bottom: 2.5% !important; left: 5% !important; width: 90% !important; }
html body .depart-button strong { font-size: 44cqh !important; top: 15% !important; height: 44% !important; line-height: 44cqh !important; color: #ffd45a !important;
  -webkit-text-stroke: 3.2cqh #3e1404 !important; text-shadow: 0 1cqh 0 #220a02 !important; letter-spacing: .04em !important; }
html body .depart-button small { font-size: 19cqh !important; top: 59% !important; left: 24% !important; right: 14% !important; }
html:not([lang="ko"]) body .depart-button strong { font-size: 30cqh !important; }
html:not([lang="ko"]) body .depart-button small { font-size: 14cqh !important; }
@media (max-height: 640px) { html body .inn-hero { transform: scale(.88); transform-origin: 94px 204px; } }

/* ---- 동료 (heroes-v2): 금테 종이 카드 3열 ---- */
html body:has(.cards-screen) { background: #2a1a10 url(sprites/bg-v4-heroes.webp) center top / cover no-repeat fixed; }
html body:has(#screen .hero-grid) main.orak-stage { background: url(sprites/bg-v4-heroes.webp) center top / cover no-repeat fixed !important; }
html body .hero-grid { display: grid !important; grid-template-columns: repeat(3, 100px) !important; justify-content: center; gap: 6px 10px !important;
  padding: 34px 0 8px !important; margin: 0 !important; }
html body .hero-grid .hero-tile { position: relative !important; width: 100px !important; height: 145px !important; aspect-ratio: auto !important; padding: 0 !important; margin: 0 !important;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important; overflow: visible !important; display: block !important; opacity: 1 !important;
  background: url(sprites/ui-v4-card.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 3px 4px #000a) !important; }
html body .hero-grid .hero-tile.locked { background-image: url(sprites/ui-v4-card-lock.webp) !important; }
html body .hero-grid .hero-tile::before, html body .hero-grid .hero-tile::after { display: none !important; }
html body .hero-grid .hero-tile .card-sprite { position: absolute !important; left: -21px !important; top: -27px !important; width: 210px !important; height: 143px !important;
  object-fit: fill; pointer-events: none; z-index: 1; }
html body .hero-grid .hero-tile .card-sprite.silhouette { filter: brightness(0) opacity(.86) !important; }
html body .el-badge { position: absolute; z-index: 3; left: 4px; top: 4px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0 5px 4px 0;
  background: center / 100% 100% no-repeat; color: #fff3d6; font: 15px/1 Jua, sans-serif; -webkit-text-stroke: 3px #1a0f08; paint-order: stroke fill;
  filter: drop-shadow(0 1px 1px #0008); }
html body .el-badge.el-wood { background-image: url(sprites/ui-v4-el-wood.webp); }
html body .el-badge.el-fire { background-image: url(sprites/ui-v4-el-fire.webp); }
html body .el-badge.el-earth { background-image: url(sprites/ui-v4-el-earth.webp); }
html body .el-badge.el-metal { background-image: url(sprites/ui-v4-el-metal.webp); }
html body .el-badge.el-water { background-image: url(sprites/ui-v4-el-water.webp); }
html body .hero-grid .hero-tile .hero-level { position: absolute !important; z-index: 3; right: 11px !important; left: auto !important; top: 10px !important;
  padding: 0 !important; background: none !important; border: 0 !important; color: #3a1e0c !important; font: 14px/1 Jua, sans-serif !important; -webkit-text-stroke: 0 !important; }
html body .hero-grid .hero-tile .hero-name { position: absolute !important; z-index: 3; left: 12px !important; right: 12px !important; top: 100px !important; height: 19px; margin: 0 !important;
  padding: 0 4px !important; max-width: none !important; background: url(sprites/ui-v4-card-name.webp) center / 100% 100% no-repeat !important; border: 0 !important; border-radius: 0 !important;
  color: #3a2010 !important; font: 14px/19px Jua, sans-serif !important; text-align: center; white-space: nowrap; overflow: hidden; -webkit-text-stroke: 0 !important; letter-spacing: 0 !important; }
html body .hero-grid .hero-tile .hero-stars { position: absolute; z-index: 3; left: 13px; right: 13px; top: 121px; height: 14px; display: flex; justify-content: center; gap: 1px; }
html body .hero-grid .hero-tile .hero-stars i { flex: 0 0 14px; height: 14px; background: url(sprites/ui-v4-star.webp) center / contain no-repeat; }
html body .hero-grid .hero-tile .hero-stars i.off { background-image: url(sprites/ui-v4-star-empty.webp); }
html body .hero-grid .hero-tile .card-lock { position: absolute; z-index: 3; left: 32px; top: 46px; width: 36px; height: auto; }
html body .hero-grid .hero-tile.locked .hero-name { top: 104px !important; left: 9px !important; right: 9px !important; height: 20px; font-size: 11.5px !important; line-height: 20px !important; }
html body .hero-grid .hero-tile .new-stamp { position: absolute; z-index: 4; right: -4px; top: 66px; padding: 3px 7px; transform: rotate(-12deg);
  background: url(sprites/ui-v4-stamp.webp) center / 100% 100% no-repeat; color: #fff3d6; font: 13px/1.1 Jua, sans-serif; white-space: nowrap; }
html:not([lang="ko"]) body .hero-grid .hero-tile .new-stamp { font-size: 10.5px; }
html body .hero-grid .hero-tile .red-dot { right: -3px; top: -3px; z-index: 4; }
html body .heroes-tip { margin: 8px 12px 14px !important; padding: 12px 34px !important; min-height: 50px; display: grid; place-items: center;
  background: url(sprites/ui-v4-tip-scroll.webp) center / 100% 100% no-repeat; color: #3a2010; font: 14px/1.25 Jua, sans-serif; text-align: center; }
html:not([lang="ko"]) body .hero-grid .hero-tile .hero-name { font-size: 12px !important; letter-spacing: -.02em !important; }
html body .hero-grid .hero-tile:disabled > strong.hero-name { display: block !important; }
html body .hero-grid .hero-tile.locked .el-badge { display: none; }
html body .hero-grid .hero-tile .red-dot { display: none !important; }
html body .hero-grid .hero-tile .hero-level { display: block !important; }
html body .hero-grid .hero-tile .card-sprite:not(.silhouette) { filter: saturate(1.12) contrast(1.06); }
html body .hero-grid .hero-tile .new-stamp { font-size: 15px; padding: 4px 9px 5px; color: #fff6e0; -webkit-text-stroke: 2px #7a0e06; paint-order: stroke fill; right: -8px; top: 70px; }
html body #screen.cards-screen:has(.hero-grid) { padding-top: 0 !important; }
html body:has(#screen .hero-grid) main.orak-stage { padding-top: var(--status-height) !important; }
html body .hero-grid .hero-tile .card-sprite { z-index: 1 !important; top: -14px !important; }
html body .hero-grid .hero-tile .hero-level, html body .hero-grid .hero-tile .el-badge, html body .hero-grid .hero-tile .hero-name, html body .hero-grid .hero-tile .hero-stars { z-index: 5 !important; }
html body .hero-grid .el-badge { width: 36px; height: 36px; left: -3px; top: -3px; font-size: 17px; }
html body .hero-grid .hero-tile .hero-stars { top: 120px; height: 16px; gap: 0; left: 10px; right: 10px; }
html body .hero-grid .hero-tile .hero-stars i { flex: 0 0 16px; height: 16px; }
/* 협객 수가 적을 때(새 저장): 한 명은 바닥 가운데, 세 명째는 뒷줄 가운데 */
html body .inn-hero:only-child { left: calc(50% - 94px) !important; top: calc(62% - 204px) !important; }
html body .inn-hero:nth-child(3):last-child { left: calc(48% - 94px) !important; }
/* 키 큰 폰: 장면이 길어지는 만큼 협객도 키운다(발 위치 기준) */
@media (min-height: 780px) { html body .inn-hero { transform: scale(1.14); transform-origin: 94px 204px; } }
@media (min-height: 860px) { html body .inn-hero { transform: scale(1.26); } }
@media (min-height: 860px) { html body .treasure-chest { width: 26% !important; } html body .inn-poster { width: 20%; } }

/* 좁은 폰·긴 언어: 값 알약은 한 줄, 잠긴 칸 합류 글자는 두 줄까지, 팁·상자 글자 칸은 넓게 */
html body #wallet.sub-bar .wallet-resources > span { white-space: nowrap; }
@media (max-width: 380px) {
  html body #wallet.sub-bar { gap: 4px; padding: 0 5px; }
  html body #wallet.sub-bar .sub-title { min-width: 96px; font-size: 16.5px; border-width: 7px 22px 8px 22px !important; }
  html body #wallet.sub-bar .wallet-resources { gap: 3px; }
  html body #wallet.sub-bar .wallet-resources > span { min-width: 0; padding: 3px 7px 3px 3px; font-size: 12px; gap: 2px; }
  html body #wallet.sub-bar .wallet-resources .game-icon, html body #wallet.sub-bar .wallet-resources img { width: 20px; height: 17px; }
}
html:not([lang="ko"]) body .hero-grid .hero-tile.locked .hero-name.join-at { top: 99px !important; height: 30px; white-space: normal !important; overflow: hidden;
  display: grid !important; place-items: center; font-size: 10.5px !important; line-height: 12px !important; padding: 0 4px; word-break: keep-all; }
html:not([lang="ko"]) body .heroes-tip { font-size: 12.5px; padding: 12px 38px !important; line-height: 1.15; }
html:not([lang="ko"]) body #chest-time { left: 64% !important; width: 34% !important; height: 32px; padding: 0 10px !important; white-space: normal; display: grid; place-items: center;
  font: 10.5px/12px Jua, sans-serif !important; word-break: keep-all; }
/* 시안 객잔에서 만두는 다른 협객보다 한 뼘 크다(시안 215px : 지금 190px). 발끝 기준으로 키운다. */
html body .inn-hero[data-hero="mandu"] canvas { transform: scale(1.12); transform-origin: 94px 204px; }

/* ===== 4차 디테일 (시안 2배 대조, 2026-11-28 23:4x) ===== */
/* 위 띠: '전투력'은 왼쪽 정렬, 숫자는 크게. 은·철 숫자는 크림색 */
html body #wallet .power-value { justify-items: start; min-width: 96px; }
html body #wallet .power-value small { font-size: 13px; padding-left: 2px; }
html body #wallet .power-value strong { font-size: 29px; -webkit-text-stroke: 6px #2e1406; }
html body #wallet:not(.sub-bar) .wallet-resources { font-size: 15px; color: #fff3dc; }
/* 벽보: 더 기울이고 짙은 붉은 굵은 글자 */
html body .inn-poster { transform: rotate(-7deg); }
html body .inn-poster strong { font-size: 18.5px; line-height: 1.05; color: #a3110b; -webkit-text-stroke: .7px #a3110b; }
/* 수련 상자: 분홍 테 대신 금빛 후광과 빛줄기 */
html body .treasure-chest { overflow: visible !important; }
html body .treasure-chest::before { content: ''; position: absolute; z-index: 0; left: -30%; right: -30%; top: -55%; bottom: 35%; pointer-events: none;
  background: repeating-conic-gradient(from -90deg at 50% 100%, #ffd96acc 0 5deg, #ffd96a00 5deg 15deg);
  -webkit-mask: radial-gradient(farthest-side at 50% 100%, #000 30%, #0000 100%); mask: radial-gradient(farthest-side at 50% 100%, #000 30%, #0000 100%); }
html body #chest-time { font-size: 12.5px !important; color: #3a1e0c !important; -webkit-text-stroke: .3px #3a1e0c !important; }
/* 협객: 시안처럼 선명하게, 이름패 글자 굵게 */
html body .inn-hero canvas { filter: saturate(1.22) contrast(1.12) !important; }
html body .inn-hero > span { font-size: 15px !important; color: #3a1e0c !important; -webkit-text-stroke: .35px #3a1e0c !important; min-width: 66px; }
/* 출정: 굵고 큰 금색 글자에 두꺼운 짙은 테두리, 아래 판 이름은 크림색 큰 글자 */
html body .depart-button strong { font-size: 47cqh !important; top: 15% !important; height: 48% !important; line-height: 48cqh !important;
  color: #ffd650 !important; -webkit-text-stroke: 7cqh #2e0d03 !important; paint-order: stroke fill !important;
  text-shadow: 0 2cqh 0 #1e0802, 0 0 3cqh #ffb23a55 !important; letter-spacing: .06em !important; }
html body .depart-button small { font-size: 22cqh !important; top: 60% !important; left: 18% !important; right: 12% !important;
  color: #fff1d2 !important; -webkit-text-stroke: 5cqh #2a0e04 !important; paint-order: stroke fill !important; }
html:not([lang="ko"]) body .depart-button strong { font-size: 38cqh !important; }
html:not([lang="ko"]) body .depart-button small { font-size: 16cqh !important; }
/* 아래 메뉴: 밝은 나무 판, 더 큰 그림, 차분한 테의 이름 패, 고른 칸은 그림과 이름을 함께 감싸는 금빛 테 */
html body #nav::before { background:
    repeating-linear-gradient(180deg, #0000 0 21px, #2a150a55 21px 23px),
    linear-gradient(#4a2c18, #3a2112 60%, #2a170c) !important; border-top: 3px solid #241208 !important; box-shadow: inset 0 2px 0 #8a5e36; }
html body #nav .menu-item .game-icon { width: 50px !important; height: 48px !important; margin-bottom: -5px !important; }
html body #nav .menu-item > span:last-child { background-image: url(sprites/ui-v4-nav-tab2.webp) !important; color: #fff1d6 !important; font-size: 16px !important; }
html body #nav .menu-item.selected > span:last-child { background-image: url(sprites/ui-v4-nav-tab2.webp) !important; color: #fff6dc !important; }
html body #nav .menu-item.selected::before { top: -5px; width: 62px; height: calc(100% - env(safe-area-inset-bottom, 0px) + 2px); }
html body #nav .menu-item.tower-locked .game-icon { opacity: 1 !important; filter: drop-shadow(0 2px 2px #000a) !important; }
html body #nav .menu-item.tower-locked > span:last-child { opacity: 1 !important; }
html:not([lang="ko"]) body #nav .menu-item > span:last-child { font-size: 10.5px !important; }
/* 동료 카드: 협객을 더 크고 높게(머리가 Lv 줄 바로 아래), 별은 카드 테 안쪽 */
html body .hero-grid .hero-tile .card-sprite { left: -14px !important; top: -16px !important; width: 196px !important; height: 133px !important; }
html body .hero-grid .hero-tile .card-sprite:not(.silhouette) { filter: saturate(1.22) contrast(1.12) !important; }
html body .hero-grid .hero-tile .hero-name { top: 95px !important; height: 20px; font-size: 15px !important; line-height: 20px !important; color: #3a1e0c !important; -webkit-text-stroke: .35px #3a1e0c !important; }
html body .hero-grid .hero-tile .hero-stars { top: 115px; height: 15px; left: 12px; right: 12px; }
html body .hero-grid .hero-tile .hero-stars i { flex: 0 0 15px; height: 15px; }
html body .hero-grid .hero-tile .hero-level { font-size: 15px !important; -webkit-text-stroke: .3px #3a1e0c !important; }
html body .hero-grid .hero-tile .new-stamp { right: -7px; top: 72px; transform: rotate(-10deg); z-index: 6; }
html body .heroes-tip { font-size: 16px; color: #3a1e0c; -webkit-text-stroke: .3px #3a1e0c; }
html body #wallet.sub-bar .sub-title { font-size: 20.5px; color: #ffe6a0; }
html body #wallet.sub-bar .wallet-resources > span { color: #fff3dc; }
html body .treasure-chest .game-icon { position: relative; z-index: 1; }
html body #nav .menu-item.selected::before { filter: drop-shadow(0 0 5px #ffcf4acc) drop-shadow(0 0 2px #ffe08a); }
/* 수련 상자는 시안 크기(장면 폭 20%)로, 상자 밑이 이름 패 위에 얹히게. 패 글자는 굵게 */
html body .treasure-chest { left: 72.5% !important; width: 20% !important; top: 22.5% !important; }
html body #chest-time { left: 68.5% !important; width: 28% !important; top: 32.6% !important; height: 24px !important; padding: 0 4px !important; font-size: 12.5px !important; line-height: 24px !important; letter-spacing: -.02em; }
html body .inn-poster strong { -webkit-text-stroke: 1px #6e0a05; color: #6e0a05; }
html body .inn-poster { z-index: 5 !important; }
html body #nav .menu-item.selected::before { width: 66px; filter: brightness(1.3) saturate(1.2) drop-shadow(0 0 6px #ffc93a) drop-shadow(0 0 3px #ffe9a0) !important; }
html body .hero-grid .hero-tile .hero-level { top: 8px !important; right: 9px !important; }
html:not([lang="ko"]) body .depart-button strong { font-size: 34cqh !important; left: 14% !important; right: 10% !important; width: auto !important; letter-spacing: .02em !important; }

/* ===== 4차 무대: 시안 390x693 좌표 그대로, --k 배로 통째로 맞춤 ===== */
html body .v4-stage { position: fixed; z-index: 1; top: 0; left: 50%; width: 390px; height: 693px; transform: translateX(-50%) scale(var(--k, 1)); transform-origin: 50% 0;
  font-family: Jua, sans-serif; color: #3a1e0c; }
html body .v4-stage > * { position: absolute; margin: 0 !important; box-sizing: border-box; }
html body .v4-stage button { min-width: 0 !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: none; }
html body[data-view] #screen:has(.v4-stage) { min-height: 100dvh; padding: 0 !important; background: none !important; }
html body:has(.v4-stage) main.orak-stage { background: none !important; padding: 0 !important; }
html body:has(.v4-stage) #wallet { z-index: 5; }
html body:has(.v4-stage) #screen > h1 { display: none; }
html body[data-view="detail"] { background: url(sprites/bg-v4-detail.webp) center top / calc(390px * var(--k)) auto no-repeat, url(sprites/bg-v4-detail.webp) center bottom / calc(390px * var(--k)) auto no-repeat, #5a3a22 !important; }

/* ---- 상세 (detail-v1) ---- */
html body .v4-stage .fit { display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; }
html body .v4-detail .d4-tap { cursor: pointer; overflow: visible; }
html body .v4-detail .d4-hero { position: absolute; left: -6px; top: -72px; width: 418px; height: 285px; display: block !important; transform-origin: 157px 269px; object-fit: fill;
  animation: hero-breathe 2.4s ease-in-out infinite;
  filter: saturate(1.3) contrast(1.12) drop-shadow(1px 0 0 #2a1206) drop-shadow(-1px 0 0 #2a1206) drop-shadow(0 1px 0 #2a1206) drop-shadow(0 -1px 0 #2a1206) drop-shadow(0 4px 3px #0006); }
html body .v4-detail .d4-badge { padding: 0 9px 8px 0; font-size: 27px; -webkit-text-stroke: 4px #12230f; }
html body .v4-detail .d4-stars { display: flex; gap: 1px; }
html body .v4-detail .d4-stars i { flex: 0 0 22px; height: 22px; background: url(sprites/ui-v4-star.webp) center / contain no-repeat; filter: drop-shadow(0 1px 1px #0008); }
html body .v4-detail .d4-stars i.off { background-image: url(sprites/ui-v4-star-empty.webp); }
html body .v4-detail .d4-arrow { background: url(sprites/ui-v4-arrow-l.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 2px 3px #0008); }
html body .v4-detail .d4-arrow.next { background-image: url(sprites/ui-v4-arrow-r.webp) !important; }
html body .v4-detail .d4-board { display: flex; align-items: center; padding: 4px 30px 6px 34px; background: url(sprites/ui-v4-board.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 4px #0009); }
html body .v4-detail .d4-caption { flex: 0 0 150px; min-width: 0; text-align: center; }
html body .v4-detail .d4-caption strong { font: 23px/1.15 Jua, sans-serif; color: #fff3da; -webkit-text-stroke: 4px #2a1206; paint-order: stroke fill; }
html body .v4-detail .d4-caption span { font: 13.5px/1.2 Jua, sans-serif; color: #f2dcb4; -webkit-text-stroke: 3px #2a1206; paint-order: stroke fill; }
html body .v4-detail .d4-sep { flex: 0 0 2px; align-self: stretch; margin: 6px 10px; background: linear-gradient(#0000, #c99a4a, #0000); }
html body .v4-detail .d4-power { flex: 1 1 auto; height: 38px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 10px;
  background: url(sprites/ui-v4-power.webp) center / 100% 100% no-repeat; white-space: nowrap; }
html body .v4-detail .d4-power small { font: 15px/1 Jua, sans-serif; color: #4a2408; }
html body .v4-detail .d4-power strong { font: 22px/1 Jua, sans-serif; color: #3a1a04; }
html body .v4-detail .d4-stats { background: url(sprites/ui-v4-stats.webp) center / 100% 100% no-repeat; padding: 18px 64px 18px 66px; display: grid; grid-template-rows: repeat(3, 1fr);
  filter: drop-shadow(0 3px 4px #0008); }
html body .v4-detail .d4-stat { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 0 12px 0 34px; border-bottom: 1px solid #8a6a4060; }
html body .v4-detail .d4-stat:last-child { border-bottom: 0; }
html body .v4-detail .d4-stat img { width: 28px; height: 28px; object-fit: contain; }
html body .v4-detail .d4-stat-name { font-size: 18px; color: #3a1e0c; }
html body .v4-detail .d4-stat b { font: 20px/1 Jua, sans-serif; color: #2a1406; font-weight: normal; }
html body .v4-detail .d4-skill { background: url(sprites/ui-v4-skillframe.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 3px 4px #0008); }
html body .v4-detail .d4-skill-icon { position: absolute; left: 40px; top: 25px; width: 70px; height: 68px; }
html body .v4-detail .d4-skill-icon.el-fire { filter: hue-rotate(160deg) saturate(1.2); }
html body .v4-detail .d4-skill-icon.el-earth { filter: hue-rotate(190deg) saturate(.9); }
html body .v4-detail .d4-skill-icon.el-metal { filter: saturate(.25) brightness(1.1); }
html body .v4-detail .d4-skill-sep { position: absolute; left: 121px; top: 30px; bottom: 30px; width: 2px; background: linear-gradient(#0000, #a07a48, #0000); }
html body .v4-detail .d4-skill-name { position: absolute; left: 128px; top: 24px; max-width: 210px; height: 36px; padding: 0 26px 2px 14px;
  background: url(sprites/ui-v4-brush.webp) center / 100% 100% no-repeat; font: 20px/36px Jua, sans-serif; color: #fff1d6; -webkit-text-stroke: 4px #2a1406; paint-order: stroke fill; }
html body .v4-detail .d4-skill-desc { position: absolute; left: 134px; right: 34px; top: 64px; font: 12.5px/1.3 Jua, sans-serif; color: #3a2010; margin: 0; }
html body .v4-detail .d4-upgrades { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
html body .v4-detail .d4-up { position: relative; height: 98px; display: block; background: url(sprites/ui-v4-upbtn.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 3px 3px #0009); }
html body .v4-detail .d4-up.best { background-image: url(sprites/ui-v4-upbtn-on.webp) !important; transform: scale(1.07); z-index: 2; }
html body .v4-detail .d4-up.unavailable { filter: drop-shadow(0 3px 3px #0009) saturate(.6) brightness(.86); opacity: 1 !important; }
html body .v4-detail .d4-up-icon { position: absolute; left: 50%; top: 9px; width: 38px; height: 34px; object-fit: contain; transform: translateX(-50%); }
html body .v4-detail .d4-up-name { position: absolute; left: 4px; right: 4px; top: 44px; font: 18px/1.1 Jua, sans-serif; color: #fff3da; text-align: center; -webkit-text-stroke: 4px #2a1206; paint-order: stroke fill; }
html body .v4-detail .d4-costs { position: absolute; left: 7px; right: 7px; bottom: 9px; height: 22px; display: flex; justify-content: center; align-items: center; gap: 4px;
  background: #2a160ad8; border-radius: 11px; box-shadow: inset 0 0 0 1px #8a6534; }
html body .v4-detail .d4-cost { display: flex; align-items: center; gap: 1px; height: 22px; }
html body .v4-detail .d4-cost img { width: 16px; height: 13px; object-fit: contain; }
html body .v4-detail .d4-cost b { font: 13px/22px Jua, sans-serif; color: #fff1d6; font-weight: normal; }
html body .v4-detail .d4-costs:has(.d4-cost + .d4-cost) { gap: 2px; left: 4px; right: 4px; }
html body .v4-detail .d4-costs:has(.d4-cost + .d4-cost) b { font-size: 11px; }
html body .v4-detail .d4-costs:has(.d4-cost + .d4-cost) img { width: 12px; height: 10px; }
html body .v4-detail .upgrade-gain { position: absolute; left: 40px; right: 40px; top: 200px; z-index: 6; text-align: center; color: #ffe07a; font: 18px Jua, sans-serif; -webkit-text-stroke: 4px #2a1206; paint-order: stroke fill; }
html body .v4-detail .upgrade-beam { position: absolute; left: 140px; top: 40px; width: 110px; height: 200px; z-index: 0; background: radial-gradient(#ffe08a90, #0000 70%); }
html:not([lang="ko"]) body .v4-detail .d4-up-name { font-size: 12.5px; top: 47px; }
html:not([lang="ko"]) body .v4-detail .d4-skill-name { font-size: 16px; }
html:not([lang="ko"]) body .v4-detail .d4-stat-name { font-size: 15px; }

/* ---- 편성 (party-v2) ---- */
html body[data-view="party"] { background: url(sprites/bg-v4-party.webp) center top / calc(390px * var(--k)) auto no-repeat, url(sprites/bg-v4-party.webp) center bottom / calc(390px * var(--k)) auto no-repeat, #4a3020 !important; }
html body[data-view="party"] #wallet .wallet-resources, html body[data-view="map"] #wallet .wallet-resources { display: none !important; }
html body .v4-party .p4-foe { background: url(sprites/ui-v4-foe-scroll.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 4px #0008); }
html body .v4-party .p4-foe-title { position: absolute; left: 40px; right: 40px; top: 14px; text-align: center; font: 19px/24px Jua, sans-serif; color: #3a1e0c; }
html body .v4-party .p4-faces { position: absolute; left: 30px; top: 44px; width: 172px; height: 56px; display: flex; gap: 2px; justify-content: center; }
html body .v4-party .p4-faces canvas { width: 56px; height: 56px; }
html body .v4-party .p4-foe-sep { position: absolute; left: 208px; top: 46px; width: 2px; height: 52px; background: linear-gradient(#0000, #8a6a40, #0000); }
html body .v4-party .p4-foe-tip { position: absolute; left: 214px; right: 30px; top: 44px; height: 56px; display: flex; align-items: center; gap: 2px; }
html body .v4-party .p4-foe-tip .el-badge { position: relative; flex: 0 0 44px; height: 44px; left: auto; top: auto; font-size: 20px; padding: 0 6px 5px 0; }
html body .v4-party .p4-arrow { flex: 0 0 22px; height: 18px; object-fit: contain; }
html body .v4-party .p4-win { font: 14px/1.15 Jua, sans-serif; color: #3a1e0c; word-break: keep-all; }
html body .v4-party .p4-wheel { background: url(sprites/ui-v4-wheel.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 4px #0008); }
html body .v4-party .p4-wheel b { position: absolute; width: 24px; margin-left: -12px; text-align: center; font: 13px/1 Jua, sans-serif; color: #fff; -webkit-text-stroke: 3px #1a0f08; paint-order: stroke fill; }
html body .v4-party .p4-wheel-wood { left: 48%; top: 15%; } html body .v4-party .p4-wheel-earth { left: 78%; top: 42%; }
html body .v4-party .p4-wheel-water { left: 68%; top: 72%; } html body .v4-party .p4-wheel-fire { left: 30%; top: 72%; } html body .v4-party .p4-wheel-metal { left: 19%; top: 42%; }
html:not([lang="ko"]) body .v4-party .p4-wheel b { display: none; }
html body .v4-party .p4-slot { overflow: visible; }
html body .v4-party .p4-hero { position: absolute; left: -9px; top: -21px; width: 202px; height: 138px; display: block; pointer-events: none;
  filter: saturate(1.3) contrast(1.12) drop-shadow(1px 0 0 #2a1206) drop-shadow(-1px 0 0 #2a1206) drop-shadow(0 1px 0 #2a1206) drop-shadow(0 -1px 0 #2a1206); }
html body .v4-party .p4-ring { position: absolute; left: 14px; top: 98px; width: 92px; height: 32px; background: url(sprites/ui-v4-green-ring.webp) center / 100% 100% no-repeat; }
html body .v4-party .p4-good { position: absolute; left: 30px; top: 112px; width: 62px; height: 24px; background: url(sprites/ui-v4-good-badge.webp) center / 100% 100% no-repeat; z-index: 2; }
html body .v4-party .p4-good b { position: absolute; left: 22px; right: 4px; top: 0; font: 14px/24px Jua, sans-serif; color: #fff; text-align: center; -webkit-text-stroke: 3px #123012; paint-order: stroke fill; }
html body .v4-party .p4-plus { position: absolute; left: 0; right: 0; top: 70px; text-align: center; font: 34px/1 Jua, sans-serif; color: #fff8; -webkit-text-stroke: 3px #0006; paint-order: stroke fill; }
html body .v4-party .p4-row { z-index: 5; background: url(sprites/ui-v4-row-tag.webp) center / 100% 100% no-repeat; text-align: center; font: 14px/24px Jua, sans-serif; color: #fff1d6; -webkit-text-stroke: 3px #2a1206; paint-order: stroke fill; }
html body .v4-party .p4-shelf { background: url(sprites/ui-v4-shelf.webp) center / 100% 100% no-repeat; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
html body .v4-party .p4-shelf-row { display: flex; gap: 6px; padding: 14px 14px 0; width: max-content; min-width: 100%; justify-content: center; box-sizing: border-box; }
html body .v4-party .p4-card { position: relative; flex: 0 0 68px; height: 96px; background: url(sprites/ui-v4-bench-card.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 3px 3px #0009); overflow: hidden; }
html body .v4-party .p4-card.selected { box-shadow: 0 0 0 2px #ffd650, 0 0 8px 2px #ffc93a !important; border-radius: 6px !important; }
html body .v4-party .p4-card:not(.selected) { filter: drop-shadow(0 3px 3px #0009) saturate(.35) brightness(.78); }
html body .v4-party .p4-face { position: absolute; left: 4px; top: 4px; width: 60px; height: 56px; object-fit: cover; object-position: 50% 20%; }
html body .v4-party .p4-card .el-badge { left: 2px; top: 2px; width: 22px; height: 22px; font-size: 11px; padding: 0 3px 3px 0; -webkit-text-stroke: 2px #12230f; }
html body .v4-party .p4-name { position: absolute; left: 3px; right: 3px; top: 58px; text-align: center; font: 14px/18px Jua, sans-serif; color: #3a1e0c; }
html body .v4-party .p4-lv { position: absolute; left: 9px; right: 9px; top: 76px; height: 16px; border-radius: 8px; background: #3a2412; text-align: center; font: 11.5px/16px Jua, sans-serif; color: #fff1d6; }
html body .v4-party .p4-auto { background: url(sprites/ui-v4-btn-cream.webp) center / 100% 100% no-repeat !important; font: 19px/46px Jua, sans-serif !important; color: #3a1e0c !important; padding: 0 10px !important; }
html body .v4-party .p4-go { background: url(sprites/ui-v4-btn-red.webp) center / 100% 100% no-repeat !important; font: 34px/66px Jua, sans-serif !important; color: #ffd650 !important; padding: 0 44px !important;
  -webkit-text-stroke: 6px #3a0c04; paint-order: stroke fill; letter-spacing: .04em; filter: drop-shadow(0 4px 4px #0009); }
html:not([lang="ko"]) body .v4-party .p4-go { font-size: 24px !important; }
html:not([lang="ko"]) body .v4-party .p4-auto { font-size: 14px !important; }
html:not([lang="ko"]) body .v4-party .p4-name { font-size: 11px; }
html body .v4-party .p4-foe-title { top: 26px; }
html body .v4-party .p4-faces { top: 56px; }
html body .v4-party .p4-faces canvas { background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
html body .v4-party .p4-foe-sep { top: 58px; }
html body .v4-party .p4-foe-tip { top: 56px; left: 214px; right: 26px; }
html body .v4-party .p4-foe-tip .el-badge { flex-basis: 40px; height: 40px; font-size: 18px; }
html body .v4-party .p4-win { font-size: 13px; line-height: 1.1; }
html body .v4-party .p4-wood { background: linear-gradient(#0000, #0000), url(sprites/bg-v4-detail.webp) center bottom / 390px auto no-repeat; box-shadow: 0 -4px 6px #0007; border-top: 3px solid #2a1208; }
html body .v4-party .p4-shelf { background-size: 100% 100%; }
html body .v4-party .p4-shelf-row { padding-top: 14px; }
html body .v4-party > .p4-good { position: absolute; z-index: 6; }
html body .v4-party .p4-faces { top: 54px; height: 50px; } html body .v4-party .p4-faces canvas { width: 52px; height: 52px; }

/* ── 4차 지도 (map-v2 시안): 그림 속 굽은 길 + 판 원반, 위 나무 머리띠, 아래 출정 두루마리 ── */
html body[data-view="map"] { background: #2a1a10 !important; overflow: hidden; --m4: url(sprites/bg-v4-map.webp); }
html body .v4-map { height: calc(var(--sh, 693) * 1px); }
html body .v4-map .m4-scene { left: 0; top: 0; width: 390px; height: 694px; transform: scale(var(--ks, 1)); transform-origin: 50% 0; background: var(--m4) center / 100% 100% no-repeat; }
html body .v4-map .m4-scene > * { position: absolute; }
html body[data-view="map"][data-chapter="2"] { --m4: url(sprites/bg-v4-map-2.webp); }
html body[data-view="map"][data-chapter="3"] { --m4: url(sprites/bg-v4-map-3.webp); }
html body[data-view="map"][data-chapter="4"] { --m4: url(sprites/bg-v4-map-4.webp); }
html body[data-view="map"][data-chapter="5"] { --m4: url(sprites/bg-v4-map-5.webp); }
html body[data-view="map"][data-chapter="6"] { --m4: url(sprites/bg-v4-map-6.webp); }
html body[data-view="map"][data-chapter="7"] { --m4: url(sprites/bg-v4-map-7.webp); }
html body[data-view="map"] #wallet { display: none !important; }
html body .v4-map .m4-band { background: linear-gradient(#2a1206cc, #3a1a0a99 60%, #2a1206dd), url(sprites/bg-v4-detail.webp) center 62% / 390px auto no-repeat;
  border-bottom: 3px solid #c08a3a; box-shadow: 0 2px 0 #3a1a08, 0 6px 8px #0008; z-index: 1; }
html body .v4-map .m4-rod { background: url(sprites/ui-v4-rod.webp) center / 100% 100% no-repeat; z-index: 2; filter: drop-shadow(0 2px 2px #0008); }
html body .v4-map .m4-back { background: url(sprites/ui-v4-back.webp) center / 100% 100% no-repeat !important; z-index: 3; filter: drop-shadow(0 2px 3px #0009); }
html body .v4-map .m4-plaque { background: url(sprites/ui-v4-map-plaque.webp) center / 100% 100% no-repeat; z-index: 3; filter: drop-shadow(0 2px 3px #0009); }
html body .v4-map .m4-plaque strong { position: absolute; left: 60px; right: 60px; top: 0; height: 46px; font: 21px/46px Jua, sans-serif; text-align: center; color: #ffe7a8; -webkit-text-stroke: 4px #2a1206; paint-order: stroke fill; }
html body .v4-map .m4-turn { position: absolute; top: 7px; width: 32px; height: 32px; }
html body .v4-map .m4-prev { left: 30px; } html body .v4-map .m4-next { right: 30px; }
html body .v4-map .m4-turn::before { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border: solid #ffe7a8; border-width: 0 0 4px 4px;
  transform: translate(-35%, -50%) rotate(45deg); filter: drop-shadow(0 0 1px #2a1206) drop-shadow(0 0 1px #2a1206); }
html body .v4-map .m4-next::before { transform: translate(-65%, -50%) rotate(-135deg); }
html body .v4-map .m4-turn:disabled { opacity: .32; }
html body .v4-map .m4-starbar { z-index: 3; display: block; background: none; border: 0; padding: 0; }
html body .v4-map .m4-starbar > * { position: absolute; }
html body .v4-map .m4-total { left: 4px; top: 6px; width: 98px; height: 40px; background: url(sprites/ui-v4-star-plate.webp) center / 100% 100% no-repeat; display: flex; align-items: center; justify-content: center; gap: 3px; filter: drop-shadow(0 2px 3px #0008); }
html body .v4-map .m4-total i { width: 26px; height: 25px; background: url(sprites/ui-v4-star-s.webp) center / contain no-repeat; }
html body .v4-map .m4-total b { font: 21px/1 Jua, sans-serif; color: #3a1e0c; }
html body .v4-map .m4-starbar .star-chest { top: -2px; width: 62px; height: 50px; background: none !important; overflow: visible; }
html body .v4-map .m4-starbar .star-chest:nth-of-type(1) { left: 114px; } html body .v4-map .m4-starbar .star-chest:nth-of-type(2) { left: 197px; } html body .v4-map .m4-starbar .star-chest:nth-of-type(3) { left: 278px; }
html body .v4-map .star-chest i { position: absolute; left: 6px; top: 0; width: 50px; height: 40px; background: url(sprites/ui-v4-chest-closed.webp) center / contain no-repeat; filter: drop-shadow(0 2px 2px #0009); }
html body .v4-map .star-chest.opened i { background-image: url(sprites/ui-v4-chest-open.webp); }
html body .v4-map .star-chest.closed i { filter: grayscale(1) brightness(1.15) contrast(1.05) drop-shadow(0 2px 2px #0009); }
html body .v4-map .star-chest.ready::before { content: ''; position: absolute; left: -6px; right: -6px; top: -12px; height: 52px; border-radius: 50%;
  background: radial-gradient(#fff2a0, #ffd96acc 35%, #ffc94055 55%, #0000 72%); animation: m4glow 1.6s ease-in-out infinite; }
html body .v4-map .star-chest.ready i { animation: m4bob 1.2s ease-in-out infinite; }
@keyframes m4glow { 50% { opacity: .55; transform: scale(1.08); } }
@keyframes m4bob { 50% { transform: translateY(-3px); } }
html body .v4-map .star-chest b { position: absolute; left: 0; right: 0; bottom: -4px; display: flex; justify-content: center; align-items: center; gap: 1px;
  font: 18px/1 Jua, sans-serif; color: #fff; -webkit-text-stroke: 4px #2a1206; paint-order: stroke fill; }
html body .v4-map .star-chest b::after { content: ''; width: 18px; height: 17px; background: url(sprites/ui-v4-star-s.webp) center / contain no-repeat; }
html body .v4-map .star-chest:disabled { opacity: 1 !important; }
html body .v4-map .m4-node { overflow: visible; background: url(sprites/ui-v4-disc.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 3px 2px #0009); z-index: 2; }
html body .v4-map .m4-node.node-next { background: none !important; }
html body .v4-map .m4-node.node-next::before { content: ''; position: absolute; left: -27px; right: -27px; top: -24px; bottom: -8px; background: url(sprites/ui-v4-disc-on.webp) center / 100% 100% no-repeat; z-index: -1; animation: m4pulse 1.8s ease-in-out infinite; }
@keyframes m4pulse { 50% { filter: brightness(1.15); transform: scale(1.04); } }
html body .v4-map .m4-node.node-locked { filter: grayscale(1) brightness(.78) drop-shadow(0 3px 2px #0009); opacity: 1 !important; }
html body .v4-map .m4-node.m4-boss { background-image: url(sprites/ui-v4-disc-boss.webp) !important; }
html body .v4-map .m4-node.m4-boss.node-locked { filter: drop-shadow(0 3px 2px #0009); }
html body .v4-map .m4-node.picked:not(.node-next) { filter: drop-shadow(0 0 3px #ffe27a) drop-shadow(0 0 5px #ffd040) drop-shadow(0 3px 2px #0009); }
html body .v4-map .m4-num { position: absolute; left: 0; right: 0; top: 4px; font: 19px/24px Jua, sans-serif; text-align: center; color: #3a1e0c; white-space: nowrap; }
html body .v4-map .m4-boss .m4-num { top: 6px; color: #5a0e08; font-size: 20px; }
html body .v4-map .node-locked .m4-num { color: #2c2c2c; }
html body .v4-map .m4-stars { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); display: flex; gap: 0; }
html body .v4-map .m4-boss .m4-stars { top: 30px; }
html body .v4-map .m4-stars i { width: 18px; height: 17px; background: url(sprites/ui-v4-star-s-off.webp) center / contain no-repeat; filter: drop-shadow(0 1px 1px #000a); }
html body .v4-map .m4-stars i.on { background-image: url(sprites/ui-v4-star-s.webp); }
html body .v4-map .m4-bossface { border-radius: 50%; border: 3px solid #e0a030 !important; outline: 2px solid #5a1408; background: radial-gradient(#fbe4b8, #d9a86a) !important; box-shadow: 0 3px 6px #000a; z-index: 1; pointer-events: none; }
html body .v4-map .m4-mandu { z-index: 3; pointer-events: none; background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
html body .v4-map .m4-card { z-index: 4; background: url(sprites/ui-v4-map-scroll.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 -2px 6px #0009); padding: 0; border: 0; border-radius: 0; box-shadow: none; }
html body .v4-map .m4-card > * { position: absolute; }
html body .v4-map .m4-head { left: 34px; right: 34px; top: 42px; height: 34px; display: flex; justify-content: center; align-items: center; gap: 6px; }
html body .v4-map .m4-head::before, html body .v4-map .m4-head::after { content: ''; flex: 0 1 46px; min-width: 22px; height: 25px; background: url(sprites/ui-v4-cloud.webp) center / contain no-repeat; }
html body .v4-map .m4-head::after { transform: scaleX(-1); }
html body .v4-map .m4-head strong { flex: 0 1 auto; min-width: 0; font: 23px/34px Jua, sans-serif; color: #3a1e0c; text-align: center; }
html body .v4-map .m4-warn { left: 70px; right: 70px; top: 72px; font: 12.5px/16px Jua, sans-serif; color: #b01e10; text-align: center; }
html body .v4-map .m4-faces { left: 34px; top: 86px; width: 180px; height: 64px; display: flex; gap: 2px; justify-content: center; align-items: center; }
html body .v4-map .m4-faces canvas { width: 54px; height: 54px; background: radial-gradient(#fff4dc, #e8c48e) !important; border: 2px solid #8a5a2a !important; border-radius: 50% !important; box-shadow: 0 2px 3px #0006 !important; filter: drop-shadow(0 2px 2px #0007); }
html body .v4-map .m4-faces::after { content: ''; position: absolute; right: -6px; top: 4px; width: 2px; height: 56px; background: linear-gradient(#0000, #8a6a40, #0000); }
html body .v4-map .m4-seal { left: 212px; top: 92px; width: 46px; height: 46px; background: url(sprites/ui-v4-seal.webp) center / 100% 100% no-repeat; font: 25px/46px Jua, sans-serif; text-align: center; color: #c0281a; }
html body .v4-map .m4-seal.el-wood { color: #2f8a2a; } html body .v4-map .m4-seal.el-water { color: #1f5fc0; }
html body .v4-map .m4-seal.el-earth { color: #9a6a1a; } html body .v4-map .m4-seal.el-metal { color: #6a6a78; }
html body .v4-map .m4-go { left: 264px; top: 84px; width: 106px; height: 60px; background: url(sprites/ui-v4-btn-gold.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 3px 3px #0008); }
html body .v4-map .m4-go b { position: absolute; left: 12px; right: 12px; top: 0; bottom: 3px; display: flex !important; align-items: center; justify-content: center; font: 29px/1 Jua, sans-serif; color: #4a1e06; -webkit-text-stroke: 3px #fff1c0; paint-order: stroke fill; }
html body .v4-map .can-sweep .m4-go { top: 80px; height: 44px; }
html body .v4-map .can-sweep .m4-go b { font-size: 25px; }
html body .v4-map .m4-sweep { left: 276px; top: 124px; height: 26px; width: 86px; height: 30px; background: url(sprites/ui-v4-btn-cream.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 2px 2px #0007); }
html body .v4-map .m4-sweep b { position: absolute; inset: 0 8px 2px; display: flex !important; align-items: center; justify-content: center; font: 16px/1 Jua, sans-serif; color: #3a1e0c; }
html body .v4-map .m4-two { white-space: normal !important; display: flex !important; align-items: center; justify-content: center; overflow: hidden; word-break: keep-all; overflow-wrap: anywhere; }
html body .v4-map .m4-plaque .m4-two { top: 3px; height: 38px; font-size: 15px; line-height: 16px; -webkit-text-stroke-width: 3px; }
html body .v4-map .m4-head .m4-two { font-size: 17px; line-height: 17px; max-height: 36px; }
html:not([lang="ko"]) body .v4-map .m4-head { left: 26px; right: 26px; top: 38px; height: 40px; }
html:not([lang="ko"]) body .v4-map .m4-head::before, html:not([lang="ko"]) body .v4-map .m4-head::after { display: none; }
html:not([lang="ko"]) body .v4-map .m4-warn { top: 74px; }
/* 별 보상 상자 창: 2.0 남색 상자 대신 시안 두루마리(크림 종이 + 붉은 축) */
html body dialog.star-reward { width: min(340px, 92vw); padding: 34px 40px 28px; border: 0; border-radius: 0; color: #3a1e0c;
  background: url(sprites/ui-v4-map-scroll.webp) center / 100% 100% no-repeat; box-shadow: none; filter: drop-shadow(0 6px 10px #000a); text-align: center; font-family: Jua, sans-serif; }
html body dialog.star-reward::backdrop { background: #0009; }
html body dialog.star-reward h2 { margin: 6px 0 8px; font: 22px/1.2 Jua, sans-serif; color: #3a1e0c; }
html body dialog.star-reward .map-reward { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 4px 0; font: 17px/1.2 Jua, sans-serif; color: #3a1e0c; }
html body dialog.star-reward .map-reward .game-icon { width: 30px; height: 26px; }
html body dialog.star-reward .title-stamp { color: #a01a10; font: 16px/1.2 Jua, sans-serif; }
html body dialog.star-reward button { margin: 10px auto 6px; min-width: 110px; height: 42px; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  background: url(sprites/ui-v4-btn-gold.webp) center / 100% 100% no-repeat !important; color: #4a1e06 !important; font: 19px/1 Jua, sans-serif !important; padding: 0 22px !important; }

/* ── 4차 전투 (battle-v1 시안): 둥근 나무 단추·나무 현판, 금테 두루마리 카드, 합격기 리본, 아래 크림 두루마리 ── */
html body.battling #fight { background: linear-gradient(#2a1c22, #22161c) !important; }
html body.battling .battle-tools { display: none !important; }
html body.battling .battle-top { background: linear-gradient(#3a2414, #26170c) !important; box-shadow: 0 2px 0 #8a5a2a, 0 4px 8px #000a !important; padding: 4px 6px !important; gap: 5px !important; }
html body.battling .battle-top button, html body.battling .battle-top a.orak-home-button:not(.btn) {
  width: 42px !important; height: 42px !important; min-width: 42px !important; min-height: 42px !important; border-radius: 50% !important; box-shadow: none !important;
  background: url(sprites/ui-v4-b-round.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 2px 2px #000a); color: #ffe7a8 !important; }
html body.battling .battle-top a.orak-home-button:not(.btn) { background-image: url(sprites/ui-v4-b-home.webp) !important; }
html body.battling #auto { background-image: url(sprites/ui-v4-b-bolt.webp) !important; }
html body.battling #retreat { background-image: url(sprites/ui-v4-b-flag.webp) !important; }
html body.battling #speed { font: 17px/1 Jua, sans-serif !important; color: #ffe7a8 !important; text-shadow: 0 2px 0 #2a1206; }
html body.battling .battle-top #wave { height: 42px !important; background: url(sprites/ui-v4-b-plaque.webp) center / 100% 100% no-repeat !important; padding: 0 12px !important; gap: 5px !important; filter: drop-shadow(0 2px 2px #000a); }
html body.battling #wave .wave-label { font: 15px/1 Jua, sans-serif !important; color: #ffe7a8 !important; text-shadow: 0 2px 0 #1a0a04 !important; }
html body.battling #wave .wave-dots i { width: 10px !important; height: 10px !important; border: 1px solid #3a1a08 !important; background: #3a2414 !important; }
html body.battling #wave .wave-dots i.past, html body.battling #wave .wave-dots i.current { background: radial-gradient(circle at 35% 30%, #fff6c8, #f2c23a 60%, #9a6714) !important; }
html body.battling .card-deck { background: none !important; padding: 18px 8px 6px !important; }
html body.battling #cards { gap: 6px !important; }
html body.battling #cards .portrait { border: 0 !important; border-image: none !important; padding: 22px 10px 24px !important; height: auto !important; aspect-ratio: .52 !important; max-height: 27dvh;
  background: url(sprites/ui-v4-skillcard.webp) center / 100% 100% no-repeat !important; justify-content: flex-start !important; }
html body.battling #cards .portrait.ready { background-image: url(sprites/ui-v4-skillcard-on.webp) !important; background-size: 116% 104% !important; filter: drop-shadow(0 0 6px #ffd84f) !important; }
html body.battling #cards .card-art { aspect-ratio: 1 / .95; margin-top: 0; border-radius: 4px; flex: 0 0 auto; }
html body.battling #cards .portrait strong { font-size: clamp(16px, 27cqw, 22px) !important; color: #3a1e0c !important; margin: 2px 0 4px !important; }
html body.battling #cards .bar.energy { height: 12px !important; border: 2px solid #f2e2b8 !important; outline: 1.5px solid #3a1e0c; border-radius: 7px !important; background: #2e1a10 !important; margin-top: auto; }
html body.battling #cards .bar.energy i { background: linear-gradient(#fff6a0, #ffd21e 50%, #d99a0a) !important; border-radius: 5px; }
html body.battling #combo-tag { width: 168px !important; height: 50px !important; top: -20px !important; left: 27% !important;
  background: url(sprites/ui-v4-ribbon.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 2px 3px #000a); }
html body.battling #combo-tag span { font: 21px/1 Jua, sans-serif !important; color: #5a1406 !important; text-shadow: 0 1px 0 #fff3c0 !important; margin-top: -8px !important; }
html body.battling #combo-tag i { bottom: 9px !important; background: #a01a10 !important; left: 30% !important; right: 30% !important; }
html body.battling #fight > .hint { background: url(sprites/ui-v4-tip-band.webp) center / 100% 100% no-repeat, transparent !important; margin: 0 6px 6px !important;
  height: 54px !important; padding: 0 16% !important; place-items: center !important; font: 21px/1.1 Jua, sans-serif !important; color: #3a1e0c !important; filter: drop-shadow(0 2px 3px #000a); }
html body.battling #fight > .hint[data-kind='break'] { color: #a0100c !important; }
@media (max-height: 700px) { html body.battling #fight > .hint { height: 48px !important; font-size: 18px !important; } }
html:not([lang="ko"]) body.battling #fight > .hint { font-size: 16px !important; padding: 0 14% !important; }
html body.battling .battle-top #wave { justify-content: center !important; overflow: hidden; }
html body.battling #wave .wave-label { flex: 0 1 auto; max-width: calc(100% - 40px); }
html body.battling #wave .wave-dots { gap: 2px !important; }
html[lang="ko"] body.battling #fight > .hint { font-size: 23px !important; }
@media (max-height: 700px) { html[lang="ko"] body.battling #fight > .hint { font-size: 20px !important; } }

/* ── 4차 승리·패배 (result-v1 · lose-v1 시안) ── */
html body.battle-result .settings, html body.battle-result #mute, html body.battle-result #settings-toggle { display: none !important; }
html body #fight .result-panel { gap: 4px !important; padding-top: max(6px, env(safe-area-inset-top)) !important;
  background: linear-gradient(#0000 60%, #1a100a66), var(--result-bg, none) center top / cover no-repeat, #1c140e !important; }
html body #fight .result-panel > .orak-home-button { width: 42px !important; height: 42px !important; min-width: 42px !important; padding: 0 !important; border: 0 !important;
  border-radius: 50% !important; font-size: 0 !important; box-shadow: none !important; background: url(sprites/ui-v4-b-home.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 2px 3px #000a); }
html body #fight .result-panel > .orak-home-button > * { display: none !important; }
html body #fight .result-panel .result-title { width: 214px !important; height: 116px !important; aspect-ratio: auto !important; font-size: 0 !important; -webkit-text-stroke: 0 !important; text-shadow: none !important;
  background: url(sprites/ui-v4-ink.webp) center / 100% 100% no-repeat !important; letter-spacing: 0 !important; }
html body #fight .result-panel .result-title .result-word { width: 168px; height: auto; filter: drop-shadow(0 3px 2px #0009); }
html body #fight .result-panel .result-title span { font: 62px/1 Jua, sans-serif; color: #ffd84a; -webkit-text-stroke: 7px #4a1a06; paint-order: stroke fill; }
html body #fight [data-outcome='lose'] .result-title span { color: #eef0f2; -webkit-text-stroke-color: #2a1018; }
html:not([lang="ko"]) body #fight .result-panel .result-title { width: 300px !important; }
html body .result-panel .result-stage { margin-top: -12px !important; width: 236px; min-width: 0 !important; height: 58px; padding: 7px 30px 0 !important; box-sizing: border-box;
  background: url(sprites/ui-v4-stage-plaque.webp) center / 100% 100% no-repeat !important; color: #fff1cf !important; font-size: 20px; line-height: 30px; -webkit-text-stroke: 4px #2a1206 !important; }
html body .result-panel .result-party { max-height: 196px !important; min-height: 120px; margin-top: -14px; }
html body .result-panel .result-stars { margin-top: -38px !important; gap: 0 !important; }
html body .result-panel .result-stars img { width: 56px !important; height: 52px !important; }
html body .result-panel .result-stars img:nth-child(2) { width: 62px !important; height: 58px !important; margin-bottom: 4px; }
html body .result-panel .result-scroll { width: 94% !important; background: url(sprites/ui-v4-result-scroll.webp) center / 100% 100% no-repeat !important; }
html body .result-panel .result-goals { min-height: 124px !important; padding: 14px 22% 16px !important; margin-top: -18px !important; gap: 2px !important; }
html body .result-panel .result-goals li { font-size: 20px !important; border: 0 !important; color: #3a1e0c; }
html body .result-panel .result-goals li.miss { color: #8d7a62 !important; }
html body .result-panel .result-goals img { width: 26px !important; height: 26px !important; }
html body .result-panel .result-rewards { min-height: 66px !important; padding: 6px 6% !important; background: url(sprites/ui-v4-reward-bar.webp) center / 100% 100% no-repeat !important; }
html body .result-panel .result-rewards span + span { border-left: 2px solid #c9a46a80 !important; }
html body .result-panel .result-rewards img { width: 42px !important; height: 36px !important; filter: drop-shadow(0 2px 1px #0005); }
html body .result-panel .result-rewards b { font: 23px/1 Jua, sans-serif !important; color: #3a1e0c; white-space: nowrap; }
html body #fight .result-panel .result-buttons button { height: 56px !important; border-radius: 0 !important; background: url(sprites/ui-v4-btn-wood.webp) center / 100% 100% no-repeat !important;
  color: #fff1cf !important; font-size: 22px !important; -webkit-text-stroke: 4px #2a1206 !important; filter: drop-shadow(0 3px 3px #0009); }
html body #fight .result-panel .result-buttons .result-main { background-image: url(sprites/ui-v4-btn-red2.webp) !important; color: #ffe08a !important; -webkit-text-stroke-color: #4a0a06 !important; font-size: 24px !important; }
html body #fight .result-panel .result-small button.result-pill { min-height: 40px !important; padding: 4px 22px 4px 14px !important; border: 0 !important; border-radius: 0 !important;
  background: url(sprites/ui-v4-pill-dark.webp) center / 100% 100% no-repeat !important; color: #fff1cf !important; font-size: 17px !important; filter: drop-shadow(0 2px 3px #0009); }
/* 패배: 크림 두루마리 안 '이렇게 하면 이긴다냥' 크림 패 + 줄마다 크림 띠, 오른쪽 짙은 단추 */
html body .result-panel .defeat-advice { width: 100% !important; padding: 14px 10% 16px !important; background: url(sprites/ui-v4-result-scroll.webp) center / 100% 100% no-repeat !important; }
html body .result-panel .advice-head { padding: 5px 30px 7px !important; margin-bottom: 4px !important; background: url(sprites/ui-v4-reward-bar.webp) center / 100% 100% no-repeat !important;
  color: #3a1e0c !important; -webkit-text-stroke: 0 !important; font-size: 20px; }
html body .result-panel .defeat-advice li { min-height: 40px !important; margin: 3px 0; padding: 0 4px 0 8px; border: 0 !important; background: url(sprites/ui-v4-advice-row.webp) center / 100% 100% no-repeat; color: #3a1e0c; font-size: 14.5px !important; }
html body .result-panel .defeat-advice li > img { width: 30px !important; height: 30px !important; }
html body #fight .result-panel .advice-go { min-height: 30px !important; height: 30px; min-width: 70px; max-width: 42%; padding: 0 10px !important; border-radius: 0 !important;
  background: url(sprites/ui-v4-pill-dark.webp) center / 100% 100% no-repeat !important; font-size: 14px !important; white-space: nowrap; overflow: hidden; }
html body #fight .result-panel .result-title img.result-word { width: 168px !important; height: auto !important; max-height: none !important; object-fit: contain; }
html body .result-panel .result-stage { width: fit-content !important; min-width: 236px !important; max-width: 92% !important; }
html body .result-panel .result-party { flex: 1 0 186px !important; max-height: 210px !important; }
html body #fight .result-panel .advice-head { background: url(sprites/ui-v4-reward-bar.webp) center / 100% 100% no-repeat !important; color: #3a1e0c !important; -webkit-text-stroke: 0 !important; white-space: nowrap; font-size: 19px; }
html body .result-panel .defeat-advice { padding: 14px 7% 16px !important; }
html body #fight .result-panel .advice-go { min-width: 64px; font-size: 13px !important; line-height: 30px; }
html body .result-panel .defeat-advice li > span { font-size: 14px; line-height: 1.15; }
html body #fight .result-panel .result-title { padding: 0 !important; background-size: 100% 100% !important; line-height: 1 !important; }
html body #fight .result-panel .advice-head { border: 0 !important; border-image: none !important; }
html body .result-panel .result-party { flex: 1 1 186px !important; min-height: 96px !important; }
html:not([lang="ko"]) body .result-panel .result-goals { padding: 14px 15% 16px !important; }
html:not([lang="ko"]) body .result-panel .result-goals li { font-size: 16px !important; line-height: 1.1 !important; }
html:not([lang="ko"]) body .result-panel .defeat-advice li > span { font-size: 12.5px; }
html:not([lang="ko"]) body #fight .result-panel .advice-go { font-size: 11.5px !important; line-height: 1.05; white-space: normal; height: 32px; }
@media (max-height: 700px) {
  html body #fight .result-panel .result-title { height: 90px !important; width: 180px !important; }
  html body #fight .result-panel .result-title img.result-word { width: 136px !important; }
  html body #fight .result-panel .result-title span { font-size: 48px; }
  html body .result-panel .result-stage { height: 50px; font-size: 18px; line-height: 26px; padding-top: 6px !important; margin-top: -10px !important; }
  html body .result-panel .result-stars { margin-top: -30px !important; }
  html body .result-panel .result-stars img { width: 46px !important; height: 43px !important; } html body .result-panel .result-stars img:nth-child(2) { width: 52px !important; height: 49px !important; }
  html body .result-panel .result-goals { min-height: 100px !important; padding-top: 10px !important; padding-bottom: 12px !important; }
  html body .result-panel .result-goals li { font-size: 17px !important; }
  html body .result-panel .result-rewards { min-height: 54px !important; } html body .result-panel .result-rewards img { width: 34px !important; height: 30px !important; }
  html body .result-panel .result-rewards b { font-size: 19px !important; }
  html body #fight .result-panel .result-buttons button { height: 48px !important; font-size: 19px !important; }
  html body #fight .result-panel .result-small button.result-pill { min-height: 34px !important; font-size: 15px !important; }
  html body .result-panel .defeat-advice { padding-top: 10px !important; padding-bottom: 12px !important; }
  html body .result-panel .defeat-advice li { min-height: 36px !important; margin: 2px 0; }
}
html body .result-panel .result-stage { white-space: nowrap !important; overflow: hidden; }
html body .result-panel .advice-head { max-width: 96% !important; overflow: hidden; }
@media (max-height: 700px) { html[lang="ko"] body .result-panel .defeat-advice li > span { font-size: 13px; } }

/* ── 4차 수련장 (training-v1 시안): 나무 벽 배경, 보라 축 두루마리, 띠 다섯 줄(한자 배지·짙은 이름패·금빛 수련 단추) ── */
html body[data-view="training"] { background: url(sprites/bg-v4-training.webp) center top / 100% auto no-repeat, #3a2414 !important; }
html body[data-view="training"] #screen { background: none !important; }
html body .cards-screen .training-banner { background: url(sprites/ui-v4-info-scroll.webp) center / 100% 100% no-repeat !important; border: 0 !important;
  margin: 2px 0 8px !important; padding: 10px 16% 12px !important; color: #3a1e0c !important; font-size: 17px; }
html body .cards-screen .training-grid { gap: 8px !important; }
html body .cards-screen .training-card, html body .cards-screen .training-card.open { height: 76px !important; border: 3px solid #b8853a !important; border-radius: 10px !important;
  box-shadow: inset 0 0 0 1px #5a3410, 0 3px 6px #000a !important; background-size: cover !important; background-position: center !important; overflow: visible; }
html body .cards-screen .training-card .train-glow { position: absolute; inset: -9px -8px; background: url(sprites/ui-v4-glow-frame.webp) center / 100% 100% no-repeat; pointer-events: none; z-index: 1;
  animation: m4glow 1.8s ease-in-out infinite; }
html body .cards-screen .training-card .train-stamp { position: absolute; right: 78px; top: 4px; width: 40px; height: 40px; z-index: 2; display: grid; place-items: center;
  background: url(sprites/ui-v4-stamp-red.webp) center / 100% 100% no-repeat; color: #fff3d6; font: 12px/1 Jua, sans-serif; font-style: normal; transform: rotate(-10deg); }
html body .cards-screen .training-card .element-badge { left: 6px !important; top: 6px !important; width: 40px !important; height: 40px !important; z-index: 2; filter: drop-shadow(0 2px 2px #0009); }
html body .cards-screen .training-card > strong { position: absolute !important; left: 50%; bottom: -6px; transform: translateX(-50%); margin: 0 !important; z-index: 2;
  border: 0 !important; border-image: none !important; padding: 4px 22px 6px !important; background: url(sprites/ui-v4-plate-dark.webp) center / 100% 100% no-repeat !important;
  color: #fff1cf !important; font: 16px/1.1 Jua, sans-serif !important; -webkit-text-stroke: 3px #2a1206; paint-order: stroke fill; white-space: nowrap; }
html body .cards-screen .training-card .train-go { right: 8px !important; padding: 0 !important; width: 62px; height: 34px; display: grid !important; place-items: center; border: 0 !important; border-radius: 0 !important;
  background: url(sprites/ui-v4-btn-gold2.webp) center / 100% 100% no-repeat !important; box-shadow: none !important; color: #3a1e0c !important; -webkit-text-stroke: 0 !important;
  font: 17px/1 Jua, sans-serif !important; filter: drop-shadow(0 2px 2px #0009); z-index: 2; }
html body .cards-screen .training-card > small { left: 52px !important; top: 8px !important; font-size: 11.5px !important; z-index: 2; }
html body .cards-screen .training-card.open > small { display: none; }
html body .cards-screen .training-card.locked { filter: grayscale(.8) brightness(.62) !important; }
html body .cards-screen .training-card, html body .cards-screen .training-card.open { height: 80px !important; }
html body .cards-screen .training-card .el-badge.element-badge { position: absolute !important; left: 2px !important; top: 2px !important; width: 46px !important; height: 46px !important; font-size: 22px !important; padding: 0 7px 6px 0 !important; }
html body .cards-screen .training-card > strong { font-size: 18px !important; padding: 5px 26px 7px !important; }
html body .cards-screen .training-card .train-go { width: 66px; height: 38px; font-size: 18px !important; }
html body .cards-screen .training-banner { font-size: 18px; margin-top: -4px !important; }
/* 4차 수련장 2차: 판(bg-v4-training)에 그려진 다섯 띠 위치에 카드를 그대로 얹는다. --tk = 화면 폭/390 (메뉴 위에 다 들어가게 줄임, cards.js) */
html body[data-view="training"] { background: #3a2414 !important; }
html body[data-view="training"] main.orak-stage { --tk: 1px; background: url(sprites/bg-v4-training.webp) center top / calc(var(--tk) * 390) auto no-repeat, url(sprites/bg-v4-training-floor.webp) center calc(var(--tk) * 690) / calc(var(--tk) * 390) auto repeat-y, #3a2414 !important; }
html body[data-view="training"] #screen.cards-screen { position: static !important; }
html body[data-view="training"] .cards-screen .training-banner { position: absolute; left: 50%; top: calc(var(--tk) * 64); width: calc(var(--tk) * 350); height: calc(var(--tk) * 54); transform: translateX(-50%);
  margin: 0 !important; padding: 0 calc(var(--tk) * 40) 4px !important; box-sizing: border-box; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; column-gap: .25em;
  font-size: calc(var(--tk) * 15) !important; line-height: 1.15; white-space: normal; text-align: center; }
html body[data-view="training"] .cards-screen .training-banner b { color: #b3200f; font-size: 1.35em; line-height: 1; }
html body[data-view="training"] .cards-screen .training-banner em { font-style: normal; color: #b3200f; }
html body[data-view="training"] .cards-screen .training-grid { position: absolute; left: 50%; top: calc(var(--tk) * 123); width: calc(var(--tk) * 369); transform: translateX(-50%);
  display: grid !important; grid-template-rows: calc(var(--tk) * 97) calc(var(--tk) * 83) calc(var(--tk) * 82) calc(var(--tk) * 82) calc(var(--tk) * 85); row-gap: calc(var(--tk) * 8) !important; gap: calc(var(--tk) * 8) 0 !important; margin: 0 !important; }
html body[data-view="training"] .cards-screen .training-card, html body[data-view="training"] .cards-screen .training-card.open { height: auto !important; min-height: 0 !important; margin: 0 !important; }
html body[data-view="training"] .cards-screen .training-card .train-stamp { right: 84px; top: 8px; width: 54px; height: 54px; font-size: 17px; }
html body[data-view="training"] .cards-screen .training-card .train-hero { position: absolute; left: 36px; bottom: -12%; width: auto; height: 168%; min-width: 0; z-index: 1; pointer-events: none; filter: drop-shadow(0 3px 2px #0008); }
html body[data-view="training"] .cards-screen .training-rewards { position: absolute; left: 0; right: 0; top: calc(var(--tk) * 123); z-index: 5; }
html body[data-view="training"] .cards-screen .training-card:has(.train-glow) { border-color: #ffd34d !important; box-shadow: 0 0 0 2px #fff0a8, 0 0 16px 5px #ffc933b0, 0 3px 6px #000a !important; }
html body[data-view="training"] .cards-screen .training-banner span { white-space: normal !important; }
html:not([lang="ko"]) body[data-view="training"] .cards-screen .training-banner { font-size: calc(var(--tk) * 12.5) !important; line-height: 1.1; padding: 0 calc(var(--tk) * 34) 4px !important; }
html body[data-view="training"] .cards-screen .training-card .train-go { white-space: nowrap; overflow: hidden; }
html:not([lang="ko"]) body[data-view="training"] .cards-screen .training-card .train-go { width: auto; min-width: 66px; padding: 0 10px 2px !important; font-size: 15px !important; }
html:not([lang="ko"]) body[data-view="training"] .cards-screen .training-card .train-stamp { right: auto; left: 50px; top: 4px; width: 46px; height: 46px; font-size: 12px; z-index: 3; }
/* ── 4차 비무 (duel-v1 시안): 비무장 장면 끝까지, 날짜 두루마리, 포권 다섯 · 두 줄 나무패, 점수 두루마리, 붉은 도전 패 ── */
html body[data-view="duel"] { background: #2a1a10 !important; }
html body[data-view="duel"] main.orak-stage { --tk: 1px; background: url(sprites/bg-v4-duel.webp) center top / cover no-repeat, #2a1a10 !important; }
html body[data-view="duel"] #wallet .wallet-resources { display: none !important; }
html body[data-view="duel"] #screen { position: static !important; background: none !important; }
html body .v4-duel { position: static !important; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
html body .v4-duel > h1 { display: none !important; }
html body .v4-duel .duel-date { position: absolute; left: 50%; top: calc(var(--tk) * 58); width: calc(var(--tk) * 330); height: calc(var(--tk) * 54); transform: translateX(-50%); margin: 0 !important;
  box-sizing: border-box; padding: 0 calc(var(--tk) * 46) calc(var(--tk) * 6) !important; display: flex; align-items: center; justify-content: center; white-space: nowrap;
  background: url(sprites/ui-v4-date-scroll.webp) center / 100% 100% no-repeat !important; border: 0 !important; border-image: none !important; box-shadow: none !important;
  color: #3a1e0c !important; font: calc(var(--tk) * 19) / 1 Jua, sans-serif !important; -webkit-text-stroke: 0 !important; text-shadow: none !important; }
html body .v4-duel .duel-opponents { position: absolute; left: 50%; top: calc(var(--tk) * 208); width: calc(var(--tk) * 390); transform: translateX(-50%); display: flex !important; justify-content: center;
  gap: 0 !important; margin: 0 !important; padding: 0 !important; background: none !important; border: 0 !important; }
html body .v4-duel .duel-opponents figure { position: relative; width: calc(var(--tk) * 76); margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; align-items: center; background: none !important; border: 0 !important; box-shadow: none !important; }
html body .v4-duel .duel-opponents img { width: auto !important; height: calc(var(--tk) * 118) !important; max-width: none !important; object-fit: contain; margin: 0 !important; background: none !important; border: 0 !important; border-radius: 0 !important;
  filter: drop-shadow(0 calc(var(--tk) * 4) calc(var(--tk) * 3) #0007); }
html body .v4-duel .duel-opponents figcaption { width: calc(var(--tk) * 70); height: calc(var(--tk) * 36); margin: calc(var(--tk) * 2) 0 0 !important; box-sizing: border-box; padding: 0 calc(var(--tk) * 5) !important;
  display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; white-space: normal;
  background: url(sprites/ui-v4-plate-2line.webp) center / 100% 100% no-repeat !important; border: 0 !important; border-radius: 0 !important;
  color: #fff1cf !important; font: calc(var(--tk) * 12.5) / 1.08 Jua, sans-serif !important; -webkit-text-stroke: 2.5px #2a1206; paint-order: stroke fill; filter: drop-shadow(0 2px 2px #0008); }
html body .v4-duel .duel-board { position: absolute; left: 50%; top: calc(var(--tk) * 376); width: calc(var(--tk) * 384); height: calc(var(--tk) * 140); transform: translateX(-50%); margin: 0 !important;
  box-sizing: border-box; padding: 0 !important; background: url(sprites/ui-v4-score-scroll.webp) center / 100% 100% no-repeat !important; border: 0 !important; border-image: none !important; box-shadow: none !important; }
html body .v4-duel .duel-board p { position: absolute; left: 0; right: 0; margin: 0 !important; text-align: center; background: none !important; border: 0 !important; }
html body .v4-duel .duel-score { top: calc(var(--tk) * 22); padding: 0 calc(var(--tk) * 80) !important; color: #3a1e0c !important; font: calc(var(--tk) * 23) / 1.2 Jua, sans-serif !important; white-space: nowrap; -webkit-text-stroke: 0 !important; text-shadow: none !important; }
html body .v4-duel .duel-score b { color: #b3200f; font-size: 1.25em; margin-inline-start: .2em; }
html body .v4-duel .duel-rank { top: calc(var(--tk) * 71); left: 28% !important; right: 28% !important; height: calc(var(--tk) * 38); display: flex; align-items: center; justify-content: center;
  color: #ffe58a !important; font: calc(var(--tk) * 17) / 1 Jua, sans-serif !important; -webkit-text-stroke: 2.5px #4a0c06; paint-order: stroke fill; white-space: nowrap; overflow: hidden; }
html body .v4-duel .duel-rule { top: calc(var(--tk) * 112); color: #4a2c14 !important; font: calc(var(--tk) * 13) / 1.1 Jua, sans-serif !important; padding: 0 calc(var(--tk) * 40) !important; white-space: nowrap; }
html body .v4-duel .duel-go { position: absolute !important; left: 50%; top: calc(var(--tk) * 520); width: calc(var(--tk) * 250) !important; height: calc(var(--tk) * 72) !important; transform: translateX(-50%); margin: 0 !important; padding: 0 calc(var(--tk) * 50) calc(var(--tk) * 4) !important;
  background: url(sprites/ui-v4-btn-red.webp) center / 100% 100% no-repeat !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; filter: drop-shadow(0 4px 4px #000a);
  color: #ffe6a8 !important; font: calc(var(--tk) * 40) / 1 Jua, sans-serif !important; -webkit-text-stroke: 4px #4a0c06; paint-order: stroke fill; text-shadow: 0 3px 0 #2a0604; white-space: nowrap; }
html body .v4-duel .duel-go::before, html body .v4-duel .duel-go::after { display: none !important; }
html body .v4-duel .duel-opponents { height: auto !important; min-height: 0 !important; align-items: flex-start !important; }
html body .v4-duel .duel-opponents figure { height: auto !important; min-height: 0 !important; justify-content: flex-start !important; }
html body .v4-duel .duel-date { width: calc(var(--tk) * 340); padding: 0 calc(var(--tk) * 34) calc(var(--tk) * 6) !important; font-size: calc(var(--tk) * 18) !important; }
html body .v4-duel .duel-board { height: calc(var(--tk) * 146); }
html body .v4-duel .duel-rule { top: calc(var(--tk) * 114); }
/* 비무 머리띠: 시안의 나무 판 띠 */
html body[data-view="duel"] #wallet { background: linear-gradient(#0000 78%, #1a0a0399), url(sprites/bg-v4-training-floor.webp) center / 100% 100% no-repeat !important; box-shadow: 0 3px 6px #0008; }
html body .v4-duel .duel-board { height: calc(var(--tk) * 144); background-image: url(sprites/ui-v4-score-scroll2.webp) !important; }
html body .v4-duel .duel-score { top: calc(var(--tk) * 18); }
html body .v4-duel .duel-rank { top: calc(var(--tk) * 62); height: calc(var(--tk) * 35); }
html body .v4-duel .duel-rule { top: calc(var(--tk) * 104); font-size: calc(var(--tk) * 13.5) !important; }
/* 키 큰 폰: 남는 높이를 장면 사이에 나눠 협객이 마당 위에 서게 */
html body[data-view="duel"] main.orak-stage { --tx: 0px; }
html body .v4-duel .duel-date { top: calc(var(--tk) * 58 + var(--tx) * .2); }
html body .v4-duel .duel-opponents { top: calc(var(--tk) * 208 + var(--tx) * .5); }
html body .v4-duel .duel-board { top: calc(var(--tk) * 376 + var(--tx) * .72); }
html body .v4-duel .duel-go { top: calc(var(--tk) * 520 + var(--tx) * .86); }
html:not([lang="ko"]) body .v4-duel .duel-go { padding: 0 calc(var(--tk) * 38) calc(var(--tk) * 4) !important; font-size: calc(var(--tk) * 30) !important; }
html:not([lang="ko"]) body .v4-duel .duel-opponents figcaption { font-size: calc(var(--tk) * 11) !important; }
html:not([lang="ko"]) body .v4-duel .duel-score { font-size: calc(var(--tk) * 19) !important; padding: 0 calc(var(--tk) * 70) !important; }
html:not([lang="ko"]) body .v4-duel .duel-rule { font-size: calc(var(--tk) * 12) !important; padding: 0 calc(var(--tk) * 34) !important; }
html:not([lang="ko"]) body .v4-duel .duel-date { font-size: calc(var(--tk) * 15.5) !important; }
html body .v4-duel .duel-board .duel-score, html body .v4-duel .duel-board .duel-score.fit-line, html body .v4-duel .duel-rule, html body .v4-duel .duel-rank { white-space: nowrap !important; text-overflow: clip !important; overflow: hidden; }
html:not([lang="ko"]) body .v4-duel .duel-opponents figcaption { width: calc(var(--tk) * 74); height: calc(var(--tk) * 46); padding: 0 calc(var(--tk) * 6) !important; -webkit-text-stroke-width: 2px; }
html:not([lang="ko"]) body .v4-duel .duel-opponents figcaption { height: auto; min-height: calc(var(--tk) * 46); padding: calc(var(--tk) * 6) calc(var(--tk) * 6) !important; font-size: calc(var(--tk) * 10.5) !important; hyphens: auto; }
/* ── 4차 무림탑 (tower-v1 시안): 밤 누각 판(폭 390 기준 --tk), 규칙 두루마리 + 오행 메달, 층마다 패 다섯, 협객, 기록 두루마리, 붉은 도전 패 ── */
html body[data-view="tower"] { background: #141a2e !important; }
html body[data-view="tower"] main.orak-stage { --tk: 1px; --tx: 0px; background: url(sprites/bg-v4-tower.webp) center top / calc(var(--tk) * 390) auto no-repeat, url(sprites/bg-v4-tower-floor.webp) center calc(var(--tk) * 693) / calc(var(--tk) * 390) auto repeat-y, #141a2e !important; }
html body[data-view="tower"] #wallet .wallet-resources { display: none !important; }
html body[data-view="tower"] #wallet { background: linear-gradient(#0000 78%, #1a0a0399), url(sprites/bg-v4-training-floor.webp) center / 100% 100% no-repeat !important; box-shadow: 0 3px 6px #0008; }
html body[data-view="tower"] #screen { position: static !important; background: none !important; }
html body[data-view="tower"] #screen > h1, html body[data-view="tower"] .tower-week, html body[data-view="tower"] .tower-controls { display: none !important; }
html body .t4-rule { position: absolute !important; left: 50%; top: calc(var(--tk) * 54); width: calc(var(--tk) * 376); height: calc(var(--tk) * 62); transform: translateX(-50%); margin: 0 !important; box-sizing: border-box;
  padding: 0 calc(var(--tk) * 34) calc(var(--tk) * 4) calc(var(--tk) * 96) !important; display: flex !important; align-items: center; background: url(sprites/ui-v4-date-scroll.webp) center / 100% 100% no-repeat !important;
  border: 0 !important; border-image: none !important; box-shadow: none !important; border-radius: 0 !important; color: #3a1e0c !important; font: calc(var(--tk) * 15) / 1.15 Jua, sans-serif !important; text-align: start; -webkit-text-stroke: 0 !important; text-shadow: none !important; }
html body .t4-rule .t4-medal { position: absolute; left: calc(var(--tk) * 34); top: 50%; width: calc(var(--tk) * 56); height: calc(var(--tk) * 54); transform: translateY(-52%); object-fit: contain; filter: drop-shadow(0 2px 2px #0008); }
html body .t4-rule .t4-clock { display: grid; place-items: center; font-style: normal; font-size: calc(var(--tk) * 30); }
html body .t4-rule::after { content: ''; position: absolute; left: calc(var(--tk) * 90); top: 24%; bottom: 28%; width: 2px; background: #8a6a40; }
html body .t4-rule .fit-rule { display: block; width: 100%; }
html body .t4-scene { position: static !important; background: none !important; border: 0 !important; box-shadow: none !important; margin: 0 !important; padding: 0 !important; height: 0 !important; min-height: 0 !important; aspect-ratio: auto !important; overflow: visible !important; }
html body .t4-scene::before, html body .t4-scene::after { display: none !important; }
html body .t4-scene .t4-floor { position: absolute !important; left: 50% !important; transform: translate(-50%, -50%) !important; width: calc(var(--tk) * 92) !important; height: calc(var(--tk) * 38) !important; min-width: 0 !important; margin: 0 !important; padding: 0 0 calc(var(--tk) * 2) !important;
  display: grid !important; place-items: center; background: url(sprites/ui-v4-plate-dark.webp) center / 100% 100% no-repeat !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; opacity: 1 !important; filter: drop-shadow(0 3px 3px #000a) !important; }
html body .t4-scene .t4-floor strong { position: static !important; margin: 0 !important; padding: 0 !important; background: none !important; border: 0 !important; color: #fff1cf !important; font: calc(var(--tk) * 19) / 1 Jua, sans-serif !important; -webkit-text-stroke: 3px #2a1206; paint-order: stroke fill; white-space: nowrap; }
html body .t4-scene .t4-floor.next { width: calc(var(--tk) * 100) !important; height: calc(var(--tk) * 44) !important; filter: drop-shadow(0 0 calc(var(--tk) * 8) #ffd24ccc) drop-shadow(0 3px 3px #000a) !important; animation: m4glow 1.8s ease-in-out infinite; }
html body .t4-scene .t4-floor.next strong { color: #ffe58a !important; font-size: calc(var(--tk) * 22) !important; }
html body .t4-scene .t4-floor.boss { width: calc(var(--tk) * 104) !important; background-image: url(sprites/ui-v4-btn-red2.webp) !important; padding-right: calc(var(--tk) * 26) !important; }
html body .t4-scene .t4-floor.boss .portrait, html body .t4-scene .t4-floor.boss canvas, html body .t4-scene .t4-floor.boss img { position: absolute !important; right: calc(var(--tk) * -30); top: 50%; width: calc(var(--tk) * 58) !important; height: calc(var(--tk) * 58) !important; transform: translateY(-58%); margin: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
html body .t4-scene .t4-hero { position: absolute !important; left: calc(50% - var(--tk) * 150); top: calc(var(--tk) * 360); width: auto !important; height: calc(var(--tk) * 118) !important; min-width: 0 !important; z-index: 1; pointer-events: none; filter: drop-shadow(0 3px 2px #0009); }
html body .t4-scene .t4-lock { position: absolute !important; left: 50%; top: calc(var(--tk) * 400); transform: translateX(-50%); width: calc(var(--tk) * 250); margin: 0 !important; padding: calc(var(--tk) * 12) calc(var(--tk) * 18) !important;
  background: url(sprites/ui-v4-plate-dark.webp) center / 100% 100% no-repeat !important; border: 0 !important; color: #fff1cf !important; font: calc(var(--tk) * 16) / 1.2 Jua, sans-serif !important; text-align: center; -webkit-text-stroke: 3px #2a1206; paint-order: stroke fill; }
html body .t4-scene .t4-lock::before { content: '🔒 '; }
html body .t4-scene.locked .t4-hero { filter: drop-shadow(0 3px 2px #0009) brightness(.85); }
html body .t4-stats { position: absolute; left: 50%; top: calc(var(--tk) * 466 + var(--tx)); width: calc(var(--tk) * 384); height: calc(var(--tk) * 66); transform: translateX(-50%); box-sizing: border-box; padding: 0 calc(var(--tk) * 36) calc(var(--tk) * 4);
  display: flex; align-items: center; justify-content: center; gap: calc(var(--tk) * 10); background: url(sprites/ui-v4-date-scroll.webp) center / 100% 100% no-repeat; }
html body .t4-stats p { flex: 1; margin: 0 !important; height: calc(var(--tk) * 42); display: grid; place-items: center; background: url(sprites/ui-v4-btn-cream.webp) center / 100% 100% no-repeat; color: #3a1e0c; font: calc(var(--tk) * 18) / 1 Jua, sans-serif; white-space: nowrap; overflow: hidden; }
html body .t4-stats p b { color: #b3200f; font-size: 1.15em; margin-inline-start: .15em; }
html body .t4-scene .t4-go { position: absolute !important; left: 50%; top: calc(var(--tk) * 536 + var(--tx)); width: calc(var(--tk) * 290) !important; height: calc(var(--tk) * 62) !important; transform: translateX(-50%); margin: 0 !important; padding: 0 calc(var(--tk) * 54) calc(var(--tk) * 4) !important;
  background: url(sprites/ui-v4-btn-red.webp) center / 100% 100% no-repeat !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; filter: drop-shadow(0 4px 4px #000a);
  color: #ffe6a8 !important; font: calc(var(--tk) * 32) / 1 Jua, sans-serif !important; -webkit-text-stroke: 4px #4a0c06; paint-order: stroke fill; text-shadow: 0 3px 0 #2a0604; white-space: nowrap; }
html body .t4-scene .t4-go::before, html body .t4-scene .t4-go::after { display: none !important; }
html body .t4-rule .t4-medal { display: grid; place-items: center; background: center / contain no-repeat; font-style: normal; }
html body .t4-rule .t4-medal .el-badge { position: static !important; width: auto !important; height: auto !important; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 calc(var(--tk) * 6) calc(var(--tk) * 6) 0 !important;
  color: #fff1cf !important; font: calc(var(--tk) * 22) / 1 Jua, sans-serif !important; -webkit-text-stroke: 3px #3a1e0c; paint-order: stroke fill; }
html body .t4-scene .t4-floor.next, html body .t4-scene .tower-platform.t4-floor.next { background: url(sprites/ui-v4-plate-dark.webp) center / 100% 100% no-repeat !important; border: 0 !important; box-shadow: none !important; }
html body .t4-scene .tower-platform.t4-floor.boss { background: url(sprites/ui-v4-btn-red2.webp) center / 100% 100% no-repeat !important; }
html body .t4-stats p { display: flex; align-items: center; justify-content: center; height: calc(var(--tk) * 38); flex: 0 1 calc(var(--tk) * 136); }
html body .t4-scene .t4-hero { height: calc(var(--tk) * 130) !important; top: calc(var(--tk) * 344); left: calc(50% - var(--tk) * 160); }
html body .t4-scene .tower-platform.t4-floor.next { filter: drop-shadow(0 0 calc(var(--tk) * 7) #ffd24c) drop-shadow(0 0 calc(var(--tk) * 3) #ffe9a0) !important; }
html body .t4-scene .tower-platform.t4-floor.next strong { color: #ffe27a !important; }
html body .t4-scene .tower-platform.t4-floor.locked:not(.boss) { filter: drop-shadow(0 3px 3px #000a) brightness(.88) !important; }
html body .t4-scene .tower-platform.t4-floor.next { animation: none !important; }
html body .t4-scene .tower-platform.t4-floor.boss, html body .t4-scene .tower-platform.t4-floor.boss.locked { border: 0 !important; outline: 0 !important; box-shadow: none !important; }
html body .t4-scene .tower-platform.t4-floor.boss::before, html body .t4-scene .tower-platform.t4-floor.boss::after, html body .t4-scene .tower-platform.t4-floor::before, html body .t4-scene .tower-platform.t4-floor::after { display: none !important; }
html body .cards-screen .t4-rule.weekly-rule { padding: calc(var(--tk) * 8) calc(var(--tk) * 34) calc(var(--tk) * 12) calc(var(--tk) * 98) !important; font-size: calc(var(--tk) * 15) !important; line-height: 1.12 !important; }
html body .cards-screen .t4-rule .fit-rule { height: 100%; display: flex; align-items: center; white-space: normal; overflow: hidden; }
html:not([lang="ko"]) body .cards-screen .t4-rule.weekly-rule { font-size: calc(var(--tk) * 13) !important; }
html body .t4-stats p { padding: 0 calc(var(--tk) * 14) calc(var(--tk) * 2) !important; box-sizing: border-box; }
html body .t4-in { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-align: center; }
html body .t4-scene .t4-go { padding: 0 calc(var(--tk) * 54) calc(var(--tk) * 4) !important; display: flex !important; align-items: center; justify-content: center; }
html body .t4-scene .t4-go .t4-in { flex: 1 1 auto; min-width: 0; }
html body .cards-screen .t4-rule .fit-rule { height: auto !important; max-height: 100%; display: block !important; overflow: hidden; }
html body .t4-in, html body .t4-in.fit-line { text-overflow: clip !important; }
html:not([lang="ko"]) body .t4-scene .t4-go { font-size: calc(var(--tk) * 25) !important; }
html:not([lang="ko"]) body .t4-stats p { font-size: calc(var(--tk) * 15); }
html body .cards-screen .t4-rule .fit-rule { font-family: Jua, sans-serif; }
html:is([lang="vi"], [lang="th"]) body .cards-screen .t4-rule .fit-rule { font-family: system-ui, sans-serif; }
html:not([lang="ko"]) body .cards-screen .t4-rule.weekly-rule { height: calc(var(--tk) * 76); top: calc(var(--tk) * 48); padding-top: calc(var(--tk) * 14) !important; padding-bottom: calc(var(--tk) * 18) !important; font-size: calc(var(--tk) * 12.5) !important; }
html:not([lang="ko"]) body .t4-stats { padding: 0 calc(var(--tk) * 30) calc(var(--tk) * 4); }
html:not([lang="ko"]) body .t4-stats p { flex: 1 1 0; margin: 0 calc(var(--tk) * 3) !important; padding: 0 calc(var(--tk) * 9) calc(var(--tk) * 2) !important; }
html body .t4-stats p .t4-in { flex: 1 1 auto; min-width: 0; }
html:not([lang="ko"]) body .cards-screen .t4-rule .fit-rule { max-height: calc(var(--tk) * 32); margin-top: calc(var(--tk) * -4); }
html:not([lang="ko"]) body .t4-rule .t4-medal { width: calc(var(--tk) * 46); height: calc(var(--tk) * 44); left: calc(var(--tk) * 30); }
html:not([lang="ko"]) body .t4-rule::after { left: calc(var(--tk) * 80); }
html:not([lang="ko"]) body .cards-screen .t4-rule.weekly-rule { padding-left: calc(var(--tk) * 86) !important; padding-right: calc(var(--tk) * 28) !important; }
html:not([lang="ko"]) body .t4-stats p { padding: 0 calc(var(--tk) * 19) calc(var(--tk) * 2) !important; }
/* ── 4차 이야기 앨범 (story-v1 시안): 나무 진열장, 앨범 현판, 장 꼬리표 + 장면 수 알약, 핀 꽂은 사진 셋씩, 선반 ── */
html body[data-view="replay"] { background: #4a2a14 !important; }
html body[data-view="replay"] main.orak-stage { background: url(sprites/bg-v4-story.webp) center top / 100% auto no-repeat, url(sprites/bg-v4-story-wall.webp) center 0 / 100% auto repeat-y, #4a2a14 !important; }
html body[data-view="replay"] #wallet .wallet-resources { display: none !important; }
html body[data-view="replay"] #wallet { background: none !important; box-shadow: none !important; }
html body[data-view="replay"] #screen { background: none !important; padding: 0 0 16px !important; }
html body[data-view="replay"] .cards-screen .album-title { display: flex !important; align-items: center; justify-content: center; position: static !important; width: 250px; max-width: 70%; height: 48px; margin: 34px auto 10px !important; padding: 0 44px 2px !important; box-sizing: border-box;
  background: url(sprites/ui-v4-album-plaque.webp) center / 100% 100% no-repeat !important; border: 0 !important; color: #3a1e0c !important; font: 23px/1 Jua, sans-serif !important; -webkit-text-stroke: 0 !important; text-shadow: none !important; white-space: nowrap; filter: drop-shadow(0 3px 3px #0008); }
html body[data-view="replay"] .cards-screen .album-head { position: relative; display: flex; align-items: center; justify-content: space-between; height: 34px; margin: 14px 8px 2px; padding: 0 6px 0 10px;
  background: url(sprites/ui-v4-shelf.webp) center 62% / 100% 16px no-repeat; }
html body[data-view="replay"] .cards-screen .album-heading { position: relative; display: flex !important; align-items: center; margin: 0 !important; height: 32px; width: auto; max-width: 62%; padding: 0 18px 1px 22px !important; box-sizing: border-box;
  background: url(sprites/ui-v4-btn-cream.webp) center / 100% 100% no-repeat !important; border: 0 !important; border-image: none !important; color: #3a1e0c !important; font: 17px/1 Jua, sans-serif !important; -webkit-text-stroke: 0 !important; text-shadow: none !important;
  white-space: nowrap !important; overflow: hidden; filter: drop-shadow(0 2px 2px #0008); }
html body[data-view="replay"] .cards-screen .album-head .album-count { display: flex; align-items: center; height: 28px; margin: 0 !important; padding: 0 14px 1px !important; border-radius: 0 !important;
  background: url(sprites/ui-v4-count-pill.webp) center / 100% 100% no-repeat !important; color: #fff1cf !important; font: 14px/1 Jua, sans-serif !important; white-space: nowrap; filter: drop-shadow(0 2px 2px #0008); }
html body[data-view="replay"] .cards-screen .album-head .album-count b { color: #ffd34d; margin-inline-end: 1px; }
html body[data-view="replay"] .cards-screen .album-strip { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 9px !important; margin: 0 8px !important; padding: 12px 14px 16px !important; overflow: visible !important;
  background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--row, 104px) - 10px), #8a5a2c calc(var(--row, 104px) - 10px) calc(var(--row, 104px) - 8px), #5a3214 calc(var(--row, 104px) - 8px) calc(var(--row, 104px) - 2px), #2a1206 calc(var(--row, 104px) - 2px) var(--row, 104px)) !important;
  background-position: 0 4px !important; }
html body[data-view="replay"] .cards-screen .album-card { position: relative; display: flex !important; flex-direction: column; width: auto !important; height: auto !important; aspect-ratio: 113 / 84 !important; min-height: 0 !important; margin: 0 !important; padding: 4px 4px 0 !important;
  background: #f1e0bb !important; border: 2px solid #b48a52 !important; border-radius: 3px !important; box-shadow: inset 0 0 0 1px #fff6dd, 0 3px 4px #000a !important; overflow: visible !important; opacity: 1 !important; filter: none !important; }
html body[data-view="replay"] .cards-screen .album-card .album-pin { position: absolute; left: 50%; top: -9px; width: 17px !important; height: 15px !important; transform: translateX(-50%); z-index: 2; object-fit: contain; border: 0 !important; filter: drop-shadow(0 1px 1px #0008) !important; opacity: 1 !important; }
html body[data-view="replay"] .cards-screen .album-card .album-shot { position: relative; flex: 1 1 auto; min-height: 0; display: block; overflow: hidden; border: 1px solid #8a6a40; background: #3a2a1c; }
html body[data-view="replay"] .cards-screen .album-card .album-shot > img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; filter: none !important; opacity: 1 !important; border-radius: 0 !important; }
html body[data-view="replay"] .cards-screen .album-card > strong { display: block !important; flex: none; height: 19px; min-height: 0 !important; margin: 0 !important; padding: 0 2px !important; color: #3a1e0c !important; font: 11px/19px Jua, sans-serif !important;
  text-align: center !important; white-space: nowrap !important; overflow: hidden; text-overflow: clip; -webkit-line-clamp: unset !important; background: none !important; }
html body[data-view="replay"] .cards-screen .album-card.locked { background: #d9c7a1 !important; }
html body[data-view="replay"] .cards-screen .album-card.locked .album-shot { background: linear-gradient(#6a6058, #3e3630) !important; }
html body[data-view="replay"] .cards-screen .album-card.locked .album-shot > img.album-silhouette { inset: 8% 0 0; height: 92% !important; object-fit: contain; object-position: 50% 100%; filter: brightness(0) opacity(.6) !important; }
html body[data-view="replay"] .cards-screen .album-card.locked .album-shot > img.album-lock { inset: auto; left: 50%; top: 50%; width: 30px !important; height: 34px !important; transform: translate(-50%, -50%); object-fit: contain; filter: drop-shadow(0 2px 2px #000a) !important; }
html:not([lang="ko"]) body[data-view="replay"] .cards-screen .album-heading { font-size: 14px !important; }
html:not([lang="ko"]) body[data-view="replay"] .cards-screen .album-card > strong { font-size: 10px !important; }
html body[data-view="replay"] .cards-screen .album-strip { background-image: none !important; }
html body[data-view="replay"] .cards-screen .album-card::after { content: ''; position: absolute; left: -7px; right: -7px; bottom: -15px; height: 9px; z-index: -1; pointer-events: none;
  background: linear-gradient(#a06a34, #6a3c18 35%, #3a1c08); border-radius: 1px; box-shadow: 0 3px 4px #0009; }
html body[data-view="replay"] .cards-screen .album-strip { isolation: isolate; }
html body[data-view="replay"] .cards-screen .album-head { background-size: 100% 22px; }
html body[data-view="replay"] .cards-screen .album-strip { gap: 24px 8px !important; padding: 14px 10px 18px !important; }
html body[data-view="replay"] .cards-screen .album-card .album-pin { top: -10px; width: 19px !important; height: 17px !important; }
html body[data-view="replay"] .cards-screen .album-card.locked .album-shot { background: radial-gradient(ellipse at 50% 40%, #b2aaa0, #6e665e 75%) !important; }
html body[data-view="replay"] .cards-screen .album-card.locked .album-shot > img.album-silhouette { filter: brightness(0) opacity(.7) !important; }
html:not([lang="ko"]) body[data-view="replay"] .cards-screen .album-card > strong { height: 23px; padding: 1px 1px 0 !important; font: 9.5px/1.08 Jua, sans-serif !important; white-space: normal !important; display: flex !important; align-items: center; justify-content: center; overflow: hidden; }
html:is([lang="vi"], [lang="th"]) body[data-view="replay"] .cards-screen .album-card > strong { font-family: system-ui, sans-serif !important; }
html body[data-view="replay"] .cards-screen .album-card.locked .album-shot > img.album-silhouette { inset: auto 0 -6% 0; width: 100% !important; height: 112% !important; object-fit: contain; object-position: 50% 100%; }
html body[data-view="replay"] .cards-screen .album-card.locked .album-shot.who-2 > img.album-silhouette:nth-child(1) { left: -22%; right: auto; width: 80% !important; }
html body[data-view="replay"] .cards-screen .album-card.locked .album-shot.who-2 > img.album-silhouette:nth-child(2) { right: -22%; left: auto; width: 80% !important; transform: scaleX(-1); }
html body[data-view="replay"] .cards-screen .album-card.locked .album-shot > img.album-lock { z-index: 1; }
/* ── 4차 기록장 (book-v1 시안): 펼친 책 판 위 '나의 기록' 표(아이콘·값 칸), 도전 과제 판·두루마리 줄(메달·진행 막대·도장). --tk = 폭/390 ── */
html body .osc-book.v4-book { --tk: 1px; background: #3a2010 !important; font-family: Jua, sans-serif; }
html body .osc-book.v4-book::after { display: none !important; }
html body .osc-book.v4-book .osc-header { display: none !important; }
html body .osc-book.v4-book .osc-book-scroll { position: relative !important; max-width: none !important; margin: 0 !important; padding: calc(var(--tk) * 418) calc(var(--tk) * 10) calc(var(--tk) * 110) !important; box-sizing: border-box;
  background: url(sprites/bg-v4-book.webp) center top / calc(var(--tk) * 390) auto no-repeat local, url(sprites/bg-v4-book-floor.webp) center calc(var(--tk) * 690) / calc(var(--tk) * 390) auto repeat-y local, #3a2010 !important; }
html body .osc-book.v4-book .osc-heading:first-child { position: absolute; left: calc(50% - var(--tk) * 100); top: calc(var(--tk) * 146); margin: 0 !important; padding: 0 calc(var(--tk) * 8) calc(var(--tk) * 6) !important; width: auto !important;
  background: url(sprites/ui-v4-underline.webp) left bottom / 100% calc(var(--tk) * 10) no-repeat !important; border: 0 !important; color: #3a1e0c !important; font: calc(var(--tk) * 25) / 1.1 Jua, sans-serif !important; -webkit-text-stroke: 0 !important; text-shadow: none !important; white-space: nowrap; }
html body .osc-book.v4-book .osc-records { position: absolute; left: calc(50% - var(--tk) * 129); top: calc(var(--tk) * 184); width: calc(var(--tk) * 262); display: grid !important; grid-template-columns: 1fr !important; gap: 0 !important; margin: 0 !important; padding: 0 !important;
  background: none !important; border: 0 !important; border-top: 1px solid #8a6a4099 !important; box-shadow: none !important; border-radius: 0 !important; }
html body .osc-book.v4-book .osc-record { display: grid !important; grid-template-columns: calc(var(--tk) * 26) 1fr calc(var(--tk) * 78); align-items: center; height: calc(var(--tk) * 18.8); padding: 0 !important; gap: 0 calc(var(--tk) * 6);
  border: 0 !important; border-bottom: 1px solid #8a6a4099 !important; border-radius: 0 !important; background: none !important; }
html body .osc-book.v4-book .osc-record .bk-icon { width: calc(var(--tk) * 22); height: calc(var(--tk) * 16); object-fit: contain; justify-self: center; }
html body .osc-book.v4-book .osc-record .osc-label { color: #3a1e0c !important; font: calc(var(--tk) * 13.5) / 1 Jua, sans-serif !important; white-space: nowrap; overflow: hidden; text-overflow: clip; }
html body .osc-book.v4-book .osc-record-value { height: 100%; display: flex; align-items: center; justify-content: flex-end; padding-right: calc(var(--tk) * 4); border-left: 1px solid #8a6a4099; color: #3a1e0c !important; font: calc(var(--tk) * 14) / 1 Jua, sans-serif !important; white-space: nowrap; }
html body .osc-book.v4-book .osc-heading:not(:first-child) { display: flex !important; align-items: center; justify-content: center; width: calc(var(--tk) * 250) !important; height: calc(var(--tk) * 56); margin: 0 auto calc(var(--tk) * 6) !important; padding: 0 calc(var(--tk) * 50) calc(var(--tk) * 3) !important; box-sizing: border-box;
  background: url(sprites/ui-v4-heading.webp) center / 100% 100% no-repeat !important; border: 0 !important; color: #fff1cf !important; font: calc(var(--tk) * 22) / 1 Jua, sans-serif !important; -webkit-text-stroke: 3px #2a1206; paint-order: stroke fill; white-space: nowrap; filter: drop-shadow(0 3px 3px #0008); }
html body .osc-book.v4-book .osc-tier { margin: calc(var(--tk) * 10) 0 calc(var(--tk) * 4) !important; text-align: center; color: #ffe08a !important; font: calc(var(--tk) * 15) / 1 Jua, sans-serif !important; -webkit-text-stroke: 3px #2a1206; paint-order: stroke fill; }
html body .osc-book.v4-book .osc-challenges { gap: calc(var(--tk) * 4) !important; }
html body .osc-book.v4-book .osc-challenge { position: relative; display: flex !important; align-items: center; gap: calc(var(--tk) * 8) !important; min-height: calc(var(--tk) * 62); padding: calc(var(--tk) * 6) calc(var(--tk) * 30) calc(var(--tk) * 8) calc(var(--tk) * 30) !important; box-sizing: border-box;
  border: 0 !important; border-radius: 0 !important; background: url(sprites/ui-v4-task-row.webp) center / 100% 100% no-repeat !important; color: #3a1e0c !important; box-shadow: none !important; filter: drop-shadow(0 3px 3px #0007); }
html body .osc-book.v4-book .osc-challenge .bk-medal { flex: none; width: calc(var(--tk) * 40); height: calc(var(--tk) * 40); object-fit: contain; }
html body .osc-book.v4-book .osc-challenge-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: calc(var(--tk) * 3); }
html body .osc-book.v4-book .osc-challenge .osc-label { color: #3a1e0c !important; font: calc(var(--tk) * 15) / 1.1 Jua, sans-serif !important; -webkit-text-stroke: 0 !important; }
html body .osc-book.v4-book .osc-challenge .osc-sub { color: #7a5a34 !important; font: calc(var(--tk) * 11) / 1 Jua, sans-serif !important; order: 3; }
html body .osc-book.v4-book .bk-bar { position: relative; display: block; height: calc(var(--tk) * 10); background: url(sprites/ui-v4-bar-track.webp) center / 100% 100% no-repeat; }
html body .osc-book.v4-book .bk-bar > i { position: absolute; left: 0; top: 0; bottom: 0; min-width: calc(var(--tk) * 10); background: url(sprites/ui-v4-bar-green.webp) left center / auto 100% no-repeat; background-size: 100% 100%; border-radius: 9px; }
html body .osc-book.v4-book .bk-bar > i[style^="width: 0%"] { display: none; }
html body .osc-book.v4-book .bk-value { flex: none; min-width: calc(var(--tk) * 50); text-align: right; color: #3a1e0c; font: calc(var(--tk) * 16) / 1 Jua, sans-serif; }
html body .osc-book.v4-book .osc-done-stamp { flex: none; display: grid !important; place-items: center; width: calc(var(--tk) * 62); height: calc(var(--tk) * 40); margin: 0 !important; padding: 0 0 calc(var(--tk) * 2) !important; border: 0 !important; border-radius: 0 !important;
  background: url(sprites/ui-v4-stamp-done.webp) center / 100% 100% no-repeat !important; color: #c0281a !important; font: calc(var(--tk) * 18) / 1 Jua, sans-serif !important; -webkit-text-stroke: 0 !important; transform: rotate(-8deg) !important; }
html body .osc-book.v4-book .osc-done-stamp .osc-date { display: none !important; }
html body[data-view="book"] #wallet .wallet-resources { display: none !important; }
html body .osc-book.v4-book .osc-challenge { min-height: calc(var(--tk) * 70); padding: calc(var(--tk) * 12) calc(var(--tk) * 34) calc(var(--tk) * 12) calc(var(--tk) * 34) !important; }
html body .osc-book.v4-book .osc-challenge .osc-sub { position: absolute; right: calc(var(--tk) * 40); top: calc(var(--tk) * 13); -webkit-text-stroke: 0 !important; paint-order: normal; text-shadow: none !important; font-size: calc(var(--tk) * 10.5) !important; }
html body .osc-book.v4-book .osc-challenge.osc-done .osc-sub { display: none !important; }
html body .osc-book.v4-book .bk-value { padding-top: calc(var(--tk) * 12); }
html body .osc-book.v4-book .osc-challenge .osc-label { padding-right: calc(var(--tk) * 4); }
html body .osc-book.v4-book .osc-challenge { padding-right: calc(var(--tk) * 42) !important; }
html body .osc-book.v4-book .bk-value, html body .osc-book.v4-book .osc-challenge .osc-label { -webkit-text-stroke: 0 !important; paint-order: normal; text-shadow: none !important; }
html body .osc-book.v4-book .osc-challenge .osc-sub { right: calc(var(--tk) * 46); }
html body .osc-book.v4-book .osc-done-stamp { white-space: nowrap; overflow: hidden; }
html:not([lang="ko"]) body .osc-book.v4-book .osc-done-stamp { width: auto; min-width: calc(var(--tk) * 62); padding: 0 calc(var(--tk) * 9) calc(var(--tk) * 2) !important; font-size: calc(var(--tk) * 12) !important; }
html body .osc-book.v4-book .osc-challenge .osc-sub { top: calc(var(--tk) * 17); }
html body .t4-scene .t4-lock { white-space: normal !important; }
html body .osc-book.v4-book .osc-challenge .osc-sub { position: static !important; order: 3; }
html body .osc-book.v4-book .bk-value { padding-top: 0; }
html body .osc-book.v4-book .osc-heading:first-child { max-width: calc(var(--tk) * 170); overflow: hidden; }
html:not([lang="ko"]) body .v4-map .m4-head { left: 40px; right: 40px; }
html body .result-panel .defeat-advice li > span.m4-two { display: block; flex: 1 1 auto; min-width: 0; max-height: 38px; overflow: hidden; }
html:not([lang="ko"]) body #fight .result-panel .result-title span { display: block; max-width: 290px; white-space: nowrap; overflow: hidden; text-overflow: clip; padding: 0 4px; }
html:not([lang="ko"]) body #fight .result-panel .result-title span { padding: 0 10px; text-overflow: clip !important; }
html:not([lang="ko"]) body #fight .result-panel .advice-go { flex: 0 0 auto; width: 78px; min-width: 0 !important; max-width: 78px !important; padding: 0 6px !important; font-size: 10.5px !important; overflow: hidden; }
html:not([lang="ko"]) body .result-panel .defeat-advice li { gap: 5px; padding: 0 5px 0 6px !important; }
html:not([lang="ko"]) body .result-panel .defeat-advice { padding-left: 5% !important; padding-right: 5% !important; }
html:not([lang="ko"]) body .result-panel .defeat-advice li { min-height: 40px !important; height: auto !important; padding-top: 4px !important; padding-bottom: 4px !important; }
html:not([lang="ko"]) body .result-panel .defeat-advice li > span.m4-two { max-height: 50px; font-size: 11.5px; line-height: 1.1; }
html:not([lang="ko"]) body #fight .result-panel .advice-head { font-size: 15px !important; padding-left: 22px !important; padding-right: 22px !important; }
html:not([lang="ko"]) body .result-panel .defeat-advice li { padding-top: 7px !important; padding-bottom: 7px !important; min-height: 44px !important; }
html:not([lang="ko"]) body .result-panel .result-stage.m4-two { white-space: normal !important; display: flex !important; align-items: center; justify-content: center; text-align: center; padding: 6px 30px 8px !important; font-size: 15px; line-height: 1.08 !important; overflow: hidden; }
html:not([lang="ko"]) body .result-panel .result-stage.m4-two { height: 54px !important; min-height: 54px; padding: 4px 30px 10px !important; }
/* 처음 안내 쪽지: 4차 장면(고정 판) 위에 떠 있게, 크림 종이 + 금테, 금빛 확인 단추 */
html body #screen > .tutorial { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--menu-height, 90px) + 14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(340px, calc(100vw - 32px)); box-sizing: border-box; margin: 0;
  padding: 14px 16px 12px; border: 3px solid #c9973f; border-radius: 12px; background: linear-gradient(#fbf1d8, #efdcb2); box-shadow: inset 0 0 0 2px #fff6dd, 0 6px 16px #000a;
  color: #3a1e0c; font: 16px/1.35 Jua, sans-serif; text-align: center; }
html:not([lang="ko"]) body #screen > .tutorial { font-family: system-ui, sans-serif; font-size: 14.5px; }
html body #screen > .tutorial button { margin: 10px auto 0; min-width: 120px; height: 40px; padding: 0 18px; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  background: url(sprites/ui-v4-btn-gold2.webp) center / 100% 100% no-repeat !important; color: #3a1e0c !important; font: 17px/1 Jua, sans-serif !important; -webkit-text-stroke: 0 !important; filter: drop-shadow(0 2px 2px #0008); }

/* ===== 5차: 큰 나무 현판 (party·duel·tower·story·book 시안 위 띠) ===== */
html body #wallet.sub-bar.big-title .sub-title { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 4px); transform: translateX(-50%); z-index: 2;
  width: min(268px, calc(100% - 116px)); height: 50px; min-width: 0; box-sizing: border-box; padding: 0 44px 3px !important; display: flex; align-items: center; justify-content: center;
  border: 0 !important; border-image: none !important; background: url(sprites/ui-v4-heading.webp) center / 100% 100% no-repeat !important; filter: drop-shadow(0 3px 3px #0009);
  color: #fff1d6; font: 29px/1 Jua, sans-serif; -webkit-text-stroke: 4px #2a1206; paint-order: stroke fill; letter-spacing: .04em; overflow: hidden !important; }
html body #wallet.sub-bar.big-title .wallet-resources { display: none !important; }
/* 작은 현판(동료·상세·수련)은 시안처럼 크림색 글자 */
html body #wallet.sub-bar:not(.big-title) .sub-title { color: #fff1d6; font-size: 20px; }
/* 5차: 무림탑 규칙 두루마리 = 짙은 굵은 글자 한 줄 (tower-v1) */
html body .cards-screen .t4-rule.weekly-rule { padding: calc(var(--tk) * 8) calc(var(--tk) * 30) calc(var(--tk) * 12) calc(var(--tk) * 100) !important; font-size: calc(var(--tk) * 17.5) !important; color: #2a1408 !important; }
html[lang="ko"] body .cards-screen .t4-rule .fit-rule { white-space: nowrap !important; overflow: visible; }
html:not([lang="ko"]) body .cards-screen .t4-rule.weekly-rule { font-size: calc(var(--tk) * 14) !important; color: #2a1408 !important; }
html body .t4-rule .t4-medal .el-badge { font-size: calc(var(--tk) * 19) !important; padding: 0 calc(var(--tk) * 10) calc(var(--tk) * 14) 0 !important; }
/* 5차: 층 패 글자 — 19px+3px 테두리는 '층'의 ㅊ 윗점이 가로획과 붙어 '증'처럼 보였다. 시안 크기 + 얇은 테두리. */
html body .t4-scene .t4-floor strong { font-size: calc(var(--tk) * 22) !important; -webkit-text-stroke: 2px #2a1206 !important; letter-spacing: .02em; }
html body .t4-scene .t4-floor.next strong { font-size: calc(var(--tk) * 25) !important; }
/* 5차: 규칙 두루마리를 시안처럼 두껍게 (종이 높이 약 52px) */
html body .cards-screen .t4-rule.weekly-rule { top: calc(var(--tk) * 44); height: calc(var(--tk) * 96); background-image: url(sprites/ui-v4-rule-scroll.webp) !important; padding-bottom: calc(var(--tk) * 30) !important; padding-top: 0 !important; }
html body .t4-rule::after { top: 17%; bottom: 37%; }
html body .t4-rule .t4-medal { top: 34%; width: calc(var(--tk) * 50); height: calc(var(--tk) * 48); }
html body .cards-screen .t4-rule.weekly-rule { top: calc(var(--tk) * 58); }
html body .t4-rule .t4-medal { top: 41%; width: calc(var(--tk) * 54); height: calc(var(--tk) * 52); }
html body .cards-screen .t4-rule .fit-rule { -webkit-text-stroke: .7px #2a1408; }
/* 5차: 비무 점수 두루마리 (duel-v1): 굵은 짙은 글자, 숫자는 붙여서 크게, 알약 안 숫자는 금빛 */
html body .v4-duel .duel-score { font-size: calc(var(--tk) * 25) !important; color: #2a1408 !important; -webkit-text-stroke: .6px #2a1408 !important; }
html body .v4-duel .duel-score b { margin-inline-start: 0; font-size: 1.3em; color: #a3170b; -webkit-text-stroke: 1px #5a0c05; }
html body .v4-duel .duel-rank b { color: #ffd84a; margin: 0 .1em; }
html body .v4-duel .duel-rule { font-size: calc(var(--tk) * 17) !important; color: #2a1408 !important; -webkit-text-stroke: .4px #2a1408; }
html:not([lang="ko"]) body .v4-duel .duel-rule { font-size: calc(var(--tk) * 13) !important; }
html body .v4-duel .duel-rank { color: #fff1d6 !important; font-size: calc(var(--tk) * 19) !important; left: 25% !important; right: 25% !important; padding: 0 calc(var(--tk) * 14) !important; box-sizing: border-box; }
html body .v4-duel .duel-rank { top: calc(var(--tk) * 70); }
html body .v4-duel .duel-date { color: #2a1408 !important; -webkit-text-stroke: .5px #2a1408 !important; }
/* 5차: 다른 언어 비무 이름패 — 단어 안에서 마음대로 끊지 않고(붙임표에서만) 세 줄까지, 넘치면 글자만 줄인다 */
html:not([lang="ko"]) body .v4-duel .duel-opponents figcaption { hyphens: manual !important; word-break: normal !important; overflow-wrap: normal !important; width: calc(var(--tk) * 77);
  height: calc(var(--tk) * 48) !important; min-height: 0 !important; overflow: hidden; padding: calc(var(--tk) * 5) calc(var(--tk) * 3) !important; }
html:not([lang="ko"]) body .v4-duel .duel-rank { white-space: normal !important; line-height: .98 !important; font-size: calc(var(--tk) * 15) !important; text-align: center; }
/* 5차: 이야기 앨범 = 장마다 한 줄 (story-v1). 넷째부터는 옆으로 밀어 본다. */
html body[data-view="replay"] .cards-screen .album-title { margin: 30px auto 2px !important; }
html body[data-view="replay"] .cards-screen .album-head { margin: 6px 8px 0; }
html body[data-view="replay"] .cards-screen .album-strip { grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: calc((100% - 16px) / 3); gap: 8px !important;
  padding: 13px 10px 16px !important; overflow-x: auto !important; overflow-y: hidden !important; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; touch-action: pan-x pan-y; }
html body[data-view="replay"] .cards-screen .album-strip::-webkit-scrollbar { display: none; }
html body[data-view="replay"] .cards-screen .album-strip.more { grid-auto-columns: calc((100% - 24px) / 3.28); }
html body[data-view="replay"] .cards-screen .album-card { aspect-ratio: 113 / 80 !important; scroll-snap-align: start; }
html body[data-view="replay"] .cards-screen .album-card::after { bottom: -12px; }
/* 앨범 줄 크게 + 한 장짜리 선반(시안처럼 줄 전체에 이어진 나무 선반) */
html body[data-view="replay"] .cards-screen .album-head { margin: 4px 6px 0; }
html body[data-view="replay"] .cards-screen .album-strip { margin: 0 4px !important; padding: 11px 8px 13px !important; grid-auto-columns: calc((100% - 16px) / 3);
  background: linear-gradient(#a06a34, #6a3c18 35%, #3a1c08) left bottom / 100% 9px no-repeat !important; }
html body[data-view="replay"] .cards-screen .album-strip.more { grid-auto-columns: calc((100% - 24px) / 3.22); }
html body[data-view="replay"] .cards-screen .album-card::after { display: none; }
html body[data-view="replay"] .cards-screen .album-card { aspect-ratio: 113 / 79 !important; box-shadow: 0 3px 4px #0008 !important; }
html body[data-view="replay"] .cards-screen .album-strip { scroll-padding-inline: 8px; }
/* 다른 언어 순위 글자는 붉은 판 안쪽(높이 약 28px)에만 — 넘치면 글자를 줄인다 */
html:not([lang="ko"]) body .v4-duel .duel-rank { top: calc(var(--tk) * 73.5); height: calc(var(--tk) * 28); font-size: calc(var(--tk) * 13.5) !important; padding: 0 calc(var(--tk) * 20) !important; }
html:not([lang="ko"]) body .v4-duel .duel-rank { white-space: nowrap !important; line-height: 1 !important; font-size: calc(var(--tk) * 15) !important; }
html:not([lang="ko"]) body .cards-screen .t4-rule.weekly-rule { padding-bottom: calc(var(--tk) * 36) !important; line-height: 1.02 !important; }
html body .cards-screen .t4-rule .fit-rule { white-space: nowrap !important; overflow: hidden !important; }
html:not([lang="ko"]) body .cards-screen .t4-rule.weekly-rule { padding-bottom: calc(var(--tk) * 30) !important; font-size: calc(var(--tk) * 15) !important; }
html body .cards-screen .t4-rule.weekly-rule { top: calc(var(--tk) * 54 + 8px); }
/* 5차: 다음 상대 얼굴 아래가 칼로 자른 듯 끊기지 않게 부드럽게 흐린다 */
html body .v4-party .p4-faces canvas { -webkit-mask-image: linear-gradient(#000 70%, #0000 98%); mask-image: linear-gradient(#000 70%, #0000 98%); }
html body .v4-party .p4-foe-title, html body .v4-party .p4-foe-tip { color: #2a1408 !important; -webkit-text-stroke: .5px #2a1408; }

/* ===== 5차: 글자 윗점 잘림 ('층'이 '증'으로 보이던 원인) =====
   한 줄 글자 칸(.fit-line 등)이 overflow:hidden이라 Jua의 ㅊ 윗점·테두리 윗부분이 칸 위에서 잘렸다.
   가로만 자르고(넘침 계산은 그대로) 세로는 칸 밖까지 그리게 한다. */
html:root body .fit-line.fit-line, html:root body .t4-in.t4-in, html:root body .v4-duel .duel-rank.duel-rank, html:root body .v4-duel .duel-board .duel-score.duel-score,
html:root body .v4-duel .duel-rule.duel-rule, html:root body .osc-book.v4-book .osc-record .osc-label.osc-label, html:root body .t4-stats p.t4-p, html:root body .cards-screen .t4-rule .fit-rule.fit-rule {
  overflow-x: clip !important; overflow-y: visible !important; }
html body .t4-scene .t4-floor strong { display: block !important; box-sizing: border-box; width: 100%; padding: 0 calc(var(--tk) * 12) !important; text-align: center; }
/* 5차: 긴 언어 넘침 — 유리 배지는 넓게, 앨범 장 이름은 줄 끝까지 */
html:not([lang="ko"]) body .v4-party .p4-good { width: 80px !important; margin-left: -9px; }
html:not([lang="ko"]) body[data-view="replay"] .cards-screen .album-heading { max-width: 72%; }

/* ===== 6차: 글자와 뒷판 가운데 맞추기 (fix-v6) =====
   Jua 글꼴은 글자가 칸 안에서 위로 붙어 그려져 판 가운데보다 2~5px 위에 앉는다(실제 글자 픽셀로 잼).
   판이 자기 배경인 칸은 칸을 --ink 만큼 내리고 배경은 그만큼 올려 판은 제자리, 글자만 움직인다. */
/* 11/30 판 그림 잘림 검수: 배경을 칸 안에서 밀면 판 위·아래가 칸 밖으로 잘렸다(현판 술, 단추 금테 위).
   이제 칸·판은 그대로 두고 게임 코드(inkPad)가 위·아래 여백만 --ink 만큼 옮겨 글자를 움직인다. */
html:root body .p4-go.p4-go, html:root body .v4-duel .duel-go.duel-go, html:root body .v4-party .p4-row.p4-row,
html:root body[data-view="replay"] .cards-screen .album-title.album-title, html:root body .cards-screen .training-card > strong,
html:root body .result-panel .result-stage.result-stage, html:root body .hero-grid .hero-tile .hero-name.hero-name, html:root body #chest-time#chest-time,
html:root body .v4-duel .duel-date.duel-date, html:root body .el-badge.el-badge, html:root body #wallet.sub-bar.big-title .sub-title.sub-title,
html:root body .osc-book.v4-book .osc-heading.osc-heading:not(:first-child), html:root body #wallet.sub-bar:not(.big-title) .sub-title.sub-title {
  --ink-pad: 1; }
html body .v4-party .p4-go { --ink: .1em; }
html body .v4-duel .duel-go { --ink: .135em; }
html body .v4-party .p4-row { --ink: .17em; }
html body[data-view="replay"] .cards-screen .album-title { --ink: .14em; }
html body .cards-screen .training-card > strong { --ink: .14em; }
html body .result-panel .result-stage { --ink: -.34em; }
html body .hero-grid .hero-tile .hero-name { --ink: .11em; }
html body #chest-time { --ink: .2em; }
html body .v4-duel .duel-date { --ink: -.14em; }
html body .el-badge { --ink: .08em; }
/* 판 안쪽 글자만 따로 있는 단추: 글자만 내림 */
html body .v4-map .m4-go b { translate: 0 .18em; }
html body .t4-scene .t4-go .t4-in { translate: 0 .15em; }
html body .t4-scene .t4-floor strong { translate: 0 .15em; }

/* 큰 나무 현판: 시안 모양(키 큰 나무판 + 금테, 아래 양옆 금빛 구름)으로 새로 그린 ui-v6-heading. 판 면은 가로 17~84%, 세로 15~87%. */
html body #wallet.sub-bar.big-title .sub-title { width: min(266px, calc(100% - 104px)); height: 52px; top: calc(env(safe-area-inset-top, 0px) + 2px);
  padding: 0 46px !important; background-image: url(sprites/ui-v6-heading.webp) !important; font-size: 27px; --ink: .12em; }
html body .osc-book.v4-book .osc-heading:not(:first-child) { background-image: url(sprites/ui-v6-heading.webp) !important; width: calc(var(--tk) * 270) !important; height: calc(var(--tk) * 53);
  padding: 0 calc(var(--tk) * 52) !important; font-size: calc(var(--tk) * 21) !important; --ink: .12em; }
/* 작은 현판(동료·상세·수련): 양옆 꽃 장식과 글자 사이를 띄움 */
html body #wallet.sub-bar:not(.big-title) .sub-title { border-width: 7px 36px 8px 36px !important; --ink: .08em; }

/* 오행 동전(ui-v6-coin-*): 위쪽 그림, 아래쪽 글자 */
html body .el-coin { display: block; position: relative; background: center / contain no-repeat; font-style: normal; }
html body .el-coin b { position: absolute; left: 18%; right: 18%; top: 60%; height: 22%; display: flex; align-items: center; justify-content: center; translate: 0 .1em;
  font: inherit; font-family: Jua, sans-serif; line-height: 1; color: #fff4da; -webkit-text-stroke: .2em #2a1206; paint-order: stroke fill; white-space: nowrap; }
html body .t4-rule .t4-medal { background: none !important; }
html body .t4-rule .t4-medal .el-coin { width: 100%; height: 100%; font-size: calc(var(--tk) * 14); }
html body .v4-party .p4-foe-tip .p4-coin { flex: 0 0 46px; width: 46px; height: 46px; font-size: 13px; }
html body .v4-party .p4-wheel .el-coin { position: absolute; width: 29%; aspect-ratio: 1; height: auto; margin: -14.5% 0 0 -14.5%; font-size: 10.5px; }
html body .v4-party .p4-wheel-wood { left: 50.4%; top: 16.7%; } html body .v4-party .p4-wheel-earth { left: 78%; top: 39%; }
html body .v4-party .p4-wheel-water { left: 68.5%; top: 71.6%; } html body .v4-party .p4-wheel-fire { left: 30.7%; top: 69.5%; } html body .v4-party .p4-wheel-metal { left: 23%; top: 39%; }
html:not([lang="ko"]) body .v4-party .p4-wheel b { display: flex; }

/* 편성 대기 카드(시안): 왼쪽 위 오행 그림 동전, 얼굴은 종이 안에서 아래로 부드럽게, 이름·Lv는 가운데, 카드 사이 나무 틈 */
html body .v4-party .p4-shelf-row { gap: 8px; padding: 13px 16px 0; }
html body .v4-party .p4-card { flex: 0 0 66px; height: 94px; }
html body .v4-party .p4-card.selected { box-shadow: none !important; filter: drop-shadow(0 0 3px #ffd650) drop-shadow(0 3px 3px #0009) !important; }
html body .v4-party .p4-elb { position: absolute; z-index: 3; left: 2px; top: 2px; width: 22px; height: 22px; background: center / contain no-repeat; filter: drop-shadow(0 1px 1px #0008); }
html body .v4-party .p4-face { left: 5px; top: 5px; width: 56px; height: 56px; -webkit-mask-image: linear-gradient(#000 72%, #0000 100%); mask-image: linear-gradient(#000 72%, #0000 100%); }
html body .v4-party .p4-name { top: 56px; }
html body .v4-party .p4-lv { left: 10px; right: 10px; top: 74px; height: 17px; line-height: 17px; }
html body .v4-party .p4-foe-title { top: 30px; }

/* 비무 순위 알약: 글자는 붉은 판 면(그림의 가로 28.8~70.7%, 세로 46~63%) 안에만 */
html:root body .v4-duel .duel-rank.duel-rank { left: calc(28.8% + var(--tk) * 9) !important; right: calc(29.3% + var(--tk) * 9) !important; top: calc(var(--tk) * 66.5); height: calc(var(--tk) * 24);
  padding: 0 !important; display: flex !important; align-items: center; justify-content: center; line-height: 1 !important; font-size: calc(var(--tk) * 18) !important; translate: 0 .12em; white-space: nowrap !important; }

/* 무림탑 규칙: 글자는 메달과 오른쪽 축 사이 종이 안, 종이 띠(세로 13~69%) 가운데 */
html:root body .cards-screen .t4-rule.weekly-rule { padding-right: calc(var(--tk) * 40) !important; padding-bottom: calc(var(--tk) * 22) !important; }
html:root body .cards-screen .t4-rule .fit-rule { translate: 0 .1em; }

/* 승리 결과 두루마리: 오른쪽에 붙어 있던 다른 그림 조각을 잘라낸 그림. 세 줄은 종이 가운데. */
html body .result-panel .result-scroll { width: 88% !important; }
html body .el-badge.el-metal { --ink: 0em; }
html body .cards-screen .training-card > strong { font-size: 16.5px !important; }
html body .v4-duel .duel-opponents .m4-two { font-size: calc(var(--tk) * 11.8) !important; }
html body .v4-party .p4-good b { font-size: 13px; left: 23px; right: 6px; }
html body .v4-party .p4-wheel .el-coin b { width: auto; margin: 0; font-size: inherit; -webkit-text-stroke-width: 3px; }
html body .v4-party .p4-foe-tip { right: 30px; } html body .v4-party .p4-win { font-size: 12.5px; padding-right: 2px; }
html body .cards-screen .training-card > strong { font-size: 17px !important; padding: 7px 28px 9px !important; --ink: .06em; }
html body .cards-screen .training-card > strong { font-size: 18px !important; padding: 8px 26px 10px !important; --ink: .1em; }
html body .v4-party .p4-foe-tip { right: 24px; gap: 1px; } html body .v4-party .p4-arrow { flex-basis: 18px; } html body .v4-party .p4-win { font-size: 12.5px; letter-spacing: -.02em; }
/* 패배 조언 줄: 줄 그림(ui-v4-advice-row)에 이미 짙은 알약(가로 70~98.5%)이 그려져 있다. 단추는 그 알약 위에 바탕 없이 글자만. */
html body .result-panel .defeat-advice li { position: relative; padding-right: 31% !important; }
html:root body #fight .result-panel .advice-go.advice-go { position: absolute !important; left: 71.5%; right: 2.5%; top: 17%; bottom: 17%; width: auto; height: auto; min-width: 0; min-height: 0 !important; max-width: none;
  margin: 0 !important; padding: 0 4px !important; display: flex !important; align-items: center; justify-content: center; background: none !important; border: 0 !important; box-shadow: none !important;
  color: #fff1d6 !important; font: 13px/1 Jua, sans-serif !important; -webkit-text-stroke: 2.5px #2a1206 !important; paint-order: stroke fill; white-space: nowrap; translate: 0 .1em; }
html:not([lang="ko"]) body #fight .result-panel .advice-go.advice-go { font-size: 12px !important; white-space: nowrap; line-height: 1 !important; text-align: center; }
html[lang="ko"] body #fight .result-panel .advice-go.advice-go { font-size: 15px !important; }
/* 승리 목표 세 줄: 두루마리 종이 띠 가운데 */
html body .result-panel .result-goals { padding-top: 24px !important; padding-bottom: 12px !important; }
html:not([lang="ko"]) body .result-panel .defeat-advice li > span.m4-two { max-height: 32px !important; overflow-wrap: anywhere; }
html:root body #fight .result-panel .defeat-advice li { padding-right: calc(28.5% + 4px) !important; }
html:root body #fight .result-panel .defeat-advice li > span.m4-two { flex: 1 1 0; width: auto; max-width: none; }
/* 6차 다른 언어: 라틴·태국 글자는 Jua 한글처럼 위로 뜨지 않으므로 내림 폭을 줄이고, 한자 동전·패는 면 안에 들게 조금 작게 */
html:not([lang="ko"]) body .hero-grid .hero-tile .hero-name { --ink: -.06em; padding: 0 6px !important; }
html:not([lang="ko"]) body #wallet.sub-bar.big-title .sub-title { --ink: 0em; }
html:not([lang="ko"]) body #wallet.sub-bar:not(.big-title) .sub-title { padding-left: 10px !important; padding-right: 10px !important; }
html:not([lang="ko"]) body .el-coin b { font-size: .84em; }
html:not([lang="ko"]) body .hero-grid .el-badge { font-size: 15px; }
html:not([lang="ko"]) body .v4-party .p4-good b { left: 23px; right: 7px; font-size: 12px; white-space: nowrap; text-overflow: clip; }
/* 상세 무공 설명: 대나무 틀 안 두 줄 칸, 넘치면 글자를 줄인다(fit m4-two) */
html body .v4-detail .d4-skill-desc.m4-two { right: 42px; height: 34px; max-height: 34px; overflow: hidden; display: block; white-space: normal !important; text-overflow: clip !important; }
html[lang="th"] body .v4-party .p4-good b { font-size: 10.5px; left: 22px; right: 5px; }
/* 6차 다른 언어 2: 라틴 글자는 내림 폭을 줄이고, 태국 글자(위로 뜸)는 내리고, 넘치는 패는 안 여백 */
html:not([lang="ko"]) body .t4-scene .t4-floor strong { translate: 0 .03em; }
html:not([lang="ko"]) body .t4-scene .t4-go .t4-in { translate: 0 0; }
html:not([lang="ko"]) body .v4-duel .duel-go { --ink: 0em; }
html:not([lang="ko"]) body .v4-party .p4-good b { left: 26px; right: 10px; }
html[lang="th"] body .v4-party .p4-good b { left: 25px; right: 8px; }
html:not([lang="ko"]) body .cards-screen .training-card > strong { padding-left: 34px !important; padding-right: 34px !important; }
html:not([lang="ko"]) body[data-view="replay"] .cards-screen .album-heading { padding-left: 28px !important; padding-right: 24px !important; }
html:not([lang="ko"]) body .hero-grid .el-badge { font-size: 14px; }
html:not([lang="ko"]) body .cards-screen .training-card .el-badge.element-badge { font-size: 19px !important; }
html:not([lang="ko"]) body .v4-detail .d4-badge { font-size: 23px; }
html:root[lang="th"] body .result-panel .result-buttons .result-main.result-main, html:root[lang="th"] body .result-panel .result-buttons .result-inn.result-inn,
html:root[lang="th"] body[data-view="training"] .cards-screen .training-card .train-go.train-go {
  --ink-pad: 1; --ink: .14em; }
html[lang="th"] body .result-panel .result-stage { --ink: -.08em; }
html[lang="th"] body[data-view="replay"] .cards-screen .album-title { --ink: .3em; }
/* 6차 다른 언어 3: 눈으로 본 확대판에서 판 끝에 닿던 글자 */
html:not([lang="ko"]) body .v4-party .p4-good b { font-size: 10.5px; }
html:not([lang="ko"]) body .v4-party .p4-row { padding-left: 12px !important; padding-right: 12px !important; }
html:not([lang="ko"]) body .v4-party .p4-auto { padding-left: 14px !important; padding-right: 14px !important; }
html:not([lang="ko"]) body .cards-screen .training-card > strong { font-size: 15px !important; }
html:not([lang="ko"]) body .hero-grid .hero-tile .hero-name { font-size: 10.5px !important; letter-spacing: -.02em !important; padding: 0 9px !important; }
html:not([lang="ko"]) body .v4-duel .duel-opponents .m4-two { font-size: calc(var(--tk) * 9.6) !important; line-height: 1.05 !important; }
/* 태국 글자(Noto Sans Thai)는 칸 안에서 위로 떠 그려진다: 판과 따로 움직일 수 있는 곳은 글자만 내린다 */
html[lang="th"] body .v4-duel .duel-go { --ink: .26em; }
html[lang="th"] body .v4-party .p4-row { --ink: .2em; }
html[lang="th"] body .t4-scene .t4-floor strong, html[lang="th"] body .t4-scene .t4-go .t4-in { translate: 0 .24em; }
html[lang="th"] body .t4-scene .t4-floor strong { font-size: .9em; }
html:root[lang="th"] body .result-panel .result-buttons > button { padding-top: 5px !important; padding-bottom: 0 !important; translate: none; background-position-y: 50% !important; }
html[lang="th"] body #wallet.sub-bar:not(.big-title) .sub-title { padding-top: 7px !important; padding-bottom: 1px !important; }
html[lang="th"] body #wallet.sub-bar.big-title .sub-title { padding-top: 6px !important; }
html:not([lang="ko"]) body .v4-party .p4-good b { left: 29px; right: 7px; }
html[lang="th"] body .v4-party .p4-row { padding-left: 5px !important; padding-right: 5px !important; text-overflow: clip !important; }
/* 조언 단추: 보이는 알약은 작아도 누르는 자리는 줄 높이 가득(44px 안팎) */
html body #fight .result-panel .advice-go::before { content: ''; position: absolute; inset: -9px -3px; }
html[lang="th"] body .v4-party .p4-good b { left: 28px; right: 5px; font-size: 9.5px; }
html[lang="th"] body .v4-party .p4-row { font-size: 12px; }
html[lang="th"] body .v4-duel .duel-opponents .m4-two { font-size: calc(var(--tk) * 8.8) !important; }
/* 2026-12-01 판 그림 잘림 고침 v2: 승리·패배 판 이름 = 시안의 술 달린 현판(ui-v4-stage-plaque).
   옛 9칸 규칙(style.css)이 잘린 구름 현판(ui-hud-plaque)을 border-image 로 덮어 그리던 것을 이 요소에서만 끈다.
   판 그림 420x109: 나무 판 = 가로 12.6~88.3%, 세로 6.4~56% (아래는 술). 3칸 자르기라 세로 배율 = 상자 높이/109.
   판 면(검수 기준) 가로 13.6~87.6%, 세로 9.2~63.3% → 66px 상자에서 면 중심 23.9px, 좌우 여백 34.5/31.5px. 글자 잉크를 잰 값으로 맞춤. */
html:root body .result-panel .result-stage.result-stage { border: 0 !important; border-image: none !important;
  background: url(sprites/ui-v4-stage-plaque.webp) center / 100% 100% no-repeat !important;
  height: 66px !important; min-height: 0; padding: 5.6px 31.5px 0 34.5px !important; line-height: 30px; --ink: .22em; }
html:root:not([lang="ko"]) body .result-panel .result-stage.result-stage.m4-two { height: 66px !important; min-height: 0;
  padding: 8.4px 31.5px 24.6px 34.5px !important; align-items: center; --ink: 0em; }
html[lang="th"]:root body .result-panel .result-stage.result-stage { --ink: -.08em; }
@media (max-height: 700px) {
  html:root body .result-panel .result-stage.result-stage { height: 58px !important; padding-top: 5.1px !important; line-height: 26px; }
  html:root:not([lang="ko"]) body .result-panel .result-stage.result-stage.m4-two { height: 58px !important; padding: 7px 31.5px 21px 34.5px !important; }
}
/* 판 그림 잘림 고침 v2-2: 승리·패배 판 이름은 모든 언어에서 한 줄. 긴 이름은 판이 넓어지고(양 끝 술 장식은 그대로), 그래도 길면 글자만 줄인다.
   좌우 여백은 판 면(구름 장식 안쪽)에서 7px 더 띄워 글자가 장식에 닿지 않게 한다. */
html:root body .result-panel .result-stage.result-stage { display: block !important; white-space: nowrap !important; -webkit-line-clamp: unset;
  max-width: calc(100vw - 14px) !important; padding-left: 41.5px !important; padding-right: 38.5px !important; text-overflow: clip !important; }
html:root:not([lang="ko"]) body .result-panel .result-stage.result-stage { font-size: 18px; }
@media (max-height: 700px) { html:root:not([lang="ko"]) body .result-panel .result-stage.result-stage { font-size: 16px; } }
/* 언어별 글자 올림 값(승리·패배 판 이름, 잉크 중심을 판 면 중심에 맞춰 잼) */
html[lang="en"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.153em; }
html[lang="de"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.26em; }
html[lang="fr"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.17em; }
html[lang="id"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.16em; }
html[lang="ja"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.1em; }
html[lang="zh-TW"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.115em; }
html[lang="vi"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.07em; }
html[lang="th"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.326em; }
@media (max-height: 700px) {
  html[lang="de"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.22em; }
  html[lang="en"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.06em; }
  html[lang="es"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.17em; }
  html[lang="fr"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.075em; }
  html[lang="id"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.065em; }
  html[lang="ja"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.12em; }
  html[lang="zh-TW"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.12em; }
  html[lang="vi"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.09em; }
  html[lang="pt-BR"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.126em; }
  html[lang="th"]:root body .result-panel .result-stage.result-stage.result-stage { --ink: 0.30em; }
}
/* 2026-12-02 패배 조언 두 줄 판: 한국어 줄이 판보다 낮아 글이 위아래 테두리 밖으로 나가던 것, 긴 말이 단추에 닿던 것 → 줄 판을 종이 폭만큼 넓히고 높이를 같게 */
html:root body #fight .result-panel .result-scroll.defeat-advice { padding-left: 12px !important; padding-right: 12px !important; }
html:root body #fight .result-panel .defeat-advice li { min-height: 54px !important; height: auto !important; padding-top: 7px !important; padding-bottom: 7px !important; padding-right: calc(28.5% + 7px) !important; }
html:root body #fight .result-panel .defeat-advice li > span.m4-two { max-height: 40px !important; font-size: 11.5px !important; line-height: 1.12 !important; }
html:root[lang="ko"] body #fight .result-panel .defeat-advice li > span.m4-two { font-size: 12.5px !important; }
html:root body #fight .result-panel .defeat-advice li .advice-go.advice-go { white-space: nowrap !important; padding-left: 9px !important; padding-right: 9px !important; }
html:root:not([lang="ko"]) body #fight .result-panel .advice-head.advice-head { font-size: 13.5px !important; padding-left: 16px !important; padding-right: 16px !important; }
/* 2026-12-02 승리·패배 큰 단추: 긴 말(태국어·베트남어)이 양 끝 구름 장식에 닿지 않게 */
html:root body #fight .result-panel .result-main.result-main { padding-left: 31px !important; padding-right: 31px !important; }
html:root body #fight .result-panel .result-inn.result-inn { padding-left: 12px !important; padding-right: 12px !important; }
/* 2026-12-02 객잔 수련 상자 시간 띠: 긴 말(베트남어)이 두 줄로 띠 밖에 나가던 것 */
html:root body #chest-time#chest-time { white-space: nowrap !important; }
/* 2026-12-02 동료·편성 등 윗줄 지갑: 큰 수(208,000 / 3,000)가 화면 오른쪽 밖으로 잘리던 것 → 알약은 줄지 않게, 좁은 화면은 제목 판 옆 장식 폭을 줄인다 */
html:root body #wallet.sub-bar .wallet-resources { gap: 3px; margin-right: 2px; flex: none; }
html:root body #wallet.sub-bar .wallet-resources > span { flex: none; padding: 2px 7px 2px 3px; font-size: 13px; gap: 2px; }
html:root body #wallet.sub-bar .wallet-resources .game-icon, html:root body #wallet.sub-bar .wallet-resources img { width: 20px; height: 18px; }
@media (max-width: 380px) {
  html:root body #wallet.sub-bar .wallet-resources > span { font-size: 12px; padding: 2px 6px 2px 2px; }
  html:root body #wallet.sub-bar .wallet-resources .game-icon, html:root body #wallet.sub-bar .wallet-resources img { width: 18px; height: 16px; }
  html:root body #wallet.sub-bar:not(.big-title) .sub-title.sub-title { flex: 0 1 auto; min-width: 0; border-width: 7px 28px 8px 28px !important; padding-left: 4px !important; padding-right: 4px !important; }
}
/* 2026-12-02 동료 능력치 이름: 긴 말(베트남어 Tấn công·Phòng thủ)이 두 줄로 숫자를 밀어내던 것 → 한 줄로 줄여 맞춤 */
html:root body .d4-stat-name.d4-stat-name { white-space: nowrap !important; overflow: hidden; }
/* 2026-12-02 맞춘 글자 칸: 1px 미만 넘침에 말줄임(…)이 붙던 것(크기 맞춤이 끝난 칸은 넘치지 않으므로 잘라도 보이는 글자가 없다) */
html:root body .fit-line.fit-line { text-overflow: clip !important; }
/* 2026-12-02 편성 다음 상대 두루마리: 상성 글(Wasser schlägt Feuer, 水は火に勝つ)이 오른쪽 두루마리 기둥 위로 나가던 것 */
html:root body .v4-party .p4-foe-tip.p4-foe-tip { right: 40px; }
html:root body .v4-party .p4-win.p4-win { font-size: 11.5px; line-height: 1.12; min-width: 0; overflow-wrap: anywhere; }
html:root:is([lang="ja"], [lang="zh-TW"]) body .v4-party .p4-win.p4-win { word-break: normal; }
html:root[lang="ja"] body .v4-party .p4-win.p4-win { word-break: auto-phrase; }
html:root body .v4-party .p4-row.p4-row { padding-left: 5px !important; padding-right: 5px !important; }
/* 2026-12-02 지도 장 이름 두 줄일 때 한 낱말만 아래로 떨어지지 않게 */
html:root body .v4-map .m4-head .m4-two { text-wrap: balance; }
/* 2026-12-02 수련장 '오늘' 붉은 도장: 긴 말(Hôm nay, Heute)이 도장 원 가장자리에 닿던 것 → 두 줄 허용, 원 안쪽 70% 폭 */
html:root:not([lang="ko"]) body .train-stamp.train-stamp { white-space: normal !important; padding: 0 7px !important; font-size: 10.5px !important; line-height: 1.02 !important; text-align: center; word-break: keep-all; overflow-wrap: normal; }
/* 2026-12-02 비무 두루마리: 띠 글자가 양 끝 구름에, 아랫줄 규칙 글이 두루마리 기둥에 닿던 것(긴 말) */
html:root body .v4-duel .duel-rank.duel-rank { padding-left: calc(var(--tk) * 9) !important; padding-right: calc(var(--tk) * 9) !important; }
html:root body .v4-duel .duel-rule.duel-rule { padding-left: calc(var(--tk) * 48) !important; padding-right: calc(var(--tk) * 48) !important; }
/* 2026-12-02 무림탑 층 패: 'Etage 11·Floor 12·第14層' 이 줄임표로 잘리던 것(main 부터) → 글자 칸 여백을 패 안쪽 면만큼 줄이고 더 작게까지 줄인다 */
html:root body .t4-scene .t4-floor strong { padding: 0 calc(var(--tk) * 7) !important; }
/* 2026-12-02 무림탑 잠김 말판: 판 왼쪽은 만두 그림이 덮으므로 글은 그 오른쪽부터(일본어 第7 이 칼 뒤에 가려지던 것) */
html:root body .t4-scene .t4-lock.t4-lock { padding-left: calc(var(--tk) * 62) !important; padding-right: calc(var(--tk) * 26) !important; text-wrap: balance; }
html:root[lang="ja"] body .t4-scene .t4-lock.t4-lock { word-break: auto-phrase; }
/* 2026-12-02 이야기 앨범 장 이름 패: 긴 이름이 양 끝 장식에 닿던 것 */
html:root:not([lang="ko"]) body[data-view="replay"] .cards-screen .album-heading.album-heading { padding-left: 31px !important; padding-right: 30px !important; }
html:root:not([lang="ko"]) body[data-view="replay"] .cards-screen .album-card > strong.m4-two { height: 27px !important; align-items: safe center !important; overflow: hidden; }
/* 2026-12-02 기록장 도전 과제 줄: 과제 이름이 종이 위 테두리에 붙어 있던 것(main 부터) → 내용 묶음을 종이 면 가운데로 3px 내림 */
html:root body .osc-book.v4-book .osc-challenge.osc-challenge { padding-top: 14px !important; padding-bottom: 10px !important; }
html:root body .osc-book.v4-book .osc-challenge-text.osc-challenge-text { gap: 2px; }
html:root[lang="th"] body .osc-book.v4-book .osc-challenge.osc-challenge { padding-top: 17px !important; padding-bottom: 7px !important; }
/* 2026-12-02 상성 풀이(p4-win): 라틴 글자는 낱말 가운데서 끊지 않는다("mengalahka/n" → 글자를 줄여 한 낱말로) */
html:root:not([lang="ja"]):not([lang="zh-TW"]) body .v4-party .p4-win.p4-win { overflow-wrap: normal; word-break: normal; }
html:root[lang="id"] body .v4-party .p4-win.p4-win { font-size: 10px; letter-spacing: -.02em; }
