/* 먼바다 포수 화면 스타일: 짙은 남색 유리 패널, 놋쇠 테두리, 크림 글자, 주홍 버튼, 골드 숫자 */
:root {
  --navy: #0E2236;
  --glass: rgba(14, 34, 54, 0.9);
  --glass-2: rgba(22, 48, 74, 0.92);
  --panel-top: rgba(22, 50, 78, 0.94);
  --panel-bot: rgba(10, 27, 45, 0.95);
  --line: rgba(245, 235, 216, 0.16);
  --line-2: rgba(245, 235, 216, 0.32);
  --brass: #D9B26A;
  --cream: #F5EBD8;
  --cream-2: #E2D6C0;
  --ink: #0B1B2B;
  --accent: #FF6B4A;
  --accent-2: #FF8A6B;
  --accent-lip: #B8401F;
  --gold: #FFD05A;
  --gold-lip: #A9781C;
  --token: #6FF2E0;
  --ok: #8CF2B0;
  --bad: #FF8A76;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; position: fixed; inset: 0;
  background: #04101C; color: var(--cream); font-family: var(--font); font-weight: 700;
  overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
  word-break: keep-all; overflow-wrap: break-word;
}
@supports (height: 100dvh) { html, body { height: 100dvh; } }
#stage { position: fixed; left: 0; top: 0; overflow: hidden; background: #04101C; }
#game { position: absolute; left: 0; top: 0; display: block; touch-action: none; }
#ui { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; font-size: 16px; }
html.rotated { --sat: 0px; --sar: 0px; --sab: 0px; --sal: 0px; }
input, button { font-family: var(--font); }
input[type=range] { user-select: auto; -webkit-user-select: auto; }

.ic { width: 1.15em; height: 1.15em; flex: none; display: block; }
.icw { display: inline-flex; }

.screen {
  position: absolute; inset: 0; pointer-events: auto;
  padding: calc(10px + var(--sat)) calc(12px + var(--sar)) calc(10px + var(--sab)) calc(12px + var(--sal));
  display: none;
}
.screen.on { display: block; animation: scrIn 0.22s ease-out; }
.screen.passthru, #hud.on { pointer-events: none; animation: none; }
.screen.dim { background: rgba(4, 12, 22, 0.5); }
@keyframes scrIn { from { opacity: 0; } to { opacity: 1; } }

.panel {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(0, 10, 20, 0.35), 0 14px 34px rgba(0, 8, 20, 0.45);
}

/* 버튼 */
.btn {
  appearance: none; border: 0; border-radius: 14px; min-height: 48px; min-width: 48px; padding: 0 18px;
  font: 800 18px/1 var(--font); color: var(--cream); background: rgba(245, 235, 216, 0.1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; touch-action: manipulation;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease, box-shadow 0.08s ease; white-space: nowrap; position: relative;
}
.btn .ic { width: 22px; height: 22px; }
.btn:active { transform: scale(0.96); }
.btn.primary {
  background: linear-gradient(180deg, #FF8A64, #F25433); color: #FFFFFF; text-shadow: 0 1px 0 rgba(120, 30, 10, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 0 var(--accent-lip), 0 8px 16px rgba(0, 0, 0, 0.25);
}
.btn.primary:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 0 var(--accent-lip); transform: translateY(3px); }
.btn.gold {
  background: linear-gradient(180deg, #FFE08A, #F2B437); color: #2B1D00;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 0 var(--gold-lip), 0 8px 16px rgba(0, 0, 0, 0.25);
}
.btn.gold:active { box-shadow: 0 1px 0 var(--gold-lip); transform: translateY(3px); }
.btn.ghost { background: rgba(8, 22, 36, 0.62); border: 1.5px solid var(--line-2); color: var(--cream); }
.btn.ghost:active { background: rgba(245, 235, 216, 0.14); }
.btn[disabled], .btn.off { opacity: 0.45; filter: saturate(0.4); pointer-events: none; }
.btn.small { min-height: 44px; font-size: 16px; padding: 0 14px; border-radius: 12px; }
.btn.small .ic { width: 19px; height: 19px; }
.btn.big { min-height: 62px; font-size: 23px; padding: 0 28px; border-radius: 18px; min-width: 210px; }
.btn.big .ic { width: 26px; height: 26px; }
.btn.icon-only { padding: 0; width: 52px; }
.gold-t { color: var(--gold); }
.token-t { color: var(--token); }
.muted { color: var(--cream-2); font-weight: 700; }
.note { color: var(--cream-2); font-size: 15px; font-weight: 600; }
.hidden { display: none !important; }

/* 공통 머리띠 */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; }
.topbar h2 { margin: 0; font-size: 24px; font-weight: 900; display: flex; align-items: center; gap: 8px; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.topbar h2 .ic { width: 26px; height: 26px; color: var(--brass); }
.screen > .topbar > .muted { padding: 6px 12px; border-radius: 999px; background: rgba(8, 22, 36, 0.72); border: 1px solid var(--line); color: var(--cream); font-size: 16px; }
.wallet { display: flex; gap: 8px; }
.wallet .hudchip { font-size: 19px; padding: 7px 12px; }
.wallet-s { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; }
.wallet-s .ic { width: 20px; height: 20px; color: var(--cream-2); margin-left: 6px; }
.section-t { margin: 10px 4px 6px; font-size: 16px; color: var(--cream-2); font-weight: 700; }
.badge { display: inline-block; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 14px; line-height: 22px; text-align: center; }

/* 타이틀 */
#scr-title.on { display: flex; flex-direction: column; align-items: center; justify-content: space-between; }
.logo { margin-top: calc(var(--sh, 720px) * 0.05); display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.emblem-w { flex: none; filter: drop-shadow(0 8px 18px rgba(0, 10, 25, 0.45)); animation: bob 5s ease-in-out infinite; }
.emblem { width: clamp(84px, calc(var(--sh, 720px) * 0.25), 160px); height: auto; display: block; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-1.5deg); } }
.logo-t { text-align: left; }
.logo h1 {
  margin: 0; font-size: clamp(42px, calc(var(--sh, 720px) * 0.13), 96px); font-weight: 900; letter-spacing: 0.02em; color: #FFF8EC; line-height: 1.02;
  text-shadow: 0 2px 0 #C9B898, 0 4px 0 rgba(11, 27, 43, 0.55), 0 12px 28px rgba(5, 18, 32, 0.6);
}
.logo .harpoon-line { height: 6px; margin: 10px 26px 0 2px; position: relative; background: linear-gradient(90deg, rgba(255, 107, 74, 0), var(--accent) 22%, #FF8A64); border-radius: 3px; }
.logo .harpoon-line::after { content: ""; position: absolute; right: -22px; top: -8px; border-left: 24px solid var(--cream); border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.logo p { margin: 12px 0 0; font-size: clamp(15px, calc(var(--sh, 720px) * 0.038), 20px); color: #FFFFFF; text-shadow: 0 2px 8px rgba(5, 18, 32, 0.8); }
.title-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: calc(var(--sh, 720px) * 0.025); }
.title-prog { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(8, 22, 36, 0.72); border: 1px solid var(--line); font-size: 16px; }
.pchip .ic { width: 18px; height: 18px; color: var(--brass); }
.pchip small { font-size: 14px; color: var(--cream-2); font-weight: 700; }
.pchip.gold b { color: var(--gold); }
.title-menu { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
.title-sub { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ver { position: absolute; right: calc(14px + var(--sar)); bottom: calc(8px + var(--sab)); font-size: 14px; color: var(--cream-2); text-shadow: 0 1px 3px #000; }

.rot-hint { position: absolute; left: 50%; bottom: calc(10px + var(--sab)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(8, 22, 36, 0.82); border: 1px solid var(--line-2); font-size: 14px; z-index: 35; transition: opacity 0.5s; pointer-events: none; white-space: nowrap; }
.rot-hint.out { opacity: 0; }
.rot-hint .rp .ic { width: 22px; height: 22px; animation: rotph 1.6s ease-in-out infinite; }
@keyframes rotph { 0%, 20% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* HUD */
#hud .tl { position: absolute; left: calc(12px + var(--sal)); top: calc(10px + var(--sat)); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.bar { width: 170px; height: 20px; border-radius: 10px; background: rgba(11, 27, 43, 0.7); overflow: hidden; position: relative; border: 1.5px solid rgba(255, 255, 255, 0.28); }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #A6F7C4, #3FBF7A); border-radius: 9px; transition: width 0.15s; }
.bar.low { animation: lowhp 0.8s ease-in-out infinite; }
.bar.low > i { background: linear-gradient(180deg, #FFB0A0, #E0533C); }
@keyframes lowhp { 50% { box-shadow: 0 0 0 3px rgba(255, 74, 61, 0.55); } }
.bar > b { position: absolute; inset: 0; font-size: 14px; line-height: 17px; text-align: center; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.hudchip { background: rgba(8, 22, 36, 0.66); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 12px; padding: 6px 10px; font-size: 17px; display: inline-flex; gap: 6px; align-items: center; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.hudchip .ic { width: 18px; height: 18px; color: var(--brass); }
.hudchip.full { border-color: var(--bad); color: var(--bad); }
.kit { height: 36px; padding: 0 12px 0 9px; border-radius: 999px; background: rgba(8, 22, 36, 0.7); border: 1.5px solid rgba(255, 255, 255, 0.28); color: #fff; font: 800 15px var(--font); pointer-events: auto; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; touch-action: none; }
.kit.none { display: none; }
.kit .ic { width: 20px; height: 20px; color: var(--ok); }
.kit.off { opacity: 0.45; }
.kit.urge { border-color: var(--ok); animation: urge 1s ease-in-out infinite; }
@keyframes urge { 50% { box-shadow: 0 0 0 4px rgba(140, 242, 176, 0.45); } }
#hud .tc { position: absolute; left: 50%; top: calc(8px + var(--sat)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart { width: 380px; height: 30px; border-radius: 12px; background: rgba(8, 22, 36, 0.62); position: relative; overflow: hidden; border: 1.5px solid rgba(255, 255, 255, 0.25); }
/* 위쪽은 구간 이름, 아래쪽 띠는 배·고래 무리 표시(서로 겹치지 않게 나눈다) */
.chart .band { position: absolute; top: 0; bottom: 0; border-right: 1px solid rgba(255, 255, 255, 0.3); font-size: 12px; line-height: 17px; text-align: center; color: #E4F2FF; text-shadow: 0 1px 2px #000; }
.chart .band.b0 { background: rgba(80, 190, 220, 0.22); }
.chart .band.b1 { background: rgba(40, 120, 180, 0.26); }
.chart .band.b2 { background: rgba(20, 50, 110, 0.4); }
.chart .me { position: absolute; top: 17px; width: 8px; height: 9px; margin-left: -4px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 0 2px #fff; transition: left 0.1s linear; }
.chart .pod { position: absolute; top: 19px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--token); box-shadow: 0 0 6px var(--token); }
.chart .pod.v { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.chart.flash { animation: flash 0.6s 6 alternate; }
@keyframes flash { to { box-shadow: 0 0 0 3px var(--gold); } }
.timebox { display: flex; gap: 8px; align-items: center; font-size: 18px; }
.timebox b.late { color: var(--bad); animation: late 1s steps(2) infinite; }
@keyframes late { 50% { opacity: 0.55; } }
.wind { font-size: 15px; color: #D8EEFF; }
#hud .tr { position: absolute; right: calc(12px + var(--sar)); top: calc(10px + var(--sat)); display: flex; gap: 8px; align-items: center; }
.pausebtn { width: 54px; height: 54px; border-radius: 14px; background: rgba(8, 22, 36, 0.7); border: 1.5px solid rgba(255, 255, 255, 0.28); pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: 6px; touch-action: none; }
.pausebtn i { width: 6px; height: 20px; background: #fff; border-radius: 2px; }
.mv { position: absolute; bottom: calc(14px + var(--sab)); width: 96px; height: 96px; border-radius: 26px; background: rgba(8, 22, 36, 0.5); border: 2px solid rgba(255, 255, 255, 0.3); pointer-events: auto; display: flex; align-items: center; justify-content: center; touch-action: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.mv.down { background: rgba(255, 107, 74, 0.6); border-color: #fff; transform: scale(0.96); }
.mv svg { width: 40px; height: 40px; }
.mv.l { left: calc(14px + var(--sal)); }
.mv.r { left: calc(122px + var(--sal)); }
.reel { position: absolute; right: calc(18px + var(--sar)); bottom: calc(16px + var(--sab)); width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 40% 32%, #FF9C7E, #E0533C 70%); border: 4px solid rgba(255, 255, 255, 0.9); pointer-events: auto; color: #fff; font: 900 22px var(--font); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; touch-action: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); text-shadow: 0 1px 2px rgba(100, 20, 0, 0.6); }
.reel svg { width: 30px; height: 30px; }
.reel.down { transform: scale(0.94); background: radial-gradient(circle at 40% 32%, #FFC0AE, #FF6B4A 70%); }
.reel.down svg { animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }
.reel.hide { display: none; }
/* 특수탄 칸은 일시정지 아래에서 시작하고, 감기 버튼과 겹칠 만큼 많으면 왼쪽 열로 넘긴다 */
.ammo { position: absolute; right: calc(10px + var(--sar)); top: calc(74px + var(--sat)); display: flex; flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 6px; max-height: calc(var(--sh, 390px) - 212px - var(--sat) - var(--sab)); }
.ammo .slot { width: 60px; height: 54px; border-radius: 16px; background: rgba(8, 22, 36, 0.7); border: 2px solid rgba(255, 255, 255, 0.25); pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 15px; touch-action: none; }
.ammo .slot .ic { width: 20px; height: 20px; }
.ammo .slot em { font: 800 11px/1 var(--font); font-style: normal; color: #fff; opacity: 0.9; letter-spacing: 0.02em; }
.ammo .slot b { line-height: 1; }
.ammo .slot b { color: #fff; }
.ammo .slot.sel { border-color: var(--gold); background: rgba(60, 46, 10, 0.75); box-shadow: 0 0 0 3px rgba(255, 208, 90, 0.45); }
.ammo .slot.empty { opacity: 0.4; }
.tension { position: absolute; left: 50%; bottom: calc(18px + var(--sab)); transform: translateX(-50%); width: 340px; display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.tension .name { display: flex; justify-content: space-between; font-size: 17px; text-shadow: 0 1px 3px #000, 0 0 4px #000; }
.tension .name .tag { color: var(--gold); margin-left: 6px; }
.tension .name .over.red { color: #FF8A76; }
.tension .name .over.green { color: var(--ok); }
.tgauge { position: relative; height: 20px; border-radius: 10px; background: rgba(8, 22, 36, 0.72); overflow: hidden; border: 1.5px solid rgba(255, 255, 255, 0.3); }
.tgauge .zone { position: absolute; left: 70%; width: 20%; top: 0; bottom: 0; background: rgba(255, 255, 255, 0.2); border-left: 1px dashed rgba(255, 255, 255, 0.7); border-right: 1px dashed rgba(255, 255, 255, 0.7); }
.tgauge > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #7CF2A0; }
.tgauge.taut { box-shadow: 0 0 0 2px rgba(255, 208, 90, 0.6); }
.tgauge.shake { animation: tshake 0.08s infinite; box-shadow: 0 0 0 2px rgba(255, 74, 61, 0.7); }
@keyframes tshake { 50% { transform: translateX(2px); } }
.tgauge .glab { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; pointer-events: none; }
.whrow { display: flex; align-items: center; gap: 6px; }
.whrow small { font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; }
.whrow .whp { flex: 1; }
.whp { height: 9px; border-radius: 5px; background: rgba(8, 22, 36, 0.7); overflow: hidden; }
.whp > i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #FFD05A, #FF9A3C); }
.bossbar { position: relative; width: 380px; text-align: center; display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 10px; border-radius: 12px; background: rgba(8, 22, 36, 0.62); border: 1.5px solid rgba(255, 255, 255, 0.25); }
.bossbar.hidden { display: none; }
.bossbar .bn { font-size: 14px; text-shadow: 0 1px 3px #000; white-space: nowrap; flex: none; }
.bossbar .bb { flex: 1; height: 11px; border-radius: 6px; background: rgba(8, 22, 36, 0.75); position: relative; overflow: hidden; border: 1.5px solid var(--brass); }
.bossbar .bb > i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #FF6B4A, #FFB36A); transition: width 0.2s; }
.bossbar .bb .tick { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.8); }
.combo { position: absolute; right: calc(14px + var(--sar)); top: calc(74px + var(--sat)); display: flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 12px; background: rgba(60, 40, 6, 0.75); border: 1.5px solid var(--gold); opacity: 0; transform: translateY(-6px); transition: opacity 0.25s, transform 0.25s; }
.combo small { font-size: 14px; color: #FFF0C8; }
.combo b { font-size: 22px; color: var(--gold); }
.combo.on { opacity: 1; transform: none; }
.combo.pop b { animation: pop 0.35s ease-out; }
@keyframes pop { 40% { transform: scale(1.35); } }
.hint { position: absolute; left: 50%; top: calc(86px + var(--sat)); transform: translateX(-50%); background: rgba(8, 22, 36, 0.86); border: 1.5px solid var(--line-2); border-radius: 16px; padding: 10px 18px; font-size: 18px; text-align: center; max-width: 60%; opacity: 0; transition: opacity 0.3s; }
.hint.on { opacity: 1; }
.bossintro { position: absolute; left: 0; right: 0; bottom: 26%; height: 74px; background: linear-gradient(90deg, rgba(8, 22, 36, 0), rgba(8, 22, 36, 0.88) 30%, rgba(8, 22, 36, 0.88) 70%, rgba(8, 22, 36, 0)); border-top: 1px solid rgba(217, 178, 106, 0.6); border-bottom: 1px solid rgba(217, 178, 106, 0.6); display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 900; letter-spacing: 0.12em; opacity: 0; transform: translateX(-30%); transition: all 0.5s; }
.bossintro.on { opacity: 1; transform: translateX(0); }
.bossintro small { font-size: 16px; color: var(--brass); margin-right: 14px; letter-spacing: 0.04em; }

/* 손가락 안내(첫 판·조작법 공용) */
.tut { position: absolute; inset: 0; pointer-events: none; display: none; }
.tut.on { display: block; }
html.is-paused .tut, html.is-paused .hint, html.is-paused .combo { visibility: hidden; }
.tut.t-aim .demo { position: absolute; left: 58%; top: 50%; transform: translate(-50%, -50%) scale(1.3); }
.tut.t-aim .d-scene { display: none; }
.d-pull, .d-shot { display: none; position: absolute; left: 150px; top: 30px; height: 0; transform-origin: 0 0; }
.tut .d-pull, .tut .d-shot { display: block; }
.d-pull { width: 69px; border-top: 3px dashed var(--gold); animation: pull 2.6s linear infinite; }
.d-shot { width: 120px; border-top: 4px dotted #FFFFFF; animation: shot 2.6s ease-out infinite; }
.d-shot::after { content: ""; position: absolute; right: -6px; top: -9px; border-left: 14px solid #FFFFFF; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
@keyframes pull { 0%, 16% { transform: rotate(144.5deg) scaleX(0); opacity: 0; } 20% { opacity: 1; } 56% { transform: rotate(144.5deg) scaleX(1); opacity: 1; } 62%, 100% { transform: rotate(144.5deg) scaleX(1); opacity: 0; } }
@keyframes shot { 0%, 60% { transform: rotate(-35.5deg) scaleX(0); opacity: 0; } 64% { opacity: 1; } 78% { transform: rotate(-35.5deg) scaleX(1); opacity: 1; } 94%, 100% { transform: rotate(-35.5deg) scaleX(1); opacity: 0; } }
.tut .ring { position: absolute; border-radius: 50%; border: 4px solid var(--gold); animation: ring 1.2s ease-out infinite; }
.tut.t-reel .ring { right: calc(18px + var(--sar)); bottom: calc(16px + var(--sab)); width: 120px; height: 120px; }
.tut.t-reel > .d-hand { right: calc(38px + var(--sar)); bottom: calc(6px + var(--sab)); animation: press 1.6s ease-in-out infinite; }
.tut.t-far .ring { left: calc(122px + var(--sal)); bottom: calc(14px + var(--sab)); width: 96px; height: 96px; border-radius: 26px; }
.tut.t-far > .d-hand { left: calc(150px + var(--sal)); bottom: calc(2px + var(--sab)); animation: press 1.6s ease-in-out infinite; }
@keyframes ring { 0% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes press { 0%, 100% { transform: translateY(10px); } 40%, 70% { transform: translateY(0) scale(0.9); } }
.d-hand { position: absolute; width: 44px; height: 44px; color: #FFFFFF; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6)); }
.d-hand .ic { width: 44px; height: 44px; fill: rgba(255, 255, 255, 0.92); stroke: #0B1B2B; stroke-width: 1.4; }
.demo { position: relative; width: 240px; height: 120px; flex: none; }
.d-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.d-aim .d-hand { left: 132px; top: 22px; animation: aimhand 2.6s ease-in-out infinite; }
.d-aim .d-band { position: absolute; left: 141px; top: 21px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--gold); animation: band 2.6s linear infinite; }
.d-aim .d-arc { animation: arc 2.6s linear infinite; }
@keyframes aimhand {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { transform: translate(0, 0); opacity: 1; }
  16% { transform: translate(0, 0) scale(0.9); }
  56% { transform: translate(-56px, 40px) scale(0.9); opacity: 1; }
  64% { transform: translate(-56px, 34px) scale(1.06); opacity: 1; }
  84%, 100% { transform: translate(-56px, 30px); opacity: 0; }
}
@keyframes band { 0%, 14% { opacity: 0; transform: scale(0.6); } 18%, 56% { opacity: 1; transform: scale(1); } 62%, 100% { opacity: 0; } }
@keyframes arc { 0%, 58% { opacity: 0; stroke-dashoffset: 40; } 64% { opacity: 1; } 92% { opacity: 1; stroke-dashoffset: 0; } 100% { opacity: 0; } }
.d-reel .d-gauge { position: absolute; left: 8px; top: 30px; width: 120px; height: 18px; border-radius: 9px; background: rgba(8, 22, 36, 0.8); border: 1.5px solid rgba(255, 255, 255, 0.4); overflow: hidden; }
.d-reel .d-gauge b { position: absolute; left: 70%; width: 20%; top: 0; bottom: 0; background: rgba(255, 255, 255, 0.22); }
.d-reel .d-gauge i { position: absolute; left: 0; top: 0; bottom: 0; width: 10%; background: #7CF2A0; animation: rfill 3s linear infinite; }
@keyframes rfill { 0% { width: 10%; background: #7CF2A0; } 30% { background: #7CF2A0; } 42% { background: #FFB13C; } 55% { width: 92%; background: #FF4A3D; } 70% { width: 50%; background: #7CF2A0; } 100% { width: 10%; background: #7CF2A0; } }
.d-reel .d-btn { position: absolute; right: 22px; top: 18px; width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(circle at 40% 32%, #FF9C7E, #E0533C 70%); border: 3px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; animation: rbtn 3s ease-in-out infinite; }
.d-reel .d-hand { right: 30px; top: 48px; animation: rhand 3s ease-in-out infinite; }
@keyframes rbtn { 0%, 8% { transform: scale(1); } 12%, 55% { transform: scale(0.92); } 60%, 100% { transform: scale(1); } }
@keyframes rhand { 0% { transform: translateY(14px); opacity: 0; } 8% { opacity: 1; transform: translateY(0); } 12%, 55% { transform: translateY(0) scale(0.9); } 64% { transform: translateY(-18px); opacity: 1; } 80%, 100% { transform: translateY(-18px); opacity: 0; } }
.d-move .d-keys { position: absolute; left: 10px; bottom: 6px; display: flex; gap: 8px; }
.d-move .d-keys span { width: 52px; height: 52px; border-radius: 14px; background: rgba(8, 22, 36, 0.7); border: 2px solid rgba(255, 255, 255, 0.4); display: flex; align-items: center; justify-content: center; }
.d-move .d-keys span .ic { width: 26px; height: 26px; }
.d-move .d-keys span.r .ic { transform: scaleX(-1); }
.d-move .d-keys span.r { animation: mkey 2.4s ease-in-out infinite; }
.d-move .d-boat { position: absolute; left: 120px; top: 20px; width: 70px; animation: mboat 2.4s ease-in-out infinite; }
.d-move .d-hand { left: 76px; top: 76px; animation: mhand 2.4s ease-in-out infinite; }
@keyframes mkey { 15%, 70% { background: rgba(255, 107, 74, 0.65); } }
@keyframes mboat { 0%, 15% { transform: translateX(-30px); } 70%, 100% { transform: translateX(40px); } }
@keyframes mhand { 0% { transform: translateY(8px); opacity: 0; } 12%, 70% { transform: translateY(0) scale(0.9); opacity: 1; } 85%, 100% { transform: translateY(-10px); opacity: 0; } }
.help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.help-c { border-radius: 14px; background: rgba(245, 235, 216, 0.06); border: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.help-c .demo { background: linear-gradient(180deg, rgba(127, 200, 242, 0.18), rgba(12, 58, 102, 0.4)); border-radius: 12px; }
.help-c b { font-size: 18px; }
.help-c span { font-size: 15px; color: var(--cream-2); font-weight: 600; line-height: 1.45; }

/* 항구 */
.port-main { position: absolute; top: calc(64px + var(--sat)); bottom: calc(72px + var(--sab)); right: calc(12px + var(--sar)); width: 62%; display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); }
.tab { flex: 1; min-height: 46px; border-radius: 12px; background: transparent; border: 0; color: var(--cream-2); font: 800 17px var(--font); touch-action: manipulation; position: relative; }
.tab.on { background: rgba(245, 235, 216, 0.14); color: #fff; }
.tab.on::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 4px; height: 3px; border-radius: 2px; background: var(--brass); }
.list { flex: 1; overflow-y: auto; padding: 8px 8px 12px; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
.card { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(245, 235, 216, 0.06); border: 1px solid rgba(245, 235, 216, 0.08); }
.card.flash { animation: cflash 0.7s ease-out; }
@keyframes cflash { 0% { box-shadow: 0 0 0 3px var(--gold); background: rgba(255, 208, 90, 0.2); } 100% { box-shadow: 0 0 0 0 transparent; } }
.cico { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(180deg, #1D4A70, #0E2A45); border: 1px solid rgba(217, 178, 106, 0.45); color: var(--brass); display: flex; align-items: center; justify-content: center; }
.cico .ic { width: 26px; height: 26px; }
.cbody { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card .nm { font-size: 18px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.card .nm small { font-size: 14px; color: var(--cream-2); font-weight: 600; }
.card .val { font-size: 16px; color: #EAF6FF; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; line-height: 1.3; }
.card .val .arr { color: var(--cream-2); }
.card .val b { color: var(--ok); }
.card .val .gain { font-size: 13px; padding: 2px 6px; border-radius: 6px; background: rgba(140, 242, 176, 0.14); color: var(--ok); }
.dots { display: flex; gap: 4px; }
.dots i { width: 12px; height: 12px; border-radius: 3px; background: rgba(245, 235, 216, 0.2); }
.dots i.on { background: var(--gold); box-shadow: 0 0 4px rgba(255, 208, 90, 0.5); }
.dots i.lock { background: transparent; border: 1.5px dashed rgba(245, 235, 216, 0.45); }
.lvbar { position: relative; height: 14px; border-radius: 7px; background: rgba(245, 235, 216, 0.16); overflow: hidden; max-width: 220px; }
.lvbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold); }
.lvbar em { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); }
.lvbar b { position: absolute; inset: 0; font-size: 11px; line-height: 14px; text-align: center; color: #0B1B2B; }
.card .buy { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.btn.price { min-width: 104px; min-height: 46px; padding: 0 12px; font-size: 17px; border-radius: 12px; }
.btn.price .ic { width: 18px; height: 18px; }
.maxed { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-size: 16px; }
.maxed .ic { width: 18px; height: 18px; }
.card .why { font-size: 14px; color: var(--bad); font-weight: 700; max-width: 150px; text-align: right; line-height: 1.25; }
.fmt-slot { margin-bottom: 12px; }
.fmt-slot h3 { margin: 4px 4px 8px; font-size: 17px; color: var(--cream); display: flex; align-items: center; gap: 6px; }
.fmt-slot h3 .ic { width: 20px; height: 20px; color: var(--brass); }
.fmt-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fcard { border-radius: 14px; background: rgba(245, 235, 216, 0.06); padding: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 150px; border: 2px solid transparent; }
.fcard.on { border-color: var(--gold); background: rgba(255, 208, 90, 0.1); }
.fcard.locked .fn, .fcard.locked .good { opacity: 0.8; }
.fcard .fn { font-size: 17px; display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.fdots { display: flex; gap: 3px; }
.fdots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(245, 235, 216, 0.25); }
.fdots i.on { background: var(--gold); }
.fcard .good { font-size: 14px; color: var(--ok); font-weight: 700; line-height: 1.35; }
.fcard .bad { font-size: 14px; color: var(--bad); font-weight: 700; line-height: 1.35; }
.fcard .acts { margin-top: auto; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.fcard .acts .buy { align-items: stretch; }
.fcard .acts .why { text-align: left; max-width: none; }
.equip { color: var(--gold); font-size: 15px; }
.plate { position: absolute; left: calc(12px + var(--sal)); bottom: calc(72px + var(--sab)); width: calc(38% - 34px); padding: 10px 12px; }
.pl-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.pl-h b { font-size: 18px; color: var(--brass); }
.pl-h span { font-size: 14px; color: var(--cream-2); }
.pl-g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; }
.pl-g span { display: flex; justify-content: space-between; gap: 4px; font-size: 15px; }
.pl-g small { color: var(--cream-2); font-size: 13px; font-weight: 700; }
.bottombar { position: absolute; left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); bottom: calc(10px + var(--sab)); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.bottombar .grow { flex: 1; }
.btn.sail { min-width: 150px; min-height: 54px; font-size: 21px; }

/* 출항 준비 */
.center-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, 92%); max-height: 94%; overflow-y: auto; padding: 16px 18px; touch-action: pan-y; overscroll-behavior: contain; }
.zonehead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.zonehead h2 { margin: 0; font-size: 26px; }
.zonehead .sub { color: var(--cream-2); font-size: 16px; }
.lo-head { border-radius: 14px; padding: 14px 16px; min-height: 92px; display: flex; align-items: flex-end; position: relative; overflow: hidden; }
.lo-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 16, 28, 0.7), rgba(5, 16, 28, 0.05)); }
.lo-head > div { position: relative; z-index: 1; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7); }
.lo-head small { font-size: 15px; color: #FFF3DA; }
.lo-head h2 { margin: 2px 0; font-size: 28px; }
.lo-head span { font-size: 16px; color: #FFFFFF; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.facts span { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 10px; background: rgba(245, 235, 216, 0.07); border: 1px solid var(--line); }
.facts small { font-size: 13px; color: var(--cream-2); font-weight: 700; }
.facts b { font-size: 16px; }
.facts .hard b { color: var(--bad); }
.facts .tight b { color: var(--gold); }
.facts .easy b, .facts .ok b { color: var(--ok); }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 8px 0; }
.pick { border-radius: 14px; background: rgba(245, 235, 216, 0.07); border: 2px solid transparent; padding: 10px; min-height: 64px; color: var(--cream); font: 800 16px var(--font); text-align: left; display: flex; align-items: center; gap: 10px; touch-action: manipulation; }
.pick.on { border-color: var(--gold); background: rgba(255, 208, 90, 0.1); }
.pico .ic { width: 30px; height: 30px; }
.ptx { flex: 1; }
.ptx small { display: block; font-size: 14px; color: var(--cream-2); font-weight: 600; margin-top: 3px; }
.pchk { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: #2B1D00; flex: none; }
.pick.on .pchk { background: var(--gold); border-color: var(--gold); }
.pchk .ic { width: 16px; height: 16px; }
.empty-note { font-size: 15px; color: var(--cream-2); padding: 8px 2px; grid-column: 1 / -1; }

/* 해도 */
.mapp { width: min(940px, 96%); }
.route { position: relative; display: flex; align-items: center; overflow-x: auto; padding: 8px 4px 12px; touch-action: pan-x; overscroll-behavior: contain; scrollbar-width: thin; }
.rope { flex: 0 0 22px; height: 0; border-top: 3px dotted rgba(245, 235, 216, 0.35); }
.rope.open { border-top-color: var(--brass); }
.znode { flex: 0 0 auto; width: 116px; min-height: 92px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.2); padding: 8px; color: #fff; font: 800 16px var(--font); text-align: left; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; background: #0B1B2B; touch-action: manipulation; }
.znode .zsky { position: absolute; inset: 0; }
.znode .zsky::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.45)); }
.znode .zn, .znode .znm { position: relative; text-shadow: 0 1px 3px #000, 0 0 4px #000; }
.znode .zn { font-size: 14px; }
.znode.locked .zsky { filter: grayscale(0.7) brightness(0.8); }
.znode.locked { border-style: dashed; }
.znode.sel { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 208, 90, 0.4); }
.znode.down { border-color: rgba(217, 178, 106, 0.8); }
.znode .lk, .znode .crown { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(8, 22, 36, 0.75); }
.znode .lk .ic, .znode .crown .ic { width: 16px; height: 16px; }
.znode .crown { color: var(--gold); }
.minfo { margin-top: 2px; }
.zinfo { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin-top: 8px; }
.brow { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.brow > b { flex: 0 0 60px; color: var(--token); font-size: 15px; }
.bsp { display: flex; flex-wrap: wrap; gap: 6px; }
.sp { display: inline-flex; flex-direction: column; align-items: center; padding: 3px 6px 4px; border-radius: 10px; background: rgba(245, 235, 216, 0.06); }
.sp canvas { width: 64px; height: 26px; display: block; }
.sp em { font-style: normal; font-size: 13px; }
.sp.unk em { color: var(--cream-2); }
.zfacts { font-size: 15px; color: var(--cream-2); margin-top: 6px; font-weight: 600; }
.conds .ct { font-size: 16px; color: var(--cream-2); margin-bottom: 4px; }
.conds .ok, .conds .no { display: flex; gap: 8px; align-items: flex-start; font-size: 16px; margin: 6px 0; line-height: 1.4; }
.conds .ok { color: var(--ok); }
.conds .no { color: var(--cream); }
.conds .ic { width: 20px; height: 20px; margin-top: 1px; }
.conds .no .ic { color: var(--bad); }
.bosscard { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(255, 107, 74, 0.1); border: 1px solid rgba(255, 107, 74, 0.35); }
.bosscard canvas { width: 96px; height: 40px; flex: none; }
.bosscard div { display: flex; flex-direction: column; }
.bosscard small { font-size: 13px; color: var(--brass); }
.bosscard b { font-size: 19px; }
.bosscard span { font-size: 14px; color: var(--cream-2); }
.zacts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; justify-content: flex-end; }

/* 도감 */
.codex-wrap { position: absolute; top: calc(64px + var(--sat)); bottom: calc(10px + var(--sab)); left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); display: grid; grid-template-columns: 1fr 300px; gap: 10px; }
.cgrid { overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; align-content: start; touch-action: pan-y; overscroll-behavior: contain; }
.ghead { grid-column: 1 / -1; font-size: 16px; color: var(--brass); margin: 4px 2px 0; }
.ccell { border-radius: 12px; background: rgba(245, 235, 216, 0.06); padding: 4px 4px 6px; text-align: center; font-size: 15px; border: 2px solid transparent; color: var(--cream); font-family: var(--font); font-weight: 700; touch-action: manipulation; }
.ccell.unk span { color: var(--cream-2); }
.ccell.sel { border-color: var(--gold); }
.ccell canvas { width: 100%; height: 52px; display: block; }
.ccell.boss { background: rgba(255, 107, 74, 0.1); }
.cdetail { padding: 12px; overflow-y: auto; touch-action: pan-y; }
.dstage { border-radius: 12px; background: radial-gradient(ellipse at 50% 30%, rgba(80, 180, 220, 0.28), rgba(8, 30, 52, 0.6)); }
.cdetail canvas { width: 100%; height: 120px; display: block; }
.cdetail h3 { margin: 8px 0 6px; font-size: 22px; }
.cdetail .row { font-size: 15px; margin: 4px 0; font-weight: 600; line-height: 1.4; }
.stats2 { display: flex; gap: 6px; }
.stats2 span { flex: 1; display: flex; flex-direction: column; padding: 6px 8px; border-radius: 10px; background: rgba(245, 235, 216, 0.07); }
.stats2 small { font-size: 13px; color: var(--cream-2); }
.stamps { display: flex; gap: 6px; margin: 8px 0; }
.stamp { flex: 1; border-radius: 10px; border: 2px dashed rgba(245, 235, 216, 0.4); text-align: center; padding: 5px 0; font-size: 14px; color: var(--cream-2); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.stamp i { width: 14px; height: 14px; border-radius: 50%; background: rgba(245, 235, 216, 0.15); }
.stamp.on { border-style: solid; border-color: var(--gold); color: var(--gold); }
.stamp.on i { background: var(--vc, var(--gold)); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
.tip { font-size: 15px; line-height: 1.45; padding: 8px 10px; border-radius: 10px; background: rgba(111, 242, 224, 0.08); border-left: 3px solid var(--token); margin-top: 6px; font-weight: 600; }

/* 의뢰 */
.lead { margin: 4px 0 0; font-size: 15px; color: var(--cream-2); font-weight: 600; }
.quest-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.qcard { position: relative; border-radius: 14px; background: linear-gradient(180deg, rgba(245, 235, 216, 0.1), rgba(245, 235, 216, 0.04)); border: 1px solid var(--line); border-top: 3px solid var(--brass); padding: 16px 14px 14px; min-height: 150px; display: flex; flex-direction: column; gap: 10px; }
.qcard.done { border-top-color: var(--ok); }
.qpin { position: absolute; top: -8px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE7B0, #B8862F); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5); }
.qcard .qt { font-size: 18px; line-height: 1.35; }
.qprog { height: 10px; border-radius: 5px; background: rgba(8, 22, 36, 0.7); overflow: hidden; }
.qprog i { display: block; height: 100%; background: linear-gradient(90deg, #4FD8C6, var(--token)); }
.qst { display: flex; gap: 6px; align-items: center; font-size: 15px; color: var(--cream-2); }
.qcard.done .qst { color: var(--ok); }
.qst .ic { width: 18px; height: 18px; }
.qr { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 18px; }
.qr small { font-size: 14px; color: var(--cream-2); }
.qr .ic { width: 18px; height: 18px; color: var(--gold); }

/* 정산 */
.res { width: min(780px, 94%); }
.rhead { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.rhead small { font-size: 15px; color: var(--cream-2); }
.rhead h2 { margin: 2px 0 0; font-size: 28px; }
.rhead.good h2 { color: #FFF3D2; }
.rhead.bad h2 { color: var(--bad); }
.result-list { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; max-height: calc(var(--sh, 720px) * 0.42); overflow-y: auto; touch-action: pan-y; }
.rline { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 12px; background: rgba(245, 235, 216, 0.06); font-size: 17px; opacity: 0; transform: translateY(8px); animation: rin 0.3s forwards; min-height: 42px; }
.rline .rth { width: 58px; height: 26px; flex: none; }
.rline .rn { flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rline .rn small { font-size: 14px; color: var(--cream-2); }
.rline .rn .ic { width: 18px; height: 18px; color: var(--token); }
.rline .tag { font-size: 13px; padding: 2px 7px; border-radius: 6px; }
.tag.v { background: rgba(255, 208, 90, 0.18); color: var(--gold); }
.tag.f { background: rgba(111, 242, 224, 0.15); color: var(--token); }
.tag.rec { background: rgba(255, 107, 74, 0.22); color: #FFB4A2; }
.rline.bonus { background: rgba(111, 242, 224, 0.08); }
.rline.minus { background: rgba(255, 122, 102, 0.12); }
.rline .neg { color: var(--bad); }
@keyframes rin { to { opacity: 1; transform: none; } }
.rtotal { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 22px; font-weight: 900; padding: 8px 4px 2px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rtotal > div:first-child { display: flex; align-items: center; gap: 8px; }
.rtotal > b { font-size: 34px; }
.newrec { font-size: 14px; padding: 4px 9px; border-radius: 8px; background: var(--gold); color: #2B1D00; animation: pop 0.5s ease-out; }
.rstats { display: flex; gap: 6px; margin-left: auto; }
.rstats span { display: flex; flex-direction: column; padding: 3px 9px; border-radius: 9px; background: rgba(245, 235, 216, 0.07); }
.rstats small { font-size: 12px; color: var(--cream-2); }
.rstats b { font-size: 16px; }
.bossfail { padding: 10px 12px; border-radius: 12px; background: rgba(255, 107, 74, 0.08); border: 1px solid rgba(255, 107, 74, 0.3); margin: 6px 0; }
.bf-t { display: flex; justify-content: space-between; font-size: 17px; }
.hpfail { height: 14px; border-radius: 7px; background: rgba(8, 22, 36, 0.7); overflow: hidden; margin: 6px 0; }
.hpfail i { display: block; height: 100%; background: linear-gradient(90deg, #FF6B4A, #FFB36A); }
.advice { display: flex; gap: 8px; align-items: center; font-size: 16px; color: var(--cream); margin-top: 6px; }
.advice .ic { width: 20px; height: 20px; color: var(--gold); }
.install-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(111, 242, 224, 0.08); border: 1px solid rgba(111, 242, 224, 0.3); font-size: 16px; margin-top: 8px; }

/* 설정·일시정지 */
.setp { width: min(580px, 92%); }
.pause-acts { display: flex; gap: 8px; margin: 6px 0 10px; flex-wrap: wrap; }
.pause-acts .btn.big { min-width: 160px; }
.verchip { font-size: 14px; color: var(--cream-2); padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 2px; min-height: 52px; font-size: 17px; border-bottom: 1px solid var(--line); }
.set-row .sl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set-row .sl .ic { width: 20px; height: 20px; color: var(--brass); }
.set-row .sl small { flex-basis: 100%; padding-left: 28px; font-size: 13px; color: var(--cream-2); font-weight: 600; }
.set-row .sr { display: flex; align-items: center; gap: 10px; }
.set-row .sv { min-width: 32px; text-align: right; font-size: 16px; }
.set-row input[type=range] { width: 190px; height: 36px; accent-color: var(--accent); touch-action: pan-x; }
.toggle { width: 64px; height: 36px; border-radius: 18px; background: rgba(245, 235, 216, 0.18); position: relative; border: 0; touch-action: manipulation; flex: none; }
.toggle::before { content: ""; position: absolute; inset: -6px -4px; }
.toggle::after { content: ""; position: absolute; left: 4px; top: 4px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: left 0.15s; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 32px; }
.seg { display: flex; padding: 3px; border-radius: 12px; background: rgba(245, 235, 216, 0.1); }
.seg button { border: 0; background: transparent; color: var(--cream-2); font: 800 16px var(--font); min-height: 40px; min-width: 64px; border-radius: 9px; touch-action: manipulation; }
.seg button.on { background: var(--cream); color: var(--ink); }
.okchip { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-size: 16px; }
.okchip .ic { width: 18px; height: 18px; }
.set-row .note { max-width: 260px; text-align: right; }

/* 토스트·모달·설치 안내 */
#toast { position: absolute; left: 50%; top: calc(12px + var(--sat)); transform: translate(-50%, -30px); background: rgba(8, 22, 36, 0.95); border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 16px; display: flex; gap: 12px; align-items: center; font-size: 16px; opacity: 0; transition: all 0.25s; pointer-events: none; z-index: 30; max-width: 90%; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); }
#toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
html.in-hunt #toast { bottom: auto; top: calc(130px + var(--sat)); }
.ios-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.ios-step { border-radius: 14px; background: rgba(245, 235, 216, 0.08); padding: 12px; text-align: center; font-size: 17px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--cream); }
.ios-step svg { width: 54px; height: 54px; display: block; color: #6FC3FF; }
.modal { position: absolute; inset: 0; background: rgba(4, 12, 22, 0.6); display: flex; align-items: center; justify-content: center; pointer-events: auto; z-index: 20; animation: scrIn 0.18s ease-out; }
.modal .panel { width: min(560px, 92%); padding: 18px; max-height: 94%; overflow-y: auto; touch-action: pan-y; }
.modal.wide .panel { width: min(860px, 96%); }
.modal h3 { margin: 0 0 8px; font-size: 22px; }
.modal p { margin: 6px 0; font-size: 16px; color: var(--cream); font-weight: 600; line-height: 1.5; }
.modal p.note { color: var(--cream-2); font-size: 15px; }
.row-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
/* 길어서 스크롤되는 패널에서도 주요 버튼은 늘 보이게 아래에 붙인다 */
.center-panel.docked { display: flex; flex-direction: column; overflow: hidden; }
.center-panel.docked > * { flex: none; }
.center-panel.docked > .pbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; padding-bottom: 14px; -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 16px), transparent); }
.pfoot { display: flex; align-items: center; gap: 12px; padding-top: 10px; margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.center-panel .pfoot > .row-btns, .center-panel .pfoot > .zacts { position: static; margin: 0 0 0 auto; padding: 0; background: none; flex: none; }
.center-panel .pfoot > .rtotal { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; border: 0; }
.center-panel > div > .row-btns, .center-panel .zacts { position: sticky; bottom: -16px; margin-bottom: -16px; padding: 10px 0 14px; background: linear-gradient(180deg, rgba(10, 27, 45, 0), rgba(10, 27, 45, 0.97) 30%); z-index: 2; }
#dbg { position: absolute; left: calc(12px + var(--sal)); top: 38%; opacity: 0.85; font: 600 11px/1.3 ui-monospace, Menlo, Consolas, monospace; color: #DFFFF6; background: rgba(0, 0, 0, 0.55); padding: 6px 8px; border-radius: 8px; pointer-events: none; z-index: 40; white-space: pre; }

/* 작은 가로 화면(무대 높이 430 이하, view.js가 compact 클래스를 붙인다) */
html.compact .chart { width: 300px; height: 28px; }
html.compact .chart .band { line-height: 15px; font-size: 11px; }
html.compact .chart .me { top: 16px; }
html.compact .chart .pod { top: 18px; }
html.compact .tension { width: 300px; bottom: calc(10px + var(--sab)); }
html.compact .hint { top: calc(80px + var(--sat)); font-size: 17px; padding: 8px 14px; }
html.compact .port-main { width: 63%; top: calc(56px + var(--sat)); bottom: calc(64px + var(--sab)); }
html.compact .plate { bottom: calc(64px + var(--sab)); width: calc(37% - 30px); padding: 8px 10px; }
html.compact .pl-h { margin-bottom: 3px; }
html.compact .pl-g span { font-size: 14px; }
html.compact .topbar { min-height: 44px; }
html.compact .topbar h2 { font-size: 22px; }
html.compact .tabs { padding: 4px; }
html.compact .tab { min-height: 44px; font-size: 16px; }
html.compact .cards { grid-template-columns: 1fr; gap: 6px; }
html.compact .card { padding: 7px 10px; grid-template-columns: 40px 1fr auto; gap: 8px; }
html.compact .cico { width: 40px; height: 40px; }
html.compact .cico .ic { width: 22px; height: 22px; }
html.compact .fcard { min-height: 0; padding: 8px; }
html.compact .fmt-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.compact .cbody { gap: 2px; }
html.compact .card .nm { font-size: 17px; }
html.compact .card .val { font-size: 15px; }
html.compact .btn.price { min-height: 44px; min-width: 96px; }
html.compact .brow { margin: 2px 0; }
html.compact .sp canvas { width: 56px; height: 22px; }
html.compact .codex-wrap { grid-template-columns: 1fr 250px; top: calc(56px + var(--sat)); }
html.compact .cdetail canvas { height: 96px; }
html.compact .bossbar { width: 300px; height: 28px; }
html.compact .combo { top: calc(70px + var(--sat)); }
html.compact .result-list { max-height: calc(var(--sh, 720px) * 0.36); }
html.compact .rhead h2 { font-size: 24px; }
html.compact .rtotal > b { font-size: 28px; }
html.compact .center-panel { padding: 12px 14px; }
html.compact .lo-head { min-height: 74px; padding: 10px 14px; }
html.compact .lo-head h2 { font-size: 24px; }
html.compact .znode { min-height: 64px; width: 104px; padding: 6px 8px; }
html.compact .zinfo { gap: 10px; }
html.compact .conds .ok, html.compact .conds .no { font-size: 14px; margin: 4px 0; line-height: 1.3; }
html.compact .set-row { min-height: 44px; padding: 3px 2px; }
/* 높이 430px 이하에서는 보조 설명을 숨겨 일시정지 창이 잘리지 않게 한다 */
html.compact .set-row .sl small { display: none; }
html.compact .help-c span { font-size: 14px; }
/* 가로 폭이 720px 미만(360x640 같은 작은 폰): 상단 HUD가 서로 겹치지 않게 줄인다 */
html.narrow .bar { width: 118px; }
html.narrow .chart, html.narrow .bossbar { width: 172px; }
html.narrow .chart .band { font-size: 10.5px; letter-spacing: -0.3px; }
html.narrow .tension { width: 190px; }
html.compact .btn.sail { min-height: 50px; min-width: 130px; }
html.compact .btn.big { min-height: 56px; font-size: 21px; min-width: 190px; }
html.compact .title-prog .pchip { padding: 4px 10px; font-size: 15px; }
html.compact .logo { margin-top: calc(var(--sh, 720px) * 0.03); }

@media (prefers-reduced-motion: reduce) {
  .emblem-w, .chart.flash, .bar.low, .kit.urge, .tgauge.shake { animation: none; }
}
