:root {
  --ink: #1f1d1a;
  --ink2: #5d5850;
  --paper: #fbf8f3;
  --paper2: #f2ede4;
  --line: rgba(31, 29, 26, 0.12);
  --accent: #b88a3e;
  --accent-ink: #ffffff;
  --panel: rgba(251, 248, 243, 0.86);
  --shadow: 0 10px 30px rgba(31, 24, 14, 0.16);
  --r: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink: #f3efe8; --ink2: #b9b2a6; --paper: #191816; --paper2: #24221f; --line: rgba(255,255,255,0.12); --panel: rgba(28, 26, 23, 0.84); --shadow: 0 10px 30px rgba(0,0,0,0.45); color-scheme: dark; }
}
:root[data-theme="dark"] { --ink: #f3efe8; --ink2: #b9b2a6; --paper: #191816; --paper2: #24221f; --line: rgba(255,255,255,0.12); --panel: rgba(28, 26, 23, 0.84); --shadow: 0 10px 30px rgba(0,0,0,0.45); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
#app { position: fixed; inset: 0; }
#stage { position: absolute; inset: 0; }
#stage canvas.gl { display: block; width: 100%; height: 100%; touch-action: none; }

/* ---------- 공통 버튼 ---------- */
.btn { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 12px 22px; font-weight: 600; letter-spacing: -0.01em; transition: transform .12s ease, background .2s; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 14px; font-size: 13px; }
.seg { border: 1px solid var(--line); background: transparent; padding: 7px 13px; border-radius: 999px; font-size: 13px; }
.seg.on { background: var(--ink); color: var(--paper); border-color: transparent; }
.icon-btn { border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 12px; padding: 8px 11px; font-size: 13px; font-weight: 600; }

/* ---------- 화면 전환 ---------- */
.screen { position: absolute; inset: 0; display: none; z-index: 20; }
.screen.show { display: flex; }

/* 타이틀 */
#title { background: radial-gradient(120% 90% at 70% 30%, #fff7ea 0%, #f4e6d0 45%, #e9d6bb 100%); align-items: center; justify-content: flex-start; padding: 0 clamp(16px, 7vw, 120px); overflow: hidden; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #title { background: radial-gradient(120% 90% at 70% 30%, #2b2620 0%, #1d1a16 60%, #141210 100%); } }
.title-inner { position: relative; z-index: 2; max-width: 560px; }
.eyebrow-line { width: 56px; height: 1px; background: var(--ink); opacity: .5; margin: 0 0 22px; }
#title h1 { font-size: clamp(38px, 7vw, 76px); line-height: 1.04; margin: 0 0 16px; letter-spacing: -0.04em; font-weight: 800; }
#title .sub { font-size: clamp(16px, 2vw, 19px); color: var(--ink2); margin: 0 0 30px; line-height: 1.55; }
.title-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.fine { margin-top: 34px; font-size: 12px; color: var(--ink2); line-height: 1.6; max-width: 440px; }
.title-mong { position: absolute; right: clamp(-80px, 2vw, 60px); bottom: -30px; height: min(88vh, 760px); pointer-events: none; filter: drop-shadow(0 30px 40px rgba(80, 50, 20, .18)); }
@media (max-width: 760px) { .title-mong { opacity: .35; right: -120px; } }

/* 출발 안내판 */
#board { flex-direction: column; background: var(--paper); padding: 22px clamp(16px, 5vw, 64px); overflow: auto; }
.board-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-top: 1px solid var(--ink); padding-top: 14px; }
.board-head h2 { margin: 0; font-size: clamp(24px, 4vw, 36px); letter-spacing: -0.03em; }
.board-head .sub { margin: 4px 0 0; color: var(--ink2); font-size: 14px; }
.board-me { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--ink2); white-space: nowrap; }
.board-me .miles { font-weight: 700; color: var(--ink); }
.board-filter { display: flex; gap: 6px; margin: 18px 0 10px; }
.board-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; padding-bottom: 20px; }
.flight { position: relative; text-align: left; border: 1px solid var(--line); background: var(--paper2); border-radius: var(--r); overflow: hidden; padding: 0; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .2s; }
.flight:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.flight .thumb { aspect-ratio: 16 / 9; background: #d9cdb8 center / cover no-repeat; border-top: 3px solid var(--fa, var(--accent)); }
.flight .body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.flight .r1 { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink2); }
.flight .route { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.flight .route i { flex: 1; height: 1px; background: var(--line); max-width: 60px; }
.flight .prod { font-size: 15px; font-weight: 600; }
.flight .meta { display: flex; gap: 12px; font-size: 12px; color: var(--ink2); }
.flight .prog { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.flight .prog i { display: block; height: 100%; background: var(--fa, var(--accent)); }
.flight.pending { opacity: .55; cursor: default; }
.board-foot { display: flex; gap: 8px; justify-content: space-between; padding: 8px 0 16px; }

/* 로딩 */
#loading { align-items: center; justify-content: center; background: rgba(251, 248, 243, .92); }
.load-card { width: min(420px, 86vw); text-align: center; }
.load-route { font-size: 24px; font-weight: 800; margin: 0 0 18px; letter-spacing: -0.02em; }
.load-bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s; }
.load-msg { color: var(--ink2); font-size: 14px; margin-top: 12px; }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; display: none; z-index: 10; }
.hud.show { display: block; }
.hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.flight-card { background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: var(--r); padding: 10px 14px 10px; min-width: 250px; box-shadow: var(--shadow); border-top: 2px solid var(--accent); }
.fc-line1 { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.fc-line1 span { color: var(--ink2); }
.fc-route { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; margin: 4px 0; }
.fc-track { position: relative; flex: 1; height: 2px; background: var(--line); border-radius: 2px; min-width: 70px; }
.fc-track #fcPlane { position: absolute; top: -5px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(255,255,255,.7); transition: left .5s linear; }
.fc-line2 { display: flex; gap: 10px; font-size: 12px; color: var(--ink2); align-items: center; }
.belt { margin-left: auto; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); opacity: .35; font-size: 11px; }
.belt.on { opacity: 1; background: #ffcf5a; color: #3a2a00; border-color: transparent; }
.hud-right { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.miles-box { display: flex; align-items: center; gap: 6px; background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 12px; padding: 7px 12px; font-size: 15px; box-shadow: var(--shadow); }
.miles-box .coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffe9a0, #ffc93c 60%, #d89a10); }
.miles-box .mi { font-size: 12px; color: var(--ink2); }
.miles-box.bump { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }

.announce { position: absolute; top: 96px; left: 50%; transform: translate(-50%, -10px); max-width: min(560px, 92vw); background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: var(--r); padding: 10px 16px; font-size: 14px; line-height: 1.5; box-shadow: var(--shadow); opacity: 0; transition: all .35s; pointer-events: none; border-top: 1px solid var(--ink); }
.announce.show { opacity: 1; transform: translate(-50%, 0); }
.announce b { display: block; font-size: 11px; color: var(--ink2); font-weight: 600; margin-bottom: 2px; }

.toasts { position: absolute; top: 70px; right: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; animation: toastIn .35s ease, toastOut .4s ease 2.4s forwards; }
.toast b { color: #ffd76a; margin-right: 4px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

.info-card { position: absolute; left: 12px; bottom: 92px; width: min(360px, calc(100vw - 24px)); background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); font-size: 13.5px; line-height: 1.55; display: none; border-top: 2px solid var(--accent); }
.info-card.show { display: block; animation: toastIn .3s ease; }
.info-card h4 { margin: 0 0 4px; font-size: 16px; letter-spacing: -0.02em; }
.info-card .src { margin-top: 8px; font-size: 11.5px; color: var(--ink2); }
.info-card .close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 18px; color: var(--ink2); }
.info-card .dish-plating { color: var(--ink2); font-size: 12.5px; margin-top: 4px; }
.info-card .row { display: flex; gap: 6px; margin-top: 10px; }

.seat-panel { position: absolute; right: 12px; top: 120px; bottom: 92px; width: 228px; background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px; overflow: auto; display: none; border-top: 2px solid var(--accent); }
.seat-panel.show { display: block; }
.seat-panel h5 { margin: 6px 4px 6px; font-size: 12px; color: var(--ink2); font-weight: 600; }
.seat-panel button { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; background: transparent; padding: 9px 8px; border-radius: 10px; text-align: left; font-size: 14px; }
.seat-panel button:hover { background: var(--paper2); }
.seat-panel button .ck { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); flex: 0 0 auto; display: grid; place-items: center; font-size: 11px; }
.seat-panel button.done .ck { background: var(--accent); border-color: transparent; color: #fff; }
.seat-panel button .mi { margin-left: auto; font-size: 11px; color: var(--ink2); }
.seat-panel button.on { background: var(--paper2); font-weight: 700; }
@media (max-width: 760px) {
  .seat-panel { top: auto; bottom: 150px; left: 8px; right: 8px; width: auto; max-height: 34vh; }
  .info-card { bottom: 150px; }
  .seat-panel.show ~ .info-card.show { bottom: calc(150px + 34vh + 8px); }
}

.ctx-action { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); display: none; gap: 6px; }
.ctx-action.show { display: flex; }
.ctx-action button { border: 0; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 11px 18px; font-weight: 700; font-size: 15px; box-shadow: var(--shadow); white-space: nowrap; }
.ctx-action button kbd { font: inherit; font-size: 11px; opacity: .65; margin-left: 6px; border: 1px solid rgba(255,255,255,.35); border-radius: 5px; padding: 0 5px; }

.emote-bar { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 2px; background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 999px; padding: 6px; box-shadow: var(--shadow); }
.emote-bar button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--ink2); }
.emote-bar button .ico { font-size: 21px; line-height: 1.1; }
.emote-bar button:hover, .emote-bar button.on { background: var(--paper2); color: var(--ink); }
.emote-bar .sep { width: 1px; background: var(--line); margin: 6px 4px; }
@media (max-width: 480px) { .emote-bar button { padding: 6px 8px; } }

.joystick { position: absolute; left: 22px; bottom: 100px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.28); border: 1px solid rgba(255,255,255,.55); display: none; touch-action: none; }
.joystick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.touch .joystick.show { display: block; }
.hint { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); font-size: 12.5px; color: #fff; background: rgba(0,0,0,.45); padding: 6px 12px; border-radius: 999px; opacity: 0; transition: opacity .4s; pointer-events: none; white-space: nowrap; }
.hint.show { opacity: 1; }

/* 이름표·말풍선 */
#labels { position: absolute; inset: 0; pointer-events: none; z-index: 9; overflow: hidden; }
.tag { position: absolute; transform: translate(-50%, -100%); background: rgba(255,255,255,.88); color: #2a2622; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.tag.me { background: #2a2622; color: #fff; }
.tag.crew { background: var(--accent); color: #fff; }
.bubble { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: #fff; color: #2a2622; border-radius: 16px; padding: 9px 13px; font-size: 14px; line-height: 1.45; max-width: 250px; box-shadow: 0 6px 20px rgba(0,0,0,.16); pointer-events: auto; animation: pop .28s cubic-bezier(.2,1.6,.4,1); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #fff; }
.bubble .who { display: block; font-size: 11px; color: #8a8378; font-weight: 600; margin-bottom: 1px; }
.bubble .choices { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.bubble .choices button { border: 1px solid #e7e1d6; background: #faf7f2; border-radius: 10px; padding: 7px 10px; font-size: 13px; text-align: left; color: #2a2622; }
.bubble .choices button:hover { background: #f1eadf; }
.bubble .next { display: block; text-align: right; font-size: 11px; color: #a39a8c; margin-top: 3px; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, calc(-100% - 4px)) scale(.6); } }

/* 휴식 모드 */
.relax-hud { position: absolute; inset: 0; pointer-events: none; display: none; z-index: 11; }
.relax-hud.show { display: block; }
.relax-top { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.4); text-align: center; font-size: 13px; display: grid; gap: 2px; }
.relax-top #relaxTime { font-size: 32px; font-weight: 300; letter-spacing: .02em; }
.relax-ctrl { pointer-events: auto; position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; background: rgba(20,18,16,.42); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 999px; padding: 6px 8px; color: #fff; opacity: .35; transition: opacity .4s; max-width: 94vw; }
.relax-ctrl:hover, .relax-ctrl:focus-within { opacity: 1; }
.relax-ctrl .seg { color: #fff; border-color: rgba(255,255,255,.3); }
.relax-ctrl .seg.on { background: #fff; color: #222; }
.relax-ctrl .sep { width: 1px; height: 20px; background: rgba(255,255,255,.3); margin: 0 4px; }
.relax-ctrl select { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 6px 8px; font: inherit; font-size: 13px; }
.relax-ctrl select option { color: #222; }
.relax-ctrl .btn { color: #fff; background: transparent; border-color: rgba(255,255,255,.4); }

/* 모달 */
.modal { position: absolute; inset: 0; background: rgba(20, 16, 10, .42); display: none; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal.show { display: flex; }
.modal-card { background: var(--paper); color: var(--ink); border-radius: 18px; width: min(560px, 100%); max-height: 88vh; overflow: auto; padding: 20px; box-shadow: var(--shadow); border-top: 1px solid var(--ink); }
.modal-card h3 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.03em; }
.modal-card .sub { margin: 0 0 14px; color: var(--ink2); font-size: 13.5px; }
.modal-card .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shop-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; background: var(--paper2); }
.shop-item .em { font-size: 30px; }
.shop-item b { font-size: 14px; }
.shop-item .price { font-size: 12px; color: var(--ink2); }
.dex-list { display: grid; gap: 4px; }
.dex-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.dex-row .st { color: var(--ink2); font-size: 12.5px; white-space: nowrap; }
.dex-row.done .st { color: var(--accent); font-weight: 700; }
.photo-img { width: 100%; border-radius: 12px; display: block; }
.grade-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 6px 0 14px; }
.grade-bar i { display: block; height: 100%; background: var(--accent); }
.settings { display: grid; gap: 14px; }
.settings label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.settings .segs { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.seat-panel .quick { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.seat-panel .quick .seg { width: auto; display: inline-flex; padding: 6px 10px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; }
.tag.pet { background: #fff3c4; color: #6b4e00; font-size: 10.5px; padding: 2px 7px; }
.bubble .sub, .announce .sub { display: block; font-size: 12px; color: #8a8378; margin-top: 3px; line-height: 1.4; }
.announce .sub { color: var(--ink2); }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 4px; }
.menu-row:hover { background: var(--paper2); }
.menu-row .em { font-size: 26px; }
.menu-row b { display: block; font-size: 15px; }
.menu-row small { display: block; color: var(--ink2); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.menu-row .st { margin-left: auto; font-size: 12px; color: var(--ink2); white-space: nowrap; }
.seat-panel .fold-btn { justify-content: center; font-weight: 700; font-size: 13px; color: var(--ink2); padding: 4px; }
@media (max-width: 760px) {
  .seat-panel.folded { max-height: none; bottom: 150px; overflow: hidden; }
  .seat-panel.folded > :not(.fold-btn):not(.quick) { display: none; }
}

/* ---------- 첫 화면: 지도 노선도 ---------- */
#title { flex-direction: column; background: var(--paper); padding: 16px clamp(16px, 3vw, 40px) 10px; overflow: hidden; align-items: stretch; justify-content: flex-start; }
.map-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-top: 1px solid var(--ink); padding-top: 12px; flex-wrap: wrap; }
.map-head h1 { font-size: clamp(28px, 4.4vw, 46px); margin: 0; letter-spacing: -0.04em; font-weight: 800; line-height: 1.05; }
.map-head .sub { margin: 6px 0 0; color: var(--ink2); font-size: 14px; }
.map-head .me { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink2); }
.map-head .miles { font-weight: 700; color: var(--ink); }
.name-pill { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px; }
.map-wrap { position: relative; flex: 1; min-height: 0; margin-top: 10px; display: flex; gap: 14px; }
.world-map { flex: 1; min-width: 0; height: 100%; display: block; }
.map-filter { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; z-index: 2; background: var(--panel); padding: 4px; border-radius: 999px; }
.world-map .sea { fill: #eaf1f5; }
.world-map .land { fill: #ddd2c1; stroke: #cbbfad; stroke-width: 0.6; }
.world-map .grat { fill: none; stroke: #d7e2ea; stroke-width: 0.6; }
.world-map .route { fill: none; stroke-width: 4.5; stroke-linecap: round; opacity: 0.85; cursor: pointer; transition: opacity .2s, stroke-width .2s; }
.world-map .route-hit { fill: none; stroke: transparent; stroke-width: 34; cursor: pointer; }
.world-map .route.dim { opacity: 0.18; }
.world-map .route.on { stroke-width: 7; opacity: 1; }
.world-map .ap circle { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.world-map .ap text { font: 800 26px var(--font); fill: var(--ink); paint-order: stroke; stroke: #fbf8f3; stroke-width: 7px; }
.world-map .ap .ko { font-weight: 600; font-size: 19px; fill: var(--ink2); }
.world-map .plane { font-size: 30px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .world-map .sea { fill: #1d2328; } :root:not([data-theme="light"]) .world-map .land { fill: #3a352e; stroke: #4a443b; } :root:not([data-theme="light"]) .world-map .grat { stroke: #262d33; } :root:not([data-theme="light"]) .world-map .ap text { stroke: #191816; } }
.route-panel { width: 330px; flex: 0 0 330px; background: var(--paper2); border-radius: var(--r); overflow: auto; border-top: 2px solid var(--accent); display: flex; flex-direction: column; }
.route-panel .thumb { aspect-ratio: 16 / 9; background: #d9cdb8 center / cover no-repeat; }
.route-panel .body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.route-panel .air { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink2); }
.route-panel .codes { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.route-panel .codes i { flex: 1; height: 1px; background: var(--line); }
.route-panel .prod { font-size: 16px; font-weight: 700; }
.route-panel .meta { font-size: 12.5px; color: var(--ink2); display: flex; gap: 12px; flex-wrap: wrap; }
.route-panel ul { margin: 2px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.55; color: var(--ink); }
.route-panel .prog { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.route-panel .prog i { display: block; height: 100%; background: var(--accent); }
.route-panel .go { margin-top: 4px; }
.route-panel .others { border-top: 1px solid var(--line); padding: 10px 16px 14px; display: grid; gap: 4px; }
.route-panel .others button { text-align: left; border: 0; background: transparent; padding: 6px 4px; border-radius: 8px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.route-panel .others button:hover { background: var(--paper); }
.route-panel .others .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
#title .fine { margin: 8px 0 0; font-size: 11.5px; color: var(--ink2); }
@media (max-width: 860px) {
  #title { overflow: auto; }
  .map-wrap { flex-direction: column; flex: none; }
  .world-map { width: 100%; height: auto; flex: none; }
  .route-panel { width: auto; flex: none; }
  .map-filter { position: static; align-self: flex-start; margin-bottom: 6px; }
}
.name-input { width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper2); color: var(--ink); }
.name-row { display: flex; gap: 8px; align-items: center; }
.name-row .dice { font-size: 22px; border: 1px solid var(--line); background: var(--paper2); border-radius: 12px; width: 52px; height: 50px; flex: 0 0 auto; }

/* ---------- 승무원 근무 모드 ---------- */
.route-panel .go-row { display: flex; gap: 6px; }
.route-panel .go-row .btn { flex: 1; padding: 11px 10px; }
.route-panel .go-note { margin: 2px 0 0; font-size: 11.5px; color: var(--ink2); line-height: 1.5; }
.crew-hud { position: absolute; right: 12px; top: 120px; width: 250px; background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; border-top: 2px solid var(--accent); font-size: 13px; }
.crew-hud h5 { margin: 0 0 8px; font-size: 12px; color: var(--ink2); font-weight: 600; }
.crew-hud .ph { display: flex; justify-content: space-between; align-items: baseline; }
.crew-hud .ph b { font-size: 18px; letter-spacing: -0.02em; }
.crew-hud .bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 6px 0; }
.crew-hud .bar i { display: block; height: 100%; background: var(--accent); }
.crew-hud .tip { margin: 0 0 8px; color: var(--ink2); font-size: 12.5px; line-height: 1.45; }
.crew-hud ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.crew-hud li { display: flex; align-items: center; gap: 7px; }
.crew-hud li em { margin-left: auto; font-style: normal; color: var(--ink2); font-size: 12px; }
.crew-hud li .ck { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 10px; flex: 0 0 auto; }
.crew-hud li.ok .ck { background: var(--accent); color: #fff; border-color: transparent; }
.crew-hud li.ok { color: var(--ink2); }
.crew-hud .sum { display: flex; justify-content: space-between; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-weight: 700; font-size: 12.5px; }
.order { position: absolute; transform: translate(-50%, -100%); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c, #3cb371) calc(var(--p, 1) * 1turn), rgba(0,0,0,.12) 0); box-shadow: 0 4px 12px rgba(0,0,0,.18); animation: pop .3s cubic-bezier(.2,1.6,.4,1); }
.order span { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 22px; }
.order.night span { background: #eef0ff; }
.order.land { --c: #f0b429; --p: 1; }
.tray-badge { position: absolute; transform: translate(-50%, -100%); background: #fff; border-radius: 12px; padding: 3px 8px; font-size: 20px; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.galley-menu { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; border-top: 2px solid var(--accent); }
.galley-menu .gh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.galley-menu .gh span { color: var(--ink2); font-size: 13px; }
.galley-menu .gh .x { margin-left: auto; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.galley-menu .gi { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.galley-menu .gi button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 8px 10px; text-align: left; font-size: 13px; }
.galley-menu .gi button:hover { background: var(--paper2); }
.galley-menu .gi .em { font-size: 24px; }
.galley-menu .gi kbd { margin-left: auto; font: inherit; font-size: 11px; color: var(--ink2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.galley-menu .gn { margin: 8px 0 0; font-size: 12px; color: var(--ink2); }
.galley-menu .gn .clr { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 2px 8px; font-size: 11.5px; }
@media (max-width: 760px) { .crew-hud { top: auto; bottom: 150px; left: 8px; right: 8px; width: auto; max-height: 32vh; overflow: auto; } }
.route-panel .pick { display: flex; gap: 4px; flex-wrap: wrap; }
.route-panel .others .ot { font-size: 12px; color: var(--ink2); padding: 2px 4px 4px; }


/* 탑승권 · 동시접속 */
.ticket { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--paper2); }
.ticket .tk-top { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px; background: var(--tc); color: #fff; }
.ticket .tk-top span { font-size: 12.5px; opacity: .9; }
.ticket .tk-route { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.ticket .tk-route em { display: block; font-style: normal; font-size: 38px; font-weight: 800; letter-spacing: -0.02em; }
.ticket .tk-route small { color: var(--ink2); font-size: 12px; }
.ticket .tk-route i { font-style: normal; font-size: 22px; color: var(--tc); }
.ticket .tk-route div:last-child { text-align: right; }
.ticket .tk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px 18px 14px; border-top: 1px dashed var(--line); margin-top: 8px; }
.ticket .tk-grid small { display: block; font-size: 11px; color: var(--ink2); }
.ticket .tk-grid b { font-size: 16px; }
.ticket .tk-grid b.seat { font-size: 26px; color: var(--tc); }
.ticket .tk-note { margin: 0; padding: 0 18px 14px; font-size: 12px; color: var(--ink2); line-height: 1.5; }
.route-panel .pres.big { font-size: 13px; font-weight: 700; color: var(--accent); min-height: 1em; }
.route-panel .others .pres { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--accent); }
.fc-line2 .pax { font-weight: 700; color: var(--ink); }
.tag.real { background: #fff; color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 2px 6px rgba(0,0,0,.12); }

/* ---------- 첫 화면 v2: 지도 + 상세 + 노선 카드(세로 스크롤) ---------- */
#title { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
#title .map-wrap { flex: none; height: clamp(440px, 66vh, 720px); }
.map-box { position: relative; flex: 1; min-width: 0; display: flex; }
.map-box .world-map { width: 100%; height: 100%; }
.al-badge { --ac: #333; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ac); color: #fff; font-weight: 800; font-size: 12.5px; letter-spacing: .02em; flex: 0 0 auto; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.al-badge.sm { width: 24px; height: 24px; font-size: 10px; }
.route-panel { width: 380px; flex: 0 0 380px; display: block; padding: 0; }
.route-panel .rp-hero { aspect-ratio: 16 / 8; background: #d9cdb8 center / cover no-repeat; }
.rp-body { padding: 14px 18px 18px; display: grid; gap: 10px; }
.rp-air { display: flex; align-items: center; gap: 10px; }
.rp-air b { display: block; font-size: 15px; }
.rp-air small { color: var(--ink2); font-size: 12px; }
.rp-route { display: flex; align-items: center; gap: 10px; }
.rp-route em { font-style: normal; font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.rp-route i { flex: 1; position: relative; height: 1px; background: var(--line); }
.rp-route i span { position: absolute; left: 50%; top: -11px; transform: translateX(-50%); color: var(--accent); font-style: normal; font-size: 16px; background: var(--paper2); padding: 0 6px; }
.rp-sub { color: var(--ink2); font-size: 13px; }
.rp-prod { margin: 2px 0 0; font-size: 17px; letter-spacing: -0.02em; line-height: 1.35; }
.rp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; }
.rp-tiles div { background: var(--paper); border-radius: 10px; padding: 8px 10px; }
.rp-tiles small { display: block; font-size: 11px; color: var(--ink2); }
.rp-tiles b { font-size: 15px; }
.rp-sec { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.rp-label { margin: 0; font-size: 12px; color: var(--ink2); font-weight: 600; }
.svc { display: flex; gap: 10px; align-items: flex-start; }
.svc .ic { width: 32px; height: 32px; border-radius: 10px; background: var(--paper); display: grid; place-items: center; font-size: 17px; flex: 0 0 auto; }
.svc b { display: block; font-size: 14px; }
.svc small { display: block; color: var(--ink2); font-size: 12.5px; line-height: 1.45; margin-top: 1px; }
.rp-hl { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; display: grid; gap: 3px; }
.rp-live { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13.5px; font-weight: 700; }

.rp-live .dot { width: 9px; height: 9px; border-radius: 50%; background: #c9c4bb; }
.rp-live .dot.live { background: #2fb36d; box-shadow: 0 0 0 4px rgba(47,179,109,.18); }
.rp-prog { display: grid; gap: 5px; font-size: 12px; color: var(--ink2); }
.rp-prog i { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; display: block; }
.rp-prog b { display: block; height: 100%; background: var(--accent); }
.rc-wrap { margin-top: 18px; }
.rc-head { display: flex; align-items: baseline; gap: 10px; border-top: 1px solid var(--ink); padding-top: 12px; }
.rc-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.rc-head span { color: var(--ink2); font-size: 13px; }
.route-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; margin: 12px 0 6px; }
.rcard { text-align: left; border: 1px solid var(--line); background: var(--paper2); border-radius: 14px; overflow: hidden; padding: 0; display: flex; flex-direction: column; border-top: 3px solid var(--ac); transition: transform .15s ease, box-shadow .2s; }
.rcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rcard.on { box-shadow: 0 0 0 2px var(--ac); }
.rc-img { aspect-ratio: 16 / 7; background: #d9cdb8 center / cover no-repeat; }
.rc-body { padding: 10px 12px 12px; display: grid; gap: 5px; }
.rc-air { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.rc-air small { margin-left: auto; color: var(--ink2); font-weight: 500; }
.rc-route { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.rc-route i { flex: 1; max-width: 48px; height: 1px; background: var(--line); }
.rc-prod { font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin-top: 2px; }
.pres.card { font-weight: 700; color: #8a8f94; }
.pres.card.live { color: #1f9a5b; }
.rc-time { color: var(--ink2); }
@media (max-width: 860px) {
  #title { padding: 12px 14px 10px; }
  .map-head { align-items: flex-start; }
  .map-head .me { width: 100%; }
  #title .map-wrap { height: auto; flex-direction: column; }
  .map-box { flex-direction: column; }
  .map-box .world-map { height: auto; aspect-ratio: 1600 / 820; }
  .route-panel { width: auto; flex: none; }
  .route-panel .rp-hero { aspect-ratio: 16 / 7; }
  .rp-route em { font-size: 28px; }
  .route-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rc-img { aspect-ratio: 16 / 9; }
  .rc-route { font-size: 17px; }
  .rc-air span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rc-air small { display: none; }
  .rc-foot { flex-direction: column; align-items: flex-start; gap: 1px; }
}

/* ---------- 모바일 HUD 압축 ---------- */
@media (max-width: 760px) {
  .map-head h1 { font-size: 30px; }
  .map-head .sub { font-size: 13px; }
  .map-head .me { gap: 6px; }
  .hud-top { left: 8px; right: 8px; top: max(8px, env(safe-area-inset-top)); gap: 6px; }
  .flight-card { min-width: 0; flex: 1; padding: 7px 10px; }
  .fc-line1 { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .fc-line1 span { display: none; }
  .fc-route { font-size: 15px; margin: 2px 0; gap: 6px; }
  .fc-track { min-width: 30px; }
  .fc-line2 { font-size: 11px; gap: 6px; flex-wrap: wrap; row-gap: 0; }
  .fc-line2 #fcRemain { display: none; }
  .belt { padding: 1px 5px; font-size: 10px; }
  .hud-right { flex-wrap: wrap; max-width: 132px; gap: 4px; }
  .miles-box { padding: 5px 9px; font-size: 13px; width: 100%; justify-content: center; }
  .icon-btn { padding: 6px 8px; font-size: 12px; }
  .announce { top: 112px; font-size: 13px; width: calc(100vw - 16px); max-width: none; }
  .hint { bottom: 205px; top: auto; white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 32px); }
  .toasts { top: 112px; }
  .ctx-action { bottom: 150px; }
  .emote-bar { padding: 4px; }
  .emote-bar button { padding: 4px 7px; font-size: 10.5px; }
  .emote-bar button .ico { font-size: 18px; }
  .joystick { width: 96px; height: 96px; bottom: 96px; left: 12px; }
  .bubble { max-width: 210px; font-size: 13px; }
  .tag { font-size: 10.5px; }
}

/* 상세 패널: 실시간 현황·탑승 버튼은 패널 아래에 고정 */
.route-panel .rp-cta { position: sticky; bottom: 0; background: var(--paper2); padding: 10px 18px 14px; display: grid; gap: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.route-panel .rp-cta .rp-live { border-top: 0; padding-top: 0; }
.route-panel .rp-hero { aspect-ratio: 16 / 6.5; }

/* ---------- 첫 화면 v3: 슬로건 · 좌석 등급 탭 · 등급별 카드 ---------- */
:root { --first: #b0812c; --first-hi: #e4c27a; --first-bg: #1d1a16; --first-ink: #f4ecdc; --biz: #2c5aa0; --biz-bg: #eef3fa; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --biz-bg: #1b2230; --first-bg: #12100d; } }
:root[data-theme="dark"] { --biz-bg: #1b2230; --first-bg: #12100d; }
.brand-name { margin: 0 0 6px; display: flex; align-items: baseline; gap: 10px; }
.brand-name b { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.brand-name span { font-size: 12px; color: var(--ink2); letter-spacing: .02em; }
#title .map-head h1.slogan { font-size: clamp(24px, 3.4vw, 40px); margin: 0; line-height: 1.15; letter-spacing: -0.035em; font-weight: 800; }
#title .map-head .sub { font-size: 14px; margin: 6px 0 0; }
.lang-btn { font-weight: 700; }

.class-tabs { display: flex; gap: 8px; margin-top: 14px; flex: none; }
.class-tabs .ct { display: flex; align-items: baseline; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 9px 18px; font-size: 15px; transition: background .15s; }
.class-tabs .ct b { font-weight: 800; letter-spacing: -0.01em; }
.class-tabs .ct small { font-size: 12px; color: var(--ink2); font-weight: 700; }
.class-tabs .ct.first b { color: var(--first); }
.class-tabs .ct.business b { color: var(--biz); }
.class-tabs .ct.on { background: var(--ink); border-color: transparent; }
.class-tabs .ct.on b { color: var(--paper); }
.class-tabs .ct.on small { color: var(--paper); opacity: .7; }
.class-tabs .ct.first.on { background: var(--first-bg); box-shadow: inset 0 -3px 0 var(--first); }
.class-tabs .ct.first.on b { color: var(--first-hi); }
.class-tabs .ct.first.on small { color: var(--first-hi); }
.class-tabs .ct.business.on { background: var(--biz); }
.class-tabs .ct.business.on b, .class-tabs .ct.business.on small { color: #fff; }

.world-map .route.first { stroke-width: 5.5; }
.map-legend { position: absolute; left: 10px; bottom: 10px; margin: 0; display: flex; gap: 14px; font-size: 12px; font-weight: 700; background: var(--panel); padding: 6px 12px; border-radius: 999px; pointer-events: none; }
.map-legend .lg::before { content: ""; display: inline-block; width: 22px; height: 0; vertical-align: middle; margin-right: 6px; border-top: 3px solid var(--first); }
.map-legend .lg.first { color: var(--first); }
.map-legend .lg.business { color: var(--biz); }
.map-legend .lg.business::before { border-top: 3px dashed var(--biz); }

.route-panel { border-top: 3px solid var(--cc, var(--accent)); }
.rp-cls { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.rp-cls b { font-size: 13px; letter-spacing: .18em; color: var(--cc); font-weight: 800; }
.rp-cls span { font-size: 13px; color: var(--ink2); font-weight: 600; }
.route-panel .cls-go { background: var(--cc); color: #fff; }
.route-panel[data-cls="first"] .cls-go { background: var(--first-bg); color: var(--first-hi); box-shadow: inset 0 0 0 1px var(--first); }

.rc-wrap { margin-top: 6px; }
.rc-group { margin-top: 18px; }
.rc-group .rc-head { border-top: 2px solid var(--cc); flex-wrap: wrap; row-gap: 2px; }
.rc-group .rc-head h2 { color: var(--cc); }
.rcard { border-top: 3px solid var(--cc); }
.rcard.on { box-shadow: 0 0 0 2px var(--cc); }
.rc-img { position: relative; }
.rc-cls { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 7px; font-size: 12px; font-weight: 800; letter-spacing: .24em; color: #fff; background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0)); }
.rcard.first .rc-cls { color: var(--first-hi); }
.rc-kind { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--cc); }
.rcard.first { background: var(--first-bg); color: var(--first-ink); border-color: #3a3328; border-top-color: var(--first); }
.rcard.first .rc-kind { color: var(--first-hi); }
.rcard.first .rc-prod, .rcard.first .rc-time, .rcard.first .pres.card { color: #b9ad98; }
.rcard.first .pres.card.live { color: #6fd39b; }
.rcard.first .rc-route i { background: rgba(255,255,255,.22); }
.rcard.business { background: var(--biz-bg); }

/* 탑승권: 등급을 크게 */
.ticket .tk-top { background: var(--tc); }
.ticket.first .tk-top { background: var(--first-bg); color: var(--first-hi); }
.ticket .tk-cls { margin: 0; padding: 12px 18px 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ticket .tk-cls b { font-size: 22px; letter-spacing: .14em; color: var(--tc); font-weight: 800; }
.ticket .tk-cls span { font-size: 13px; color: var(--ink2); font-weight: 600; }
.ticket .tk-route i { color: var(--tc); }
.ticket .tk-grid b.seat { color: var(--tc); }

/* 비행 카드의 등급 표시 */
.fc-cls { font-weight: 800; }
.flight-card[data-cls="first"] .fc-cls { color: var(--first); }
.flight-card[data-cls="business"] .fc-cls { color: var(--biz); }

/* ---------- 하단 가운데 행동 버튼 + 감정 표현 서랍 ---------- */
.act-bar { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 4px; background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 20px; padding: 6px; box-shadow: var(--shadow); max-width: calc(100vw - 16px); }
.act-bar[hidden], .act-bar:empty { display: none; }
.act-bar button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 62px; padding: 7px 10px; border-radius: 14px; font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.act-bar button .ico { font-size: 22px; line-height: 1.1; }
.act-bar button:hover:not(:disabled), .act-bar button.on { background: var(--paper2); }
.act-bar button:disabled { opacity: .4; cursor: default; }
.act-bar button.main { flex-direction: row; gap: 8px; background: var(--ink); color: var(--paper); padding: 11px 20px; font-size: 15px; }
.act-bar button.main .ico { font-size: 20px; }
.act-bar button.emo { color: var(--ink2); }
.emote-bar { display: none; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 76px); }
.emote-bar.open { display: flex; animation: toastIn .2s ease; }
.ctx-action { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 82px); }
.emote-bar.open ~ .ctx-action { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 150px); }
.seat-panel { bottom: 96px; }
.info-card { bottom: 96px; }
.hint { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 140px); }

/* ---------- 좁은 화면(휴대폰 세로) ---------- */
@media (max-width: 760px) {
  #title { padding: 10px 14px 10px; }
  .map-head { gap: 8px; padding-top: 8px; }
  .brand-name { margin-bottom: 3px; }
  .brand-name b { font-size: 13px; }
  .brand-name span { font-size: 11px; }
  #title .map-head h1.slogan { font-size: 22px; }
  #title .map-head .sub { font-size: 12.5px; margin-top: 3px; }
  .map-head .me .btn.small { padding: 6px 11px; font-size: 12.5px; }
  .class-tabs { margin-top: 10px; gap: 6px; }
  .class-tabs .ct { flex: 1; padding: 11px 6px; }
  /* 지도: 노선 있는 위도만 잘라 가로 2배로 키우고 손가락으로 밀어 본다 */
  .map-box { display: block; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-radius: 12px; }
  .map-box::-webkit-scrollbar { display: none; }
  .map-box .world-map { width: 200%; max-width: none; height: auto; }
  .map-legend { position: sticky; left: 8px; bottom: auto; width: max-content; margin: 6px 0 0; }
  .route-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-group .rc-head span { font-size: 12px; }
  /* 게임 HUD */
  .seat-panel { bottom: 88px; max-height: 38vh; }
  .seat-panel.folded { bottom: 88px; left: auto; right: 8px; width: auto; padding: 4px; }
  .seat-panel.folded .fold-btn { padding: 8px 12px; }
  .info-card { bottom: 88px; }
  .seat-panel.show ~ .info-card.show { bottom: calc(88px + 46px); }
  .announce { top: 104px; bottom: auto; font-size: 12.5px; padding: 8px 12px; }
  .hint { top: auto; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 140px); }
  .act-bar button.main { flex: none; }
  .act-bar { gap: 2px; padding: 5px; border-radius: 18px; }
  .act-bar button { min-width: 0; flex: 1; padding: 6px 7px; font-size: 11.5px; }
  .act-bar button .ico { font-size: 20px; }
  .act-bar button.main { padding: 11px 18px; font-size: 14.5px; }
  .emote-bar { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px); }
  .emote-bar button { white-space: nowrap; }
  .ctx-action { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 74px); }
  .joystick { bottom: 140px; }
  .fc-line1 { display: flex; }
  .fc-line1 span#fcClass { display: inline; }
  .fc-prod { display: none; }
}

/* ---------- 휴대폰 가로 ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  #title { padding: 8px 16px; }
  .map-head { flex-wrap: nowrap; align-items: center; padding-top: 6px; }
  .brand-name, #title .map-head .sub { display: none; }
  #title .map-head h1.slogan { font-size: 19px; white-space: nowrap; }
  .map-head .me { width: auto; justify-content: flex-end; }
  .class-tabs { margin-top: 6px; }
  .class-tabs .ct { flex: none; padding: 6px 14px; font-size: 13.5px; }
  #title .map-wrap { height: calc(100vh - 100px); min-height: 240px; flex-direction: row; }
  .map-box { min-width: 0; flex: 1; }
  .route-panel { width: 300px; flex: 0 0 300px; }
  .route-panel .rp-hero { display: none; }
  /* 게임 HUD: 위아래 공간이 좁으니 한 줄로 */
  .hud-top { top: 6px; }
  .flight-card { padding: 5px 10px; }
  .fc-route { font-size: 14px; margin: 1px 0; }
  .announce { top: auto; bottom: 70px; max-width: min(460px, 60vw); font-size: 12.5px; padding: 7px 12px; }
  .seat-panel { top: 64px; bottom: 76px; width: 210px; }
  .act-bar { padding: 4px; }
  .act-bar button { padding: 4px 9px; font-size: 11px; }
  .act-bar button .ico { font-size: 18px; }
  .emote-bar { bottom: 66px; }
}
.install-steps { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; line-height: 1.5; }
.install-opts { display: grid; gap: 10px; margin-top: 6px; }
.install-opts .btn { text-align: center; text-decoration: none; color: inherit; }
.install-opts .btn.primary { color: var(--paper); }
.fine-print { margin: -4px 0 0; font-size: 12px; color: var(--ink2); line-height: 1.5; }
@media (max-width: 760px) { .fc-line2 #fcPhase { display: none; } }

/* ---------- 휴대폰: 좌석 기능은 한 줄 가로 스크롤, 승무원 할 일은 접힌 한 줄 ---------- */
.crew-hud .ch-mini { display: none; }
@media (max-width: 760px) {
  .seat-panel.strip { top: auto; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 72px); left: 8px; right: 8px; width: auto; max-height: none; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 6px; border-radius: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .seat-panel.strip.show { display: flex; }
  .seat-panel.strip::-webkit-scrollbar { display: none; }
  .seat-panel.strip button { flex: none; width: auto; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; white-space: nowrap; gap: 6px; }
  .seat-panel.strip button .ck { width: 16px; height: 16px; }
  .seat-panel.strip button .mi { margin-left: 0; }
  .seat-panel.strip button[data-k="special"] { border-color: var(--accent); }
  .seat-panel.strip .fold-btn.x { padding: 8px 12px; color: var(--ink2); }
  .seat-panel.strip.show ~ .info-card.show { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 126px); }
  .info-card { max-height: 30vh; overflow: auto; font-size: 12.5px; padding: 10px 12px; }
  .info-card h4 { font-size: 14.5px; }
  .crew-hud { top: 110px; bottom: auto; left: 8px; right: auto; width: auto; max-width: calc(100vw - 16px); max-height: 46vh; overflow: auto; padding: 7px 12px; cursor: pointer; }
  .crew-hud .ch-mini { display: flex; align-items: center; gap: 10px; font-size: 12.5px; white-space: nowrap; }
  .crew-hud .ch-mini b { font-size: 13.5px; }
  .crew-hud .ch-mini i { font-style: normal; color: var(--ink2); margin-left: auto; }
  .crew-hud:not(.open) > :not(.ch-mini) { display: none; }
  .crew-hud.open .ch-mini { margin-bottom: 6px; }
}
.brand-name { align-items: center; }
.brand-mark { width: 28px; height: auto; display: block; }
@media (max-width: 760px) { .brand-mark { width: 22px; } }
.brand-logo { height: 34px; width: auto; display: block; }
@media (max-width: 760px) { .brand-logo { height: 26px; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-logo { content: url(../brand/logo-h-light.svg); } }
:root[data-theme="dark"] .brand-logo { content: url(../brand/logo-h-light.svg); }
