/* Compact enchanting book covers with captions; details live in #enchantBookTooltip. */
#bookLoadout .ench-grid,#resultBookLoadout .ench-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#bookLoadout .ench-book-wrap,#resultBookLoadout .ench-book-wrap{display:flex;min-width:0;border-radius:12px}
#bookLoadout .ench-book-wrap:focus-visible,#resultBookLoadout .ench-book-wrap:focus-visible{outline:3px dashed var(--amber);outline-offset:3px}
#bookLoadout .ench-book,#resultBookLoadout .ench-book{display:flex;align-items:center;width:100%;min-width:0;min-height:44px;padding:7px 8px 7px 15px;font-size:11px;line-height:1.3;border-radius:12px;border-color:color-mix(in srgb,var(--ench-color,var(--slate)) 45%,var(--slate))}
#bookLoadout .ench-book>:not(strong):not(.ench-book-cover),#resultBookLoadout .ench-book>:not(strong):not(.ench-book-cover){display:none!important}
#bookLoadout .ench-book strong,#resultBookLoadout .ench-book strong{display:block;min-width:0;overflow-wrap:anywhere;font-weight:800;color:var(--chalk)}
#bookLoadout .ench-book::before,#resultBookLoadout .ench-book::before{width:5px;border-radius:12px 0 0 12px;background:var(--ench-color,var(--rhodo-d))}
#bookLoadout .ench-book:hover:not(:disabled),#resultBookLoadout .ench-book:hover:not(:disabled){border-color:var(--ench-color,var(--dust))}
#bookLoadout .ench-book[aria-pressed=true],#resultBookLoadout .ench-book[aria-pressed=true]{border-color:var(--ench-color,var(--amber));background:#2e1d3e;box-shadow:inset 0 -3px 0 var(--ench-color,var(--amber-d)),0 0 10px color-mix(in srgb,var(--ench-color,#b777ff) 30%,transparent)}
#bookLoadout .ench-book[aria-pressed=true] strong,#resultBookLoadout .ench-book[aria-pressed=true] strong{color:var(--amber)}
#bookLoadout .ench-book[data-enchanted=true],#resultBookLoadout .ench-book[data-enchanted=true]{border-color:#d9acff;background:#2a1d44}
#bookLoadout .ench-book[data-enchanted=true] strong,#resultBookLoadout .ench-book[data-enchanted=true] strong{color:#e6c8ff}
#bookLoadout .ench-book:disabled,#resultBookLoadout .ench-book:disabled{pointer-events:none;opacity:.42;filter:grayscale(.6)}
@media (max-width:620px){#bookLoadout .ench-grid,#resultBookLoadout .ench-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:359px){#bookLoadout .ench-grid,#resultBookLoadout .ench-grid{grid-template-columns:minmax(0,1fr)}}

/* closed book covers */
#bookLoadout .ench-grid,#resultBookLoadout .ench-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
#bookLoadout .ench-book,#resultBookLoadout .ench-book{flex-direction:column;justify-content:flex-start;gap:3px;padding:6px 4px;text-align:center;background:#1b1228}
#bookLoadout .ench-book::before,#resultBookLoadout .ench-book::before{display:none}
#bookLoadout .ench-book-cover,#resultBookLoadout .ench-book-cover{display:block;width:100%;max-width:80px;margin:0 auto}
#bookLoadout .ench-book-cover svg,#resultBookLoadout .ench-book-cover svg{display:block;width:100%;height:auto;max-height:100px;transition:transform .12s}
#bookLoadout .ench-book:hover:not(:disabled) .ench-book-cover svg,#resultBookLoadout .ench-book:hover:not(:disabled) .ench-book-cover svg{transform:translateY(-2px) rotate(-1deg)}
#bookLoadout .ench-book strong,#resultBookLoadout .ench-book strong{font-size:10px;line-height:1.2;text-align:center;width:100%}
#bookLoadout .ench-book:disabled,#resultBookLoadout .ench-book:disabled{opacity:.72;filter:grayscale(.35) brightness(.85)}
#bookLoadout .ench-book:disabled .ench-book-cover,#resultBookLoadout .ench-book:disabled .ench-book-cover{opacity:.9}
@media (max-width:620px){#bookLoadout .ench-grid,#resultBookLoadout .ench-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:359px){#bookLoadout .ench-grid,#resultBookLoadout .ench-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (prefers-reduced-motion:reduce){#bookLoadout .ench-book-cover svg,#resultBookLoadout .ench-book-cover svg{transition:none;transform:none!important}}

#enchantBookTooltip.book-tooltip{position:fixed;z-index:10050;max-width:min(300px,calc(100vw - 24px));padding:9px 11px;display:grid;gap:4px;background:#1a1128;color:var(--chalk,#efe6ff);border:2px solid var(--ench-color,#b777ff);border-radius:12px;box-shadow:0 6px 0 #0d0a1a,0 0 16px color-mix(in srgb,var(--ench-color,#b777ff) 35%,transparent);font-size:11px;line-height:1.45;pointer-events:auto;overflow-wrap:anywhere}
#enchantBookTooltip.book-tooltip[hidden]{display:none!important}
#enchantBookTooltip .book-tooltip-title{font-size:12px;font-weight:800;color:#e6c8ff}
#enchantBookTooltip .book-tooltip-description{color:var(--dust,#c7b9dc)}
#enchantBookTooltip .book-tooltip-count{justify-self:start;font-weight:800;font-size:10px;padding:1px 7px;border:2px solid currentColor;border-radius:8px;color:var(--mala,#ffc65c)}

/* Inventory book slots: counts, owned glow, decorative motes (pointer-inert). */
#bookLoadout .ench-book-wrap,#resultBookLoadout .ench-book-wrap{position:relative}
.ench-book-wrap .ench-count{position:absolute;top:-6px;right:-6px;z-index:3;width:24px;height:24px;padding:0;box-sizing:border-box;
  display:grid;place-items:center;border-radius:999px;font:700 11px/1 ui-monospace,"Space Mono",monospace;font-variant-numeric:tabular-nums;
  color:#fbf2ff;background:#5b2ea6;border:2px solid #e3c7ff;box-shadow:0 1px 0 #1a0f2a,0 0 0 1px #1a0f2a;pointer-events:none}
.ench-book-wrap[data-owned="false"] .ench-count{color:#c9bfd6;background:#2a2236;border-color:#6d6280}
.ench-book-wrap[data-owned="true"] .ench-book{box-shadow:0 0 0 1px color-mix(in srgb,#c58bff 70%,transparent),0 0 10px rgba(183,119,255,.38)}
.ench-book-wrap[data-owned="false"] .ench-book-cover{filter:saturate(.45) brightness(.8)}
.ench-book-wrap[data-owned="false"] .ench-book{opacity:.78}
.ench-motes{position:absolute;inset:0;z-index:2;overflow:hidden;pointer-events:none;border-radius:12px}
.ench-mote{position:absolute;bottom:4px;width:3px;height:3px;background:#ecd2ff;opacity:0;box-shadow:0 0 3px #b777ff;
  animation:ench-mote-rise 2.6s linear infinite}
.ench-mote:nth-child(1){left:18%;animation-delay:0s}
.ench-mote:nth-child(2){left:42%;animation-delay:.7s;background:#b777ff}
.ench-mote:nth-child(3){left:66%;animation-delay:1.3s;width:2px;height:2px}
.ench-mote:nth-child(4){left:84%;animation-delay:1.9s;background:#d7a8ff}
@keyframes ench-mote-rise{0%{transform:translateY(0);opacity:0}20%{opacity:.9}80%{opacity:.6}100%{transform:translateY(-34px);opacity:0}}
[hidden] .ench-mote,.overlay.hidden .ench-mote,details:not([open]) .ench-mote{animation-play-state:paused}
@media (prefers-reduced-motion: reduce){.ench-mote{animation:none;opacity:.55}.ench-mote:nth-child(odd){transform:translateY(-14px)}}
