/* ELDRUNA: SHIELDWALL - handbook overlay (js/handbook.js, 11.10.2026). Dark parchment-free panel in the game's black/orange look. */
#ov-hb { z-index: 6; display: none; padding: 0; text-align: left; background: #080706; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#ov-hb.on { display: block; }
#ov-hb .hb-head { position: sticky; top: 0; z-index: 3; background: linear-gradient(180deg, #17100a 0%, #0c0907 100%); border-bottom: 2px solid #3a2210; padding: 10px 12px 0; box-shadow: 0 6px 16px rgba(0, 0, 0, .55); }
#ov-hb .hb-top { display: flex; align-items: center; gap: 10px; max-width: 980px; margin: 0 auto; }
#ov-hb .hb-top h2 { flex: 1; margin: 0; font-size: clamp(11px, 2vw, 18px); text-align: left; }
#ov-hb .hb-count { font-family: "Press Start 2P", monospace; font-size: clamp(7px, 1.1vw, 10px); color: #e0a458; white-space: nowrap; }
#ov-hb .hb-x { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255, 150, 80, .6); background: #0c0c0c; color: var(--orange); font-family: "Press Start 2P", monospace; font-size: 12px; cursor: pointer; }
#ov-hb .hb-x:hover, #ov-hb .hb-x:focus-visible { color: #fff; border-color: var(--orange); }
#ov-hb .hb-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 9px; max-width: 980px; margin: 0 auto; scrollbar-width: none; }
#ov-hb .hb-tabs::-webkit-scrollbar { display: none; }
#ov-hb .hb-tabs button { position: relative; flex: none; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 2px solid #333; background: #0c0c0c; color: #b3aba5; font: inherit; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; white-space: nowrap; }
#ov-hb .hb-tabs button small { font-size: 11px; opacity: .75; margin-left: 2px; }
#ov-hb .hb-tabs button.on { background: var(--orange); color: #000; border-color: var(--orange); }
#ov-hb .hb-nw { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: #ffd23f; box-shadow: 0 0 0 2px #0c0907; }
#ov-hb .hb-body { padding: 12px 12px 22px; max-width: 980px; margin: 0 auto; color: #e9e4dc; }
#ov-hb p { text-align: left; font-size: clamp(14px, 1.6vw, 16px); line-height: 1.38; margin: 4px 0; color: #e0d9d0; letter-spacing: .02em; }
#ov-hb .hb-fine { font-size: 13px; color: #a69d94; line-height: 1.35; }
#ov-hb .hb-fine b { color: #e0a458; }
#ov-hb h3 { font-family: "Press Start 2P", monospace; font-size: clamp(9px, 1.3vw, 12px); color: var(--orange); margin: 2px 0 6px; line-height: 1.5; text-transform: uppercase; }
#ov-hb h4 { font-family: "Press Start 2P", monospace; font-size: 8px; color: #e0a458; margin: 8px 0 4px; }
.hb-px { image-rendering: pixelated; image-rendering: crisp-edges; display: inline-block; vertical-align: middle; flex: none; background: none; touch-action: manipulation; }   /* game.css styles every canvas (block, dark fill, touch-action none): undo that for sprite icons */
/* top bar of a tab: note + spoiler switch */
#ov-hb .hb-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
#ov-hb .hb-bar p { flex: 1 1 260px; margin: 0; }
#ov-hb .hb-spoil { min-height: 36px; border: 2px solid #3a3a3a; background: #0c0c0c; color: #b3aba5; border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
#ov-hb .hb-spoil.on { border-color: var(--orange); color: var(--orange); }
/* how to play */
#ov-hb .hb-demo-wrap { position: relative; margin: 0 auto 10px; max-width: 576px; }
#ov-hb .hb-demo-wrap.sm { max-width: 420px; margin: 8px 0; }
#ov-hb canvas.hb-demo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; border: 3px solid #0b0b0b; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255, 150, 80, .45), 0 10px 22px rgba(0, 0, 0, .55); background: #1b1d19; touch-action: pan-y; }
#ov-hb .hb-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
#ov-hb .hb-toc button { min-height: 32px; border: 1px solid #3a2a1c; background: #140e09; color: #e0a458; border-radius: 8px; padding: 5px 10px; font: inherit; font-weight: 700; font-size: 13px; letter-spacing: .03em; cursor: pointer; }
#ov-hb .hb-toc button:hover { color: #fff; border-color: var(--orange); }
#ov-hb .hb-sec { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(180deg, #1a1410, #0f0c0a); border: 2px solid #2a1c12; border-radius: 12px; padding: 12px; margin-bottom: 10px; scroll-margin-top: 110px; }
#ov-hb .hb-sec.wide { display: block; }
#ov-hb .hb-art { flex: 0 0 200px; min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; background: radial-gradient(circle at 50% 60%, #2a2118, #120e0b 70%); border-radius: 10px; padding: 8px; }
#ov-hb .hb-art b { font-family: "Press Start 2P", monospace; color: var(--orange); font-size: 10px; }
#ov-hb .hb-art .hb-vs { font-size: 9px; color: #e0a458; }
#ov-hb .hb-txt { flex: 1; min-width: 0; }
#ov-hb kbd { display: inline-block; min-width: 26px; padding: 2px 6px 4px; margin: 0 2px 2px 0; border-radius: 6px; background: #2a2a2a; border: 1px solid #555; box-shadow: inset 0 -3px 0 #111; color: #fff; font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 15px; line-height: 1.1; text-align: center; }
#ov-hb .hb-keys, #ov-hb .hb-list { list-style: none; padding: 0; margin: 6px 0; }
#ov-hb .hb-keys li { margin: 4px 0; font-size: 15px; color: #e0d9d0; font-weight: 700; }
#ov-hb .hb-list li { position: relative; padding: 3px 0 3px 16px; font-size: 14px; line-height: 1.35; color: #ddd5cc; }
#ov-hb .hb-list li::before { content: ""; position: absolute; left: 3px; top: 10px; width: 6px; height: 6px; background: var(--orange); }
#ov-hb .hb-list li b { color: #ffb37a; }
#ov-hb .hb-list li.done b::after { content: " \2713"; color: #7ed957; }
#ov-hb .hb-minicards { display: flex; gap: 4px; }
#ov-hb .hb-minicards i { display: flex; align-items: center; justify-content: center; width: 34px; height: 46px; border-radius: 6px; background: linear-gradient(180deg, #2a2a2a, #111); box-shadow: 0 0 0 2px rgba(255, 150, 80, .5); }
/* timeline */
#ov-hb .hb-tl { position: relative; height: 74px; margin: 8px 18px 6px 8px; }
#ov-hb .hb-tlbar { position: absolute; left: 0; right: 0; bottom: 14px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #ff5e00 0%, #b3261e 80%, #5a1010 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6); }
#ov-hb .hb-tlbar .sw { position: absolute; top: -3px; bottom: -3px; border-radius: 3px; background: repeating-linear-gradient(45deg, rgba(255, 210, 63, .7) 0 4px, rgba(0, 0, 0, 0) 4px 8px); }
#ov-hb .hb-tlbar .end { position: absolute; top: 0; bottom: 0; right: 0; background: repeating-linear-gradient(90deg, #3a0d00 0 3px, #170606 3px 6px); border-radius: 0 4px 4px 0; }
#ov-hb .hb-tlm { position: absolute; bottom: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
#ov-hb .hb-tlm b { font-family: "Press Start 2P", monospace; font-size: 7px; color: #fff; background: #000; padding: 1px 3px; border-radius: 3px; margin-top: 12px; }
#ov-hb .hb-tlm .hb-px { margin-bottom: -10px; }
#ov-hb .hb-tlm.inf b { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 16px; line-height: 1; color: var(--orange); }
/* battlefields + characters */
#ov-hb .hb-fields, #ov-hb .hb-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
#ov-hb .hb-field, #ov-hb .hb-char { background: #0d0a08; border: 1px solid #2f2116; border-radius: 10px; padding: 9px 10px; }
#ov-hb .hb-fhead { display: flex; align-items: center; gap: 8px; }
#ov-hb .hb-fhead b, #ov-hb .hb-char b { font-family: "Press Start 2P", monospace; font-size: 9px; color: var(--orange); line-height: 1.5; display: block; }
#ov-hb .hb-stars { color: #ffd23f; font-size: 13px; letter-spacing: 1px; }
#ov-hb .hb-char { display: flex; gap: 10px; align-items: center; }
#ov-hb .hb-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
#ov-hb .hb-chips span { font-size: 12px; font-weight: 700; color: #ffd8b8; background: #2a1405; border: 1px solid #5a2c0c; border-radius: 999px; padding: 2px 8px; letter-spacing: .03em; }
#ov-hb .hb-roster { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
#ov-hb .hb-ar { display: inline-flex; flex-direction: column; align-items: center; min-width: 34px; background: #17110c; border-radius: 6px; padding: 3px 2px; }
#ov-hb .hb-ar b { font-family: "Press Start 2P", monospace; font-size: 6px; color: #b3aba5; margin-top: 2px; }
/* entries (weapons, evolutions, passives, blessings, enemies) */
#ov-hb .hb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; align-items: start; }
#ov-hb .hb-entry { background: linear-gradient(180deg, #221a14, #100c0a); border: 2px solid #31221a; border-radius: 12px; padding: 0; color: #e9e4dc; scroll-margin-top: 110px; }
#ov-hb .hb-entry.flat { padding: 10px 12px; }
#ov-hb details.hb-entry[open] { grid-column: 1 / -1; border-color: #6a3714; }
#ov-hb .hb-entry.evo { border-color: #6a3714; background: linear-gradient(180deg, #3a2208, #140b04); }
#ov-hb .hb-entry.locked { opacity: .78; border-style: dashed; }
#ov-hb .hb-entry.hb-focus { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange), 0 0 22px rgba(255, 94, 0, .35); }
#ov-hb summary, #ov-hb .hb-sum { display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer; padding: 10px 12px; min-height: 60px; }
#ov-hb .hb-sum { padding: 0 0 4px; cursor: default; }
#ov-hb summary::-webkit-details-marker { display: none; }
#ov-hb summary::after { content: "+"; margin-left: auto; font-family: "Press Start 2P", monospace; font-size: 12px; color: var(--orange); }
#ov-hb details[open] > summary::after { content: "-"; }
#ov-hb summary > .hb-px, #ov-hb .hb-sum > .hb-px { background: radial-gradient(circle, #2e241b, #0d0a08 72%); border-radius: 8px; padding: 4px; box-sizing: content-box; }
#ov-hb summary span, #ov-hb .hb-sum span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#ov-hb summary b, #ov-hb .hb-sum b { font-family: "Press Start 2P", monospace; font-size: clamp(8px, 1.1vw, 10px); color: var(--orange); line-height: 1.5; }
#ov-hb summary small, #ov-hb .hb-sum small { font-size: 14px; color: #cfc6bc; font-weight: 600; line-height: 1.3; }
#ov-hb .locked summary b, #ov-hb .locked .hb-sum b { color: #6d6259; }
#ov-hb .hb-newt { font-style: normal; font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 11px; color: #000; background: #ffd23f; border-radius: 4px; padding: 0 5px; margin-left: 8px; text-transform: uppercase; vertical-align: 2px; }
#ov-hb .hb-detail { padding: 0 12px 12px; }
#ov-hb details.locked > p, #ov-hb details.locked > .hb-rcp { padding: 0 12px; }
#ov-hb details.locked > p:last-child { padding-bottom: 10px; }
/* weapon details: demo on the left, numbers on the right (stacked on phones) */
#ov-hb .hb-cols { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 14px; align-items: start; }
#ov-hb .hb-cols .hb-demo-wrap.sm { margin: 4px 0; max-width: none; }
@media (max-width: 760px) { #ov-hb .hb-cols { grid-template-columns: 1fr; } }
/* level selector under the demo */
#ov-hb .hb-lvs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
#ov-hb .hb-lvs button { flex: 1 1 0; min-width: 52px; min-height: 36px; border: 2px solid #333; background: #0c0c0c; color: #b3aba5; border-radius: 8px; font: inherit; font-weight: 800; font-size: 12px; text-transform: uppercase; cursor: pointer; }
#ov-hb .hb-lvs button.on { border-color: var(--orange); color: #000; background: var(--orange); }
#ov-hb .hb-lvs button.evo { color: #ffd23f; border-color: #6a3714; }
#ov-hb .hb-lvs button.evo.on { background: #ffd23f; color: #000; border-color: #ffd23f; }
/* stat tables */
#ov-hb .hb-tblw { overflow-x: auto; margin: 8px 0; border-radius: 8px; border: 1px solid #31221a; }
#ov-hb .hb-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
#ov-hb .hb-tbl th, #ov-hb .hb-tbl td { padding: 5px 7px; text-align: center; border-bottom: 1px solid #241a13; white-space: nowrap; }
#ov-hb .hb-tbl thead th { font-family: "Press Start 2P", monospace; font-size: 8px; color: #e0a458; background: #17100b; }
#ov-hb .hb-tbl tbody th { text-align: left; font-weight: 700; color: #cfc6bc; font-size: 13px; white-space: normal; min-width: 92px; }
#ov-hb .hb-tbl td { font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
#ov-hb .hb-tbl td.up { color: #ffb37a; }
#ov-hb .hb-tbl .evo { background: rgba(255, 94, 0, .1); color: #ffd23f; }
#ov-hb .hb-tbl .sel { outline: 2px solid var(--orange); outline-offset: -2px; }
#ov-hb .hb-recipe { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
#ov-hb .hb-recipe b { font-family: "Press Start 2P", monospace; font-size: 8px; color: #ffd23f; }
#ov-hb .hb-rcp { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
#ov-hb .hb-rcp span { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 84px; background: #0d0a08; border: 1px solid #3a2414; border-radius: 10px; padding: 8px 6px; text-align: center; }
#ov-hb .hb-rcp span.ev { border-color: var(--orange); box-shadow: 0 0 14px rgba(255, 94, 0, .3); }
#ov-hb .hb-rcp b { font-family: "Press Start 2P", monospace; font-size: 7px; color: var(--orange); line-height: 1.5; }
#ov-hb .hb-rcp i { font-style: normal; font-size: 12px; color: #a69d94; font-weight: 700; }
#ov-hb .hb-rcp em { font-style: normal; font-family: "Press Start 2P", monospace; font-size: 14px; color: #ffd23f; }
#ov-hb .hb-diff em, #ov-hb .hb-list em { font-style: normal; color: #ffd23f; font-weight: 800; }
#ov-hb .hb-arrow { color: var(--orange); font-weight: 800; }
#ov-hb .hb-steps { list-style: none; padding: 0; margin: 6px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
#ov-hb .hb-steps li { display: flex; align-items: center; gap: 8px; background: #0d0a08; border-radius: 6px; padding: 4px 8px; font-size: 14px; font-weight: 700; color: #e9e4dc; }
#ov-hb .hb-steps b { font-family: "Press Start 2P", monospace; font-size: 8px; color: #000; background: var(--orange); border-radius: 4px; padding: 3px 5px; }
#ov-hb .hb-big { font-size: 18px !important; font-weight: 800; color: #ffd23f !important; }
#ov-hb .hb-big small { font-size: 13px; color: #a69d94; font-weight: 600; }
/* bestiary */
#ov-hb .hb-maps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: thin; }
#ov-hb .hb-maps button { flex: none; min-height: 34px; border: 2px solid #333; background: #0c0c0c; color: #b3aba5; border-radius: 999px; padding: 5px 12px; font: inherit; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
#ov-hb .hb-maps button.on { border-color: var(--orange); color: var(--orange); }
#ov-hb .foe.boss { border-color: #5a1a14; background: linear-gradient(180deg, #2a1210, #100808); }
#ov-hb .hb-stat { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 6px 0; }
#ov-hb .hb-stat div { background: #0d0a08; border-radius: 6px; padding: 4px 2px; text-align: center; }
#ov-hb .hb-stat dt { font-size: 11px; color: #a69d94; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
#ov-hb .hb-stat dd { margin: 0; font-family: "Press Start 2P", monospace; font-size: 9px; color: #fff; line-height: 1.8; }
/* title button (next to the gear), pause button, level-up "?" */
.hb-open { position: absolute; top: 10px; left: 54px; z-index: 2; height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px 0 10px; border-radius: 999px; border: 2px solid rgba(255, 150, 80, .55); background: rgba(0, 0, 0, .55); color: var(--orange); cursor: pointer; font-family: "Press Start 2P", monospace; font-size: 8px; text-transform: uppercase; }
.hb-open img { width: 24px; height: 24px; image-rendering: pixelated; }
.hb-open:hover, .hb-open:focus-visible { color: #fff; border-color: var(--orange); }
.hb-dot { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #ffd23f; color: #000; font-style: normal; font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 12px; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #000; }
.hb-dot[hidden] { display: none; }
#cards .card { position: relative; }
.hb-q { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid rgba(255, 150, 80, .7); background: #0c0c0c; color: var(--orange); font-family: "Press Start 2P", monospace; font-size: 11px; line-height: 1; cursor: pointer; z-index: 1; }
.hb-q:hover, .hb-q:focus-visible { background: var(--orange); color: #000; }
.hb-q::before { content: ""; position: absolute; inset: -7px; }   /* 44 px touch target */
/* discovery toast */
.hb-toast { position: absolute; right: 10px; bottom: 26px; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .78); border: 2px solid rgba(255, 150, 80, .6); color: #fff; pointer-events: none; opacity: 0; transform: translateY(8px); max-width: 70%; }
.hb-toast span { display: flex; flex-direction: column; font-weight: 700; font-size: 13px; line-height: 1.2; }
.hb-toast b { font-family: "Press Start 2P", monospace; font-size: 7px; color: #ffd23f; font-weight: 400; margin-bottom: 3px; }
.hb-toast.on { animation: hbtoast 3.2s ease forwards; }
@keyframes hbtoast { 0% { opacity: 0; transform: translateY(8px); } 10%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hb-toast.on { animation-duration: 3.2s; transform: none; } }
@media (max-width: 600px) {
  .hb-open { padding: 0 7px; } .hb-open .hb-lbl { display: none; }
  #ov-hb .hb-head { padding: 8px 8px 0; }
  #ov-hb .hb-body { padding: 10px 8px 20px; }
  #ov-hb .hb-sec { flex-direction: column; gap: 8px; padding: 10px; }
  #ov-hb .hb-art { flex-basis: auto; width: 100%; min-height: 56px; }
  #ov-hb .hb-grid { grid-template-columns: 1fr; }
  #ov-hb .hb-fields, #ov-hb .hb-chars { grid-template-columns: 1fr; }
  #ov-hb .hb-tbl { font-size: 13px; } #ov-hb .hb-tbl th, #ov-hb .hb-tbl td { padding: 4px 4px; }
  #ov-hb .hb-tbl tbody th { min-width: 74px; font-size: 12px; }
  #ov-hb .hb-stat { grid-template-columns: repeat(3, 1fr); }
  #ov-hb .hb-rcp span { min-width: 72px; }
  .hb-q { top: 50%; right: 8px; transform: translateY(-50%); }
  #cards .card { padding-right: 46px; }
}
/* phones: the game screen is small, so the handbook takes the whole viewport (still inside #screen, so fullscreen keeps working) */
@media (max-width: 600px), (max-height: 520px) {
  #ov-hb { position: fixed; inset: 0; z-index: 60; border-radius: 0; height: 100%; height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
  #ov-hb .hb-head { padding-top: max(8px, env(safe-area-inset-top)); }
}
/* recipe icons on a small light chip, so dark sprites (raven) stay visible */
#ov-hb .hb-recipe .hb-px { background: #3a2c20; border-radius: 6px; padding: 3px; box-sizing: content-box; }
