:root {
  --gold: #e8c26a; --red: #ff3b2a; --ink: #f4e6d0; --dim: rgba(244, 230, 208, .65);
  --serif: 'Shippori Mincho B1', 'Hiragino Mincho ProN', serif; --latin: 'Cinzel', serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a0408; color: var(--ink); font-family: var(--serif); user-select: none; -webkit-user-select: none; touch-action: none; }
#c { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hide { display: none !important; }
button { font-family: var(--serif); cursor: pointer; }
kbd { font-family: var(--latin); font-size: 11px; padding: 1px 6px; border: 1px solid rgba(232, 194, 106, .6); border-radius: 4px; background: rgba(0, 0, 0, .4); color: var(--gold); margin: 0 3px; }

#touchLayer { position: fixed; inset: 0; display: none; }
body.touch.playing #touchLayer { display: block; }
#joy { position: fixed; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .2); display: none; pointer-events: none; }
#joy.on { display: block; }
#joy .knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle, rgba(232, 194, 106, .8), rgba(232, 194, 106, .2)); transform: translate(-50%, -50%); }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#stats { position: absolute; left: max(16px, env(safe-area-inset-left)); top: 14px; display: flex; gap: 10px; align-items: flex-start; }
#lv { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--gold); background: radial-gradient(circle, #3a1410, #120606); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--latin); font-size: 11px; color: var(--gold); box-shadow: 0 0 18px rgba(232, 120, 40, .4); }
#lv b { font-size: 20px; line-height: 1; color: #fff; }
.bars { display: flex; flex-direction: column; gap: 4px; padding-top: 3px; }
.bar { position: relative; height: 14px; width: min(300px, 46vw); background: rgba(0, 0, 0, .55); border: 1px solid rgba(232, 194, 106, .45); border-radius: 2px; overflow: hidden; transform: skewX(-12deg); }
.bar i, .bar u { position: absolute; left: 0; top: 0; bottom: 0; transition: width .12s; }
.bar span { position: absolute; right: 8px; top: -1px; font-size: 11px; font-family: var(--latin); text-shadow: 0 1px 2px #000; transform: skewX(12deg); }
.bar.hp { height: 18px; }
.bar.hp i { background: linear-gradient(#ff6a50, #b8140c 60%, #7a0a06); box-shadow: 0 0 12px #ff3020 inset; }
.bar.hp.low { animation: low .6s infinite alternate; }
@keyframes low { to { border-color: #ff3020; box-shadow: 0 0 16px #ff2010; } }
.bar.mp i { background: linear-gradient(#6ab8ff, #1d4cc8 60%, #10287a); }
.bar.st { height: 6px; width: min(220px, 34vw); }
.bar.st i { background: linear-gradient(#ffe39a, #c89a30); }
.bar.xp { height: 4px; width: min(220px, 34vw); border-color: rgba(120, 180, 255, .4); }
.bar.xp i { background: #8fd0ff; box-shadow: 0 0 6px #8fd0ff; }
#round { position: absolute; right: max(64px, env(safe-area-inset-right)); top: 18px; font-family: var(--latin), var(--serif); font-size: 13px; letter-spacing: .12em; color: var(--dim); text-shadow: 0 1px 3px #000; }
#pauseBtn { position: absolute; right: max(14px, env(safe-area-inset-right)); top: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(232, 194, 106, .5); background: rgba(0, 0, 0, .45); color: var(--gold); font-family: var(--latin); font-weight: 900; pointer-events: auto; }

#boss { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); width: min(720px, 86vw); text-align: center; }
body.touch #boss { bottom: auto; top: 76px; width: min(560px, 60vw); }
#boss .bname { font-size: 20px; letter-spacing: .25em; color: #ffd6b0; text-shadow: 0 0 12px #ff4010, 0 2px 4px #000; margin-bottom: 4px; }
#boss .bar { width: 100%; height: 14px; transform: none; border-color: rgba(255, 120, 60, .7); }
#boss .bar u { background: #ffe0b0; }
#boss .bar i { background: linear-gradient(#ff5a20, #a01008); box-shadow: 0 0 14px #ff3010; transition: none; }

#combo { position: absolute; right: 6vw; top: 30%; text-align: right; opacity: 0; transition: opacity .3s; font-family: var(--latin); }
#combo.on { opacity: 1; }
#combo b { display: block; font-size: 64px; line-height: 1; font-weight: 900; color: #fff; text-shadow: 0 0 20px #4aa0ff, 0 0 4px #4aa0ff, 0 3px 0 #123; }
#combo span { font-size: 16px; letter-spacing: .4em; color: #9fd0ff; }
#combo.bump b { animation: bump .18s; }
@keyframes bump { from { transform: scale(1.35); } to { transform: scale(1); } }

#pad { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 10px; align-items: flex-end; }
.btn { position: relative; width: 64px; height: 64px; border-radius: 12px; border: 1px solid rgba(232, 194, 106, .55); background: radial-gradient(circle at 50% 30%, rgba(80, 30, 20, .85), rgba(10, 4, 6, .85)); color: var(--ink); pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding: 0; box-shadow: 0 4px 14px rgba(0, 0, 0, .6); }
.btn em { font-style: normal; font-size: 24px; line-height: 1.1; position: relative; z-index: 2; }
.btn small { font-size: 10px; color: var(--dim); position: relative; z-index: 2; }
.btn kbd { position: absolute; left: 2px; top: 2px; margin: 0; padding: 0 4px; font-size: 10px; z-index: 3; }
.btn s { position: absolute; right: 3px; bottom: 2px; text-decoration: none; font-size: 9px; color: #8fc4ff; font-family: var(--latin); z-index: 2; }
.btn::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--cd, 0) * 100%); background: rgba(0, 0, 0, .65); z-index: 1; }
.btn.dis { filter: saturate(.3); }
.btn.on { transform: scale(.92); border-color: #fff; }
.btn.ult { border-color: rgba(255, 200, 80, .8); }
.btn.ult .fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, rgba(255, 140, 30, .7), rgba(255, 220, 120, .5)); z-index: 0; transition: height .2s; }
.btn.ult.ready { animation: ready 1s infinite alternate; }
@keyframes ready { from { box-shadow: 0 0 10px #ffb030; } to { box-shadow: 0 0 34px #ffd060, 0 0 8px #fff inset; } }

body.touch #pad { left: auto; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); transform: none; width: 230px; height: 220px; display: block; }
body.touch .btn { position: absolute; border-radius: 50%; width: 62px; height: 62px; }
body.touch .btn kbd { display: none; }
body.touch .btn.atk { right: 0; bottom: 0; width: 100px; height: 100px; }
body.touch .btn.atk em { font-size: 38px; }
body.touch .btn.dodge { right: 112px; bottom: 0; }
body.touch .btn.sk:nth-child(3) { right: 104px; bottom: 74px; }
body.touch .btn.sk:nth-child(4) { right: 40px; bottom: 112px; }
body.touch .btn.ult { right: 150px; bottom: 140px; width: 70px; height: 70px; }

/* ---- 演出 ---- */
#dmg, #pops { position: fixed; inset: 0; pointer-events: none; }
.dn { position: absolute; left: 0; top: 0; font-family: var(--latin); font-weight: 900; font-size: 22px; color: #fff; text-shadow: 0 0 6px #3a8aff, 0 2px 0 #000, 0 0 2px #000; white-space: nowrap; }
.dn.crit { font-size: 34px; color: #ffd84a; text-shadow: 0 0 12px #ff7a10, 0 3px 0 #5a1800; }
.dn.crit::after { content: ' 会心'; font-family: var(--serif); font-size: 16px; }
.dn.bolt { color: #c8e4ff; text-shadow: 0 0 12px #4a8aff, 0 2px 0 #000; }
.dn.hurt { color: #ff4a3a; font-size: 26px; text-shadow: 0 2px 0 #000, 0 0 8px #800; }
.dn.heal { color: #7aff8a; text-shadow: 0 0 8px #10a020, 0 2px 0 #000; }
#flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; }
.pop { position: absolute; left: 50%; top: calc(36% + var(--o)); transform: translate(-50%, -50%); font-size: 26px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; animation: pop 1.2s forwards; text-shadow: 0 2px 6px #000; }
.pop.warn { font-size: 18px; color: #ffb0a0; }
.pop.just { font-family: var(--latin); font-size: 44px; color: #bfe4ff; text-shadow: 0 0 20px #3a8aff, 0 0 4px #fff; font-style: italic; }
.pop.lv { color: var(--gold); text-shadow: 0 0 16px #ff9a20, 0 2px 0 #000; font-size: 30px; }
.pop.parry { color: #ffe0a0; font-size: 22px; }
.pop.ult { top: 26%; font-size: 52px; color: #fff3d0; text-shadow: 0 0 24px #ff9a20, 0 0 6px #ffb040, 0 3px 0 #5a1800; letter-spacing: .25em; animation: popUlt 1.6s forwards; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(1.6); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -90%); } }
@keyframes popUlt { 0% { opacity: 0; letter-spacing: 1em; } 15% { opacity: 1; letter-spacing: .25em; } 80% { opacity: 1; } 100% { opacity: 0; letter-spacing: .4em; } }

#banner { position: fixed; left: 0; right: 0; top: 30%; text-align: center; pointer-events: none; opacity: 0; transition: opacity .6s; }
#banner.show { opacity: 1; }
#banner h1 { margin: 0; font-size: clamp(34px, 7vw, 76px); font-weight: 800; letter-spacing: .2em; color: #fff4e0; text-shadow: 0 0 24px #ff5a10, 0 0 6px #ff9a40, 0 4px 0 #300; }
#banner h2 { margin: 0 0 6px; font-family: var(--latin), var(--serif); font-size: clamp(13px, 2vw, 18px); letter-spacing: .5em; color: var(--gold); }
#banner.show h1 { animation: banIn .9s cubic-bezier(.2, .9, .2, 1); }
#banner.boss h1 { color: #ffd0b8; text-shadow: 0 0 30px #ff2000, 0 0 8px #ff6020, 0 4px 0 #300; }
#banner.red h1 { color: #ffb0a0; font-size: clamp(26px, 5vw, 54px); }
#banner.gold h1 { color: #fff0c0; text-shadow: 0 0 24px #ffb020, 0 4px 0 #430; }
#banner::before { content: ''; position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; margin-top: 8px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .0; }
@keyframes banIn { from { letter-spacing: .8em; opacity: 0; filter: blur(8px); } to { letter-spacing: .2em; opacity: 1; filter: none; } }

/* ---- 祝福カード ---- */
#cards { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(30, 8, 6, .55), rgba(0, 0, 0, .85)); padding: 16px; overflow-y: auto; }
#cards h2 { margin: 0; font-size: 32px; letter-spacing: .3em; color: var(--gold); text-shadow: 0 0 18px #ff8a20; }
#cards p { margin: 6px 0 22px; color: var(--dim); font-size: 14px; }
#cards .list { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.card { position: relative; width: 200px; min-height: 250px; padding: 22px 16px; border-radius: 10px; border: 1px solid rgba(232, 194, 106, .7); background: linear-gradient(170deg, #2e120c, #0e0506); color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 12px; animation: cardIn .5s backwards cubic-bezier(.2, .9, .2, 1.2); transition: transform .15s, box-shadow .15s; box-shadow: 0 8px 30px rgba(0, 0, 0, .7); }
.card:hover, .card:active { transform: translateY(-8px); box-shadow: 0 0 34px rgba(255, 160, 50, .55); border-color: #ffe0a0; }
.card .ico { font-size: 54px; filter: drop-shadow(0 0 12px #ff9a30); }
.card .nm { font-size: 22px; font-weight: 800; color: var(--gold); }
.card .ds { font-size: 14px; line-height: 1.6; color: var(--ink); }
.card .k { position: absolute; top: 8px; left: 10px; font-family: var(--latin); font-size: 13px; color: var(--dim); }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) rotateY(60deg); } }
@media (max-width: 700px) {
  .card { width: 100%; max-width: 380px; min-height: 0; flex-direction: row; text-align: left; padding: 12px 14px; gap: 14px; }
  .card .ico { font-size: 36px; }
  .card .nm { font-size: 18px; min-width: 96px; }
  .card .ds { font-size: 13px; }
  #cards .list { flex-direction: column; gap: 10px; width: 100%; align-items: center; }
  #cards h2 { font-size: 24px; }
}

/* ---- 画面 ---- */
#title, #over, #win, #pause { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; }
#title { background: radial-gradient(ellipse at 50% 60%, rgba(0, 0, 0, 0), rgba(0, 0, 0, .7)); }
.tin { max-width: 640px; animation: fade 1.6s; }
.sub { font-family: var(--latin); letter-spacing: .7em; color: var(--gold); font-size: clamp(13px, 2.4vw, 20px); text-shadow: 0 0 10px #ff8a20; padding-left: .7em; }
#title h1, .box h1 { margin: 6px 0 10px; font-size: clamp(54px, 13vw, 120px); font-weight: 800; letter-spacing: .12em; color: #fff3e0; text-shadow: 0 0 40px #ff4a10, 0 0 10px #ff8a30, 0 6px 0 #2a0400; line-height: 1.1; }
.lead { color: var(--dim); line-height: 1.9; font-size: clamp(14px, 2.6vw, 17px); margin: 0 0 26px; }
button.big, #btnTitle, #btnQuit { display: block; margin: 10px auto; min-width: 240px; padding: 14px 30px; font-size: 22px; font-weight: 800; letter-spacing: .3em; color: #fff3e0; background: linear-gradient(#8a2412, #3a0806); border: 1px solid var(--gold); border-radius: 4px; box-shadow: 0 0 24px rgba(255, 90, 20, .45); transition: transform .15s, box-shadow .15s; }
button.big:hover { transform: scale(1.04); box-shadow: 0 0 40px rgba(255, 140, 40, .7); }
#btnTitle, #btnQuit { font-size: 16px; padding: 10px 20px; background: rgba(0, 0, 0, .5); box-shadow: none; }
#best { margin-top: 8px; color: var(--gold); font-size: 14px; }
.keys { margin-top: 22px; font-size: 13px; color: var(--dim); line-height: 2.1; }
.keys .tip { margin-top: 6px; color: #ffb0a0; }
.keys b { color: #bfe4ff; font-family: var(--latin); }
.keys.mob { display: none; }
body.touch .keys.pc { display: none; }
body.touch .keys.mob { display: block; }
.box { max-width: 560px; animation: fade 1s; }
#over { background: radial-gradient(circle, rgba(40, 0, 0, .55), rgba(0, 0, 0, .9)); }
#over h1 { color: #ff6a50; text-shadow: 0 0 40px #a00, 0 6px 0 #200; }
#overRound { color: var(--gold); margin-bottom: 20px; }
#win { background: radial-gradient(circle, rgba(60, 30, 0, .45), rgba(0, 0, 0, .85)); }
#winStats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin: 20px auto; max-width: 380px; text-align: left; }
#winStats div { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(232, 194, 106, .3); padding: 4px 0; }
#winStats span { color: var(--dim); font-size: 13px; }
#winStats b { font-family: var(--latin); color: var(--gold); }
#pause { background: rgba(0, 0, 0, .6); }
#pause h1 { font-size: 48px; }
@keyframes fade { from { opacity: 0; transform: translateY(16px); } }

@media (max-width: 700px) {
  .bar { width: 40vw; }
  #combo b { font-size: 44px; }
  #round { font-size: 10px; top: 58px; right: 14px; }
  .pop.ult { font-size: 30px; }
  .pop.just { font-size: 32px; }
}
@media (max-height: 500px) {
  #title h1 { font-size: 54px; }
  .lead { margin-bottom: 12px; }
  .keys { margin-top: 8px; }
}

/* ---- 探索UI ---- */
#round { display: none; }
#minimap { position: absolute; right: max(14px, env(safe-area-inset-right)); top: 60px; width: 168px; height: 168px; border-radius: 50%; border: 2px solid rgba(232, 194, 106, .6); box-shadow: 0 0 20px rgba(0, 0, 0, .8), 0 0 12px rgba(255, 120, 40, .25); background: #0c0606; }
#quest { position: absolute; right: max(14px, env(safe-area-inset-right)); top: 236px; max-width: 260px; text-align: right; font-size: 14px; color: #fff3e0; text-shadow: 0 1px 3px #000, 0 0 8px #000; line-height: 1.5; }
#quest small { display: block; font-size: 10px; letter-spacing: .4em; color: var(--gold); }
#quest.flash { animation: qf 1.2s; }
@keyframes qf { 0%, 30% { color: #ffd060; transform: scale(1.06); } }
#prompt { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); padding: 8px 18px; background: rgba(0, 0, 0, .65); border: 1px solid rgba(232, 194, 106, .6); border-radius: 4px; font-size: 16px; white-space: nowrap; animation: fade .3s; }
#interactBtn { display: none; }
body.touch #prompt kbd { display: none; }
body.touch.playing #interactBtn:not(.hide) { display: block; position: fixed; left: 50%; bottom: 40%; transform: translateX(-50%); padding: 12px 28px; font-size: 18px; font-weight: 800; color: #fff3e0; background: linear-gradient(#8a5a12, #3a2406); border: 1px solid var(--gold); border-radius: 30px; box-shadow: 0 0 20px rgba(255, 180, 60, .5); }
body.touch #prompt { bottom: calc(40% + 60px); }
#area { position: fixed; left: 0; right: 0; top: 18%; text-align: center; pointer-events: none; opacity: 0; font-size: clamp(26px, 5vw, 46px); font-weight: 800; letter-spacing: .3em; color: #fff3e0; text-shadow: 0 0 20px rgba(255, 120, 40, .7), 0 3px 0 #200; }
#area small { display: block; font-family: var(--latin); font-size: 13px; letter-spacing: .6em; color: var(--gold); }
#area.show { animation: areaIn 2.6s forwards; }
@keyframes areaIn { 0% { opacity: 0; letter-spacing: .7em; } 18% { opacity: 1; letter-spacing: .3em; } 75% { opacity: 1; } 100% { opacity: 0; } }
#talk { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(760px, calc(100vw - 32px)); min-height: 130px; padding: 18px 24px 28px; background: linear-gradient(rgba(20, 8, 6, .92), rgba(8, 3, 3, .95)); border: 1px solid rgba(232, 194, 106, .7); border-radius: 6px; box-shadow: 0 0 40px rgba(0, 0, 0, .8); cursor: pointer; }
#talk .nm { font-size: 15px; color: var(--gold); letter-spacing: .2em; margin-bottom: 8px; }
#talk .tx { font-size: 18px; line-height: 1.8; }
#talk .tx.in { animation: fade .4s; }
#talk .nx { position: absolute; right: 16px; bottom: 6px; font-size: 11px; color: var(--dim); animation: ready 1s infinite alternate; }
.btn.pot s { color: #9fffb0; font-size: 12px; }
body.touch .btn.pot { right: 186px; bottom: 60px; width: 54px; height: 54px; }
@media (max-width: 700px) {
  #minimap { width: 112px; height: 112px; top: 58px; }
  #quest { top: 176px; font-size: 12px; max-width: 180px; }
  #talk .tx { font-size: 15px; }
}
@media (max-width: 700px) {
  body:not(.touch) #pad { gap: 6px; }
  body:not(.touch) .btn { width: 50px; height: 50px; }
  body:not(.touch) .btn em { font-size: 18px; }
}

/* ---- 町・NPC ---- */
#gold { font-family: var(--latin); font-size: 13px; color: #ffd860; text-shadow: 0 1px 2px #000; margin-top: 2px; }
#gold b { font-size: 15px; }
#labels { position: fixed; inset: 0; pointer-events: none; }
.nlabel { position: absolute; left: 0; top: 0; text-align: center; white-space: nowrap; display: none; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.nlabel b { display: block; font-size: 13px; color: #fff3e0; }
.nlabel small { display: block; font-size: 10px; color: var(--gold); letter-spacing: .1em; }
.nlabel i { display: block; font-style: normal; font-size: 26px; font-weight: 900; line-height: 1; }
.nlabel i.q { color: #ffd84a; text-shadow: 0 0 10px #ff9a10, 0 2px 0 #000; animation: bob 1s infinite alternate; }
.nlabel i.r { color: #8fe0ff; text-shadow: 0 0 10px #2a8aff, 0 2px 0 #000; animation: bob 1s infinite alternate; }
.nlabel i.s { font-size: 16px; color: #ffd860; }
@keyframes bob { to { transform: translateY(-5px); } }
#quest .sq { margin-top: 8px; }
#quest .sl { font-size: 12px; color: #e8d8b8; }
.pop.gold { color: #ffd860; font-family: var(--latin); text-shadow: 0 0 10px #a07000, 0 2px 0 #000; font-size: 22px; }
.dn.gold { color: #ffd860; font-size: 16px; text-shadow: 0 1px 0 #000, 0 0 6px #a07000; }
.dn.alert { color: #ff4a30; font-size: 34px; text-shadow: 0 0 10px #ff0000, 0 2px 0 #000; }
#shop { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); padding: 16px; }
#shop .sbox { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; background: linear-gradient(#24100c, #0e0606); border: 1px solid rgba(232, 194, 106, .7); border-radius: 8px; padding: 18px; box-shadow: 0 0 50px rgba(0, 0, 0, .9); animation: fade .3s; }
#shop .shead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
#shop .st { font-size: 22px; font-weight: 800; color: var(--gold); letter-spacing: .15em; }
#shop .gd { color: var(--dim); font-size: 13px; }
#shop .gd b { color: #ffd860; font-family: var(--latin); font-size: 18px; }
.srow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-bottom: 8px; padding: 10px 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(232, 194, 106, .3); border-radius: 6px; color: var(--ink); }
.srow:hover { background: rgba(255, 200, 100, .1); border-color: var(--gold); }
.srow div { flex: 1; }
.srow b { display: block; font-size: 16px; }
.srow b em { font-style: normal; font-size: 11px; color: var(--dim); font-family: var(--latin); }
.srow small { color: var(--dim); font-size: 12px; }
.srow .k { font-family: var(--latin); color: var(--dim); font-size: 12px; }
.srow .pr { font-family: var(--latin); color: #ffd860; font-size: 16px; white-space: nowrap; }
.srow.poor .pr { color: #aa6a5a; }
.srow.sold { opacity: .4; }
.srow.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
#shop .close { display: block; margin: 12px auto 0; padding: 8px 24px; background: rgba(0, 0, 0, .5); color: var(--ink); border: 1px solid rgba(232, 194, 106, .5); border-radius: 4px; }
body.touch .srow .k, body.touch #shop .close { font-size: 14px; }

/* ---- 宿屋・イベント ---- */
#buffs { display: flex; gap: 6px; margin-top: 4px; }
#buffs span { font-size: 18px; line-height: 1; background: rgba(0, 0, 0, .45); border: 1px solid rgba(232, 194, 106, .4); border-radius: 4px; padding: 2px 4px; display: flex; align-items: center; gap: 2px; }
#buffs small { font-size: 10px; color: var(--dim); }
.pop.save { font-size: 14px; color: var(--dim); top: 72%; }
#sleep { position: fixed; inset: 0; background: #000; opacity: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; transition: opacity 1s; }
#sleep.in { opacity: 1; }
#sleep.out { opacity: 0; transition: opacity 1.2s; }
#sleep div { font-size: 28px; letter-spacing: .4em; color: #ffe0a0; opacity: 0; transition: opacity .8s .9s; }
#sleep.in div { opacity: 1; }
.nlabel i.s { color: #ffd860; }

.dn.burn { color: #ff9a40; text-shadow: 0 0 8px #ff3000, 0 2px 0 #000; }
body.touch .btn.s3 { right: 168px; bottom: 210px; width: 56px; height: 56px; }

/* ---- 装備画面 ---- */
#bagBtn { position: absolute; right: max(62px, env(safe-area-inset-right)); top: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(232, 194, 106, .5); background: rgba(0, 0, 0, .45); font-size: 18px; pointer-events: auto; }
#minimap { top: 62px; }
#inv { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .6); padding: 16px; }
#inv .sbox { width: min(620px, 100%); max-height: 92vh; overflow-y: auto; background: linear-gradient(#20100c, #0c0505); border: 1px solid rgba(232, 194, 106, .7); border-radius: 8px; padding: 18px; animation: fade .25s; }
#inv .shead .st { font-size: 22px; font-weight: 800; color: var(--gold); letter-spacing: .15em; margin-bottom: 10px; }
.istat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 14px; font-size: 13px; color: var(--dim); margin-bottom: 12px; }
.istat b { color: #fff3e0; font-family: var(--latin); font-size: 16px; }
.itabs { display: flex; gap: 6px; margin-bottom: 10px; }
.itabs button { flex: 1; padding: 8px; background: rgba(0, 0, 0, .4); color: var(--dim); border: 1px solid rgba(232, 194, 106, .3); border-radius: 4px; }
.itabs button.on { color: #fff3e0; border-color: var(--gold); background: rgba(120, 60, 20, .4); }
.irow { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; margin-bottom: 6px; padding: 10px 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(232, 194, 106, .25); border-radius: 6px; color: var(--ink); }
.irow.on { border-color: #ffd860; box-shadow: 0 0 12px rgba(255, 200, 80, .3); }
.irow.on b::after { content: '　装備中'; font-size: 11px; color: #ffd860; }
.irow b { display: block; font-size: 15px; }
.irow small { color: var(--dim); font-size: 12px; }
.irow span { font-family: var(--latin); color: #ffd860; white-space: nowrap; font-size: 13px; }
#inv .none { color: var(--dim); text-align: center; }
#inv .close { display: block; margin: 12px auto 0; padding: 8px 24px; background: rgba(0, 0, 0, .5); color: var(--ink); border: 1px solid rgba(232, 194, 106, .5); border-radius: 4px; }
.bar.st.tired { animation: low .3s infinite alternate; }
.dn.guard { color: #d8e4ff; font-size: 20px; text-shadow: 0 0 8px #6a8aff, 0 2px 0 #000; }

/* ---- ハート・スタミナの輪 ---- */
#hearts { display: flex; flex-wrap: wrap; gap: 3px; max-width: min(330px, 60vw); margin-bottom: 3px; }
#hearts .hrt { width: 26px; height: 24px; filter: drop-shadow(0 1px 1px #000); }
#hearts .hb { fill: rgba(30, 10, 10, .75); stroke: #f4e6d0; stroke-width: 2; }
#hearts .hf { fill: #ff3a3a; }
#hearts.low .hrt:last-child, #hearts.low { animation: hbeat .5s infinite alternate; }
@keyframes hbeat { to { transform: scale(1.06); } }
.bar.hp { height: 8px; }
.bar.hp span { display: none; }
#lv { width: 46px; height: 46px; }
#stwheel { position: fixed; left: 0; top: 0; width: 44px; height: 44px; pointer-events: none; opacity: 0; }
@media (max-width: 700px) { #hearts .hrt { width: 20px; height: 18px; } }

/* ---- アイテム入手 ---- */
#itemget { position: fixed; left: 50%; bottom: 14%; transform: translateX(-50%); width: min(620px, calc(100vw - 32px)); padding: 18px 24px 22px; text-align: center; background: linear-gradient(rgba(10, 18, 30, .92), rgba(5, 8, 14, .95)); border: 2px solid #c8b070; border-radius: 10px; box-shadow: 0 0 40px rgba(0, 0, 0, .8), inset 0 0 20px rgba(200, 170, 80, .15); cursor: pointer; animation: igIn .35s; }
#itemget h3 { margin: 0 0 6px; font-size: 24px; color: #fff3c8; letter-spacing: .08em; text-shadow: 0 0 10px #c8a040; }
#itemget p { margin: 0; font-size: 14px; color: #d8d0c0; line-height: 1.6; }
#itemget .nx { position: absolute; right: 14px; bottom: 6px; font-size: 12px; color: #c8b070; animation: ready 1s infinite alternate; }
@keyframes igIn { from { opacity: 0; transform: translateX(-50%) scale(.9); } }

#lockmark { position: fixed; left: 0; top: 0; pointer-events: none; }
#lockmark i { display: block; width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 18px solid #ffd84a; filter: drop-shadow(0 0 6px #ff9a10) drop-shadow(0 2px 1px #000); animation: lockb .5s infinite alternate; }
@keyframes lockb { to { transform: translateY(-6px); } }
body.touch .btn.lockb { right: 0; bottom: 182px; width: 50px; height: 50px; }

.pop.heartp { color: #ff6a7a; font-size: 30px; }

/* ボス登場：上下の黒帯と名前の札 */
#letterbox i { position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 30; transition: height .6s cubic-bezier(.3, .8, .3, 1); pointer-events: none; }
#letterbox i:first-child { top: 0; }
#letterbox i:last-child { bottom: 0; }
body.cine #letterbox i { height: 11vh; }
body.cine #hud, body.cine #pad { opacity: 0; transition: opacity .4s; }
#bosscard { position: fixed; left: max(7vw, 24px); bottom: calc(11vh + 26px); z-index: 31; pointer-events: none; opacity: 0; transform: translateX(-30px); transition: opacity .7s, transform .9s cubic-bezier(.2, .9, .2, 1); }
#bosscard.show { opacity: 1; transform: none; }
#bosscard small { display: block; font-size: clamp(13px, 1.8vw, 18px); letter-spacing: .3em; color: #e8d8b0; text-shadow: 0 2px 4px #000; margin-bottom: 2px; }
#bosscard b { display: block; font-size: clamp(30px, 6vw, 64px); font-weight: 800; letter-spacing: .12em; color: #fff; -webkit-text-stroke: 1px #3a1a08; text-shadow: 0 0 22px rgba(255, 120, 40, .7), 0 4px 0 #2a0c04; }
#bosscard b::after { content: ''; display: block; height: 3px; margin-top: 6px; width: 100%; background: linear-gradient(90deg, #ffc860, transparent); }
body.touch .btn.guard { right: 184px; bottom: 0; width: 56px; height: 56px; }
