/* 혈의 약 — 한지·먹·단청 느낌의 UI */
:root {
  --ink: #241a12; --ink2: #4a3a2a; --paper: #e9dcc0; --paper2: #d8c7a3; --red: #8e2a22; --blue: #2c3f73; --gold: #c9a24f;
  --dc-red: #b33a2a; --dc-green: #2e7a62; --dc-blue: #2b4f8a; --dc-yellow: #d8a83a;
  --font: 'Gowun Batang', 'Nanum Myeongjo', serif; --title: 'Song Myung', 'Gowun Batang', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #050608; color: var(--paper); font-family: var(--font); overflow: hidden; user-select: none; }
#cv { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Cpath d='M2 2 L17 8 L10 10 L8 18 Z' fill='%23e3d3a8' stroke='%23201810' stroke-width='1.5'/%3E%3C/svg%3E") 2 2, default; }
.hidden { display: none !important; }
button { font-family: var(--font); cursor: pointer; }
input, select { font-family: var(--font); }

/* 한지 종이 */
.paper {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.27 0 0 0 0 0.16 0 0 0 0.22 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 30% 20%, #efe4cb 0%, #e3d3b0 55%, #cdb88f 100%);
  color: var(--ink);
  border: 1px solid #6d5636;
  box-shadow: 0 0 0 3px #2a1f15, 0 0 0 4px var(--gold), 0 0 0 7px #2a1f15, 0 10px 40px rgba(0,0,0,0.7);
}
.paper h2, .paper h3 { font-family: var(--title); font-weight: 400; margin: 0 0 6px; color: var(--red); letter-spacing: 2px; }
.note { color: var(--ink2); margin: 4px 0; }
.small { font-size: 12px; }
.key { font-family: var(--font); font-size: 11px; color: #fff; background: var(--ink2); padding: 0 5px; border-radius: 2px; vertical-align: middle; }
.link { background: none; border: none; color: var(--ink2); text-decoration: underline; }

/* 첫 화면 */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10; }
#title { background: radial-gradient(ellipse at 50% 40%, rgba(40,20,14,0.5), rgba(0,0,0,0.92) 70%); }
.title-box { text-align: center; max-width: 560px; padding: 24px; }
.hanja { font-family: var(--title); font-size: 22px; color: #7c2018; letter-spacing: 10px; opacity: 0.85; }
.title-box h1 { font-family: var(--title); font-weight: 400; font-size: 92px; margin: 0; color: #c63a2a; text-shadow: 0 0 30px rgba(200,40,20,0.45), 2px 2px 0 #1a0805; letter-spacing: 12px; }
.title-box .sub { font-family: var(--title); font-size: 22px; color: #d9c79e; letter-spacing: 6px; margin-bottom: 18px; }
.lead { color: #bfae8a; line-height: 1.8; }
#login-area { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#devlogin input, #char-new input { padding: 8px 10px; border: 1px solid #6d5636; background: #f4ead4; width: 200px; }
#devlogin button, #char-new button, #revive { padding: 8px 14px; background: var(--red); color: #f4e6c8; border: 1px solid #3a120c; }
.msg { color: #e5a37a; min-height: 1.2em; }

/* 캐릭터 고르기 */
.chars-box { width: 440px; padding: 22px 26px; }
#char-list { list-style: none; padding: 0; margin: 12px 0; }
#char-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; margin: 6px 0; border: 1px solid #8a7048; background: rgba(255,250,235,0.45); cursor: pointer; }
#char-list li:hover { background: rgba(255,240,200,0.8); border-color: var(--red); }
#char-list .nm { font-family: var(--title); font-size: 20px; color: var(--ink); }
#char-list .meta { color: var(--ink2); font-size: 13px; }
#char-list .del { background: none; border: none; color: #9a3a2a; font-size: 12px; }
#char-new { display: flex; gap: 8px; margin: 10px 0; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }
#zone-name { position: absolute; top: 12px; left: 16px; font-family: var(--title); font-size: 20px; color: #e4d2a2; text-shadow: 1px 1px 2px #000; pointer-events: none !important; }
#sysbox { position: absolute; top: 44px; left: 16px; width: 520px; pointer-events: none !important; }
#sysbox div { font-size: 14px; text-shadow: 1px 1px 2px #000, 0 0 6px #000; margin: 2px 0; transition: opacity 1s; }
#chatbox { position: absolute; left: 14px; bottom: max(250px, 30vh); width: 420px; }
#chat-log { max-height: 190px; overflow-y: auto; font-size: 14px; padding: 4px 6px; text-shadow: 1px 1px 2px #000; scrollbar-width: thin; }
#chat-log .c { margin: 1px 0; }
#chat-log .from { color: #e6d29a; }
#chat-log .w .from { color: #9ec6ff; }
#chat-log .whisper { color: #e8a8ff; }
#chat-log .sys { color: #9a8f78; font-style: italic; }
#chat-form { display: flex; opacity: 0.35; transition: opacity 0.2s; }
#chat-form:focus-within { opacity: 1; }
#chat-ch { background: #1a140e; color: #e4d2a2; border: 1px solid #5a4630; }
#chat-in { flex: 1; background: rgba(20,15,10,0.85); color: #f0e4c8; border: 1px solid #5a4630; padding: 5px 8px; }
#toast { position: absolute; top: 34%; left: 50%; transform: translateX(-50%); font-family: var(--title); font-size: 26px; text-shadow: 0 0 10px #000, 2px 2px 0 #000; pointer-events: none !important; text-align: center; }

/* 창 */
.panel { position: absolute; padding: 14px 16px; max-height: 80vh; overflow: auto; }
#panel-inv { right: 18px; top: 60px; width: 470px; }
#panel-stats { left: 18px; top: 60px; width: 330px; }
#panel-skills { left: 18px; top: 60px; width: 360px; }
#panel-chron { left: 50%; top: 70px; transform: translateX(-50%); width: 480px; }
#panel-npc { left: 18px; top: 60px; width: 440px; }
#panel-mentor { left: 50%; top: 22%; transform: translateX(-50%); width: 480px; }
.line { font-size: 16px; line-height: 1.7; border-left: 3px solid var(--red); padding-left: 10px; margin: 8px 0 12px; }

/* 행낭 */
#doll { position: relative; height: 296px; margin: 4px 0 10px; background: radial-gradient(ellipse at 50% 45%, rgba(120,90,50,0.18), transparent 70%); }
.slot { position: absolute; border: 1px solid #6d5636; background: rgba(40,28,18,0.82); box-shadow: inset 0 0 8px #000; display: flex; align-items: center; justify-content: center; }
.slot .lab { position: absolute; bottom: 1px; width: 100%; text-align: center; font-size: 10px; color: #8d7a5a; pointer-events: none; }
.slot img, .cell-item img { max-width: 100%; max-height: 100%; image-rendering: auto; pointer-events: none; }
#grid { position: relative; width: 438px; height: 176px; background-size: 44px 44px; background-image: linear-gradient(#5a4630 1px, transparent 1px), linear-gradient(90deg, #5a4630 1px, transparent 1px); background-color: rgba(40,28,18,0.82); border: 1px solid #6d5636; }
.cell-item { position: absolute; display: flex; align-items: center; justify-content: center; }
.cell-item.g-sang, .slot.g-sang { background: rgba(40,60,140,0.35); }
.cell-item.g-jin, .slot.g-jin { background: rgba(150,130,30,0.35); }
.cell-item.g-myeong, .slot.g-myeong { background: rgba(150,90,20,0.45); }
.cell-item.g-beol, .slot.g-beol { background: rgba(40,130,50,0.38); }
.cell-item.bad { background: rgba(160,20,20,0.35); }
.gold { margin-top: 8px; text-align: right; color: var(--ink2); }
.gold b { color: #8a5a10; }

/* 능력치 */
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 2px; border-bottom: 1px dotted #a08a62; }
.stat-row button { width: 24px; height: 22px; background: var(--red); color: #f4e6c8; border: 1px solid #3a120c; padding: 0; }
.stat-row .v { font-weight: 700; }
.sub-title { font-family: var(--title); color: var(--blue); margin: 10px 0 2px; }
.skill { padding: 8px; margin: 6px 0; border: 1px solid #a08a62; background: rgba(255,250,235,0.35); }
.skill.locked { opacity: 0.45; }
.skill .nm { font-family: var(--title); font-size: 17px; color: var(--ink); }
.skill .kk { float: right; font-size: 12px; }

/* 상점 */
.shop-item { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid #a08a62; margin: 4px 0; background: rgba(255,250,235,0.3); cursor: pointer; }
.shop-item:hover { background: rgba(255,240,200,0.75); }
.shop-item .ic { width: 44px; height: 44px; background: rgba(40,28,18,0.85); display: flex; align-items: center; justify-content: center; }
.shop-item .ic img { max-width: 44px; max-height: 44px; }
.shop-item .nm { flex: 1; }
.shop-item .pr { color: #8a5a10; }

/* 인연 */
.mentor { padding: 10px; margin: 8px 0; border: 1px solid var(--red); background: rgba(255,245,220,0.5); }
.mentor .who { font-family: var(--title); font-size: 20px; color: var(--red); }
.mentor button { margin-top: 8px; padding: 6px 12px; background: var(--red); color: #f4e6c8; border: 1px solid #3a120c; }

/* 실록 */
#chron-list { list-style: none; padding: 0; margin: 6px 0; }
#chron-list li { padding: 5px 0; border-bottom: 1px dotted #a08a62; font-size: 14px; }
#chron-list .when { color: #8d7a5a; font-size: 11px; margin-right: 6px; }

/* 죽음 */
#dead { position: absolute; inset: 0; z-index: 55; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(30,0,0,0.45); }
.dead-title { font-family: var(--title); font-size: 72px; color: #b4251a; text-shadow: 0 0 20px #000; letter-spacing: 16px; }
#dead-msg { color: #e4d2a2; margin: 10px 0 20px; text-shadow: 1px 1px 2px #000; }

/* 설명 창 */
#tip { position: fixed; z-index: 50; max-width: 320px; padding: 10px 12px; background: rgba(14,10,8,0.95); border: 1px solid #6d5636; box-shadow: 0 0 0 1px #000, 0 6px 20px #000; color: #d8ccb0; font-size: 14px; line-height: 1.55; pointer-events: none; text-align: center; }
#tip .tn { font-family: var(--title); font-size: 18px; }
#tip .tsub { color: #a49678; font-size: 12px; }
#tip .ts { color: #8fa8ff; }
#tip .tr { color: #e05a4a; }
#tip .tl { color: #b8a27a; font-style: italic; margin-top: 6px; }
#drag { position: fixed; z-index: 60; pointer-events: none; opacity: 0.85; }

/* ── 렌더한 재질 (tools/blender/ui_art.py) ── 그림이 있으면 덮어쓴다 */
.paper {
  border: 30px solid transparent;
  border-image: url("../ui/frame_najeon.png") 58 stretch;
  background: url("../ui/tex_hanji.png") center / 340px;
  background-clip: padding-box;
  box-shadow: 0 14px 50px rgba(0,0,0,0.75);
}
#panel-inv {
  border-image: url("../ui/frame_bandaji.png") 58 stretch;
  background: url("../ui/tex_bandaji.png") center / 300px;
  background-clip: padding-box;
  color: #ecdcb6;
  width: 520px;
}
#panel-inv h3 { color: #f0c870; text-shadow: 1px 1px 0 #000; }
#panel-inv .note { color: #c8b48a; }
#panel-inv .gold { color: #d8c290; }
#panel-inv .gold b { color: #ffd77a; }
#doll { background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0.25), transparent 70%); }
.slot { border: 1px solid #b08a48; background: rgba(16,10,6,0.88); box-shadow: inset 0 0 10px #000, 0 0 0 2px rgba(0,0,0,0.6); }
#grid { border: 2px solid #b08a48; background-color: rgba(16,10,6,0.9); background-image: linear-gradient(rgba(176,138,72,0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(176,138,72,0.35) 1px, transparent 1px); box-shadow: inset 0 0 18px #000; }
.panel { padding: 6px 10px; }
.paper h2, .paper h3 { font-size: 22px; border-bottom: 1px solid rgba(110,80,40,0.45); padding-bottom: 4px; }
#tip {
  border: 18px solid transparent;
  border-image: url("../ui/frame_najeon.png") 58 stretch;
  background: rgba(10,6,5,0.96);
  background-clip: padding-box;
  padding: 4px 6px;
  box-shadow: 0 8px 30px #000;
}
.sk-ic { float: left; width: 64px; height: 64px; margin: 0 10px 4px 0; background-image: url("../ui/skills.png"); background-size: 512px auto; box-shadow: 0 0 0 2px #2a1a10, 0 0 0 3px #b08a48; }
.skill.locked .sk-ic { filter: grayscale(1) brightness(0.5); }
.skill { overflow: hidden; }
.stat-row button, #devlogin button, #char-new button, #revive, .mentor button {
  background: linear-gradient(#7a1a12, #4a0c08); border: 1px solid #c9a24f; color: #f6e2b0; box-shadow: inset 0 1px 0 rgba(255,220,160,0.3), 0 1px 2px #000;
}

/* ── 터치 조작 ── */
#touch { display: none; }
body.touch #touch { display: block; }
#joy { position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: 26px; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(20,14,10,0.35) 55%, rgba(201,162,79,0.25) 56%, rgba(20,14,10,0.5) 70%);
  border: 2px solid rgba(201,162,79,0.7); box-shadow: 0 0 0 3px rgba(0,0,0,0.5), inset 0 0 20px #000; touch-action: none; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e8c470, #8a6420 60%, #3a2a10); border: 2px solid #2a1a10; box-shadow: 0 2px 8px #000; pointer-events: none; }
#tbtns { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: 22px; width: 250px; height: 250px; touch-action: none; }
.tb { position: absolute; border-radius: 50%; border: 2px solid #c9a24f; color: #f2dfae; font-family: var(--title); box-shadow: 0 0 0 3px #1a120a, 0 4px 12px rgba(0,0,0,0.7);
  background: radial-gradient(circle at 40% 35%, #6a1a12, #2a0806); background-repeat: no-repeat; touch-action: none; }
.tb.down { filter: brightness(1.5); transform: scale(0.94); }
.tb.big { right: 6px; bottom: 6px; width: 104px; height: 104px; font-size: 22px; }
.tb.sk { width: 66px; height: 66px; background-color: #1a120a; }
.tb.sk.locked { filter: grayscale(1) brightness(0.45); }
.tb.sk[data-s="0"] { right: 124px; bottom: 6px; }
.tb.sk[data-s="1"] { right: 112px; bottom: 82px; }
.tb.sk[data-s="2"] { right: 58px; bottom: 132px; }
.tb.sk[data-s="3"] { right: 0; bottom: 148px; display: none; }
.tb.sm { width: 54px; height: 54px; font-size: 12px; line-height: 1.1; background: radial-gradient(circle at 40% 35%, #3a2c1e, #120c08); }
.tb.sm[data-a="interact"] { right: 190px; bottom: 120px; }
.tb.sm[data-a="target"] { right: 128px; bottom: 170px; }
#tmenu { position: absolute; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); display: flex; gap: 6px; }
#tmenu button { min-width: 44px; height: 40px; padding: 0 8px; font-family: var(--title); font-size: 14px; color: #f2dfae; border: 1px solid #c9a24f;
  background: linear-gradient(#3a1a12, #1a0806); box-shadow: 0 2px 6px #000; }
@media (min-height: 700px) { .tb.sk[data-s="3"] { display: block; } }
@media (max-height: 699px) { .tb.sk[data-s="3"] { display: block; right: 10px; bottom: 120px; } .tb.sm[data-a="target"] { right: 190px; bottom: 60px; } }

/* 터치 화면에서는 창을 크게, 채팅은 위로 */
body.touch .panel { left: 50% !important; top: 52px !important; transform: translateX(-50%) !important; max-width: calc(100vw - 16px); max-height: calc(100vh - 64px); }
body.touch #chatbox { top: auto; bottom: 6px; left: 50%; transform: translateX(-50%); width: min(360px, 40vw); }
body.touch #chat-log { max-height: 84px; font-size: 12px; }
body.touch #chat-form { opacity: 0.85; }
body.touch #sysbox { top: 96px; }
body.touch #zone-name { font-size: 16px; }
@media (max-width: 560px) {
  #panel-inv { transform: translateX(-50%) scale(0.72) !important; transform-origin: top center; }
  .title-box h1 { font-size: 64px; }
}

/* ── 첫 화면 ── */
#backdrop { position: fixed; inset: 0; z-index: 1; overflow: hidden; background: #050304; }
#backdrop.hidden { display: none; }
#bd-img { position: absolute; inset: -3%; background: url("../ui/title_bg.png") 62% 60% / cover no-repeat; animation: bdzoom 40s ease-in-out infinite alternate; }
@keyframes bdzoom { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.06) translate(-1%, -0.5%); } }
#bd-moon { position: absolute; left: 76%; top: 50%; width: 70vmin; height: 70vmin; transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle, rgba(255,120,90,0.32) 0%, rgba(200,50,40,0.16) 30%, rgba(120,20,20,0.06) 55%, transparent 72%); mix-blend-mode: screen; animation: moonpulse 7s ease-in-out infinite; }
@keyframes moonpulse { 50% { opacity: 0.75; } }
#bd-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#bd-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, transparent 30%, rgba(0,0,0,0.55) 100%), linear-gradient(transparent 60%, rgba(0,0,0,0.7)); pointer-events: none; }
#title { background: none; z-index: 10; align-items: flex-start; }
.title-box { margin-top: 6vh; max-width: 760px; }
.title-head { display: flex; align-items: center; justify-content: center; gap: 18px; }
.title-box h1 { font-family: 'Song Myung', serif; font-size: clamp(64px, 12vw, 148px); letter-spacing: 0.08em; margin: 0; line-height: 1;
  color: #c92a18; text-shadow: 0 0 28px rgba(230,50,25,0.55), 0 0 2px rgba(255,140,100,0.6), 3px 4px 0 #120303; }
.title-box h1 span { display: inline-block; opacity: 0; transform: translateY(14px); animation: inkin 1.4s forwards; }
.title-box h1 .t2 { font-size: 0.55em; animation-delay: 0.35s; margin: 0 0.04em; }
.title-box h1 .t3 { animation-delay: 0.7s; }
@keyframes inkin { to { opacity: 1; transform: none; } }
.seal { width: clamp(48px, 7vw, 76px); height: clamp(48px, 7vw, 76px); background: #a8150e; border-radius: 6px; display: grid; grid-template-columns: 1fr; place-items: center;
  color: #f6e2c8; font-family: 'Noto Serif KR', 'Song Myung', serif; font-weight: 700; font-size: clamp(18px, 2.6vw, 28px); line-height: 1; padding: 4px;
  box-shadow: inset 0 0 0 3px #f6e2c8, inset 0 0 0 5px #a8150e, 0 0 18px rgba(200,30,20,0.4); transform: rotate(-4deg); opacity: 0; animation: inkin 1s 1.2s forwards; }
.title-box .sub { font-family: 'Song Myung', serif; font-size: clamp(18px, 2.4vw, 28px); color: #e6d2a4; letter-spacing: 0.5em; margin: 14px 0 8px; text-shadow: 0 0 12px #000, 0 2px 0 #000;
  opacity: 0; animation: inkin 1.2s 1.4s forwards; }
.title-box .sub::before, .title-box .sub::after { content: '—'; color: #8a2a1c; margin: 0 0.6em; letter-spacing: 0; }
.lead { color: #cdbb94; line-height: 1.9; text-shadow: 0 1px 4px #000, 0 0 12px #000; opacity: 0; animation: inkin 1.2s 1.8s forwards; }
.lacquer { margin: 22px auto 0; padding: 16px 22px; max-width: 360px; border: 18px solid transparent; border-image: url("../ui/frame_najeon.png") 58 stretch;
  background: rgba(12,7,6,0.88); background-clip: padding-box; opacity: 0; animation: inkin 1s 2.2s forwards; }
#devlogin { display: flex; gap: 8px; } #devlogin button { white-space: nowrap; }
/* 명부 */
.chars-box { width: min(640px, calc(100vw - 24px)); }
.chars-grid { display: grid; grid-template-columns: 1fr 260px; gap: 14px; align-items: start; }
#char-preview { width: 260px; height: 320px; background: radial-gradient(ellipse at 50% 70%, rgba(120,30,20,0.35), rgba(10,6,5,0.85) 70%); border: 1px solid #8a7048; }
#char-new { flex-wrap: wrap; }
.sex { display: flex; gap: 0; }
.sex button { padding: 8px 12px; background: #e9dcc0; border: 1px solid #6d5636; color: #4a3a2a; }
.sex button.on { background: #7a1a12; color: #f6e2b0; }
@media (max-width: 640px) { .chars-grid { grid-template-columns: 1fr; } #char-preview { width: 100%; height: 220px; } }

/* ── 「구룸 소긔 숨은 룡」 첫 화면: 제첨(고서 표제 쪽지) ── */
#title { align-items: flex-end; justify-content: center; padding-bottom: 5vh; }
#title .title-box { margin: 0; max-width: 560px; background: rgba(236,228,208,0.0); }
#title .lead { color: #c8bfae; text-shadow: 0 1px 6px #000; }
#title .lead b { color: #e0b860; }
.jecheom { position: fixed; z-index: 11; right: 9vw; top: 8vh; display: flex; align-items: flex-start; gap: 14px; opacity: 0; animation: inkin 1.6s 0.3s forwards; }
.jc-inner { writing-mode: vertical-rl; padding: 22px 16px; background: #f1e8d2; border: 2px solid #2a2018; outline: 1px solid #2a2018; outline-offset: 4px;
  box-shadow: 0 0 0 9px #f1e8d2, 0 0 0 10px #2a2018, 0 8px 30px rgba(40,25,10,0.35); }
.jc-title { font-family: 'Song Myung', serif; font-size: clamp(34px, 5.4vh, 62px); color: #16110d; letter-spacing: 0.22em; line-height: 1; }
.jc-hanja { writing-mode: vertical-rl; font-family: 'Noto Serif KR', serif; font-weight: 700; color: #9a907c; font-size: clamp(14px, 2vh, 20px); letter-spacing: 0.4em; margin-top: 14px; }
.seal2 { position: absolute; left: -36px; bottom: -18px; width: 54px; height: 54px; background: #a8150e; border-radius: 5px; display: grid; place-items: center;
  color: #f6e2c8; font-family: 'Noto Serif KR', serif; font-weight: 700; font-size: 20px; line-height: 1; box-shadow: inset 0 0 0 3px #f6e2c8, inset 0 0 0 5px #a8150e;
  transform: rotate(-5deg); opacity: 0.92; }
#title .lacquer { border: 18px solid transparent; border-image: url("../ui/frame_najeon.png") 58 stretch; background: rgba(10,8,8,0.82); background-clip: padding-box; color: #e0d4b8; box-shadow: none; }
#title .msg { color: #8e1e14; }
@media (max-width: 700px) { .jecheom { right: 5vw; top: 4vh; } #title { padding-bottom: 2vh; } }

/* ── 메뉴 아이콘 (ui/menu.png: 160px 10칸) ── */
.mi { background-image: url("../ui/menu.png") !important; background-repeat: no-repeat !important; border: none !important; box-shadow: 0 3px 8px rgba(0,0,0,0.6) !important;
  border-radius: 50% !important; padding: 0 !important; color: transparent !important; cursor: pointer; }
.mi-inv { --i: 0; } .mi-stats { --i: 1; } .mi-skills { --i: 2; } .mi-chron { --i: 3; } .mi-map { --i: 4; } .mi-chat { --i: 5; } .mi-walk { --i: 6; }
.mi-attack { --i: 7; } .mi-target { --i: 8; } .mi-interact { --i: 9; }
.minimenu button { width: 46px; height: 46px; min-width: 0 !important; background-size: 460px 46px !important; background-position: calc(var(--i) * -46px) 0 !important; transition: transform 0.12s, filter 0.12s; }
.minimenu button:hover { transform: translateY(-2px) scale(1.06); filter: brightness(1.2); }
.minimenu button.on { filter: brightness(1.35) drop-shadow(0 0 6px #ffcf7a); }
#mini { position: absolute; left: 50%; bottom: 17vh; transform: translateX(-50%); display: flex; gap: 6px; --ms: 46px; }
body.touch #mini { display: none; }
#tmenu { gap: 8px; }
#tmenu button { width: 46px; height: 46px; }
.tb.mi { background-size: auto 100% !important; }
.tb.big.mi { width: 104px; height: 104px; background-size: 1040px 104px !important; background-position: calc(var(--i) * -104px) 0 !important; }
.tb.sm.mi { width: 58px; height: 58px; background-size: 580px 58px !important; background-position: calc(var(--i) * -58px) 0 !important; }
.tb.sm.mi[data-a="interact"] { right: 188px; bottom: 118px; } .tb.sm.mi[data-a="target"] { right: 126px; bottom: 168px; }

/* ── 이야기: 대화창 · 추적 창 · 두 개의 실록 · 판소리 서막 ── */
#tracker { position: absolute; right: 16px; top: 64px; width: 300px; pointer-events: none !important; }
#tracker .tq { background: linear-gradient(90deg, rgba(10,6,4,0), rgba(10,6,4,0.78) 18%); padding: 8px 12px 10px 34px; margin-bottom: 6px; text-align: right; border-right: 3px solid #a8150e; }
#tracker .tq-n { font-family: var(--title); font-size: 17px; color: #ffd27a; text-shadow: 0 1px 2px #000; }
#tracker .tq-t { font-size: 14px; color: #f0e4c8; text-shadow: 0 1px 2px #000; margin-top: 2px; }
#tracker .tq-p { color: #ffcf7a; font-weight: 700; }
#tracker .tq-h { font-size: 12px; color: #b8a27a; margin-top: 3px; text-shadow: 0 1px 2px #000; }
body.touch #tracker { top: 62px; right: 8px; width: 240px; }
#dialog { position: absolute; left: 50%; bottom: 20vh; transform: translateX(-50%); width: min(720px, calc(100vw - 24px)); min-height: 120px; padding: 18px 26px 26px;
  border: 22px solid transparent; border-image: url("../ui/frame_najeon.png") 58 stretch; background: rgba(12,8,6,0.94); background-clip: padding-box; cursor: pointer; z-index: 40; }
.dlg-who { font-family: var(--title); font-size: 20px; color: #ffcf7a; margin-bottom: 8px; min-height: 1em; }
.dlg-text { font-size: 18px; line-height: 1.8; color: #f2e6cc; white-space: pre-line; }
.dlg-text.narr { color: #cdbb94; font-style: italic; text-align: center; }
.dlg-next { position: absolute; right: 10px; bottom: 4px; font-size: 12px; color: #b8a27a; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
#records { position: absolute; inset: 0; background: rgba(0,0,0,0.65); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 45; }
.rec-title { font-family: var(--title); font-size: 28px; color: #ffd27a; margin-bottom: 14px; text-shadow: 0 2px 4px #000; }
.rec-pair { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.rec { width: min(340px, 44vw); min-height: 220px; padding: 20px 22px; color: #1e140c; background: url("../ui/tex_hanji.png") center / 300px; position: relative;
  box-shadow: 0 0 0 6px #5a3e22, 0 0 0 8px #2a1a10, 0 10px 30px #000; }
.rec::before, .rec::after { content: ''; position: absolute; left: -10px; right: -10px; height: 14px; background: linear-gradient(#6a4a2a, #3a2414); border-radius: 7px; }
.rec::before { top: -14px; } .rec::after { bottom: -14px; }
.rec-h { font-family: var(--title); font-size: 22px; color: #6a1810; border-bottom: 1px solid #8a6a4a; padding-bottom: 6px; margin-bottom: 10px; }
.rec-h span { display: block; font-family: var(--font); font-size: 12px; color: #6a5a40; }
.rec.official .rec-h { color: #1a2a5a; }
.rec-b { font-size: 16px; line-height: 1.9; }
.rec.official .rec-b { font-family: 'Noto Serif KR', serif; }
.rec-ok { margin-top: 26px; padding: 10px 28px; font-family: var(--title); font-size: 18px; background: linear-gradient(#7a1a12, #4a0c08); color: #f6e2b0; border: 1px solid #c9a24f; }
#intro { position: fixed; inset: 0; z-index: 60; background: transparent; }
#intro-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-text { position: absolute; left: 50%; bottom: 12vh; transform: translateX(-50%); width: min(820px, calc(100vw - 32px)); text-align: center;
  font-family: 'Song Myung', serif; font-size: clamp(18px, 2.6vh, 28px); line-height: 1.9; color: #e8dfcc; white-space: pre-line;
  text-shadow: 0 0 14px #000, 0 0 4px #000; }
.intro-text span { opacity: 0; transition: opacity 0.6s; }
.intro-text span.on { opacity: 1; }
.intro-skip { position: absolute; right: 22px; bottom: 22px; padding: 8px 16px; font-family: var(--title); background: rgba(30,20,14,0.75); color: #f0e0bc; border: 1px solid #8a6a4a; }

/* ── 기기별 배치: body.pc / body.tablet / body.phone (+ portrait, short) ── */
.lay { width: 46px; height: 46px; border-radius: 50%; border: 2px solid #8a6a34; background: radial-gradient(circle at 40% 35%, #3a2c1e, #120c08); box-shadow: 0 3px 8px rgba(0,0,0,0.6);
  color: #f0dfae; font-size: 20px; cursor: pointer; padding: 0; }
.lay::before { content: '✋'; }
.lay.kb::before { content: '⌨'; }
.lay[hidden] { display: none; }

/* 태블릿 + 키보드: PC 판을 쓰고 조이스틱·큰 버튼은 치운다. 메뉴는 오른쪽 위 (손이 닿게) */
body.tablet #touch { display: none; }
body.tablet #mini { display: flex; position: absolute; right: max(10px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); bottom: auto; }
body.tablet #mini button { width: 50px; height: 50px; background-size: 500px 50px !important; background-position: calc(var(--i) * -50px) 0 !important; }
body.tablet #mini .lay { background-size: auto !important; }
body.tablet #tracker { top: 72px; right: 10px; width: 280px; }
body.tablet #chatbox { left: 14px; bottom: max(200px, 26vh); width: 360px; transform: none; }
body.tablet .panel { top: 70px !important; }

/* 휴대폰 */
body.phone #mini { display: none; }
body.phone #tracker { top: 140px; right: auto; left: 10px; width: 230px; }
body.phone #tracker .tq { text-align: left; border-right: none; border-left: 3px solid #a8150e; padding: 6px 12px 7px 10px;
  background: linear-gradient(270deg, rgba(10,6,4,0), rgba(10,6,4,0.78) 22%); }
body.phone #tracker .tq-n { font-size: 14px; } body.phone #tracker .tq-t { font-size: 12px; } body.phone #tracker .tq-h { font-size: 11px; }
body.phone #sysbox { top: 140px; left: auto; right: 10px; width: min(300px, 45vw); text-align: right; }
body.phone #sysbox div { font-size: 12px; }
body.phone #chatbox { bottom: max(6px, env(safe-area-inset-bottom)); width: min(320px, 36vw); }
body.phone #chat-log { max-height: 64px; }
body.phone #zone-name { top: 8px; }
body.phone .lay { width: 46px; height: 46px; }
body.phone.panel-open #tracker, body.phone.panel-open #joy, body.phone.panel-open #tbtns, body.phone.panel-open #chatbox { display: none; }
body.phone #dialog { bottom: 8px; width: calc(100vw - 16px); min-height: 0; padding: 10px 14px 14px; border-width: 14px; }
body.phone .dlg-who { font-size: 16px; margin-bottom: 4px; }
body.phone .dlg-text { font-size: 15px; }

/* 휴대폰 세로: 메뉴를 오른쪽 세로줄로, 추적 창은 구슬 아래, 채팅은 조이스틱 위 */
body.phone.portrait #tmenu { flex-direction: column; top: max(10px, env(safe-area-inset-top)); }
body.phone.portrait #tmenu button { width: 42px; height: 42px; background-size: 420px 42px !important; background-position: calc(var(--i) * -42px) 0 !important; }
body.phone.portrait #tmenu .lay { background-size: auto !important; }
body.phone.portrait #tracker { top: 190px; width: calc(100vw - 80px); max-width: 300px; }
body.phone.portrait #sysbox { top: auto; bottom: 330px; left: 10px; right: auto; text-align: left; width: calc(100vw - 80px); }
body.phone.portrait #chatbox { left: 10px; transform: none; bottom: 200px; width: calc(100vw - 20px); }
body.phone.portrait #chat-log { max-height: 54px; }
body.phone.portrait #joy { width: 136px; height: 136px; bottom: max(30px, env(safe-area-inset-bottom)); }
body.phone.portrait #tbtns { bottom: max(26px, env(safe-area-inset-bottom)); }
body.phone.portrait #dialog { bottom: 180px; }

/* 높이가 낮은 화면 (가로 휴대폰): 버튼을 줄여 화면을 넓게 */
body.phone.short #joy { width: 118px; height: 118px; bottom: 14px; }
body.phone.short #joy-knob { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
body.phone.short #tbtns { transform: scale(0.8); transform-origin: right bottom; bottom: 10px; }
body.phone.short #tmenu button { width: 40px; height: 40px; background-size: 400px 40px !important; background-position: calc(var(--i) * -40px) 0 !important; }
body.phone.short #tmenu .lay { background-size: auto !important; }
body.phone.short #tracker { top: 122px; width: 210px; }
body.phone.short #tracker .tq-h { display: none; }
body.phone.short #sysbox { top: 58px; right: 10px; }
body.phone.short #chatbox { width: min(300px, 34vw); }
body.phone.short #dialog { bottom: 4px; width: min(640px, calc(100vw - 300px)); }
body.phone.short #zone-name { display: none; }
body.phone.portrait #zone-name { left: 50%; transform: translateX(-50%); top: 6px; font-size: 14px; white-space: nowrap; }
body.phone.portrait #tbtns { transform: scale(0.78); transform-origin: right bottom; }
body.phone.portrait #joy { left: 14px; width: 128px; height: 128px; }
body.phone.portrait #chatbox { bottom: 236px; }
body.phone.portrait #tracker { top: 204px; }
@media (max-width: 360px) { body.phone.portrait #tbtns { transform: scale(0.7); } }

/* ── 제첨 다시: 찢긴 한지, 스며든 먹, 찍히는 낙관, 뒤에서 타오르는 도깨비불 ── */
.jecheom { animation: none; opacity: 1; }
#jc-fx { position: absolute; left: -90px; top: -120px; width: calc(100% + 180px); height: calc(100% + 170px); z-index: -1; pointer-events: none; }
.jc-inner { position: relative; background: none; border: none; outline: none; box-shadow: none; padding: 30px 22px; isolation: isolate;
  opacity: 0; animation: jcpaper 1.4s 0.2s forwards; }
.jc-inner::before { content: ''; position: absolute; inset: 0; z-index: -2; filter: url(#f-torn);
  background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 45%, rgba(110,72,34,0.35) 85%, rgba(60,36,16,0.6) 100%),
    url("../ui/tex_hanji.png") center / 220px, linear-gradient(#ece2c8, #dccfae);
  box-shadow: 0 0 40px rgba(120,190,255,0.18), 0 12px 40px rgba(0,0,0,0.7); }
.jc-inner::after { content: ''; position: absolute; inset: 9px; z-index: -1; border: 1.5px solid rgba(26,18,12,0.8); box-shadow: inset 0 0 0 3px rgba(236,226,200,0.0), inset 0 0 0 4.5px rgba(26,18,12,0.55); filter: url(#f-ink); }
@keyframes jcpaper { from { opacity: 0; transform: translateY(-14px) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
.jc-title { font-family: 'Song Myung', serif; color: #0d0907; filter: url(#f-ink); text-shadow: 0 0 1px rgba(13,9,7,0.5); font-size: clamp(38px, 6vh, 70px); }
.jc-title .ch { display: inline-block; opacity: 0; filter: blur(6px); transform: scale(1.25); animation: jcink 0.9s forwards; }
@keyframes jcink { 60% { opacity: 1; filter: blur(0.6px); } to { opacity: 1; filter: none; transform: none; } }
.jc-hanja { color: #b8b2a2; text-shadow: 0 0 8px #000; opacity: 0; animation: inkin 1.4s 2.4s forwards; }
.seal2 { opacity: 0; animation: jcstamp 0.5s 2.9s cubic-bezier(.3,1.6,.5,1) forwards; mix-blend-mode: normal; filter: url(#f-ink); }
@keyframes jcstamp { from { opacity: 0; transform: rotate(-5deg) scale(1.9); } to { opacity: 0.92; transform: rotate(-5deg) scale(1); } }
.jecheom.thud { animation: jcthud 0.25s; }
@keyframes jcthud { 30% { transform: translate(1px, 2px); } 60% { transform: translate(-1px, -1px); } }

/* 능력치 설명 */
.stat-k .stat-what { font-size: 12px; color: #6d5636; margin-left: 4px; }
.stat-per { font-size: 12px; color: #8a4a20; margin: -2px 0 6px 10px; }
.stat-tip { font-size: 12px; color: #4a3a2a; background: rgba(120,90,50,0.12); border-left: 3px solid #8e2a22; padding: 6px 8px; margin: 6px 0 2px; line-height: 1.6; }

/* ── 길잡이 ── */
.helpb { width: 46px; height: 46px; border-radius: 50%; border: 2px solid #b08a48; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 40% 32%, #5a2018, #2a0a06 70%); box-shadow: 0 3px 8px rgba(0,0,0,0.6), inset 0 0 0 3px rgba(0,0,0,0.35);
  color: #f0d488; font-family: 'Noto Serif KR', serif; font-weight: 700; font-size: 20px; line-height: 1; text-shadow: 0 1px 2px #000; }
.helpb:hover { filter: brightness(1.2); }
body.phone.portrait #tmenu .helpb, body.phone.short #tmenu .helpb { width: 40px; height: 40px; font-size: 17px; }
body.tablet #mini .helpb { width: 50px; height: 50px; }
#panel-help { width: min(560px, calc(100vw - 16px)); max-height: min(78vh, 640px); overflow: auto; left: 50%; top: 10vh; transform: translateX(-50%); }
.help-tabs { display: flex; gap: 6px; margin: 4px 0 10px; }
.help-tabs button { padding: 6px 14px; background: #e4d6b4; border: 1px solid #8a6a3a; color: #4a3a2a; font-family: var(--title); font-size: 15px; cursor: pointer; }
.help-tabs button.on { background: #7a1a12; color: #f6e2b0; }
.help-dev-now { font-size: 13px; color: #6d5636; margin-bottom: 6px; }
.help-keys { width: 100%; border-collapse: collapse; font-size: 14px; }
.help-keys th { text-align: left; white-space: nowrap; padding: 6px 10px 6px 0; color: #7a1a12; font-family: var(--title); font-weight: 400; vertical-align: top; width: 1%; }
.help-keys td { padding: 6px 0; color: #2a2018; border-bottom: 1px dashed rgba(120,90,50,0.35); line-height: 1.5; }
.help-other { margin-top: 10px; font-size: 12px; color: #6d5636; }
.help-dev { margin: 4px 4px 0 0; padding: 3px 8px; font-size: 12px; background: #eadfc4; border: 1px solid #a88a5a; color: #4a3a2a; cursor: pointer; }
.help-topic { border-bottom: 1px dashed rgba(120,90,50,0.35); padding: 6px 0; }
.help-topic summary { cursor: pointer; font-family: var(--title); font-size: 16px; color: #5a1a10; }
.help-topic div { font-size: 14px; color: #2a2018; line-height: 1.75; padding: 6px 4px 2px; }
.help-topic b, #gtip b { color: #8e1e14; }
.help-reset { margin-top: 12px; padding: 5px 10px; font-size: 12px; background: #eadfc4; border: 1px solid #a88a5a; color: #4a3a2a; cursor: pointer; }
#gtip { position: absolute; left: 50%; bottom: 22vh; transform: translateX(-50%); width: min(440px, calc(100vw - 24px)); z-index: 45;
  border: 18px solid transparent; border-image: url("../ui/frame_najeon.png") 58 stretch; background: rgba(12,8,6,0.95); background-clip: padding-box; padding: 10px 16px 12px;
  animation: gtin 0.35s ease-out; }
@keyframes gtin { from { opacity: 0; transform: translate(-50%, 12px); } }
.gt-title { font-family: var(--title); font-size: 19px; color: #ffcf7a; margin-bottom: 6px; }
.gt-body { font-size: 14px; color: #efe2c4; line-height: 1.75; }
#gtip b { color: #ffd27a; }
.gt-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.gt-btns button { padding: 6px 12px; font-size: 13px; background: #3a1a12; color: #f2dfae; border: 1px solid #a8803e; cursor: pointer; }
.gt-btns .gt-ok { background: #7a1a12; }
body.phone #gtip { bottom: auto; top: 30vh; }
body.phone.short #gtip { top: 12px; }
body.phone .gt-all { display: none; }

/* PC 메뉴 줄: 크기는 ui.js placeMini 가 판 너비에 맞춰 --ms 로 준다 */
body.pc #mini button { width: var(--ms); height: var(--ms); }
body.pc #mini button.mi { background-size: calc(var(--ms) * 10) var(--ms) !important; background-position: calc(var(--i) * var(--ms) * -1) 0 !important; }
body.pc #mini .helpb { font-size: calc(var(--ms) * 0.42); }

/* 기술 창 — 점수·단계·수치 (lib/skills.js) */
.sk-pts { font-family: var(--title); color: var(--blue); margin: 2px 0 6px; }
.sk-pts b { color: var(--red); font-size: 18px; }
.skill { cursor: pointer; }
.skill.sk-right { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: rgba(255,240,200,0.55); }
.skill .sk-up { width: 22px; height: 20px; margin-left: 4px; padding: 0; background: var(--red); color: #f4e6c8; border: 1px solid #3a120c; font-weight: 700; }
.skill .sk-up:hover { background: #a8352b; }
.sk-bonus { color: var(--dc-blue); }
.sk-tag { font-family: var(--font); font-size: 11px; color: var(--dc-green); border: 1px solid currentColor; padding: 0 4px; margin-left: 4px; vertical-align: middle; }
.sk-tag.sk-lock { color: var(--dc-red); }
.sk-num { font-size: 12px; color: var(--ink); margin-top: 4px; border-top: 1px dotted #a08a62; padding-top: 3px; }
.sk-next { color: var(--ink2); border-top: none; padding-top: 0; margin-top: 1px; }

/* ───────── 세계: 역참 장부 · 궤짝 · 종묘지기 (public/js/world.js) ───────── */
.w-hanja { font-family: var(--title); font-size: 13px; color: var(--ink2); letter-spacing: 3px; margin-left: 6px; }
.wpanel h3 .close, .w-ledger h3 .close, .w-gwe h3 .close { float: right; background: none; border: none; color: var(--ink2); font-size: 16px; }
/* 역참 장부: 괘선 친 장부 한 장. 등록한 역참엔 붉은 驛 도장 */
#panel-wp { left: 50%; top: 70px; transform: translateX(-50%); width: 430px; }
#wp-list { list-style: none; margin: 8px 0 4px; padding: 0; border-top: 2px solid #6d5636; border-bottom: 2px solid #6d5636;
  background: repeating-linear-gradient(90deg, transparent 0 46px, rgba(120,40,30,0.18) 46px 47px); }
.wp-row { display: flex; align-items: center; gap: 10px; padding: 4px 8px; border-bottom: 1px dotted rgba(90,60,30,0.55); }
.wp-row:last-child { border-bottom: none; }
.wp-seal { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; font-family: var(--title); font-size: 18px; }
.wp-row.known .wp-seal { color: #f3d9c0; background: #9a2a20; border: 2px solid #6a160f; box-shadow: inset 0 0 0 2px rgba(255,210,180,0.35); transform: rotate(-4deg); filter: url(#f-ink); }
.wp-row.unknown .wp-seal { border: 1px dashed rgba(90,60,30,0.5); border-radius: 2px; }
.wp-nm { flex: 1; font-size: 15px; color: var(--ink); }
.wp-nm small { display: block; font-size: 11px; color: var(--ink2); }
.wp-row.unknown .wp-nm { color: rgba(60,45,30,0.45); }
.wp-st { font-family: var(--title); font-size: 14px; color: var(--blue); min-width: 42px; text-align: right; }
.wp-row.unknown .wp-st { color: rgba(60,45,30,0.4); font-family: var(--font); font-size: 12px; }
.wp-row.here { background: rgba(201,162,79,0.18); }
.wp-row.here .wp-st { color: var(--ink2); }
.wp-row.known:not(.here) { cursor: pointer; }
.wp-row.known:not(.here):hover { background: rgba(142,42,34,0.12); }
.wp-row.known:not(.here):hover .wp-st { color: var(--red); }
.wp-row.portal .wp-seal { background: #3a3a44; border-color: #222; }
.w-foot { margin-top: 6px; }
/* 궤짝: 행낭과 같은 반닫이 재질 */
#panel-stash { left: 18px; top: 60px; width: 760px; max-width: calc(100vw - 24px);
  border-image: url("../ui/frame_bandaji.png") 58 stretch; background: url("../ui/tex_bandaji.png") center / 300px; background-clip: padding-box; color: #ecdcb6; }
#panel-stash h3 { color: #f0c870; text-shadow: 1px 1px 0 #000; }
#panel-stash h3 .w-hanja, #panel-stash .note { color: #c8b48a; }
#panel-stash .close { color: #c8b48a; }
.st-wrap { display: flex; gap: 16px; flex-wrap: wrap; }
.st-h { font-family: var(--title); color: #e8c27a; margin: 4px 0; letter-spacing: 2px; }
.st-grid { position: relative; border: 2px solid #b08a48; background-color: rgba(16,10,6,0.9);
  background-image: linear-gradient(rgba(176,138,72,0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(176,138,72,0.3) 1px, transparent 1px); background-size: 34px 34px; box-shadow: inset 0 0 18px #000; }
.st-it { position: absolute; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.st-it img { max-width: 100%; max-height: 100%; }
.st-it:hover { background: rgba(255,210,120,0.16); }
.st-it.g-sang { background: rgba(80,100,200,0.16); } .st-it.g-jin { background: rgba(220,190,60,0.14); }
.st-it.g-myeong { background: rgba(200,130,50,0.2); } .st-it.g-beol { background: rgba(80,190,90,0.16); }
.st-it.unid img { filter: sepia(0.6) brightness(0.8); }
.st-gold { margin-top: 10px; font-size: 13px; color: #d8c290; line-height: 1.6; }
.st-gold b { color: #ffd77a; }
.st-gb { margin-top: 4px; display: flex; gap: 6px; }
.st-gb button, .sg-btns button { padding: 5px 10px; font-size: 13px; background: linear-gradient(#7a1a12, #4a0c08); border: 1px solid #c9a24f; color: #f6e2b0; box-shadow: inset 0 1px 0 rgba(255,220,160,0.3), 0 1px 2px #000; }
.st-hover { min-height: 18px; margin-top: 8px; font-size: 13px; }
/* 종묘지기: 먹빛 혼, 옛이야기는 한지에 쓴 인용 */
#panel-sage { left: 18px; top: 60px; width: 440px; }
#panel-sage h3 { color: #3a4a6a; }
.sg-btns { display: flex; gap: 8px; margin: 8px 0; }
.sg-btns button:disabled { filter: grayscale(0.8) brightness(0.8); cursor: default; }
#sg-lore-t { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--red); background: rgba(255,250,235,0.35); font-size: 14px; line-height: 1.6; color: var(--ink); }
body.touch #panel-stash .st-grid { transform-origin: 0 0; }
body.panel-open #tracker { display: none; }
#devlogin { flex-wrap: wrap; justify-content: center; }
#devlogin #devkey { width: 120px; }
