:root {
  --bg: #1a1714;
  --panel: #241f1b;
  --panel2: #2e2823;
  --line: #4a4038;
  --text: #ece4d8;
  --muted: #a89c8c;
  --accent: #e0a24a;
  --good: #7ed957;
  --bad: #e5534b;
  --font: "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font), var(--emoji); touch-action: none; user-select: none; -webkit-user-select: none; }
canvas#gl { position: fixed; inset: 0; display: block; width: 100%; height: 100%; }
canvas#game { position: fixed; inset: 0; display: block; }
body.three canvas#game { pointer-events: none; }
button { font: inherit; color: inherit; cursor: pointer; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ok { color: var(--good); }
.no { color: var(--bad); }

/* ---------- 버튼 ---------- */
.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-height: 40px; transition: transform .08s, background .15s; }
.btn:hover:not(:disabled) { background: #3a322b; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(#e0a24a, #b87828); border-color: #f2c06a; color: #1a1209; font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(#ecb25a, #c88632); }
.btn.danger { background: #5a2420; border-color: #8a3a32; }
.btn.pink { background: #5a2440; border-color: #8a3a62; }
.btn.sm { padding: 6px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 14px 20px; font-size: 18px; width: 100%; margin-top: 12px; }
.btn.on { outline: 2px solid var(--accent); }
.badge { background: var(--accent); color: #1a1209; border-radius: 99px; padding: 1px 7px; font-size: 11px; font-weight: 700; }

/* ---------- HUD ---------- */
#hud { position: fixed; top: 0; left: 0; right: 0; padding: max(8px, env(safe-area-inset-top)) 10px 0; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 6px; pointer-events: none; text-shadow: 0 1px 2px #000; z-index: 5; }
#hud .hud-l { background: rgba(20,16,13,.72); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 7px 10px; min-width: 210px; pointer-events: auto; cursor: pointer; }
#hud .hud-r { grid-column: 3; background: rgba(20,16,13,.72); border-radius: 12px; padding: 7px 10px; text-align: right; font-size: 13px; line-height: 1.6; }
#hud .who { font-size: 13px; margin-bottom: 4px; }
#hud .bars { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 3px 4px; font-size: 12px; }
#hud .bars.sm { display: flex; gap: 8px; margin-top: 4px; }
.hb { height: 8px; background: rgba(0,0,0,.6); border-radius: 4px; overflow: hidden; }
.hb i { display: block; height: 100%; transition: width .3s; }
.hb.hp i { background: linear-gradient(90deg, #c0392b, #e5534b); }
.hb.hu i { background: linear-gradient(90deg, #b8742a, #e0a24a); }
.hb.th i { background: linear-gradient(90deg, #2a7ab8, #5ab0e0); }
#hud .goal { grid-column: 1 / 3; grid-row: 2; max-width: 420px; background: rgba(20,16,13,.72); border-left: 3px solid var(--accent); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; pointer-events: auto; cursor: pointer; }

/* ---------- 조작 ---------- */
#controls { position: fixed; inset: auto 0 0 0; height: 0; z-index: 6; }
#joy { position: fixed; left: 18px; bottom: calc(88px + env(safe-area-inset-bottom)); width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.15); touch-action: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 50%; background: rgba(255,255,255,.25); border: 2px solid rgba(255,255,255,.35); }
#act { position: fixed; right: 20px; bottom: calc(96px + env(safe-area-inset-bottom)); width: 84px; height: 84px; border-radius: 50%; background: rgba(224,162,74,.85); border: 3px solid #f2c06a; font-size: 34px; box-shadow: 0 4px 14px rgba(0,0,0,.5); touch-action: none; }
#act:active { transform: scale(.94); }
#dodge { position: fixed; right: 112px; bottom: calc(96px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; background: rgba(90,140,180,.85); border: 3px solid #9fd3ff; font-size: 22px; touch-action: none; }
body.joy-right #dodge { right: auto; left: 112px; }
@media (hover: hover) and (pointer: fine) { #dodge { width: 48px; height: 48px; right: 122px; font-size: 18px; } body.joy-right #dodge { left: 122px; } }
#menu { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 84px)); justify-content: center; gap: 3px; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(10,8,6,.85) 35%); }
#menu button { background: rgba(36,31,27,.9); border: 1px solid var(--line); border-radius: 10px; min-width: 0; padding: 5px 0; font-size: clamp(16px, 4.6vw, 20px); display: flex; flex-direction: column; align-items: center; }
#menu button span { font-size: clamp(10px, 2.7vw, 13px); color: var(--text); white-space: nowrap; margin-top: 2px; }
@media (hover: hover) and (pointer: fine) { #joy { display: none; } #act { width: 64px; height: 64px; font-size: 26px; } }

/* ---------- 모달 ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 35; padding: 12px; animation: fade .15s; }
.modal { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: min(460px, 100%); max-height: calc(100% - 8px); overflow: auto; padding: 18px 16px 16px; box-shadow: 0 20px 60px rgba(0,0,0,.6); touch-action: pan-y; user-select: text; }
.modal.wide { width: min(720px, 100%); }
.modal h2 { margin: 0 34px 10px 0; font-size: 19px; }
.modal h2 small { font-size: 12px; color: var(--muted); font-weight: 400; }
.modal h3 { margin: 16px 0 8px; font-size: 15px; color: var(--accent); }
.modal .x { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); }
.story { line-height: 1.7; white-space: pre-line; }
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; line-height: 1.6; }
.card.warn { border-color: #8a6a32; background: #2f2618; }
.card.gold { border-color: #d4af37; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; overflow-x: auto; }
.tab { background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; white-space: nowrap; }
.tab.on { background: var(--accent); color: #1a1209; border-color: var(--accent); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.chip.dim { opacity: .45; }
.chip .mini { background: none; border: 0; color: var(--muted); padding: 0 0 0 4px; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.acts select { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px; }
.rlist { display: flex; flex-direction: column; gap: 6px; }
.recipe { display: grid; grid-template-columns: 56px minmax(110px, 1fr) auto auto; gap: 8px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.recipe.dim > .ic, .recipe.dim > .rinfo { opacity: .55; }
.recipe .ic { font-size: 34px; text-align: center; width: 56px; height: 56px; min-height: 0; padding: 0; }
.recipe small { display: block; margin-top: 2px; }
.person { display: grid; grid-template-columns: 42px 1fr; gap: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.person .pp { font-size: 30px; text-align: center; }
.person small { display: block; }
.log { font-size: 12.5px; line-height: 1.6; max-height: 220px; overflow: auto; }
.log .good { color: var(--good); } .log .bad { color: var(--bad); } .log .warn { color: var(--accent); }
.help li { margin-bottom: 8px; line-height: 1.6; }
textarea.code { width: 100%; height: 120px; background: #111; color: #ddd; border: 1px solid var(--line); border-radius: 8px; font-family: monospace; font-size: 11px; }
details { margin-top: 12px; color: var(--muted); font-size: 13px; }

/* 가방 */
.bag-top { display: grid; grid-template-columns: 180px 1fr; gap: 10px; }
@media (max-width: 520px) { .bag-top { grid-template-columns: 1fr; } .doll-wrap { justify-self: center; } }
.doll-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; background: radial-gradient(#3a2f26, #221c17); border-radius: 12px; padding: 4px; }
.equip { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.eq { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 5px; display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto 1fr; align-items: center; column-gap: 6px; font-size: 12px; }
.eq small { grid-column: 1 / -1; color: var(--muted); }
.eq .empty { grid-column: 1 / -1; color: #6a6058; padding: 8px 0; }
.stats { background: var(--panel2); border-radius: 12px; padding: 8px 10px; margin: 8px 0; font-size: 13px; line-height: 1.7; }
.statrow { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.plus { background: var(--accent); color: #1a1209; border: 0; border-radius: 6px; width: 22px; height: 22px; font-weight: 700; margin-left: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 7px; }
.slot { position: relative; aspect-ratio: 1; flex-direction: column; padding: 2px 2px 8px; color: var(--text); background: #1c1814; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; min-height: 48px; }
.slot .ic { font-size: 34px; line-height: 1; }
.slot .q { position: absolute; right: 4px; bottom: 2px; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.slot .bar { position: absolute; left: 5px; right: 5px; bottom: 3px; height: 3px; background: rgba(0,0,0,.6); border-radius: 2px; overflow: hidden; }
.slot .bar.fresh { bottom: 3px; }
.slot .bar i { display: block; height: 100%; }
.slot .bar.fresh i { background: #5ab0e0; }
.slot.f-mid { border-color: #8a7a32; } .slot.f-bad { border-color: #8a3a32; background: #2a1a17; }
.iteminfo { margin-top: 10px; background: var(--panel2); border-radius: 10px; padding: 10px; font-size: 13px; line-height: 1.5; }
.bigdoll { width: 100%; max-width: min(300px, 46vh); aspect-ratio: 300 / 360; height: auto; display: block; margin: 0 auto 8px; border-radius: 12px; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.pick small { width: 48px; color: var(--muted); }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); }

.earthmap { width: min(100%, 76vh); margin: 0 auto; aspect-ratio: 2 / 1; border-radius: 10px; border: 1px solid var(--line); display: block; background: #1e2c34; }
.klist { display: flex; flex-direction: column; gap: 4px; }
.krow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.krow > span:first-child { min-width: 22px; color: var(--accent); font-weight: 700; }
.krow.me { border-color: var(--accent); background: #33281c; }
.krow .btn { margin-left: auto; }
.badge.bot { background: #4a4a52; color: #ddd; }
canvas#gl.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
body.joy-right #joy { left: auto; right: 18px; }
body.joy-right #act { right: auto; left: 20px; }
#tut { position: fixed; left: 50%; top: calc(110px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 7; background: rgba(29,23,18,.9); border: 2px solid var(--accent); border-radius: 12px; padding: 8px 14px 8px; max-width: min(92vw, 460px); display: flex; flex-direction: column; gap: 2px; text-align: center; pointer-events: auto; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
#tut small { color: var(--accent); font-size: 11px; }
#tut b { font-size: 15px; }
#tut span { font-size: 12.5px; color: var(--muted); }
#tut .mini { position: absolute; right: 6px; top: 4px; background: none; border: 0; color: var(--muted); font-size: 11px; }
/* 아이콘 세트 */
.gi { display: inline-block; vertical-align: middle; flex: none; }
.gi-fb { display: inline-block; min-width: 1em; }
#menu button .gi { width: clamp(24px, 7vw, 36px); height: clamp(24px, 7vw, 36px); }
#hud .gi { vertical-align: -3px; }
.slot .ic .gi { width: 44px; height: 44px; }

/* ---------- 토스트 ---------- */
#toasts { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 50; pointer-events: none; width: min(90vw, 420px); }
.toast { background: rgba(20,16,13,.92); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-size: 14px; transition: opacity .5s, transform .5s; text-align: center; }
.toast.good { border-color: #4f8a3a; } .toast.bad { border-color: #8a3a32; } .toast.warn { border-color: #8a6a32; }
.toast.out { opacity: 0; transform: translateY(-12px); }

/* ---------- 타이틀/생성 ---------- */
#title { position: fixed; inset: 0; z-index: 30; background: radial-gradient(ellipse at 50% 120%, #7a3f1e 0%, #2a1c14 45%, #0e0c0b 100%); overflow: auto; touch-action: pan-y; }
.t-wrap { max-width: 640px; margin: 0 auto; padding: 48px 16px 40px; text-align: center; }
.t-wrap h1 { font-size: 48px; letter-spacing: 6px; margin: 30px 0 4px; color: #f0d9b0; text-shadow: 0 0 30px rgba(224,120,40,.6); }
.t-wrap h3 { color: var(--accent); letter-spacing: 3px; font-weight: 400; margin: 0 0 18px; }
.t-wrap.create { text-align: left; padding-top: 20px; }
.create-top { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; }
.create-top canvas { width: 160px; height: 200px; background: radial-gradient(#3a2f26, #1a1512); border-radius: 14px; }
.create-top input { width: 100%; background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 12px; font: inherit; margin-bottom: 8px; user-select: text; }
.seg { display: flex; gap: 6px; margin-bottom: 6px; }
.seg .btn { flex: 1; }
.jobs, .diffs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.job { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.job.on { border-color: var(--accent); background: #33281c; box-shadow: 0 0 0 2px var(--accent) inset; }
.job .ic { font-size: 26px; }
.job .badge { position: absolute; right: 8px; top: 8px; }
.job small { color: var(--muted); line-height: 1.4; }

/* ---------- 시네마틱 ---------- */
.cine { position: fixed; inset: 0; z-index: 40; background: #000; animation: fade .6s; }
.cine canvas { width: 100%; height: 100%; display: block; }
.cine-text { position: absolute; left: 0; right: 0; bottom: 7%; padding: 18px 20px 0; background: linear-gradient(transparent, rgba(0,0,0,.55) 30%); text-align: center; text-shadow: 0 2px 8px #000; }
.cine-text h1 { font-size: clamp(22px, 5vw, 38px); color: #f3dcb2; margin: 0 0 10px; letter-spacing: 2px; }
.cine-text p { max-width: 640px; margin: 0 auto 16px; line-height: 1.8; font-size: 16px; white-space: pre-line; min-height: 3em; }

/* ---------- 미니게임 ---------- */
.mg { position: fixed; inset: 0; z-index: 45; background: rgba(8,6,5,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px; touch-action: none; }
.mg-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mg-head b { font-size: 18px; color: var(--accent); }
.mg-head span { font-size: 12px; color: var(--muted); text-align: center; }
.mg canvas { border-radius: 12px; border: 1px solid var(--line); touch-action: none; }
.mg-end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,.75); gap: 6px; }
.mg-end h2 { font-size: 28px; margin: 0; }
.quiz { width: min(420px, 100%); display: flex; flex-direction: column; gap: 8px; }
.quiz h3 { line-height: 1.5; }

@keyframes fade { from { opacity: 0; } }

/* 화면이 낮아도(가로 폰·브라우저 축소) 그림이 창을 밀어내지 않고, 확인 버튼은 항상 보이게 */
.modal .btn.primary.big { position: sticky; bottom: -16px; box-shadow: 0 -10px 18px var(--panel); }
#doll { width: 180px; height: 220px; display: block; }
/* 세이브 슬롯 8칸 */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 18px 0 10px; text-align: center; }
.slot-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 132px; justify-content: center; padding: 12px 8px; background: rgba(28,24,21,.92); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; color: var(--text); font: inherit; }
.slot-card:hover { border-color: var(--accent); }
.slot-card b { font-size: 16px; } .slot-card small { color: var(--muted); }
.slot-card.empty b { color: var(--accent); font-size: 17px; }
.slot-card.dead { opacity: .6; }
.slot-del { position: absolute; top: 6px; right: 6px; background: none; border: 0; font-size: 15px; opacity: .55; cursor: pointer; }
.slot-del:hover { opacity: 1; }

/* ---- 아이템 칸: 등급(색) × 종류(모양) ---- */
.slot .nm { font-size: 10.5px; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.slot.g0 { --g: #7a7a7a; } .slot.g1 { --g: #6e6253; } .slot.g2 { --g: #5fb54a; } .slot.g3 { --g: #4a95d0; } .slot.g4 { --g: #e0a24a; }
.slot[class*=" g"] { border: 2px solid var(--g); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--g) 22%, #1c1814) 0%, #1c1814 70%); }
.slot.g4 { box-shadow: 0 0 10px rgba(224,162,74,.45); }
.slot.t-weapon { border-radius: 4px; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); }
.slot.t-tool { border-radius: 6px; }
.slot.t-cloth { border-radius: 14px 14px 22px 22px; }
.slot.t-food { border-radius: 50% / 42%; }
.slot.t-med { border-radius: 12px; border-style: double; border-width: 3px; }
.slot.t-res { border-radius: 3px; }
.slot.t-misc { border-radius: 10px; border-style: dashed; }
/* ---- 제작 필요 재료(오른쪽, 아이콘 크기) ---- */
.needs { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.need { display: flex; flex-direction: column; align-items: center; width: 58px; padding: 4px 2px; border-radius: 8px; background: #1c1814; border: 1px solid var(--line); }
.need .gi { width: 32px; height: 32px; } .need b { font-size: 12px; } .need small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56px; }
.need.ok { border-color: #4f7a3a; } .need.no { border-color: #8a3a32; } .need.no b { color: #ff8a80; }
@media (max-width: 560px) { .recipe { grid-template-columns: 56px 1fr auto; } .recipe .needs { grid-column: 1 / -1; justify-content: flex-start; } }
/* ---- 아래 메뉴 잠금 ---- */
#menu button.locked { opacity: .38; filter: grayscale(1); position: relative; }
#menu button.locked::after { content: "🔒"; position: absolute; top: 2px; right: 4px; font-size: 11px; }
#act span, #dodge span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--text); text-shadow: 0 1px 2px #000; white-space: nowrap; pointer-events: none; }
.rmap { width: 100%; height: auto; max-height: 58vh; object-fit: contain; display: block; border-radius: 10px; border: 2px solid #6b5636; cursor: pointer; }
/* 던지기·필살기·화살 */
#throwBtn, #specBtn { position: fixed; width: 56px; height: 56px; border-radius: 50%; border: 3px solid #d9c9a8; background: rgba(60,52,44,.88); color: #fff; font-size: 22px; touch-action: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#throwBtn { right: 20px; bottom: calc(196px + env(safe-area-inset-bottom)); }
#specBtn { right: 92px; bottom: calc(176px + env(safe-area-inset-bottom)); border-color: #9fd3ff; background: rgba(40,70,100,.9); }
#throwBtn b { position: absolute; right: -2px; top: -4px; font-size: 11px; background: #1c1814; border-radius: 8px; padding: 0 4px; }
#throwBtn span, #specBtn span { position: absolute; bottom: -17px; left: 50%; transform: translateX(-50%); font-size: 10.5px; white-space: nowrap; text-shadow: 0 1px 2px #000; pointer-events: none; }
#specBtn.cooling { filter: grayscale(.8); opacity: .7; }
#specBtn .cd { position: absolute; font-style: normal; font-weight: 700; font-size: 18px; }
#ammoBox { position: fixed; right: 16px; bottom: calc(268px + env(safe-area-inset-bottom)); background: rgba(20,17,14,.82); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font-size: 12px; max-width: 300px; cursor: pointer; }
#ammoBox .sel { color: var(--accent); font-weight: 700; } #ammoBox .gi { vertical-align: middle; }
body.joy-right #throwBtn { right: auto; left: 20px; } body.joy-right #specBtn { right: auto; left: 92px; } body.joy-right #ammoBox { right: auto; left: 16px; }
@media (hover: hover) and (pointer: fine) { #throwBtn, #specBtn { width: 48px; height: 48px; } #throwBtn { bottom: 168px; } #specBtn { right: 82px; bottom: 150px; } #ammoBox { bottom: 236px; } }
#throwBtn[hidden], #specBtn[hidden], #ammoBox[hidden] { display: none; }
#throwBtn .gi-fb, #specBtn .gi-fb { font-size: 24px; line-height: 1; }
#zoomBox { position: fixed; top: 252px; right: 12px; display: flex; flex-direction: column; gap: 4px; }
#zoomBox button { width: 34px; height: 34px; border-radius: 8px; background: rgba(20,17,14,.82); border: 1px solid var(--line); color: #fff; font-size: 20px; line-height: 1; }
#dailyBtn { margin-top: 4px; pointer-events: auto; position: relative; } #dailyBtn .dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #e5534b; }
/* 타이틀 허브·슬롯 카드(야생소년식) */
.tbar { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 6px 0; } .tbar span { background: rgba(20,17,14,.8); border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; }
.slot-card .dif { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 11px; padding: 1px 10px; border-radius: 8px 8px 0 0; background: #5a4a3a; }
.slot-card .dif-easy { background: #3e6a4a; } .slot-card .dif-hard { background: #7a2b2b; }
.slot-card .skull { position: absolute; top: 6px; left: 8px; font-size: 12px; opacity: .8; }
.slot-card .por { width: 96px; height: 104px; }
.hub { display: flex; gap: 10px; justify-content: center; margin: 10px 0; } .hub .btn { display: flex; flex-direction: column; align-items: center; font-size: 26px; min-width: 96px; } .hub .btn span { font-size: 12px; margin-top: 2px; }
.charpage { display: grid; grid-template-columns: 220px 1fr; gap: 12px; } @media (max-width: 640px) { .charpage { grid-template-columns: 1fr; } }
.cleft { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; } .cleft h2 { margin: 0; }
.rrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); } .rrow > b { width: 72px; }
.relic { width: 76px; min-height: 76px; border-radius: 10px; border: 2px solid #6e6253; background: #1c1814; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text); font: inherit; }
.relic span { font-size: 30px; } .relic small { font-size: 10px; } .relic.r1 { border-color: #4a95d0; } .relic.r2 { border-color: #9b6ad0; } .relic.r3 { border-color: #e0a24a; box-shadow: 0 0 8px rgba(224,162,74,.5); }
.relic.on { outline: 3px solid var(--accent); } .relic.empty, .relic.lock { color: var(--muted); font-size: 12px; text-align: center; }
.vaults { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } @media (max-width: 640px) { .vaults { grid-template-columns: 1fr; } }
.vault { background: #1c1814; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.vault .vicon { font-size: 54px; } .v-bunker { border-color: #e0a24a; }
.jrow { display: flex; align-items: center; gap: 8px; }
.slot.w2 { grid-column: span 2; aspect-ratio: 2 / 1; } .slot .q i { font-style: normal; font-weight: 400; opacity: .6; font-size: 9px; }
.evpic { width: 100%; max-height: 34vh; aspect-ratio: 420 / 200; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; }
.codein { width: 100%; font-size: 30px; letter-spacing: 12px; text-align: center; padding: 10px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; }
.notepaper { background: #e8dcc0; color: #3a2a1a; padding: 14px; border-radius: 6px; transform: rotate(-1deg); font-family: serif; text-align: center; }
#tipbox { position: fixed; z-index: 60; max-width: 260px; background: rgba(14,12,10,.96); color: #f1e8d8; border: 1px solid var(--accent); border-radius: 8px; padding: 6px 9px; font-size: 12px; line-height: 1.45; white-space: pre-line; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.trades { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.trade { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; } .trade .slot { width: 76px; } .trade.dim { opacity: .5; }
.pot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #1c1814; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.pot .slot { width: 66px; } .pot .slot.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 24px; border: 2px dashed var(--line); border-radius: 10px; aspect-ratio: 1; }
.pot .arrow { font-size: 26px; color: var(--accent); } .potres { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; } .potres .slot { width: 60px; }
#sneakBtn { position: fixed; right: 156px; bottom: calc(110px + env(safe-area-inset-bottom)); width: 48px; height: 48px; border-radius: 50%; border: 3px solid #8a8a9a; background: rgba(40,40,52,.88); color: #fff; font-size: 20px; touch-action: none; }
#sneakBtn.on { background: rgba(90,60,140,.95); border-color: #c9a0ff; box-shadow: 0 0 10px #a070ff; }
#sneakBtn span { position: absolute; bottom: -17px; left: 50%; transform: translateX(-50%); font-size: 10.5px; white-space: nowrap; text-shadow: 0 1px 2px #000; pointer-events: none; }
body.joy-right #sneakBtn { right: auto; left: 156px; }
@media (hover: hover) and (pointer: fine) { #sneakBtn { right: 196px; bottom: 96px; width: 44px; height: 44px; } #sneakBtn span::after { content: " (X)"; } body.joy-right #sneakBtn { left: 196px; } }
#placeBar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 25; display: flex; gap: 8px; align-items: center; background: rgba(20,17,14,.92); border: 1px solid var(--accent); border-radius: 12px; padding: 8px 10px; max-width: 94vw; flex-wrap: wrap; justify-content: center; }
#placeBar span { font-size: 13px; }
.heroface { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; } .heroface img { height: 180px; border-radius: 10px; border: 2px solid var(--accent); object-fit: cover; } .heroface img.full { height: 180px; width: auto; border-color: var(--line); }
.person .pp img.face { width: 52px; height: 64px; object-fit: cover; border-radius: 8px; border: 2px solid var(--accent); }
img.gi.art { object-fit: contain; image-rendering: auto; }
.chipface { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: top; vertical-align: middle; background: #2a241e; }
