:root {
  --bg: rgba(16, 18, 30, 0.62);
  --bg-strong: rgba(18, 20, 34, 0.9);
  --line: rgba(222, 185, 112, 0.45);
  --gold: #e6c27a;
  --gold-deep: #b98a3e;
  --text: #f6efe0;
  --muted: #c8bda6;
  --red: #c4483a;
  --sky: #9cc4ff;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #14182a; color: var(--text);
  font-family: 'Noto Sans KR', system-ui, sans-serif; font-size: 17px; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
input, textarea { font: inherit; user-select: text; -webkit-user-select: text; }
.hidden { display: none !important; }
.hud { position: fixed; z-index: 10; }

#loading { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 70%, #3a2a3a 0%, #14182a 70%); transition: opacity .8s; }
#loading.done { opacity: 0; pointer-events: none; }
.ld-title { font-family: 'Gowun Batang', serif; font-size: 30px; color: var(--gold); letter-spacing: 2px; }
.ld-sub { margin-top: 10px; color: var(--muted); font-size: 16px; }

#money { left: 14px; top: calc(12px + var(--safe-t)); padding: 9px 16px; border-radius: 22px; background: var(--bg); border: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 18px; }
#money b { color: var(--gold); font-weight: 700; }
#topRight { right: 12px; top: calc(12px + var(--safe-t)); display: flex; gap: 8px; }
.pill { min-width: 44px; min-height: 44px; padding: 0 16px; border-radius: 22px; background: var(--bg); border: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 17px; font-weight: 500; }
.pill:hover { border-color: var(--gold); }
#btnBgm.off { opacity: .5; text-decoration: line-through; }

#chat { left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); width: min(560px, calc(100% - 24px)); }
#chat { position: fixed; }
#chatLog { height: min(150px, 25vh); overflow-x: hidden; overflow-y: auto; display: flex; flex-direction: column; padding: 0 6px 6px; box-sizing: border-box; border-radius: 12px;
  font-size: 15px; text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: auto; touch-action: pan-y; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(230,194,122,.55) transparent; transition: background .2s;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%); mask-image: linear-gradient(to bottom, transparent, #000 35%); }
#chatLog .m { margin-top: 2px; word-break: break-all; }
#chatLog::-webkit-scrollbar { width: 5px; }
#chatLog::-webkit-scrollbar-thumb { background: rgba(230,194,122,.55); border-radius: 3px; }
#chatLog::-webkit-scrollbar-track { background: transparent; }
#chat:hover #chatLog, #chat.browsing #chatLog { background: rgba(16, 18, 30, .5); -webkit-mask-image: none; mask-image: none; }
#chatLog > :first-child { margin-top: auto; }   /* 높이 고정 · 메시지는 아래부터 쌓임 (채팅창이 위로 커져 게임 화면을 가리지 않게) */
#chatNew { position: absolute; right: 10px; bottom: 54px; padding: 5px 12px; border-radius: 14px; background: var(--gold); color: #2a1d08;
  font-size: 13px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.5); z-index: 2; }
body.touch #chatLog { height: min(117px, 25vh); }   /* 휴대폰 세로: 최근 약 5줄 */
#chatLog .m b { color: var(--gold); font-weight: 500; }
#chatLog .m.me b { color: var(--sky); }
#chatLog .m.sys { color: var(--muted); font-style: italic; }
#chatInput { width: 100%; height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--bg); color: var(--text); outline: none;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 16px; }
#chatInput:focus { border-color: var(--gold); background: var(--bg-strong); }
#chatInput::placeholder { color: rgba(246, 239, 224, .5); }

#joy { display: none; left: calc(18px + env(safe-area-inset-left, 0px)); bottom: calc(18px + var(--safe-b)); width: 130px; height: 130px; border-radius: 50%;
  background: rgba(16, 18, 30, .35); border: 2px solid rgba(230, 194, 122, .45); }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3dca6, #b98a3e); box-shadow: 0 2px 10px rgba(0,0,0,.5); }
body.touch #joy { display: block; }
body.touch #chat { left: auto; right: 12px; transform: none; width: calc(100% - 180px); max-width: 460px; }

#hint { left: 50%; transform: translateX(-50%); bottom: calc(286px + var(--safe-b)); padding: 10px 20px; border-radius: 24px; background: var(--bg-strong);
  border: 1px solid var(--line); font-size: 18px; white-space: nowrap; pointer-events: none; }
#hint kbd { display: inline-block; min-width: 28px; padding: 1px 8px; margin-right: 8px; border-radius: 6px; background: var(--gold); color: #2a1d08; font-family: inherit; font-weight: 700; text-align: center; }
body.touch #hint { display: none !important; }
#btnInteract { right: 18px; bottom: calc(220px + var(--safe-b)); min-width: 132px; min-height: 64px; padding: 0 22px; border-radius: 32px; font-size: 20px; font-weight: 700;
  background: linear-gradient(180deg, #f0d391, #b98a3e); color: #2a1d08; box-shadow: 0 4px 18px rgba(0,0,0,.45), 0 0 18px rgba(240,200,120,.35); }
body:not(.touch) #btnInteract { display: none !important; }

#npcBar { left: 50%; transform: translateX(-50%); bottom: calc(222px + var(--safe-b)); display: flex; gap: 8px; }
#npcBar button { min-height: 50px; min-width: 96px; padding: 0 18px; border-radius: 25px; font-size: 18px; font-weight: 700;
  background: linear-gradient(180deg, #ffc6dc, #e57fa9); color: #4a1630; box-shadow: 0 3px 12px rgba(0,0,0,.4), 0 0 14px rgba(255,150,200,.35); }
#npcBar button:disabled { opacity: .5; }
#npcBar button.bellBtn { background: linear-gradient(180deg, #f6dc9a, #c8963f); color: #3a2508; }
#toast.sacred { top: 24%; padding: 18px 34px; font-family: 'Gowun Batang', serif; font-size: 25px; font-weight: 700; color: #fff4cf;
  background: radial-gradient(ellipse at center, rgba(120,80,20,.92), rgba(30,20,10,.88)); border: 2px solid #f6d27a;
  box-shadow: 0 0 30px rgba(255,215,120,.75), 0 0 80px rgba(255,200,90,.45); text-shadow: 0 0 12px rgba(255,220,140,.9); }
body.touch #npcBar { bottom: calc(170px + var(--safe-b)); right: 12px; left: auto; transform: none; }
#actionBar, #standBar { left: 50%; transform: translateX(-50%); bottom: calc(222px + var(--safe-b)); display: flex; gap: 8px; }
#actionBar button, #standBar button, #bowCounter button { min-height: 50px; min-width: 76px; padding: 0 16px; border-radius: 25px; font-size: 18px; font-weight: 700;
  background: linear-gradient(180deg, rgba(240,211,145,.95), rgba(185,138,62,.95)); color: #2a1d08; box-shadow: 0 3px 12px rgba(0,0,0,.4); }
#actionBar button.on { outline: 3px solid #fff3cf; }
button.ghost, #actionBar button.ghost, #standBar button.ghost { background: var(--bg-strong); color: var(--text); border: 1px solid var(--line); }
body.touch #actionBar, body.touch #standBar { bottom: calc(170px + var(--safe-b)); right: 12px; left: auto; transform: none; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 170px); }

#bowCounter { left: 50%; top: calc(74px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
#bowNum { font-family: 'Gowun Batang', serif; font-size: 40px; font-weight: 700; color: var(--gold); text-shadow: 0 2px 10px #000; }
#bowCounter button { min-height: 44px; font-size: 16px; }

#toast { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -8px); z-index: 60; padding: 14px 26px; border-radius: 30px; background: var(--bg-strong);
  border: 1px solid var(--gold); font-size: 19px; color: var(--text); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; text-align: center; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(5, 6, 12, .45); padding: 16px; }
.modal.top { z-index: 70; }
.modal.consult { background: rgba(5, 6, 12, .25); }
.panel { width: min(460px, 100%); max-height: calc(100% - 20px); overflow: auto; padding: 18px; border-radius: 18px; background: var(--bg-strong);
  border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 12px; }
.panel.small { width: min(380px, 100%); }
.panel.tall { height: min(620px, 100%); }
.ph { display: flex; align-items: center; justify-content: space-between; font-family: 'Gowun Batang', serif; font-size: 21px; font-weight: 700; color: var(--gold); }
.x { width: 44px; height: 44px; border-radius: 22px; background: transparent; font-size: 20px; color: var(--muted); }
.row { display: flex; gap: 10px; }
.row > button { flex: 1; min-height: 50px; border-radius: 14px; font-size: 18px; font-weight: 700; }
button.gold { background: linear-gradient(180deg, #f0d391, #b98a3e); color: #2a1d08; }
button.danger { background: linear-gradient(180deg, #d0614f, #8f2c22); color: #fff; }
button:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.6); }
.panel input, .panel textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: var(--text); outline: none; font-size: 17px; }
.panel textarea { resize: none; }
.err { color: #ff9b8a; min-height: 22px; font-size: 15px; }
.info { color: var(--muted); font-size: 15px; min-height: 20px; text-align: center; }
.cnt { text-align: right; color: var(--muted); font-size: 14px; margin-top: 4px; }
.tabs { display: flex; gap: 6px; }
.tab { flex: 1; min-height: 46px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid transparent; font-size: 17px; }
.tab.on { border-color: var(--gold); color: var(--gold); background: rgba(230,194,122,.12); font-weight: 700; }
.amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.amounts button { min-height: 46px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); font-size: 15px; }
.amounts button.on { background: rgba(230,194,122,.25); border-color: var(--gold); color: #fff3cf; font-weight: 700; }
.server-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.server-grid button { min-height: 50px; border-radius: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font-size: 15px; line-height: 1.2; }
.server-grid button small { display: block; color: var(--muted); font-size: 13px; }
.server-grid button.cur { border-color: var(--gold); color: var(--gold); }
.cf-text { font-size: 18px; text-align: center; line-height: 1.6; padding: 6px 0; white-space: pre-line; }

#cLog { flex: 1; min-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.3); user-select: text; }
#cLog .cm { max-width: 82%; padding: 8px 12px; border-radius: 14px; font-size: 16px; line-height: 1.45; word-break: break-all; }
#cLog .cm small { display: block; font-size: 12px; opacity: .75; margin-bottom: 2px; }
#cLog .cm.c { align-self: flex-start; background: rgba(150, 86, 190, .35); border: 1px solid rgba(200, 140, 240, .45); }
#cLog .cm.k { align-self: flex-end; background: rgba(60, 120, 190, .35); border: 1px solid rgba(120, 180, 250, .45); }
#cLog .cm.sys { align-self: center; background: rgba(230,194,122,.15); color: var(--gold); font-size: 14px; }
#cForm { display: flex; gap: 8px; }
#cForm input { flex: 1; }
#cForm button { min-width: 84px; border-radius: 12px; font-weight: 700; }
#bokWrap { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.bok-row { display: flex; align-items: center; gap: 8px; }
.bok-row span { font-size: 18px; }
.legend { font-size: 13px; color: var(--muted); }

/* ───── 소원초 (핑크·아이보리·샴페인골드) ───── */
.modal.top2 { z-index: 50; }
.panel.candle { background: linear-gradient(180deg, rgba(58,30,44,.96), rgba(36,22,32,.96)); border-color: rgba(240,205,160,.7); width: min(640px, 100%); }
.panel.candle.small2 { width: min(420px, 100%); }
.panel.candle .ph { color: #ffd9e6; }
.panel.candle .tab.on { border-color: #f3cf9a; color: #ffe2c0; background: rgba(255,190,210,.12); }
button.pink { background: linear-gradient(180deg, #ffd3e2, #e98fb2); color: #4a1630; font-weight: 700; }
.legend { font-size: 13px; color: #e8d6c8; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-left: 6px; }
.lg.empty { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.3); }
.lg.lit { background: #f5b84a; } .lg.mine { background: #ff8fbd; }
.cgrid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.cgrid button { min-height: 44px; border-radius: 8px; font-size: 13px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); color: #f6e9dc; line-height: 1.1; padding: 2px; }
.cgrid button.lit { background: radial-gradient(circle at 50% 30%, rgba(255,210,120,.55), rgba(140,70,30,.5)); border-color: #f3cf9a; }
.cgrid button.mine { background: radial-gradient(circle at 50% 30%, rgba(255,170,205,.75), rgba(150,60,100,.6)); border-color: #ffb3d1; font-weight: 700; }
.cgrid button small { display: block; font-size: 10px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide { color: #f3dfe8; font-size: 15px; text-align: center; }
.slotname { text-align: center; color: #f3cf9a; font-weight: 700; }
.chk { display: flex; align-items: center; gap: 8px; color: #f0e2d6; font-size: 15px; min-height: 36px; }
.chk input { width: 22px; height: 22px; }
.buyinfo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; font-size: 14px; color: #e8d6c8; background: rgba(255,255,255,.05); border-radius: 12px; padding: 10px 4px; }
.buyinfo b { display: block; color: #ffe2c0; font-size: 16px; margin-top: 2px; }
.cibody { color: #f3e6dc; font-size: 16px; line-height: 1.7; white-space: pre-line; background: rgba(255,255,255,.05); border-radius: 12px; padding: 12px; }
#cHist { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
#cHist .h { background: rgba(255,255,255,.06); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: #f0e2d6; line-height: 1.5; }
#cHist .h b { color: #ffd0e2; }
#myCandleBar { left: 50%; transform: translateX(-50%); bottom: calc(222px + var(--safe-b)); background: rgba(58,30,44,.9); border: 1px solid #f3cf9a; border-radius: 18px; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
#mcInfo { color: #ffe2c0; font-size: 14px; text-align: center; }
.mcBtns { display: flex; gap: 8px; }
.mcBtns button { min-height: 46px; padding: 0 16px; border-radius: 23px; font-weight: 700; background: rgba(255,255,255,.1); border: 1px solid rgba(255,220,200,.4); }
.mcBtns button.main { background: linear-gradient(180deg, #ffd3e2, #e98fb2); color: #4a1630; }
body.touch #myCandleBar { bottom: calc(230px + var(--safe-b)); width: calc(100% - 24px); }
#findArrow { left: 50%; top: calc(70px + var(--safe-t)); transform: translateX(-50%); background: rgba(58,30,44,.88); border: 1px solid #ffb3d1; color: #ffe2ee; border-radius: 22px; padding: 8px 18px; font-size: 16px; }
#prayHud { left: 50%; top: calc(70px + var(--safe-t)); transform: translateX(-50%); background: rgba(40,26,20,.85); border: 1px solid #f3cf9a; color: #ffe8c8; border-radius: 22px; padding: 6px 8px 6px 18px; font-size: 17px; display: flex; gap: 10px; align-items: center; }
#prayHud button { min-height: 40px; border-radius: 20px; padding: 0 14px; background: rgba(255,255,255,.12); }
#playerMenu { background: rgba(20,22,34,.92); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 150px; transform: translate(-50%, -110%); }
#playerMenu #pmName { color: var(--gold); font-weight: 700; text-align: center; font-size: 15px; }
#playerMenu button { min-height: 44px; border-radius: 12px; font-weight: 700; background: linear-gradient(180deg, #ffd3e2, #e98fb2); color: #4a1630; }
#playerMenu button.ghost { background: rgba(255,255,255,.08); color: var(--text); }
#reqPop { left: 50%; top: 44%; transform: translateX(-50%); width: min(360px, calc(100% - 32px)); background: rgba(58,30,44,.95); border: 1px solid #f3cf9a; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
#reqText { text-align: center; font-size: 17px; color: #ffe8f0; line-height: 1.5; }
#reqPop .row button { min-height: 48px; }

/* 성별 */
.gender-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gbtn { min-height: 120px; border-radius: 16px; background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.12); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 20px; font-weight: 700; }
.gbtn small { font-size: 13px; font-weight: 400; color: var(--muted); }
.gbtn .gicon { font-size: 34px; }
.gbtn.on { border-color: var(--gold); background: rgba(230,194,122,.16); color: #fff3cf; }
/* 선황나무 */
#treeBar { left: 50%; transform: translateX(-50%); bottom: calc(222px + var(--safe-b)); background: rgba(30,40,28,.9); border: 1px solid #d9c27a; border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.tbTitle { color: #f3e2a8; font-weight: 700; font-size: 15px; }
.tbBtns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tbBtns button { min-height: 46px; padding: 0 16px; border-radius: 23px; font-weight: 700; background: rgba(255,255,255,.1); border: 1px solid rgba(240,220,160,.45); }
.tbBtns button.main { background: linear-gradient(180deg, #f6dc9a, #c8963f); color: #3a2508; }
.tbBtns button:disabled { opacity: .45; }
body.touch #treeBar { bottom: calc(170px + var(--safe-b)); width: calc(100% - 24px); }
.ribbon-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ribbon-row button { min-height: 78px; border-radius: 12px; font-size: 15px; font-weight: 700; background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.12); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 6px; position: relative; }
.ribbon-row button::before { content: ''; position: absolute; top: 8px; left: 50%; width: 14px; height: 40px; margin-left: -7px; border-radius: 3px; background: var(--c); box-shadow: 0 0 8px rgba(0,0,0,.4); }
.ribbon-row button.on { border-color: var(--gold); background: rgba(230,194,122,.18); }

/* 돌 고르기 */
.stone-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stone-row button { min-height: 92px; border-radius: 14px; background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.12); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 17px; font-weight: 700; }
.stone-row button:hover { border-color: var(--gold); }
.st { display: block; background: radial-gradient(ellipse at 35% 30%, #c9c2b6, #7d766c 70%, #5d574f); box-shadow: 0 3px 6px rgba(0,0,0,.5); }
.st.thin { width: 64px; height: 12px; border-radius: 50%; }
.st.wide { width: 76px; height: 20px; border-radius: 45%; }
.st.long { width: 86px; height: 16px; border-radius: 40%; }
.st.small { width: 30px; height: 22px; border-radius: 50%; }
#incenseBar { left: 50%; transform: translateX(-50%); bottom: calc(222px + var(--safe-b)); background: rgba(40,26,20,.9); border: 1px solid #d9b27a; border-radius: 18px; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
body.touch #incenseBar { bottom: calc(170px + var(--safe-b)); left: auto; right: 12px; transform: none; }
/* 108배 염주 */
#beads { right: 16px; bottom: calc(300px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; touch-action: manipulation; }
#beadCanvas { width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(40,26,20,.72) 52%, rgba(40,26,20,0) 71%); transition: transform .35s cubic-bezier(.3,1.4,.5,1); }
#beads:active #beadCanvas { filter: brightness(1.15); }
.beadLabel { text-align: center; font-size: 13px; color: #ffe8c8; text-shadow: 0 1px 3px #000; background: rgba(20,14,10,.6); padding: 4px 10px; border-radius: 10px; }
.beadLabel small { color: #d8c4a8; }
body.touch #beads { bottom: calc(300px + var(--safe-b)); right: 10px; }
body.touch #beadCanvas { width: 140px; height: 140px; }
#beadCount { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 180px; height: 92px; display: flex; align-items: baseline; justify-content: center; gap: 4px; padding-top: 26px; box-sizing: border-box; pointer-events: none; font-family: 'Gowun Batang', serif; text-shadow: 0 2px 6px #000, 0 0 12px rgba(0,0,0,.6); }
#beadCount b { font-size: 30px; color: #ffe6b0; }
#beadCount span { font-size: 14px; color: #e8d2b0; font-family: 'Noto Sans KR', sans-serif; font-weight: 600; }
body.touch #beadCount { width: 140px; height: 74px; padding-top: 18px; }
body.touch #beadCount b { font-size: 24px; }

/* 신력 · 말걸기 · 굿 */
#money { display: flex; align-items: center; gap: 12px; }
#money .pw { padding-left: 12px; border-left: 1px solid var(--line); color: #e8dcff; white-space: nowrap; }
#money .mv { white-space: nowrap; }
#money.glow { animation: pglow 1s ease; }
@keyframes pglow { 0% { box-shadow: 0 0 0 rgba(200,170,255,0); } 30% { box-shadow: 0 0 22px rgba(200,170,255,.9); } 100% { box-shadow: 0 0 0 rgba(200,170,255,0); } }
#powerPops { left: 18px; top: calc(62px + var(--safe-t)); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.powerPop { color: #e6d6ff; font-weight: 700; font-size: 15px; text-shadow: 0 0 8px rgba(160,120,255,.9), 0 1px 3px #000; animation: pup 1.9s ease forwards; }
@keyframes pup { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; transform: translateY(0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
#btnIncBox { background: rgba(255,255,255,.1); }
#money .pw b { color: #c9b2ff; }
#npcBar button.talkBtn { background: linear-gradient(180deg, #d8ccff, #9d86e6); color: #24124a; }
.panel.talk { background: linear-gradient(180deg, rgba(36,26,52,.97), rgba(20,16,30,.97)); }
.talkLine { font-size: 16px; line-height: 1.6; color: #f3e8ff; background: rgba(255,255,255,.06); border-radius: 12px; padding: 12px; }
.talkAnswer { min-height: 76px; display: flex; align-items: center; justify-content: center; font-family: "Gowun Batang", serif; font-size: 36px; font-weight: 700; color: #fff2c8; text-shadow: 0 0 18px rgba(255,210,120,.8); border-radius: 14px; }
.talkAnswer.yes { background: radial-gradient(ellipse, rgba(120,200,140,.35), transparent 70%); }
.talkAnswer.no { background: radial-gradient(ellipse, rgba(230,100,110,.35), transparent 70%); }
.talkAnswer.pop { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
#gutBanner { left: 50%; top: calc(66px + var(--safe-t)); transform: translateX(-50%); background: linear-gradient(90deg, rgba(120,20,30,.9), rgba(60,20,40,.9)); border: 1px solid #f0c060; color: #fff0d0; border-radius: 22px; padding: 7px 16px; font-size: 15px; white-space: nowrap; box-shadow: 0 0 20px rgba(255,120,60,.4); }
#gutBanner .drum { display: inline-block; animation: drum .5s infinite alternate; }
@keyframes drum { from { transform: scale(1); } to { transform: scale(1.25); } }
#jakduBar { left: 50%; transform: translateX(-50%); bottom: calc(222px + var(--safe-b)); background: rgba(60,16,22,.92); border: 1px solid #f0c060; border-radius: 18px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.jkInfo { font-size: 13px; color: #ffe0c0; }
body.touch #jakduBar { bottom: calc(170px + var(--safe-b)); left: auto; right: 12px; transform: none; }

@media (max-width: 420px) {
  #topRight { gap: 5px; right: 8px; }
  .pill { padding: 0 9px; font-size: 14px; min-width: 44px; }
  #money { font-size: 14px; padding: 8px 10px; left: 8px; }
}
@media (max-width: 600px) {
  /* 모바일: 보유금 아래 줄에 신력 → 오른쪽 버튼에 가려지지 않음 */
  #money { flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 12px; font-size: 14px; line-height: 1.25; border-radius: 14px; }
  #money .pw { padding-left: 0; border-left: 0; font-size: 14px; }
  #powerPops { top: calc(70px + var(--safe-t)); }
  .cgrid { grid-template-columns: repeat(5, 1fr); }
  html, body { font-size: 16px; }
  #money { font-size: 16px; padding: 8px 12px; }
  .pill { padding: 0 12px; font-size: 15px; }
  .panel.tall { height: 100%; }
  #actionBar button, #standBar button { min-width: 64px; padding: 0 12px; font-size: 16px; }
}

/* 좁은 화면: 보유금·신력 상자를 오른쪽 버튼 줄 아래로 내려 절대 겹치지 않게 */
@media (max-width: 600px) {
  #money { top: calc(64px + var(--safe-t)); left: 8px; font-size: 15px; padding: 6px 12px; }
  #powerPops { top: calc(122px + var(--safe-t)); }
}

/* ───── 랭킹 ───── */
.rankPill { position: fixed; left: 14px; top: calc(66px + var(--safe-t)); min-height: 38px; padding: 0 14px; font-size: 15px; color: #ffe7a8; border-color: rgba(233,185,73,.55); background: linear-gradient(180deg, rgba(60,40,18,.88), rgba(28,20,12,.88)); }
#powerPops { top: calc(112px + var(--safe-t)); }
#afkBar { left: 50%; top: 24%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 16px;
  background: rgba(30,20,12,.9); border: 1px solid rgba(233,185,73,.6); box-shadow: 0 0 24px rgba(233,185,73,.35); max-width: calc(100vw - 32px); text-align: center; z-index: 30; }
#afkBar #afkText { color: #ffe6b0; font-size: 15px; }
#afkBar.paused { border-color: #c86a6a; }
#afkBtn { min-height: 46px; padding: 0 22px; font-size: 17px; border-radius: 23px; animation: afkPulse 1.2s ease-in-out infinite; }
@keyframes afkPulse { 50% { box-shadow: 0 0 18px rgba(255,214,120,.9); } }
.panel.rank { width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 760px); display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(34,22,14,.97), rgba(18,12,10,.97)); border-color: rgba(233,185,73,.5); }
.rtabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.rtabs .tab { flex: 1 0 auto; padding: 8px 10px; font-size: 14px; white-space: nowrap; }
.rkHead { margin: 10px 2px 6px; color: #ffe2a0; font-size: 14px; line-height: 1.5; word-break: keep-all; }
.rkHead b { color: #ffd36b; }
.rkList { flex: 1; overflow-y: auto; min-height: 120px; }
.rkRow { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 1px solid rgba(233,185,73,.15); font-size: 15px; }
.rkRow .no { color: #e9b949; font-weight: 700; text-align: center; }
.rkRow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff3da; }
.rkRow .vl { color: #ffd98a; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.rkRow .vl small { color: #c8b48a; margin-left: 4px; }
.rkRow.top1 .no { color: #ffd700; } .rkRow.me { background: rgba(120,90,200,.18); border-radius: 8px; }
.rkEmpty { padding: 24px 8px; text-align: center; color: #b8a888; }
.rkMine { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(233,185,73,.14); border: 1px solid rgba(233,185,73,.4); color: #ffecc0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hofSec { margin: 10px 0 4px; color: #e9b949; font-weight: 700; font-size: 14px; }
.hofDay { padding: 6px 4px 8px; border-bottom: 1px dashed rgba(233,185,73,.2); font-size: 14px; color: #f3e6c8; line-height: 1.6; }
.hofDay .k { color: #c8b48a; margin-right: 6px; }
.hofDay .c { color: #e9b949; margin-right: 4px; }
.cm .thx { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 12px; font-size: 13px; background: #f3d17a; color: #3a2408; border: 0; vertical-align: middle; }
.cm .thx[disabled] { background: #6a5a3a; color: #e8d8b0; }
@media (max-width: 600px) {
  .rankPill { top: calc(120px + var(--safe-t)); left: 8px; min-height: 36px; font-size: 14px; }
  #powerPops { top: calc(162px + var(--safe-t)); }
  .rkRow { font-size: 14px; grid-template-columns: 32px minmax(0, 1fr) auto; }
  .rtabs .tab { font-size: 13px; padding: 7px 8px; }
}

.rtabs, .rkHead, .rkMine, .panel.rank .ph { flex-shrink: 0; }
.rkList { min-height: 0; }

@media (max-width: 600px) { .rtabs { flex-wrap: wrap; overflow: visible; } .rtabs .tab { flex: 1 0 30%; } }


/* 접속 안내 (작게, 위 가운데) */
#visitPops { left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; z-index: 9; width: max-content; max-width: calc(100vw - 24px); }
.visitPop { padding: 4px 12px; border-radius: 14px; background: rgba(40,22,30,.72); border: 1px solid rgba(255,190,215,.35); color: #ffe9f1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100vw - 24px); animation: vin .4s ease; transition: opacity .8s; }
.visitPop b { color: #ffd1e3; }
.visitPop.out { opacity: 0; }
@keyframes vin { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 600px) { #visitPops { top: calc(172px + var(--safe-t)); left: auto; right: 8px; transform: none; align-items: flex-end; } .visitPop { font-size: 12px; } }

/* ───── 무당 NPC 점사 ───── */
#csJoinBar { right: 12px; bottom: calc(150px + var(--safe-b, 0px)); }
#csQueueBar { left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 20px; background: rgba(40,20,50,.9); border: 1px solid rgba(190,150,255,.6); color: #f0e6ff; font-size: 14px; z-index: 12; }
#csQueueBar button { min-height: 32px; padding: 0 10px; font-size: 13px; }
.panel.cs { width: min(560px, calc(100vw - 20px)); max-height: min(92vh, 900px); display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(40,22,34,.98), rgba(20,12,18,.98)); border-color: rgba(233,185,73,.5); }
#csBody { overflow-y: auto; flex: 1; min-height: 0; padding-right: 2px; }
.csTimer { margin-left: auto; margin-right: 8px; color: #ffcf7a; font-size: 14px; font-variant-numeric: tabular-nums; }
.csNote { font-size: 13px; color: #e9dcc0; background: rgba(233,185,73,.12); border-radius: 10px; padding: 7px 10px; margin-bottom: 8px; line-height: 1.5; word-break: keep-all; }
.csNote.dim { background: rgba(140,120,200,.15); color: #ddd2ff; }
.csL { display: block; margin: 10px 0 5px; font-size: 14px; color: #ffe2a8; font-weight: 700; }
.csL small { color: #b9a98c; font-weight: 400; margin-left: 4px; }
#csForm input:not([type=checkbox]), #csForm select, #csForm textarea { width: 100%; box-sizing: border-box; min-height: 42px; font-size: 16px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; min-height: 42px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #f3e6c8; font-size: 15px; }
.seg button.on { background: linear-gradient(180deg, #f3d17a, #c99633); color: #2a1606; border-color: #f3d17a; font-weight: 700; }
#csChoices { display: grid; gap: 6px; margin-top: 6px; }
.small { min-height: 34px !important; font-size: 13px !important; padding: 0 10px; }
#csErr { min-height: 20px; margin-top: 6px; }
#csNext.dis { opacity: .55; }
.csSpin { width: 64px; height: 64px; margin: 26px auto 12px; border-radius: 50%; border: 5px solid rgba(233,185,73,.25); border-top-color: #f3d17a; animation: csSpin 1.1s linear infinite; }
@keyframes csSpin { to { transform: rotate(360deg); } }
#csWaitTxt { text-align: center; color: #ffe2a8; font-size: 17px; }
.csSaju { text-align: center; color: #c8b48a; font-size: 13px; margin: 8px 0 20px; word-break: keep-all; }
.card { position: relative; border-radius: 18px; padding: 16px 16px 12px; border: 3px solid var(--c, #e9b949); background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.08), transparent 60%), linear-gradient(180deg, rgba(30,18,26,.98), rgba(16,10,14,.98)); box-shadow: 0 0 26px color-mix(in srgb, var(--c) 45%, transparent); color: #f6ead2; word-break: keep-all; overflow-wrap: anywhere; }
.card .hd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 1px solid color-mix(in srgb, var(--c) 50%, transparent); padding-bottom: 8px; margin-bottom: 10px; }
.card .nm { font-family: "Gowun Batang", serif; font-size: 20px; font-weight: 700; color: var(--c); }
.card .dt { font-size: 12px; color: #c8b48a; white-space: nowrap; }
.card .gr { font-size: 15px; margin-bottom: 8px; color: #ffe9c4; }
.card .ch { margin: 6px 0 10px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--c) 22%, transparent); font-weight: 700; }
.card .rd { font-size: 15.5px; line-height: 1.75; white-space: pre-wrap; }
.card .ad, .card .lk { margin-top: 10px; font-size: 14.5px; line-height: 1.6; }
.card .ad b, .card .lk b { color: var(--c); margin-right: 6px; }
.card .cl { margin-top: 10px; font-size: 14.5px; color: #ffe9c4; }
.card .dis { margin-top: 12px; padding-top: 8px; border-top: 1px dashed rgba(255,255,255,.2); font-size: 12px; color: #b8a888; line-height: 1.5; }
.card .basic { display: inline-block; margin-top: 6px; font-size: 11.5px; color: #ddd2ff; background: rgba(140,120,200,.2); border-radius: 8px; padding: 2px 8px; }
.cardBtns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.cardBtns button { min-height: 44px; font-size: 14px; padding: 0 4px; }
.csCrisis { text-align: center; padding: 14px 6px; line-height: 1.7; color: #ffeede; word-break: keep-all; }
.csCrisis .help { margin: 14px auto; padding: 14px; border-radius: 14px; background: rgba(255,120,120,.14); border: 1px solid rgba(255,160,160,.5); font-size: 20px; font-weight: 700; color: #fff; }
#chatLog .m.share { color: #ffe3f0; }
#chatLog .m.share b { color: #ffb6d5; }
@media (max-width: 600px) { .cardBtns { grid-template-columns: repeat(2, 1fr); } .card .nm { font-size: 18px; } #csJoinBar { bottom: 170px; } #csQueueBar { top: calc(206px + var(--safe-t)); } }
#csJoinBar { right: auto; left: 50%; transform: translateX(-50%); bottom: calc(222px + var(--safe-b)); background: rgba(46,20,52,.92); border: 1px solid #c9a0ff; border-radius: 18px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; align-items: center; max-width: calc(100vw - 24px); }
body.touch #csJoinBar { bottom: calc(170px + var(--safe-b)); left: auto; right: 12px; transform: none; }
#csJoinInfo { font-size: 13px; color: #eadcff; text-align: center; word-break: keep-all; }
.cardBtns [data-cb=share] { background: linear-gradient(180deg, #d8ccff, #9d86e6); color: #24124a; border: 0; font-weight: 700; }

.panel.cs .ph { gap: 8px; align-items: flex-start; } .panel.cs .ph #csTitle { flex: 1; min-width: 0; word-break: keep-all; } .csTimer { white-space: nowrap; margin-left: 0; }

#bokHint { left: 50%; transform: translateX(-50%); top: calc(64px + var(--safe-t)); padding: 7px 14px; border-radius: 16px; background: rgba(60,40,10,.92); border: 1px solid #f3cf6e; color: #ffe9b0; font-size: 14px; z-index: 13; animation: afkPulse 1.6s ease-in-out infinite; max-width: calc(100vw - 24px); text-align: center; }
@media (max-width: 600px) { #bokHint { top: calc(250px + var(--safe-t)); font-size: 13px; } }
.seg[data-seg=mode] button { font-size: 14px; }
.card .cp { margin: 6px 0 10px; padding: 8px 10px; border-radius: 10px; background: linear-gradient(90deg, rgba(255,120,170,.25), rgba(255,200,120,.2)); font-weight: 700; color: #ffe6f0; }
#cGrid.vip { grid-template-columns: repeat(10, 1fr); } #cGrid.vip button { border-color: rgba(243,207,110,.7); }
@media (max-width: 600px) { #cGrid.vip { grid-template-columns: repeat(5, 1fr); } }


/* ───── 로그인 버튼 (보유금 창 바로 위) · 위치 재배치 ───── */
.loginPill { position: fixed; left: 14px; top: calc(12px + var(--safe-t)); min-height: 36px; padding: 0 14px; font-size: 15px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dfe9ff; border-color: rgba(160,190,255,.55); }
.loginPill.on { color: #ffe7a8; border-color: rgba(233,185,73,.6); }
#money { top: calc(56px + var(--safe-t)); }
.rankPill { top: calc(108px + var(--safe-t)); }
#powerPops { top: calc(154px + var(--safe-t)); }
@media (max-width: 600px) {
  .loginPill { left: 8px; top: calc(62px + var(--safe-t)); min-height: 34px; font-size: 14px; padding: 0 12px; }
  #money { top: calc(102px + var(--safe-t)); }
  .rankPill { top: calc(160px + var(--safe-t)); }
  #powerPops { top: calc(202px + var(--safe-t)); }
  #visitPops { top: calc(210px + var(--safe-t)); }
  #bokHint { top: calc(260px + var(--safe-t)); }
}
@media (max-width: 420px) { #topRight .pill { padding: 0 8px; font-size: 13px; } }

/* ───── 로그인 창 ───── */
.panel.auth { width: min(420px, 100%); }
.auView { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.auView label { display: flex; flex-direction: column; gap: 5px; font-size: 15px; color: #f3e6c8; }
.auView label small { color: #b8a888; font-size: 13px; }
.auView input:not([type=checkbox]) { width: 100%; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.07); color: #fff; font-size: 16px; }
.auView input:focus { outline: none; border-color: var(--gold); }
.pwBox { display: flex; gap: 6px; align-items: stretch; }
.pwBox input { flex: 1; min-width: 0; }
.pwBox .eye, .pwBox .chkBtn { flex: 0 0 auto; min-width: 46px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid var(--line); font-size: 16px; color: #f3e6c8; }
.pwBox .eye.on { background: rgba(233,185,73,.25); }
.pwBox .chkBtn { padding: 0 10px; font-size: 14px; white-space: nowrap; }
.auView .chk { flex-direction: row; align-items: center; gap: 8px; font-size: 15px; }
.auView .chk input { width: 20px; height: 20px; accent-color: #d9a94a; }
.auView .note { font-size: 14px; line-height: 1.5; color: #e8dcc0; word-break: keep-all; }
.auView .note.gold { color: #ffd98a; } .auView .note.bad { color: #ff9b8a; }
.auView .note.warn { color: #ffb4a4; background: rgba(160,40,30,.2); border: 1px solid rgba(255,120,100,.4); padding: 10px 12px; border-radius: 12px; }
.hintQ { padding: 10px 12px; border-radius: 12px; background: rgba(233,185,73,.12); border: 1px solid rgba(233,185,73,.35); color: #ffe6a8; font-size: 15px; }
.err.ok { color: #9fe0a8; }
.auView .row.sub { gap: 6px; }
.auView .row.sub > button { flex: 1 1 auto; padding: 0 8px; white-space: nowrap; min-height: 44px; font-size: 14px; font-weight: 500; background: rgba(255,255,255,.07); border: 1px solid var(--line); color: #f3e6c8; }
.auView .row.col { flex-direction: column; }
button.danger { background: linear-gradient(180deg, #d8705f, #a0372a); color: #fff; }

/* ───── 캐릭터 수정 ───── */
.panel.edit { width: min(560px, 100%); display: flex; flex-direction: column; gap: 8px; }
.edView { position: relative; height: min(38vh, 300px); min-height: 180px; border-radius: 14px; background: radial-gradient(ellipse at 50% 40%, rgba(255,230,190,.18), rgba(10,10,20,.4)); border: 1px solid rgba(233,185,73,.3); }
#edCanvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.edTip { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 12px; color: #c8b48a; pointer-events: none; }
.edTabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.edTabs .tab { flex: 1 0 auto; min-height: 40px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.tab.on { background: rgba(233,185,73,.22); border-color: rgba(233,185,73,.6); color: #ffe6a8; }
.edBody { min-height: 120px; max-height: 26vh; overflow-y: auto; }
.edSub { margin: 8px 2px 4px; font-size: 13px; color: #c8b48a; word-break: keep-all; }
.edRow { display: flex; flex-wrap: wrap; gap: 6px; }
.edRow .chip { min-height: 38px; padding: 0 12px; border-radius: 19px; background: rgba(255,255,255,.07); border: 1px solid var(--line); color: #f3e6c8; font-size: 14px; white-space: nowrap; }
.edRow .chip.on { background: rgba(233,185,73,.3); border-color: #e9b949; color: #fff3d0; font-weight: 700; }
.edRow .sw { width: 38px; height: 38px; border-radius: 19px; border: 2px solid rgba(255,255,255,.25); }
.edRow .sw.on { border: 3px solid #ffd36b; box-shadow: 0 0 0 2px rgba(0,0,0,.5) inset; }
.swl { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 46px; }
.swl small { font-size: 11px; color: #c8b48a; }
.panel.edit .row > button { min-height: 46px; font-size: 16px; }
.panel.edit .note { min-height: 0; font-size: 13px; color: #ffd98a; text-align: center; }
@media (max-width: 600px) { .edView { height: 32vh; } .edBody { max-height: 24vh; } .panel.edit { padding: 12px; } }

/* ───── 경제: 상점 · 우편함 · 보유금 표시 ───── */
#econBar { left: 14px; top: calc(56px + var(--safe-t)); display: flex; gap: 6px; align-items: center; transform: translateX(calc(var(--moneyW, 230px) + 8px)); }
.shopPill, .emotePill { min-height: 38px; padding: 0 14px; font-size: 15px; color: #ffe7a8; border-color: rgba(233,185,73,.55); }
.emotePill { padding: 0 10px; }
#talismanChip, #offerChip { padding: 6px 10px; border-radius: 16px; background: rgba(60,40,10,.85); border: 1px solid rgba(233,185,73,.5); color: #ffe6a8; font-size: 13px; white-space: nowrap; }
#moneyPops { left: 18px; top: calc(100px + var(--safe-t)); pointer-events: none; display: flex; flex-direction: column; gap: 2px; z-index: 12; }
.moneyPop { font-weight: 700; font-size: 17px; text-shadow: 0 1px 3px #000; animation: mpop 1.9s ease forwards; }
.moneyPop.up { color: #ffd86b; } .moneyPop.down { color: #ff9b8a; }
@keyframes mpop { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; transform: translateY(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.mailPill { position: fixed; right: 12px; top: calc(64px + var(--safe-t)); min-width: 44px; min-height: 40px; padding: 0 10px; font-size: 18px; }
.mailPill .dot, .adminPill .dot { position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; border-radius: 5px; background: #ff4a3a; box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.adminPill { position: fixed; right: 64px; top: calc(64px + var(--safe-t)); min-width: 44px; min-height: 40px; padding: 0 10px; font-size: 18px; background: linear-gradient(180deg, rgba(40,30,90,.92), rgba(20,16,50,.92)); border-color: #9a8cff; z-index: 11; }
.adminPill .dot.cnt { width: auto; height: auto; min-width: 18px; padding: 0 4px; font-size: 11px; font-style: normal; line-height: 18px; border-radius: 9px; color: #fff; top: -4px; right: -4px; }
#emoteMenu { left: 14px; top: calc(102px + var(--safe-t)); display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; background: var(--bg-strong); border: 1px solid var(--line); z-index: 20; }
#emoteMenu button { min-height: 40px; padding: 0 14px; border-radius: 12px; background: rgba(255,255,255,.08); color: #f3e6c8; border: 1px solid var(--line); white-space: nowrap; }
@media (max-width: 600px) {
  #econBar { left: 8px; top: calc(160px + var(--safe-t)); transform: translateX(78px); }
  .shopPill, .emotePill { min-height: 36px; font-size: 14px; }
  #moneyPops { top: calc(140px + var(--safe-t)); left: 160px; }
  .mailPill { top: calc(62px + var(--safe-t)); right: 8px; min-height: 36px; }
  .adminPill { top: calc(62px + var(--safe-t)); right: 60px; min-height: 36px; }
  #emoteMenu { top: calc(204px + var(--safe-t)); left: 8px; }
}
.panel.shop, .panel.mail, .panel.report { width: min(520px, 100%); display: flex; flex-direction: column; gap: 8px; }
.shopCounts { font-size: 13px; color: #ffe2a0; line-height: 1.5; word-break: keep-all; }
.shopTabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.shopTabs .tab { flex: 1 0 auto; min-height: 40px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.shopBody { overflow-y: auto; max-height: 56vh; display: flex; flex-direction: column; gap: 6px; }
.shopBody input { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.07); color: #fff; font-size: 16px; }
.sItem { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(233,185,73,.2); }
.sItem.col { flex-direction: column; align-items: stretch; }
.sItem .sName { flex: 1; color: #f3e6c8; font-size: 15px; word-break: keep-all; }
.sItem .sPrice { color: #ffd98a; white-space: nowrap; font-size: 14px; }
.sItem .sEff { color: #c8b48a; font-size: 13px; word-break: keep-all; }
.sItem button { min-height: 38px; padding: 0 14px; border-radius: 10px; white-space: nowrap; }
.sItem .sw { display: inline-block; width: 22px; height: 22px; border-radius: 11px; border: 1px solid rgba(255,255,255,.3); }
.own { color: #9fe0a8; }
.row.wrap { flex-wrap: wrap; } .row.wrap .chip { flex: 0 0 auto; min-height: 38px; padding: 0 12px; border-radius: 19px; background: rgba(255,255,255,.07); border: 1px solid var(--line); color: #f3e6c8; font-size: 14px; }
.row.wrap .chip.on { background: rgba(233,185,73,.3); border-color: #e9b949; }
.muted { color: #b8a888; } .small { font-size: 13px; }
.mailList { overflow-y: auto; max-height: 52vh; display: flex; flex-direction: column; gap: 6px; }
.mItem { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(233,185,73,.25); }
.mItem > div { flex: 1; } .mItem.done { opacity: .6; } .mTitle { color: #ffe6a8; font-size: 15px; word-break: keep-all; }
.mItem button { min-height: 38px; padding: 0 14px; border-radius: 10px; }
.edRow .sw { position: relative; } .edRow .sw.locked i { position: absolute; right: -4px; bottom: -4px; font-size: 12px; font-style: normal; }
.chip small { font-size: 11px; color: #ffd98a; }
.cf-text, #cfText { white-space: pre-line; }
.paidHide { display: none !important; }
/* 신령님의 복주머니 */
#blessPop { left: 50%; top: 24%; transform: translateX(-50%); z-index: 35; text-align: center; padding: 14px 20px; border-radius: 18px; background: rgba(60,30,10,.92); border: 2px solid #f3cf6e; box-shadow: 0 0 30px rgba(255,200,80,.6); color: #ffe9b0; cursor: pointer; max-width: calc(100vw - 32px); }
#blessPop .pouch { font-size: 54px; } #blessPop .bt { font-weight: 700; font-size: 16px; word-break: keep-all; }
#blessPop.drop { animation: bdrop 1.2s cubic-bezier(.3,1.4,.5,1); }
@keyframes bdrop { 0% { transform: translate(-50%, -240px); opacity: 0; } 100% { transform: translate(-50%, 0); opacity: 1; } }
/* 미니게임 */
#mgBox { position: fixed; inset: 0; z-index: 45; background: rgba(8,6,12,.92); display: flex; flex-direction: column; padding: calc(10px + var(--safe-t)) 12px calc(12px + var(--safe-b)); gap: 8px; }
#mgBox .mgTop { display: flex; align-items: center; gap: 10px; color: #ffe6a8; font-size: 17px; }
#mgBox .mgTop b { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } #mgBox .mgTop button { min-height: 40px; padding: 0 12px; border-radius: 12px; }
#mgCanvas { flex: 1; width: 100%; min-height: 0; border-radius: 14px; touch-action: none; background: #222; }
#mgTip { color: #e8dcc0; font-size: 14px; text-align: center; word-break: keep-all; }
.mrBody { font-size: 17px; color: #ffe6a8; line-height: 1.7; text-align: center; margin: 12px 0; word-break: keep-all; }
.rhythmPill { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(230px + var(--safe-b)); z-index: 14; color: #ffe7a8; border-color: #f3cf6e; background: rgba(80,30,20,.9); min-height: 46px; }
/* 신고 */
#chatForm { display: flex; gap: 6px; align-items: stretch; }
#chatForm #chatInput { flex: 1; min-width: 0; }
#btnQuickReport { flex: 0 0 44px; width: 44px; min-height: 44px; border-radius: 22px; background: rgba(160,40,30,.85); border: 1px solid #ff9b8a; font-size: 18px; padding: 0; }
.reportBtn { min-height: 34px; padding: 0 10px; border-radius: 10px; background: rgba(160,40,30,.7); color: #fff; font-size: 13px; border: 0; white-space: nowrap; }
#dlgConsult .ph { gap: 8px; } #dlgConsult .ph span { flex: 1; min-width: 0; }
.rpList { overflow-y: auto; max-height: 52vh; display: flex; flex-direction: column; gap: 6px; }
.rpItem { text-align: left; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(233,185,73,.2); color: #f3e6c8; font-size: 14px; word-break: break-all; }
.rpItem.on { border-color: #ff8a7a; background: rgba(200,60,50,.25); } .rpItem small { color: #b8a888; }
.rReasons { display: flex; flex-direction: column; gap: 6px; color: #f3e6c8; }
.rReasons label { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 15px; }
#rDetail { min-height: 70px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.07); color: #fff; padding: 8px 10px; font-size: 15px; resize: none; }
.rTarget { color: #ffd98a; font-size: 14px; }
#chatRepMenu { z-index: 50; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; background: var(--bg-strong); border: 1px solid var(--line); }
#chatRepMenu button { min-height: 40px; padding: 0 12px; border-radius: 10px; background: rgba(160,40,30,.8); color: #fff; border: 0; white-space: nowrap; }
#chatRepMenu button.ghost { background: rgba(255,255,255,.08); color: #f3e6c8; }
#pcBar { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: rgba(40,80,120,.35); border: 1px solid #6fc0ff; color: #dff1ff; font-size: 14px; font-weight: 700; text-align: center; word-break: keep-all; }
.panel.adminPanel { width: min(1000px, 100%); height: min(90vh, 900px); display: flex; flex-direction: column; gap: 8px; }
#admFrame { flex: 1; width: 100%; border: 0; border-radius: 12px; background: #16121c; }
#admPin input { width: 100%; min-height: 46px; font-size: 22px; letter-spacing: 6px; text-align: center; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.07); color: #fff; }
.ld-note { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; text-align: center; font-size: 12px; color: #a89a80; padding: 0 16px; word-break: keep-all; }
@media (min-width: 601px) { #visitPops { top: calc(112px + var(--safe-t)); } }
.rReasons label { justify-content: flex-start; text-align: left; } .rReasons input[type=radio] { width: 22px !important; height: 22px !important; min-height: 0 !important; flex: 0 0 22px; margin: 0; padding: 0; accent-color: #e05a48; }
.shopBody > *, .mailList > *, .rpList > * { flex-shrink: 0; } .shopBody .note { line-height: 1.5; word-break: keep-all; }
#toast { z-index: 90; }

/* 모바일 채팅 입력: 키보드 위로 올리기 (body.chatting = 입력 중) */
#chatBox { position: relative; flex: 1; min-width: 0; display: flex; }
#chatBox #chatInput { flex: 1; min-width: 0; }
#chatCount { display: none; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: rgba(255,255,255,.6); pointer-events: none; }
#chatCount.over { color: #ff9b8a; }
#chatSend { display: none; flex: 0 0 auto; min-height: 44px; padding: 0 14px; border-radius: 22px; background: var(--gold); color: #2a1d08; font-size: 16px; font-weight: 700; }
body.touch #chatCount { display: block; }
body.touch #chatBox #chatInput { padding-right: 52px; }
body.touch #chatInput { font-size: 16px; }
body.chatting #chatSend { display: block; }
body.chatting #chat { left: 8px; right: 8px; width: auto; max-width: none; transform: none; z-index: 38; transition: none; }
body.chatting #chatLog { height: var(--chatLogMax, 108px); background: rgba(10, 12, 20, .72); -webkit-mask-image: none; mask-image: none; padding: 6px 10px; margin-bottom: 6px; }
body.chatting #chatLog.none { display: none; }
body.chatting #chatInput { background: rgba(8, 10, 18, .94); color: #fff; border-color: var(--gold); -webkit-text-fill-color: #fff; caret-color: var(--gold); }
body.chatting #chatNew { display: none; }
body.chatting #joy, body.chatting #npcBar, body.chatting #actionBar, body.chatting #standBar, body.chatting #btnInteract,
body.chatting #emoteMenu, body.chatting #btnEmote, body.chatting #bowCounter, body.chatting .rhythmPill { visibility: hidden !important; pointer-events: none !important; }
/* visualViewport를 지원하지 않는 브라우저: 입력 중에는 화면 위쪽(상단 버튼 아래)에 띄움 */
body.chatting.chatTop #chat { top: calc(64px + var(--safe-t)); bottom: auto !important; display: flex; flex-direction: column-reverse; }

/* ───── 왼쪽 상단 묶음 (보유금 → 랭킹 → 로그인 → 우편함 → 관리자) ─────
   예전 규칙(화면마다 top 값을 따로 주던 것)은 묶음 안에서는 모두 무시하고, 세로 한 줄로 정렬 */
#hud-top-left { left: calc(12px + env(safe-area-inset-left, 0px)); top: calc(12px + var(--safe-t)); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; z-index: 11; pointer-events: none; }
#hud-top-left > * { pointer-events: auto; }
#hud-top-left #moneyRow { display: flex; align-items: stretch; gap: 8px; }
#hud-top-left #money { position: relative; left: auto; top: auto; display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 6px 12px; min-height: 44px;
  border-radius: 14px; background: rgba(18, 22, 44, .78); border: 1px solid rgba(230, 194, 122, .6); font-size: 15px; line-height: 1.25; }
#hud-top-left #money .mvw { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
#hud-top-left #money .mv, #hud-top-left #money .pw { white-space: nowrap; }
#hud-top-left #money .pw { padding-left: 0; border-left: 0; font-size: 14px; }
#hud-top-left #talismanChip, #hud-top-left #offerChip { padding: 2px 7px; border-radius: 10px; font-size: 12px; line-height: 1.3; display: inline-flex; flex-direction: column; align-items: center; }
#hud-top-left #talismanChip b, #hud-top-left #offerChip b { font-weight: 600; font-size: 11px; }
#hud-top-left #econBar { position: static; transform: none; display: flex; gap: 8px; align-items: stretch; }
#hud-top-left .shopPill, #hud-top-left .emotePill { position: static; min-height: 44px; height: auto; padding: 0 12px; border-radius: 14px; font-size: 15px;
  background: rgba(18, 22, 44, .78); border: 1px solid rgba(230, 194, 122, .6); color: #ffe7a8; }
#hud-top-left #stackBtns { display: inline-flex; flex-direction: column; align-items: stretch; gap: 8px; }
#hud-top-left .stackBtn { position: relative; left: auto; right: auto; top: auto; z-index: auto; min-width: 44px; min-height: 44px; height: 44px; padding: 0 14px; border-radius: 14px;
  background: rgba(18, 22, 44, .78); border: 1px solid rgba(230, 194, 122, .6); color: #ffe7a8; font-size: 15px; font-weight: 500; text-align: left; white-space: nowrap; }
#hud-top-left .stackBtn:hover { border-color: var(--gold); }
#hud-top-left .loginPill { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
#hud-top-left .loginPill.on { color: #ffe7a8; }
#hud-top-left .stackBtn .dot { position: absolute; top: -6px; right: -6px; }
#hud-top-left .stackBtn .dot.cnt { width: auto; height: auto; min-width: 18px; padding: 0 5px; font-size: 11px; font-style: normal; font-weight: 700; line-height: 18px; border-radius: 9px; color: #fff; background: #ff4a3a; box-shadow: 0 0 0 2px rgba(0,0,0,.45); text-align: center; }
#hud-top-left #powerPops { position: absolute; left: 0; top: calc(100% + 4px); }
#hud-top-left #moneyPops { position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); z-index: 12; }
/* 좁은 휴대폰: 오른쪽 버튼 줄과 겹치지 않게 보유금 창 글자·여백을 줄임 */
@media (max-width: 420px) {
  #hud-top-left { left: calc(8px + env(safe-area-inset-left, 0px)); }
  #hud-top-left #money { font-size: 13px; padding: 4px 9px; gap: 6px; }
  #hud-top-left #money .pw { font-size: 12px; }
  #hud-top-left .shopPill, #hud-top-left .emotePill { font-size: 13px; padding: 0 9px; }
  #hud-top-left .stackBtn { font-size: 14px; padding: 0 12px; }
}
/* 채팅 입력 중(키보드)에는 왼쪽 묶음을 건드리지 않음: 채팅창이 위에 올라와도 묶음은 제자리 */
body.chatting #hud-top-left { z-index: 9; }
#hud-top-left.shopDown #econBar { position: absolute; }
#hud-top-left.shopDown #econBar .shopPill, #hud-top-left.shopDown #econBar .emotePill { height: 44px; }
#hud-top-left #money .mvw { align-items: stretch; }
#hud-top-left #money .pwRow { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#hud-top-left #money .chips { display: inline-flex; gap: 4px; }
#hud-top-left #talismanChip, #hud-top-left #offerChip { flex-direction: row; gap: 2px; padding: 0 5px; border-radius: 8px; font-size: 11px; line-height: 16px; }
#hud-top-left #talismanChip.hidden, #hud-top-left #offerChip.hidden { display: none; }
#hud-top-left #econBar #offerChip { align-self: center; padding: 4px 8px; border-radius: 12px; font-size: 12px; line-height: 16px; }
/* 높이가 낮은 가로 화면: 세로로 쌓으면 조이스틱과 겹침 → 같은 순서로 보유금 아래 가로 한 줄 */
@media (orientation: landscape) and (max-height: 500px) {
  #hud-top-left #stackBtns { flex-direction: row; }
  #hud-top-left #money { font-size: 14px; padding: 4px 10px; }
  #hud-top-left #money .pw { font-size: 13px; }
}
@media (orientation: landscape) and (max-height: 500px) { #hud-top-left #stackBtns { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; } }
body.chatting.chatCover #hud-top-left { visibility: hidden; }
/* 잠깐 뜨는 가운데 안내(108배 횟수·합장·복전함·상담 대기열)는 왼쪽 묶음보다 앞에 보이게 */
#bowCounter, #afkBar, #bokHint, #csQueueBar { z-index: 12; }
/* 미니게임: 가장 위(확인 창·안내 토스트 바로 아래)에 그리고, 판 위에서는 스크롤·확대 없이 손가락 입력만 */
#mgBox { z-index: 65; touch-action: none; }
#mgCanvas { touch-action: none; -webkit-user-select: none; user-select: none; }
#mgBox .mgTop #mgQuit { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 22px; font-size: 20px; line-height: 1; color: #ffe6a8; background: rgba(255,255,255,.08); border: 1px solid rgba(230,194,122,.6); }
#mgBox .mgTop #mgInfo { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.moneyPop { white-space: nowrap; }

/* ───── 왼쪽 상단 HUD (2차) ─────
   PC: 글자 버튼 그대로 (.lbl). 휴대폰: 아이콘만 (.ico) — 1줄 보유금 / 2줄 🏆 🛍️ / 3줄 로그인 ✉️ */
#hud-top-left .ico { display: none; }
#hud-top-left .hudRow { display: none; }
@media (max-width: 600px), (hover: none) and (pointer: coarse) {
  #hud-top-left, #hud-top-left.hudMobile { top: calc(env(safe-area-inset-top, 0px) + 8px); left: calc(env(safe-area-inset-left, 0px) + 12px); max-width: 45vw; gap: 8px; }
  #hud-top-left #moneyRow, #hud-top-left #stackBtns { display: none; }
  #hud-top-left .hudRow { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; max-width: 45vw; }
  #hud-top-left .hudRow:empty { display: none; }
  #hud-top-left .ico { display: inline; font-size: 22px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
  #hud-top-left .lbl { display: none; }
  /* 보유금 패널: 내용에 맞는 폭, 글자 15px */
  #hud-top-left #money { width: max-content; max-width: 45vw; padding: 8px 12px; font-size: 15px; min-height: 0; gap: 6px; }
  #hud-top-left #money .pw { font-size: 15px; }
  /* 🏆 🛍️ ✉️ (🙆 🔒): 같은 원형 44px */
  #hud-top-left #btnRank, #hud-top-left #btnShop, #hud-top-left #btnMail, #hud-top-left #btnEmote, #hud-top-left #btnAdminMail {
    position: relative; flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1;
    background: rgba(18, 22, 44, .78); border: 1.5px solid rgba(230, 194, 122, .7); color: #ffe7a8; }
  /* 로그인: 높이 44px, 글자 15px, 좌우 16px, 줄바꿈 없음 */
  #hud-top-left #btnLogin { flex: 0 1 auto; height: 44px; min-height: 44px; padding: 0 16px; font-size: 15px; white-space: nowrap; border-radius: 22px;
    max-width: calc(45vw - 52px); overflow: hidden; text-overflow: ellipsis; background: rgba(18, 22, 44, .78); border: 1.5px solid rgba(230, 194, 122, .7); text-align: center; }
  /* 우편함 새 우편: 오른쪽 위 빨간 점 8px */
  #hud-top-left #btnMail .dot, #hud-top-left #btnMail .dot.cnt { top: 1px; right: 1px; width: 8px; height: 8px; min-width: 0; padding: 0; font-size: 0; line-height: 0; border-radius: 50%; }
  #hud-top-left #btnAdminMail .dot.cnt { top: -4px; right: -4px; }
  #hud-top-left #offerChip { align-self: center; padding: 4px 8px; border-radius: 12px; font-size: 12px; white-space: nowrap; }
  /* 돈 증가 표시: 보유금 패널 오른쪽 옆 */
  #hud-top-left #moneyPops { left: calc(100% + 8px); top: 50%; transform: translateY(-50%); }
}
@media (max-width: 400px) { #hud-top-left #money { font-size: 14px; padding: 7px 10px; } #hud-top-left #money .pw { font-size: 14px; } }
/* 상담자 주의사항: 어두운 남색 + 금색 테두리, 모바일에서 스크롤 없이, 글자 15px 이상 */
#dlgCWarn .panel.cwarn { background: rgba(16, 20, 42, .97); border: 2px solid #e6c27a; border-radius: 18px; padding: 16px 18px; max-width: 440px; width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; font-size: 15px; line-height: 1.55; color: #f3ead2; }
#dlgCWarn .cwTitle { font-size: 19px; font-weight: 800; color: #ffd36b; margin-bottom: 6px; }
#dlgCWarn .cwLead { margin: 0 0 8px; font-weight: 700; }
#dlgCWarn ul { margin: 0 0 8px; padding-left: 18px; } #dlgCWarn li { margin: 4px 0; word-break: keep-all; }
#dlgCWarn .cwRed { color: #ff5a4a; font-weight: 900; }
#dlgCWarn .cwEnd { margin: 6px 0 12px; color: #ffe6a8; }
#dlgCWarn .row { display: flex; gap: 8px; } #dlgCWarn .row button { flex: 1; min-height: 46px; font-size: 16px; } #dlgCWarn #cwOk:disabled { opacity: .55; }
/* 소원초 색 고르기 */
.buyColorRow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; color: #f3e6c8; font-size: 15px; }
.colorChips { display: flex; flex-wrap: wrap; gap: 8px; }
.colorChips button { width: 34px; height: 34px; min-width: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); padding: 0; box-shadow: inset 0 -3px 6px rgba(0,0,0,.25); }
.colorChips button.on { border: 3px solid #ffd36b; box-shadow: 0 0 0 2px rgba(255,211,107,.45), inset 0 -3px 6px rgba(0,0,0,.25); transform: scale(1.08); }
#dlgBuy .note.small { font-size: 12px; color: #c8bda6; margin: 4px 0; word-break: keep-all; }

/* ── 정성금 (방석 기도 10분마다) ── */
#jsgHud { left: 50%; top: calc(70px + var(--safe-t)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 24px; background: rgba(40,26,20,.82); border: 1px solid #f3cf9a; color: #ffe8c8; pointer-events: none; white-space: nowrap; }
#jsgHud .jr { width: 34px; height: 34px; transform: rotate(-90deg); flex: none; }
#jsgHud .jr circle { fill: none; stroke-width: 3.4; }
#jsgHud .jr .bg { stroke: rgba(255,255,255,.15); }
#jsgHud .jr .fg { stroke: #f3d27e; stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset .25s linear; filter: drop-shadow(0 0 3px rgba(255,210,110,.7)); }
#jsgHud.done .jr .fg { stroke: #9fe0a8; }
#jsgHud .jt { display: flex; flex-direction: column; line-height: 1.25; }
#jsgHud #jsgTxt { font: 700 15px/1.3 'Gowun Batang', serif; color: #ffe6a8; }
#jsgHud small { font-size: 11.5px; color: #e8d8c0; }
#jsgHud.paused #jsgTxt::after { content: ' · 멈춤'; color: #ffb0a0; font-size: 12px; }
@media (max-width: 600px) { #jsgHud { top: auto; bottom: calc(150px + var(--safe-b, 0px)); } }

/* ── 랭킹 상금 안내 ── */
.rkPrize { margin: 8px 0 4px; padding: 8px 12px; border-radius: 12px; background: linear-gradient(180deg, rgba(243,210,126,.22), rgba(185,138,46,.14)); border: 1px solid rgba(243,210,126,.55); color: #ffe9b0; font-size: 13.5px; line-height: 1.5; word-break: keep-all; }
.rkPrize b { color: #ffd36b; }
.rkPrize small { display: block; color: #d8c8a8; font-size: 11.5px; }
.rkRow .pz { flex: none; margin-left: 6px; padding: 1px 7px; border-radius: 9px; background: rgba(243,210,126,.18); border: 1px solid rgba(243,210,126,.5); color: #ffd36b; font-size: 12px; font-weight: 700; white-space: nowrap; }

/* ── 108배 완주 금빛 +금액 ── */
@keyframes bowGoldUp { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.12); } 25% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -40px) scale(1); } }
.bowGold { position: fixed; left: 50%; top: 38%; z-index: 70; pointer-events: none; font: 700 44px/1 'Gowun Batang', serif; background: linear-gradient(180deg, #fffaf0, #f3d27e 55%, #b98a2e); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px rgba(255,210,110,.75)) drop-shadow(0 2px 0 rgba(90,50,6,.6)); animation: bowGoldUp 2.5s ease-out forwards; white-space: nowrap; }

/* ── 알바 결과 화면 (미니게임 판 위) ── */
#mgBox { position: fixed; }
#mgRes { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(340px, calc(100% - 32px)); padding: 20px 18px 16px; border-radius: 20px; text-align: center; background: linear-gradient(180deg, rgba(42,30,46,.97), rgba(18,12,22,.97)); border: 2px solid #f3d27e; box-shadow: 0 0 0 1px #6b4a12, 0 0 30px rgba(255,200,120,.25); color: #f3e6c8; z-index: 3; }
#mgRes .mrT { font: 700 20px/1.3 'Gowun Batang', serif; color: #ffe6a8; }
#mgRes .mrStars { margin: 8px 0 4px; display: flex; justify-content: center; gap: 8px; }
#mgRes .mrStars .mrSt { width: 44px; height: 44px; fill: rgba(255,255,255,.16); }
#mgRes .mrStars .mrSt.on { fill: #ffd86a; filter: drop-shadow(0 0 8px rgba(255,210,100,.8)); animation: mrStar .5s ease-out both; }
@keyframes mrStar { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.3) rotate(8deg); opacity: 1; } 100% { transform: scale(1); } }
#mgRes .mrScore { font-size: 17px; } #mgRes .mrScore b { font-size: 24px; color: #fff2c8; }
#mgRes .nb { display: inline-block; padding: 1px 8px; border-radius: 9px; background: #ff4fac; color: #fff; font-size: 12px; font-weight: 700; vertical-align: 3px; }
#mgRes .mrBest { color: #c8b8a0; font-size: 13px; margin-top: 2px; }
#mgRes .mrAmt { margin: 10px 0 4px; font: 700 30px/1.2 'Gowun Batang', serif; background: linear-gradient(180deg, #fffaf0, #f3d27e 55%, #b98a2e); -webkit-background-clip: text; background-clip: text; color: transparent; }
#mgRes .mrB { margin: 6px 0; font-size: 14px; word-break: keep-all; } #mgRes .mrB.small { font-size: 12.5px; color: #c8b8a0; }
#mgRes .mrBtns { display: flex; gap: 10px; margin-top: 12px; } #mgRes .mrBtns button { flex: 1; min-height: 46px; border-radius: 14px; font-size: 16px; }
#mgRes .mrWait { padding: 16px 0; font-size: 15px; }

#bowNum .bwR { display: block; text-align: center; font: 700 14px/1.3 'Noto Sans KR', sans-serif; color: #ffe6a8; text-shadow: 0 1px 4px #000; margin-top: 2px; white-space: nowrap; }

/* ── 사당 (칠성각 · 산신각 · 메인 제단) ── */
#shrineBar { left: 50%; transform: translateX(-50%); bottom: calc(222px + var(--safe-b)); background: rgba(40,26,20,.92); border: 1px solid #e7bb55; border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 11; }
#shrineBar[data-p="chil"] { background: linear-gradient(180deg, rgba(48,24,70,.94), rgba(26,12,40,.94)); box-shadow: 0 0 18px rgba(255,210,110,.25); }
#shrineBar[data-p="chil"] .tbTitle { color: #ffe08a; }
body.touch #shrineBar { bottom: calc(170px + var(--safe-b)); width: calc(100% - 24px); }
.shoList { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.shoItem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(240,220,160,.3); }
.shoItem .ic { font-size: 28px; } .shoItem .nm { flex: 1; font-weight: 700; } .shoItem .nm small { display: block; font-weight: 400; color: #d8c8a8; font-size: 12px; }
.shRice .fl { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; font-weight: 700; color: #f3e6c8; }
.shRice .fl small { font-weight: 400; color: #c8b8a0; }
.shRice input, .shRice textarea { font: inherit; font-weight: 400; }
.calRow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-weight: 400; }
.calRow label { display: flex; align-items: center; gap: 4px; }
.calRow input[type=date] { flex: 1 1 160px; min-height: 42px; }
.riceNote { margin: 4px 0 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255,214,110,.12); border: 1px solid rgba(243,210,126,.5); color: #ffe6a8; font-size: 13.5px; line-height: 1.5; }
.riceNote small { color: #e0d0b0; font-size: 12px; }
.smList .h { padding: 8px 10px; margin: 6px 0; border-radius: 10px; background: rgba(255,255,255,.06); line-height: 1.5; word-break: break-all; }

#shcWish, #srWish { width: 100%; min-height: 84px; resize: vertical; box-sizing: border-box; }
.shRice input#srName { width: 100%; box-sizing: border-box; min-height: 42px; }

.shRice .fl { display: block; }
.shRice .fl > input, .shRice .fl > textarea, .shRice .calRow { display: flex; margin-top: 4px; }
.shRice .fl > input, .shRice .fl > textarea { width: 100%; }
.shRice .calRow label { flex-direction: row; white-space: nowrap; font-weight: 400; gap: 4px; }
.shRice .calRow input[type=radio] { width: auto; min-height: 0; margin: 0; flex: none; }

/* 정성금 배지: 작게 · 반투명 · 기도 버튼 줄 바로 위 (위치는 main.js에서 계산) */
#jsgHud { padding: 3px 10px 3px 4px; gap: 6px; background: rgba(30,20,16,.6); border-color: rgba(243,207,154,.7); }
#jsgHud .jr { width: 24px; height: 24px; }
#jsgHud #jsgTxt { font-size: 13px; }
#jsgHud small { font-size: 10.5px; }
@media (max-width: 600px) { #jsgHud { top: auto; bottom: auto; } }

#nickErr.ok { color: #7fe08a; }

/* 쪽지 (운영자: 금색 · 친구: 분홍) */
.mItem.note { border: 1.5px solid rgba(243,210,126,.85); border-radius: 12px; padding: 8px 10px; background: rgba(243,210,126,.08); }
.mItem.note.friend { border-color: rgba(255,143,189,.8); background: rgba(255,143,189,.07); }
.mItem .mTag { font-size: 12px; font-weight: 700; color: #f3d27e; }
.mItem.note.friend .mTag { color: #ffb6d5; }
.newDot { display: inline-block; width: 7px; height: 7px; border-radius: 4px; background: #ff5a4a; vertical-align: 1px; margin-left: 4px; }
.noteRead .nrTag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 13px; background: rgba(243,210,126,.2); color: #f3d27e; border: 1px solid rgba(243,210,126,.7); }
.noteRead .nrTag.friend { background: rgba(255,143,189,.15); color: #ffb6d5; border-color: rgba(255,143,189,.6); }
.noteRead .nrTitle { font-weight: 700; font-size: 17px; margin: 8px 0 2px; color: #ffe6a8; word-break: break-all; }
.noteRead .nrBody { white-space: pre-wrap; word-break: break-all; margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.25); line-height: 1.6; max-height: 50vh; overflow: auto; }

/* 💾 저장 · 👥 친구 (휴대폰: 🏆🛍️ 와 같은 원형 44px · 남색 반투명 + 금색 테두리) */
@media (max-width: 600px), (hover: none) and (pointer: coarse) {
  #hud-top-left #btnSave, #hud-top-left #btnFriends {
    position: relative; flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1;
    background: rgba(18, 22, 44, .78); border: 1.5px solid rgba(230, 194, 122, .7); color: #ffe7a8; }
  #hud-top-left #hudRow2 { max-width: calc(100vw - 24px - env(safe-area-inset-left, 0px)); }
}
#btnSave .svState { position: absolute; inset: -2px; border-radius: inherit; pointer-events: none; }
#btnSave.glow { animation: svGlow 1s ease-out; }
@keyframes svGlow { 0% { box-shadow: 0 0 0 0 rgba(255,214,110,.0); } 30% { box-shadow: 0 0 12px 3px rgba(255,214,110,.75); } 100% { box-shadow: 0 0 0 0 rgba(255,214,110,0); } }
#btnSave.saving .ico, #btnSave.saving .lbl { display: inline-block; animation: svSpin .8s linear infinite; }
@keyframes svSpin { to { transform: rotate(360deg); } }
#btnSave.done::after { content: "✓"; position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 9px; background: #3fbf63; color: #fff; font: 700 12px/18px sans-serif; text-align: center; box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
#svTip { position: fixed; z-index: 30; padding: 4px 10px; border-radius: 10px; background: rgba(10,12,20,.9); color: #ffe6a8; font-size: 12.5px; pointer-events: none; }

/* ── 친구 (friends-ui.js) ── */
.frPanel { width: min(460px, 94vw); }
.frBody { margin-top: 10px; max-height: min(52vh, 420px); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.frBody #frQ { width: 100%; min-height: 44px; font-size: 16px; margin-bottom: 6px; }
.frRow { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.05); }
.frRow.small { padding: 5px 10px; font-size: 14px; }
.frWho { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.frWho b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frSt { font-size: 13px; } .frSt.on { color: #8fe3a2; } .frSt.off { color: var(--muted); }
.frBtns { display: flex; gap: 5px; flex-shrink: 0; }
.frBtns button { min-height: 38px; padding: 0 10px; font-size: 14px; border-radius: 10px; }
.frBtns button[disabled] { opacity: .4; }
.frSec { margin-top: 8px; font-size: 13px; color: var(--muted); }
.frRead { font-size: 12px; color: var(--muted); } .frRead.on { color: #8fe3a2; }
.frShowRow { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.frShowRow input { width: 20px; height: 20px; }
#frMore { position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 4px; padding: 6px; width: 160px; border-radius: 12px; background: rgba(20,16,30,.97); border: 1px solid rgba(230,194,122,.35); }
#frMore.hidden { display: none; } #frMore button { min-height: 40px; font-size: 15px; border-radius: 9px; }
@media (max-width: 400px) { .frBtns button { padding: 0 7px; font-size: 13px; } .frWho b { font-size: 15px; } }
/* ── 무당 NPC 1:1 점사 메신저 ── */
.csFeeBox { padding: 12px 14px; border-radius: 14px; background: rgba(255,182,213,.1); border: 1px solid rgba(255,182,213,.4); font-size: 16px; line-height: 1.55; margin-bottom: 8px; }
.csHead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.1); }
.csHead b#csNpcName { font-size: 17px; flex: 1; min-width: 0; }
#csClock { font-weight: 700; color: #ffe2a8; font-variant-numeric: tabular-nums; } #csClock.warn { color: #ff9b8a; }
.csFeeNow { font-size: 13px; color: var(--muted); width: 100%; } .csFeeNow b { color: #ffe2a8; }
.csMsgs { height: min(46vh, 380px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 2px; overscroll-behavior: contain; }
.csMsg { max-width: 82%; padding: 9px 12px; border-radius: 16px; font-size: 15.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.csMsg.npc { align-self: flex-start; background: rgba(255,182,213,.13); border: 1px solid rgba(255,182,213,.3); border-top-left-radius: 4px; }
.csMsg.npc.wrap { border-color: #e6c27a; }
.csMsg.me { align-self: flex-end; background: rgba(230,194,122,.22); border-top-right-radius: 4px; }
.csMsg.sys { align-self: center; max-width: 94%; font-size: 13px; color: var(--muted); background: rgba(255,255,255,.05); text-align: center; }
.csMsg.typing { color: #ffb6d5; font-style: italic; animation: csBlink 1.2s ease-in-out infinite; }
@keyframes csBlink { 50% { opacity: .45; } }
.csInput { display: flex; gap: 6px; } .csInput input { flex: 1; min-width: 0; min-height: 46px; font-size: 16px; } .csInput button { min-width: 76px; }/* 점사 1단계: 사주 정보 입력 */
#csForm .csAsk, #csConfirm .csAsk { margin: 4px 0 10px; max-width: 100%; }
.csF { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.csF > span { min-width: 84px; font-weight: 700; color: #e6c27a; font-size: 15px; }
.csF input#csName { flex: 1; min-width: 150px; min-height: 44px; font-size: 17px; }
.csChips { display: flex; gap: 6px; }
.csChips button { min-height: 44px; min-width: 64px; font-size: 16px; padding: 0 14px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(230,194,122,0.35); color: #f3ead2; }
.csChips button.on { background: linear-gradient(#e6c27a, #b88a3a); color: #2a1a08; font-weight: 700; border-color: #f3d48a; }
.csDate { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.csDate select { min-height: 44px; font-size: 16px; padding: 0 6px; border-radius: 10px; background: #1d1626; color: #f3ead2; border: 1px solid rgba(230,194,122,0.35); }
.csZi { color: #ffd86b; font-size: 16px; }
.csLeap, .csSave { display: flex; align-items: center; gap: 6px; font-size: 15px; min-height: 44px; }
.csLeap input, .csSave input { width: 22px; height: 22px; }
.csSavedRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-radius: 10px; background: rgba(230,194,122,0.1); font-size: 14px; }
.csSavedRow button { min-height: 40px; }
.linkBtn { background: none; border: 0; color: #c8b48a; text-decoration: underline; font-size: 13px; margin-top: 6px; min-height: 36px; }
.csDate { flex: 1 1 200px; flex-wrap: nowrap; } .csDate select { width: auto; flex: 1 1 0; min-width: 0; } .csZi { flex: 0 0 auto; white-space: nowrap; }
/* 접속 상태 */
.ld-pct { margin-top: 10px; font-size: 15px; color: #e6c27a; letter-spacing: 1px; }
#ldFail { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
#ldFail .t { font-size: 18px; font-weight: 700; color: #ffd27a; }
#ldFail .s { font-size: 14px; color: #e8dcc0; line-height: 1.6; max-width: 320px; }
#ldFail button { min-height: 44px; min-width: 180px; font-size: 16px; border-radius: 12px; border: 1px solid #e6c27a; background: linear-gradient(#e6c27a, #b88a3a); color: #2a1a08; font-weight: 700; }
#ldFail button.ghost { background: rgba(255,255,255,0.08); color: #f3ead2; }
#netBanner { position: fixed; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 9000; padding: 8px 16px; border-radius: 20px; background: rgba(30,18,10,0.9); border: 1px solid #e6c27a; color: #ffe2a8; font-size: 14px; pointer-events: none; animation: nbPulse 1.4s ease-in-out infinite; }
@keyframes nbPulse { 50% { opacity: 0.65; } }
/* ───── 한복방 상점 · 옷장 ───── */
#edTabs .hbTab { color: #ffd98a; font-weight: 700; }
.hbCats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.hbCats .chip { min-height: 44px; }
.hbAll { display: flex; align-items: center; gap: 6px; font-size: 14px; min-height: 44px; margin-left: auto; }
.hbAll input { width: 20px; height: 20px; }
.hbGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 8px; }
.hbCard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; border-radius: 14px; border: 1px solid rgba(230,194,122,0.3); background: #1d1626; color: #f3ead2; min-height: 44px; overflow: hidden; }
.hbCard img { width: 100%; max-width: 96px; aspect-ratio: 6 / 7; border-radius: 10px; }
.hbCard b { font-size: 14px; line-height: 1.25; text-align: center; }
.hbCard small { font-size: 13px; color: #ffd98a; }
.hbCard.on { border-color: #ffd98a; box-shadow: 0 0 0 2px rgba(255,217,138,0.4); }
.hbCard.shine::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,240,200,0.35) 50%, transparent 65%); background-size: 260% 100%; animation: hbShine 2.8s linear infinite; pointer-events: none; }
@keyframes hbShine { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.hbTier { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 9px; color: #2a1a08; }
.hbTier.t-rare { background: #7fc8ff; } .hbTier.t-hero { background: #c9a0ff; } .hbTier.t-legend { background: #f2cf6e; } .hbTier.t-myth { background: linear-gradient(90deg, #ff5a6e, #f2cf6e); color: #fff; }
.hbDet { padding: 10px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(230,194,122,0.25); }
.hbDetH { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.hbDetH .hbTier { position: static; }
.hbDetH b { font-size: 19px; color: #ffe2a8; font-family: "Gowun Batang", serif; }
.hbDetH small { color: #c8b48a; font-size: 13px; }
.hbDet p { margin: 8px 0; font-size: 15px; line-height: 1.6; }
.hbAura { color: #ffd98a; font-size: 14px; margin: 3px 0; }
.hbPal { display: flex; gap: 6px; margin: 8px 0; } .hbPal i { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.25); }
.hbBig { width: 100%; min-height: 48px; font-size: 17px; margin-top: 6px; }
.hbSub, .hbHint { font-size: 13px; color: #c8b48a; margin-top: 6px; line-height: 1.5; }
.hbWarn { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255,90,90,0.12); color: #ffb3a8; font-size: 14px; }
.hbRows { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.hbRow { display: flex; align-items: center; gap: 8px; } .hbRow img { width: 40px; height: 46px; border-radius: 8px; }
.hbRow span { flex: 1; display: flex; flex-direction: column; } .hbRow span b { font-size: 15px; } .hbRow span small { font-size: 12px; color: #c8b48a; }
.hbRow button { min-height: 44px; min-width: 96px; font-size: 14px; }
.hbTags { display: flex; flex-wrap: wrap; gap: 6px; } .hbTags span { padding: 4px 10px; border-radius: 10px; border: 1px solid rgba(230,194,122,0.35); font-size: 13px; }
.hbDone { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; margin-bottom: 8px; border-radius: 12px; background: rgba(242,207,110,0.15); color: #ffe2a8; font-weight: 700; }
.hbDone button { min-height: 44px; }
.hbSlot { margin: 8px 0; } .hbSlot > span { display: block; font-weight: 700; color: #e6c27a; margin-bottom: 4px; font-size: 15px; }
.hbChips { display: flex; flex-wrap: wrap; gap: 6px; } .hbChips .chip { min-height: 44px; }
.hbToggles { display: flex; flex-wrap: wrap; gap: 16px; margin: 10px 0; } .hbToggles label { display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: 15px; } .hbToggles input { width: 22px; height: 22px; }
.hbCats .chip, .hbChips .chip { padding: 0 14px; border-radius: 22px; background: rgba(255,255,255,.07); border: 1px solid var(--line); color: #f3e6c8; font-size: 15px; white-space: nowrap; }
.hbCats .chip.on, .hbChips .chip.on { background: rgba(233,185,73,.3); border-color: #e9b949; color: #fff3d0; font-weight: 700; }
.hbChips small.dim { color: #9a8a70; font-size: 13px; align-self: center; }
/* 플레이어 유료 상담: 대화창 맨 위 고정 타이머 · 실시간 차감 */
#pcBar { position: sticky; top: 0; z-index: 2; flex: 0 0 auto; padding: 8px 12px; margin: 0 0 6px; border-radius: 12px; background: rgba(30,20,12,0.92); border: 1px solid rgba(230,194,122,0.45); font-size: 15px; line-height: 1.5; }
#pcBar .pcRow { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
#pcBar .pcRow span { color: #e8dcc0; } #pcBar .pcRow b { color: #fff3d6; font-variant-numeric: tabular-nums; }
#pcBar b.neg { color: #ffb3a8; } #pcBar b.pos { color: #9fe0a8; }
#pcBar .pcLeft { position: relative; } #pcBar .pcLeft small { font-weight: 400; color: #c8b48a; font-size: 12px; }
#pcBar .pcRow.orange b.pcLeft { color: #ffad42; } #pcBar .pcRow.red b.pcLeft { color: #ff5a4a; animation: pcBlink 0.8s steps(2) infinite; }
#pcBar .pcNote { font-size: 13px; font-weight: 700; } #pcBar .pcNote.orange { color: #ffad42; } #pcBar .pcNote.red { color: #ff5a4a; animation: pcBlink 0.8s steps(2) infinite; }
#pcBar .pcWait { margin-top: 4px; font-size: 13px; color: #ffd98a; }
@keyframes pcBlink { 50% { opacity: 0.35; } }
#pcBar .pcFloat { position: absolute; right: 0; top: -2px; font-style: normal; font-size: 12px; color: #ff9a8a; pointer-events: none; animation: pcFloat 0.9s ease-out forwards; }
@keyframes pcFloat { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-14px); } }
/* 한복방 상점 개편: 보유금 · 한 줄 안내 · 카드마다 버튼 하나 (휴대폰에서도 큰 글씨) */
.hbTop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hbMoney { font-size: 16px; color: #ffe2a8; } .hbMoney b { font-size: 18px; }
.hbMine { display: flex; align-items: center; gap: 6px; font-size: 15px; color: #f3e6c8; min-height: 44px; } .hbMine input { width: 20px; height: 20px; }
.hbNote { font-size: 15px; color: #ffd98a; margin: 2px 0 8px; }
.hbGrid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
.hbCard { padding: 6px 6px 8px; justify-content: space-between; }
.hbPick { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; }
.hbPick img { width: 100%; max-width: 110px; aspect-ratio: 6 / 7; border-radius: 10px; }
.hbPick b { font-size: 15px; line-height: 1.3; text-align: center; color: #f3ead2; }
.hbPrice { font-size: 15px; font-weight: 700; color: #ffd98a; }
.hbSt { font-style: normal; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 9px; }
.hbSt.buy { background: rgba(255,255,255,.08); color: #e8dcc0; } .hbSt.own { background: rgba(127,200,255,.18); color: #bfe4ff; } .hbSt.worn { background: rgba(242,207,110,.25); color: #ffe7a8; }
.hbBtn { width: 100%; min-height: 46px; margin-top: 6px; font-size: 16px; font-weight: 700; border-radius: 12px; }
.hbBtn:disabled { opacity: .55; }
.hbPoor { display: block; text-align: center; font-size: 12px; color: #ffb3a8; margin-top: 2px; }
.hbSel { padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(230,194,122,0.25); font-size: 14px; line-height: 1.5; }
.hbSel b { color: #ffe2a8; font-size: 16px; } .hbSel small { color: #d8c8a8; font-size: 13px; }
.hbTier.t-normal { background: #cfd8c4; } .hbTier.t-free { background: #e8e2d4; }
@media (max-width: 480px) { .hbGrid { grid-template-columns: repeat(2, 1fr); } .hbPick b { font-size: 16px; } }
.hbCats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } .hbCats::-webkit-scrollbar { display: none; } .hbCats .chip { flex: 0 0 auto; }
@media (max-width: 600px) { #dlgEdit.shopMode .edView { height: 22vh; min-height: 150px; } #dlgEdit.shopMode .edBody { max-height: 40vh; } }
/* 유료 상담 실시간 바 (대화창 제목 바로 아래 고정) · 종료 안내 */
#pcBar { text-align: left; }
#pcBar .pcTimer { font-size: 20px; color: #fff3d6; font-variant-numeric: tabular-nums; } #pcBar .pcTimer b { font-size: 22px; letter-spacing: 1px; }
#pcBar .pcMoney { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; display: inline-block; }
#pcBar .pcMoney.use { color: #ffd2c8; } #pcBar .pcMoney.red { color: #ff5a4a; } #pcBar .pcMoney b { color: inherit; }
#pcBar .pcMoney.earn { color: #ffd65a; text-shadow: 0 0 8px rgba(255,200,60,.45); } #pcBar .pcEarn { display: inline-block; }
#pcBar .bump { animation: pcBump .35s ease-out; } @keyframes pcBump { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-3px) scale(1.08); } 100% { transform: none; } }
#pcBar .pcPre { font-size: 13px; color: #ffd98a; }
.panel.pcWin { position: relative; overflow: hidden; border-color: #f2cf6e; box-shadow: 0 0 30px rgba(242,207,110,.45); background: linear-gradient(180deg, #3a2a10, #1e160c); }
.pcWinT { font-size: 22px; line-height: 1.45; color: #ffe2a8; text-align: center; font-weight: 800; } .pcWinT b { font-size: 30px; color: #ffd65a; text-shadow: 0 0 12px rgba(255,200,60,.6); }
.pcEndT { font-size: 18px; line-height: 1.5; text-align: center; color: #f3ead2; font-weight: 700; } .pcWinS { text-align: center; font-size: 16px; color: #e8dcc0; margin: 6px 0; }
.coinRain { position: absolute; inset: 0; pointer-events: none; overflow: hidden; } .coinRain i { position: absolute; top: -30px; font-style: normal; animation: coinFall 1.6s ease-in forwards; }
@keyframes coinFall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(420px) rotate(540deg); opacity: 0; } }
#dlgConsult.kbOpen { padding: 6px; align-items: stretch; } #dlgConsult.kbOpen .panel { max-height: 100%; height: 100%; } #dlgConsult.kbOpen #pcBar { padding: 4px 10px; } #dlgConsult.kbOpen #pcBar .pcTimer { font-size: 16px; } #dlgConsult.kbOpen #pcBar .pcTimer b { font-size: 17px; }
/* 감정표현 빠른 버튼 (채팅 줄 오른쪽 끝 · 44px) + 휠 */
#btnEmoFab { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: rgba(16,14,24,.72); border: 1.5px solid var(--gold, #e9b949); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.35); touch-action: manipulation; -webkit-user-select: none; user-select: none; }
#btnEmoFab svg { width: 28px; height: 28px; pointer-events: none; } #btnEmoFab:active { transform: scale(.93); }
#emoWheel { position: fixed; inset: 0; z-index: 60; } #emoWheel.hidden { display: none; }
#emoWheel .emoBack { position: absolute; inset: 0; background: rgba(5,6,12,.25); }
#emoWheel .emoSlot, #emoWheel .emoMore, #emoWheel .emoEmpty { position: absolute; transform: translate(-50%, -50%); }
#emoWheel .emoSlot { width: 64px; height: 64px; border-radius: 50%; padding: 0; background: rgba(22,16,28,.92); border: 1.5px solid rgba(233,185,73,.8); color: #fff3d6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; overflow: hidden; animation: emoIn .18s ease-out; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
#emoWheel .emoSlot i { font-style: normal; font-size: 26px; line-height: 1; } #emoWheel .emoSlot span { font-size: 10px; line-height: 1.1; max-width: 60px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#emoWheel .emoSlot u { position: absolute; top: 3px; right: 9px; font-size: 10px; text-decoration: none; color: #c8b48a; } body.touch #emoWheel .emoSlot u { display: none; }
#emoWheel .emoCd { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(0,0,0,.6) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
#emoWheel .emoMore { width: 70px; height: 70px; border-radius: 50%; background: linear-gradient(180deg, #f2cf6e, #b8892e); color: #2a1a08; font-weight: 800; font-size: 13px; line-height: 1.2; border: none; }
#emoWheel .emoEmpty { margin-top: -10px; padding: 6px 10px; border-radius: 10px; background: rgba(22,16,28,.92); color: #ffe2a8; font-size: 13px; white-space: nowrap; }
#emoWheel .emoEdit { position: absolute; left: 50%; bottom: calc(80px + var(--safe-b, 0px)); transform: translateX(-50%); width: min(420px, calc(100% - 32px)); padding: 12px; border-radius: 16px; background: rgba(22,16,28,.97); border: 1px solid rgba(233,185,73,.6); color: #f3ead2; display: flex; flex-direction: column; gap: 8px; }
#emoWheel .emoEdit small { color: #c8b48a; } #emoWheel .emoEditList { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; max-height: 40vh; overflow: auto; }
#emoWheel .emoEditList button { position: relative; min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15); color: #f3ead2; font-size: 14px; text-align: left; }
#emoWheel .emoEditList button.on { border-color: #e9b949; background: rgba(233,185,73,.22); } #emoWheel .emoEditList i { font-style: normal; font-size: 20px; } #emoWheel .emoEditList em { position: absolute; top: 2px; right: 6px; font-style: normal; font-size: 11px; color: #ffd98a; }
@keyframes emoIn { from { transform: translate(-50%, -50%) scale(.75); } }
#bnLog { flex: 1 1 auto; min-height: 120px; overflow-y: auto; } #dlgBench.kbOpen { padding: 6px; align-items: stretch; } #dlgBench.kbOpen .panel { max-height: 100%; height: 100%; }
/* 벤치 대화창: 고민상담소 대화창과 같은 모양 */
#bnLog { flex: 1; min-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.3); user-select: text; }
#bnLog .cm { max-width: 82%; padding: 8px 12px; border-radius: 14px; font-size: 16px; line-height: 1.45; word-break: break-all; }
#bnLog .cm small { display: block; font-size: 12px; opacity: .75; margin-bottom: 2px; }
#bnLog .cm.c { align-self: flex-start; background: rgba(150, 86, 190, .35); border: 1px solid rgba(200, 140, 240, .45); }
#bnLog .cm.k { align-self: flex-end; background: rgba(60, 120, 190, .35); border: 1px solid rgba(120, 180, 250, .45); }
#bnLog .cm.sys { align-self: center; background: rgba(230,194,122,.15); color: var(--gold); font-size: 14px; }
#bnForm { display: flex; gap: 8px; } #bnForm input { flex: 1; } #bnForm button { min-width: 84px; border-radius: 12px; font-weight: 700; }
