/* Armory — parchment, wood, wax seals. Big obvious buttons. */
@font-face { font-family: "Cinzel Deco"; src: url("assets/fonts/CinzelDecorative-Bold.ttf"); font-weight: 700; }
@font-face { font-family: "Crimson"; src: url("assets/fonts/CrimsonText-Regular.ttf"); }
@font-face { font-family: "Crimson"; src: url("assets/fonts/CrimsonText-Bold.ttf"); font-weight: 700; }

:root {
  --ink: #2a1a0c; --ink-soft: #5a4028; --brass: #b8893a; --wood: #6b4226; --wood-dark: #3a2410;
  --parch: #f3e2c0; --parch-dark: #d9bf8e; --wax: #9c1e1e;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }   /* ns2: lock page scroll */
body.armory-page {
  font-family: "Crimson", Georgia, serif; color: var(--ink); height: 100%; min-height: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 200, 120, 0.18), transparent 60%),
    repeating-linear-gradient(90deg, #4a2e17 0 38px, #553519 38px 40px, #4d3018 40px 86px, #3f2713 86px 88px),
    #4a2e17;
}
.pill-row { display: flex; gap: 6px; flex: 1; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  background: linear-gradient(180deg, var(--parch), var(--parch-dark)); border: 2px solid var(--brass);
  font-weight: 700; font-size: 0.95rem; box-shadow: 0 3px 8px rgba(0,0,0,.35);
}
.pill img { width: 20px; height: 20px; }
.pill.gems i { width: 18px; height: 18px; background: url("assets/town/icon_gems.png") center/contain no-repeat; display: inline-block; }

.armory { max-width: 560px; margin: 0 auto; padding: 72px 10px 40px; }
.sign {
  text-align: center; margin: 0 auto 10px; padding: 10px 14px 8px; max-width: 340px;
  background: linear-gradient(180deg, #7a4d2b, #5a3519); border: 3px solid var(--brass); border-radius: 10px;
  box-shadow: 0 6px 0 #2d1b0b, 0 10px 24px rgba(0,0,0,.45); color: #fbe7bf;
}
.sign h1 { font-family: "Cinzel Deco", serif; margin: 0; font-size: 1.7rem; letter-spacing: .5px; text-shadow: 0 2px 0 #2d1b0b; }
.sign p { margin: 2px 0 0; font-style: italic; opacity: .9; }

.tabs { display: flex; gap: 6px; margin: 12px 0; }
.wood, .btn {
  font-family: "Crimson", serif; font-weight: 700; cursor: pointer; border-radius: 10px;
  border: 2px solid var(--brass); color: #fbe7bf;
  background: linear-gradient(180deg, #8a5a33, #5e3a1c); box-shadow: 0 4px 0 #2d1b0b;
  padding: 10px 12px; font-size: 1.05rem; line-height: 1.1;
}
.wood:active, .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2d1b0b; }
.tab { flex: 1; font-size: 1.1rem; padding: 12px 6px; }
.tab.active { background: linear-gradient(180deg, var(--parch), var(--parch-dark)); color: var(--ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }
.btn.small { font-size: .9rem; padding: 7px 10px; }
.btn.tiny { font-size: .8rem; padding: 4px 6px; border-radius: 7px; box-shadow: 0 2px 0 #2d1b0b; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn.big { font-size: 1.25rem; padding: 14px; }
.btn.round { width: 52px; height: 52px; border-radius: 50%; font-size: 1.6rem; padding: 0; }
.btn.danger { background: linear-gradient(180deg, #8a2b22, #5a160f); }
.btn.wax {
  background: radial-gradient(circle at 35% 30%, #d0413a, var(--set, var(--wax)) 60%, #5a0e0e);
  border-color: #e9c27a; text-shadow: 0 1px 0 rgba(0,0,0,.5);
}
.btn.wax small, .btn small { font-weight: 400; font-size: .8rem; opacity: .9; }

.parchment {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.35), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(120,80,30,.18), transparent 60%),
    linear-gradient(180deg, var(--parch), var(--parch-dark));
  border: 2px solid #a57b3c; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.card { padding: 12px; margin-bottom: 12px; }
.card h3 { font-family: "Cinzel Deco", serif; margin: 0 0 4px; font-size: 1.15rem; }
.hint { color: #f1dcb2; text-align: center; font-style: italic; margin: 6px 0 12px; }
.fine { font-size: .88rem; color: var(--ink-soft); margin: 6px 0; }

.seal {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.45), var(--set, var(--wax)) 45%, rgba(0,0,0,.55));
  color: #fff3d6; font-family: "Cinzel Deco", serif; font-weight: 700; font-size: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,.5), inset 0 0 0 3px rgba(0,0,0,.15);
}
.seal.big { width: 84px; height: 84px; font-size: 2.2rem; }

/* set readout */
.setcard { display: flex; gap: 12px; align-items: center; }
.portrait { width: 110px; min-height: 140px; border-radius: 10px; border: 3px solid var(--set); background: rgba(0,0,0,.15);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0; overflow: hidden; text-align: center; }
.portrait img { width: 100%; height: 150px; object-fit: cover; object-position: top; }
.portrait small { font-size: .72rem; color: var(--ink-soft); padding: 0 4px; }
.readout h3 { margin-bottom: 2px; }
.readout ul { margin: 4px 0; padding-left: 18px; }
.readout li { margin: 2px 0; font-size: .98rem; }
.rule { margin: 2px 0; font-size: .9rem; }
.next { font-size: .88rem; font-style: italic; color: #6b3d12; margin: 4px 0 0; }

/* 5x5 grid */
.wood-frame { background: linear-gradient(180deg, #6b4226, #4a2d16); border: 3px solid var(--brass); border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.grid { display: grid; grid-template-columns: 78px repeat(5, 1fr); gap: 5px; padding: 8px; }
.gh { color: #fbe7bf; text-align: center; font-weight: 700; font-size: .78rem; display: flex; flex-direction: column; align-items: center; }
.gh span { font-size: 1.2rem; }
.rowhead { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fbe7bf; text-align: center; font-size: .78rem; }
.rowhead b { line-height: 1; }
.gcell {
  position: relative; aspect-ratio: 1 / 1.1; border-radius: 9px; cursor: pointer; padding: 2px;
  border: 2px solid var(--set); color: var(--ink);
  background: radial-gradient(circle at 50% 35%, #fff7e2, var(--parch-dark));
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: "Crimson", serif;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.4), 0 3px 0 rgba(0,0,0,.35);
}
.gcell.empty { background: rgba(0,0,0,.25); border-style: dashed; box-shadow: none; }
.gcell.worn { box-shadow: 0 0 0 3px #f2c14e, 0 0 12px #f2c14e; }
.gcell .pi { font-size: 1.35rem; line-height: 1; }
.gcell .pi.dim { opacity: .3; filter: grayscale(1); }
.gcell b { font-size: 1rem; line-height: 1; }
.gcell small { font-size: .72rem; color: var(--ink-soft); line-height: 1; }
.gcell em.up { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .64rem; font-weight: 700;
  background: #f2c14e; color: #3a2410; padding: 1px 5px; border-radius: 6px; white-space: nowrap; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 10px #ffd66b; } }

/* piece chip */
.piece { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 74px; min-height: 84px; padding: 4px;
  border-radius: 10px; border: 3px solid var(--set); background: radial-gradient(circle at 50% 30%, #fffaf0, var(--parch-dark)); text-align: center; }
.piece .pi { font-size: 1.6rem; }
.piece b { font-size: 1.05rem; }
.piece small { font-size: .66rem; line-height: 1.05; color: var(--ink-soft); }
.piece.best { box-shadow: 0 0 0 2px #f2c14e; }
.piece.shiny { box-shadow: 0 0 14px 3px #ffd66b; }

/* sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(20,10,4,.65); display: flex; align-items: flex-end; justify-content: center; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; padding: 16px 14px 20px; border-radius: 16px 16px 0 0; }
.sheet-close { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--brass);
  background: var(--wood); color: #fbe7bf; font-size: 1.1rem; cursor: pointer; }
.sheet-title { font-family: "Cinzel Deco", serif; display: flex; align-items: center; gap: 8px; margin: 0 40px 2px 0; font-size: 1.3rem; }
.sub { margin: 0 0 8px; color: var(--ink-soft); }
.block { border-top: 2px dashed rgba(120,80,30,.4); padding-top: 8px; margin-top: 8px; }
.block h4 { margin: 0 0 6px; font-family: "Cinzel Deco", serif; font-size: .98rem; }
.lvrows { display: flex; flex-direction: column; gap: 6px; }
.lvrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lvrow .piece { width: 62px; min-height: 70px; }
.lvrow .piece small { display: none; }
.cnt { font-weight: 700; min-width: 70px; }
.upg { display: grid; gap: 3px; background: rgba(255,255,255,.35); padding: 8px; border-radius: 8px; }
.miss { color: #8a1c12; font-weight: 700; }
.bar { height: 12px; border-radius: 6px; background: rgba(0,0,0,.2); overflow: hidden; border: 1px solid #a57b3c; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #8d99a6, #dfe6ec); }
.odds { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.odds span { background: rgba(255,255,255,.5); border: 1px solid #a57b3c; border-radius: 6px; padding: 2px 6px; font-size: .86rem; }
.odds.sets span { border-color: var(--set); border-width: 2px; font-size: .78rem; }

/* chests */
.shelf { font-family: "Cinzel Deco", serif; color: #fbe7bf; margin: 14px 4px 6px; font-size: 1.05rem; text-shadow: 0 2px 0 #2d1b0b; }
.shelf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chest-card { padding: 10px; display: flex; flex-direction: column; align-items: center; text-align: center; border-top: 5px solid var(--set); }
.chest-card h4 { font-family: "Cinzel Deco", serif; margin: 6px 0 2px; font-size: .95rem; }
.chest-card p { margin: 0 0 4px; font-size: .84rem; color: var(--ink-soft); }
.chest-card .btn { margin-top: auto; font-size: .95rem; }
.chest { position: relative; width: 90px; height: 70px; }
.chest .box { position: absolute; bottom: 0; left: 0; right: 0; height: 60%; border-radius: 4px 4px 8px 8px;
  background: repeating-linear-gradient(90deg, #7a4a24 0 14px, #6b3f1d 14px 16px); border: 3px solid #c9a24f;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.25); }
.chest .lid { position: absolute; top: 0; left: 0; right: 0; height: 45%; border-radius: 40px 40px 4px 4px;
  background: repeating-linear-gradient(90deg, #8a5630 0 14px, #74461f 14px 16px); border: 3px solid #c9a24f; transform-origin: 50% 100%; z-index: 2; }
.chest .seal { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 3; width: 30px; height: 30px; font-size: .85rem; }
.chest.mini { transform: scale(.85); }
.chest.big { width: 160px; height: 125px; margin: 10px auto; }
.chest.big .seal { width: 52px; height: 52px; font-size: 1.3rem; }
.chest .glow { position: absolute; left: 50%; top: 40%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); opacity: 0; z-index: 1; }
.shaking { animation: shake .9s ease-in-out; }
.shaking .lid { animation: lid 0.6s ease-out 0.9s forwards; }
.shaking .seal { animation: crack 0.4s ease-in 0.8s forwards; }
.shaking .glow { animation: glow 1s ease-out 1s forwards; }
@keyframes shake { 0%,100% { transform: rotate(0); } 15% { transform: rotate(-6deg); } 30% { transform: rotate(6deg); } 45% { transform: rotate(-5deg); } 60% { transform: rotate(5deg); } 75% { transform: rotate(-3deg); } }
@keyframes lid { to { transform: rotateX(70deg) translateY(-18px); } }
@keyframes crack { to { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
@keyframes glow { 0% { opacity: .9; box-shadow: 0 0 0 0 #ffe7a0; } 100% { opacity: 0; box-shadow: 0 0 60px 60px rgba(255,231,160,0); } }
.open-stage { text-align: center; }
.loot { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; min-height: 90px; }
.flip { opacity: 0; transform: rotateY(90deg) translateY(20px); animation: flipin .45s ease-out forwards; }
@keyframes flipin { to { opacity: 1; transform: none; } }
.later { opacity: 0; animation: fadein .3s forwards; }
@keyframes fadein { to { opacity: 1; } }

/* shop */
.pickrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { font-family: "Crimson", serif; font-weight: 700; font-size: .95rem; padding: 8px 10px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--set, var(--brass)); background: rgba(255,255,255,.5); color: var(--ink); }
.chip.on { background: var(--set, var(--wood)); color: #fff3d6; box-shadow: 0 0 0 2px #f2c14e; }
.pickrow .btn.wax { flex: 1 1 45%; }
.lvpick { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0; }
.lvshow { font-size: 1.3rem; min-width: 100px; text-align: center; }
.buyline { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0; }
.curve { width: 100%; border-collapse: collapse; font-size: .8rem; margin-top: 8px; }
.curve th, .curve td { border: 1px solid #a57b3c; padding: 3px 2px; text-align: center; }
.crate { display: flex; align-items: center; gap: 10px; }
.crate img { width: 64px; height: 64px; }

.dev { margin-top: 18px; padding: 10px; border-radius: 10px; background: rgba(0,0,0,.3); color: #e8d3a8; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dev .note { width: 100%; margin: 4px 0 0; font-size: .8rem; opacity: .85; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; padding: 10px 16px; border-radius: 10px;
  background: linear-gradient(180deg, var(--parch), var(--parch-dark)); border: 2px solid var(--brass); font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
[hidden] { display: none !important; }
.grid { grid-template-columns: 66px repeat(5, minmax(0, 1fr)); gap: 4px; padding: 6px; }
.rowhead { font-size: .72rem; }
.rowhead .btn.tiny { font-size: .7rem; padding: 3px 4px; }
.lvrow .btn { font-size: .9rem; padding: 8px 9px; }
.lvrow .cnt { min-width: 44px; }

/* armory2 (kept in armory3): set value line, crate limit, Forge Secrets scroll */
.pill-row { gap: 4px; }
.pill { padding: 5px 8px; font-size: .9rem; }
.readout .value { margin: 2px 0; font-weight: 700; color: #6b3d12; font-size: .92rem; }
.limit { margin: 2px 0 0; font-size: .9rem; }
.limit b { color: #8a1c12; }
.secret-line { font-size: .92rem; }
.secret-line.ok b { color: #2f6b2f; }
.scroll { border-top: 6px solid var(--set); position: relative;
  background:
    linear-gradient(90deg, rgba(90,55,20,.25), transparent 6%, transparent 94%, rgba(90,55,20,.25)),
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.35), transparent 50%),
    linear-gradient(180deg, #f6e7c6, #dcc293); }
.keeper { display: flex; gap: 10px; align-items: center; }
.keeper-seal { width: 56px; height: 56px; font-size: 1.5rem; --set: #6a4a8c; }
.bands { display: grid; gap: 6px; margin-top: 6px; }
.band { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,.35); border: 1px dashed #a57b3c; }
.band.learned { background: rgba(255,255,255,.6); border-style: solid; border-color: var(--set); }
.band .seal { width: 36px; height: 36px; font-size: .95rem; }
.band .seal.shut { filter: grayscale(.6); }
.bandtxt { flex: 1; display: flex; flex-direction: column; line-height: 1.1; }
.bandtxt small { color: var(--ink-soft); }
.band .btn { white-space: nowrap; }
@media (max-width: 440px) {
  .armory-page .pill-row { flex-wrap: nowrap; gap: 3px; min-width: 0; }
  .armory-page .pill { padding: 4px 6px; gap: 3px; font-size: .8rem; border-width: 1.5px; }
  .armory-page .pill img, .armory-page .pill.gems i { width: 15px; height: 15px; }
}
.prog { color: #8a1c12; font-weight: 700; }
.prog.ok { color: #2f6b2f; }
.warnbox { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.4); border: 2px dashed #8a1c12; border-radius: 10px; padding: 10px; margin: 8px 0; }
.warnbox p { margin: 0; font-size: 1.05rem; }
.confirm-row { display: flex; gap: 8px; }
.confirm-row .btn { flex: 1; font-size: 1.05rem; }

/* armory3 (kept in armory4): quest cards with wax seals, crate premium odds, shared Steel cap */
.keeper.cold { opacity: .95; }
.keeper-seal.cold { filter: grayscale(.85) brightness(.8); }
.purse { margin: 4px 0 0; font-size: .92rem; }
.quests { display: grid; gap: 8px; margin-top: 8px; }
.quest { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; position: relative;
  background: linear-gradient(180deg, #fbf0d6, #ead3a3); border: 1px solid #a57b3c; box-shadow: 0 2px 0 rgba(90,55,20,.25); }
.quest.active { border: 2px solid var(--set, #8a5a2b); box-shadow: 0 0 0 2px rgba(242,193,78,.55), 0 3px 0 rgba(90,55,20,.3); }
.quest.locked { opacity: .72; filter: saturate(.6); }
.quest.learned { background: linear-gradient(180deg, #fffaf0, #efe0bd); }
.wax-seal { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff3d6; font-weight: 800; font-size: 1.1rem;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.45), var(--set) 45%, rgba(0,0,0,.55));
  clip-path: polygon(50% 0, 61% 7%, 75% 4%, 80% 17%, 94% 22%, 91% 36%, 100% 50%, 91% 64%, 94% 78%, 80% 83%, 75% 96%, 61% 93%, 50% 100%, 39% 93%, 25% 96%, 20% 83%, 6% 78%, 9% 64%, 0 50%, 9% 36%, 6% 22%, 20% 17%, 25% 4%, 39% 7%);
  text-shadow: 0 1px 1px rgba(0,0,0,.6); }
.wax-seal span { font-size: .95rem; }
.qbody { flex: 1; min-width: 0; }
.qhead { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.qhead b { font-size: 1.02rem; }
.qprice { font-size: .82rem; font-weight: 700; color: #6b3d12; text-align: right; }
.hook { margin: 4px 0; font-style: italic; color: #4a2c10; font-size: .92rem; }
.hook.big { font-size: 1.02rem; }
.qlist { list-style: none; padding: 0; margin: 4px 0 6px; font-size: .86rem; }
.qlist li { padding-left: 18px; position: relative; margin: 2px 0; color: #8a1c12; }
.qlist li::before { content: "○"; position: absolute; left: 0; }
.qlist li.ok { color: #2f6b2f; }
.qlist li.ok::before { content: "✓"; }
.quest .btn { white-space: nowrap; }
.rescue { text-align: center; }
.rescue .keeper-seal { margin: 0 auto 6px; }
.setpick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.setpick .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; }
.setpick .seal { width: 30px; height: 30px; font-size: .9rem; }
.setpick .btn:last-child { grid-column: 1 / -1; }
.odds.premium { align-items: center; }
.odds.premium .lbl { background: none; border: 0; font-weight: 700; padding-left: 0; }
.odds.premium span[style] { border: 2px solid var(--set); }
.shared { margin: 2px 0; }
.free-note { margin: 2px 0 0; font-size: .78rem; }

/* armory4: Keeper meeting, first quest, L5 offer, weekly errand tracker (7 seals) + Keeper's chest */
.quest.first, .quest.offer { margin: 8px 0; text-align: left; }
.offer-prices td, .offer-prices th { font-size: .78rem; padding: 3px 4px; }
.errands { margin-top: 10px; border-top: 6px solid #6a4a8c; }
.errands h3 { margin: 0 0 2px; }
.seals7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px 0 4px; }
.seal7 { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.seal7 .wax-seal { width: 38px; height: 38px; font-size: .9rem; }
.seal7 small { font-size: .72rem; color: var(--ink-soft); }
.seal7.today .wax-seal { box-shadow: 0 0 0 3px rgba(242,193,78,.8); border-radius: 50%; }
.seal7.ahead .wax-seal { opacity: .55; }
.seal7.missed .wax-seal { filter: grayscale(.8); }
.today-errand { margin: 4px 0; font-size: .9rem; }
.okc { color: #2f6b2f; font-weight: 700; }
.kchest { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; border: 1px dashed #6a4a8c; background: rgba(255,255,255,.35); margin: 6px 0; }
.kchest.ready { border: 2px solid #6a4a8c; box-shadow: 0 0 0 3px rgba(242,193,78,.6); background: rgba(255,248,225,.8); }
.kchest.lost { opacity: .7; filter: saturate(.5); }
.kchest .chest.mini { flex: 0 0 auto; }
.kchest small { font-size: .76rem; }
.chest-status { margin: 2px 0 0; }

/* ================= armory5: simple Armory (college pattern) =================
   Hero paperdoll in the middle, Gear (4 armor) left, Weapon + Off-hand right, one primary action, details tucked away. */
.top-hud .back-town.has-lbl, .top-hud .menu-btn.has-lbl { width: auto; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 22px; display: inline-flex; align-items: center; gap: 5px; }
.top-hud .menu-btn.has-lbl { border-radius: 12px; }
.has-lbl .lbl { font-style: normal; font-size: .85rem; font-weight: 700; }
.pill-stack { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.pill-stack strong { font-size: .85rem; }
.pill-lbl { font-style: normal; font-size: .6rem; font-weight: 600; letter-spacing: .03em; color: #5a4028; margin-top: 1px; }
@media (max-width: 440px) {
  .top-hud { gap: 5px; padding-left: 8px; padding-right: 8px; }
  .top-hud .pill-row { gap: 4px; flex-wrap: nowrap; }
  .top-hud .pill { padding: 4px 6px; gap: 4px; }
  .top-hud .pill img, .top-hud .pill.gems i { width: 16px; height: 16px; }
  .top-hud .back-town.has-lbl, .top-hud .menu-btn.has-lbl { padding: 0 8px; min-width: 40px; height: 40px; }
  .top-hud .has-lbl .lbl { display: none; }
}

.armory { max-width: 780px; }
.sign p { font-size: 1.02rem; }

/* icons: drawn art, palette (a), installed camp19 */
.si { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.si.dim { opacity: .35; }
.pi .si { width: 30px; height: 30px; margin: 0 auto; }
.piece .pi .si { width: 38px; height: 38px; }
.gh .si { width: 26px; height: 26px; }
.chip .si { width: 20px; height: 20px; display: inline-block; vertical-align: -5px; }
.chest .seal .si { width: 70%; height: 70%; filter: brightness(2.2) sepia(.3); }

/* the stage */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; padding: 14px 12px; align-items: start;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 226, 170, .55), transparent 62%),
    linear-gradient(180deg, #7a5230, #4a2d16); }
.col { display: flex; flex-direction: column; gap: 9px; }
.group-lbl { margin: 0 0 1px; text-align: center; font-family: "Cinzel Deco", serif; font-size: 1.05rem; color: #fbe7bf; text-shadow: 0 2px 0 #2d1b0b; letter-spacing: .5px; }
.slot {
  position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 78px; padding: 7px 8px; cursor: pointer; text-align: left;
  font-family: "Crimson", serif; color: var(--ink); border-radius: 12px; border: 3px solid var(--set, #a57b3c);
  background: radial-gradient(circle at 30% 30%, #fff8e4, var(--parch) 45%, var(--parch-dark));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 4px 0 #2d1b0b, 0 8px 16px rgba(0,0,0,.35);
}
.slot:active { transform: translateY(3px); box-shadow: 0 1px 0 #2d1b0b; }
.slot:focus-visible { outline: 3px solid #f2c14e; outline-offset: 2px; }
.slot.empty { border-style: dashed; background: linear-gradient(180deg, rgba(243,226,192,.75), rgba(217,191,142,.75)); }
.slot-ic { width: 54px; height: 54px; flex-shrink: 0; border-radius: 50%; padding: 5px; background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.7), rgba(120,80,30,.18)); }
.slot-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.slot-txt b { font-size: 1.08rem; }
.slot-txt small { font-size: .84rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .dot { position: absolute; top: -8px; right: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700;
  background: radial-gradient(circle at 35% 30%, #e0524a, var(--wax) 60%, #5a0e0e); color: #fff3d6; border: 2px solid #e9c27a; font-size: .85rem; animation: pulse 1.4s infinite; }

.col-hero { align-items: center; text-align: center; }
.doll { position: relative; width: 100%; height: 330px; display: flex; align-items: flex-end; justify-content: center; }
.doll::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 0; height: 26px; border-radius: 50%; background: radial-gradient(ellipse, rgba(0,0,0,.45), transparent 70%); }
.hero-img { position: relative; max-height: 100%; max-width: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.hero-name { margin: 4px 0 6px; color: #fbe7bf; font-size: 1.05rem; text-shadow: 0 1px 0 #2d1b0b; }
.set-banner { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border-radius: 10px; text-align: left; font-family: "Crimson", serif; color: var(--ink);
  background: linear-gradient(180deg, var(--parch), var(--parch-dark)); border: 2px solid var(--set, #a57b3c); box-shadow: 0 3px 0 #2d1b0b; }
button.set-banner { cursor: pointer; }
.set-banner span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.set-banner b { font-size: .98rem; }
.set-banner small { font-size: .8rem; color: var(--ink-soft); }
.set-banner .seal.dim { background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.4), #8a7a64 50%, #4a3a28); }

.primary { text-align: center; margin: 14px 0 6px; }
.primary-btn { min-width: 280px; font-size: 1.45rem; padding: 16px 26px; border-radius: 14px; }
.primary-note { margin: 8px 0 0; color: #f1dcb2; font-style: italic; }

/* tucked-away details */
.more { margin-top: 16px; }
.more > summary { list-style: none; display: block; text-align: center; font-size: 1.05rem; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary { margin-bottom: 4px; }
.more-lead { color: #f1dcb2; text-align: center; font-style: italic; margin: 6px 0 10px; }
.grid { grid-template-columns: 78px repeat(5, 1fr); }   /* armory6: 5 slots, no weapon column */
.dev { display: block; }
.dev > summary { cursor: pointer; font-weight: 700; margin-bottom: 6px; }
.dev[open] { display: flex; flex-wrap: wrap; gap: 6px; }
.dev[open] > summary { width: 100%; }

/* slot sheet */
.slot-title { gap: 10px; }
.slot-title .si.big { width: 46px; height: 46px; }
.own-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.own-row { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 10px; border: 2px solid var(--set); background: rgba(255,255,255,.4); }
.own-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.own-txt small { color: var(--ink-soft); font-size: .86rem; }
.own-row .btn.wax { font-size: 1.1rem; padding: 10px 16px; }
.worn-tag { font-weight: 700; color: #2f6b2f; padding: 0 8px; }
.empty-note { font-size: 1.05rem; }

/* plain tooltips on hover (desktop); phones get the same words in the slot sheet */
@media (hover: hover) {
  [data-tip] { position: relative; }
  .slot[data-tip]:hover::after, .group-lbl[data-tip]:hover::after, .set-banner[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); z-index: 30; width: max-content; max-width: 240px;
    padding: 7px 10px; border-radius: 8px; background: #fff3d6; color: var(--ink); border: 2px solid var(--brass); font: 400 .9rem/1.25 "Crimson", serif; text-align: left;
    box-shadow: 0 6px 14px rgba(0,0,0,.4); text-shadow: none; letter-spacing: 0; pointer-events: none; }
}

@media (max-width: 560px) {
  .armory { padding-left: 8px; padding-right: 8px; }
  .sign { max-width: 100%; }
  .sign h1 { font-size: 1.45rem; }
  .stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr); gap: 6px; padding: 10px 6px; }
  .slot { flex-direction: column; justify-content: center; text-align: center; gap: 2px; min-height: 84px; padding: 6px 4px; }
  .slot-txt { align-items: center; }
  .slot-txt b { font-size: .95rem; }
  .slot-txt small { font-size: .74rem; }
  .slot-ic { width: 44px; height: 44px; padding: 4px; }
  .group-lbl { font-size: .92rem; }
  .doll { height: 300px; }
  .hero-name { font-size: .95rem; }
  .set-banner { flex-direction: column; text-align: center; gap: 3px; padding: 6px 5px; }
  .set-banner span:last-child { align-items: center; }
  .set-banner small { font-size: .72rem; }
  .primary-btn { width: 100%; min-width: 0; }
  .grid { grid-template-columns: 58px repeat(5, 1fr); gap: 3px; padding: 5px; }
  .tabs .tab { font-size: .95rem; padding: 10px 4px; }
}
/* armory7: set chest result note (new piece vs duplicate) */
.dup-note { margin: 8px auto 0; max-width: 300px; font-size: .95em; color: #4a2e14; text-align: center; font-weight: 600; }
.dup-note.new { color: #2f6b3f; font-weight: 700; }

/* ---------- no-scroll pass (ns1): the Armory fits one screen at 390x844 and 1280x800 ---------- */
.armory { height: 100vh; height: 100dvh; padding: 62px 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.armory > .sign { margin: 0 auto; padding: 5px 12px 4px; flex: none; }
.armory > .sign h1 { font-size: 1.35rem; } .armory > .sign p { font-size: .88rem; margin: 0; }
.armory > .home { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.home .stage { flex: 1; min-height: 0; padding: 8px 8px; gap: 8px; }
.home .col { gap: 7px; }
.home .slot { min-height: 70px; }
.home .col-hero { min-height: 0; display: flex; flex-direction: column; height: 100%; }
.home .doll { flex: 1; min-height: 160px; height: auto; max-height: 340px; }
.home .hero-name { margin: 2px 0 4px; }
.home .primary { margin: 6px 0 0; }
.home .primary-btn { padding: 12px 22px; font-size: 1.3rem; }
.home .primary-note { margin: 3px 0 0; font-size: .88rem; }
/* "More" opens as a sheet over the room; its lists scroll inside (genuinely long data) */
.armory > .more { margin: 0; flex: none; text-align: center; }
.more > summary.more-sum { display: inline-block; padding: 8px 16px; font-size: .95rem; }
.more .ms-close { display: none; }
.more[open] { position: fixed; z-index: 120; left: 0; right: 0; top: 58px; bottom: 0; margin: 0 auto; max-width: 780px; padding: 8px 10px 10px; display: flex; flex-direction: column; text-align: left;
  background: linear-gradient(180deg, #5d3a1d, #3a2410); border: 3px solid var(--brass); border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.6); }
.more[open] > summary.more-sum { align-self: flex-end; margin: 0; padding: 6px 14px; }
.more[open] .ms-open { display: none; } .more[open] .ms-close { display: inline; }
.more[open] .tabs { margin: 6px 0; flex: none; }
.more[open] .pane:not([hidden]) { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* test tools: a small pill in the corner, opens as a sheet */
.armory > details.dev { position: fixed; z-index: 130; right: 8px; bottom: 8px; margin: 0; padding: 0; background: none; }
.armory > details.dev > summary { list-style: none; margin: 0; height: 32px; line-height: 28px; padding: 0 10px; border-radius: 999px; border: 2px solid var(--brass); background: rgba(40,24,10,.8); color: #e8d3a8; font-size: .8rem; opacity: .8; }
.armory > details.dev > summary::-webkit-details-marker { display: none; }
.armory > details.dev[open] { left: 8px; max-width: 520px; margin-left: auto; padding: 10px; border-radius: 12px; background: rgba(30,18,8,.97); border: 2px solid var(--brass); box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.armory > details.dev[open] > summary { width: auto; display: inline-block; opacity: 1; }
@media (max-width: 560px) {
  .home .stage { gap: 5px; padding: 6px 5px; }
  .home .slot { min-height: 0; padding: 4px 3px; }
  .home .slot-ic { width: 38px; height: 38px; padding: 3px; }
  .home .group-lbl { font-size: .85rem; }
  .home .set-banner { padding: 4px 4px; }
  .home .primary-btn { padding: 11px 14px; font-size: 1.2rem; min-height: 50px; }   /* night1: tap target >= 50px */
}
/* night1: chests one shelf at a time, compact cards; pieces grid fits a 390px phone */
.shelf-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 0 0 6px; }
.shelf-tab { min-height: 40px; padding: 4px 2px; border-radius: 10px; border: 2px solid var(--brass); background: rgba(40,24,10,.85); color: #fbe7bf; font: 700 .9rem "Crimson", Georgia, serif; cursor: pointer; }
.shelf-tab.on { background: linear-gradient(180deg, var(--parch), var(--parch-dark)); color: var(--ink); }
.shelf-grp[hidden] { display: none !important; }
.shelf-grp .shelf { margin-top: 4px; }
.chest-card.compact { padding: 6px 6px 8px; }
.chest-card.compact h4 { margin: 2px 0 1px; }
.chest-card.compact p { font-size: .8rem; line-height: 1.15; }
.chest-card.compact .chest.mini { transform: scale(.8); margin: -6px 0 -8px; }
.grid { grid-template-columns: 64px repeat(5, minmax(0, 1fr)); gap: 4px; padding: 6px; }
.gcell { min-width: 0; }
.rowhead { font-size: .72rem; min-width: 0; }
.rowhead .btn.tiny { padding: 2px 4px; font-size: .68rem; }
.more[open] { overflow: hidden; }
.shelf-nav.two { grid-template-columns: 1fr 1fr; }
#pane-shop .card[hidden] { display: none !important; }
#pane-shop .curve { display: none; }
.shelf-grp[data-grp=set] .shelf-row, .shelf-grp[data-grp=slot] .shelf-row, .shelf-grp[data-grp=sure] .shelf-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.shelf-grp[data-grp=set] .chest-card h4, .shelf-grp[data-grp=slot] .chest-card h4, .shelf-grp[data-grp=sure] .chest-card h4 { font-size: .8rem; }
.shelf-grp[data-grp=set] .chest-card .btn, .shelf-grp[data-grp=slot] .chest-card .btn, .shelf-grp[data-grp=sure] .chest-card .btn { font-size: .82rem; padding-left: 4px; padding-right: 4px; }
.shelf-grp .shelf { display: none; }

/* armory_story_v1: Old Hobb's forge (Pactfire + Gravewake from the story), "Story ch N" locks, Curse broken card */
.stlock { display: inline-block; font-style: normal; font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: #3a2a1a; color: #f3dfb0; border: 1px solid #8a6a3a; white-space: nowrap; vertical-align: middle; }
.rowhead .stlock { margin: 0 4px; }
.hobb { padding: 8px 10px; }
.hobb-head { display: flex; gap: 8px; align-items: center; }
.hobb-head h3 { margin: 0; font-size: 1rem; }
.hobb-head .fine { margin: 2px 0 0; }
.hrow { margin-top: 8px; padding: 6px; border-radius: 10px; border: 2px solid var(--set); background: rgba(255,255,255,.25); }
.hrow-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hrow-h small { opacity: .8; }
.hrow-h .stlock { margin-left: auto; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--set); background: transparent; }
.pips i.on { background: var(--set); }
.htiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 5px; }
.htile { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 2px; border-radius: 8px; border: 2px solid var(--set); background: #fff8e6; cursor: pointer; min-height: 48px; }
.htile .pi img, .htile .pi svg { width: 26px; height: 26px; }
.htile small { font-size: .66rem; font-weight: 700; line-height: 1.1; }
.htile.lock { opacity: .6; cursor: default; border-style: dashed; }
.htile.got small { color: #2f6b2f; }
.htile.got.lock { opacity: 1; }
.hcost { margin: 4px 0 0; font-size: .72rem; }
.stlock-p { margin: 4px 0; }
.curse-line { color: #6a4a8c; font-weight: 700; }
.curse-card { position: fixed; inset: 0; z-index: 90; background: rgba(10,6,16,.6); display: flex; align-items: center; justify-content: center; }
.curse-box { width: min(330px, 88vw); background: linear-gradient(180deg, #f6ead0, #e4d0a4); border: 3px solid #6a4a8c; border-radius: 14px; padding: 16px; text-align: center; color: #2a1d10; }
.curse-box h3 { margin: 8px 0 4px; color: #4a2f6a; }
