:root{
	/* Anchorsworn typography system (see STYLE_GUIDE.md):
	   DISPLAY = titles and compact hover labels; NARRATIVE = roomy lore/flavor prose only;
	   UI = every control, stat, value, table, and compact description. Never insert a literal
	   font-family elsewhere: choose one of these roles or its utility class. The former fonts
	   remain in each stack as fallbacks. --font-body is a compatibility alias for older rules. */
	--font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
	--font-narrative: 'Forum', Georgia, 'Times New Roman', serif;
	--font-ui: Arial, sans-serif;
	--font-body: var(--font-ui);
	--color-gameDark: rgb(50, 50, 50);
	--color-gameLight: rgb(230, 230, 230);	
    --color-gameSlate: rgb(120, 109, 95);
    --text-shadow: 0 0 10px #FFD700, 0 0 10px #FFD700;
    --text-shadow-black-outline: 
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;

    --color-skill-specialized: rgb(90, 150, 160);   /* confident, expert */
    --color-skill-trained:     rgb(120, 150, 140);  /* competent */
    --color-skill-untrained:   rgb(150, 145, 135);  /* barely capable */
    --color-skill-unusable:    rgb(110, 110, 110);  /* disabled */
    --color-notEnoughXP: #8B2E2E;
    --color-gold: #FFD700;
    --color-xp-purple: #7c4fd6;

}

html, body{
    font-family: var(--font-ui);
}
button, input, select, textarea{
    font-family: inherit;
}
/* Text areas throughout the game and development tools are layout-owned controls. Allowing the
   browser resize handle to override their containing cards creates overlap and broken grids. */
textarea{
    resize: none !important;
}
/* A title token can appear alone or among several classes. Matching the `-title` token rather
   than the word "title" avoids incorrectly promoting subtitles and descriptive helper copy. */
h1, h2, h3, h4, h5, h6,
[class$="-title"],
[class*="-title "],
.item-use-title-text,
.item-details-heading-name{
    font-family: var(--font-display);
}
.font-display,
.text-title{
    font-family: var(--font-display) !important;
}
.font-narrative,
.text-narrative,
.town-description,
.inn-flavor,
.overworld-flavor{
    font-family: var(--font-narrative) !important;
}
.font-ui,
.text-ui{
    font-family: var(--font-ui) !important;
}

/* Compact, word-or-phrase hover labels use the display face. Rich tooltip cards reset to Forum,
   then opt only their headings back into Cinzel below. */
.iconsButton[tooltip]:hover::after,
.increaseButton[tooltip]:hover::after,
.advanceSkillLevelButton[tooltip]:hover::after,
.combat-hero-ability[tooltip]:hover::after,
.combat-hero-toggle[tooltip]:hover::after,
.combat-turnOrder[tooltip]:hover::after,
.combat-zone-button[tooltip]:hover::after,
.overworld-direction-button[tooltip]:hover::after,
.game-close[tooltip]:hover::after,
.inventory-container-tab[tooltip]:hover::after,
.inventory-paperdoll-wrapper [tooltip]:hover::after,
.game-content-travel [data-tooltip]:hover::after,
.devtools-nav-tooltip{
    font-family: var(--font-display);
}
.hover-tooltip,
.inventory-hover-tooltip,
.item-use-wrapper.inspect-frame{
    font-family: var(--font-body);
}
.hover-tooltip-title,
.hover-tooltip-section-title,
.creature-tooltip-section-title,
.item-details-resistances-title,
.item-details-enchantments-title,
.item-use-wrapper.inspect-frame .item-use-title-text{
    font-family: var(--font-display);
}

/* Thin, themed scrollbars everywhere instead of each browser's bulky default OS chrome, which
   stood out against the game's own dark/gold palette. Site-wide (not scoped to one dashboard)
   since this is purely cosmetic and every scrollable area - devtools panels, in-game menus,
   anything else - should read as the same game. Firefox (scrollbar-width/-color) and WebKit
   (::-webkit-scrollbar and friends) need separate properties; there's no third mechanism to
   cover, these two are the whole story for scrollbar styling today. */
*{
    scrollbar-width: thin;
    scrollbar-color: var(--color-gameSlate) rgba(0,0,0,0.25);
}
::-webkit-scrollbar{
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track{
    background: rgba(0,0,0,0.25);
}
::-webkit-scrollbar-thumb{
    background: var(--color-gameSlate);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover{
    background: var(--color-gold);
}

.messageBanner{
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translate(-50%, -20px);
    max-width: 80vw;
    padding: 10px 18px;
    background-color: var(--color-gameDark);
    color: var(--color-gameLight);
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out;
}
.messageBanner.messageBannerActive{
    opacity: 1;
    transform: translate(-50%, 0);
}

.game-overlay{
    position: fixed;
    inset:0;
    background: rgba(0,0,0,0.8);
    display:flex;
    flex-direction: column;
    gap:5px;
    padding:10px;
}
.game-header{
    position: relative;
    /* The attached buff shelf hangs into the play frame. Keep it above the navbar (30) and the
       combat screen (50), while dialogs and blocking overlays (60+) still cover the HUD. */
    z-index:55;
    box-sizing: border-box;
    margin: -10px -10px 0;
    padding: 8px 14px 9px;
    width: calc(100% + 20px);
    background: linear-gradient(180deg, #211f1b 0%, #39342c 100%);
    border-bottom: 1px solid #b78a39;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.65), inset 0 -1px rgba(255,215,0,0.12);
    display:grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
    gap:12px;

}
.game-header-vital{
    --pct: 100%;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
    border-radius: 17px;
    height: 32px;
    padding-left: 38px;
    border: 1px solid rgba(0,0,0,0.95);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    align-content: center;
    color:white;
    text-shadow: 0 1px 2px #000, 1px 0 1px #000, -1px 0 1px #000;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -2px 4px rgba(0,0,0,0.55),
        0 1px 2px rgba(0,0,0,0.75);
    transition: background-size 1.15s ease-in-out, filter 0.2s ease;
}
.game-header-vital::before{
    content:"";
    position:absolute;
    z-index:2;
    left:-7px;
    top:-1px;
    width:32px;
    height:32px;
    border-radius:50%;
    background:linear-gradient(145deg, #4d493f, #171613 66%);
    border:1px solid rgba(255,215,0,0.8);
    box-shadow:0 0 0 2px rgba(10,9,7,0.85), 0 2px 5px rgba(0,0,0,0.8), inset 0 1px rgba(255,255,255,0.25);
}
.game-header-vital::after{
    /* The unfilled part is intentionally a dark, subtly hatched reserve rather than a
       desaturated version of the resource color.  It makes a partly depleted vital read
       as genuinely empty at a glance. */
    content:"";
    position:absolute;
    z-index:0;
    top:1px;
    right:1px;
    bottom:1px;
    left:var(--pct);
    border-radius:0 16px 16px 0;
    background:
        repeating-linear-gradient(-45deg, rgba(255,255,255,0.045) 0 2px, rgba(0,0,0,0.13) 2px 5px),
        linear-gradient(180deg, rgba(8,9,10,0.78), rgba(0,0,0,0.93));
    box-shadow:inset 2px 0 5px rgba(0,0,0,0.58), inset 0 1px rgba(255,255,255,0.06);
    pointer-events:none;
    /* Bug (owner report, dodge/stamina loss in combat): this overlay's own `left` never animated
       - only the base element's `background-size` did (below) - so on a DECREASE this dark
       reserve snapped instantly ahead of the still-shrinking color fill, letting the true fill
       show through its semi-transparent hatch as a "ghost" trailing behind it for the rest of the
       transition. An INCREASE (healing) hid the same mismatch, since the reserve was retreating
       to reveal not-yet-filled area that was already the same dark color underneath. Matching this
       transition to the base element's own (line ~119) keeps both moving together. */
    transition: left 1.15s ease-in-out;
}
.game-header-vital-icon{
    position:absolute;
    z-index:3;
    left:-8px;
    top:0;
    width:34px;
    height:34px;
    object-fit:cover;
    filter:drop-shadow(0 1px 1px #000);
}
.game-header-vital-value{
    position:relative;
    z-index:2;
    display:block;
}
.game-header-vital.health{
    background-color: #392426;
    background-image: linear-gradient(180deg, #ff4b55 0%, #d31322 52%, #920b16 100%);
    background-repeat: no-repeat;
    background-position: left center;
    background-size: var(--pct) 100%;
}
.game-header-vital.stamina{
    background-color: #3b3825;
    background-image: linear-gradient(180deg, #ffe65a 0%, #dfbd09 52%, #987b00 100%);
    background-repeat: no-repeat;
    background-position: left center;
    background-size: var(--pct) 100%;
}
.game-header-vital.mana{
    background-color: #252844;
    background-image: linear-gradient(180deg, #596cff 0%, #243be0 52%, #101f91 100%);
    background-repeat: no-repeat;
    background-position: left center;
    background-size: var(--pct) 100%;
}
/* Buffs hang from the header as an attached shelf. Absolute positioning keeps the HUD's height
   fixed, while the shared background and border make the shelf read as part of the same frame. */
@property --buff-progress{
    syntax:"<percentage>";
    inherits:false;
    initial-value:100%;
}
.game-header-buffs{
    position:absolute;
    z-index:4;
    top:calc(100% - 1px);
    left:14px;
    display: flex;
    flex-wrap: wrap;
    gap:7px;
    max-width:calc(100% - 56px);
    padding:5px 8px 7px;
    border:1px solid #b78a39;
    border-top:0;
    border-radius:0 0 16px 16px;
    background:linear-gradient(180deg,#39342c,#211f1b);
    box-shadow:0 5px 10px rgba(0,0,0,.5),inset 0 -1px rgba(255,215,0,.1);
}
.game-header-buffs:empty{
    display: none;
}
.game-header-debuffs{
    left:auto;
    right:14px;
    flex-direction:row-reverse;
    border-color:#9e4646;
}
.game-header-buff{
    --buff-progress:100%;
    position: relative;
    width:28px;
    height:28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1;
    background:conic-gradient(from -90deg,#f5d154 0 var(--buff-progress),rgba(91,74,33,.34) var(--buff-progress) 100%);
    border:0;
    box-shadow:0 0 0 2px rgba(10,9,7,.9),0 2px 5px rgba(0,0,0,.8),0 0 5px rgba(255,215,0,.22);
    cursor: default;
}
.game-header-buff::before{
    content:"";
    position:absolute;
    inset:3px;
    border-radius:50%;
    background:linear-gradient(145deg,#4d493f,#171613 66%);
    box-shadow:inset 0 1px rgba(255,255,255,.22);
}
.game-header-buff-icon{ position:relative; z-index:1; }
/* A spell-sourced buff's own real icon (owner request 2026-09-27: "the buffs granted via scrolls
   should use the icon associated with the spell the scroll is based off of") in place of the
   generic per-type emoji - sized to sit inside .game-header-buff::before's inset:3px face. */
.game-header-buff-icon.has-image{
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
}
.game-header-buff.is-timed{ animation:buff-rim-drain var(--buff-duration) linear forwards; }
@keyframes buff-rim-drain{ to{ --buff-progress:0%; } }
.game-header-buff.is-debuff{
    background:conic-gradient(from -90deg,#e05252 0 var(--buff-progress),rgba(91,33,33,.34) var(--buff-progress) 100%);
}
.game-header-buff.buff-removing{
    animation: buff-fall-away 620ms cubic-bezier(.2,.7,.35,1) forwards;
    transform-origin: center;
    pointer-events: none;
}
@keyframes buff-fall-away{
    0%{ opacity:1; filter:brightness(1); transform:translateY(0) scale(1); }
    24%{ opacity:1; filter:brightness(2.4) saturate(1.45); transform:translateY(-3px) scale(1.32); }
    48%{ opacity:.9; filter:brightness(1.65) saturate(1.2); transform:translateY(3px) rotate(5deg) scale(1.08); }
    100%{ opacity:0; filter:brightness(.8); transform:translateY(34px) rotate(22deg) scale(.08); }
}
@media (prefers-reduced-motion: reduce){
    .game-header-buff.buff-removing{ animation-duration: 120ms; }
}
/* Ornate level/XP footer (renderXpFooterBlock()/makeXpFooterBadge(), attributes_skills_
   inventory.js) - a level badge beside a total-XP caption + progress bar, then one or two
   full-width "Available X" badges below. Gold-on-dark throughout, matching a reference layout
   the owner supplied, rather than the plain right-aligned text rows this used to be. */
.xp-footer-card{
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.xp-footer-badge-section{
    display: flex;
    align-items: center;
    gap: 12px;
}
.xp-level-badge{
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    border: 2px solid var(--color-gold);
    background: linear-gradient(180deg, var(--color-gameSlate) 0%, var(--color-gameDark) 100%);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6), inset 0 0 8px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-gold);
}
.xp-level-badge-label{
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    opacity: 0.85;
}
.xp-level-badge-number{
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}
.xp-footer-main{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.xp-footer-total{
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-gold);
    text-shadow: var(--text-shadow-black-outline);
}
.xp-footer-total-label{
    font-size: 0.6rem;
    color: white;
    text-shadow: none;
}
.xp-footer-total-value{
    font-size: 0.7rem;
}
.xp-ornate-bar{
    position: relative;
    width: 100%;
    height: 24px;
    border-radius: 999px;
    border: 2px solid var(--color-gold);
    background-color: var(--color-gameDark);
    box-shadow: inset 0 0 6px rgba(0,0,0,0.6);
    overflow: hidden;
}
.xp-ornate-bar-fill{
    --pct: 0%;
    height: 100%;
    width: var(--pct);
    background: linear-gradient(180deg, #a888e8 0%, var(--color-xp-purple) 100%);
    transition: 1.15s width ease-in-out;
}
.xp-ornate-bar-label{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--color-gameLight);
    text-shadow: var(--text-shadow-black-outline);
}
.xp-footer-badge{
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 2px solid var(--color-gold);
    background-color: var(--color-gameDark);
    box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
.xp-footer-available{
    display: flex;
    gap: 8px;
    width: 100%;
}
/* Character build mode (2026-10-14, attributes_skills_inventory.js) - a new hero building
   themselves on the Attributes / Skills screens: points left, a hint, and Finished. */
.character-build-footer-row{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}
.character-build-footer-row .xp-footer-badge{
    width: auto;
    flex: none;
}
.character-build-hint{
    flex: 1;
    min-width: 160px;
    color: #d8cda9;
    font-size: 0.9rem;
}
.character-build-next{
    margin-left: auto;
    color: var(--color-gold);
    font-weight: 700;
}
.character-build-finish{
    flex: none;
    margin: 0 0 0 auto;
    min-height: 32px;
}
/* Points still unspent (they'd be lost) - a dull, warning-red button. */
.character-build-finish.unspent{
    border-color: rgba(190,70,60,0.75);
    background: linear-gradient(180deg, #3a2422, #221615);
    color: #d9a59f;
}
.character-build-finish.unspent:hover{
    border-color: #d0574a;
    color: #f0c0b8;
}
/* Everything spent - gold, with a slow shimmer passing across it. */
.character-build-finish.all-spent{
    position: relative;
    overflow: hidden;
    border-color: #f2d27a;
    background: linear-gradient(180deg, #e2b94f, #a87a22);
    color: #2a1d06;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(255,240,190,0.5);
    box-shadow: 0 0 12px rgba(255,215,0,0.45);
}
.character-build-finish.all-spent::after{
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
    transform: skewX(-20deg);
    animation: character-build-shimmer 2.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes character-build-shimmer{
    0%{ left: -60%; }
    55%, 100%{ left: 130%; }
}
@media (prefers-reduced-motion: reduce){
    .character-build-finish.all-spent::after{ animation: none; display: none; }
}
.character-build-finish:disabled{
    opacity: 0.6;
    cursor: default;
}
.attribute-spend-button.character-build-button{
    justify-self: center;
    box-sizing: border-box;
    background-size: 20px;
    background-position: center;
    border: 1px solid #a8b8aa;
    background-color: #252a27;
    box-shadow: inset 0 1px rgba(255,255,255,0.2), 0 1px 3px rgba(0,0,0,0.65);
}
.attribute-spend-button.character-build-button:hover{
    background-color: #334839;
    border-color: #86ff9b;
    box-shadow: 0 0 9px rgba(58,255,101,0.55);
}
/* Build mode's core rows get a slider column before Lower / Raise. */
.core-attributes.character-build-panel .attributeWrapper,
.attribute-core-headings.character-build-headings{
    grid-template-columns: 38px minmax(110px,1fr) repeat(4,50px) minmax(120px,1.4fr) 28px 28px;
    gap: 10px;
}
/* The row's hover nudge fights a dragged slider - not while building. */
.core-attributes.character-build-panel .attributeWrapper:hover,
.game-content-skills .character-build-skills .skillWrapper:hover{
    transform: none;
}
/* Slider: gold up to the value, a fainter band as far as the points left would reach. */
.character-build-slider{
    --pct: 0%;
    --reach: 0%;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 18px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}
.character-build-slider:focus-visible{
    outline: none;
}
.character-build-slider::-webkit-slider-runnable-track{
    height: 6px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.6);
    background: linear-gradient(90deg,
        #c9962f 0%, #f2d27a var(--pct),
        rgba(214,173,79,0.35) var(--pct), rgba(214,173,79,0.35) var(--reach),
        #1d1d1d var(--reach), #1d1d1d 100%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.7);
}
.character-build-slider::-moz-range-track{
    height: 6px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.6);
    background: linear-gradient(90deg,
        #c9962f 0%, #f2d27a var(--pct),
        rgba(214,173,79,0.35) var(--pct), rgba(214,173,79,0.35) var(--reach),
        #1d1d1d var(--reach), #1d1d1d 100%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.7);
}
.character-build-slider::-webkit-slider-thumb{
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border-radius: 50%;
    border: 2px solid #3a2a0c;
    background: radial-gradient(circle at 35% 35%, #fff4bd, #d6ad4f 60%, #8a6420);
    box-shadow: 0 1px 3px rgba(0,0,0,0.8);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.character-build-slider::-moz-range-thumb{
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #3a2a0c;
    background: radial-gradient(circle at 35% 35%, #fff4bd, #d6ad4f 60%, #8a6420);
    box-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.character-build-slider:hover::-webkit-slider-thumb,
.character-build-slider:focus-visible::-webkit-slider-thumb{
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(255,215,0,0.6);
}
.character-build-slider:focus-visible::-moz-range-thumb{
    box-shadow: 0 0 8px rgba(255,215,0,0.6);
}
/* Out of points - the badge and the slider that asked for more pulse red. */
.character-build-pulse{
    animation: character-build-pulse 0.55s ease-out;
}
@keyframes character-build-pulse{
    0%, 100%{ box-shadow: 0 0 0 0 rgba(220,60,40,0); }
    30%{ box-shadow: 0 0 0 4px rgba(220,60,40,0.55), 0 0 14px rgba(220,60,40,0.6); }
}
.character-build-slider.character-build-pulse{
    border-radius: 9px;
}
.attribute-spend-button.character-build-button.disabled{
    opacity: 0.3;
    pointer-events: none;
}
.character-build-undo{
    display: grid;
    place-items: center;
    justify-self: center;
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    border: 1px solid #d6ad4f;
    border-radius: 50%;
    background: linear-gradient(180deg, #3d382e, #191919);
    color: #fff4bd;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.character-build-undo:hover{
    border-color: var(--color-gold);
    box-shadow: 0 0 7px rgba(255,215,0,0.45);
}
.xp-footer-available .xp-footer-badge{
    width: auto;
    flex: 1;
}
.game-content-skills .xp-footer-available .xp-footer-badge:first-child{
    flex: 3;
}
.game-content-skills .xp-footer-available .xp-footer-sp{
    flex: 1;
    padding-left: 10px;
    padding-right: 10px;
}
.xp-footer-badge-label{
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-align: left;
    color: var(--color-gameLight);
}
.xp-footer-badge-value{
    font-size: 1rem;
    font-weight: bold;
    text-align: right;
    color: var(--color-gold);
}
/* Account/interface controls live together after the three equally-sized vital bars. */
.game-header > .game-header-settings{
    grid-column:4;
    grid-row:1;
    width:28px;
    height:28px;
    min-width:28px;
    min-height:28px;
    align-self:center;
    padding:0;
    display:grid;
    place-items:center;
    box-sizing:border-box;
    border:1px solid rgba(201,154,62,.52);
    border-radius:50%;
    background:radial-gradient(circle at 50% 38%,#514a3e,#282620 72%);
    color:#d8c58b;
    font:17px/1 var(--font-ui);
    box-shadow:inset 0 1px rgba(255,255,255,.14),inset 0 -2px 3px rgba(0,0,0,.5),0 3px 9px rgba(0,0,0,.42);
    cursor:pointer;
    transition:color .14s ease,border-color .14s ease,box-shadow .14s ease,filter .14s ease;
}
.game-header > .game-header-settings:hover{
    color:#fff1a4;
    border-color:var(--color-gold);
    box-shadow:0 0 0 1px rgba(255,215,0,.2),0 0 10px rgba(255,215,0,.26),inset 0 1px rgba(255,255,255,.2);
    filter:brightness(1.15);
}
.game-header > .game-header-settings:focus-visible{ outline:2px solid var(--color-gold);outline-offset:2px; }
/* Keep the return control pinned to the final header cell independently of the attached buff shelf. */
.game-header > .game-close{
    grid-column: 5;
    grid-row: 1;
    align-self:center;
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    background-size: 10px 10px, 10px 10px, auto;
}
/* The main header control returns to character selection; it is not a generic modal close.
   Its AS crest comes from the same randomized brand set chosen by auth.js for this page load.
   Scoped to this one header button so every other X stays intact. */
.game-header > .game-header-character-return{
    background:
        var(--character-return-icon) center / 22px 22px no-repeat,
        radial-gradient(circle at 50% 38%, #514a3e, #282620 72%);
}
.game-close{
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    box-sizing: border-box;
    padding: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(201,154,62,.72);
    border-radius: 50%;
    background:
        linear-gradient(45deg, transparent 44%, #f7e8bd 45%, #f7e8bd 55%, transparent 56%) center / 13px 13px no-repeat,
        linear-gradient(-45deg, transparent 44%, #f7e8bd 45%, #f7e8bd 55%, transparent 56%) center / 13px 13px no-repeat,
        linear-gradient(180deg, #514a3e, #292722);
    color: #f7e8bd;
    box-shadow: inset 0 1px rgba(255,255,255,.14), inset 0 -2px 3px rgba(0,0,0,.5), 0 3px 9px rgba(0,0,0,.42);
    cursor:pointer;
    transition: color .14s ease, border-color .14s ease, box-shadow .14s ease, filter .14s ease;
}
.game-close:hover{
    color: #fff6d5;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 1px rgba(255,215,0,.2), 0 0 10px rgba(255,215,0,.26), inset 0 1px rgba(255,255,255,.2);
    filter: brightness(1.15);
}
.game-close:focus-visible{
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* gamePrompt()'s message box - the option buttons themselves now reuse .item-use-option/
   .item-use-options-wrapper (the same equip/grip-prompt menu chrome) so every popup's buttons
   look and behave alike; this dark inset box is what's still specific to a confirmation prompt. */
.gamePromptMessageWrapper{
    font-size: 1rem;
    padding: 10px;
    text-align: center;
    background-color: var(--color-gameDark);
    color: var(--color-gameLight);
    border-radius: 5px;
}
/* Still used directly by the attribute/skill-point "Continue" buttons (game.js) outside
   gamePrompt() itself - not dead even though gamePrompt()'s own options no longer use it. */
.gamePromptOption{
    border-radius: 5px;
    cursor: pointer;
    padding:5px;
    text-align: center;
    border: 1px solid white;
    flex:1;
    background-color: var(--color-gameDark);
    color: var(--color-gameLight);
    transition: 0.15s all ease-in-out;
}
.gamePromptOption:hover{
    background-color: darkgreen;
    text-shadow: 0 0 10px #FFD700, 0 0 10px #FFD700;
    border-color:black;
}

.game-job-selection-outter-wrapper{
    display: flex;
    flex-direction: column;
    background-color: var(--color-gameLight);
    /* A translucent scrim of the wrapper's own background color, composited over the class
       portrait - keeps the portrait's "bleed through" effect on hover while keeping title/
       ability text readable against it, rather than raw artwork directly behind text. */
    background-image: linear-gradient(rgba(230,230,230,0.8), rgba(230,230,230,0.8)), var(--bg, none);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover, 90%;
    height: 100%;
    gap:10px;
}
.game-job-selection-wrapper-title{
    font-size: 1.5rem;
    text-align: center;
    color: var(--color-gameDark);
    background-color: rgba(230,230,230,0.97);
    border-radius: 5px;
    padding: 5px;
    margin: 0 20px;
}

.game-job-selection-buttons-wrapper{
    display: flex;
    flex-direction: row;
}

.game-job-details-wrapper{
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}
.game-job-selection-details-wrapper{
    background-color: rgba(30,30,30,0.75);
    color: var(--color-gameLight);
    border-radius: 8px;
    padding: 15px 25px;
    max-width: 80%;
}
.game-job-selection-details-title{
    justify-self: center;
    font-size: 1.5rem;
    text-align: center;
}
.game-job-selection-details-content{
    text-align: center;
    margin-bottom: 10px;
}

.game-job-selection{
    border-radius: 5px;
    cursor: pointer;
    padding:5px;
    text-align: center;
    border: 1px solid white;
    flex:1;
    background-color: var(--color-gameDark);
    color: var(--color-gameLight);
    transition: 0.15s all ease-in-out;
}
.game-job-selection:hover,
.game-job-selection.is-previewed{
    background-color: darkgreen;
    text-shadow: 0 0 10px #FFD700, 0 0 10px #FFD700;
    border-color:black;
}

/* Shared outer panel for character creation's attribute-spend and skill-spend screens
   (spendAttributePoints()/spendSkillPoints() in game.js) - unlike the class-selection screen
   (.game-job-selection-outter-wrapper, which wants the full width for its background
   portrait), these are capped and centered so a handful of rows doesn't stretch edge to edge. */
.game-creation-panel{
    display: flex;
    flex-direction: column;
    background-color: var(--color-gameLight);
    max-width: 800px;
    min-width: 450px;
    margin: 20px auto;
    padding: 20px 0;
    border-radius: 10px;
    gap: 10px;
}
.attribute-spend-remaining{
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-gameDark);
    background-color: rgba(230,230,230,0.97);
    border-radius: 5px;
    padding: 5px;
    margin: 0 20px;
}
.attribute-spend-rows{
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 20px;
}
.attribute-spend-row{
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--color-gameDark);
    color: var(--color-gameLight);
    border-radius: 5px;
    padding: 8px 12px;
}
.attribute-spend-label{
    flex: 1;
}
.attribute-spend-value{
    width: 40px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: bold;
}
/* Reuses the live Attributes tab's own increase icon (images/icons/increase.svg) - "decrease"
   is the same icon flipped, rather than a second asset. */
.attribute-spend-button{
    width: 24px;
    height: 24px;
    border-radius: 25px;
    cursor: pointer;
    background-image: url("../images/icons/increase.svg");
    background-repeat: no-repeat;
    background-size: 24px;
    transition: 0.1s all ease-in-out;
}
.attribute-spend-button:hover{
    background-color: var(--color-gold);
}
.attribute-spend-button.decrease{
    transform: rotate(180deg);
}
.attribute-spend-continue{
    margin: 15px 20px 0;
    flex: none;
    max-height: 20px;
}

/* spendSkillPoints()'s screen - one stacked section per skillLevel, same visual language as
   the live Skills tab (.skillBlockOutterWrapper/.skillWrapperTitle/.skillBlockInnerWrapper,
   defined further down for gameDisplaySkills()), just with its own row/button treatment since
   there's no base/bonus/total breakdown or increaseButton column here. */
.creation-skill-levels{
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 20px;
}
.creation-skill-wrapper{
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) 24px 20px;
    gap: 10px;
    align-items: center;
    padding: 4px 0;
}
/* Populated only while hovering this row's Train/Specialize or Undo button (see
   spendSkillPoints() in game.js) - a fixed width keeps the row from reflowing when the text
   appears/disappears. Deliberately its own class rather than reusing .game-skill-data, which
   turns its own text transparent on hover (a hide-and-reveal-via-tooltip trick meant for the
   live Skills tab's base/bonus/total columns) - this text should stay visible while hovering. */
.creation-skill-cost-preview{
    width: 55px;
    text-align: right;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: var(--color-gold);
}
/* The live Skills tab only ever styled this icon via a positional ".skillWrapper > :first-child"
   selector (see gameDisplaySkills() below) rather than a rule on the class itself - giving it
   a real standalone rule here so it also works wherever else "game-skill-image" is used. */
.game-skill-image{
    border: 1px solid var(--color-gameDark);
    width: 25px;
    height: 25px;
    border-radius: 5px;
    background-image: var(--bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 25px;
}
.creation-skill-wrapper .game-skill-name{
    color: var(--color-gameLight);
    text-shadow: var(--text-shadow-black-outline);
}
.creation-skill-undo-button{
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    border-radius: 25px;
    cursor: pointer;
    border: 1px solid var(--color-gameLight);
    color: var(--color-gameLight);
    font-size: 0.9rem;
    transition: 0.1s all ease-in-out;
}
.creation-skill-undo-button:hover{
    background-color: var(--color-gold);
    color: var(--color-gameDark);
}

/* Character-creation visual refresh. These selectors are scoped to the creation-only shells;
   allocation/training behavior remains owned by game.js. */
.game-job-selection-outter-wrapper{
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    grid-template-areas:
        "title title"
        "classes details";
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    width: min(1220px, calc(100% - 32px));
    min-height: min(720px, calc(100vh - 90px));
    max-height: calc(100vh - 70px);
    height: calc(100vh - 90px);
    margin: 12px auto;
    padding: 10px;
    box-sizing: border-box;
    background: linear-gradient(145deg, #b9b9b9, #929292);
    border: 1px solid #6f685b;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.38), inset 0 1px rgba(255,255,255,0.35);
}
.game-job-selection-outter-wrapper > .game-job-selection-wrapper-title{
    grid-area: title;
}
.game-job-selection-wrapper-title{
    margin: 0 2px;
    padding: 6px 12px;
    color: #fff5cf;
    background: linear-gradient(180deg, #4b4841, #343330);
    border: 1px solid #625b4f;
    border-bottom-color: #b98e35;
    border-radius: 8px;
    font-size: 1.05rem;
    line-height: 1.2;
    font-weight: 700;
    text-shadow: 0 1px 2px #000;
}
.game-job-selection-buttons-wrapper{
    grid-area: classes;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 0;
    gap: 5px;
    padding: 7px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    background: #30302f;
    border: 1px solid #625b4f;
    border-radius: 9px;
    box-shadow: inset 0 1px rgba(255,255,255,0.06);
}
.game-job-gender-filters{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding-bottom: 9px;
    margin-bottom: 3px;
    border-bottom: 1px solid rgba(198,166,91,0.28);
}
.game-job-gender-filter{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    padding: 6px 5px;
    color: #ded8ca;
    background: linear-gradient(180deg, #45433e, #292927);
    border: 1px solid #625b4f;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.game-job-gender-filter-icon{
    color: #d6ad4f;
    font-size: 1rem;
    line-height: 1;
}
.game-job-gender-filter:hover{
    color: #fff5cf;
    border-color: #b98e35;
    background: linear-gradient(180deg, #555047, #34312d);
}
.game-job-gender-filter.selected{
    color: #fff5cf;
    border-color: #e0b84f;
    background: linear-gradient(180deg, #69541e, #3f351d);
    box-shadow: inset 0 0 0 1px rgba(255,215,0,0.15), 0 0 8px rgba(214,173,79,0.18);
}
.game-job-selection{
    flex: 0 0 auto;
    padding: 10px 12px;
    text-align: left;
    border-color: rgba(198,166,91,0.2);
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015));
    font-weight: 700;
}
.game-job-selection:hover{
    color: #fff5cf;
    background: linear-gradient(90deg, rgba(214,173,79,0.2), rgba(255,255,255,0.025));
    border-color: #d6ad4f;
    transform: translateX(2px);
}
.game-job-details-wrapper{
    grid-area: details;
    position: relative;
    min-width: 0;
    min-height: 620px;
    align-items: flex-end;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
    overflow: hidden;
    background-color: #252525;
    background-image: linear-gradient(180deg, rgba(25,25,25,0.04), rgba(20,20,20,0.38)), var(--bg, none);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    border: 1px solid #625b4f;
    border-radius: 9px;
    box-shadow: inset 0 0 28px rgba(0,0,0,0.42);
}
.game-job-selection-details-wrapper{
    width: min(560px, 76%);
    max-width: none;
    padding: 14px 18px;
    background: rgba(35,34,32,0.94);
    border: 1px solid #b98e35;
    box-shadow: 0 8px 20px rgba(0,0,0,0.45), inset 0 1px rgba(255,255,255,0.08);
}
.game-job-preview-class-name{
    color: var(--color-gold);
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    text-shadow: var(--text-shadow-black-outline);
}
.game-job-preview-kicker{
    margin: 3px 0 10px;
    color: #cfc5aa;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-align: center;
    text-transform: uppercase;
}
.game-job-selection-details-title{
    color: #fff5cf;
    font-size: 1rem;
    font-weight: 700;
}
.game-job-selection-details-content{
    margin: 2px 0 9px;
    color: #e5e2da;
    font-size: 0.84rem;
    line-height: 1.35;
}

/* The large portrait is the appearance picker. Controls sit at its outside edges and remain
   clear of the centered class details panel. */
.game-job-appearance-controls{
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.game-job-appearance-arrow{
    position: absolute;
    top: 50%;
    width: 46px;
    height: 64px;
    padding: 0;
    line-height: 60px;
    text-align: center;
    font-size: 1.6rem;
    color: #fff5cf;
    background: rgba(35,34,32,0.88);
    border: 1px solid #b98e35;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    pointer-events: auto;
    transform: translateY(-50%);
    transition: 0.1s all ease-in-out;
}
.game-job-appearance-previous{ left: 16px; }
.game-job-appearance-next{ right: 16px; }
.game-job-appearance-arrow:hover{
    background: rgba(74,67,53,0.96);
    border-color: #ffe476;
    color: var(--color-gold);
}

.game-creation-panel{
    width: min(680px, calc(100% - 32px));
    max-width: none;
    min-width: 0;
    max-height: calc(100vh - 115px);
    margin: 24px auto;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
    background: linear-gradient(145deg, #b9b9b9, #929292);
    border: 1px solid #6f685b;
    box-shadow: 0 14px 30px rgba(0,0,0,0.38), inset 0 1px rgba(255,255,255,0.35);
}
.game-creation-panel .attribute-spend-remaining{
    margin: 0 2px;
    padding: 7px 12px;
    color: #fff5cf;
    background: linear-gradient(180deg, #3d382e, #202020);
    border: 1px solid #b98e35;
    font-weight: 700;
}
.creation-attributes-panel .attribute-spend-rows{
    gap: 4px;
    padding: 7px;
    background: #30302f;
    border: 1px solid #625b4f;
    border-radius: 9px;
}
.creation-attributes-panel .attribute-spend-row{
    min-height: 43px;
    padding: 5px 8px;
    border: 1px solid rgba(198,166,91,0.18);
    border-radius: 7px;
    background: linear-gradient(90deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015));
}
.creation-attributes-panel .attribute-spend-row:hover{
    border-color: rgba(225,187,85,0.58);
    background: linear-gradient(90deg, rgba(214,173,79,0.12), rgba(255,255,255,0.025));
}
.creation-attributes-panel .attributeImage{
    width: 34px;
    height: 34px;
    background-size: 32px;
    border-color: #8c816c;
    background-color: #252525;
}
.creation-attributes-panel .attribute-spend-label{
    font-weight: 700;
    text-shadow: 0 1px 2px #000;
}
.creation-attributes-panel .attribute-spend-label-text,
.creation-skills-panel .game-skill-name{
    display: inline-block;
    width: fit-content;
    justify-self: start;
    cursor: help;
}
.creation-attributes-panel .attribute-spend-value{
    color: #e9ff9b;
    font-size: 1.05rem;
}
.creation-attributes-panel .attribute-spend-button{
    box-sizing: border-box;
    background-size: 20px;
    background-position: center;
    border: 1px solid #a8b8aa;
    background-color: #252a27;
    box-shadow: inset 0 1px rgba(255,255,255,0.2), 0 1px 3px rgba(0,0,0,0.65);
}
.creation-attributes-panel .attribute-spend-button:hover{
    background-color: #334839;
    border-color: #86ff9b;
    box-shadow: 0 0 9px rgba(58,255,101,0.55);
}
.attribute-spend-continue{
    margin: 2px;
    min-height: 32px;
    max-height: none;
    line-height: 32px;
}
.creation-navigation-actions{
    display: grid;
    grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
    gap: 8px;
    margin: 2px;
}
.creation-navigation-actions .attribute-spend-continue{
    margin: 0;
}
.creation-back-button{
    min-height: 32px;
    padding-inline: 22px;
    color: var(--color-gameLight);
    background: #30302f;
    border-color: #8b8376;
}

.creation-skills-panel{
    width: min(1080px, calc(100% - 32px));
    height: calc(100vh - 78px);
    max-height: calc(100vh - 78px);
    margin-block: 8px;
}
.creation-skills-panel .creation-skill-levels{
    gap: 7px;
    padding: 2px;
    overflow: hidden;
}
.creation-skills-panel .skillBlockOutterWrapper{
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 7px;
    padding: 6px;
    overflow: hidden;
    background: #30302f;
    border: 1px solid #625b4f;
    border-left-width: 3px;
    border-radius: 9px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2), inset 0 1px rgba(255,255,255,0.05);
}
.creation-skills-panel .skillBlockOutterWrapper.specialized{ border-left-color: #72d8ec; background: #30302f; }
.creation-skills-panel .skillBlockOutterWrapper.trained{ border-left-color: #87b7a5; background: #30302f; }
.creation-skills-panel .skillBlockOutterWrapper.untrained{ border-left-color: #c3bca7; background: #30302f; }
.creation-skills-panel .skillBlockOutterWrapper.unusable{ border-left-color: #858585; background: #30302f; }
.creation-skills-panel .skillWrapperTitle{
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: stretch;
    min-height: 48px;
    font-size: 0;
    border-right: 1px solid #b98e35;
    border-radius: 6px 0 0 6px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 48px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.55));
}
.creation-skills-panel .specialized > .skillWrapperTitle{ background-image: url("../images/icons/skill_categories/specialized.webp"); }
.creation-skills-panel .trained > .skillWrapperTitle{ background-image: url("../images/icons/skill_categories/trained.webp"); }
.creation-skills-panel .untrained > .skillWrapperTitle{ background-image: url("../images/icons/skill_categories/untrained.webp"); }
.creation-skills-panel .unusable > .skillWrapperTitle{ background-image: url("../images/icons/skill_categories/unusable.webp"); }
.creation-skills-panel .skillBlockInnerWrapper{
    grid-column: 2;
    grid-row: 2;
    gap: 3px;
    min-height: 48px;
    max-height: none;
    overflow-y: auto;
}
.creation-skills-panel .creation-skill-wrapper{
    grid-template-columns: 25px minmax(170px, 1fr) 76px 130px 76px 24px 20px;
    min-height: 34px;
    padding: 3px 6px;
    border: 1px solid rgba(198,166,91,0.15);
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.055), rgba(255,255,255,0.012));
}
.creation-skill-column-headings{
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(205px, 1fr) 76px 130px 76px 24px 20px;
    gap: 10px;
    align-items: end;
    min-width: 0;
    /* Match .skillBlockInnerWrapper's stable scrollbar gutter so each icon sits directly
       above the value column it describes, even when that section is not currently scrolling. */
    padding: 0 18px 3px 6px;
    box-sizing: border-box;
    color: #cbb77b;
    font-size: 0.64rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
}
.creation-skill-column-headings > span{
    min-width: 0;
}
.creation-skill-value{
    color: var(--color-gameLight);
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.creation-skill-total{
    color: #e9ff9b;
    font-weight: 700;
}
.creation-skills-panel .creation-skill-wrapper:hover{
    border-color: rgba(225,187,85,0.52);
    background: linear-gradient(90deg, rgba(214,173,79,0.11), rgba(255,255,255,0.02));
}

.game-job-selection-confirm-box{
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #c69f42;
}
.game-job-selection-hint{
    color: #e8dfc8;
    text-align: center;
    font-size: 0.9rem;
}
.game-job-confirm{
    margin-top: 8px;
    min-height: 34px;
    line-height: 34px;
    color: #17130b;
    background: linear-gradient(#ffe570, #d8a900);
    border-color: #ffe476;
    font-weight: 700;
}
.game-job-confirm:hover{
    background: linear-gradient(#fff0a0, #ebc323);
}

@media (max-width: 700px){
    .game-job-selection-outter-wrapper{
        grid-template-columns: 1fr;
        grid-template-areas: "title" "classes" "details";
        grid-template-rows: auto auto minmax(480px, 1fr);
        height: auto;
        max-height: none;
    }
    .game-job-selection-buttons-wrapper{
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 190px;
    }
    .game-job-gender-filters{ grid-column: 1 / -1; }
    .game-job-details-wrapper{ min-height: 480px; }
    .game-job-selection-details-wrapper{ width: min(520px, 72%); }
    .game-job-appearance-previous{ left: 8px; }
    .game-job-appearance-next{ right: 8px; }
}

.iconsWrapper{
    gap:50px;
    background-color: var(--color-gameSlate);
    padding: 5px;
    margin: 5px;
    border-radius: 4px 4px 0 0;
    flex-shrink: 0;
}

.iconsWrapper, .playerIconsWrapper, .shopIconsWrapper, .actionIconsWrapper, .otherIconsWrapper{
    display: flex;
    flex-direction: row;
    justify-content: center;
}
.playerIconsWrapper, .shopIconsWrapper, .actionIconsWrapper, .otherIconsWrapper{
    gap: 5px;
}

.iconsButton{
    text-align: center;
    border: 1px solid white;
    display: flex;
    width:50px;
    height:50px;
    border-radius: 5px;
    color:var(--color-gameLight);
    background-image: var(--bg);
    background-color:var(--color-gameDark);
	background-repeat:no-repeat;
	background-size:50px;
    cursor: pointer;
    transition: 0.15s all ease-in-out;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
}
.iconsButton:hover{
    background-color: #FFD700;
    text-shadow: 0 0 10px #FFD700, 0 0 10px #FFD700;
    border-color:black;
}
.iconsButton.pulse{
    background-color: darkgreen;
    text-shadow: 0 0 10px #FFD700, 0 0 10px #FFD700;
    border-color:black;
}
.iconsButton, .increaseButton, .combat-hero-ability, .combat-hero-toggle, .combat-turnOrder,
.overworld-direction-button {
    position: relative;
}
.iconsButton[tooltip]:hover::after,
.increaseButton[tooltip]:hover::after,
.advanceSkillLevelButton[tooltip]:hover::after,
.combat-hero-ability[tooltip]:hover::after,
.combat-hero-toggle[tooltip]:hover::after,
.combat-turnOrder[tooltip]:hover::after,
.combat-zone-button[tooltip]:hover::after,
.overworld-direction-button[tooltip]:hover::after,
.game-close[tooltip]:hover::after {
    content: attr(tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #111;
    color: var(--color-gameLight);
    text-shadow: none;
    font-size: 0.85rem;
    font-weight: normal;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--color-gold);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    z-index: 20;
    pointer-events: none;
}
/* The character-return control lives against the viewport's upper-right edge. Its plaque opens
   below and inward; the shared close tooltip remains above for modal controls everywhere else. */
.game-header > .game-header-character-return[tooltip]:hover::after{
    top: calc(100% + 8px);
    right: 0;
    bottom: auto;
    left: auto;
    transform: none;
}
.game-header > .game-header-settings[tooltip]:hover::after{
    top:calc(100% + 8px);
    right:0;
    bottom:auto;
    left:auto;
    transform:none;
}
[data-hotkey-action][tooltip]:hover::after{
    display:none;
}
.configurable-hotkey-tooltip{
    display:flex;
    position:fixed;
    align-items:center;
    gap:6px;
    padding:4px 7px;
    border:1px solid var(--color-gold);
    border-radius:4px;
    background:#111;
    box-shadow:0 2px 6px rgba(0,0,0,0.5);
    color:var(--color-gameLight);
    font-family:var(--font-display);
    font-size:0.85rem;
    font-weight:normal;
    text-shadow:none;
    white-space:nowrap;
    pointer-events:none;
    z-index:30000;
}
.configurable-hotkey-tooltip[hidden]{
    display:none;
}
.configurable-hotkey-tooltip-key,
.devtools-nav-tooltip .configurable-hotkey-tooltip-key{
    padding:1px 5px;
    border:1px solid #8f805f;
    border-radius:4px;
    background:linear-gradient(180deg,#3d3931,#211f1b);
    color:#ffe78a;
    font-family:var(--font-ui);
    font-size:0.72rem;
    line-height:1.35;
    box-shadow:inset 0 1px rgba(255,255,255,0.1);
}
.devtools-nav-tooltip{
    display:flex;
    align-items:center;
    gap:6px;
}
/* otherIconsWrapper (chronicle/debug/devtools) sits at the very top of the screen - a tooltip
   opening upward from there gets clipped off above the viewport, so these specifically open
   downward instead. Same specificity trick as .devtools-sidebar-search elsewhere: a more
   specific selector overriding a subset of the shared rule's properties, not a full redefinition. */
.otherIconsWrapper > .iconsButton[tooltip]:hover::after{
    bottom: auto;
    top: calc(100% + 8px);
}

/* Main-nav tone-testing prototype. */
.tone-testing-overlay{ display:grid; place-items:center; padding:22px; background:rgba(5,5,7,.88); }
.tone-testing-panel{ display:flex; flex-direction:column; box-sizing:border-box; width:min(1120px,96vw); height:min(760px,calc(100vh - 135px)); min-height:0; overflow:hidden; border:2px solid #b78a39; border-radius:8px; background:linear-gradient(145deg,#3c3934,#22211f 72%); box-shadow:inset 0 0 0 1px #17110a,0 18px 48px rgba(0,0,0,.72); }
.tone-testing-header{ display:flex; align-items:center; justify-content:space-between; flex:0 0 auto; gap:18px; padding:14px 18px; border-bottom:1px solid rgba(183,138,57,.55); background:rgba(10,9,8,.35); }
.tone-testing-title-copy{ min-width:0; }
.tone-testing-title{ margin:0; color:#f0d47d; font-family:var(--font-display); font-size:1.25rem; font-weight:normal; }
.tone-testing-subtitle{ margin:3px 0 0; color:#bbb3a5; font-size:.82rem; }
.tone-testing-close{ position:relative; flex:0 0 auto; }
.tone-testing-body{ display:grid; grid-template-columns:minmax(0,1fr) 330px; flex:1 1 auto; min-height:0; }
.tone-testing-stage{ position:relative; display:grid; min-width:0; min-height:0; place-items:center; overflow:hidden; background:radial-gradient(circle at 50% 38%,rgba(117,89,45,.22),transparent 48%),linear-gradient(135deg,#17191d,#090a0d); }
.tone-testing-stage::before{ content:""; position:absolute; inset:16px; border:1px solid rgba(223,200,111,.2); border-radius:6px; pointer-events:none; }
.tone-testing-canvas{ display:block; width:100%; height:100%; object-fit:contain; }
.tone-testing-status{ position:absolute; right:24px; bottom:20px; padding:5px 9px; border:1px solid rgba(183,138,57,.45); border-radius:4px; background:rgba(8,8,9,.78); color:#c9c0ae; font-size:.72rem; }
.tone-testing-controls{ min-height:0; padding:15px; overflow:auto; border-left:1px solid rgba(183,138,57,.42); background:rgba(18,17,16,.68); }
.tone-testing-section-title{ margin:0 0 9px; color:#ecd27e; font-family:var(--font-display); font-size:.92rem; font-weight:normal; }
.tone-testing-colors-title{ margin-top:18px; }
.tone-testing-character-choices{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.tone-testing-character-choice{ display:flex; flex-direction:column; min-width:0; padding:4px; border:1px solid #655c4d; border-radius:5px; background:#292825; color:#d8d1c5; cursor:pointer; }
.tone-testing-character-choice:hover,.tone-testing-character-choice:focus-visible{ border-color:#d1ad4d; outline:none; }
.tone-testing-character-choice.active{ border-color:#ffe071; background:#4d421e; box-shadow:0 0 8px rgba(255,215,0,.24); }
.tone-testing-character-thumb{ width:100%; height:98px; object-fit:cover; object-position:50% 18%; border-radius:3px; background:#111; }
.tone-testing-character-number{ padding:5px 2px 2px; font-size:.72rem; text-align:center; }
.tone-testing-color-group{ margin-top:9px; padding:9px; border:1px solid #514b41; border-radius:5px; background:rgba(61,59,54,.55); }
.tone-testing-color-heading{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:7px; }
.tone-testing-color-label{ color:#eee6d9; font-weight:700; }
.tone-testing-color-value{ color:#aaa294; font-size:.7rem; }
.tone-testing-color-row{ display:flex; align-items:center; gap:8px; }
.tone-testing-color-picker{ width:42px; height:34px; flex:0 0 auto; padding:2px; border:1px solid #8e7b52; border-radius:4px; background:#1c1b19; cursor:pointer; }
.tone-testing-swatches{ display:grid; grid-template-columns:repeat(5,1fr); flex:1; gap:5px; }
.tone-testing-swatch{ aspect-ratio:1; min-width:0; border:1px solid rgba(255,255,255,.36); border-radius:50%; background:var(--tone-swatch); box-shadow:inset 0 0 0 2px rgba(0,0,0,.2); cursor:pointer; }
.tone-testing-swatch:hover,.tone-testing-swatch:focus-visible{ border-color:#fff2a6; outline:none; transform:scale(1.08); }
.tone-testing-note{ margin:13px 2px 0; color:#aaa294; font-size:.75rem; line-height:1.4; }
.tone-testing-diagnostics-title{ margin-top:18px; }
.tone-testing-diagnostic-choices{ display:grid; grid-template-columns:repeat(4,1fr); gap:5px; }
.tone-testing-diagnostic-choice{ min-width:0; padding:7px 4px; border:1px solid #5b554b; border-radius:4px; background:#292825; color:#ddd5c8; font-family:var(--font-ui); font-size:.7rem; cursor:pointer; }
.tone-testing-diagnostic-choice:hover,.tone-testing-diagnostic-choice:focus-visible{ border-color:#d1ad4d; outline:none; }
.tone-testing-diagnostic-choice.active{ border-color:#ffe071; background:#4d421e; color:#fff1ae; }
.tone-testing-edit-masks{
    width:100%; margin-top:16px; padding:9px 12px; border:1px solid #b78a39; border-radius:5px;
    background:linear-gradient(#4d421e,#302812); color:#f0d47d; font:700 .8rem var(--font-ui); cursor:pointer;
}
.tone-testing-edit-masks:hover,.tone-testing-edit-masks:focus-visible{ border-color:#ffe071; outline:none; filter:brightness(1.12); }

/* Owner mask authoring tool (tone_mask_editor.js). All inference and correction stays in the browser. */
.game-content-overlay.tone-mask-editor-overlay{ z-index:1500; display:grid; place-items:center; padding:18px; background:rgba(3,3,5,.94); }
.tone-mask-editor-panel{ display:flex; flex-direction:column; box-sizing:border-box; width:min(1260px,100%); height:min(850px,100%); min-height:0; overflow:hidden; border:2px solid #b78a39; border-radius:8px; background:#181817; box-shadow:0 20px 60px rgba(0,0,0,.8); }
.tone-mask-editor-header{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex:0 0 auto; padding:12px 17px; border-bottom:1px solid rgba(183,138,57,.5); background:#211f1c; }
.tone-mask-editor-close{ flex:0 0 auto; }
.tone-mask-editor-title{ margin:0; color:#f0d47d; font-family:var(--font-display); font-size:1.15rem; font-weight:normal; }
.tone-mask-editor-subtitle{ margin:3px 0 0; color:#bdb5a7; font-size:.78rem; }
.tone-mask-editor-panel > .tone-mask-editor-header + *{ min-height:0; }
.tone-mask-editor-panel{ container-type:inline-size; }
.tone-mask-editor-header + .tone-mask-editor-canvas{ min-height:0; }
.tone-mask-editor-panel > :last-child{ min-height:0; }
.tone-mask-editor-panel .tone-mask-editor-sidebar{ min-height:0; }
.tone-mask-editor-header ~ .tone-mask-editor-sidebar{ min-height:0; }
.tone-mask-editor-panel{ --editor-sidebar:330px; }
.tone-mask-editor-header + .tone-mask-editor-body{ min-height:0; }
.tone-mask-editor-canvas{ position:absolute; display:block; max-width:none; max-height:none; transform:translate(-50%,-50%); touch-action:none; cursor:crosshair; }
.tone-mask-editor-canvas.is-panning{ cursor:grab; }
.tone-mask-editor-canvas.is-panning:active{ cursor:grabbing; }
.tone-mask-editor-status{ position:absolute; right:14px; bottom:12px; max-width:70%; padding:5px 8px; border:1px solid rgba(183,138,57,.55); border-radius:4px; background:rgba(7,7,8,.88); color:#ddd3c0; font-size:.72rem; }
.tone-mask-editor-panel > .tone-mask-editor-header ~ .tone-mask-editor-sidebar{ border-left:1px solid rgba(183,138,57,.4); }
.tone-mask-editor-panel{ display:grid; grid-template-columns:minmax(0,1fr) var(--editor-sidebar); grid-template-rows:auto minmax(0,1fr); }
.tone-mask-editor-header{ grid-column:1/-1; }
.tone-mask-editor-panel > .tone-mask-editor-header + .tone-mask-editor-stage{ min-height:0; }
.tone-mask-editor-panel > .tone-mask-editor-sidebar{ grid-column:2; grid-row:2; }
.tone-mask-editor-header + .tone-mask-editor-stage{ grid-column:1; grid-row:2; }
.tone-mask-editor-panel > canvas{ grid-column:1; grid-row:2; min-height:0; }
.tone-mask-editor-panel > .tone-mask-editor-sidebar{ padding:13px; overflow:auto; background:#151513; }
.tone-mask-editor-panel > .tone-mask-editor-header + canvas{ min-height:0; background:radial-gradient(circle,#202126,#0c0d10 72%); }
.tone-mask-editor-section-title{ margin:0 0 7px; color:#ecd27e; font-family:var(--font-display); font-size:.83rem; font-weight:normal; }
.tone-mask-editor-section-title:not(:first-child){ margin-top:15px; }
.tone-mask-editor-layers{ display:grid; grid-template-columns:1fr 1fr; gap:5px; }
.tone-mask-editor-layer,.tone-mask-editor-tool,.tone-mask-editor-action{ border:1px solid #5b554b; border-radius:4px; background:#292825; color:#ddd5c8; font-family:var(--font-ui); cursor:pointer; }
.tone-mask-editor-layer{ display:flex; align-items:center; gap:6px; min-width:0; padding:7px; font-size:.73rem; text-align:left; }
.tone-mask-editor-layer-dot{ width:10px; height:10px; flex:0 0 auto; border:1px solid rgba(255,255,255,.55); border-radius:50%; background:var(--mask-color); }
.tone-mask-editor-layer.active,.tone-mask-editor-tool.active{ border-color:#ffe071; background:#4d421e; color:#fff1ae; }
.tone-mask-editor-tools{ display:grid; grid-template-columns:repeat(4,1fr); gap:5px; }
.tone-mask-editor-tool{ min-height:38px; padding:5px; font-size:.7rem; }
.tone-mask-editor-sliders{ display:grid; gap:7px; margin-top:10px; padding:9px; border:1px solid #474239; border-radius:5px; background:#22211f; }
.tone-mask-editor-slider-label{ display:flex; justify-content:space-between; color:#cfc6b8; font-size:.72rem; }
.tone-mask-editor-sliders input{ width:100%; margin:0; accent-color:#c9a748; }
.tone-mask-editor-actions{ display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:14px; }
.tone-mask-editor-action{ min-height:34px; padding:6px; font-size:.72rem; }
.tone-mask-editor-action:hover,.tone-mask-editor-action:focus-visible,.tone-mask-editor-layer:hover,.tone-mask-editor-layer:focus-visible,.tone-mask-editor-tool:hover,.tone-mask-editor-tool:focus-visible{ border-color:#d1ad4d; outline:none; }
.tone-mask-editor-action:disabled{ opacity:.38; cursor:default; }
.tone-mask-editor-auto{ grid-column:1/-1; color:#f0d47d; }
.tone-mask-editor-export{ width:100%; margin-top:12px; padding:9px; border:1px solid #d1ad4d; border-radius:5px; background:linear-gradient(#d7b84e,#a98020); color:#17130a; font:700 .78rem var(--font-ui); cursor:pointer; }
.tone-mask-editor-export:hover,.tone-mask-editor-export:focus-visible{ outline:none; filter:brightness(1.1); }
.tone-mask-editor-export-selected{ width:100%; min-height:34px; margin-top:7px; }
.tone-mask-editor-help{ margin:10px 1px 0; color:#9f978a; font-size:.72rem; line-height:1.4; }
.tone-mask-editor-panel{ display:flex; flex-direction:column; }
.tone-mask-editor-body{ display:grid; grid-template-columns:minmax(0,1fr) 330px; flex:1 1 auto; min-height:0; }
.tone-mask-editor-stage{ position:relative; min-width:0; min-height:0; overflow:hidden; background:radial-gradient(circle,#202126,#0c0d10 72%); }
.tone-mask-editor-sidebar{ min-height:0; padding:13px; overflow:auto; border-left:1px solid rgba(183,138,57,.4); background:#151513; }
@media (max-width:800px){
    .tone-mask-editor-body{ grid-template-columns:1fr; grid-template-rows:minmax(280px,1fr) minmax(220px,42vh); }
    .tone-mask-editor-sidebar{ border-top:1px solid rgba(183,138,57,.4); border-left:0; }
}
@media (max-width:800px){
    .tone-mask-editor-panel{ --editor-sidebar:280px; }
    .tone-mask-editor-layers{ grid-template-columns:1fr; }
}
@media (max-width:760px){
    .tone-testing-body{ grid-template-columns:1fr; grid-template-rows:minmax(280px,1fr) auto; }
    .tone-testing-controls{ max-height:280px; border-top:1px solid rgba(183,138,57,.42); border-left:0; }
}

/* Main in-game navigation: a compact dark-and-gold command strip instead of a plain slate
   slab.  This is intentionally scoped to the live game content so the devtools navbar keeps
   its own established layout. */
#gameContentWrapper > .iconsWrapper{
    position:relative;
    overflow:visible;
    /* Above the opaque player-module overlay (40) so downward-opening nav tooltips are not
       painted behind it; still below dialogs/combat (50) and messages (60). */
    z-index:45;
    box-sizing:border-box;
    width:calc(100% - 24px);
    margin:8px 12px 10px;
    padding:8px 44px;
    gap:38px;
    background:linear-gradient(180deg, #514a3e 0%, #37332c 48%, #24231f 100%);
    border:1px solid rgba(0,0,0,0.9);
    border-bottom-color:#b78a39;
    border-radius:4px 4px 7px 7px;
    box-shadow:inset 0 1px rgba(255,255,255,0.16), inset 0 -1px rgba(0,0,0,0.8), 0 3px 8px rgba(0,0,0,0.35);
}
#gameContentWrapper > .iconsWrapper::before,
#gameContentWrapper > .iconsWrapper::after{
    content:"";
    position:absolute;
    left:50%;
    z-index:0;
    width:70px;
    height:13px;
    background:linear-gradient(90deg, transparent 0%, #b78a39 15%, var(--color-gold) 35%, #fff0a0 50%, var(--color-gold) 65%, #b78a39 85%, transparent 100%);
    clip-path:polygon(0 43%, 31% 43%, 39% 18%, 44% 43%, 50% 0, 56% 43%, 61% 18%, 69% 43%, 100% 43%, 100% 57%, 69% 57%, 61% 82%, 56% 57%, 50% 100%, 44% 57%, 39% 82%, 31% 57%, 0 57%);
}
#gameContentWrapper > .iconsWrapper::before{ display:none; }
#gameContentWrapper > .iconsWrapper::after{ top:auto; bottom:-7px; transform:translateX(-50%) rotate(180deg); }
#gameContentWrapper > .iconsWrapper > *{
    position:relative;
    z-index:1;
}
#gameContentWrapper > .iconsWrapper .iconsButton{
    width:48px;
    height:48px;
    border-color:#b8af9f;
    border-radius:7px;
    background-size:46px;
    background-color:#282725;
    box-shadow:inset 0 1px rgba(255,255,255,0.18), inset 0 -2px 4px rgba(0,0,0,0.72), 0 2px 3px rgba(0,0,0,0.45);
}
#gameContentWrapper > .iconsWrapper #playerIconButton_social{
    background-position:center;
    background-size:60px;
}
#gameContentWrapper > .iconsWrapper .iconsButton:hover{
    border-color:var(--color-gold);
    background-color:#574a1a;
    box-shadow:0 0 0 1px rgba(255,215,0,0.28), 0 0 10px rgba(255,215,0,0.34), inset 0 1px rgba(255,255,255,0.24);
    transform:translateY(-1px);
}
#gameContentWrapper > .iconsWrapper .iconsButton.is-selected{
    border-color:var(--color-gold);
    background-color:#655319;
    box-shadow:0 0 0 1px rgba(255,215,0,0.46), 0 0 12px rgba(255,215,0,0.38), inset 0 1px rgba(255,255,255,0.32), inset 0 -2px 5px rgba(0,0,0,0.68);
}
/* Main-nav tooltips stay inside the clipped play frame by opening below the buttons.  This
   also makes them independent of the vital header's stacking layer. */
#gameContentWrapper > .iconsWrapper .iconsButton[tooltip]:hover::after{
    top:calc(100% + 8px);
    bottom:auto;
    z-index:1000;
}

.game-content-wrapper{
    position: relative;
    box-sizing:border-box;
    background:var(--color-gameDark);
    border:1px solid var(--color-gameLight);
    border-top:0 !important;
    padding:2px;
    padding-bottom: 15px;
    border-radius:0 0 5px 5px !important;
    font-size:18px;
    width:100%;
    display:flex;
    flex: 1;
    flex-direction: column; /* Added to stack content elements */
    /* Header + command strip occupy variable space.  A fixed viewport height here made
       Travel's town hub spill past the overlay after the HUD refresh. */
    height:auto;
    min-height:0;
    overflow:hidden;
}
/* The play frame is the continuation of the vital header, not a second floating card. */
.game-header + .game-content-wrapper{
    margin-top:-5px;
}
/* Reusable ornate gold-bordered frame - a double-border effect (the outer rule's own border +
   an inset pseudo-element border a few px in) plus a soft inner glow and outer drop shadow.
   Declared after .game-content-wrapper so its border/border-radius/background win over that
   rule's plainer versions when both classes sit on the same element (as the main game panel
   does), without needing to touch every other property .game-content-wrapper still owns
   (padding, flex, height, etc). Anything else that wants this same treatment later just needs
   the class added, nothing new to write. */
.gold-frame{
    position: relative;
    border: 2px solid #b78a39;
    border-radius: 8px;
    background: linear-gradient(#333, #202020);

    box-shadow:
        inset 0 0 0 1px #1a140b,
        inset 0 0 12px rgba(255, 195, 65, 0.10),
        0 0 0 1px #20170b,
        0 7px 18px rgba(0, 0, 0, 0.5);
}

.gold-frame::before{
    content: "";
    position: absolute;
    inset: 6px;

    border: 1px solid rgba(226, 193, 111, 0.65);
    border-radius: 4px;

    pointer-events: none;
}
.game-content{
    visibility: visible;
    position: relative;
}

/* Shared player-module overlay. Travel remains mounted beneath it, but this opaque shell always
   fills #gameContent so no town/map imagery can show around a narrower module. Layer 40 clears
   Town's decorative/Spirit Anchor layers (up to 12) and the normal content. The navbar at 45
   remains usable and its tooltips can extend over this shell, while shared dialog/combat
   overlays at 50 and messages at 60 still correctly open above both. */
.game-screen-overlay{
    position: absolute;
    /* The generous side reveal distinguishes this as a screen layered over Travel and keeps it
       well clear of the main frame's own border treatment. */
    inset: 7px 140px;
    z-index: 40;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid rgba(201,154,62,.48);
    border-radius: 10px;
    background: linear-gradient(145deg, #343434, #292929 58%, #242424);
    box-shadow: 0 10px 28px rgba(0,0,0,.5);
}
/* The overlay is deliberately narrower than Travel so the main frame remains visible. Hide the
   mounted base screen while a module is open; otherwise town/map artwork would peek through that
   seven-pixel frame gutter. #gameContent itself supplies the solid opaque backing. */
.game-content-travel:has(> #screenOverlay) > :not(#screenOverlay){
    visibility: hidden;
}
/* A module owns only its internal layout. Widths, margins, scrolling, and specialized panel
   backgrounds belong here; the outer overlay above remains full-size and opaque regardless. */
.game-screen-module{
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
}
.game-screen-overlay-ornaments{
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}
.game-screen-overlay-ornaments::before,
.game-screen-overlay-ornaments::after{
    content: "";
    position: absolute;
    top: 44px;
    bottom: 44px;
    width: 22px;
    background: url("../images/icons/overlay-rail.svg") center top / 22px 240px repeat-y;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.55));
    opacity: .48;
}
.game-screen-overlay-ornaments::before{ left: -16px; }
.game-screen-overlay-ornaments::after{ right: -16px; transform: scaleX(-1); }
.game-screen-overlay-corner{
    position: absolute;
    width: 44px;
    height: 44px;
    background: url("../images/icons/overlay-corner.svg") center / contain no-repeat;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.58));
    opacity: .68;
}
.game-screen-overlay-corner.top-left{ top:-6px; left:-6px; }
.game-screen-overlay-corner.top-right{ top:-6px; right:-6px; transform:scaleX(-1); }
.game-screen-overlay-corner.bottom-right{ right:-6px; bottom:-6px; transform:scale(-1); }
.game-screen-overlay-corner.bottom-left{ bottom:-6px; left:-6px; transform:scaleY(-1); }
.game-screen-overlay-close{
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
}
@media (max-width: 700px){
    .game-screen-overlay{ inset-inline: 16px; }
}

.game-content-quest{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
}

/* Trades: known crafting disciplines and the player-owned recipe/tool collections that will
   populate them as those systems come online. */
.game-content-trades{ display:flex; flex:1; min-height:0; padding:22px; box-sizing:border-box; }
.trades-screen{ display:flex; flex:1; min-width:0; min-height:0; flex-direction:column; gap:14px; padding:18px 20px; border:1px solid rgba(183,138,57,0.58); border-radius:8px; background:linear-gradient(155deg,rgba(73,68,59,0.96),rgba(35,35,35,0.98)); box-shadow:inset 0 0 18px rgba(0,0,0,0.38); }
.trades-header{ display:flex; flex-direction:column; gap:3px; }
.trades-title{ margin:0; color:var(--color-gold); font-size:1.35rem; }
.trades-intro{ margin:0; color:var(--color-gameLight); opacity:0.86; }
.trades-view-tabs{ display:flex; gap:5px; border-bottom:1px solid rgba(183,138,57,0.45); }
.trades-view-tab{ min-width:112px; padding:9px 18px; border:1px solid rgba(183,138,57,0.34); border-bottom:0; border-radius:6px 6px 0 0; color:var(--color-gameSlate); background:rgba(0,0,0,0.14); font:inherit; font-weight:bold; cursor:pointer; }
.trades-view-tab:hover,.trades-view-tab:focus-visible{ color:#f2df91; border-color:rgba(207,159,52,0.62); }
.trades-view-tab.active{ color:var(--color-gold); border-color:rgba(207,159,52,0.7); background:rgba(0,0,0,0.34); }
.trades-tabs{ display:flex; flex-wrap:wrap; gap:6px; border-bottom:1px solid rgba(183,138,57,0.38); }
.trades-tab{ padding:7px 14px; border:1px solid transparent; border-bottom:0; border-radius:6px 6px 0 0; color:var(--color-gameSlate); background:transparent; font:inherit; cursor:pointer; }
.trades-tab:hover,.trades-tab:focus-visible{ color:#f2df91; border-color:rgba(183,138,57,0.38); }
.trades-tab.active{ color:var(--color-gold); border-color:rgba(183,138,57,0.52); background:rgba(0,0,0,0.28); }
.trades-content{ display:flex; flex:1; min-width:0; min-height:0; flex-direction:column; gap:14px; overflow:hidden; }
.trades-panel{ min-height:250px; padding:14px; border:1px solid rgba(183,138,57,0.34); border-radius:7px; background:rgba(0,0,0,0.2); }
.trades-recipe-tabs{ flex:0 0 auto; }
.trades-recipes{ flex:1; min-height:0; overflow-y:auto; }
.trades-recipes-head{ display:flex; align-items:center; gap:14px; margin-bottom:10px; }
.trades-recipes-head .trades-panel-title{ flex:0 0 auto; margin:0; }
.trades-recipe-search{ width:min(420px,100%); min-height:34px; margin-left:auto; padding:7px 10px; border:1px solid rgba(183,138,57,.5); border-radius:5px; outline:0; color:var(--color-gameLight); background:rgba(0,0,0,.34); font:inherit; }
.trades-recipe-search:focus{ border-color:var(--color-gold); box-shadow:0 0 0 2px rgba(183,138,57,.1); }
.trades-recipe-search::placeholder{ color:rgba(255,255,255,.38); }
.trades-recipe-row{ position:relative; cursor:pointer; overflow:visible; }
.trades-recipe-row.is-open{ z-index:20; border-color:var(--color-gold); }
.trades-recipe-row:focus-visible{ border-color:var(--color-gold); outline:1px solid var(--color-gold); outline-offset:1px; }
.trades-recipe-detail{ position:fixed; top:0; left:0; z-index:10020; width:290px; min-width:290px; max-height:330px; padding:10px; box-sizing:border-box; overflow-y:auto; border:1px solid rgba(207,159,52,.82); border-radius:6px; color:var(--color-gameLight); background:linear-gradient(155deg,#302d27,#191817); box-shadow:0 9px 22px rgba(0,0,0,.78),inset 0 0 12px rgba(0,0,0,.3); cursor:default; }
.trades-recipe-detail-title{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:7px; padding-bottom:6px; border-bottom:1px solid rgba(183,138,57,.32); color:var(--color-gold); font-family:var(--font-display); font-size:.84rem; }
.trades-recipe-detail-unit{ color:var(--color-gameSlate); font-family:var(--font-ui); font-size:.68rem; letter-spacing:.05em; text-transform:uppercase; }
.trades-recipe-facilities{ display:flex; flex-wrap:wrap; gap:5px; margin-bottom:12px; }
.trades-recipe-facility{ padding:3px 8px; border:1px solid rgba(183,138,57,.36); border-radius:4px; background:rgba(255,255,255,.025); font-size:.76rem; }
.trades-recipe-ingredient-image{ cursor:default; }
.trades-skill-badge{ display:flex; flex:0 0 auto; align-items:center; gap:10px; }
.trades-skill-badge-icon{ width:40px; height:40px; object-fit:contain; border:1px solid rgba(183,138,57,.5); border-radius:5px; background:#151515; }
.trades-skill-badge-text{ display:flex; flex-direction:column; line-height:1.1; }
.trades-skill-badge-label{ color:var(--color-gameSlate); font-size:.68rem; letter-spacing:.06em; text-transform:uppercase; }
.trades-skill-badge-value{ color:var(--color-gold); font-family:var(--font-display); font-size:1.25rem; }
.trades-recipe-ingredient{ display:grid; grid-template-columns:32px minmax(0,1fr) auto; align-items:center; gap:8px; min-height:34px; padding:3px 5px; border-radius:4px; background:rgba(255,255,255,.025); }
.trades-recipe-ingredient+.trades-recipe-ingredient{ margin-top:3px; }
.trades-recipe-ingredient-image{ width:30px; height:30px; object-fit:contain; border:1px solid rgba(183,138,57,.36); border-radius:4px; background:#151515; }
.trades-recipe-ingredient-name{ min-width:0; overflow:hidden; font-size:.78rem; text-overflow:ellipsis; white-space:nowrap; }
.trades-recipe-ingredient-count{ color:#ddd0a7; font-size:.76rem; font-weight:700; white-space:nowrap; }
.trades-recipe-ingredient.short .trades-recipe-ingredient-count{ color:#ef796b; }
.trades-recipe-choice-title{ margin:8px 0 5px; color:#cbb77b; font-size:.73rem; font-weight:700; }
.trades-recipe-choice-option{ margin-top:4px; padding:5px; border:1px solid rgba(183,138,57,.22); border-radius:4px; background:rgba(0,0,0,.18); }
.trades-recipe-choice-label{ margin-bottom:3px; color:var(--color-gameSlate); font-size:.66rem; letter-spacing:.04em; text-transform:uppercase; }
.trades-recipe-no-ingredients,.trades-recipe-no-results{ padding:18px; color:var(--color-gameSlate); text-align:center; }
.trades-recipe-no-results{ grid-column:1/-1; }
.trades-panel-title{ margin:0 0 12px; color:#dfc86f; font-size:1rem; }
.trades-panel-empty,.trades-empty{ display:flex; align-items:center; justify-content:center; flex-direction:column; gap:6px; color:var(--color-gameSlate); text-align:center; }
.trades-panel-empty{ min-height:190px; border:1px dashed rgba(183,138,57,0.25); border-radius:6px; }
.trades-empty{ flex:1; min-height:320px; }
.trades-empty-icon{ width:96px; height:96px; object-fit:contain; opacity:0.72; filter:drop-shadow(0 3px 5px rgba(0,0,0,0.65)); }
.trades-empty-title,.trades-panel-empty-title{ color:#cbb77b; font-family:var(--font-display); }
.trades-empty-title{ font-size:1.15rem; }
.trades-empty-copy,.trades-panel-empty-copy{ max-width:430px; }
.trades-view-empty{ min-height:240px; }
.trades-tools-heading{ flex:0 0 auto; }
.trades-section-title{ margin:0; color:#dfc86f; font-size:1.08rem; }
.trades-section-copy{ margin:3px 0 0; color:var(--color-gameLight); opacity:.82; }
.trades-tool-groups{ display:flex; flex:1; flex-direction:column; gap:14px; min-height:0; padding-right:4px; overflow-y:auto; }
.trades-tool-group{ padding:10px 12px 12px; border:1px solid rgba(183,138,57,.28); border-radius:9px; background:rgba(0,0,0,.16); box-shadow:inset 0 0 18px rgba(0,0,0,.22); }
.trades-tool-group-title{ margin:0 0 9px; padding-bottom:6px; border-bottom:1px solid rgba(183,138,57,.24); color:#dfc86f; font-size:.95rem; letter-spacing:.06em; }
.trades-tool-grid{ display:flex; flex-flow:row wrap; gap:10px; }
.trades-tool-grid > .trades-tool-card{ width:250px; }
.trades-tool-card{ display:flex; min-width:0; min-height:94px; flex-direction:column; padding:10px 12px; border:1px solid rgba(183,138,57,0.36); border-radius:7px; background:linear-gradient(155deg,rgba(38,36,32,.92),rgba(19,19,18,.92)); box-shadow:inset 0 0 14px rgba(0,0,0,.28); }
.trades-tool-card-heading{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding-bottom:6px; border-bottom:1px solid rgba(183,138,57,.24); }
.trades-tool-card-title{ min-width:0; margin:0; overflow:hidden; color:var(--color-gold); font-size:1rem; text-overflow:ellipsis; white-space:nowrap; }
.trades-tool-card-kind{ flex:0 0 auto; color:var(--color-gameSlate); font-size:.68rem; letter-spacing:.06em; text-transform:uppercase; }
.trades-tool-card-equipment{ display:flex; align-items:center; padding-top:8px; }
.trades-primary-tool-slot{ width:42px; height:42px; }
/* Trades with more than one tool slot (Harvesting, 2026-11-01): the slots side by side, unlabeled. */
.trades-tool-card-slots{ gap:10px; }
.trades-bait-title{ margin:0 0 4px; color:#cbb77b; font-family:var(--font-ui); font-size:.68rem; letter-spacing:.06em; text-transform:uppercase; }
.trades-bait-slots{ display:flex; flex-wrap:nowrap; gap:5px; }
.trades-tool-card-fishing{ display:grid; min-height:94px; grid-template-columns:48px minmax(0,1fr); grid-template-rows:auto auto auto; column-gap:10px; }
.trades-tool-card-fishing .trades-tool-card-heading{ grid-column:1/-1; }
.trades-tool-card-fishing .trades-tool-card-equipment{ grid-column:1; grid-row:2/4; align-self:center; padding-top:7px; }
.trades-tool-card-fishing .trades-bait-title{ grid-column:2; grid-row:2; align-self:end; padding-top:5px; }
.trades-tool-card-fishing .trades-bait-slots{ grid-column:2; grid-row:3; align-self:start; }
.trades-tool-card-fishing .trades-bait-slot{ width:36px; height:36px; }
.trades-bait-option-effect{ color:var(--color-gameSlate); font-size:0.85rem; }
.trades-tool-option-bonus{ color:var(--color-gold); font-weight:bold; }
.trades-tool-overlay{ position:fixed; inset:0; z-index:1200; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(0,0,0,0.72); }
.trades-tool-dialog{ width:min(560px,100%); max-height:min(620px,80vh); display:flex; flex-direction:column; gap:12px; padding:16px; border:1px solid var(--color-gold); border-radius:8px; background:#292826; box-shadow:0 14px 40px rgba(0,0,0,0.72); }
.trades-tool-dialog-header{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.trades-tool-dialog-title{ margin:0; color:var(--color-gold); font-size:1.05rem; }
.trades-tool-dialog-close{ width:30px; height:30px; border:1px solid rgba(207,159,52,0.58); border-radius:50%; background:#222; color:var(--color-gameLight); font-size:1.15rem; cursor:pointer; }
.trades-tool-options{ display:flex; flex-direction:column; gap:8px; overflow-y:auto; }
.trades-tool-options-empty{ padding:34px 16px; color:var(--color-gameSlate); text-align:center; }
.trades-tool-option{ display:grid; grid-template-columns:58px minmax(0,1fr) auto; align-items:center; gap:12px; padding:8px; border:1px solid rgba(183,138,57,0.3); border-radius:6px; background:rgba(0,0,0,0.2); }
.trades-tool-option.equipped{ border-color:var(--color-gold); background:rgba(183,138,57,0.1); }
.trades-tool-option-image{ width:56px; height:56px; object-fit:contain; border:1px solid rgba(255,255,255,0.5); border-radius:5px; background:#1d1d1d; }
.trades-tool-option-details{ min-width:0; }
.trades-tool-option-name{ overflow:hidden; color:var(--color-gameLight); font-weight:bold; text-overflow:ellipsis; white-space:nowrap; }
.trades-tool-option-action{ min-width:88px; min-height:34px; border:1px solid rgba(207,159,52,0.62); border-radius:5px; background:#222; color:var(--color-gameLight); cursor:pointer; }
.trades-tool-option-action:hover,.trades-tool-option-action:focus-visible{ border-color:var(--color-gameGold); color:var(--color-gameGold); }

@media (max-width:620px){ .game-content-trades{ padding:10px; } .trades-screen{ padding:14px; } .trades-view-tab{ min-width:94px; padding:8px 13px; } .trades-panel{ min-height:190px; } }

/* Social: a presentation-only preview of the future Guild, Party, and Friends systems. */
.game-content-social{ display:flex; flex:1; min-height:0; padding:22px; box-sizing:border-box; }
.social-screen{ position:relative; display:flex; flex:1; min-width:0; min-height:0; flex-direction:column; gap:10px; padding:20px; border:1px solid rgba(183,138,57,0.58); border-radius:8px; background:linear-gradient(155deg,rgba(73,68,59,0.96),rgba(35,35,35,0.98)); box-shadow:inset 0 0 18px rgba(0,0,0,0.38); }
.social-my-colors-border{ position:absolute; top:-13px; left:50%; z-index:6; padding:4px 13px; transform:translateX(-50%); border:1px solid rgba(207,159,52,.78); border-radius:13px; background:#302d27; color:#e6d38c; font-family:var(--font-ui); font-size:.72rem; font-weight:bold; box-shadow:0 0 0 5px #302d27,0 3px 7px rgba(0,0,0,.45); cursor:pointer; }
.social-my-colors-border:hover,.social-my-colors-border:focus-visible{ border-color:var(--color-gold); color:#fff0a0; }
.social-my-colors-border:focus-visible{ outline:2px solid var(--color-gameLight); outline-offset:2px; }
.social-toolbar{ display:flex; min-height:28px; justify-content:flex-end; align-items:center; }
.social-header{ display:flex; flex-direction:column; gap:3px; }
.social-title{ margin:0; color:var(--color-gold); font-size:1.35rem; }
.social-intro{ margin:0; color:var(--color-gameLight); opacity:0.88; }
.social-grid{ display:grid; flex:1; width:100%; height:100%; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; min-height:0; }
.social-card{ position:relative; display:flex; min-width:0; min-height:390px; flex-direction:column; gap:14px; padding:16px; overflow:hidden; border:1px solid rgba(183,138,57,0.42); border-radius:8px; background:linear-gradient(165deg,rgba(45,42,37,0.96),rgba(24,24,23,0.96)); box-shadow:0 8px 18px rgba(0,0,0,0.2); }
.social-card::after{ content:""; position:absolute; right:-42px; bottom:-58px; width:150px; height:150px; border:1px solid rgba(183,138,57,0.12); border-radius:50%; box-shadow:0 0 0 18px rgba(183,138,57,0.03),0 0 0 38px rgba(183,138,57,0.02); pointer-events:none; }
.social-card-header{ display:grid; grid-template-columns:58px minmax(0,1fr) auto; align-items:center; gap:11px; }
.social-card-emblem{ position:relative; width:56px; height:56px; border:1px solid rgba(207,159,52,0.62); border-radius:50%; background:radial-gradient(circle at 50% 35%,rgba(183,138,57,0.25),rgba(0,0,0,0.35)); box-shadow:inset 0 0 10px rgba(0,0,0,0.45); }
.social-emblem-person{ position:absolute; bottom:11px; width:15px; height:18px; border-radius:50% 50% 42% 42%; background:#c99d42; box-shadow:0 -9px 0 -3px #ead78c; }
.social-emblem-person:nth-child(1){ left:9px; transform:scale(.78); opacity:.72; }
.social-emblem-person:nth-child(2){ left:20px; z-index:1; }
.social-emblem-person:nth-child(3){ right:9px; transform:scale(.78); opacity:.72; }
.social-emblem-person:nth-child(4){ right:19px; bottom:6px; transform:scale(.62); opacity:.48; }
.social-card-heading{ min-width:0; }
.social-card-title{ margin:0; color:#dfc86f; font-size:1.08rem; }
.social-card-lead{ overflow:hidden; color:var(--color-gameLight); font-size:.84rem; text-overflow:ellipsis; white-space:nowrap; }
.social-coming-soon{ align-self:start; padding:3px 7px; border:1px solid rgba(183,138,57,0.42); border-radius:10px; color:#cbb77b; background:rgba(183,138,57,0.09); font-size:.68rem; letter-spacing:.05em; text-transform:uppercase; white-space:nowrap; }
.social-card-copy{ min-height:48px; margin:0; color:var(--color-gameLight); opacity:.82; }
.social-preview{ display:flex; min-height:150px; flex-direction:column; gap:11px; padding:13px; border:1px dashed rgba(183,138,57,0.28); border-radius:7px; background:rgba(0,0,0,0.18); }
.social-preview-title{ color:#cbb77b; font-size:.82rem; text-align:center; }
.social-preview-lines{ display:flex; flex-direction:column; gap:7px; opacity:.48; }
.social-preview-line{ display:grid; grid-template-columns:28px minmax(0,1fr) 42px; align-items:center; gap:8px; }
.social-preview-avatar{ width:26px; height:26px; border:1px solid rgba(183,138,57,0.35); border-radius:50%; background:rgba(183,138,57,0.1); }
.social-preview-name,.social-preview-status{ height:6px; border-radius:3px; background:rgba(205,195,170,0.28); }
.social-preview-status{ background:rgba(183,138,57,0.28); }
.social-feature-list{ display:flex; flex-wrap:wrap; gap:6px; margin-top:auto; }
.social-feature{ padding:4px 8px; border:1px solid rgba(183,138,57,0.28); border-radius:11px; color:var(--color-gameSlate); background:rgba(0,0,0,0.18); font-size:.74rem; }
@media (max-width:1000px){ .social-grid{ grid-template-columns:1fr; overflow-y:auto; } .social-card{ min-height:310px; } }
@media (max-width:620px){ .game-content-social{ padding:10px; } .social-screen{ padding:14px; } .social-card-header{ grid-template-columns:52px minmax(0,1fr); } .social-coming-soon{ grid-column:2; justify-self:start; } }

/* Quest Journal (2026-10-09) - an open notebook: a list page on the left, the written page on the
   right. Warm ink-on-parchment tones inside the game's dark frame; prose in the Narrative face. */
.game-content-quest > .journal-book{
    align-self: stretch;
}
.journal-book{
    display: flex;
    flex-direction: column;
    width: min(1100px, 100%);
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    padding: 18px 22px;
    box-sizing: border-box;
    color: #e9dcc0;
}
.journal-title{
    color: var(--color-gold);
    font-size: 1.6rem;
    text-align: center;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}
.journal-tabs{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}
.journal-tab{
    padding: 6px 14px;
    border: 1px solid rgba(201,168,100,0.35);
    border-radius: 6px 6px 0 0;
    background: rgba(60,46,30,0.55);
    color: #cbb88f;
    cursor: pointer;
    font-size: 0.85rem;
}
.journal-tab:hover{
    color: var(--color-gold);
}
.journal-tab.active{
    background: rgba(92,70,42,0.85);
    border-color: var(--color-gold);
    color: var(--color-gold);
}
.journal-spread{
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.6fr);
    border: 1px solid rgba(201,168,100,0.4);
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(58,44,28,0.92) 0%, rgba(48,36,23,0.92) 49.6%, rgba(30,22,14,0.95) 50%, rgba(48,36,23,0.92) 50.4%, rgba(58,44,28,0.92) 100%);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.45), 0 6px 18px rgba(0,0,0,0.5);
    overflow: hidden;
}
.journal-page{
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px;
}
.journal-page-left{
    border-right: 1px solid rgba(201,168,100,0.25);
}
.journal-list{
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.journal-list-item{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #e2d3b2;
    text-align: left;
    cursor: pointer;
}
.journal-list-item:hover{
    border-color: rgba(201,168,100,0.35);
}
.journal-list-item.active{
    border-color: rgba(255,215,0,0.6);
    background: rgba(255,215,0,0.06);
}
.journal-list-name{
    font-size: 0.9rem;
}
.journal-list-date{
    color: #a8977a;
    font-size: 0.72rem;
}
.journal-empty{
    color: #b9a888;
    font-size: 1rem;
    line-height: 1.5;
    font-style: italic;
}
.journal-entry-title{
    color: var(--color-gold);
    font-size: 1.3rem;
    margin-bottom: 2px;
}
.journal-entry-date{
    color: #a8977a;
    font-size: 0.78rem;
    margin-bottom: 14px;
}
.journal-entry-text{
    font-size: 1.12rem;
    line-height: 1.6;
    white-space: pre-line;
}
.journal-filing{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 22px;
    padding-top: 10px;
    border-top: 1px dashed rgba(201,168,100,0.3);
}
.journal-filing-label{
    color: #a8977a;
    font-size: 0.8rem;
}
.journal-filing-button,
.journal-new-note{
    padding: 4px 12px;
    border: 1px solid rgba(201,168,100,0.45);
    border-radius: 5px;
    background: rgba(0,0,0,0.2);
    color: #e2d3b2;
    cursor: pointer;
    font-size: 0.8rem;
}
.journal-filing-button:hover,
.journal-new-note:hover{
    border-color: var(--color-gold);
    color: var(--color-gold);
}
.journal-new-note{
    margin-bottom: 10px;
}
.journal-delete:hover{
    border-color: #c0504d;
    color: #e08a88;
}
.journal-filing-hint{
    margin-top: 6px;
    color: #8f806a;
    font-size: 0.72rem;
    font-style: italic;
}
.journal-note-title{
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
    padding: 6px 8px;
    border: none;
    border-bottom: 1px solid rgba(201,168,100,0.4);
    background: transparent;
    color: var(--color-gold);
    font-size: 1.15rem;
}
.journal-note-body{
    width: 100%;
    min-height: 320px;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid rgba(201,168,100,0.2);
    border-radius: 5px;
    background: rgba(0,0,0,0.12);
    color: #eadfc6;
    font-size: 1.08rem;
    line-height: 1.6;
    resize: vertical;
}
.journal-note-tools{
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
@media (max-width: 760px){
    .journal-spread{
        grid-template-columns: 1fr;
        background: rgba(52,40,25,0.94);
    }
    .journal-page-left{
        border-right: none;
        border-bottom: 1px solid rgba(201,168,100,0.25);
    }
}

.gameMessage{
    /* Was previously invisible/misplaced - it referenced --color-dark/--color-light/
       --border/--border-radius/--corner/--text-font-baloo, none of which are defined
       anywhere in this stylesheet, so it rendered as plain unstyled text pinned to the
       top-left of the whole game window. Now uses the same real tokens/treatment as
       messageBanner, centered near the top instead. */
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: min(500px, calc(100% - 55px));
    max-height: 0px;
    display: block;
    overflow: hidden;
    text-align: center;
    color: var(--color-gameLight);
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
    background-color: var(--color-gameDark);
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    /* Appended directly to #gameContentWrapper (a sibling of #actionOverlay, not a child
       of it), so this needs to out-rank .game-content-overlay's z-index or it renders
       behind the combat modal - it's meant to show narrative beats (e.g. "You found some
       goblins!") while combat is already up. */
    z-index: 60;

	transition: all 0.2s ease-in-out;
}
.gameMessageActive{
    margin: 5px;
	max-height: 200px;
	padding:12px;
}
.combat-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    max-height: 0px;
    display: block;
    overflow: hidden;
    font-family: var(--font-ui);
    color: #ffef00; /* bright yellow for damage numbers */
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;

    background: rgba(0, 0, 0, 0.5); /* dark semi-transparent background */
    border: 2px solid #ff0000; /* red border for intensity */
    border-radius: 8px;
    box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000; /* glowing effect */
    clip-path: polygon(5% 0%, 95% 0%, 100% 5%, 100% 95%, 95% 100%, 5% 100%, 0% 95%, 0% 5%); /* jagged corners for “damage” look */

    /* Same reasoning as .gameMessage above - this is also appended directly to
       #gameContentWrapper, a sibling of #actionOverlay, so it needs to out-rank the
       combat modal's z-index to actually show up during a fight. */
    z-index: 60;

    transition: all 0.2s ease-in-out;
}

.combat-message.active {
    max-height: 200px;
    padding: 12px;
    animation: pop 0.3s ease-out forwards;
}

/* Pop-in animation for combat impact */
@keyframes pop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.attributeImage{
    border: 1px solid var(--color-gameDark);
    display: flex;
    width:25px;
    height:25px;
    border-radius: 5px;
    background-image: var(--bg);
	background-repeat:no-repeat;
    background-position: center;
	background-size:25px;
    cursor: pointer;
    transition: 0.15s all ease-in-out;
    justify-content: center;
}

.increaseButton{
    text-align: center;
    display: flex;
    width:24px;
    height:24px;
    border-radius: 25px;
    background-image: url("../images/icons/increase.svg");
	background-repeat:no-repeat;
    background-position: center;
	background-size:20px;
    cursor: pointer;
    transition: 0.1s all ease-in-out;
    justify-content: center;
    box-sizing: border-box;
    background-color: #252a27;
    border: 1px solid #a8b8aa;
    box-shadow: inset 0 1px rgba(255,255,255,0.2), 0 1px 3px rgba(0,0,0,0.65);
}
.increaseButton:hover{
    background-color: #334839;
    border-color: #86ff9b;
    box-shadow: 0 0 10px rgba(58,255,101,0.6), inset 0 1px rgba(255,255,255,0.25);
    transform: translateY(-1px) scale(1.08);
}
.increaseButton.notEnoughXP{
    background-color: var(--color-notEnoughXP) !important;
    filter: grayscale(100%) brightness(0.7);
}

.advanceSkillLevelButton{
    text-align: center;
    display: flex;
    width:24px;
    height:24px;
    border-radius: 25px;
    background-image: var(--bg);
	background-repeat:no-repeat;
    background-position: center;
	background-size:20px;
    cursor: pointer;
    transition: 0.1s all ease-in-out;
    justify-content: center;
    box-sizing: border-box;
    background-color: #252a27;
    border: 1px solid #a8b8aa;
    box-shadow: inset 0 1px rgba(255,255,255,0.2), 0 1px 3px rgba(0,0,0,0.65);
}
.advanceSkillLevelButton:hover{
    background-color: #334839;
    border-color: #86ff9b;
    box-shadow: 0 0 10px rgba(58,255,101,0.6), inset 0 1px rgba(255,255,255,0.25);
    transform: translateY(-1px) scale(1.08);
}
.advanceSkillLevelButton.notEnoughSP{
    background-color: var(--color-notEnoughXP) !important;
    filter: grayscale(100%) brightness(0.7);
}

.attributeWrapper{
    display: grid;
    grid-template-columns: 38px minmax(130px, 1fr) 64px 28px 72px;
    gap: 10px;
    align-items: center;
    min-height: 43px;
    padding: 5px 8px;
    color: #f4f1e8;
    border: 1px solid rgba(198, 166, 91, 0.18);
    border-radius: 7px;
    background: linear-gradient(90deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015));
    box-sizing: border-box;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.core-attributes .attributeWrapper,
.attribute-core-headings{
    grid-template-columns:38px minmax(130px,1fr) repeat(4,58px) 28px 72px;
    gap:12px;
}
.vitals .attributeWrapper,
.vital-column-headings{
    grid-template-columns:38px minmax(130px,1fr) repeat(5,54px) 28px 72px;
    gap:12px;
}
.attribute-column-headings{
    display:grid;
    min-height:20px;
    padding:6px 15px 0;
    color:#d8cda9;
    font-size:.68rem;
    font-weight:700;
    text-align:center;
    text-transform:uppercase;
}
.attribute-value{
    min-width:3ch;
    justify-self:center;
    text-align:center;
    font-weight:700;
    color:#f0bd55;
}
.attribute-effects.is-positive,.game-skill-data.is-positive{ color:#83e68d; }
.attribute-effects.is-negative,.game-skill-data.is-negative{ color:#ff7777; }
.attribute-effects.is-zero,.game-skill-data.is-zero{ color:#8d8d88; }
.attribute-gear{ color:#70c9ff; }
.attribute-stats{ color:lightgreen; }
.attribute-gear.is-negative,
.attribute-stats.is-negative{ color:#ff7777; }
.attribute-gear.is-zero,
.attribute-stats.is-zero{ color:#8d8d88; }
.attributeWrapper:hover{
    border-color: rgba(225, 187, 85, 0.58);
    background: linear-gradient(90deg, rgba(214,173,79,0.12), rgba(255,255,255,0.025));
    transform: translateX(2px);
}
.attributeWrapper > .total{
    width: auto;
    min-width:3ch;
    justify-self:center;
    text-align: center;
    color: #e9ff9b;
    font-size: 1.05rem;
    font-weight: 700;
    text-shadow: 0 1px 2px #000;
}
.attributeWrapper > .header{
    width: auto;
    justify-self: start;
    inline-size: max-content;
    max-width: 100%;
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 0 1px 2px #000;
}
.amountToIncrease,
.game-skill-data.infoDiv{
    box-sizing: border-box;
    min-width: 68px;
    padding: 3px 7px;
    border: 1px solid #d6ad4f;
    border-radius: 6px;
    background: linear-gradient(180deg, #3d382e, #191919);
    color: #fff4bd;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-4px) scale(0.96);
    transition: opacity 0.12s ease, transform 0.12s ease;
    pointer-events: none;
    box-shadow: inset 0 1px rgba(255,255,255,0.08), 0 3px 9px rgba(0,0,0,0.45);
}
.amountToIncrease::after{
    content: attr(reqxp) " XP";
}
.increaseButton:hover + .amountToIncrease,
.increaseButton:hover ~ .game-skill-data.infoDiv,
.advanceSkillLevelButton:hover ~ .game-skill-data.infoDiv{
    opacity: 1;
    transform: translateX(0) scale(1);
}
.increaseButton:hover ~ .game-skill-data.infoDiv::after{
    content: attr(reqxp) " XP";
}
.advanceSkillLevelButton:hover ~ .game-skill-data.infoDiv::after{
    content: attr(reqsp) " SP";
}


.game-paperdoll-footer{
    display: flex;
    flex-direction: column;
    gap:5px;
    align-self: center;
}
.game-footer-wrapper{
    display: flex;
    gap:10px;
    justify-content: end;
}
.game-content-attributes, .game-content-skills{
    margin-top: 35px;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap:5px;
    background-color: darkgray;
    border-radius: 5px;
    padding: 10px;
    margin-bottom:15px;
    margin-left:auto;
    margin-right:auto;
    overflow-y: auto;
    flex: 1;
    min-height: 0;

}
.game-content-travel{
    /* Travel is a tab now (same #gameContent panel Attributes/Skills use via
       loadPaperDoll), not a dismissible modal - no darkgray box here since the map/travel
       wrapper below already draws its own dark background. */
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-height: 0;
    overflow:hidden;
}
/* Town screen only (its .travel-wrapper - the overworld / dungeon views share .game-content-travel). */
.game-content-travel:has(> .travel-wrapper){
    box-sizing: border-box;
    padding: 0 20px;
}
.game-content-inventory{
    /* Like .game-content-travel - .inventory-main-outter-wrapper below already carries its
       own margin-top/background, so this is just the flex/scroll container. */
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.game-content-spells{
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Spell Book / Learn New Spell (owner request 2026-09-22, the Spells tab) - two side-by-side
   panels, same dark-card look as the rest of the game's chrome rather than devtools styling
   (this is player-facing, not a dashboard). */
.spells-main-wrapper{
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 1220px;
    margin-top: 16px;
    padding: 0 16px 16px;
    box-sizing: border-box;
    align-items: flex-start;
}
.spells-panel{
    flex: 1;
    min-width: 0;
    background: linear-gradient(145deg, rgba(30,25,22,.96), rgba(12,13,17,.97));
    border: 1px solid #9c7722;
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 3px rgba(232,190,70,.08), 0 10px 24px rgba(0,0,0,.38);
}
.spell-book-panel{ flex: 1.65; }
.spell-learn-panel{
    flex: 1;
    display:flex;
    flex-direction:column;
    height:456px;
    max-height:calc(100vh - 180px);
    min-height:0;
    overflow:hidden;
    background:
        radial-gradient(circle at 85% 0,rgba(120,65,175,.12),transparent 38%),
        linear-gradient(145deg,rgba(30,25,22,.98),rgba(12,13,17,.98));
}
.spells-panel-title{
    color: var(--color-gold);
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: var(--text-shadow-black-outline);
}
.spells-panel-subtitle{
    opacity: 0.8;
    font-size: 0.8rem;
    margin: 4px 0 12px;
    line-height: 1.35;
}
.spells-empty-list{
    opacity: 0.75;
    text-align: center;
    padding: 14px 6px;
}

.spell-book-list,
.spell-learn-list{
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.spell-book-list{ display: block; }
.spell-learn-list{
    min-height:0;
    flex:1;
    overflow-y:auto;
    overflow-x:hidden;
    padding:0 6px 4px 0;
    scrollbar-gutter:stable;
    overscroll-behavior:contain;
}
.spell-learn-summary{
    position:sticky;
    top:0;
    z-index:2;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:5px 8px;
    border-bottom:1px solid rgba(232,190,70,.42);
    background:rgba(17,16,18,.96);
    color:#eadba8;
    font-size:.72rem;
    font-weight:bold;
    letter-spacing:.055em;
    text-transform:uppercase;
}
.spell-learn-count{
    color:rgba(244,241,232,.62);
    font-size:.66rem;
    font-weight:normal;
    letter-spacing:.025em;
    white-space:nowrap;
}
.spell-book-row,
.spell-learn-row{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--color-gameSlate);
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
}
.spell-learn-row{
    position:relative;
    display:grid;
    grid-template-columns:46px minmax(0,1fr) auto;
    gap:10px;
    min-height:76px;
    padding:8px 9px;
    border-color:rgba(164,143,105,.5);
    background:linear-gradient(100deg,rgba(101,73,40,.13),rgba(255,255,255,.025));
    box-shadow:inset 3px 0 0 rgba(153,110,205,.42);
    transition:border-color .12s ease,background-color .12s ease,transform .12s ease;
}
.spell-learn-row:hover{
    border-color:rgba(226,190,84,.8);
    background:linear-gradient(100deg,rgba(119,79,38,.2),rgba(101,61,137,.08));
}
.spell-book-row{
    cursor: grab;
    min-height: 55px;
    box-sizing: border-box;
    border-color: rgba(112,75,35,.58);
    background: rgba(91,56,23,.075);
}
.spell-book-row.empty{
    cursor: default;
    border-style: dashed;
    opacity: .24;
}
.spell-book-row.drop-before{
    border-top-color: var(--color-gold);
    box-shadow: 0 -2px 0 var(--color-gold);
}
.spell-book-row.dragging{
    opacity: 0.4;
}
/* Cast Known Spell (owner request 2026-09-24) - the currently-armed spell (Channel Strength +
   Cast control visible below the book, renderSpellCastControl(), attributes_skills_inventory.js). */
.spell-book-row.selected{
    border-color: var(--color-gold);
    background: rgba(232,190,70,.14);
    box-shadow: 0 0 0 1px var(--color-gold), inset 0 0 12px rgba(232,190,70,.18);
}
/* Reuses combat's own .combat-channel-* classes verbatim for an identical look - only placement
   within the Spell Book panel (below the book itself) needs its own rule. */
.spellbook-channel-control{
    margin-top: 14px;
}
.spell-book-icon,
.spell-learn-icon{
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 5px;
    border: 1px solid var(--color-gameSlate);
    background-color: rgba(0,0,0,0.35);
    background-image: var(--bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px;
}
.spell-learn-icon{
    width:44px;
    height:52px;
    border-color:rgba(222,184,85,.55);
    background-size:38px;
    box-shadow:inset 0 0 8px rgba(0,0,0,.5),0 2px 5px rgba(0,0,0,.45);
}
.spell-book-info,
.spell-learn-info{
    flex: 1;
    min-width: 0;
}
.spell-book-name,
.spell-learn-name{
    font-weight: bold;
}
.spell-learn-name{
    color:#f1e8d6;
    font-size:.92rem;
    line-height:1.12;
}
.spell-book-school{
    font-size: 0.75rem;
    opacity: 0.75;
}
.spell-learn-desc{
    font-size: 0.78rem;
    opacity: 0.75;
    margin-top: 2px;
    line-height:1.18;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
    overflow:hidden;
}
.spell-book-drag-handle{
    opacity: 0.6;
    padding: 0 4px;
    flex-shrink: 0;
}
.spell-learn-button{
    flex-shrink: 0;
    align-self:center;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    min-width:76px;
    padding:6px 9px;
    border-color:rgba(224,187,79,.62);
    color:#f8edc4;
    background:linear-gradient(#49402e,#28251f);
    font-size:.78rem;
    white-space:nowrap;
    cursor:pointer;
}
.spell-learn-button:hover{
    border-color:var(--color-gold);
    background:linear-gradient(#66542f,#342c20);
    box-shadow:0 0 7px rgba(232,190,70,.2);
}
.spell-learn-button.disabled{
    opacity: 0.5;
    pointer-events: none;
}

/* Learn New Spells hub - a compact arcane study beside the physical Spell Book. */
.spell-study-panel{
    position:relative; flex:1; min-height:456px; overflow:hidden;
    background:radial-gradient(circle at 50% 8%,rgba(171,112,255,.2),transparent 31%),radial-gradient(circle at 90% 85%,rgba(59,155,190,.1),transparent 37%),linear-gradient(155deg,rgba(31,22,37,.98),rgba(12,13,19,.99) 68%);
    border-color:#9f72d1;
    box-shadow:inset 0 0 0 3px rgba(183,130,255,.08),inset 0 0 36px rgba(93,48,132,.16),0 10px 24px rgba(0,0,0,.42);
}
.spell-study-panel::before,.spell-study-panel::after{ content:""; position:absolute; width:110px; height:110px; border:1px solid rgba(205,171,255,.12); border-radius:50%; pointer-events:none; }
.spell-study-panel::before{ left:-58px; top:-58px; box-shadow:0 0 0 12px rgba(185,128,255,.025),0 0 0 25px rgba(185,128,255,.018); }
.spell-study-panel::after{ right:-62px; bottom:-62px; box-shadow:0 0 0 12px rgba(91,182,211,.025),0 0 0 25px rgba(91,182,211,.018); }
.spell-study-sigil{ position:relative; z-index:1; width:48px; height:48px; margin:0 auto 5px; display:grid; place-items:center; border:1px solid rgba(219,190,255,.72); border-radius:50%; color:#f2d6ff; font-size:1.5rem; background:radial-gradient(circle,rgba(154,92,205,.45),rgba(22,16,29,.84) 67%); box-shadow:0 0 14px rgba(180,105,242,.35),inset 0 0 10px rgba(229,201,255,.14); }
.spell-study-title{ position:relative; z-index:1; text-align:center; color:#e8c4ff; font-size:1.25rem; }
.spell-study-subtitle{ position:relative; z-index:1; max-width:360px; margin:5px auto 15px; text-align:center; color:#d4c9dc; }
.spell-study-choices{ position:relative; z-index:1; display:flex; flex-direction:column; gap:12px; }
.spell-study-choice{ position:relative; display:grid; grid-template-columns:68px minmax(0,1fr); gap:12px; min-height:128px; padding:12px; box-sizing:border-box; border:1px solid rgba(209,177,126,.5); border-radius:8px; cursor:pointer; overflow:hidden; transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease; }
.spell-study-choice:hover{ transform:translateY(-1px); border-color:#e1bd72; box-shadow:0 5px 14px rgba(0,0,0,.3),inset 0 0 15px rgba(255,255,255,.035); }
.spell-study-choice.scroll-study{ background:linear-gradient(105deg,rgba(104,66,29,.28),rgba(35,25,25,.68)); }
.spell-study-choice.practice-study{ background:linear-gradient(105deg,rgba(67,42,91,.34),rgba(23,24,38,.72)); border-color:rgba(174,126,219,.55); }
.spell-study-choice-icon{ width:66px; height:78px; align-self:center; border:1px solid rgba(225,190,102,.6); border-radius:8px; background-color:rgba(0,0,0,.28); background-image:var(--bg); background-position:center; background-repeat:no-repeat; background-size:58px; box-shadow:inset 0 0 12px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.4); }
.practice-study .spell-study-choice-icon{ border-color:rgba(201,158,242,.62); }
.spell-study-choice-copy{ min-width:0; padding-bottom:25px; }
.spell-study-choice-kicker{ color:#ad9471; font-size:.63rem; font-weight:bold; letter-spacing:.12em; text-transform:uppercase; }
.practice-study .spell-study-choice-kicker{ color:#bf93df; }
.spell-study-choice-title{ margin:2px 0 4px; color:#f5e6c5; font-size:1rem; font-weight:bold; }
.practice-study .spell-study-choice-title{ color:#ead5fb; }
.spell-study-choice-description{ color:rgba(239,234,224,.76); font-size:.75rem; line-height:1.28; }
.spell-study-choice-detail{ margin-top:5px; color:rgba(222,200,160,.75); font-size:.67rem; font-style:italic; }
.practice-study .spell-study-choice-detail{ color:rgba(211,177,236,.78); }
.spell-study-choice-action{ position:absolute; right:12px; bottom:9px; color:#e9cd8e; font-size:.68rem; font-weight:bold; letter-spacing:.04em; text-transform:uppercase; }
.spell-study-choice-action::after{ content:"  ›"; font-size:.9rem; }
.practice-study .spell-study-choice-action{ color:#d7aff2; }

.item-use-wrapper.inspect-frame.spell-learning-modal{ width:min(620px,calc(100vw - 50px)); max-width:620px; min-width:0; overflow:hidden; border-color:#a579d0; border-radius:18px; background:radial-gradient(circle at 80% 0,rgba(153,92,205,.15),transparent 34%),linear-gradient(155deg,#312a35,#17161c 70%); }
.item-use-wrapper.inspect-frame.spell-learning-modal::before,
.item-use-wrapper.inspect-frame.spell-learning-modal::after,
.spell-learning-modal .inspect-frame-corner::before,
.spell-learning-modal .inspect-frame-corner::after{
    width:64px;
    height:64px;
    background:url("../images/spellbook/corners/bottom-right.svg") center/contain no-repeat;
    clip-path:none;
    filter:drop-shadow(0 2px 3px rgba(0,0,0,.7));
}
.item-use-wrapper.inspect-frame.spell-learning-modal::before{ left:-1px; top:-1px; transform:rotate(180deg); }
.item-use-wrapper.inspect-frame.spell-learning-modal::after{ right:-1px; bottom:-1px; }
.spell-learning-modal .inspect-frame-corner::before{ right:-1px; top:-1px; transform:rotate(270deg); }
.spell-learning-modal .inspect-frame-corner::after{ left:-1px; bottom:-1px; transform:rotate(90deg); }
.spell-learning-modal .inspect-frame-ornament::before,
.spell-learning-modal .inspect-frame-ornament::after{
    width:320px;
    height:24px;
    background:url("../images/spellbook/corners/center-wide.svg") center/100% 100% no-repeat;
    clip-path:none;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.55));
}
.spell-learning-modal .inspect-frame-ornament::before{ top:-1px; }
.spell-learning-modal .inspect-frame-ornament::after{ bottom:-1px; }
.spell-learning-modal .item-use-inspect-details{ align-items:stretch; max-height:68vh; overflow:hidden; }
.spell-learning-modal-intro{ padding:7px 9px 10px; color:rgba(240,233,242,.78); font-size:.78rem; line-height:1.35; text-align:center; border-bottom:1px solid rgba(199,157,233,.25); }
.spell-learning-modal-list{ max-height:55vh; overflow-y:auto; padding-right:6px; }
.spell-practice-workspace{ min-height:300px; max-height:55vh; overflow-y:auto; padding:5px 4px; }

/* Word Bank (owner request 2026-09-26, Incantations) - a third spells-panel alongside the Spell
   Book/Learn New Spell ones above, same dark-card chrome. */
.spell-word-bank-panel{
    flex: 1;
    display:flex;
    flex-direction:column;
    height:456px;
    max-height:calc(100vh - 180px);
    min-height:0;
    overflow:hidden;
    background:
        radial-gradient(circle at 85% 0,rgba(120,65,175,.12),transparent 38%),
        linear-gradient(145deg,rgba(30,25,22,.98),rgba(12,13,17,.98));
}
.word-bank-body{
    position:relative;
    display:flex;
    flex-direction:column;
    gap:16px;
    min-height:0;
    flex:1;
}
.word-bank-empty{
    opacity:0.75;
    text-align:center;
    padding:14px 6px;
}
.word-bank-section-label{
    display:flex;
    align-items:center;
    gap:8px;
    color:#e7c9ff;
    font-size:0.72rem;
    font-weight:bold;
    text-transform:uppercase;
    letter-spacing:0.04em;
    text-shadow:0 0 8px rgba(190,116,255,.42);
    margin-bottom:8px;
}
.word-bank-section-label::before,.word-bank-section-label::after{ content:"✦"; color:#d5aa63; font-size:.62rem; }
.word-bank-section-label::after{ flex:1; height:1px; overflow:hidden; color:transparent; background:linear-gradient(90deg,rgba(199,154,78,.65),transparent); }
.word-bank-sequence-section{
    position:relative;
    padding:12px;
    border:1px solid rgba(173,119,218,.5);
    border-radius:10px;
    background:radial-gradient(circle at 50% 0,rgba(164,93,219,.14),transparent 48%),rgba(8,8,14,.34);
    box-shadow:inset 0 0 18px rgba(125,71,168,.1);
}
.word-bank-sequence-row{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    align-items:center;
    min-height:48px;
    padding:10px;
    background:radial-gradient(ellipse at center,rgba(94,50,125,.2),rgba(0,0,0,.38));
    border:1px solid rgba(216,178,105,.55);
    border-radius:9px;
    box-shadow:inset 0 0 14px rgba(0,0,0,.55),0 0 8px rgba(148,86,203,.08);
}
.word-bank-sequence-placeholder{
    width:100%;
    color:rgba(215,195,225,.58);
    font-size:0.82rem;
    font-style:italic;
    text-align:center;
    padding:4px 2px;
}
.word-bank-chip{
    position:relative;
    padding:6px 14px;
    border-radius:16px;
    font-size:0.85rem;
    cursor:pointer;
    user-select:none;
    font-family:var(--font-body);
    letter-spacing:.03em;
    transition:filter .1s ease,transform .1s ease,box-shadow .1s ease;
}
.word-bank-chip:hover{ filter:brightness(1.2); transform:none; }
.word-bank-chip-static{ cursor:default; }
.word-bank-chip-static:hover{ filter:none; }
.word-bank-chip-known{
    background:radial-gradient(circle at 35% 25%,#40324e,#17141d 72%);
    border:1px solid rgba(192,146,226,.58);
    color:#e9dff0;
    box-shadow:inset 0 0 5px rgba(193,142,234,.08);
}
.word-bank-chip-sequence{
    background:radial-gradient(circle at 35% 25%,#79559a,#2a1938 72%);
    border:1px solid #f0cc77;
    color:#fff1bc;
    font-weight:bold;
    text-shadow:0 0 6px rgba(255,221,128,.55);
    box-shadow:inset 0 0 7px rgba(238,199,110,.12),0 0 8px rgba(169,94,222,.28);
}
.word-bank-chip-sequence::after{ content:""; position:absolute; inset:3px; border:1px solid rgba(255,238,174,.16); border-radius:13px; pointer-events:none; }
.word-bank-known-row{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    align-content:flex-start;
    overflow-y:auto;
    min-height:0;
    flex:1;
    padding-right:4px;
}
.word-bank-known-section{
    display:flex;
    flex-direction:column;
    min-height:0;
    flex:1;
    padding:12px;
    border:1px solid rgba(135,98,165,.34);
    border-radius:10px;
    background:linear-gradient(145deg,rgba(40,28,49,.28),rgba(8,9,14,.22));
}
.word-bank-actions-row{
    display:flex;
    gap:10px;
    margin-top:10px;
}
.word-bank-test-button{
    position:relative;
    flex:1;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:11px;
    min-height:42px;
    box-sizing:border-box;
    border:1px solid #e8c36d;
    border-radius:7px;
    color:#fff1bd;
    background:linear-gradient(180deg,#765298,#3a244d 52%,#25172f);
    font-family:var(--font-body);
    font-size:.96rem;
    font-weight:bold;
    letter-spacing:.035em;
    text-align:center;
    text-shadow:0 1px 2px #000,0 0 7px rgba(244,210,117,.25);
    cursor:pointer;
    box-shadow:inset 0 0 0 2px rgba(235,198,110,.08),inset 0 0 15px rgba(204,137,255,.15),0 3px 9px rgba(0,0,0,.34);
    transition:filter .12s ease,transform .12s ease,box-shadow .12s ease;
}
.word-bank-test-button:hover{ filter:brightness(1.15); transform:translateY(-1px); box-shadow:inset 0 0 0 2px rgba(235,198,110,.12),inset 0 0 18px rgba(216,156,255,.24),0 5px 12px rgba(0,0,0,.42); }
.word-bank-test-button.disabled{ opacity:.38; filter:saturate(.55); cursor:default; pointer-events:none; }
.word-bank-test-button > span{ color:#f1cd75; font-size:.72rem; }
.word-bank-clear-button{
    display:grid;
    place-items:center;
    min-width:86px;
    padding:9px 14px;
    border-radius:7px;
    border:1px solid rgba(188,149,213,.55);
    color:#d9c8e3;
    background:linear-gradient(#33283d,#1b1721);
    cursor:pointer;
    text-align:center;
    font-size:.78rem;
    font-weight:bold;
    letter-spacing:.04em;
    text-transform:uppercase;
    box-shadow:inset 0 0 8px rgba(172,111,214,.08);
}
.word-bank-clear-button:hover{ border-color:#d2a7ee; color:#fff; background:linear-gradient(#463451,#241b2b); }

@media (max-width:900px){
    .spells-main-wrapper{
        flex-direction:column;
    }
    .spells-panel{ width:100%; }
    .spell-learn-panel,
    .spell-word-bank-panel,
    .spell-study-panel{
        height:430px;
        max-height:70vh;
    }
}

/* Shared player/combat spellbook shell. The inset border and four line ornaments mirror the
   portal gateway's framing, while the center seam and parchment pages keep the object legible
   as an actual open book at both sizes. */
.arcane-spellbook{
    position: relative;
    box-sizing: border-box;
    padding: 22px 22px 12px;
    overflow: hidden;
    border: 2px solid #c89d31;
    border-radius: 14px 14px 18px 18px;
    background:
        radial-gradient(ellipse at 50% 15%, rgba(83,63,133,.19), transparent 48%),
        linear-gradient(145deg, #241b18, #0d1018 62%, #19110f);
    box-shadow:
        inset 0 0 0 4px #0d0b0b,
        inset 0 0 0 5px rgba(226,186,72,.52),
        inset 0 0 28px rgba(0,0,0,.88),
        0 10px 25px rgba(0,0,0,.48);
}
.arcane-spellbook::before{
    content:"";
    position:absolute;
    inset:8px;
    pointer-events:none;
    border:1px solid rgba(237,201,99,.38);
    border-radius:8px 8px 12px 12px;
}
.spellbook-ornament{
    position:absolute;
    z-index:4;
    width:92px;
    height:92px;
    pointer-events:none;
    background-position:center;
    background-size:contain;
    background-repeat:no-repeat;
    filter:drop-shadow(0 1px 2px rgba(0,0,0,.8)) drop-shadow(0 0 4px rgba(157,101,225,.48)) drop-shadow(0 0 2px rgba(242,204,71,.28));
    opacity:1;
}
.spellbook-ornament.top-left{ left:0; top:0; background-image:url("../images/spellbook/corners/bottom-right.svg"); transform:rotate(180deg); }
.spellbook-ornament.top-right{ right:0; top:0; background-image:url("../images/spellbook/corners/bottom-right.svg"); transform:rotate(270deg); }
.spellbook-ornament.bottom-right{ right:0; bottom:0; background-image:url("../images/spellbook/corners/bottom-right.svg"); }
.spellbook-ornament.bottom-left{ left:0; bottom:0; background-image:url("../images/spellbook/corners/bottom-right.svg"); transform:rotate(90deg); }
.spellbook-center-ornament{
    position:absolute;
    z-index:4;
    left:50%;
    width:240px;
    height:42px;
    pointer-events:none;
    background:url("../images/spellbook/corners/center-wide.svg") center/contain no-repeat;
    filter:drop-shadow(0 1px 2px rgba(0,0,0,.8)) drop-shadow(0 0 5px rgba(157,101,225,.5)) drop-shadow(0 0 2px rgba(242,204,71,.3));
    opacity:1;
}
.spellbook-center-ornament.top-center{ top:0; transform:translateX(-50%); }
.spellbook-spread{
    position:relative;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    min-height:292px;
    overflow:hidden;
    border:1px solid #6f4c25;
    border-radius:10px 10px 16px 16px;
    background:#cbb887;
    box-shadow:0 4px 14px rgba(0,0,0,.6), inset 0 0 28px rgba(69,39,15,.25);
}
.spellbook-spread::after{
    content:"";
    position:absolute;
    z-index:3;
    top:0;
    bottom:0;
    left:50%;
    width:14px;
    transform:translateX(-50%);
    pointer-events:none;
    background:linear-gradient(90deg,rgba(56,31,14,.27),rgba(255,243,191,.18) 43%,rgba(52,29,13,.34));
    box-shadow:0 0 8px rgba(45,24,10,.32);
}
.spellbook-page{
    position:relative;
    min-width:0;
    padding:23px 17px 18px;
    color:#30200f;
    background:
        repeating-linear-gradient(0deg,transparent 0 24px,rgba(91,58,22,.065) 25px),
        radial-gradient(circle at 20% 15%,rgba(255,250,211,.7),transparent 42%),
        linear-gradient(100deg,#d9c895,#f0dfae 70%,#c6ad72);
    box-shadow:inset 0 0 18px rgba(75,43,16,.24);
}
.spellbook-page:first-child{ padding-right:23px; }
.spellbook-page:last-child{ padding-left:23px; }
.spellbook-page-number{
    position:absolute;
    top:5px;
    left:0;
    right:0;
    color:#73521d;
    font:700 10px/1 'Cinzel',serif;
    text-align:center;
    letter-spacing:.12em;
    text-transform:uppercase;
}
.player-spellbook .spellbook-page-body{
    display:flex;
    flex-direction:column;
    gap:6px;
}
.spellbook-navigation{
    position:relative;
    z-index:5;
    display:flex;
    justify-content:center;
    align-items:center;
    gap:8px;
    min-height:28px;
    margin-top:8px;
}
.spellbook-turn,
.spellbook-page-tab{
    display:grid;
    place-items:center;
    min-width:28px;
    height:25px;
    padding:0 7px;
    border:1px solid #8b6825;
    border-radius:5px;
    background:linear-gradient(#30251d,#141319);
    color:#e9d59a;
    cursor:pointer;
}
.spellbook-turn:disabled{ opacity:.28; cursor:default; }
.spellbook-page-tabs{ display:flex; gap:4px; max-width:390px; overflow-x:auto; padding:2px; }
.spellbook-page-tab.active,
.spellbook-page-tab.drop-target{
    border-color:var(--color-gold);
    color:#fff1a4;
    box-shadow:0 0 7px rgba(255,215,0,.65);
}
.spellbook-empty-overlay{
    position:absolute;
    z-index:4;
    inset:36px 28px;
    display:grid;
    place-items:center;
    color:#563b19;
    font-family:var(--font-body);
}
.game-content-skills,
.game-content-attributes{
    overflow: hidden;
}
.game-content-skills .game-paperdoll-footer,
.game-content-attributes .game-paperdoll-footer{
    flex-shrink: 0;
    width: 100%;
}
.attributes-sections-wrapper{
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    width: 100%;
    margin: 0 auto;
    padding: 2px;
    box-sizing: border-box;
}
.game-content-attributes{
    width: min(900px, calc(100% - 24px));
    margin-top: 8px;
    box-sizing: border-box;
    background: linear-gradient(145deg, #b9b9b9, #989898);
    border: 1px solid #6f685b;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.32), inset 0 1px rgba(255,255,255,0.32);
}
.attribute-panel{
    display:grid;
    grid-template-columns:66px minmax(0,1fr);
    gap:7px;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    padding:6px;
    box-sizing:border-box;
    border: 1px solid #625b4f;
    border-radius: 9px;
    background: #30302f;
    box-shadow: 0 4px 12px rgba(0,0,0,0.22), inset 0 1px rgba(255,255,255,0.06);
}
.attribute-panel-content{
    min-width:0;
}
.attribute-category-header{
    display:flex;
    align-items:center;
    justify-content:center;
    padding-right:7px;
    border-right:1px solid #b98e35;
    background:linear-gradient(90deg,rgba(214,173,79,.1),transparent);
    border-radius:6px 0 0 6px;
}
.attribute-category-image{
    position:relative;
    width:48px;
    height:48px;
    flex-shrink:0;
    background-image:var(--bg);
    background-repeat:no-repeat;
    background-position:center;
    background-size:contain;
    border-radius:6px;
    cursor:pointer;
    filter:drop-shadow(0 2px 3px rgba(0,0,0,.55));
}
.attribute-category-image::after{
    content:attr(data-tooltip);
    position:absolute;
    z-index:20;
    left:calc(100% + 8px);
    top:50%;
    transform:translateY(-50%);
    width:max-content;
    padding:4px 7px;
    border:1px solid #b98e35;
    border-radius:4px;
    color:#fff5cf;
    background:#24211c;
    box-shadow:0 3px 8px rgba(0,0,0,.55);
    font-size:.7rem;
    font-weight:700;
    pointer-events:none;
    opacity:0;
}
.attribute-category-image:hover::after,
.attribute-category-image:focus-visible::after{ opacity:1; }
.attribute-panel-title{
    padding: 9px 12px;
    color: #fff5cf;
    border-bottom: 1px solid #b98e35;
    background: linear-gradient(180deg, #4b4841, #373532);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px #000;
}
.attribute-list{
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 7px;
}
.game-content-attributes .attributeImage{
    justify-self:center;
    width: 34px;
    height: 34px;
    background-size: 32px;
    border-color: #8c816c;
    background-color: #252525;
    box-shadow: inset 0 1px rgba(255,255,255,0.12), 0 2px 4px rgba(0,0,0,0.35);
}
@media (max-width: 680px){
    .attributeWrapper{
        grid-template-columns: 38px minmax(100px, 1fr) 48px 28px 68px;
    }
    .core-attributes .attributeWrapper,
    .attribute-core-headings{
        grid-template-columns:38px minmax(100px,1fr) repeat(4,46px) 28px 68px;
        gap:7px;
    }
    .vitals .attributeWrapper,
    .vital-column-headings{
        grid-template-columns:38px minmax(100px,1fr) repeat(5,44px) 28px 68px;
        gap:7px;
    }
}
.skills-sections-wrapper{
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.skillBlockOutterWrapper{
    display: flex;
    flex-direction: column;
    gap:5px;
    padding: 5px 10px 5px 10px;
    border-radius: 5px;
}
.game-content-skills .skillBlockOutterWrapper{
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: stretch;
}
.skillBlockOutterWrapper.specialized{
    background-color: var(--color-skill-specialized);
}

.skillBlockOutterWrapper.trained{
    background-color: var(--color-skill-trained);
}
.skillBlockOutterWrapper.untrained{
    background-color: var(--color-skill-untrained);
}
.skillBlockOutterWrapper.unusable{
    background-color: var(--color-skill-unusable);
    
}
.game-skill-data{
    color: var(--color-gameLight);
    text-shadow: var(--text-shadow-black-outline);
    position: relative;
    cursor: default;
    text-align: end;
}
.game-skill-data.base{
    color: orange;
}
.game-skill-data.bfs{
    color: lightgreen;
}
.game-skill-data.total{
    color: greenyellow;
}
.game-skill-data.infoDiv{
    color: #fff4bd;
    text-shadow: none;
    font-size: 0.72rem;
    text-align: center;
}
.game-skill-name{
    cursor: pointer;
}

.skillWrapperTitle{
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 3px;
    color: var(--color-gameLight);
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
}
.skill-category-header{
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 8px;
    border-right: 1px solid rgba(255,255,255,0.35);
}
.skill-category-image{
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background-image: var(--bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.skill-category-image:hover,
.skill-category-image:focus-visible{
    background-color: rgba(255,255,255,0.18);
    transform: scale(1.05);
    outline: none;
}

.skillBlockInnerWrapper{
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 0;
    max-height: 150px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}
.game-content-skills .skillBlockInnerWrapper{
    max-height: none;
}

.skillWrapper{
    display: grid;
    grid-template-columns: 1fr 175px 3fr 3fr 3fr 1fr 1fr 3fr;
    gap:10px;
    align-items: center;
}
.skillWrapper > :first-child{
    border: 1px solid var(--color-gameDark);
    display: flex;
    width: 25px;
    height: 25px;
    border-radius: 5px;
    background-image: var(--bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 25px;
    cursor: pointer;
    transition: 0.15s all ease-in-out;
    justify-content: center;  
}

.skillWrapper.specialized{
}
.skillWrapper.trained{
}
.skillWrapper.untrained{
}
.skillWrapper.unusable{
}

/* Skills card refresh (September 2026). The original skill styles above are intentionally
   retained so this pass can be reverted by removing only this override block. */
.game-content-skills{
    width: min(900px, calc(100% - 24px));
    margin-top:8px;
    box-sizing: border-box;
    background: linear-gradient(145deg, #b9b9b9, #989898);
    border: 1px solid #6f685b;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.32), inset 0 1px rgba(255,255,255,0.32);
}
.game-content-skills .skills-sections-wrapper{
    width: 100%;
    gap: 8px;
    padding: 2px;
    box-sizing: border-box;
}
.game-content-skills .skillBlockOutterWrapper{
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 7px;
    padding: 6px;
    overflow: hidden;
    border: 1px solid #625b4f;
    border-left-width: 3px;
    border-radius: 9px;
    background: #30302f;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2), inset 0 1px rgba(255,255,255,0.05);
}
.game-content-skills .skillBlockOutterWrapper.specialized{ border-left-color: #72d8ec; }
.game-content-skills .skillBlockOutterWrapper.trained{ border-left-color: #87b7a5; }
.game-content-skills .skillBlockOutterWrapper.untrained{ border-left-color: #c3bca7; }
.game-content-skills .skillBlockOutterWrapper.unusable{ border-left-color: #858585; }
.game-content-skills .skill-category-header{
    padding-right: 7px;
    border-right-color: #b98e35;
    background: linear-gradient(90deg, rgba(214,173,79,0.1), transparent);
    border-radius: 6px 0 0 6px;
}
.game-content-skills .skill-category-image{
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.55));
}
.game-content-skills .skillBlockInnerWrapper{
    gap: 3px;
    padding-right: 2px;
}
.skill-section-content{
    display:flex;
    min-width:0;
    flex-direction:column;
    gap:3px;
}
.game-content-skills .skillWrapper{
    grid-template-columns:30px minmax(180px,1fr) repeat(5,50px) 28px 28px 72px;
    gap:8px;
    min-height: 34px;
    padding: 3px 6px;
    box-sizing: border-box;
    border: 1px solid rgba(198,166,91,0.15);
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.055), rgba(255,255,255,0.012));
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.skill-column-headings{
    display:grid;
    grid-template-columns:30px minmax(180px,1fr) repeat(5,50px) 28px 28px 72px;
    gap:8px;
    min-height:20px;
    /* Match the inner list's stable scrollbar gutter so header tracks stay centered over rows. */
    padding:0 18px 0 6px;
    color:#4b4230;
    font-size:.68rem;
    font-weight:800;
    text-align:center;
    text-transform:uppercase;
}
.skill-column-headings span:first-child{ grid-column:1 / 3; }
.column-heading-icon{
    position:relative;
    justify-self:center;
    width:20px;
    height:20px;
    border-radius:50%;
    background-position:center;
    background-repeat:no-repeat;
    background-size:16px;
    cursor:pointer;
    opacity:.88;
}
.column-heading-icon:hover,
.column-heading-icon:focus-visible{
    opacity:1;
    background-color:rgba(255,255,255,.28);
    outline:1px solid rgba(126,95,30,.65);
}
.column-heading-icon::after{
    content:attr(data-tooltip);
    position:absolute;
    z-index:20;
    left:50%;
    top:calc(100% + 7px);
    transform:translateX(-50%);
    width:max-content;
    max-width:180px;
    padding:4px 7px;
    border:1px solid #b98e35;
    border-radius:4px;
    color:#fff5cf;
    background:#24211c;
    box-shadow:0 3px 8px rgba(0,0,0,.55);
    font-size:.7rem;
    font-weight:700;
    line-height:1.2;
    text-transform:none;
    pointer-events:none;
    opacity:0;
    transition:opacity .12s ease;
}
.column-heading-icon:hover::after,
.column-heading-icon:focus-visible::after{ opacity:1; }
.column-heading-base{ background-image:url("../images/icons/increase.svg"); }
.column-heading-stats{ background-image:url("../images/icons/navbar/attributes.webp"); }
.column-heading-gear{ background-image:url("../images/icons/devtools/equipment.webp"); }
.column-heading-effects::before,
.column-heading-total::before{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    height:100%;
    color:#c3a34f;
    text-shadow:0 1px 2px rgba(0,0,0,.65);
    font-size:1rem;
    font-weight:900;
}
.column-heading-effects::before{ content:"\2726"; }
.column-heading-total::before{ content:"\03A3"; }
.game-skill-data.gear{ color:#70c9ff; }
.game-skill-data.effects{ color:#8d8d88; }
.game-content-skills .game-skill-data{
    min-width:3ch;
    justify-self:center;
    text-align:center;
}
.game-content-skills .increaseButton,
.game-content-skills .advanceSkillLevelButton,
.game-content-attributes .increaseButton{
    justify-self:center;
}
.game-skill-data.effects.is-positive{ color:#83e68d; }
.game-skill-data.effects.is-negative{ color:#ff7777; }
.game-content-skills .skillWrapper:hover{
    border-color: rgba(225,187,85,0.52);
    background: linear-gradient(90deg, rgba(214,173,79,0.11), rgba(255,255,255,0.02));
    transform: translateX(2px);
}
.game-content-skills .game-skill-name{
    justify-self: start;
    inline-size: max-content;
    max-width: 100%;
    color: #f4f1e8;
    font-weight: 700;
    text-shadow: 0 1px 2px #000;
}
.game-content-skills .game-skill-image{ justify-self:center; cursor:pointer; }
.game-content-attributes .attributeWrapper > .header{
    cursor: pointer;
}
@media (max-width: 760px){
    .skill-column-headings{
        grid-template-columns:28px minmax(135px,1fr) repeat(5,44px) 26px 26px 68px;
        gap:6px;
    }
    .game-content-skills .skillWrapper{
        grid-template-columns:28px minmax(135px,1fr) repeat(5,44px) 26px 26px 68px;
        gap:6px;
    }
}

.game-content-overlay{
    position: absolute;
    inset: 0;
    /* Every modal (combat, chronicle, shop, dev tools, etc.) shares this class, so this is
       the one place that needs to robustly out-rank tab content (Travel's map, in
       particular, had a direction button with its own z-index that escaped above the
       combat overlay without this). */
    z-index: 50;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 50px;
    background-color: var(--color-gameLight);
    transition: 1.5s background-color ease-in-out !important;
}
.game-content-overlay.battle{
    padding: 10px !important;
    border-radius: 5px;
    border: 1px solid var(--color-notEnoughXP);
    background-color: var(--color-gameSlate);
       
    animation: combatPulse 3s ease-in-out infinite;
}
.game-content-overlay.battle.combat-pulse-disabled{
    animation: none;
    box-shadow: none;
}
@keyframes combatPulse {
  0%, 100% {
    box-shadow: inset 0 0 0 rgba(139, 46, 46, 1.00);
  }
  50% {
    box-shadow: inset 0 0 500px rgba(139, 46, 46, 1.00);
  }
}

.game-content-overlay.skillDescription{
    background: rgba(0,0,0,0.8);
    justify-content: start;
    align-items: center;
}
.game-content-overlay.chronicle{
    background: rgba(0,0,0,0.8);
    justify-content: start;
    align-items: center;
}

.skill-description-wrapper{
    display: flex;
    flex-direction: column;
    max-width: 60vw;
    background-color: var(--color-gameSlate);
    color:var(--color-gameLight);
    border-radius: 5px;
    border:2px solid var(--color-gold);
    gap:20px;
    padding:15px;
}
.skill-description-title{
    display: grid;
    text-align: center;
    grid-template-columns: 1fr auto;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
}
.skill-description-content{
    
}

.chronicle-wrapper{
    display: flex;
    flex-direction: column;
    min-width: 300px;
    max-width: 60vw;
    max-height: 60dvh;
    /* max-height alone doesn't create a scroll region - without this, content taller than
       the cap just paints past the panel's own edge (default overflow:visible), forcing
       the whole PAGE to scroll instead of the modal scrolling internally. Every dashboard
       built on this class (Biomes/Towns/Monster Templates/Map Regions) needs this. */
    overflow-y: auto;
    background-color: var(--color-gameSlate);
    color:var(--color-gameLight);
    border-radius: 5px;
    border:2px solid var(--color-gold);
    gap:20px;
    padding:15px;
}
.chronicle-title{
    display: grid;
    text-align: center;
    grid-template-columns: 1fr auto;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
}
.chronicle-log-wrapper{
    display: flex;
    flex-direction: column;
    gap:5px;
    flex: 1;
    overflow-y: auto;
    padding-right:10px;
}
.chronicle-log-entry{
    border-radius: 5px;
    padding: 3px 25px 3px 25px;
    background-color: var(--color-gameLight);
    color: var(--color-gameDark)
}

/* Player-local hotkey editor, opened from the main command strip. */
.settings-overlay{
    z-index: 1200;
    display: grid;
    place-items: center;
    min-height: 0;
    overflow: hidden;
    background: rgba(0,0,0,0.72);
}
.keybind-settings-panel{
    width: min(620px, calc(100% - 32px));
    max-height: 100%;
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 16px;
    border: 1px solid var(--color-gold);
    border-radius: 9px;
    background: linear-gradient(145deg, #3d3a34, #24231f);
    box-shadow: 0 18px 40px rgba(0,0,0,0.62), inset 0 1px rgba(255,255,255,0.12);
    color: var(--color-gameLight);
    font-family: var(--font-ui);
}
.keybind-settings-heading{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(212,175,55,0.48);
}
.keybind-settings-heading h2{
    margin: 0;
    color: var(--color-gold);
    font-family: var(--font-display);
    font-size: 1.1rem;
}
.keybind-settings-close{
    position: static;
    flex: 0 0 auto;
}
.settings-section-tabs{ display:flex; gap:5px; padding:9px 0 0; }
.settings-section-tab{ padding:4px 13px; border:1px solid rgba(212,175,55,.35); border-radius:5px 5px 0 0; background:rgba(0,0,0,.16); color:var(--color-gameSlate); font:inherit; font-size:.78rem; cursor:pointer; }
.settings-section-tab.active{ border-color:rgba(212,175,55,.72); background:rgba(212,175,55,.14); color:var(--color-gold); }
.settings-section{ flex:1; min-height:0; }
.settings-section[hidden]{ display:none; }
.settings-controls-section,
.settings-chat-section{ display:flex; flex-direction:column; min-height:0; }
.settings-chat-section{ padding-top:8px; }
.settings-chat-section .chat-manager-content{ flex:1; }
.keybind-settings-help{
    margin: 11px 0;
    color: rgba(255,255,255,0.72);
    font-size: 0.82rem;
    line-height: 1.35;
}
.keybind-settings-feedback{
    min-height: 1.2em;
    margin-bottom: 8px;
    color: #ffe793;
    font-size: 0.78rem;
}
.keybind-settings-rows{
    display: grid;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}
.keybind-settings-group{
    min-width: 0;
    margin: 2px 0 0;
    padding: 7px 7px 8px;
    display: grid;
    gap: 4px;
    border: 1px solid rgba(212,175,55,0.52);
    border-radius: 7px;
    background: rgba(0,0,0,0.1);
    box-shadow: inset 0 0 12px rgba(0,0,0,0.18);
}
.keybind-settings-group-title{
    margin: 0 auto;
    padding: 0 10px;
    color: var(--color-gold);
    font-family: var(--font-display);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}
.keybind-settings-row{
    display: grid;
    grid-template-columns: minmax(0, 1fr) 78px;
    align-items: center;
    gap: 6px;
    padding: 3px 5px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    background: rgba(0,0,0,0.16);
}
.keybind-settings-label{
    font-weight: bold;
    font-size: 0.76rem;
}
.game-preference-row{
    cursor: pointer;
}
.game-preference-toggle{
    justify-self: end;
    width: 18px;
    height: 18px;
    margin: 0 4px 0 0;
    accent-color: var(--color-gold);
    cursor: pointer;
}
.keybind-capture-button,
.keybind-settings-reset{
    min-height: 24px;
    padding: 2px 5px;
    border: 1px solid #756b59;
    border-radius: 5px;
    background: #292824;
    color: var(--color-gameLight);
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
}
.keybind-hit-location-block{
    margin-bottom: 2px;
    padding: 4px 5px 6px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    background: rgba(0,0,0,0.16);
}
.keybind-hit-location-title{
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
    color: #d8bd69;
    font-size: 0.68rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
}
.keybind-hit-location-title::before,
.keybind-hit-location-title::after{
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(212,175,55,0.34);
}
.keybind-location-bindings{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}
.keybind-location-binding{
    display: grid;
    grid-template-rows: auto 24px;
    gap: 3px;
}
.keybind-location-label{
    color: rgba(255,255,255,0.68);
    font-size: 0.62rem;
    text-transform: uppercase;
    text-align: center;
}
.keybind-location-binding .keybind-capture-button{
    width: 100%;
    min-width: 0;
}
.keybind-movement-grid{
    width: min(250px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px 7px;
}
.keybind-movement-binding{
    padding: 3px;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 5px;
    background: rgba(0,0,0,0.14);
}
.keybind-movement-center{
    min-height: 1px;
}
.keybind-capture-button:hover,
.keybind-capture-button:focus-visible,
.keybind-capture-button.capturing{
    border-color: var(--color-gold);
    box-shadow: 0 0 0 1px rgba(255,215,0,0.2);
    outline: none;
}
.keybind-settings-actions{
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}
.keybind-settings-reset:hover,
.keybind-settings-reset:focus-visible{
    border-color: var(--color-gold);
    color: #fff1a4;
    outline: none;
}

.combat-confirm-choice{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}
.combat-confirm-choice img{
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* Debug Log additions (displayDebugLog(), scripts/game.js) - a report-bug button to the left of
   every rendered block, and consecutive same-combat entries visually grouped into one reddish
   block so a whole fight reads as one unit instead of scattered .chronicle-log-entry lines. */
.debug-log-block-row{
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.debug-log-block-row .chronicle-log-entry,
.debug-log-block-row .debug-log-combat-action{
    flex: 1;
    min-width: 0;
}
.debug-log-report-button{
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255,255,255,0.1);
    cursor: pointer;
    font-size: 0.9rem;
}
.debug-log-report-button:hover{
    background-color: rgba(255,255,255,0.2);
}
.debug-log-combat-group{
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-radius: 6px;
    padding: 8px;
    background-color: rgba(180,60,60,0.18);
    border: 1px solid rgba(180,60,60,0.4);
}
.debug-log-combat-group-header{
    font-weight: bold;
    font-size: 0.85rem;
    opacity: 0.9;
}
.debug-log-combat-action{
    border-radius: 5px;
    padding: 3px 25px 3px 25px;
    background-color: rgba(255,255,255,0.08);
    color: var(--color-gameLight);
}

.bug-report-context{
    border-radius: 5px;
    padding: 6px 10px;
    margin-bottom: 8px;
    background-color: rgba(255,255,255,0.08);
    font-size: 0.85rem;
    max-height: 100px;
    overflow-y: auto;
}
.bug-report-label{
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 3px;
}
.bug-report-textarea{
    width: 100%;
    min-height: 60px;
    resize: vertical;
    font-family: inherit;
    font-size: inherit;
    box-sizing: border-box;
    margin-bottom: 10px;
    border-radius: 5px;
    padding: 6px;
}

.game-content-overlay.shop{
    background: rgba(0,0,0,0.8);
    justify-content: start;
    align-items: center;
}
.shop-wrapper{
    display: flex;
    flex-direction: column;
    min-width: 300px;
    max-width: 60vw;
    max-height: 60dvh;
    background-color: var(--color-gameSlate);
    color:var(--color-gameLight);
    border-radius: 5px;
    border:2px solid var(--color-gold);
    gap:20px;
    padding:15px;
}
.shop-title{
    display: grid;
    text-align: center;
    grid-template-columns: 1fr auto;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
}
.shop-items-wrapper{
    display: flex;
    flex-direction: column;
    gap:5px;
    flex: 1;
    overflow-y: auto;
    padding-right:10px;
}
.shop-item-row{
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap:15px;
    border-radius: 5px;
    padding: 6px 15px;
    background-color: var(--color-gameLight);
    color: var(--color-gameDark);
}
.shop-item-price{
    color: var(--color-gold);
    font-weight: bold;
    white-space: nowrap;
}
.shop-item-stock{
    font-size: 0.85rem;
    color: var(--color-gameDark);
    opacity: 0.75;
    white-space: nowrap;
}
.shop-item-buy{
    text-align: center;
    border: 1px solid var(--color-gameDark);
    border-radius: 5px;
    padding: 4px 12px;
    background-color: var(--color-gameSlate);
    color: var(--color-gameLight);
    cursor: pointer;
    transition: 0.15s all ease-in-out;
}
.shop-item-buy:hover{
    background-color: var(--color-gold);
    color: black;
    border-color: black;
}
.shop-item-buy.disabled{
    background-color: var(--color-notEnoughXP) !important;
    filter: grayscale(100%) brightness(0.7);
    cursor: default;
    pointer-events: none;
}

/* Town screen (renderTravelUI) - a full-bleed dashboard over the town's own large background
   art (images/towns/{name}/{name}.webp), individual gold-bordered dark panels floating directly
   on that art (not one big overlay tint) - matches the owner's own mockup. CSS Grid keeps the
   floating panels (topbar/main/people/utilities/statusbar) from needing manual positioning. */
.travel-wrapper{
    position: relative; /* anchors .inn-rest-hud (owner request 2026-09-19) to this screen */
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-areas:
        "topbar    topbar"
        "main      people"
        "utilities utilities"
        "statusbar statusbar";
    grid-template-rows:auto minmax(0, 1fr) auto auto;
    align-content:stretch;
    gap: 15px;
    width: 100%;
    max-width: 1300px;
    height:100%;
    max-height:100%;
    min-height:0;
    flex:1;
    overflow:hidden;
    padding: 15px;
    box-sizing: border-box;
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
    background-color: var(--color-gameDark); /* fallback while art loads, or if a town has none yet */
    color:var(--color-gameLight);
    border-radius: 5px;
    border:2px solid var(--color-gold);
}
.travel-title{
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
}

/* Shared "floating panel" look every town-screen card uses - a dark, mostly-opaque backing
   (not the fully-opaque page background) so the art behind it stays just barely visible,
   with the same gold border/radius as the outer wrapper. */
.town-badge, .town-people, .town-utilities, .town-action-button{
    background-color: rgba(20,15,10,0.78);
    border: 1px solid var(--color-gold);
    border-radius: 6px;
}

.town-topbar{
    grid-area: topbar;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.town-badge{
    display: flex;
    align-items: center;
    gap:10px;
    padding: 8px 14px;
}
.town-badge-icon{
    font-size: 1.6rem;
}
.town-badge-title{
    font-weight: bold;
}
.town-badge.safezone{
    color: #8fd67a;
}
.town-badge-subtitle{
    font-size: 0.75rem;
    opacity: 0.85;
    color: var(--color-gameLight);
}

.town-main{
    grid-area: main;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap:20px;
}
.town-header{
    text-align: center;
}
/* Flanking gold lines around the title/Bind-to-Spirit-Anchor - flex:1 pseudo-elements so the
   lines fill whatever space is left on either side of the (variable-width) text between them. */
.town-header-flourish{
    display: flex;
    align-items: center;
    gap:12px;
    justify-content: center;
    color: var(--color-gold);
    opacity: 0.8;
    margin-bottom: 6px;
}
.town-header-flourish::before, .town-header-flourish::after{
    content: "";
    width: 70px;
    height: 1px;
    background-color: var(--color-gold);
}
.town-title{
    font-size: 2.4rem;
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
}
.town-description{
    opacity: 0.9;
    max-width: 520px;
    margin: 8px auto 0;
    text-shadow: var(--text-shadow-black-outline);
}

.town-action-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap:10px;
    width: 100%;
    max-width: 680px;
}
.town-action-button{
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap:4px;
    padding: 12px 8px;
    cursor: pointer;
    transition: 0.15s all ease-in-out;
}
.town-crafting-badge{
    position: absolute;
    top: 7px;
    padding: 3px 7px;
    border: 1px solid var(--color-gold);
    border-radius: 10px;
    color: #251c08;
    background: linear-gradient(180deg, #f1d35a, #c99c28);
    box-shadow: 0 3px 8px rgba(0,0,0,0.55);
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}
.town-crafting-ready{ right:7px; }
.town-crafting-working{ left:7px; color:#e9dec2; border-color:#a98237; background:linear-gradient(180deg,#5f5135,#3a3020); }
.town-action-button:hover{
    background-color: rgba(20,15,10,0.95);
    border-color: #fff;
}
.town-action-icon{
    font-size: 1.4rem;
}
.town-action-label{
    font-weight: bold;
}
.town-action-desc{
    font-size: 0.7rem;
    opacity: 0.75;
    text-align: center;
}

.town-people{
    grid-area: people;
    display: flex;
    flex-direction: column;
    gap:8px;
    padding: 12px;
    overflow-y: auto;
}
.town-people-title{
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid var(--color-gold);
    padding-bottom: 6px;
    margin-bottom: 4px;
}
.town-npc-row{
    display: flex;
    gap:8px;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: 0.15s background-color ease-in-out;
}
.town-npc-row:hover{
    background-color: rgba(255,255,255,0.08);
}
.town-npc-avatar{
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--color-gold);
    color: #241c10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    overflow: hidden;
    border: 1px solid rgba(242,201,94,0.7);
    box-sizing: border-box;
}
.town-npc-avatar.has-portrait{
    border-radius: 5px;
    background: rgba(0,0,0,0.38);
}
.town-npc-portrait{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.town-npc-info{
    min-width: 0;
}
.town-npc-name{
    font-weight: bold;
}
.town-npc-type{
    font-size: 0.7rem;
    opacity: 0.85;
    font-style: italic;
}
.town-npc-preview{
    font-size: 0.7rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.town-utilities{
    grid-area: utilities;
    padding: 12px;
}
.town-utilities-title{
    font-weight: bold;
    margin-bottom: 8px;
    text-align: center;
}

.town-statusbar{
    grid-area: statusbar;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.85;
    text-shadow: var(--text-shadow-black-outline);
}

/* Full-bleed town hub refresh.  The background art owns the entire available Travel panel;
   town controls float over it as translucent cards. */
.game-content-travel .travel-wrapper{
    grid-template-columns:minmax(0, 1fr) minmax(250px, 310px);
    grid-template-areas:
        "main people"
        "main people"
        "utilities utilities";
    grid-template-rows:auto minmax(0, 1fr) auto;
    gap:14px;
    width:100%;
    max-width:none;
    height:100%;
    padding:12px 16px 16px;
    border:1px solid #d4aa3f;
    border-radius:0;
    background-size:cover;
    background-position:center;
}
/* Travel's own full-bleed look (below) only while it's bare - #gameContent now permanently
   carries .game-content-travel even while Attributes/Skills/Inventory/Spells/Quest are open on
   top of it (openScreenOverlay(), attributes_skills_inventory.js), and THOSE screens still need
   the normal padded gold-frame edge the owner asked to keep visible around every overlay, so this
   has to explicitly step aside whenever #screenOverlay is present. */
#gameContentWrapper:has(> .game-content-travel:not(:has(#screenOverlay))){
    padding-left:0;
    padding-right:0;
    padding-bottom:0;
}
#gameContentWrapper:has(> .game-content-travel:not(:has(#screenOverlay)))::before{
    display:none;
}
.game-content-travel .town-frame-corner{
    position:absolute;
    z-index:8;
    inset:6px;
    pointer-events:none;
    background:
        linear-gradient(90deg,#f0cd66,#f0cd66) left top / 28px 2px no-repeat,
        linear-gradient(180deg,#f0cd66,#f0cd66) left top / 2px 28px no-repeat,
        linear-gradient(270deg,#f0cd66,#f0cd66) right top / 28px 2px no-repeat,
        linear-gradient(180deg,#f0cd66,#f0cd66) right top / 2px 28px no-repeat,
        linear-gradient(90deg,#f0cd66,#f0cd66) left bottom / 28px 2px no-repeat,
        linear-gradient(0deg,#f0cd66,#f0cd66) left bottom / 2px 28px no-repeat,
        linear-gradient(270deg,#f0cd66,#f0cd66) right bottom / 28px 2px no-repeat,
        linear-gradient(0deg,#f0cd66,#f0cd66) right bottom / 2px 28px no-repeat;
}
.game-content-travel .town-frame-ornament{
    position:absolute;
    z-index:9;
    inset:0;
    pointer-events:none;
}
.game-content-travel .town-frame-ornament::before,
.game-content-travel .town-frame-ornament::after{
    content:"◆◆";
    position:absolute;
    left:50%;
    transform:translateX(-50%);
    color:#f5d557;
    font-size:9px;
    letter-spacing:-3px;
    line-height:10px;
    text-shadow:0 0 6px rgba(255,215,70,0.7), -24px 0 0 #a87921, 24px 0 0 #a87921;
}
.game-content-travel .town-frame-ornament::before{ top:-5px; }
.game-content-travel .town-frame-ornament::after{ bottom:-5px; transform:translateX(-50%) rotate(180deg); }
.game-content-travel .town-spirit-anchor{
    position:absolute;
    z-index:12;
    top:auto;
    bottom:14px;
    left:50%;
    width:clamp(112px, 10vw, 170px);
    height:clamp(112px, 10vw, 170px);
    display:grid;
    place-items:center;
    cursor:pointer;
    border-radius:50%;
    outline:none;
    transform:translateX(-50%);
    transition:filter 0.18s, transform 0.18s;
}
.game-content-travel .town-spirit-anchor::before{
    content:"";
    position:absolute;
    z-index:0;
    left:-24%;
    right:-24%;
    top:-10%;
    bottom:-7%;
    border-radius:48% 48% 42% 42%;
    background:radial-gradient(ellipse at center,
        rgba(9,7,5,0.78) 0%,
        rgba(9,7,5,0.62) 48%,
        rgba(9,7,5,0.25) 72%,
        transparent 88%);
    border-bottom:1px solid rgba(222,174,63,0.52);
    box-shadow:0 10px 18px rgba(0,0,0,0.3);
    pointer-events:none;
}
.game-content-travel .town-spirit-anchor-image{
    position:relative;
    z-index:1;
    display:block;
    width:100%;
    height:100%;
    object-fit:contain;
    filter:drop-shadow(0 5px 8px rgba(0,0,0,0.82));
    transition:filter 0.18s, transform 0.18s;
}
.game-content-travel .town-spirit-anchor:hover,
.game-content-travel .town-spirit-anchor:focus-visible{
    transform:translateX(-50%) scale(1.0175);
}
.game-content-travel .town-spirit-anchor:hover .town-spirit-anchor-image,
.game-content-travel .town-spirit-anchor:focus-visible .town-spirit-anchor-image{
    filter:drop-shadow(0 0 10px rgba(100,210,255,0.88)) drop-shadow(0 5px 8px rgba(0,0,0,0.82));
}
.game-content-travel .town-spirit-anchor.is-bound{
    cursor:default;
    animation:town-anchor-glow 2.4s ease-in-out infinite;
}
.game-content-travel .town-spirit-anchor.disabled{
    pointer-events:none;
    opacity:0.7;
}
.game-content-travel .town-spirit-anchor[data-tooltip]::after{
    content:attr(data-tooltip);
    position:absolute;
    z-index:3;
    bottom:calc(100% - 3px);
    left:50%;
    width:max-content;
    max-width:230px;
    padding:7px 10px;
    color:#f7e8bd;
    font:0.82rem Georgia,"Times New Roman",serif;
    white-space:nowrap;
    background:linear-gradient(180deg,rgba(53,41,25,0.97),rgba(20,15,10,0.98));
    border:1px solid #d5ab42;
    border-radius:4px;
    box-shadow:0 5px 14px rgba(0,0,0,0.65),inset 0 0 0 1px rgba(255,225,139,0.12);
    opacity:0;
    transform:translate(-50%, 4px);
    transition:opacity 0.12s,transform 0.12s;
    pointer-events:none;
}
.game-content-travel .town-spirit-anchor[data-tooltip]:hover::after,
.game-content-travel .town-spirit-anchor[data-tooltip]:focus-visible::after{
    opacity:1;
    transform:translate(-50%, 0);
}
@keyframes town-anchor-glow{
    0%,100%{ filter:drop-shadow(0 0 7px rgba(88,195,255,0.62)) drop-shadow(0 0 13px rgba(255,211,72,0.28)); }
    50%{ filter:drop-shadow(0 0 14px rgba(112,220,255,0.95)) drop-shadow(0 0 25px rgba(255,217,79,0.58)); }
}
.game-content-travel .town-topbar,
.game-content-travel .town-statusbar{
    display:none;
}
.game-content-travel .town-main{
    display:grid;
    grid-template-rows:auto minmax(0, 1fr);
    align-items:center;
    gap:18px;
    min-width:0;
    min-height:0;
    padding-top:4px;
}
.game-content-travel .town-header{
    align-self:start;
    position:relative;
    width:min(820px, 100%);
    padding:10px 28px 16px;
    box-sizing:border-box;
    background:radial-gradient(ellipse at center, rgba(10,7,4,0.7) 0%, rgba(10,7,4,0.4) 45%, transparent 76%);
}
.game-content-travel .town-header-flourish{
    width:min(420px, 72%);
    height:15px;
    margin:0 auto 7px;
    gap:18px;
    background:radial-gradient(circle, #fff0a0 0 15%, var(--color-gold) 18% 34%, #765817 38% 53%, transparent 56%) center / 15px 15px no-repeat;
}
.game-content-travel .town-header-flourish::before,
.game-content-travel .town-header-flourish::after{
    flex:1;
    width:auto;
    background:linear-gradient(90deg, transparent, #8c671d 28%, #f2cf68 100%);
    box-shadow:0 1px rgba(0,0,0,0.72);
}
.game-content-travel .town-header-flourish::after{
    background:linear-gradient(90deg, #f2cf68, #8c671d 72%, transparent);
}
.game-content-travel .town-title{
    color:#f4cd62;
    background:none;
    -webkit-text-fill-color:#f4cd62;
    -webkit-text-stroke:1px rgba(80,47,7,0.9);
    font-family:var(--font-display);
    font-size:clamp(2.8rem, 5vw, 5.2rem);
    line-height:0.95;
    letter-spacing:0.02em;
    text-shadow:0 3px 2px #160e05, 0 0 3px #ffedaa, 0 0 12px rgba(0,0,0,0.95), 0 0 24px rgba(245,190,55,0.38);
}
.game-content-travel .town-description{
    max-width:720px;
    margin:14px auto 0;
    padding:9px 30px 10px;
    box-sizing:border-box;
    color:#f0e2c4;
    font-family:var(--font-body);
    font-size:clamp(0.88rem, 1.25vw, 1.15rem);
    line-height:1.35;
    opacity:0.96;
    text-shadow:0 2px 3px #000, 0 0 8px #000;
    background:linear-gradient(90deg, transparent, rgba(12,8,5,0.56) 14%, rgba(12,8,5,0.7) 50%, rgba(12,8,5,0.56) 86%, transparent);
    border-top:1px solid;
    border-bottom:1px solid;
    border-image:linear-gradient(90deg, transparent, rgba(239,199,103,0.72) 25%, rgba(255,231,155,0.9) 50%, rgba(239,199,103,0.72) 75%, transparent) 1;
}
.game-content-travel .town-main > .town-action-grid{
    grid-template-columns:repeat(4, minmax(120px, 1fr));
    gap:10px;
    width:100%;
    max-width:780px;
    max-height:100%;
    align-self:start;
    margin-top:clamp(24px, 5vh, 52px);
    padding:4px;
    box-sizing:border-box;
    overflow-y:auto;
}
.game-content-travel .town-main .town-action-button{
    justify-content:flex-end;
    gap:2px;
    min-height:112px;
    padding:6px 9px 8px;
    box-sizing:border-box;
    cursor:default;
    background:linear-gradient(180deg, rgba(24,18,11,0.42), rgba(10,8,6,0.76));
    border-color:rgba(226,178,67,0.88);
    box-shadow:inset 0 0 0 2px rgba(0,0,0,0.36), 0 4px 9px rgba(0,0,0,0.42);
    backdrop-filter:blur(1px);
}
.game-content-travel .town-main .town-action-button:hover{
    background:linear-gradient(180deg, rgba(42,31,16,0.52), rgba(10,8,6,0.82));
    border-color:#f5d474;
}
.game-content-travel .town-action-icon{
    font-size:1.65rem;
    filter:drop-shadow(0 2px 2px #000);
}
.game-content-travel .town-action-icon-image{
    display:block;
    width:58px;
    height:58px;
    object-fit:contain;
}
.game-content-travel .town-action-label{
    color:#f6e8c5;
    font-family:var(--font-body);
    font-size:1.08rem;
    text-shadow:0 2px 2px #000;
}
.game-content-travel .town-people{
    min-height:0;
    padding:16px;
    background:
        linear-gradient(90deg, #f2c95e, #f2c95e) left 7px top 7px / 22px 2px no-repeat,
        linear-gradient(180deg, #f2c95e, #f2c95e) left 7px top 7px / 2px 22px no-repeat,
        linear-gradient(270deg, #f2c95e, #f2c95e) right 7px top 7px / 22px 2px no-repeat,
        linear-gradient(180deg, #f2c95e, #f2c95e) right 7px top 7px / 2px 22px no-repeat,
        linear-gradient(90deg, #f2c95e, #f2c95e) left 7px bottom 7px / 22px 2px no-repeat,
        linear-gradient(0deg, #f2c95e, #f2c95e) left 7px bottom 7px / 2px 22px no-repeat,
        linear-gradient(270deg, #f2c95e, #f2c95e) right 7px bottom 7px / 22px 2px no-repeat,
        linear-gradient(0deg, #f2c95e, #f2c95e) right 7px bottom 7px / 2px 22px no-repeat,
        linear-gradient(180deg, rgba(19,14,9,0.76), rgba(9,7,5,0.88));
    box-shadow:inset 0 0 0 2px rgba(0,0,0,0.42), 0 5px 14px rgba(0,0,0,0.5);
    backdrop-filter:blur(2px);
}
.game-content-travel .town-people-title{
    margin-bottom:5px;
    padding-bottom:10px;
    color:#f3d889;
    font-family:var(--font-display);
    font-size:1.3rem;
    text-align:left;
}
.game-content-travel .town-npc-row{
    padding:10px 4px;
    /* Owner request 2026-09-19: NPC rows are real click targets now (Merchant/Inn/Healing/
       Gossip interactions) - cursor:default here used to correctly describe a purely static row. */
    cursor:pointer;
    border-bottom:1px solid rgba(183,138,57,0.28);
}
.game-content-travel .town-utilities{
    align-self:end;
    padding:0;
    background:transparent;
    border:0;
}
.game-content-travel .town-utilities-title{
    display:none;
}
.game-content-travel .town-utilities > .town-action-grid{
    display:flex;
    align-items:stretch;
    justify-content:flex-end;
    gap:12px;
    width:100%;
    max-width:none;
}
.game-content-travel .town-utilities .town-action-button{
    display:none;
}
.game-content-travel .town-utilities .town-action-leave-town{
    display:flex;
    flex:0 0 min(310px, 100%);
    min-height:58px;
    width:min(310px, 100%);
    flex-direction:row;
    justify-content:center;
    gap:12px;
    padding:10px 18px;
    box-sizing:border-box;
    cursor:pointer;
    background:
        linear-gradient(90deg, #f2c95e, #f2c95e) left 6px top 6px / 18px 2px no-repeat,
        linear-gradient(180deg, #f2c95e, #f2c95e) left 6px top 6px / 2px 18px no-repeat,
        linear-gradient(270deg, #f2c95e, #f2c95e) right 6px top 6px / 18px 2px no-repeat,
        linear-gradient(180deg, #f2c95e, #f2c95e) right 6px top 6px / 2px 18px no-repeat,
        linear-gradient(90deg, #f2c95e, #f2c95e) left 6px bottom 6px / 18px 2px no-repeat,
        linear-gradient(0deg, #f2c95e, #f2c95e) left 6px bottom 6px / 2px 18px no-repeat,
        linear-gradient(270deg, #f2c95e, #f2c95e) right 6px bottom 6px / 18px 2px no-repeat,
        linear-gradient(0deg, #f2c95e, #f2c95e) right 6px bottom 6px / 2px 18px no-repeat,
        linear-gradient(180deg, rgba(70,27,13,0.78), rgba(35,13,7,0.92));
    box-shadow:inset 0 0 0 2px rgba(0,0,0,0.42), 0 4px 11px rgba(0,0,0,0.48);
}
.game-content-travel .town-utilities .town-action-leave-town:hover{
    border-color:#ffe18a;
    filter:brightness(1.14);
}
.game-content-travel .town-utilities .town-action-leave-town .town-action-icon{ font-size:1.45rem; }
.game-content-travel .town-utilities .town-action-leave-town .town-action-label{ font-size:1.2rem; }
.game-content-travel .town-utilities .town-action-leave-town .town-action-desc{ display:none; }

.game-content-travel .spirit-anchor-wrapper{
    position:relative;
    width:min(540px, 82%);
    max-width:none;
    height:auto;
    margin:0 auto;
    gap:12px;
    opacity:1;
    background:none;
}
.game-content-travel .spirit-anchor-wrapper::before,
.game-content-travel .spirit-anchor-wrapper::after{
    height:1px;
    background:linear-gradient(90deg, transparent, #d2a742);
    box-shadow:0 1px rgba(0,0,0,0.75);
}
.game-content-travel .spirit-anchor-wrapper::after{
    background:linear-gradient(90deg, #d2a742, transparent);
}
.game-content-travel .spirit-anchor-button,
.game-content-travel .spirit-anchor-status{
    position:relative;
    min-height:48px;
    padding:12px 54px;
    box-sizing:border-box;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#ffe48a;
    font-family:var(--font-body);
    font-size:1.08rem;
    letter-spacing:0.025em;
    text-shadow:0 2px 2px #000, 0 0 8px rgba(255,190,46,0.25);
    background:linear-gradient(180deg, rgba(49,36,19,0.88), rgba(13,10,7,0.94));
    border:1px solid #d5a93d;
    border-radius:2px;
    clip-path:polygon(15px 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 15px 100%, 0 50%);
    box-shadow:inset 0 0 0 2px rgba(0,0,0,0.5), inset 0 1px rgba(255,234,159,0.18), 0 4px 12px rgba(0,0,0,0.55);
}
.game-content-travel .spirit-anchor-button::before,
.game-content-travel .spirit-anchor-button::after,
.game-content-travel .spirit-anchor-status::before,
.game-content-travel .spirit-anchor-status::after{
    content:"◆";
    position:absolute;
    top:50%;
    transform:translateY(-50%) rotate(45deg);
    color:#f4cc5c;
    font-size:0.66rem;
    text-shadow:0 0 5px rgba(255,215,0,0.55);
}
.game-content-travel .spirit-anchor-button::before,
.game-content-travel .spirit-anchor-status::before{ left:24px; }
.game-content-travel .spirit-anchor-button::after,
.game-content-travel .spirit-anchor-status::after{ right:24px; }
.game-content-travel .spirit-anchor-button:hover{
    color:#fff1b6;
    background:linear-gradient(180deg, rgba(91,64,24,0.94), rgba(30,20,8,0.98));
    border-color:#ffe38a;
    filter:drop-shadow(0 0 7px rgba(255,200,54,0.34));
}

@media (max-width:1050px){
    .game-content-travel .travel-wrapper{
        grid-template-columns:minmax(0, 1fr) 240px;
        padding:16px;
        gap:12px;
    }
    .game-content-travel .town-main > .town-action-grid{
        grid-template-columns:repeat(3, minmax(105px, 1fr));
    }
    .game-content-travel .town-main .town-action-button{ min-height:105px; padding-block:5px 7px; }
    .game-content-travel .town-action-icon-image{ width:54px; height:54px; }
}
@media (max-width:720px){
    .game-content-travel .travel-wrapper{
        grid-template-columns:1fr;
        grid-template-areas:"main" "people" "utilities";
        grid-template-rows:minmax(0, 1fr) auto auto;
    }
    .game-content-travel .town-people{ max-height:180px; }
    .game-content-travel .town-main > .town-action-grid{
        grid-template-columns:repeat(2, minmax(100px, 1fr));
    }
}

/* Reused inside the Travel Routes popup (openInspectPopup) - a real, working destination list,
   not a dummy - kept as its own plain class since that popup has its own unrelated chrome. */
.travel-destination{
    text-align: center;
    border-radius: 5px;
    padding: 8px 15px;
    background-color: var(--color-gameLight);
    color: var(--color-gameDark);
    cursor: pointer;
    transition: 0.15s all ease-in-out;
}
.travel-destination:hover{
    background-color: var(--color-gold);
    border-color: black;
}
.travel-destination.disabled{
    filter: grayscale(100%) brightness(0.7);
    cursor: default;
    pointer-events: none;
}
.travel-none{
    text-align: center;
    opacity: 0.75;
    padding: 10px;
}

/* Portal Networks travel screen (owner request 2026-09-22) - a dedicated overlay reused for
   every portal (a town's own linked destinations today, a standalone "in the wild" portal POI
   later - openPortalPopup() takes whatever destination list it's handed, nothing about this
   shell is town-specific). Layout: a left nav rail (destination names only, no thumbnails per
   the owner's own instruction) beside a "stage" where the current/hovered destination's own
   image shows through the gateway art's transparent ring, with a full-width Travel button bar
   along the bottom. See .portal-gateway-background's own comment for the layering/overflow
   rules the owner specifically asked for. */
.portal-gateway-frame{
    position: relative;
    overflow: visible; /* never clip the background layer's own top-overflow - see below */
    width: min(960px, 92vw);
    height: min(610px, 82vh);
    padding: 0;
    /* Let a restrained amount of the town scene show through the stage instead of presenting
       the gateway on a fully opaque gray slab. */
    background: linear-gradient(rgba(51,51,51,0.6), rgba(32,32,32,0.6));
    /* Width of the destination pane; the artwork now continues underneath it. */
    --portal-gateway-nav-width: 300px;
}
/* Four individually drawn SVG ornaments continue the double border into fine corner filigree. */
.portal-gateway-corners{
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}
.portal-gateway-corner{
    position: absolute;
    width: 72px;
    height: 72px;
    background: center / contain no-repeat;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));
}
.portal-gateway-corner-tl{ top: 0; left: 0; background-image: url("../images/portal_gateways/corners/top-right.svg"); transform: rotate(-90deg); }
.portal-gateway-corner-tr{ top: 0; right: 0; background-image: url("../images/portal_gateways/corners/top-right.svg"); }
.portal-gateway-corner-bl{ bottom: 0; left: 0; background-image: url("../images/portal_gateways/corners/top-right.svg"); transform: rotate(180deg); }
.portal-gateway-corner-br{ right: 0; bottom: 0; background-image: url("../images/portal_gateways/corners/top-right.svg"); transform: rotate(90deg); }

/* The dynamic gateway spans the whole frame, including beneath the translucent destination nav.
   Its own clip-path keeps left/right/bottom flush with the gold frame while deliberately allowing
   artwork to rise beyond the top edge. The frame itself stays overflow:visible so that exception
   remains visible. */
.portal-gateway-background{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    clip-path: inset(-999px 0 0 0);
    z-index: 0;
    pointer-events: none;
}
/* Preserve the gateway artwork's 1122x1402 proportions so the measured preview aperture below remains
   aligned. At this scale the stonework meets the right and bottom crop, its trail continues under
   the nav, and the crown is the only portion allowed beyond the frame. */
.portal-gateway-art-frame{
    position: absolute;
    height: 185%;
    width: auto;
    aspect-ratio: 1122 / 1402;
    left: 3%;
    bottom: -50%;
}
/* The destination preview sits beneath the gateway artwork. Its rectangle deliberately extends beyond
   the transparent opening; the gateway's opaque stones and energy ring cover the excess and form
   the final silhouette without a second artificial oval clipping the destination. */
.portal-gateway-preview-image{
    position: absolute;
    /* Oversize the destination behind the opening and let the gateway's opaque stonework
       provide the final portal shape. This avoids the undersized oval and its dark edge gaps. */
    top: 24%;
    left: 49%;
    right: 16%;
    bottom: 35%;
    transform: translate(5px, 5px);
    border-radius: 0;
    overflow: hidden;
    background-image: var(--bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    z-index: 0;
}
.portal-gateway-preview-image::after{
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(190,238,255,0.62), rgba(74,169,255,0.18) 48%, transparent 76%);
    opacity: 0;
    pointer-events: none;
}
.portal-gateway-preview-image.is-transitioning{
    animation: portalPreviewResolve 0.3s ease-out both;
}
.portal-gateway-preview-image.is-transitioning::after{
    animation: portalPreviewFlash 0.3s ease-out both;
}
@keyframes portalPreviewResolve{
    0%{
        opacity: 0.25;
        filter: blur(5px) brightness(1.55) saturate(0.7);
        transform: translate(5px, 5px) scale(1.035);
    }
    100%{
        opacity: 1;
        filter: none;
        transform: translate(5px, 5px) scale(1);
    }
}
@keyframes portalPreviewFlash{
    0%{ opacity: 0.8; }
    100%{ opacity: 0; }
}
.portal-gateway-art-image{
    position: absolute;
    inset: 0;
    background-image: var(--bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    z-index: 1;
}

.portal-gateway-content{
    position: relative;
    z-index: 2;
    height: 100%;
    display: grid;
    grid-template-columns: var(--portal-gateway-nav-width) 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas:
        "nav stage"
        "footer footer";
}

.portal-gateway-nav{
    grid-area: nav;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    align-self: start;
    height: 70%;
    margin: 40px;
    padding: 12px;
    background: linear-gradient(160deg, rgba(20,17,12,0.58) 0%, rgba(10,9,7,0.68) 100%);
    backdrop-filter: blur(1.5px);
    border: 1px solid rgba(226, 193, 111, 0.35);
    border-radius: 18px;
    box-sizing: border-box;
    overflow: hidden;
}
.portal-gateway-nav-title{
    font-family: var(--font-display);
    color: var(--color-gold);
    font-size: 1.7rem;
    font-weight: 800;
    text-shadow: var(--text-shadow-black-outline);
    letter-spacing: 0.02em;
}
.portal-gateway-nav-subtitle{
    margin-top: -8px;
    color: var(--color-gameLight);
    opacity: 0.75;
    font-size: 0.82rem;
    line-height: 1.35;
}
.portal-gateway-nav-list{
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
    max-height: 244px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-gutter: stable;
}
/* "Very nice hover effect" (owner's own words) - a gold left rail that grows in from nothing, a
   warm background wash, and the label brightening/nudging right, all on the same easing so it
   reads as one fluid motion rather than several separate transitions firing at once. */
.portal-gateway-nav-item{
    position: relative;
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-gameLight);
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.portal-gateway-nav-item::before{
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--color-gold);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}
.portal-gateway-nav-item-label{
    font-family: var(--font-body);
    font-size: 1.02rem;
    transition: transform 0.2s ease, color 0.2s ease;
    text-shadow: var(--text-shadow-black-outline);
}
.portal-gateway-nav-item-chevron{
    color: var(--color-gold);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.portal-gateway-nav-item:hover,
.portal-gateway-nav-item.active{
    background: rgba(255, 215, 0, 0.10);
    border-color: rgba(226, 193, 111, 0.4);
}
.portal-gateway-nav-item:hover::before,
.portal-gateway-nav-item.active::before{
    transform: scaleY(1);
}
.portal-gateway-nav-item:hover .portal-gateway-nav-item-label,
.portal-gateway-nav-item.active .portal-gateway-nav-item-label{
    color: var(--color-gold);
    transform: translateX(3px);
}
.portal-gateway-nav-item:hover .portal-gateway-nav-item-chevron,
.portal-gateway-nav-item.active .portal-gateway-nav-item-chevron{
    opacity: 1;
    transform: translateX(0);
}

.portal-gateway-footer{
    grid-area: footer;
    display: flex;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 100%);
    border-top: 1px solid rgba(226, 193, 111, 0.35);
}
.portal-gateway-travel-button{
    position: relative;
    isolation: isolate;
    min-width: 280px;
    box-sizing: border-box;
    text-align: center;
    padding: 13px 52px;
    clip-path: polygon(0 50%, 18px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 18px 100%);
    background: linear-gradient(180deg, #f3d46a 0%, #a56f16 48%, #e3b83f 100%);
    border: 0;
    color: #f5dda0;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px #000, 0 0 8px rgba(236,185,61,0.25);
    cursor: pointer;
    filter: drop-shadow(0 4px 5px rgba(0,0,0,0.68)) drop-shadow(0 0 2px rgba(221,169,45,0.38));
    transition: transform 0.16s ease, filter 0.16s ease, letter-spacing 0.16s ease;
}
.portal-gateway-travel-button::before{
    content: "";
    position: absolute;
    inset: 2px;
    z-index: -1;
    clip-path: polygon(0 50%, 17px 0, calc(100% - 17px) 0, 100% 50%, calc(100% - 17px) 100%, 17px 100%);
    background:
        radial-gradient(circle at 20px 50%, #ffe487 0 2px, #7f5614 3px 4px, transparent 5px),
        radial-gradient(circle at calc(100% - 20px) 50%, #ffe487 0 2px, #7f5614 3px 4px, transparent 5px),
        linear-gradient(180deg, rgba(48,43,34,0.98), rgba(17,16,14,0.98));
    box-shadow: inset 0 0 12px rgba(223,171,45,0.16);
    pointer-events: none;
}
.portal-gateway-travel-button::after{
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(110deg,
        transparent 0%,
        transparent 38%,
        rgba(255, 246, 196, 0.08) 44%,
        rgba(255, 246, 196, 0.72) 50%,
        rgba(255, 219, 112, 0.12) 56%,
        transparent 62%,
        transparent 100%);
    transform: translateX(-145%);
    pointer-events: none;
}
.portal-gateway-travel-button:hover{
    filter: brightness(1.12) drop-shadow(0 6px 7px rgba(0,0,0,0.7)) drop-shadow(0 0 7px rgba(255,205,67,0.6));
    letter-spacing: 0.17em;
}
.portal-gateway-travel-button:hover::after{
    animation: portalTravelShimmer 0.85s ease-out;
}
@keyframes portalTravelShimmer{
    from{ transform: translateX(-145%); }
    to{ transform: translateX(145%); }
}
.portal-gateway-travel-button.disabled{
    filter: grayscale(80%) brightness(0.7);
    cursor: default;
    pointer-events: none;
    transform: none;
}
@media (max-width: 760px){
    .portal-gateway-frame{
        --portal-gateway-nav-width: 220px;
    }
    .portal-gateway-nav{ padding: 16px 12px; }
}

.spirit-anchor-wrapper{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}
.spirit-anchor-status{
    color: var(--color-gold);
    font-size: 0.9rem;
    opacity: 0.9;
    text-align: center;
    width: 100%;
}
.spirit-anchor-button{
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 15px;
    border-radius: 5px;
    background-color: rgba(20,15,10,0.78);
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
    cursor: pointer;
    transition: 0.15s all ease-in-out;
}
.spirit-anchor-button:hover{
    background-color: var(--color-gold);
    color: var(--color-gameDark);
}
.spirit-anchor-button.disabled{
    filter: grayscale(100%) brightness(0.7);
    cursor: default;
    pointer-events: none;
}

/* The Inn's Rest & Recover popup (owner request 2026-09-19, simplified 2026-09-19 per owner
   feedback - just flavor/cost/coins + Rest/Leave, no live vitals inside the popup itself; those
   moved to the always-visible game header and the bottom-left resting HUD below). Buttons reuse
   the spirit-anchor-button's own look. */
.inn-flavor{
    color: var(--color-gameLight);
    font-size: 0.82rem;
    font-style: normal;
    line-height: 1.35;
    margin-bottom: 10px;
}
.item-use-wrapper.inspect-frame.inn-popup-frame{
    width: min(90vw, 440px);
}
.inn-popup-frame .inspect-title-image{
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.inn-coin-balance{
    display: flex;
    align-items: center;
    align-self: center;
    gap: 6px;
    width: fit-content;
    margin: 0 auto 11px;
    padding: 4px 9px;
    border: 1px solid rgba(183,138,57,0.55);
    border-radius: 12px;
    background: rgba(20,15,10,0.48);
    color: #f0dfae;
    font-size: 0.78rem;
    font-weight: bold;
}
.inn-coin-icon{
    width: 18px;
    height: 18px;
    object-fit: contain;
}
/* NPC conversation (Talk, 2026-10-09) - the NPC's line, then the player's choices as a list. Lives
   inside the same NPC popup; the line keeps the inn-flavor look, choices read as spoken replies. */
.npc-dialog-stage{
    position: relative;
}
.npc-dialog-stage.npc-dialog-transitioning{
    overflow: hidden !important;
    box-sizing: border-box;
    pointer-events: none;
    transition: height 340ms cubic-bezier(0.2, 0.75, 0.25, 1);
}
.item-use-wrapper.inspect-frame.npc-dialog-frame-transitioning{
    transition: width 340ms cubic-bezier(0.2, 0.75, 0.25, 1);
}
.npc-dialog-transition-layer{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
    box-sizing: border-box;
}
.npc-dialog-transition-old{
    animation: npc-dialog-wipe-old 480ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
.npc-dialog-transition-new{
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    animation: npc-dialog-wipe-new 480ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
.npc-dialog-wipe-edge{
    position: absolute;
    z-index: 3;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background: rgba(255,215,0,0.82);
    box-shadow: 0 0 9px rgba(255,215,0,0.72);
    animation: npc-dialog-wipe-edge 480ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes npc-dialog-wipe-old{
    from{ clip-path: inset(0 0 0 0); opacity: 1; }
    to{ clip-path: inset(0 0 0 100%); opacity: 0.65; }
}
@keyframes npc-dialog-wipe-new{
    from{ clip-path: inset(0 100% 0 0); }
    to{ clip-path: inset(0 0 0 0); }
}
@keyframes npc-dialog-wipe-edge{
    from{ left: 0; opacity: 0; }
    10%{ opacity: 1; }
    90%{ opacity: 1; }
    to{ left: calc(100% - 2px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce){
    .npc-dialog-transition-old,
    .npc-dialog-transition-new,
    .npc-dialog-wipe-edge{
        animation: none;
    }
}
.npc-dialog-text{
    white-space: pre-line;
}
.npc-dialog-note{
    color: var(--color-gold);
    font-size: 0.78rem;
    margin-bottom: 8px;
}
.npc-dialog-options{
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 65%;
    box-sizing: border-box;
    margin-inline: auto;
}
.npc-dialog-options.busy{
    opacity: 0.6;
    pointer-events: none;
}
.npc-dialog-option{
    width: 100%;
    padding: 7px 10px;
    border: 1px solid rgba(255,215,0,0.35);
    border-radius: 6px;
    background: rgba(0,0,0,0.25);
    color: var(--color-gameLight);
    font: inherit;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease;
}
.npc-dialog-option:hover:not(.disabled){
    border-color: var(--color-gold);
    color: var(--color-gold);
}
.npc-dialog-option.disabled{
    opacity: 0.5;
    cursor: default;
}
@media (max-width: 520px){
    .npc-dialog-options{ width: 100%; }
}
.npc-dialog-explanation{
    margin: -3px 0 2px 10px;
    color: var(--color-gameSlate);
    font-size: 0.75rem;
    font-style: italic;
}
.inn-status{
    color: var(--color-gold);
    font-weight: bold;
    margin-bottom: 6px;
    text-align: center;
}
.inn-button-row{
    display: flex;
    gap: 10px;
}
.npc-service-button-row{
    flex-wrap: wrap;
}
.inn-rest-button, .inn-leave-button{
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
    padding: 10px 15px;
    border-radius: 5px;
    background-color: rgba(20,15,10,0.78);
    cursor: pointer;
    transition: 0.15s all ease-in-out;
}
.npc-service-button{
    flex: 1 1 112px;
    min-width: 0;
    padding: 9px 12px;
    white-space: nowrap;
}
.npc-service-icon{
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    object-fit: contain;
}
.npc-service-icon-glyph{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}
.npc-service-button .inn-button-label,
.npc-service-cost{
    flex: 0 0 auto;
    white-space: nowrap;
}
.npc-service-cost .inn-coin-icon{
    flex: 0 0 17px;
    max-width: 17px;
    max-height: 17px;
}
.inn-rest-button{
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
}
.inn-rest-button:hover{
    background-color: var(--color-gold);
    color: var(--color-gameDark);
}
.inn-rest-cost{
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding-left: 7px;
    border-left: 1px solid currentColor;
    font-size: 0.8rem;
    font-weight: bold;
}
.inn-rest-cost .inn-coin-icon{
    width: 17px;
    height: 17px;
}
.inn-rest-button.disabled{
    filter: grayscale(100%) brightness(0.7);
    cursor: default;
    pointer-events: none;
}
.inn-leave-button{
    color: var(--color-gameLight);
    border: 1px solid #756b5c;
}
.inn-leave-button:hover{
    background-color: #756b5c;
    color: var(--color-gameLight);
}
.inn-leave-icon{
    font-size: 1.15rem;
    line-height: 1;
}

/* Merchant category tabs + empty-list note - shared by the player's shop popup and the NPCs
   dashboard. Moved here from dashboards.css (2026-10-12), which now only loads with devtools. */
.npcs-dashboard-shop-tabs{
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}
.npcs-dashboard-shop-tab{
    padding: 6px 12px;
    border-radius: 5px;
    border: 1px solid #756b5c;
    background: linear-gradient(180deg, #414141, #292929);
    color: var(--color-gameLight);
    cursor: pointer;
    font-size: 0.85rem;
}
.npcs-dashboard-shop-tab.active{
    background: linear-gradient(180deg, #263c8f, #101d66);
    border-color: var(--color-gold);
}
.npcs-dashboard-empty-list{
    padding: 14px 8px;
    color: rgba(255,255,255,0.55);
    font-size: 0.82rem;
    font-style: italic;
    text-align: center;
}

/* Merchant shop screen (owner request 2026-09-19/20: mimic the real inventory screen - merchant's
   stock tiles on top, hero's own bag tiles below). .npc-shop-frame widens openInspectPopup()'s
   shared shell past its default 420px (same extraClass technique .overworld2-minimap-modal
   already uses above), tall enough for two tile grids instead of one short item description.
   position:fixed with an explicit top (owner request 2026-09-20: "fixed positioning near the top
   of the town screen... it keeps adjusting the size of the window and it is a big jarring") takes
   the frame out of the overlay's own centering flow entirely - .itemUseOverlay's align-items/
   justify-content:center (shared by every other popup, so not changed) only affects elements
   still in normal flow, so a fixed-position child ignores it and simply anchors at `top` instead
   of recentering (and thus visibly jumping) every time its own height changes between tabs. */
.item-use-wrapper.inspect-frame.npc-shop-frame{
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: min(94vw, 1200px);
    max-width: none;
    max-height: calc(100vh - 110px);
}
.npc-shop-frame .item-use-inspect-details{
    max-height: calc(100vh - 210px);
    align-items: stretch;
    /* This is the merchant/stash vertical scroller. Keep tabs and their outer selection
       glow away from its clipping edge without increasing the popup's dimensions. */
    box-sizing: border-box;
    padding: 8px;
}
.npc-shop-body{
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}
.npc-shop-panel{
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.npc-shop-panel-title{
    color: var(--color-gold);
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
    border-bottom: 1px solid rgba(183,138,57,0.5);
    padding-bottom: 4px;
}
.npc-shop-coins{
    color: var(--color-gold);
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
    text-align: right;
}
.npc-shop-tile-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    /* Each grid scrolls independently, so it needs its own room for item auras. */
    box-sizing: border-box;
    padding: 8px;
}
/* Merchant's own stock grid (owner request 2026-09-20) - a true FIXED height (not just a cap), so
   the box never shrinks for a sparse tab either - exactly 2 rows of the real 52px tile (50px + 1px
   border each side) would need 2*52 + 1 row-gap(8) + top/bottom padding(8) = 120px; +10px beyond
   that so a 3rd row (when one exists) peeks in as a visible "there's more, scroll" hint instead of
   being fully hidden. flex-shrink:0 keeps .npc-shop-panel (a flex column) from compressing it. */
.npc-shop-tile-grid-compact{
    height: 130px;
    flex-shrink: 0;
}

/* Resting HUD. Town places it in the footer beside Leave Town; the absolute rule remains the
   safe fallback for older/partial town layouts. Bedroll screens use the inline variant below. */
.inn-rest-hud{
    position: absolute;
    left: 20px;
    bottom: 20px;
    width: 260px;
    padding: 10px 14px;
    border-radius: 8px;
    background-color: rgba(20,15,10,0.82);
    border: 1px solid var(--color-gold);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    z-index: 5;
}
/* A bedroll rest on the overworld / in a dungeon (2026-10-31): in the page flow under the info bar. */
.inn-rest-hud.inn-rest-hud-inline{
    position: static;
    width: auto;
    max-width: 320px;
}
.inn-rest-hud.inn-rest-hud-town-footer{
    position:static;
    flex:0 1 290px;
    width:290px;
    min-width:220px;
    padding:8px 14px;
    box-sizing:border-box;
}
@media (max-width:620px){
    .game-content-travel .town-utilities > .town-action-grid{ flex-wrap:wrap; }
    .inn-rest-hud.inn-rest-hud-town-footer{ flex:1 1 220px; width:auto; min-width:0; }
    .game-content-travel .town-utilities .town-action-leave-town{ flex:1 1 260px; width:auto; }
}
.inn-rest-hud-label{
    color: var(--color-gold);
    font-size: 0.78rem;
    font-weight: bold;
    margin-bottom: 6px;
    text-align: center;
}
.inn-progress-bar{
    position: relative;
    width: 100%;
    height: 14px;
    border-radius: 999px;
    border: 2px solid var(--color-gold);
    background-color: var(--color-gameDark);
    box-shadow: inset 0 0 6px rgba(0,0,0,0.6);
    overflow: hidden;
}
.inn-progress-bar-fill{
    --pct: 0%;
    height: 100%;
    width: var(--pct);
    background: linear-gradient(180deg, #ffe08a 0%, var(--color-gold) 100%);
    transition: 1.15s width ease-in-out;
}


.overworld-wrapper{
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(900px, 100%);
    margin: 0 auto;
    color: var(--color-gameLight);
}
.overworld-info-bar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background-color: var(--color-gameSlate);
    border-radius: 5px;
    padding: 10px 15px;
}
.overworld-info-text{
    text-align: left;
}
.overworld-title{
    font-size: 1.3rem;
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
}
.overworld-flavor{
    font-size: 0.85rem;
    opacity: 0.85;
}
.overworld-hunt-button{
    flex-shrink: 0;
    padding: 10px 22px;
    border-radius: 5px;
    background-color: var(--color-gold);
    color: var(--color-gameDark);
    font-weight: bold;
    border: 1px solid var(--color-gold);
    cursor: pointer;
    transition: 0.15s all ease-in-out;
}
.overworld-hunt-button:hover{
    filter: brightness(1.1);
}
.overworld-hunt-button.disabled{
    filter: grayscale(100%) brightness(0.7);
    cursor: default;
    pointer-events: none;
}
.overworld-map-stage{
    position: relative;
    width: 100%;
    aspect-ratio: 1402 / 1122;
    border-radius: 6px;
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 0 1px var(--color-gameSlate), 0 15px 40px -15px rgba(0,0,0,0.8);
    overflow: hidden;
}
.overworld2-map-stage{
    background-color: #071519;
    background-image:
        radial-gradient(ellipse at 18% 20%, rgba(37, 88, 94, 0.5), transparent 48%),
        radial-gradient(ellipse at 82% 72%, rgba(23, 62, 69, 0.55), transparent 52%),
        repeating-linear-gradient(125deg, rgba(190, 222, 218, 0.025) 0 1px, transparent 1px 9px);
    background-size: auto;
    background-position: center;
}
/* Region background art (owner request 2026-10-02/10-03) - a separate layer rather than the
   stage's own background-image, since background-image itself can't be CSS-transitioned; this
   fades its own opacity instead, revealing/covering .overworld2-map-stage's gradient above
   underneath it. Opacity is set entirely in JS (renderDungeonUI, scripts/hunt_travel_quest.js) -
   no default here, so a fresh render with no previous state to FLIP from doesn't flash at some
   unintended starting opacity before JS sets the real one. */
.dungeon-region-art-overlay{
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    pointer-events: none;
}
/* "Camera catching up to the character" movement transition (owner request 2026-10-02) - the
   map and every pin/marker pan together as one unit, so a single transition on THIS element's own
   transform animates the whole scene in lockstep and they can never visibly drift apart from each
   other mid-pan. Zero-size by design - it's a pure transform anchor, not a visual box;
   .overworld2-map-layer/.dungeon-view-map-layer/.overworld-pin/.dungeon-view-marker keep their
   own real left/top values, now relative to THIS origin instead of the stage's. See
   playCameraPanTransition() (hunt_travel_quest.js) for the transition itself - this class carries
   no transition of its own, since a fresh/jump render (no step) must never animate. */
.overworld-world-layer{
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
}
.overworld2-map-layer{
    position: absolute;
    pointer-events: none;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    -webkit-mask-image:
        linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent),
        linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 28px), transparent);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent),
        linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 28px), transparent);
    mask-composite: intersect;
}
.overworld-hero-marker{
    position: absolute;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    /* The same dedicated race/gender/class icon token is used by both overworld and dungeon
       renderers. The source assets are already square face crops, so no positional guesswork is
       needed here. */
    border: 1px solid var(--color-gold);
    background-color: var(--color-gameDark);
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 0 1px rgba(0,0,0,.72), 0 0 7px 2px rgba(255,215,0,.42);
}
.overworld-pin{
    position: absolute;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.6);
    cursor: default;
    transition: transform 0.12s ease-in-out, opacity 0.15s;
    opacity: 0.55;
}
.overworld-pin.in-range{
    opacity: 1;
    cursor: pointer;
}
.overworld-pin.in-range:hover{
    transform: scale(1.4);
}
.overworld-pin.disabled{
    filter: grayscale(60%);
    pointer-events: none;
}
.overworld-pin.dungeon-pin{
    background-color: #c0504d;
}
.overworld-pin.npc-pin{
    background-color: #5a9ec0;
}
.dungeon-explore-prompt{
    color: rgba(240,233,242,.78);
    font-size: 0.85rem;
    text-align: center;
    padding: 2px 4px 10px;
}
/* A Lockable entity that's Locked (2026-10-11). */
.dungeon-explore-locked{
    color: #e0b26a;
    font-size: 0.85rem;
    text-align: center;
    padding: 0 4px 10px;
}
.dungeon-entity-action-options{
    width: 65%;
}
.dungeon-entity-action-option{
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 36px;
}
.dungeon-entity-action-key-image{
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.dungeon-entity-action-item-icon{
    position: relative;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
}
.dungeon-entity-action-label{
    min-width: 0;
}
@media (max-width: 520px){
    .dungeon-entity-action-options{ width: 100%; }
}
/* Player-facing dungeon view (DUNGEONS\Prompt 7's first slice) - same centered/zoomed-camera
   stage chrome as the overworld (.overworld-map-stage/.overworld2-map-stage, reused directly so
   this never needs its own sizing rule), just with its own map layer positioned in pixels-per-
   grid-cell instead of percent-of-world (see renderDungeonUI/DUNGEON_VIEW_CELLS_ACROSS). */
.dungeon-view-map-layer{
    position: absolute;
    pointer-events: none;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}
/* Fog of war (2026-10-11) - the dimming layer for remembered-but-not-visible squares; one canvas
   pixel per grid square, stretched over the floorplan so each edge fades softly. Never-seen squares
   are handled by a mask on .dungeon-view-map-layer instead (set in drawDungeonFog). Sits between
   the map and the markers. */
.dungeon-view-fog{
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}
.dungeon-view-map-canvas{
    display: block;
    width: 100%;
    height: 100%;
}
.dungeon-view-marker.fogged{
    opacity: 0.45;
    filter: grayscale(0.6);
}
.dungeon-view-marker{
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
    /* Above every hero token - yours (z-index 2 when standing on others) and other players' - so standing on an NPC
       or object never hides it (owner request 2026-11-06). A chat bubble still lifts its marker to 20. */
    z-index: 3;
}
.dungeon-view-marker.has-chat-bubble{
    z-index: 20;
}
.dungeon-view-marker.in-range{
    pointer-events: auto;
    cursor: pointer;
}
.dungeon-view-marker.in-range .dungeon-view-marker-dot{
    background-color: var(--color-gold);
    box-shadow: 0 0 6px 2px rgba(255,215,0,0.6);
}
.dungeon-view-marker.in-range:hover .dungeon-view-marker-dot,
.dungeon-view-marker.in-range:hover .dungeon-view-marker-icon{
    filter: brightness(1.12);
}
.dungeon-view-marker-dot{
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.7);
    background-color: var(--color-gameSlate);
    transition: filter 0.12s ease-in-out;
}
.dungeon-view-marker-icon{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.7);
    background-color: var(--color-gameDark);
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
    transition: filter 0.12s ease-in-out, border-color 0.12s ease-in-out, box-shadow 0.12s ease-in-out;
}
.dungeon-view-marker.in-range .dungeon-view-marker-icon{
    border-color: var(--color-gold);
    box-shadow: 0 0 5px 1px rgba(255,215,0,0.5);
}
/* Hangs under the icon OUTSIDE the marker's own box, so the translate(-50%,-50%) above centers the
   ICON on its tile (owner report 2026-10-08: entities sat a few pixels higher than the hero, whose
   marker has no label - the label's height was being counted into the centering). */
.dungeon-view-marker-label{
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(240,233,242,.85);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    white-space: nowrap;
}
/* RevealOnApproach poof (owner request 2026-10-13, playDungeonRevealPoofs() in world_map.js) - a
   revealed entity fades up out of a puff of smoke; a hidden one leaves a fading ghost behind one. */
.dungeon-view-marker-reveal-in{
    animation: dungeon-reveal-in 420ms ease-out 90ms both;
}
.dungeon-view-marker-reveal-out{
    animation: dungeon-reveal-out 380ms ease-in forwards;
}
@keyframes dungeon-reveal-in{
    from{ opacity: 0; transform: translate(-50%, -50%) scale(0.55); filter: blur(3px); }
    to{ opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; }
}
@keyframes dungeon-reveal-out{
    from{ opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; }
    to{ opacity: 0; transform: translate(-50%, -50%) scale(1.2); filter: blur(3px); }
}
.dungeon-view-poof{
    position: absolute;
    width: 0;
    height: 0;
    z-index: 15;
    pointer-events: none;
}
.dungeon-view-poof-puff{
    position: absolute;
    left: -14px;
    top: -14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,226,214,0.9) 0%, rgba(178,170,158,0.55) 50%, rgba(120,114,104,0) 72%);
    opacity: 0;
    animation: dungeon-poof-puff 720ms ease-out both;
}
.dungeon-view-poof-core{
    left: -22px;
    top: -22px;
    width: 44px;
    height: 44px;
    --dx: 0px;
    --dy: 0px;
}
@keyframes dungeon-poof-puff{
    0%{ opacity: 0.95; transform: translate(0, 0) scale(0.35); }
    60%{ opacity: 0.6; }
    100%{ opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.7); }
}
@media (prefers-reduced-motion: reduce){
    .dungeon-view-poof{ display: none; }
    .dungeon-view-marker-reveal-in, .dungeon-view-marker-reveal-out{ animation-duration: 1ms; animation-delay: 0ms; }
}
/* ProximityTrigger ambient-text chat bubble (owner request 2026-10-06) - a child of the NPC's own
   .dungeon-view-marker (itself already translate(-50%,-50%) centered on its map cell), so the
   bubble's own position math only has to account for ITS offset from the marker, never the map's
   pan/zoom. Defaults above; dungeonRenderChatBubbleOnMarker (hunt_travel_quest.js) adds .below when
   the stage would otherwise clip it off the top, and sets --bubble-shift-x when it would clip off
   the left/right edge instead. No auto-dismiss timer (owner report 2026-10-06: "it needs to stay
   until I close it or walk away") - clickable (pointer-events: auto) so the whole bubble, not just
   a separate close control, dismisses it; dismissal is otherwise purely distance-based, handled
   in JS. Hover/focus treatment and a native title provide unobtrusive discoverability. */
.dungeon-view-chat-bubble{
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translateX(calc(-50% + var(--bubble-shift-x, 0px)));
    min-width: 105px;
    max-width: 280px;
    width: max-content;
    padding: 10px 15px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(35,31,27,0.98), rgba(16,13,11,0.97));
    border: 1px solid rgba(255,215,0,0.82);
    box-shadow: 0 5px 16px rgba(0,0,0,0.62), inset 0 1px rgba(255,255,255,0.06);
    pointer-events: auto;
    cursor: pointer;
    z-index: 6;
    opacity: 0;
    animation: dungeonChatBubbleIn 180ms ease-out forwards;
    transition: border-color 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
.dungeon-view-chat-bubble:hover,
.dungeon-view-chat-bubble:focus-visible{
    border-color: var(--color-gold);
    box-shadow: 0 6px 20px rgba(0,0,0,0.68), 0 0 8px rgba(255,215,0,0.22), inset 0 1px rgba(255,255,255,0.08);
    filter: brightness(1.08);
    outline: none;
}
.dungeon-view-chat-bubble.below{
    bottom: auto;
    top: calc(100% + 26px); /* clears the name label hanging under the icon */
}
/* Suppresses the entrance fade-in for a bubble that's merely surviving a marker-layer rebuild
   (renderDungeonUI runs on every move/poll/interaction) rather than genuinely appearing for the
   first time - see dungeonRenderChatBubbleOnMarker's own $animate comment. */
.dungeon-view-chat-bubble.no-enter-animation{
    animation: none;
    opacity: 1;
}
.dungeon-view-chat-bubble::after{
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(calc(-50% - var(--bubble-shift-x, 0px)));
    width: 0;
    height: 0;
    border: 7px solid transparent;
}
.dungeon-view-chat-bubble:not(.below)::after{
    top: 100%;
    border-top-color: var(--color-gold);
}
.dungeon-view-chat-bubble.below::after{
    bottom: 100%;
    border-bottom-color: var(--color-gold);
}
.dungeon-view-chat-bubble-text{
    font-size: 15px;
    font-weight: normal;
    line-height: 1.3;
    font-style: normal;
    color: rgba(240,233,242,.95);
    text-align: center;
}
@keyframes dungeonChatBubbleIn{
    from{ opacity: 0; transform: translateX(calc(-50% + var(--bubble-shift-x, 0px))) translateY(4px); }
    to{ opacity: 1; transform: translateX(calc(-50% + var(--bubble-shift-x, 0px))) translateY(0); }
}
/* Centered travel view's minimap (renderOverworld2UI, hunt_travel_quest.js) - a small plain-image
   orientation reference in the map's own corner, same "controls float on the stage" idiom
   .overworld-direction-button already uses. Deliberately no hero dot/pins here or in its
   expanded view - just the picture, per explicit request. */
/* A normal flex item in .overworld-info-bar now (far right, past Hunt - space-between there
   already pushes a 3rd child all the way to the edge) rather than absolutely positioned on a
   corner of the map stage, where it used to cover the SE direction button. Sized to the info
   bar's own scale (roughly Hunt-button height), not the stage-corner-widget size it had before. */
.overworld2-minimap{
    flex-shrink: 0;
    width: 56px;
    aspect-ratio: 1402 / 1122;
    border-radius: 4px;
    border: 1px solid var(--color-gameDark);
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.12s ease-in-out;
}
.overworld2-minimap:hover{
    transform: scale(1.08);
}
/* The expanded view's content, inside openInspectPopup()'s shared shell - just a bigger plain
   picture, no pins/hero dot, same as the small minimap it was opened from. width:100% (of
   .item-use-inspect-details, the popup's own content area) rather than an independent
   min(80vw,700px) - that ignored .item-use-wrapper.inspect-frame's own max-width:420px, so the
   image rendered wider than the popup card actually was and overflowed off past the card's own
   edge instead of just filling it. */
.overworld2-minimap-expanded-image{
    width: 100%;
    aspect-ratio: 1402 / 1122;
    border-radius: 6px;
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
}
/* openInspectPopup()'s extraClass option (attributes_skills_inventory.js) - overrides
   .item-use-wrapper.inspect-frame's own max-width:420px (sized for a small item description,
   not a map) just for this one popup. All 3 classes together, matching that base rule's own
   specificity plus one, so this reliably wins regardless of the two rules' source order. */
.item-use-wrapper.inspect-frame.overworld2-minimap-modal{
    width: min(90vw, 1100px);
    max-width: none;
}
/* Nav buttons sit directly on the map's own border (edges/corners) instead of a
   separate control block, so the overworld screen never grows taller than the map itself. */
.overworld-direction-button{
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    background-color: rgba(120,109,95,0.75);
    color: var(--color-gameLight);
    border: 1px solid rgba(0,0,0,0.5);
    border-radius: 6px;
    cursor: pointer;
    backdrop-filter: blur(1px);
    transition: 0.15s all ease-in-out;
    /* No z-index here on purpose - these buttons are appended to the DOM after the town
       pins, which already puts them on top visually. A z-index here previously escaped
       .game-content-overlay's stacking context entirely and let these render on top of the
       combat modal - see that rule's own z-index for the real fix. */
}
.overworld-direction-button:hover{
    background-color: var(--color-gold);
    color: var(--color-gameDark);
}
.overworld-direction-button.disabled{
    filter: grayscale(100%) brightness(0.5);
    cursor: default;
    pointer-events: none;
}
.overworld-direction-button.N{ top: 10px; left: 50%; transform: translateX(-50%); }
.overworld-direction-button.S{ bottom: 10px; left: 50%; transform: translateX(-50%); }
.overworld-direction-button.E{ right: 10px; top: 50%; transform: translateY(-50%); }
.overworld-direction-button.W{ left: 10px; top: 50%; transform: translateY(-50%); }
.overworld-direction-button.NE{ top: 10px; right: 10px; }
.overworld-direction-button.NW{ top: 10px; left: 10px; }
.overworld-direction-button.SE{ bottom: 10px; right: 10px; }
.overworld-direction-button.SW{ bottom: 10px; left: 10px; }

.combat-turn-order-shell{
    --turn-card-width:50px;
    --turn-card-gap:5px;
    position:relative;
    box-sizing:border-box;
    flex:0 0 auto;
    align-self:center;
    /* 20 cards (50px) + 19 gaps (5px), plus the two controls and shell spacing. Keeping
       this exact prevents page two from landing a few pixels off page one's starting edge. */
    width:min(1171px,calc(100% - 110px));
    min-width:0;
    display:grid;
    grid-template-columns:28px minmax(0,1fr) 28px;
    align-items:center;
    gap:4px;
    margin-bottom:10px;
    padding:5px;
    border:0 solid rgba(128,128,128,.72);
    border-width:0 1px 1px;
    border-radius:0 0 5px 5px;
}
.combat-turn-order-viewport{
    min-width:0;
    overflow:hidden;
}
.combat-turn-order-main-wrapper{
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap:5px;
    width:max-content;
    transform:translateX(0);
    will-change:transform;
}
.combat-turn-order-main-wrapper.paging{
    transition:transform 280ms cubic-bezier(.22,.61,.36,1);
}
.combat-turn-order-main-wrapper > * {
    flex-shrink: 0;
}
.combat-turn-order-page{
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid rgba(183,138,57,.22);
    border-radius:5px;
    background:rgba(18,16,13,.38);
    color:rgba(240,212,125,.72);
    font-family:var(--font-ui);
    cursor:pointer;
}
.combat-turn-order-page{
    width:28px;
    height:48px;
    padding:0;
    font-size:24px;
}
.combat-turn-order-page:hover:not(:disabled),
.combat-turn-order-page:focus-visible{ border-color:rgba(183,138,57,.6);background:rgba(70,53,22,.58);color:var(--color-gold);outline:none; }
.combat-turn-order-page:disabled{ opacity:.2;cursor:default; }
@media (max-width:1150px){.combat-turn-order-shell{ width:calc(100% - 90px); }}

.combat-mob-main-wrapper{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-content:flex-start;
    align-self:center;
    gap:20px;
    /* Eight 124px cards (120px portrait + borders) and seven 20px gaps. Capping the
       centered wrapper here makes the 12-enemy encounter wrap predictably as 8 + 4. */
    width:min(calc(100% - 50px), 1132px);
    height: -webkit-fill-available;
    position: relative; /* anchors .combat-clear-targets */
}
/* Clear every target pick (2026-10-16) - top-right of the enemy row, only while something is picked. */
.combat-clear-targets{
    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
    padding: 2px 8px;
    border: 1px solid #3a2a0c;
    border-radius: 10px;
    background: linear-gradient(180deg, #cdb779, #8f7434);
    color: #2a1d06;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.combat-clear-targets[hidden]{ display: none; }
.combat-hero-main-wrapper{
    display: flex;
    align-items:flex-end;
    gap:10px;
    align-self:center;
    position: relative; /* anchors .combat-zone-wrapper below, which floats above mainHand (the row's first child) without affecting this row's own layout */
}

/* Party UI (owner request 2026-09-26/27) - a friendly non-hero actor (today: summonCreature's own
   result). Empty (0 height, no gap taken) until a summon actually joins the fight - only ever
   gains children via renderPartyMemberCard() (hunt_travel_quest.js), never up front the way
   .combat-mob-main-wrapper's own mobs.forEach() build does. Pinned to the BOTTOM-right corner of
   #actionOverlay (.game-content-overlay is `position:absolute`, so it's the positioned ancestor
   this measures against - owner: "the bear is at the top right, it needs to be on the bottom") -
   out of normal flow entirely so it never disturbs mobWrapper/heroWrapper spacing. Fills
   right-to-left, up to 5 per row (owner: "fill in horizontally, up to 5... fill up right to
   left") via a `direction:rtl` grid; each card gets `direction:ltr` back so its own text/icons
   aren't mirrored. Green border (vs. .combat-mob-block's red) is the one deliberate visual
   distinction from an enemy mob card - gold/yellow is reserved for "selected" elsewhere in combat,
   so it's avoided here - everything else (vital bar classes, corner radius language, click-to-
   target/.target styling) is shared verbatim, since a party member is just as targetable (for a
   friendly spell/ability) as an enemy mob is for an attack. */
.combat-party-main-wrapper{
    position: absolute;
    bottom: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(5, auto);
    direction: rtl;
    gap: 12px;
}
.combat-party-main-wrapper:empty{
    display: none;
}
.combat-party-block{
    position: relative; /* anchors .combat-status-icons-left/-right (renderMobStatusIcons()) */
    direction: ltr;
    border-radius: 18px 18px 5px 5px;
    border: 2px solid var(--color-green, #4CAF50);
    transition: 0.15s all ease-in-out;
    display: flex;
    flex-shrink: 0;
    height: fit-content;
    flex-direction: column;
    align-items: center;
    padding: 4px 6px 6px;
    cursor: pointer;
}
.combat-party-block.target{
    border-color: gold;
}
.combat-party-block.dead{
    border-color: black;
    transition: all 1.0s ease-out;
    box-shadow:
        0 0 0 0 black,
        0 0 20px 15px rgba(0, 0, 0, 1.0);
    opacity: 0.5;
}
.combat-party-block.dead .combat-party-block-image{
    background-image: url("../images/monsters/dead.webp");
}
.combat-party-block.dead.target,
.combat-mob-block.dead.target{
    border-color:#c895ff;
    outline:2px solid rgba(91,214,255,.9);
    outline-offset:2px;
    box-shadow:
        0 0 0 1px rgba(20,8,30,.95),
        0 0 12px 4px rgba(154,86,220,.8),
        inset 0 0 9px rgba(91,214,255,.28);
    opacity:.92;
    cursor:crosshair;
}
.combat-party-block.dead.target::after,
.combat-mob-block.dead.target::after{
    content:"CORPSE TARGET";
    position:absolute;
    z-index:6;
    left:50%;
    bottom:-10px;
    transform:translateX(-50%);
    padding:2px 5px;
    border:1px solid #c895ff;
    border-radius:7px;
    background:#17101d;
    color:#dff7ff;
    box-shadow:0 0 6px rgba(154,86,220,.85);
    font-size:7px;
    font-weight:bold;
    line-height:1;
    letter-spacing:.35px;
    white-space:nowrap;
    pointer-events:none;
}
.combat-party-block.highlight{
    transition: box-shadow 0.15s ease-out;
    box-shadow:
        0 0 0 0 gold,
        0 0 16px 10px rgba(201, 165, 68, 0.75);
}
.combat-party-block-image{
    margin-bottom: 4px;
    text-align: center;
    display: flex;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    color: var(--color-gameLight);
    background-image: var(--bg);
    background-color: var(--color-gameDark);
    background-repeat: no-repeat;
    background-size: 72px;
    justify-content: center;
}
.combat-party-block-name{
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--color-gameLight);
    text-align: center;
    margin-bottom: 3px;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.combat-party-block .combat-mob-block-vital{
    width: 90px;
}
/* Shared anchor for BOTH the Combat Log panel and the Hit Location zone selector below it (owner
   request 2026-09-28: "add a combat log... above the hit location") - one position:absolute column
   stacked via normal flex flow, instead of each panel guessing the other's rendered height to avoid
   overlapping. Hit Location is still conditionally built (hero.equipment.mainHand gate,
   hunt_travel_quest.js) - the Combat Log panel is always present regardless, so this column is
   built unconditionally and both panels become its ordinary flow children. */
.combat-hit-location-column{
    /* --zone-gold: a toned-down "old gold" instead of --color-gold's #FFD700 - that read as too
       vivid for this small element specifically; other uses of --color-gold are left alone. */
    --zone-gold: #C9A544;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0; /* flush with mainHand's own left edge (mainHand is always this row's first child) - anchoring from the left instead of centering with a negative transform is what was running off the page when heroWrapper sits near the screen edge */
    width: 128px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}
.combat-zone-wrapper{
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.combat-zone-title{
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--zone-gold);
    white-space: nowrap;
}
.combat-zone-title::before,
.combat-zone-title::after{
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--zone-gold);
}
/* Low / Mid / High with the Two-Weapon Fighting toggle hung just outside to their right (2026-10-17)
   - the Hit Location column is a fixed 128px, so the toggle mustn't take any of that width. */
.combat-zone-row{
    position: relative;
}
.combat-two-weapon-toggle{
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(100% + 4px);
    white-space: nowrap;
    padding: 0 7px;
    border: 1px solid var(--zone-gold);
    border-radius: 999px;
    background: var(--color-gameDark);
    color: #cfc8b5;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: bold;
    cursor: pointer;
}
.combat-two-weapon-toggle:hover,
.combat-two-weapon-toggle:focus-visible{
    color: #fff1a4;
    border-color: var(--color-gold);
    outline: none;
}
.combat-two-weapon-toggle.active{
    color: #fff7bd;
    border-color: var(--color-gold);
    background: linear-gradient(90deg, #55410e, #242018, #7b6117);
    background-size: 220% 100%;
    box-shadow: 0 0 9px rgba(255,215,0,.68), inset 0 0 7px rgba(255,239,143,.24);
    animation: combat-auto-shimmer 1.65s linear infinite;
}
.combat-zone-select{
    display: flex;
    border: 1px solid var(--zone-gold);
    border-radius: 999px;
    overflow: hidden;
}
.combat-zone-button{
    flex: 1;
    text-align: center;
    padding: 4px 5px;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background-color: var(--color-gameDark);
    color: var(--color-gameLight);
    cursor: pointer;
    transition: 0.1s all ease-in-out;
    position: relative;
    border-left: 1px solid var(--zone-gold);
}
.combat-zone-button:first-child{
    border-left: none;
}
.combat-zone-button:hover{
    background-color: darkgreen;
}
.combat-zone-button.selected{
    background-color: var(--zone-gold);
    color: #1a1200;
}

/* Combat Log (owner request 2026-09-28) - reuses .combat-zone-title's own gold-divider header
   style (see combatLogHeader's own classList, hunt_travel_quest.js) plus this file's shared
   --zone-gold custom property (now defined on .combat-hit-location-column, the ancestor both this
   panel and .combat-zone-wrapper sit inside). */
.combat-log-panel{
    /* Owner request 2026-09-28: "we can tripple the width and double the height... we have lot of
       space available" - explicit width override (the shared .combat-hit-location-column it sits
       in is only 128px, sized for Hit Location below it) rather than stretching to match that
       column; same font size as before, just more room to breathe/fewer truncated entries. */
    width: 384px;
    background-color: rgba(0,0,0,.35);
    border: 1px solid var(--zone-gold);
    border-radius: 8px;
    padding: 6px 8px;
}
/* Kept intact as a rollback path while its summaries and detail viewer are presented in Chat. */
.combat-log-legacy{ display:none; }
.combat-log-maximize-button{
    flex: 0 0 auto;
    font-size: 0.62rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--zone-gold);
    cursor: pointer;
    white-space: nowrap;
    padding: 1px 5px;
    border: 1px solid var(--zone-gold);
    border-radius: 999px;
}
.combat-log-maximize-button:hover{
    background-color: var(--zone-gold);
    color: #1a1200;
}
.combat-log-entries{
    display: flex;
    flex-direction: column;
    gap: 3px;
}
/* Only the maximized view scrolls/grows tall - the default collapsed view (last 6 entries) is
   always exactly as tall as its own content. Doubled from 220px alongside the panel's own width
   (owner request 2026-09-28). */
.combat-log-panel.maximized .combat-log-entries{
    max-height: 440px;
    overflow-y: auto;
}
.combat-log-empty{
    opacity: 0.6;
    font-size: 0.72rem;
    font-style: italic;
}
.combat-log-entry{
    display: flex;
    align-items: flex-start;
    gap: 5px;
}
.combat-log-entry-text{
    /* Owner request 2026-09-29: "not cut off with the ellipsis... wrap to the next row" - was
       nowrap+ellipsis, now wraps normally (the panel is wide enough now that this is rare). */
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--color-gameLight);
    white-space: normal;
    overflow-wrap: break-word;
}
.combat-log-entry-details-button{
    flex: 0 0 auto;
    margin-top: 1px;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0.75;
}
.combat-log-entry-details-button:hover{
    opacity: 1;
}
/* The verbose popout's own content (combatLogEntryDetailPopup(), hunt_travel_quest.js) - the exact
   same <br>-joined HTML block the Debug Log already renders, just inside .item-use-wrapper's shell
   instead. Left-aligned/readable rather than that wrapper's own default centered prompt text. */
.combat-log-detail-content{
    text-align: left;
    line-height: 1.5;
    font-size: 0.85rem;
    max-height: 50vh;
    overflow-y: auto;
    margin: 10px 0;
}
.game-content-overlay.combat-log-detail-overlay{ z-index:920; }

.combat-mob-block{
    position: relative; /* anchors .combat-status-icons-left/-right (renderMobStatusIcons()) */
    border-radius: 25px 25px 5px 5px;
    border:2px solid red;
    transition: 0.15s all ease-in-out;
    display: flex;
    flex-shrink: 0;
    height: fit-content;
    flex-direction: column;
    overflow: none;
    padding: 0px 0px 2px 0px;
}
.combat-mob-block.target{
    border-color:gold;
}
/* Targeting priority (owner request 2026-10-14, setManualTarget() in combat.js): #2 and #3 get a
   softer gold border; each pick's number sits at the top centre of its card's border. */
.combat-mob-block.target-priority,
.combat-party-block.target-priority{
    border-color: rgba(255,215,0,0.55);
}
.combat-target-priority{
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #3a2a0c;
    background: linear-gradient(180deg, #f2d27a, #c9962f);
    color: #2a1d06;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.7);
    pointer-events: none;
}
.target-priority > .combat-target-priority{
    background: linear-gradient(180deg, #cdb779, #8f7434);
}
/* An ability still cooling down (combat abilities bar) - greyed, the turns left over it. */
.combat-hero-ability.on-cooldown{
    position: relative;
    cursor: not-allowed;
}
.combat-hero-ability.on-cooldown::before{
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(0,0,0,0.6);
    pointer-events: none;
}
.combat-ability-cooldown{
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    color: #fff4bd;
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 1px 3px #000, 0 0 6px #000;
    pointer-events: none;
}

.combat-mob-block.dead{
    border-color:black;
    transition: all 1.0s ease-out;
    box-shadow:
        0 0 0 0 black,
        0 0 20px 15px rgba(0, 0, 0, 1.0);
    opacity: 0.5;
}
.combat-mob-block.dead > :first-child {
    background-image: url("../images/monsters/dead.webp");
}

.combat-mob-block.highlight{
    transition: box-shadow 0.15s ease-out;
    box-shadow:
        0 0 0 0 yellow,
        0 0 20px 15px rgba(255, 0, 0, 0.75);
}

.combat-mob-block-image{
    margin-bottom: 5px;
    text-align: center;
    display: flex;
    width:120px;
    height:120px;
    border-radius: 25px;
    color:var(--color-gameLight);
    background-image: var(--bg);
    background-color:var(--color-gameDark);
	background-repeat:no-repeat;
	background-size:120px;
    cursor: pointer;
    transition: 0.15s all ease-in-out;
    justify-content: center;
}

.combat-mob-block-vital{
    --pct: 100%;
    border-radius: 5px;
    height: 15px;
    border: 1px solid black;
    text-align: center;
    font-size: 0.6rem;
    align-content: center;
    color: white;
    text-shadow: 0 0 10px black, 0 0 10px black;
    transition: all 1.0s ease-in-out;
}
/* Same pure-CSS gradient-fill technique as the hero's own .game-header-vital bars (line ~175) -
   these used to reference now-deleted images/icons/{health,stamina,mana}.webp as a background-size
   fill trick; matching the hero's colors/technique here means enemies never depend on those icon
   files existing at all. */
.combat-mob-block-vital.health{
    background-color: #392426;
    background-image: linear-gradient(180deg, #ff4b55 0%, #d31322 52%, #920b16 100%);
    background-repeat: no-repeat;
    background-position: left center;
    background-size: var(--pct) 100%;
}
.combat-mob-block-vital.stamina{
    background-color: #3b3825;
    background-image: linear-gradient(180deg, #ffe65a 0%, #dfbd09 52%, #987b00 100%);
    background-repeat: no-repeat;
    background-position: left center;
    background-size: var(--pct) 100%;
}
.combat-mob-block-vital.mana{
    background-color: #252844;
    background-image: linear-gradient(180deg, #596cff 0%, #243be0 52%, #101f91 100%);
    background-repeat: no-repeat;
    background-position: left center;
    background-size: var(--pct) 100%;
}

/* Per-card buff/debuff icons (owner request 2026-09-28, screenshot of the enemy row: "buffs along
   the left side of the cards filling in downward. Debuffs... right side... hover effect
   tooltips... use the images associated with the spell") - renderMobStatusIcons()/buildStatusBadge()
   (hunt_travel_quest.js). Sits just OUTSIDE the card's own edge (negative left/right) so it never
   covers the portrait/vital bars underneath; a smaller badge than the header buff bar's own 28px
   (there .game-header-buff/.has-image are reused verbatim otherwise - same gold/red progress ring,
   same tooltip). .combat-mob-block/.combat-party-block are both position:relative for exactly this. */
.combat-status-icons{
    position: absolute;
    top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}
.combat-status-icons-left{ left: -25px; }
.combat-status-icons-right{ right: -25px; }
.combat-status-icons .game-header-buff{
    width: 20px;
    height: 20px;
    font-size: 0.6rem;
}
.combat-status-icons .game-header-buff-icon.has-image{
    width: 15px;
    height: 15px;
}

.combat-hero-ability{
    margin-bottom: 5px;
    text-align: center;
    display: flex;
    width:75px;
    height:75px;
    box-sizing:border-box;
    border:1px solid rgba(201,165,68,.48);
    border-radius: 12px;
    color:var(--color-gameLight);
    background-image: var(--bg);
    background-color:var(--color-gameDark);
	background-repeat:no-repeat;
	background-size:75px;
    cursor: pointer;
    box-shadow:inset 0 0 0 1px rgba(255,245,205,.06),0 3px 8px rgba(0,0,0,.34);
    transition:border-color 120ms ease,box-shadow 120ms ease,filter 120ms ease,background-color 120ms ease;
    justify-content: center;
}
.combat-attack-control{
    position: relative;
    display: flex;
    align-items: stretch;
    margin-bottom: 5px;
}
.combat-attack-control.has-attack-modes{
    height: 75px;
    overflow: hidden;
    border:1px solid rgba(201,165,68,.55);
    border-radius: 12px;
    box-sizing: border-box;
    box-shadow:inset 0 0 0 1px rgba(255,245,205,.06),0 3px 8px rgba(0,0,0,.34);
}
.combat-attack-control.has-attack-modes > .combat-auto-attack{
    height: 100%;
    border: 0;
    border-right: 1px solid rgba(201,165,68,.72);
    border-radius: 0;
    box-sizing: border-box;
}
.combat-attack-control > .combat-hero-ability{
    margin-bottom: 0;
    border:0;
    border-radius: 0 12px 12px 0;
    position: relative;
}
.combat-attack-mode-control{
    position: relative;
    width: 125px;
    height: 100%;
    overflow: hidden;
    border-radius: 0;
    background: var(--color-gameDark);
}
.combat-attack-mode-control::after{
    content: "";
    position: absolute;
    z-index: 4;
    top: 50%;
    left: 50%;
    width: 112px;
    height: 3px;
    background: linear-gradient(#fff1a4, var(--zone-gold, #C9A544), #6f5417);
    box-shadow: 0 0 3px #000;
    transform: translate(-50%, -50%) rotate(-45deg);
    transform-origin: center;
    pointer-events: none;
}
.combat-attack-mode-control > .combat-attack-mode{
    position: absolute;
    inset: 0;
    width: 125px;
    height: 100%;
    margin: 0;
    border-radius: 0;
    background-size: 75px;
}
.combat-attack-mode-control > .combat-punch-mode{
    z-index: 1;
    background-position: left center;
    clip-path: polygon(0 0, 79.2% 0, 20.8% 100%, 0 100%);
}
.combat-attack-mode-control > .combat-dart-mode{
    z-index: 2;
    background-position: right center;
    clip-path: polygon(79.2% 0, 100% 0, 100% 100%, 20.8% 100%);
}
.combat-attack-mode-control > .combat-attack-mode:hover{
    background-color: #34352c;
    filter: brightness(1.18) saturate(1.08);
    border-color: transparent;
}
.combat-attack-mode-control > .combat-attack-mode.selected-mode{
    filter: brightness(1.2) saturate(1.08) drop-shadow(0 0 3px rgba(255,215,0,.55));
}
.combat-attack-mode-control > .combat-attack-mode.auto-selected{
    animation: combat-mode-shimmer 1.65s ease-in-out infinite;
}
@keyframes combat-mode-shimmer{
    0%, 100%{ filter: brightness(1.15) saturate(1.05) drop-shadow(0 0 2px rgba(255,215,0,.45)); }
    50%{ filter: brightness(1.85) saturate(1.45) contrast(1.08) drop-shadow(0 0 10px #ffd700) drop-shadow(0 0 4px #fff1a4); }
}
.combat-attack-mode-control.choosing-mode > .combat-attack-mode{
    animation: combat-mode-choice 1s ease-in-out infinite alternate;
}
@keyframes combat-mode-choice{
    from{ filter: brightness(.78) saturate(.75); }
    to{ filter: brightness(1.3) saturate(1.15) drop-shadow(0 0 5px rgba(255,215,0,.75)); }
}
/* Three-way tile (2026-10-18): Punch | Raise Shield | Throw - empty main hand, a shield and darts.
   Same look as the two-way split above, with two parallel gold dividers. */
.combat-attack-mode-control.three-modes::before,
.combat-attack-mode-control.three-modes::after{
    content: "";
    position: absolute;
    z-index: 4;
    top: 50%;
    width: 108px;
    height: 3px;
    background: linear-gradient(#fff1a4, var(--zone-gold, #C9A544), #6f5417);
    box-shadow: 0 0 3px #000;
    transform: translate(-50%, -50%) rotate(-50deg);
    transform-origin: center;
    pointer-events: none;
}
.combat-attack-mode-control.three-modes::before{ left: 33.6%; }
.combat-attack-mode-control.three-modes::after{ left: 66.4%; }
.combat-attack-mode-control.three-modes{ width:185px; }
.combat-attack-mode-control.three-modes > .combat-attack-mode{
    width:185px;
    background-size:75px;
}
.combat-attack-mode-control.three-modes > .combat-mode-left{
    z-index: 1;
    background-position: left center;
    clip-path: polygon(0 0, 49.6% 0, 17.6% 100%, 0 100%);
}
.combat-attack-mode-control.three-modes > .combat-mode-mid{
    z-index: 2;
    background-position: center;
    clip-path: polygon(49.6% 0, 82.4% 0, 50.4% 100%, 17.6% 100%);
}
/* Out of that ammo (2026-10-18): clicking it pulses the image red; nothing is attempted (combat.js). */
.combat-attack-control .combat-hero-ability.ammo-empty-pulse,
.combat-attack-mode-control > .combat-attack-mode.ammo-empty-pulse{
    animation: combat-ammo-empty-pulse .6s ease-in-out 2;
}
@keyframes combat-ammo-empty-pulse{
    0%, 100%{ filter: none; }
    50%{ filter: sepia(1) saturate(7) hue-rotate(-45deg) brightness(.95); background-color: #4a1a16; }
}
/* Four or more sections (2026-10-18 - e.g. Punch | Raise Shield | fire darts | frost darts): combat.js
   sets each section's width, clip-path and image position inline and adds one .combat-mode-divider
   per boundary (same gold bar and angle as the three-way tile). */
.combat-attack-mode-control.multi-modes::after{ display: none; }
.combat-attack-mode-control.multi-modes > .combat-attack-mode{ background-size: 56px; }
.combat-attack-mode-control > .combat-mode-divider{
    position: absolute;
    z-index: 20;
    top: 50%;
    width: 85px;
    height: 3px;
    background: linear-gradient(#fff1a4, var(--zone-gold, #C9A544), #6f5417);
    box-shadow: 0 0 3px #000;
    transform: translate(-50%, -50%) rotate(-62deg);
    transform-origin: center;
    pointer-events: none;
}
.combat-attack-mode-control.three-modes > .combat-mode-right{
    z-index: 3;
    background-position: right center;
    clip-path: polygon(82.4% 0, 100% 0, 100% 100%, 50.4% 100%);
}
/* Ammunition on the attack button (refreshCombatAmmoIndicator(), combat.js): a small ammo icon
   plus how many are left, tucked into the bottom-right corner. */
.combat-ammo-indicator{
    position: absolute;
    right: 3px;
    bottom: 3px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 1px 4px 1px 1px;
    border: 1px solid rgba(201,165,68,.72);
    border-radius: 6px;
    background: rgba(20,19,17,.88);
    color: var(--color-gameLight);
    font: 700 .68rem/1 var(--font-ui);
    pointer-events: none;
}
.combat-ammo-indicator.count-only{
    padding: 2px 5px;
}
.combat-ammo-indicator-icon{
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: var(--bg, none) center / contain no-repeat;
}
.combat-ammo-indicator.empty{
    border-color: rgba(200,70,60,.85);
    color: #e8786c;
}
.item-details-ammo-count{
    color: var(--color-gold);
}
.combat-auto-attack{
    position: relative;
    z-index: 1;
    width: 18px;
    min-width: 18px;
    margin: 0 -1px 0 0;
    padding: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #756b59;
    border-right-color: rgba(201,165,68,.72);
    border-radius: 12px 0 0 12px;
    background: linear-gradient(90deg, #1b1b19, #302e28);
    color: #cfc8b5;
    font: 400 .62rem/1 var(--font-ui);
    letter-spacing: .06em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px #000;
    cursor: pointer;
}
.combat-auto-attack > span{
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}
.combat-auto-attack:hover,
.combat-auto-attack:focus-visible{
    color: #fff1a4;
    border-color: var(--color-gold);
    outline: none;
}
.combat-auto-attack.awaiting-mode{
    color: #fff7bd;
    border-color: var(--color-gold);
    box-shadow: 0 0 8px rgba(255,215,0,.72);
}
.combat-auto-attack.active{
    color: #fff7bd;
    border-color: var(--color-gold);
    background: linear-gradient(90deg, #55410e, #242018, #7b6117);
    background-size: 220% 100%;
    box-shadow: 0 0 9px rgba(255,215,0,.68), inset 0 0 7px rgba(255,239,143,.24);
}
@keyframes combat-auto-shimmer{
    from{ background-position: 100% 0; }
    to{ background-position: -120% 0; }
}
.combat-hero-ability:hover{
    background-color:#26352b;
    text-shadow: var(--text-shadow);
    border-color:rgba(240,212,125,.88);
    box-shadow:inset 0 0 0 1px rgba(255,245,205,.12),0 0 10px rgba(201,165,68,.3);
}
.combat-item-quantity-badge{
    position: absolute;
    right: 5px;
    bottom: 3px;
    min-width: 16px;
    padding: 1px 4px;
    border-radius: 8px;
    background: rgba(12, 12, 12, 0.82);
    color: var(--color-gameLight);
    font-size: 12px;
    font-weight: bold;
    line-height: 16px;
    text-align: center;
    text-shadow: 0 1px 2px #000;
    pointer-events: none;
}
/* Items/Spells toggle buttons - same look as .combat-hero-ability, deliberately a different
   class so promptForAction() (hunt_travel_quest.js) never treats opening/closing the secondary
   bar as the hero's action for the turn. */
.combat-hero-toggle{
    margin-bottom: 5px;
    text-align: center;
    display: flex;
    width:75px;
    height:75px;
    box-sizing:border-box;
    border:1px solid rgba(201,165,68,.48);
    border-radius: 12px;
    color:var(--color-gameLight);
    background-image: var(--bg);
    background-color:var(--color-gameDark);
	background-repeat:no-repeat;
	background-size:75px;
    cursor: pointer;
    box-shadow:inset 0 0 0 1px rgba(255,245,205,.06),0 3px 8px rgba(0,0,0,.34);
    transition:border-color 120ms ease,box-shadow 120ms ease,filter 120ms ease,background-color 120ms ease;
    justify-content: center;
}
.combat-hero-toggle:hover{
    background-color:#26352b;
    text-shadow: var(--text-shadow);
    border-color:rgba(240,212,125,.88);
    box-shadow:inset 0 0 0 1px rgba(255,245,205,.12),0 0 10px rgba(201,165,68,.3);
}
.combat-hero-toggle.active{
    border-color:var(--color-gold);
    outline:none;
    box-shadow:inset 0 0 0 1px rgba(255,244,174,.18),0 0 11px rgba(255,215,0,.48);
}
/* Items/Spells/Abilities secondary bar - a direct child of .game-content-overlay (NOT
   heroWrapper; see
   hunt()'s own comment on why: heroWrapper stretches to the overlay's full width, which broke
   both an absolute-positioned and later an in-flow attempt at anchoring this to it). Positioned
   against the overlay's own box instead: responsive width, centered just above the action bar.
   Hidden until its toggle
   button opens it; only one of #combatItemsBar/#combatSpellsBar carries .open at a time
   (toggleCombatSecondaryBar(), hunt_travel_quest.js) - closed by clicking outside it (except on
   an actor card - see the click-outside listener set up in hunt()). Built generically so Spells
   reuses the identical bar/button/tooltip styling as Items. */
.combat-secondary-bar{
    position: absolute;
    bottom: 158px;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(360px, 44vw, 620px);
    max-width: calc(100% - 32px);
    max-height: min(55vh, 520px);
    box-sizing: border-box;
    display: none;
    padding: 12px;
    background-color: var(--color-gameDark);
    border: 2px solid var(--color-gold);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.65);
    z-index: 15;
}
.combat-secondary-bar.open{
    display: flex;
}
.combat-secondary-grid-panel{
    flex-direction: column;
    gap: 9px;
    overflow: hidden;
}
.combat-secondary-bar-title{
    flex: 0 0 auto;
    color: #e6d39b;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(201, 165, 68, 0.42);
    padding: 0 2px 7px;
}
.combat-secondary-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, 75px);
    grid-auto-rows: 75px;
    justify-content: center;
    align-content: start;
    gap: 9px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 4px 4px 2px;
    scrollbar-gutter: stable;
}
.combat-secondary-grid > .combat-hero-ability{
    margin: 0;
    box-sizing: border-box;
}
/* Passive abilities in the combat Abilities bar (2026-11-08, refreshCombatAbilitiesBar): an ability tile's look, but
   not clickable (no hover lift, default cursor) and a "Passive" tag across the bottom. The first passive starts its
   own row - grouped apart from the active ones with no visible divider. */
.combat-ability-passive{
    position: relative;
    width: 75px;
    height: 75px;
    box-sizing: border-box;
    border: 1px solid rgba(201,165,68,.32);
    border-radius: 12px;
    background-image: var(--bg);
    background-color: var(--color-gameDark);
    background-repeat: no-repeat;
    background-size: 75px;
    box-shadow: inset 0 0 0 1px rgba(255,245,205,.04), 0 3px 8px rgba(0,0,0,.34);
    cursor: default;
}
.combat-secondary-grid > .combat-ability-passive.first-passive{ grid-column-start: 1; }
.combat-ability-passive-tag{
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    padding: 1px 7px;
    border: 1px solid rgba(201,165,68,.7);
    border-radius: 999px;
    background: rgba(20,16,10,.86);
    color: #e9d49a;
    font-family: var(--font-ui);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.35;
    pointer-events: none;
}
.combat-secondary-grid > .combat-secondary-bar-empty{
    grid-column: 1 / -1;
}
.combat-secondary-bar-empty{
    color: var(--color-gameLight);
    font-size: 0.85rem;
    font-style: italic;
    padding: 10px;
}
#combatSpellsBar{
    width: 620px;
    bottom: 158px;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
#combatSpellsBar .combat-channel-control{ order:1; width:calc(100% - 44px); align-self:center; }
#combatSpellsBar .combat-spellbook{ order:2; }
.combat-spellbook{
    width:100%;
    padding-top:31px;
}
.combat-spell-list{
    display:block;
    min-height:0;
}
.combat-spell-list .spellbook-spread{
    min-height:176px;
}
.combat-spell-list .spellbook-page{
    padding-top:25px;
    padding-bottom:13px;
}
.combat-spell-list .spellbook-page-body{
    display:grid;
    grid-template-columns:repeat(2,58px);
    grid-template-rows:repeat(2,58px);
    justify-content:center;
    gap:9px 13px;
}
.combat-spell-list .combat-spell-choice{
    width:58px;
    height:58px;
    box-sizing:border-box;
    border:1px solid #765420;
    border-radius:8px;
    background-color:rgba(57,37,17,.22);
    background-image:var(--bg);
    background-repeat:no-repeat;
    background-position:center;
    background-size:49px;
    cursor:pointer;
    box-shadow:inset 0 0 8px rgba(76,42,13,.28);
}
.combat-spell-list .combat-spell-choice.empty{
    border-style:dashed;
    opacity:.22;
    cursor:default;
    background-image:none;
}
.combat-spell-list .combat-spell-choice:not(.empty):hover{
    border-color:#d3a832;
    filter:brightness(1.15);
    box-shadow:0 0 8px rgba(255,215,0,.55),inset 0 0 8px rgba(76,42,13,.2);
}
.combat-spell-list .spellbook-navigation{ margin-top:7px; }
.spellbook-spread-count{
    min-width:48px;
    color:#e9d59a;
    font:700 11px/1 'Cinzel',serif;
    text-align:center;
}
.combat-channel-control{
    --channel-progress: 0%;
    --channel-color: #62b9ff;
    --channel-haze: 14%;
    --channel-glow: 7px;
    --channel-thumb-glow: 10px;
    --channel-burst-glow: 12px;
    --channel-burst-scale: 1.3;
    --channel-pulse-speed: 1.05s;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px 9px;
    border: 1px solid color-mix(in srgb, var(--channel-color) 48%, #d8c47a);
    border-radius: 9px;
    background:
        radial-gradient(circle at var(--channel-progress) 58%, color-mix(in srgb, var(--channel-color) var(--channel-haze), transparent), transparent 30%),
        linear-gradient(180deg, rgba(47,47,51,0.98), rgba(17,18,22,0.98));
    box-shadow: inset 0 0 14px rgba(0,0,0,0.72), 0 0 var(--channel-glow) color-mix(in srgb, var(--channel-color) 35%, transparent);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.combat-channel-control[data-rank="2"]{ --channel-haze: 19%; --channel-glow: 9px; --channel-thumb-glow: 13px; --channel-burst-glow: 16px; --channel-burst-scale: 1.45; --channel-pulse-speed: .95s; }
.combat-channel-control[data-rank="3"]{ --channel-haze: 24%; --channel-glow: 11px; --channel-thumb-glow: 16px; --channel-burst-glow: 20px; --channel-burst-scale: 1.6; --channel-pulse-speed: .85s; }
.combat-channel-control[data-rank="4"]{ --channel-haze: 30%; --channel-glow: 13px; --channel-thumb-glow: 19px; --channel-burst-glow: 24px; --channel-burst-scale: 1.8; --channel-pulse-speed: .75s; }
.combat-channel-control[data-rank="5"]{ --channel-haze: 38%; --channel-glow: 16px; --channel-thumb-glow: 23px; --channel-burst-glow: 30px; --channel-burst-scale: 2; --channel-pulse-speed: .65s; }
.combat-channel-header{
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
    margin-bottom: 7px;
}
.combat-channel-title{
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: #f7e8ba;
    font-family: var(--font-display);
    font-weight: 800;
    text-overflow: ellipsis;
    text-align: center;
    white-space: nowrap;
}
/* Continuous Channel Strength readout (owner's "...p2" doc, 2026-09-26: "Display the selected
   Channel Strength with one decimal place") - sits beside the title rather than replacing it,
   since the title alone no longer communicates which of the 1.0-5.0 range is currently selected. */
.combat-channel-value{
    flex-shrink: 0;
    color: var(--channel-color, #62b9ff);
    font-family: var(--font-body);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.85em;
    letter-spacing: 0.02em;
}
.combat-channel-track{
    position: relative;
    height: 34px;
    padding: 0 8px;
}
.combat-channel-energy{
    position: absolute;
    inset: 3px 8px auto;
    height: 12px;
    overflow: visible;
    border: 1px solid #08090b;
    border-radius: 999px;
    background:
        linear-gradient(90deg,
            #2d7fd0 0%,
            #45d4cf 24%,
            #9d68ef 49%,
            #ff9c31 74%,
            #ff3548 100%);
    clip-path: inset(0 calc(100% - var(--channel-progress)) 0 0 round 999px);
    box-shadow:
        0 0 var(--channel-thumb-glow) var(--channel-color),
        inset 0 1px 4px rgba(255,255,255,0.72);
    pointer-events: none;
    transition: box-shadow 120ms ease;
}
.combat-channel-energy::after{
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(110deg, transparent 15%, rgba(255,255,255,0.78) 42%, transparent 66%);
    background-size: 80px 100%;
    animation: combat-channel-flow 1.1s linear infinite;
}
@keyframes combat-channel-flow{
    from{ background-position: -80px 0; }
    to{ background-position: 160px 0; }
}
.combat-channel-slider{
    position: relative;
    z-index: 3;
    width: 100%;
    height: 18px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}
.combat-channel-slider::-webkit-slider-runnable-track{
    height: 12px;
    border: 1px solid #08090b;
    border-radius: 999px;
    background: rgba(8,9,12,0.35);
    box-shadow: inset 0 1px 3px #000;
}
.combat-channel-slider::-webkit-slider-thumb{
    width: 18px;
    height: 18px;
    margin-top: -4px;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid #fff0ad;
    border-radius: 50%;
    background: var(--channel-color);
    box-shadow: 0 0 0 2px #17130b, 0 0 var(--channel-thumb-glow) 3px var(--channel-color);
}
.combat-channel-slider::-moz-range-track{
    height: 12px;
    border: 1px solid #08090b;
    border-radius: 999px;
    background: rgba(8,9,12,0.35);
}
.combat-channel-slider::-moz-range-progress{
    height: 12px;
    border-radius: 999px;
    background: transparent;
}
.combat-channel-slider::-moz-range-thumb{
    width: 16px;
    height: 16px;
    border: 2px solid #fff0ad;
    border-radius: 50%;
    background: var(--channel-color);
    box-shadow: 0 0 0 2px #17130b, 0 0 12px 3px var(--channel-color);
}
.combat-channel-bursts{
    position: absolute;
    inset: 0 8px auto;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 18px;
    pointer-events: none;
}
.combat-channel-burst{
    position: relative;
    grid-row: 1;
    width: 4px;
    height: 4px;
    align-self: center;
    justify-self: end;
    margin-right: -2px;
    border-radius: 50%;
    background: rgba(255,245,193,0.36);
    box-shadow: 0 0 3px rgba(255,236,157,0.28);
    transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.combat-channel-burst:nth-child(1){ grid-column: 1; }
.combat-channel-burst:nth-child(2){ grid-column: 2; }
.combat-channel-burst:nth-child(3){ grid-column: 3; }
.combat-channel-burst:nth-child(4){ grid-column: 4; }
.combat-channel-burst.active{
    background: #fff7c7;
    transform: scale(var(--channel-burst-scale));
    box-shadow: 0 0 5px 2px #fff0a0, 0 0 var(--channel-burst-glow) 5px var(--channel-color);
    animation: combat-channel-pulse var(--channel-pulse-speed) ease-in-out infinite alternate;
}
@keyframes combat-channel-pulse{
    from{ transform: scale(1); filter: brightness(1); }
    to{ transform: scale(var(--channel-burst-scale)); filter: brightness(1.55); }
}
.combat-channel-cast{
    width: 100%;
    margin-top: 2px;
    padding: 7px 12px;
    border: 1px solid var(--channel-color);
    border-radius: 6px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--channel-color) 30%, #323238), #17171b);
    color: #fff4ce;
    font-family: var(--font-body);
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: inset 0 1px rgba(255,255,255,0.15), 0 0 8px color-mix(in srgb, var(--channel-color) 32%, transparent);
}
.combat-channel-cast[hidden]{ display: none; }
.combat-channel-cast:hover{
    filter: brightness(1.18);
    box-shadow: inset 0 1px rgba(255,255,255,0.22), 0 0 13px color-mix(in srgb, var(--channel-color) 58%, transparent);
}
.combat-spell-choice.selected{
    border-color: var(--color-gold);
    outline: 2px solid rgba(255,215,0,0.65);
    box-shadow: 0 0 12px rgba(255,215,0,0.7), inset 0 0 8px rgba(255,215,0,0.22);
}
.combat-turnOrder{
    --turn-card-accent: transparent;
    position: relative;
    margin-bottom: 5px;
    text-align: center;
    display: flex;
    width:50px;
    height:50px;
    border-radius: 12px;
    color:var(--color-gameLight);
    background-image: var(--bg);
    background-color:var(--color-gameDark);
	background-repeat:no-repeat;
	background-size:50px;
    cursor: pointer;
    border: 1px solid transparent;
    box-sizing: border-box;
    box-shadow: inset 0 -3px var(--turn-card-accent);
    transition: filter 100ms ease-in-out, border-color 100ms ease-in-out, box-shadow 100ms ease-in-out;
    justify-content: center;
}
.combat-turnOrder-time{
    position: absolute;
    right: -2px;
    bottom: -3px;
    min-width: 14px;
    padding: 0 2px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 215, 0, 0.8);
    border-radius: 5px;
    background: rgba(17, 17, 17, 0.92);
    color: #fff3b0;
    font-size: 10px;
    font-weight: 700;
    line-height: 10px;
    text-align: center;
    text-shadow: 0 1px 1px #000;
    pointer-events: none;
    z-index: 3;
}
.combat-turnOrder:hover{
    filter: brightness(1.12);
    text-shadow: var(--text-shadow);
    border-color: rgba(255,255,255,0.34);
}
.combat-turnOrder.hero,
.combat-turnOrder-hero{
    --turn-card-accent: rgba(196, 170, 91, 0.72);
    background-color: rgba(112, 104, 80, 0.28);
    border-color: rgba(196, 170, 91, 0.42);
}
/* Allies share one quiet blue-green family. Their subtype is carried by only the narrow lower
   accent and border tint, keeping the strip readable without turning it into a rainbow. */
.combat-turnOrder-ally{
    --turn-card-accent: rgba(91, 154, 145, 0.82);
    background-color: rgba(50, 76, 74, 0.38);
    border-color: rgba(109, 176, 164, 0.58);
}
.combat-turnOrder-ally-summoned{
    --turn-card-accent: rgba(86, 168, 154, 0.9);
}
.combat-turnOrder-ally-hired{
    --turn-card-accent: rgba(157, 143, 105, 0.9);
    border-color: rgba(157, 143, 105, 0.58);
}
.combat-turnOrder-ally-party{
    --turn-card-accent: rgba(104, 137, 166, 0.9);
    border-color: rgba(104, 137, 166, 0.58);
}
/* Future hostile rarity hooks. Normal enemies retain the existing neutral card treatment. */
.combat-turnOrder-rarity-super{ --turn-card-accent: rgba(103, 174, 141, 0.9); }
.combat-turnOrder-rarity-rare{ --turn-card-accent: rgba(92, 126, 184, 0.92); }
.combat-turnOrder-rarity-elite{ --turn-card-accent: rgba(143, 99, 168, 0.92); }
.combat-turnOrder-rarity-legendary{ --turn-card-accent: rgba(186, 139, 58, 0.95); }
.combat-turnOrder-enemy[class*="combat-turnOrder-rarity-"]{
    border-color: var(--turn-card-accent);
}

/* Turn-preview viewport reveal: clipped lookahead cards wait just above their eventual slot. The
   turn-shift code drops them as they reach the viewport; only the initial group also fades in,
   preserving the opening stagger without making transparent holes during death compaction. */
.combat-turn-order-initial-build > .combat-turnOrder{
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
    transition: none;
}
.combat-turnOrder-pending{
    transform: translateY(-16px) scale(0.96);
    pointer-events: none;
}
.combat-turnOrder-initial-pending{
    opacity: 0;
}
.combat-turnOrder-entering{
    animation: combat-turn-order-enter 240ms cubic-bezier(.22,.75,.32,1) both;
}
.combat-turnOrder-lookahead-entering{
    animation: combat-turn-order-lookahead-enter 240ms cubic-bezier(.22,.75,.32,1) both;
}
@keyframes combat-turn-order-enter{
    from{ opacity:0; transform:translateY(-16px) scale(0.96); }
    to{ opacity:1; transform:translateY(0) scale(1); }
}
@keyframes combat-turn-order-lookahead-enter{
    from{ opacity:1; transform:translateY(-16px) scale(0.96); }
    to{ opacity:1; transform:translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce){
    .combat-turnOrder-entering,
    .combat-turnOrder-lookahead-entering{ animation-duration:1ms; }
}

/* The card whose turn just resolved "falls off" the front of the strip as a detached visual copy,
   while the live cards compact into their new slots without exposing an empty incoming square.
   It tumbles down/away with a slight spin and shrink. The "easeInBack"-style curve
   (a slight backward dip before it accelerates
   away) gives it a snappy "flicked off" feel rather than a flat linear drop. pointer-events:none
   so a hover/click can't land on a card that's already on its way out. */
.combat-turnOrder-exit{
    transition: transform 380ms cubic-bezier(.36,0,.66,-0.56), opacity 260ms ease-in;
    transform: translate(var(--turn-exit-x, 0px), 55px) rotate(-40deg) scale(0.2);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

/* Owner request 2026-09-20: animateActorDeathInTurnOrder() (scripts/hunt_travel_quest.js) - every
   upcoming card belonging to a mob that just died, not only the front-most one. Deliberately its
   own pair of classes rather than reusing .combat-turnOrder-exit above - that one is tied to "this
   card's turn just resolved" (advanceTurn()), a different trigger/caller, and the two should never
   fight over the same element if a death and a turn-advance ever land on one card in the same
   moment. .combat-turnOrder-dead is the "hold here so the skull is actually readable" pause state
   (its own --bg swap already happened inline, in JS, before this class is added - a class alone
   can't win against an already-set inline custom property); .combat-turnOrder-death-exit is the
   drop-and-fade a beat later - a plain straight-down collapse, no spin, so it reads as "this one
   died" rather than "this one's turn was flicked away". */
.combat-turnOrder-dead{
    filter: grayscale(1) brightness(0.6);
}
.combat-turnOrder-death-exit{
    transition: transform 420ms ease-in, opacity 420ms ease-in;
    transform: translateY(60px) scale(0.7);
    opacity: 0;
    visibility:visible;
    pointer-events: none;
    z-index: 2;
}


/* ============================================================
   INVENTORY (paperdoll + backpack) - ported from the original
   Jeffrey game's game.css
   ============================================================ */

.inventory-main-outter-wrapper{
    display: grid;
    /* Paperdoll used to consume half of the 1500px workspace (~745px). Cap it around 650px and
       give the recovered width to the denser backpack side. */
    grid-template-columns: minmax(500px, 650px) minmax(0, 1fr);
    gap:10px;
    width: min(1500px, 100%);
    box-sizing: border-box;
    background: linear-gradient(145deg, #302e2a, #1d1d1d);
    border: 1px solid #b78a39;
    border-radius: 9px;
    box-shadow: inset 0 0 0 2px rgba(255,215,0,0.08), 0 12px 30px rgba(0,0,0,0.45);
    padding: 8px;
    margin: 20px auto 0;
}

/* "Available Loot" panel (renderAvailableLootPanel(), attributes_skills_inventory.js) - a third
   child of .inventory-main-outter-wrapper spanning both its columns, so it becomes a new
   full-width row below the paperdoll+backpack one rather than disturbing that 2-column layout.
   Matches the dark theme .inventory-paperdoll-wrapper/.inventory-backpack-wrapper already use,
   not the light .item-use-wrapper card the post-combat overlay version of this same UI uses. */
.inventory-loot-panel{
    grid-column: 1 / -1;
    box-sizing: border-box;
    border: 1px solid #b78a39;
    background: linear-gradient(145deg, #403b33, #252525 55%, #1d1d1d);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.42), 0 8px 20px rgba(0,0,0,0.35);
}
.inventory-loot-header{
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(255,215,0,0.48);
}
.inventory-loot-header-icon{
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    height: 38px;
    border: 1px solid var(--color-gold);
    border-radius: 7px;
    background: rgba(0,0,0,0.35);
    color: var(--color-gold);
    box-shadow: inset 0 0 8px rgba(255,215,0,0.1);
}
.inventory-loot-header-copy{
    flex: 1;
    min-width: 0;
}
.inventory-loot-title{
    color: var(--color-gold);
    font-size: 1.05rem;
    font-weight: 700;
    text-shadow: var(--text-shadow-black-outline);
}
.inventory-loot-subtitle{
    margin-top: 2px;
    color: #d1cbc0;
    font-size: 0.76rem;
}
.inventory-loot-count{
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid #6f6657;
    border-radius: 999px;
    background: rgba(0,0,0,0.28);
    color: #ded8cb;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}
.inventory-loot-grid{
    min-height: 64px;
    padding: 9px;
    border: 1px solid #625a4d;
    border-radius: 7px;
    background: rgba(0,0,0,0.32);
    box-shadow: inset 0 2px 7px rgba(0,0,0,0.45);
}
.inventory-loot-panel .inventory-loot-all{
    padding: 9px 14px;
    border-color: #829b69;
    background: linear-gradient(180deg, #42643d, #294126);
    font-weight: 700;
}
.inventory-loot-panel .inventory-loot-all:hover{
    border-color: var(--color-gold);
    background: linear-gradient(180deg, #557c4d, #34502f);
}

/* Holds the search box above the actual backpack grid - the grid itself
   (.inventory-backpack-wrapper below) keeps its own bordered/bounded-height look unchanged. */
.inventory-backpack-column{
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 418px;
    min-height: 0;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #665b4b;
    border-radius: 7px;
    background: linear-gradient(180deg, #393733, #292929);
    box-shadow: inset 0 1px rgba(255,255,255,0.05);
}
.inventory-backpack-column .inventory-backpack-search,
.town-stash-body .inventory-backpack-search{
    width: 100%;
    height: 36px;
    box-sizing: border-box;
    padding: 7px 12px;
    border: 1px solid #8c7b5f;
    border-radius: 6px;
    background: #202020;
    color: var(--color-gameLight);
    font-size: 0.95rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}
.inventory-backpack-column .inventory-backpack-search:focus,
.town-stash-body .inventory-backpack-search:focus{
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 2px rgba(255,215,0,0.14), inset 0 2px 5px rgba(0,0,0,0.5);
}

/* Container tabs (Features and Modifications.txt's "Inventory management" entry) - 4 real
   containers (each own-or-locked - owner request 2026-09-19, Container Slot System) + the Coin
   Purse, above the search bar per explicit request. */
.inventory-container-tabs{
    display: flex;
    gap: 5px;
}
.inventory-container-tab{
    position: relative; /* anchors the [tooltip]::after plaque above it */
    flex: 1;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 3px 8px;
    border: 1px solid #756b5c;
    border-radius: 6px;
    background: linear-gradient(180deg, #414141, #292929);
    color: var(--color-gameLight);
    cursor: pointer;
    text-align: center;
}
.inventory-container-tab.active{
    background: linear-gradient(180deg, #263c8f, #101d66);
    border-color: var(--color-gold);
    box-shadow: 0 0 8px 1px rgba(255, 200, 100, 0.45);
}
.inventory-container-tab.drag-over{
    border-color: var(--color-gold);
    box-shadow: 0 0 10px 2px rgba(255, 215, 120, 0.6);
}
/* Locked container slot (owner request 2026-09-19, Container Slot System) - a hero who doesn't
   own this bag type yet (Satchel/Harness/Belt Pouch start locked; only Backpack is guaranteed).
   Revives the pre-Coin-Purse "??? / Locked" look, just labeled per-type now. Non-interactive by
   design - renderContainerTabs() attaches no click/drag listeners to this tile at all. */
.inventory-container-tab.locked{
    flex-direction: column;
    gap: 2px;
    background: linear-gradient(180deg, #2a2a2a, #1c1c1c);
    border-style: dashed;
    border-color: color-mix(in srgb, var(--color-gold) 40%, transparent);
    color: var(--color-gameLight);
    cursor: default;
}
/* Dimmed by its label, not the whole tile - opacity on the tile would fade its hover plaque (::after)
   too (owner 2026-11-03). */
.inventory-container-tab.locked > *{
    opacity: 0.55;
}
.inventory-container-tab-locked-label{
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}
.inventory-container-tab-locked-sub{
    font-size: 0.7rem;
    font-style: italic;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Container/Coin Purse tab tooltip (owner request 2026-09-19: "the same style as when you hover
   over an empty item slot") - the plain attr(tooltip) plaque + gold-glow highlight paperdoll empty
   slots use (.inventory-equipment-slot.empty:hover(::after) below), not the rich showHoverTooltip()
   box equipped items/inventory tiles get. Applies to every tab here (owned, locked, and the Coin
   Purse), matching the paperdoll's own "any slot, not just an occupied one" hover feedback. */
.inventory-container-tab[tooltip]:hover{
    border-color: var(--color-gold);
    box-shadow:
        0 0 0 1px rgba(255, 215, 0, 0.55),
        0 0 12px 2px rgba(255, 190, 70, 0.3),
        inset 0 0 10px rgba(255, 224, 145, 0.1);
}
.inventory-container-tab[tooltip]:hover::after{
    content: attr(tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    z-index: 5;
    padding: 4px 8px;
    box-sizing: border-box;
    border: 1px solid #b78a39;
    border-radius: 4px;
    background: linear-gradient(180deg, #39342b, #191816);
    color: var(--color-gameLight);
    box-shadow: 0 4px 10px rgba(0,0,0,0.7), inset 0 1px rgba(255,255,255,0.08);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-shadow: var(--text-shadow-black-outline);
    white-space: nowrap;
    pointer-events: none;
}
/* Coin Purse (owner request 2026-09-19) - a golden border that periodically shimmers with a
   top-left-to-bottom-right gradient sweep. A masked ::before ring (padding + mask-composite
   exclude) carries the animated diagonal gradient rather than the tile's own border/background,
   so it composes cleanly with .active/.drag-over above if either ever applies at the same time.
   ::after stays exclusively owned by the shared [tooltip] plaque. Reusing ::after here made the
   purse label inherit this ring's inset, mask, and animation and render inside the tab.
   Reuses combatPulse's (below) "infinite animation driven by keyframe percentages" convention,
   but pins most of the cycle still so there's a real idle gap between sweeps ("periodically," not
   constant). No `overflow: hidden` here (removed - real bug, owner report): the mask-composite
   above already clips the shimmer to just its own ring shape at the pixel level, so overflow was
   never load-bearing for it, but it WAS silently clipping the [tooltip]::after plaque above,
   which renders outside this tile's own box (bottom: calc(100% + 6px)). */
.inventory-container-tab.coin-purse-tab{
    position: relative;
    border-color: #a67c27;
}
.inventory-container-tab.coin-purse-tab::before{
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 6px;
    padding: 2px;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 215, 120, 0.95) 50%, transparent 60%);
    background-size: 300% 300%;
    background-position: -150% -150%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: coinPurseShimmer 4s linear infinite;
}
@keyframes coinPurseShimmer{
    0%, 55%{ background-position: -150% -150%; }
    85%, 100%{ background-position: 150% 150%; }
}
.inventory-container-tab-label{
    font-size: 0.8rem;
    font-weight: bold;
}
.inventory-container-tab-icon{
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.65));
    pointer-events: none;
}
.inventory-container-tab-count{
    font-size: 0.78rem;
    font-weight: 700;
    opacity: 0.92;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.inventory-container-tab-count.coin-purse-count{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}
.coin-purse-count-icon{
    width: 12px;
    height: 12px;
    object-fit: contain;
}
/* PARENT WRAPPERS */
.inventory-paperdoll-wrapper,
.inventory-backpack-wrapper{
    box-sizing: border-box;
    border: 1px solid #756b5c;
    background-color: var(--color-gameDark);
    border-radius: 5px;
    padding: 5px;
    max-height: 418px;
}

/* Paperdoll: use grid so left/right edges + true center are guaranteed */
.inventory-paperdoll-wrapper{
    display: grid;
    grid-template-columns: auto 1fr auto; /* left | center space | right */
    align-items: start;                  /* side columns start at top */
    position: relative;
    height: 418px;
    min-width: 0;

    background-image: var(--bg);
    background-repeat: no-repeat;
    background-position: top center;
    background-size: contain;
}

/* SIDE COLUMNS */
.inventory-side-wrapper{
    display: flex;
    flex-direction: column;
    padding: 5px;
    box-sizing: border-box;
    border: 1px solid var(--color-gameSlate);
    background-color: var(--color-gameDark);
    border-radius: 5px;
    flex: 0 0 auto;
    gap: 5px;
}

.inventory-side-wrapper.left{
    grid-column: 1;
}

.inventory-side-wrapper.right{
    grid-column: 3;
    margin-left: 0;
    justify-self: end;   /* pin to the right edge of column 3 */
}

/* BOTTOM CENTER BAR */
.inventory-center-wrapper{
    grid-column: 2;
    justify-self: center; /* true center of the middle column */
    align-self: end;      /* bottom of the paperdoll wrapper */

    gap: 5px;
    display: flex;
    flex-direction: row;
    padding: 5px;
    box-sizing: border-box;
    border: 1px solid var(--color-gameSlate);
    background-color: var(--color-gameDark);
    border-radius: 5px;

    margin: 0;
}

/* EQUIPMENT SLOTS */
.inventory-equipment-slot{
    border: 1px solid white;
    width: 50px;
    height: 50px;
    background-image: var(--bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50px;
    cursor: pointer;
    border-radius: 5px;
    border-top: 1px solid white;
    border-left: 1px solid white;
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    transition: 0.15s all ease-in-out;
    position: relative;
}
.inventory-equipment-slot.highlight{
    z-index: 3;
    transform: translateY(-1px) scale(1.045);
    border-color: var(--color-gold) !important;
    box-shadow:
        0 0 0 1px rgba(255, 215, 0, 0.9),
        0 0 10px 2px rgba(38, 105, 255, 0.78),
        0 0 18px 4px rgba(71, 35, 190, 0.48),
        inset 0 0 12px rgba(255, 215, 0, 0.18) !important;
    filter: grayscale(0) brightness(1.16) saturate(1.18) !important;
    background-color: rgba(15, 22, 42, 0.88) !important;
    animation: inventory-compatible-slot-pulse 1.25s ease-in-out infinite alternate;
}
.inventory-equipment-slot.highlight::before{
    content: "";
    position: absolute;
    inset: 2px;
    z-index: 1;
    border: 1px solid rgba(255, 224, 100, 0.55);
    border-radius: 3px;
    background: radial-gradient(circle at 50% 45%, rgba(62, 111, 255, 0.12), transparent 68%);
    pointer-events: none;
}
@keyframes inventory-compatible-slot-pulse{
    from{
        box-shadow:
            0 0 0 1px rgba(255, 215, 0, 0.78),
            0 0 8px 1px rgba(38, 105, 255, 0.62),
            0 0 13px 3px rgba(71, 35, 190, 0.38),
            inset 0 0 9px rgba(255, 215, 0, 0.12);
    }
    to{
        box-shadow:
            0 0 0 1px rgba(255, 232, 125, 1),
            0 0 12px 3px rgba(50, 125, 255, 0.88),
            0 0 20px 5px rgba(91, 47, 215, 0.52),
            inset 0 0 14px rgba(255, 215, 0, 0.24);
    }
}
.inventory-equipment-slot.empty{
    filter: grayscale(100%) brightness(0.7);
}
/* Quantity badge (owner request 2026-09-19, stackableItem) - only rendered when quantity > 1
   (renderBackpackItems()), so a lone item's tile looks exactly as it always has. */
.inventory-item-quantity-badge{
    position: absolute;
    right: 2px;
    bottom: 1px;
    font-size: 11px;
    font-weight: bold;
    color: var(--color-gameLight);
    text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 3px rgba(0,0,0,0.9);
    pointer-events: none;
}
.inventory-item-quantity-infinite{
    font-size: 15px;
    line-height: 1;
}
/* Charges-left bar (applyItemChargeBar(), behaviors.js) - a thin track along the icon's bottom;
   the fill's width and green/yellow/red color are set inline from the charges left. */
.item-charge-bar{
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 3px;
    height: 2px;
    border-radius: 1px;
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}
.item-charge-bar-fill{
    height: 100%;
    border-radius: 1px;
}
/* A quantity badge on the same icon sits just above the bar. */
.has-charge-bar > .inventory-item-quantity-badge,
.has-charge-bar > .combat-item-quantity-badge{
    bottom: 8px;
}
/* The empty-slot placeholder art already has its own beveled frame baked in - the shared bevel
   border above on top of that read as a redundant double frame. Kept as transparent rather than
   removed outright so the box's rendered size doesn't shrink relative to its real-item siblings
   (this class isn't box-sizing:border-box, so the border still takes up its own 1px either way).
   Scoped to the backpack only - paperdoll's own .empty slots keep their visible bevel. */
.inventory-backpack-wrapper .inventory-equipment-slot.empty{
    border-color: transparent;
}
.inventory-equipment-slot.empty:hover {
    z-index: 4;
    transform: translateY(-1px) scale(1.035);
    filter: grayscale(0.15) brightness(1.08) saturate(1.05);
    border-color: var(--color-gold);
    background-color: #28251f;
    box-shadow:
        0 0 0 1px rgba(255, 215, 0, 0.55),
        0 0 12px 2px rgba(255, 190, 70, 0.3),
        inset 0 0 10px rgba(255, 224, 145, 0.1);
}

.inventory-equipment-slot:not(.empty):hover {
    box-shadow:
        0 0 0 1px rgba(255, 215, 120, 0.55),
        0 0 16px 4px rgba(255, 200, 100, 0.55);
}

.inventory-equipment-slot.equipped {
    background-color: #24231f;
    position: relative;
    border-color: rgba(224, 185, 72, 0.9);
    box-shadow:
        inset 0 0 0 1px rgba(255, 224, 120, 0.38),
        inset 0 0 9px rgba(255, 210, 85, 0.13);
}
.inventory-equipment-slot.equipped:hover {
    background-color: #2b2923;
    border-color: rgba(255, 215, 80, 1);
    box-shadow:
        inset 0 0 0 1px rgba(255, 231, 145, 0.62),
        inset 0 0 11px rgba(255, 210, 85, 0.2);
}

/* Drag and drop (Features and Modifications.txt's "Inventory management" entry) - the item
   actually being dragged dims in place, whatever it's currently hovering over glows gold. */
.inventory-equipment-slot.dragging{
    opacity: 0.4;
}
.inventory-equipment-slot.drag-over{
    box-shadow:
        0 0 0 2px var(--color-gold),
        0 0 12px 3px rgba(255, 215, 0, 0.6) !important;
}

/* Shared magical-item treatment. Merchant and stash grids add an inset layer below because their
   scrollable panel edges can clip the outer bloom; inventory keeps the original outer aura. */
.item-magical-aura{
    position: relative;
    filter:
        drop-shadow(0 0 2px rgba(115, 225, 255, 0.95))
        drop-shadow(0 0 5px rgba(132, 82, 255, 0.72));
}
.npc-shop-body .item-magical-aura::after{
    content: "";
    position: absolute;
    inset: 1px;
    z-index: 1;
    border-radius: inherit;
    box-shadow:
        inset 0 0 4px rgba(115, 225, 255, 0.48),
        inset 0 0 9px rgba(132, 82, 255, 0.38);
    pointer-events: none;
}
.npc-shop-body .item-magical-aura > .inventory-item-quantity-badge{
    z-index: 2;
}

/* Grade marks (applyItemGradeMark(), behaviors.js): the same image at different grades. A tinted
   inner frame (a child span, not ::after - combat buttons use that for their tooltips) plus a corner
   letter; Base (craft-tier-1) is left plain. Later grades add a rule here. */
.item-graded{
    position: relative;
}
.item-grade-frame{
    position: absolute;
    inset: 1px;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
}
.item-grade-letter{
    position: absolute;
    top: 1px;
    left: 2px;
    z-index: 2;
    min-width: 11px;
    padding: 0 2px;
    border-radius: 3px;
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 700;
    line-height: 12px;
    text-align: center;
    pointer-events: none;
}
.item-grade-craft-tier-2 > .item-grade-frame{
    border: 1px solid rgba(190, 212, 235, 0.55);
    box-shadow: inset 0 0 5px rgba(170, 200, 235, 0.35);
}
.item-grade-craft-tier-2 > .item-grade-letter{
    color: #1b2430;
    background: linear-gradient(180deg, #eef4fb, #9fb3c8);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}
.item-grade-craft-tier-3 > .item-grade-frame{
    border: 1px solid rgba(255, 210, 110, 0.75);
    box-shadow: inset 0 0 6px rgba(255, 190, 70, 0.45);
}
.item-grade-craft-tier-3 > .item-grade-letter{
    color: #2b1a00;
    background: linear-gradient(180deg, #ffe9a8, #d39b2a);
    box-shadow: 0 0 3px rgba(255, 196, 80, 0.7), 0 0 2px rgba(0, 0, 0, 0.8);
}
.item-graded > .inventory-item-quantity-badge{
    z-index: 2;
}

.inventory-equipment-slot.equipped::before {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 3px;
    border: 1px solid rgba(255, 225, 125, 0.42);
    pointer-events: none;
}
/* Empty paper-doll slots identify their body/gear position in a compact floating plaque. Keeping
   the label outside the slot leaves the placeholder artwork visible, which matters for paired
   silhouettes such as Chest/Abdomen where the highlighted armor region is the identifying cue. */
.inventory-paperdoll-wrapper .inventory-equipment-slot.empty:hover::after{
    content: attr(tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    z-index: 5;
    padding: 4px 8px;
    box-sizing: border-box;
    border: 1px solid #b78a39;
    border-radius: 4px;
    background: linear-gradient(180deg, #39342b, #191816);
    color: var(--color-gameLight);
    box-shadow: 0 4px 10px rgba(0,0,0,0.7), inset 0 1px rgba(255,255,255,0.08);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-shadow: var(--text-shadow-black-outline);
    white-space: nowrap;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce){
    .inventory-equipment-slot.highlight{
        animation: none;
    }
}

.inventory-backpack-wrapper{
    flex: 1;
    min-height: 0;
    max-height: none;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    overflow-y: auto;
}

@media (max-width: 950px){
    .inventory-main-outter-wrapper{
        grid-template-columns: minmax(0, 1fr);
    }
    .inventory-backpack-column{
        height: 418px;
    }
}


/* Generic hover tooltip (showHoverTooltip() in game.js) - the reusable "fancy border, title,
   image, content area" mechanic, for anything other than items (which keep their own plainer
   .inventory-hover-tooltip above). Reuses the "inspect item" popup's ornate frame language
   (.item-use-wrapper.inspect-frame further down this file) rather than .inventory-hover-
   tooltip's own plainer look, since that ornate style is explicitly what this was asked to
   match - same dark gradient/gold border/inset shadow/diamond corner treatment, just as a
   position:fixed floating tooltip instead of a centered modal. */
.hover-tooltip{
    display: none;
    position: fixed;
    /* Above the devtools program (1000) and its modals (1500) - the Hero Adjuster shows a real
       inventory with item tooltips (2026-10-12). */
    z-index: 1600;
    /* min-width, not just max-width - without it the box shrinks to fit its own content
       (shrink-to-fit is the default for an auto-width flex column), which is what made it
       look cramped/thin despite the 300px cap - it was actually rendering much narrower than
       that for most monsters. */
    min-width: 240px;
    max-width: 320px;
    pointer-events: none;
    padding: 12px;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(160deg, var(--color-gameSlate) 0%, var(--color-gameDark) 65%);
    color: var(--color-gameLight);
    border: 2px solid var(--color-gold);
    border-radius: 10px;
    box-shadow:
        inset 0 0 0 3px rgba(0,0,0,0.55),
        inset 0 0 16px rgba(0,0,0,0.4),
        0 10px 28px rgba(0,0,0,0.6);
}
.hover-tooltip-header{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    /* One value for both the image and the title container below, which needs to match it
       exactly (see .hover-tooltip-title's own comment) - has already been bumped a few times,
       so this is the one place to change going forward instead of two. */
    --hover-tooltip-image-size: 64px;
}
/* Reserved square for whatever's being hovered has art for - background-image via the --bg
   custom property, same idiom .inspect-title-image already uses. Stays an empty gold-bordered
   frame when there's nothing to show (no image passed to showHoverTooltip()). box-sizing:
   border-box so the 1px border doesn't push its true rendered height past
   --hover-tooltip-image-size - .hover-tooltip-title needs to match this exactly, border
   included, for their bottom edges to actually line up. */
.hover-tooltip-image{
    width: var(--hover-tooltip-image-size);
    height: var(--hover-tooltip-image-size);
    box-sizing: border-box;
    flex-shrink: 0;
    border-radius: 5px;
    border: 1px solid var(--color-gold);
    background-color: rgba(0,0,0,0.35);
    background-image: var(--bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 54px;
}
/* Full width (fills the rest of the header, out to the card's own edge) and the exact same
   height as the image (box-sizing:border-box, matching that rule) - the gold underline is
   just this container's own border-bottom, so making its box the same height as the image is
   what makes that line land level with the image's bottom edge, rather than hugging just the
   text (which sits at the top of this box, not centered in it - see align-items below). */
.hover-tooltip-title{
    width: 100%;
    min-height: var(--hover-tooltip-image-size);
    height: auto;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    color: var(--color-gold);
    text-shadow: var(--text-shadow-black-outline);
    font-size: 1.05rem;
    font-weight: bold;
    border-bottom:0;
}
.item-details-heading-row{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    width:100%;
}
.item-details-heading-name{
    min-width:0;
    color:var(--color-gold);
    font-size:1.05rem;
    font-weight:bold;
    line-height:1.08;
}
.item-details-heading-value{
    display:inline-flex;
    align-items:center;
    gap:4px;
    flex-shrink:0;
    color:#f8df8a;
    font-size:.95rem;
    line-height:1;
}
.item-details-coin-icon{
    width:20px;
    height:20px;
    object-fit:contain;
}
.item-details-heading-description{
    width:100%;
    margin-top:5px;
    color:var(--color-gameLight);
    font-size:.7rem;
    font-weight:normal;
    line-height:1.25;
    text-shadow:var(--text-shadow-black-outline);
}
.hover-tooltip-title:has(> .item-details-heading-row){
    flex-direction:column;
}
.hover-tooltip-body{
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
}
/* A stat line (Attributes/Skills) - label left, value right, rather than one "Label: value"
   string that just left-aligns as a block of ragged text. */
.hover-tooltip-row{
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.creature-tooltip-level{
    margin-top:4px;
    color:#d8d1c4;
}
.hover-tooltip .creature-tooltip-section{
    padding:4px 8px 5px;
    background:rgba(0,0,0,.12);
}
.hover-tooltip .creature-tooltip-section-title{
    padding-bottom:3px;
    margin-bottom:1px;
    border-bottom:1px solid rgba(232,190,70,.24);
}
.hover-tooltip .creature-tooltip-section .item-details-stat-row{
    grid-template-columns:20px minmax(0,1fr) auto;
    min-height:22px;
    padding:2px 1px;
}
.hover-tooltip .creature-tooltip-stat-icon{
    width:18px;
    height:18px;
}
.creature-tooltip-abilities{
    padding:4px 2px 2px;
    color:#e5dfd0;
    line-height:1.3;
}
.hover-tooltip .creature-tooltip-gear{
    display:grid;
    grid-template-columns:repeat(3,30px);
    justify-content:center;
    align-content:start;
    gap:4px;
    padding:4px 7px 7px;
}
.hover-tooltip .creature-tooltip-gear .creature-tooltip-section-title{
    grid-column:1 / -1;
}
.creature-tooltip-gear-tile{
    position:relative;
    display:block;
    width:34px;
    height:34px;
    box-sizing:border-box;
    border:1px solid rgba(232,190,70,.52);
    border-radius:4px;
    background-color:rgba(0,0,0,.24);
    background-image:var(--bg);
    background-position:center 2px;
    background-repeat:no-repeat;
    background-size:23px;
    overflow:hidden;
}
.creature-tooltip-gear-spacer{
    display:block;
    width:30px;
    height:30px;
}
.creature-tooltip-gear-tile.empty{
    opacity:.32;
    filter:grayscale(.75);
}
.creature-tooltip-gear-tile.equipped{
    box-shadow:inset 0 0 5px rgba(255,210,70,.18);
}
.creature-tooltip-gear-slot-label{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    padding:1px 0;
    background:rgba(10,10,10,.82);
    color:#eee6d5;
    font-size:6px;
    font-weight:bold;
    line-height:1;
    text-align:center;
    text-shadow:0 1px 1px #000;
    white-space:nowrap;
}
.creature-tooltip-gear-tile.empty .creature-tooltip-gear-slot-label{
    color:#d0c8bb;
}
.hover-tooltip:has(.creature-tooltip-layout){
    width:420px;
    max-width:420px;
}
.creature-tooltip-layout{
    display:grid;
    grid-template-columns:112px minmax(0,1fr);
    align-items:start;
    gap:7px;
}
.creature-tooltip-stats{
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:0;
}
.creature-tooltip-layout > .creature-tooltip-gear{
    height:100%;
    min-height:0;
    box-sizing:border-box;
}
/* Attributes/Abilities/Skills section headers - the extra margin-top (on top of
   .hover-tooltip-body's own 4px gap) is what actually separates each section from the last;
   the first section doesn't need that extra push since there's nothing above it but the
   Level line. */
.hover-tooltip-section-title{
    font-weight: bold;
    margin-top: 8px;
}
.hover-tooltip-section-title:first-child{
    margin-top: 0;
}
/* Cast button debug tooltip (owner request 2026-09-25) - a sub-heading one notch quieter than
   .hover-tooltip-section-title, grouping a spell's raw behaviors array field-by-field ("Behaviors"
   is the section title; each behavior TYPE within it gets one of these). */
.hover-tooltip-debug-behavior-type{
    font-weight: bold;
    font-style: italic;
    opacity: 0.85;
    margin-top: 6px;
}
.hover-tooltip-debug-behavior-type:first-of-type{
    margin-top: 0;
}
/* Ornamental compass-knot corners, same technique as .item-use-wrapper.inspect-frame further down this
   file (see its own comment for why a corner span is needed alongside the wrapper's own
   ::before/::after - an element only gets two pseudo-elements of its own, and this needs all
   four corners accented). */
.hover-tooltip::before,
.hover-tooltip::after,
.hover-tooltip-corner::before,
.hover-tooltip-corner::after{
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    background: radial-gradient(circle, var(--color-gameDark) 0 22%, var(--color-gold) 25% 37%, #6f5215 40% 52%, var(--color-gold) 55% 100%);
    clip-path: polygon(50% 0, 64% 34%, 100% 50%, 64% 66%, 50% 100%, 36% 66%, 0 50%, 36% 34%);
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.75));
}
.hover-tooltip::before{ top: -11px; left: -11px; }
.hover-tooltip::after{ bottom: -11px; right: -11px; }
.hover-tooltip-corner{
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.hover-tooltip-corner::before{ top: -11px; right: -11px; }
.hover-tooltip-corner::after{ bottom: -11px; left: -11px; }
.hover-tooltip-ornament,
.inspect-frame-ornament{
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.hover-tooltip-ornament::before,
.hover-tooltip-ornament::after,
.inspect-frame-ornament::before,
.inspect-frame-ornament::after{
    content: "";
    position: absolute;
    left: 50%;
    /* Match the main navbar ornament exactly: its narrow horizontal spine lands directly on
       the frame border and fades away at both ends, so the ornament reads as a shaped section
       of that border rather than a separate gold badge laid over it. */
    width: 70px;
    height: 13px;
    background: linear-gradient(90deg, transparent 0%, #b78a39 15%, var(--color-gold) 35%, #fff0a0 50%, var(--color-gold) 65%, #b78a39 85%, transparent 100%);
    clip-path: polygon(0 43%, 31% 43%, 39% 18%, 44% 43%, 50% 0, 56% 43%, 61% 18%, 69% 43%, 100% 43%, 100% 57%, 69% 57%, 61% 82%, 56% 57%, 50% 100%, 44% 57%, 39% 82%, 31% 57%, 0 57%);
    filter: none;
}
.hover-tooltip-ornament::before,
.inspect-frame-ornament::before{ top: -7px; transform: translateX(-50%); }
.hover-tooltip-ornament::after,
.inspect-frame-ornament::after{ bottom: -7px; transform: translateX(-50%) rotate(180deg); }

/* "Inspect" popup's content wrapper (openItemInspectPopup()) - same title/description content
   as the hover tooltip (fillItemDetailsContent()), just inside the standard item-use-wrapper
   card instead of a floating box, and capped/scrollable so a long description can't blow out
   the popup's own fixed-width card. */
.item-use-inspect-details{
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    max-height: 50vh;
    overflow-y: auto;
}

/* Skills reuse the persistent item-inspect shell, but their short description and cost rows
   should occupy the card's full content width rather than inheriting the item body's centered
   child alignment. */
.skill-inspect-frame .item-use-inspect-details{
    align-items: stretch;
}
.skill-inspect-description{
    line-height: 1.4;
}
.skill-inspect-details{
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 215, 0, 0.35);
    font-size: 0.8rem;
    color: var(--color-gameLight);
    text-shadow: var(--text-shadow-black-outline);
}
.skill-tooltip-formula-label{
    margin-top: 5px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 215, 0, 0.35);
    color: var(--color-gold);
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.skill-tooltip-formula{
    padding: 5px 7px;
    border-radius: 4px;
    background: rgba(0,0,0,0.28);
    color: var(--color-gameLight);
    font-family: monospace;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

/* Post-combat loot screen (showPostCombatLootScreen(), attributes_skills_inventory.js) - a grid
   of the same .inventory-equipment-slot tiles the backpack uses, inside the plain .item-use-
   wrapper card every other options menu already uses. */
.loot-screen-grid{
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 300px;
    overflow-y: auto;
}
.loot-screen-actions{
    display: flex;
    gap: 8px;
}
.loot-screen-actions .item-use-option{
    flex: 1;
}

.item-details-title{
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    color: var(--color-gameLight);
    text-shadow: var(--text-shadow-black-outline);
}

.item-details-description{
    font-size: 0.8rem;
    color: var(--color-gameLight);
    text-shadow: var(--text-shadow-black-outline);
}
.item-details-summary:empty{ display:none; }
.item-details-stat-row{
    --details-corner-size:5.625px;
    display:grid;
    grid-template-columns:26px minmax(0,1fr) auto;
    align-items:center;
    gap:8px;
    width:100%;
    box-sizing:border-box;
    padding:6px 10px;
    border:1px solid rgba(232,190,70,.55);
    border-radius:0;
    clip-path:polygon(
        var(--details-corner-size) 0,
        calc(100% - var(--details-corner-size)) 0,
        100% var(--details-corner-size),
        100% calc(100% - var(--details-corner-size)),
        calc(100% - var(--details-corner-size)) 100%,
        var(--details-corner-size) 100%,
        0 calc(100% - var(--details-corner-size)),
        0 var(--details-corner-size)
    );
    color:var(--color-gameLight);
    font-size:.82rem;
    text-shadow:var(--text-shadow-black-outline);
}
.item-details-stat-list{
    --details-corner-size:5.625px;
    width:100%;
    box-sizing:border-box;
    padding:2px 9px;
    border:1px solid rgba(232,190,70,.55);
    border-radius:0;
    clip-path:polygon(
        var(--details-corner-size) 0,
        calc(100% - var(--details-corner-size)) 0,
        100% var(--details-corner-size),
        100% calc(100% - var(--details-corner-size)),
        calc(100% - var(--details-corner-size)) 100%,
        var(--details-corner-size) 100%,
        0 calc(100% - var(--details-corner-size)),
        0 var(--details-corner-size)
    );
}
.item-details-stat-list .item-details-stat-row{
    padding:6px 1px;
    border:0;
    border-radius:0;
    clip-path:none;
}
.item-details-stat-list .item-details-stat-row + .item-details-stat-row{
    border-top:1px solid rgba(232,190,70,.2);
}
.item-details-stat-icon{
    display:block;
    width:24px;
    height:24px;
    background-image:var(--icon);
    background-position:center;
    background-repeat:no-repeat;
    background-size:contain;
}
.item-details-stat-label{
    color:#e5dfd0;
}
.item-details-stat-value{
    color:#fff8e6;
    text-align:right;
}
/* Armor can cover enough body slots to require several lines. Give that value the flexible
   column (instead of the default max-content column) so the label stays intact and wrapping
   proceeds naturally from the right edge without overlapping either label or icon. */
.item-details-covers-row{
    grid-template-columns:26px auto minmax(0,1fr);
    align-items:start;
}
.item-details-covers-row .item-details-stat-icon{
    margin-top:1px;
}
.item-details-covers-row .item-details-stat-label{
    padding-top:3px;
    white-space:nowrap;
}
.item-details-covers-row .item-details-stat-value{
    min-width:0;
    padding-top:2px;
    line-height:1.25;
    overflow-wrap:anywhere;
    text-wrap:balance;
}
.item-details-weapon-skill-icons{
    display:flex;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
    gap:4px;
}
.item-details-weapon-skills{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    padding:6px 10px;
    background:rgba(0,0,0,.12);
}
.item-details-weapon-skills .item-details-resistances-title{
    display:flex;
    align-items:center;
    gap:7px;
    margin:0;
    text-align:left;
    font-size:.82rem;
    font-weight:normal;
}
.item-details-weapon-skills .item-details-resistances-title::before{
    content:"";
    display:block;
    width:22px;
    height:22px;
    flex:0 0 22px;
    background-image:url("../images/icons/navbar/skills.webp");
    background-position:center;
    background-repeat:no-repeat;
    background-size:contain;
}
.item-details-weapon-skills .item-details-weapon-skill-icons{ justify-content:flex-end; }
.item-details-weapon-skills .item-details-weapon-skill-icon{
    width:28px;
    height:28px;
    flex-basis:28px;
    background-size:24px;
}
.item-details-weapon-skill-icon{
    display:block;
    width:24px;
    height:24px;
    flex:0 0 24px;
    border:1px solid rgba(232,190,70,.45);
    border-radius:4px;
    background-color:rgba(0,0,0,.2);
    background-image:var(--icon);
    background-position:center;
    background-repeat:no-repeat;
    background-size:21px;
}

/* An armor item's resistances (fillItemDetailsContent()) - a bordered box of their own instead
   of plain "- Type: value" lines mixed into the rest of the description text, with a small
   centered heading and two fixed columns (physical left, elemental right). */
.item-details-resistances{
    --details-corner-size:5.625px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(232,190,70,.55);
    border-radius:0;
    clip-path:polygon(
        var(--details-corner-size) 0,
        calc(100% - var(--details-corner-size)) 0,
        100% var(--details-corner-size),
        100% calc(100% - var(--details-corner-size)),
        calc(100% - var(--details-corner-size)) 100%,
        var(--details-corner-size) 100%,
        0 calc(100% - var(--details-corner-size)),
        0 var(--details-corner-size)
    );
    padding: 6px 10px;
}
.item-details-resistances-title{
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    color: var(--color-gameLight);
    text-shadow: var(--text-shadow-black-outline);
    margin-bottom: 4px;
}
.item-details-spell{
    display:grid;
    grid-template-columns:54px minmax(0,1fr);
    align-items:center;
    gap:9px;
    border-color:#b85122;
    background:linear-gradient(105deg,rgba(87,28,12,.42),rgba(26,18,17,.35));
    box-shadow:inset 0 0 10px rgba(178,54,18,.12);
}
.item-details-spell-icon{
    width:52px;
    height:52px;
    box-sizing:border-box;
    border:1px solid var(--color-gold);
    border-radius:4px;
    background-color:rgba(0,0,0,.38);
    background-image:var(--bg);
    background-position:center;
    background-repeat:no-repeat;
    background-size:46px;
}
.item-details-spell-info{ min-width:0; }
.item-details-spell .item-details-resistances-title{
    margin-bottom:3px;
    color:var(--color-gold);
    text-align:left;
    font-size:.9rem;
}
/* Trade tool / bait boxes (fillItemTradeBoxes()) - the Resistances box frame holding stat-list rows (same font and
   dividers as an item's stats), minus the icon column. */
.item-details-trade-box{ padding:6px 9px 2px; }
.item-details-trade-box .item-details-stat-row{ padding:6px 1px; border:0; border-radius:0; clip-path:none; }
.item-details-trade-box .item-details-stat-row + .item-details-stat-row{ border-top:1px solid rgba(232,190,70,.2); }
.item-details-trade-row{ grid-template-columns:minmax(0,1fr) auto; }
.item-details-trade-single{ padding:4px 0 6px; color:#fff8e6; font-size:.82rem; text-align:center; text-shadow:var(--text-shadow-black-outline); }
.item-details-resistances-columns{
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.item-details-resistances-column{
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0,1fr) 3ch;
    align-items:center;
    column-gap: 10px;
    row-gap: 2px;
    font-size: 0.8rem;
    color: var(--color-gameLight);
    text-shadow: var(--text-shadow-black-outline);
}
.item-details-resistances-column + .item-details-resistances-column{
    padding-left:10px;
    border-left:1px solid rgba(232,190,70,.28);
}
.item-details-resistances-type{
    display:flex;
    align-items:center;
    gap:6px;
    text-align:left;
}
.item-details-resistance-icon{
    display:inline-block;
    width:20px;
    height:20px;
    flex:0 0 20px;
    background-image:var(--icon);
    background-position:center;
    background-repeat:no-repeat;
    background-size:contain;
}
.item-details-resistances-value{
    align-self:center;
    text-align:right;
    line-height:20px;
}
/* A crafting recipe's preview (scripts/crafting.js): stats are ranges ("−6 – −3"), so the box can be a bit wider and
   the resistance values size to fit on one line instead of the fixed 3ch column. */
.hover-tooltip.crafting-preview-tooltip{ max-width: 420px; }
.crafting-range-stacked{ display: inline-flex; gap: 6px; }
.crafting-range-cell{ display: flex; flex-direction: column; align-items: center; line-height: 1.05; white-space: nowrap; }
.crafting-range-cell.crafting-range-sep{ color: var(--color-gameSlate); }
.crafting-range-label,
.crafting-range-head{ color: #cbb77b; font-family: var(--font-ui); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; }
.crafting-range-pair{ display: inline-grid; grid-template-columns: minmax(26px, auto) auto minmax(26px, auto); column-gap: 4px; justify-items: center; white-space: nowrap; }
.crafting-range-pair .crafting-range-sep{ color: var(--color-gameSlate); }
.crafting-preview-tooltip .item-details-resistances-column{ grid-template-columns: minmax(0,1fr) auto; }
.crafting-preview-tooltip .item-details-resistances-value,
.crafting-preview-tooltip .item-details-stat-value{ white-space: nowrap; }
/* ...except Covers, a list that has to wrap inside the box like the normal item tooltip's. */
.crafting-preview-tooltip .item-details-covers-row .item-details-stat-value{ white-space: normal; }

.item-details-enchantments{
    position:relative;
    overflow:hidden;
    border-color:#d3a8ff;
    background:
        radial-gradient(circle at 15% 20%,rgba(205,151,255,.28),transparent 38%),
        linear-gradient(110deg,rgba(89,55,116,.84),rgba(53,40,70,.92) 48%,rgba(99,58,119,.82));
    box-shadow:inset 0 0 16px rgba(218,174,255,.22),0 0 8px rgba(184,121,255,.28);
}

/* Chromium's scoop corner is the curved, inward counterpart to border-radius used by the
   mockup. The polygon declarations above remain as a clean chamfered fallback elsewhere. */
@supports (corner-shape:scoop){
    .item-details-stat-row,
    .item-details-stat-list,
    .item-details-resistances{
        clip-path:none;
        border-radius:6.25px;
        corner-shape:scoop;
    }
    .item-details-stat-list .item-details-stat-row{
        border-radius:0;
        corner-shape:initial;
    }
}
.item-details-enchantments::after{
    content:"";
    position:absolute;
    inset:-80% -45%;
    pointer-events:none;
    background:linear-gradient(105deg,transparent 42%,rgba(255,244,190,.12) 49%,rgba(220,190,255,.2) 50%,transparent 58%);
    transform:translateX(-45%);
    animation:item-enchantment-shimmer 5s ease-in-out infinite;
}
@keyframes item-enchantment-shimmer{
    0%,55%{ transform:translateX(-45%); opacity:0; }
    62%{ opacity:1; }
    88%,100%{ transform:translateX(45%); opacity:0; }
}
.item-details-enchantments-title{
    position:relative;
    z-index:1;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    color:#e7ceff;
}
.item-details-enchantments-title::before,
.item-details-enchantments-title::after{
    content:"◆";
    color:#c797ff;
    font-size:.58rem;
    text-shadow:0 0 5px #b567ff;
}
.item-details-enchantment-list{
    position:relative;
    z-index:1;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:4px;
}
.item-details-enchantment-row{
    display:grid;
    grid-template-columns:36px auto auto;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:28px;
    color:#f2eaff;
    text-align:center;
    text-shadow:0 1px 2px #000;
}
.item-details-enchantment-icon{
    width:36px;
    height:36px;
    background-image:var(--icon);
    background-position:center;
    background-repeat:no-repeat;
    background-size:34px;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.55)) drop-shadow(0 0 4px rgba(216,171,255,.2));
}
.item-details-enchantment-name{ font-weight:bold; }
/* Enchantment behaviors described as text (behavior-set enchantments, 2026-11-02). */
.item-details-enchantment-text{
    color:#f2eaff;
    text-align:center;
    text-shadow:0 1px 2px #000;
    line-height:1.35;
}
.item-details-enchantment-value{
    color:#bfffcf;
    font-weight:bold;
}
@media (prefers-reduced-motion:reduce){
    .item-details-enchantments::after{ animation:none; }
}

/* The item-use/grip-prompt overlay used to just be the bare .game-content-overlay base (full-
   screen, opaque --color-gameLight background, no centering - every other modal that wants a
   small centered popup instead of a full-page panel, like .skillDescription/.chronicle below,
   already overrides this the same way) - this is what made it look like a full pale page instead
   of a compact dialog. Dims/centers instead, same pattern those already use. */
.game-content-overlay.itemUseOverlay{
    background: rgba(0,0,0,0.75);
    justify-content: center;
    align-items: center;
    padding: 20px;
}
/* NPC conversations begin near the top of the playable area, then keep their natural height and
   grow downward as the conversation adds choices. Only the overlay scrolls if a long exchange
   eventually reaches the bottom, leaving the ornate frame and its decorations unclipped. */
.game-content-overlay.itemUseOverlay.npc-interaction-overlay{
    justify-content: flex-start;
    padding-top: clamp(42px, 9vh, 92px);
    overflow-y: auto;
}
.item-use-wrapper{
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(155deg, #49443b 0%, #292929 60%, #1d1d1d  100%);
    color: var(--color-gameLight);
    padding: 18px;
    border-radius: 10px;
    border: 1px solid #c59b42;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.48), 0 16px 40px rgba(0,0,0,0.65);
    min-width: 320px;
    max-width: 420px;
}

/* "Inspect" popup card (openInspectPopup()) only - an .item-use-wrapper modifier so the shared
   equip/grip-prompt options menu keeps its plain look. Reuses this file's own ornate gold-on-dark
   language (.xp-level-badge above) rather than the light card default, with compass-knot corner
   accents loosely inspired by a reference the owner liked - reworked rather than copied: two
   corners via the wrapper's own ::before/::after, the other two via a plain decorative
   .inspect-frame-corner span (an element only gets two pseudo-elements of its own). */
.item-use-wrapper.inspect-frame{
    position: relative;
    background: linear-gradient(160deg, var(--color-gameSlate) 0%, var(--color-gameDark) 65%);
    color: var(--color-gameLight);
    border: 2px solid var(--color-gold);
    box-shadow:
        inset 0 0 0 3px rgba(0,0,0,0.55),
        inset 0 0 16px rgba(0,0,0,0.4),
        0 10px 28px rgba(0,0,0,0.6);
}
.item-use-wrapper.inspect-frame .item-use-title-wrapper{
    gap: 10px;
    align-items:flex-start;
    --inspect-title-image-size: 64px;
}
/* Doubles as the name of whatever's being inspected - no separate "Inspect" caption above it
   eating vertical space - so it's left-aligned next to the image square instead of the plain
   menu's centered "auto margin" title text. */
.item-use-wrapper.inspect-frame .item-use-title-text{
    margin: 0;
    flex: 1;
    min-width: 0;
    min-height: var(--inspect-title-image-size);
    height:auto;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    text-align: left;
    color: var(--color-gold);
    text-shadow: var(--text-shadow-black-outline);
    font-size: 1.05rem;
    border-bottom:0;
}
.item-use-wrapper.inspect-frame .item-use-title-text:has(> .item-details-heading-row){
    flex-direction:column;
}
/* Reserved square for whatever's being inspected has art for (items today - a monster/NPC/world
   object later) - background-image via the --bg custom property, the same idiom every other
   item icon in this file already uses. Stays an empty gold-bordered frame when there's nothing
   to show. */
.inspect-title-image{
    width: 32px;
    height: 32px;
    box-sizing: border-box;
    flex-shrink: 0;
    border-radius: 5px;
    border: 1px solid var(--color-gold);
    background-color: rgba(0,0,0,0.35);
    background-image: var(--bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 26px;
}
.item-use-wrapper.inspect-frame .inspect-title-image{
    width: var(--inspect-title-image-size);
    height: var(--inspect-title-image-size);
    background-size: 54px;
}
.item-use-wrapper.inspect-frame::before,
.item-use-wrapper.inspect-frame::after,
.inspect-frame-corner::before,
.inspect-frame-corner::after{
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    background: radial-gradient(circle, var(--color-gameDark) 0 22%, var(--color-gold) 25% 37%, #6f5215 40% 52%, var(--color-gold) 55% 100%);
    clip-path: polygon(50% 0, 64% 34%, 100% 50%, 64% 66%, 50% 100%, 36% 66%, 0 50%, 36% 34%);
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.75));
}
.item-use-wrapper.inspect-frame::before{ top: -11px; left: -11px; }
.item-use-wrapper.inspect-frame::after{ bottom: -11px; right: -11px; }
.inspect-frame-corner{
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.inspect-frame-corner::before{ top: -11px; right: -11px; }
.inspect-frame-corner::after{ bottom: -11px; left: -11px; }

.item-use-title-wrapper{
    display: flex;
    align-items: center;
    position: relative;
}
.item-use-wrapper:not(.inspect-frame) > .item-use-title-wrapper{
    min-height: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,215,0,0.55);
}

.item-use-title-text{
    margin: 0 auto;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    color: var(--color-gold);
    text-shadow: var(--text-shadow-black-outline);
}
.item-use-title-text > span{
    color: navy;
}
.item-use-options-wrapper{
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* Combat walkthrough (showCombatTutorial(), combat.js - tutorial "First Fight", 2026-10-12): the
   fight is paused under a dimmed layer; the step's target sits in a clear "spotlight" (its huge
   shadow is the dimming), and the speaker's card sits beside it. With no target, the layer itself
   dims and the card is centered. The layer swallows every click so nothing in combat can be used. */
.combat-tutorial-layer{
    position: fixed;
    inset: 0;
    z-index: 1300;
}
/* The dimmed backdrop - an SVG mask with a hole per lit part (showCombatTutorial's drawHighlights). */
.combat-tutorial-dim{
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.combat-tutorial-spotlight{
    position: fixed;
    border: 2px solid var(--color-gold);
    border-radius: 8px;
    box-shadow: 0 0 18px rgba(255,215,0,0.55);
    pointer-events: none;
    transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease;
}
/* Other parts a step lets the hero use (e.g. the Attributes / Skills buttons) - a softer ring. */
.combat-tutorial-spotlight.secondary{
    border-width: 1px;
    border-color: rgba(255,215,0,0.45);
    border-radius: 6px;
    box-shadow: 0 0 6px rgba(255,215,0,0.25);
}
.combat-tutorial-spotlight[hidden]{
    display: none;
}
/* Guided steps (2026-10-14): a click / use step lets the pointer through to the page - the lock
   lives in showCombatTutorial()'s event guard, which only lets the allowed parts work - and dims a
   little less so the parts the hero may use stay readable. */
.combat-tutorial-layer.interactive{
    pointer-events: none;
}
.combat-tutorial-layer.interactive .combat-tutorial-card{
    pointer-events: auto;
}
/* Docked beside a whole screen the hero is using. */
.combat-tutorial-card.docked{
    width: min(300px, calc(100vw - 24px));
}
.combat-tutorial-card [hidden]{
    display: none;
}
.combat-tutorial-card{
    position: fixed;
    display: flex;
    gap: 14px;
    width: min(460px, calc(100vw - 24px));
    box-sizing: border-box;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid #c59b42;
    background: linear-gradient(155deg, #49443b 0%, #292929 60%, #1d1d1d 100%);
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.48), 0 16px 40px rgba(0,0,0,0.65);
    color: var(--color-gameLight);
}
.combat-tutorial-portrait{
    flex: 0 0 84px;
    width: 84px;
    height: 84px;
    border-radius: 8px;
    border: 1px solid var(--color-gold);
    background-color: rgba(0,0,0,0.35);
    background-image: var(--bg);
    background-size: cover;
    background-position: center top;
}
.combat-tutorial-body{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.combat-tutorial-name{
    color: var(--color-gold);
    font-size: 1rem;
    font-weight: bold;
}
.combat-tutorial-text{
    font-size: 1.05rem;
    line-height: 1.35;
}
/* Spans the whole card under the portrait and text - Skip on the left, the step count, Back and
   Next on the right, all on one line even in the narrower docked card. */
.combat-tutorial-card{
    flex-wrap: wrap;
}
.combat-tutorial-footer{
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.combat-tutorial-counter{
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.7;
    white-space: nowrap;
}
.combat-tutorial-skip{
    border: 0;
    background: none;
    color: var(--color-gameLight);
    opacity: 0.6;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
}
.combat-tutorial-skip:hover{
    opacity: 1;
}
.combat-tutorial-button{
    flex: none;
    min-width: 70px;
    font-size: 0.85rem;
    white-space: nowrap;
}
.combat-tutorial-button:disabled{
    opacity: 0.4;
    cursor: default;
}
.item-use-option{
    border-radius: 5px;
    cursor: pointer;
    padding:5px;
    text-align: center;
    border: 1px solid white;
    background-color: var(--color-gameDark);
    color: var(--color-gameLight);
    transition: 0.15s all ease-in-out;
}
.item-use-option:hover{
    background-color: darkgreen;
    text-shadow: 0 0 10px #FFD700, 0 0 10px #FFD700;
    border-color:black;
}

/* Shared hierarchy for confirmation, loot and grip prompts. Inventory's richer action menu
   reuses the same semantic classes with its own more specific layout below. */
.item-use-wrapper:not(.inventory-item-options) .item-option-primary:hover{
    background: linear-gradient(180deg, #42643d, #294126);
    border-color: #8eb479;
}
.item-use-wrapper:not(.inventory-item-options) .item-option-secondary{
    border-color: #777064;
    color: #d8d4cb;
}
.item-use-wrapper:not(.inventory-item-options) .item-option-secondary:hover{
    background: linear-gradient(180deg, #55514a, #37342f);
    border-color: #aaa08f;
    text-shadow: 0 1px 1px #000;
}
.item-use-wrapper:not(.inventory-item-options) .item-option-danger{
    border-color: #914b4e;
    color: #ffb4b4;
}
.item-use-wrapper:not(.inventory-item-options) .item-option-danger:hover{
    background: linear-gradient(180deg, #702d31, #461b1e);
    border-color: #ef6868;
}
.game-prompt-card{
    width: min(390px, calc(100vw - 40px));
    min-width: 0;
}
.game-prompt-card .game-close,
.inspect-frame .game-close,
.inventory-item-options .game-close{
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    background-size: 10px 10px, 10px 10px, auto;
}
.game-prompt-card .gamePromptMessageWrapper{
    padding: 14px;
    border: 1px solid #625b50;
    border-radius: 7px;
    background: rgba(0,0,0,0.28);
    line-height: 1.45;
}
.combat-results-card{
    width: min(520px, calc(100vw - 40px));
    max-width: 520px;
}
.combat-results-card .item-use-title-text{
    font-size: 1.35rem;
}
.combat-results-card.victory .item-use-title-text{ color: var(--color-gold); }
.combat-results-card.defeat .item-use-title-text{ color: #ff8585; }
.combat-results-card.fled .item-use-title-text{ color: #d8c79c; }
.combat-results-card .item-details-description{
    padding: 10px 12px;
    border: 1px solid #625b50;
    border-radius: 6px;
    background: rgba(0,0,0,0.25);
    line-height: 1.45;
}
.combat-results-card .loot-screen-grid{
    padding: 9px;
    border: 1px solid #625b50;
    border-radius: 7px;
    background: rgba(0,0,0,0.35);
}
.loot-options-card,
.grip-options-card,
.split-options-card{
    width: min(380px, calc(100vw - 40px));
    min-width: 0;
}

/* Split slider (owner request 2026-09-19, stackableItem: "Split needs to ask how much to split
   via a slider bar") - same options-wrapper class as every other item-use card, extended here
   rather than given its own separate container. */
.split-slider-wrapper{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 4px 6px;
}
.split-slider-readout{
    text-align: center;
    font-weight: bold;
    color: var(--color-gameLight);
}
.split-slider{
    width: 100%;
}

/* Inventory item action menu: a compact companion to the ornate Inspect card, with the item
   itself in the header and visual hierarchy between inspection, movement and destructive acts. */
.item-use-wrapper.inventory-item-options{
    position: relative;
    box-sizing: border-box;
    width: min(380px, calc(100vw - 40px));
    min-width: 0;
    padding: 14px;
    gap: 12px;
    color: var(--color-gameLight);
    background: linear-gradient(155deg, #49443b 0%, #292929 58%, #1d1d1d 100%);
    border: 1px solid #c59b42;
    box-shadow:
        inset 0 0 0 2px rgba(0,0,0,0.5),
        inset 0 1px rgba(255,255,255,0.08),
        0 18px 45px rgba(0,0,0,0.7);
}
.inventory-item-options .item-use-title-wrapper{
    gap: 11px;
    min-height: 54px;
    padding: 0 0 11px;
    border-bottom: 1px solid rgba(255,215,0,0.65);
}
.inventory-item-options .inventory-item-options-image{
    width: 54px;
    height: 54px;
    background-size: 46px;
    background-color: #202020;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.7), 0 0 8px rgba(255,215,0,0.12);
}
.inventory-item-options .item-use-title-text{
    flex: 1;
    min-width: 0;
    margin: 0;
    color: var(--color-gold);
    font-size: 1.15rem;
    text-align: left;
    text-shadow: var(--text-shadow-black-outline);
}
.inventory-item-options .item-use-title-text > span{
    color: #ffb4b4;
}
.inventory-item-options .game-close{
    flex: 0 0 auto;
    align-self: flex-start;
}
.inventory-item-options .item-use-options-wrapper{
    gap: 7px;
}
.inventory-item-options .item-use-option{
    position: relative;
    padding: 9px 12px 9px 38px;
    border-color: #706858;
    background: linear-gradient(180deg, #414141, #292929);
    text-align: left;
    font-weight: 600;
    text-shadow: 0 1px 1px #000;
    box-shadow: inset 0 1px rgba(255,255,255,0.06);
}
.inventory-item-options .item-use-option::before{
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #d7c597;
    text-shadow: none;
}
.inventory-item-options .item-option-inspect::before{ content: "\25C9"; }
.inventory-item-options .item-option-modify::before{ content: "\270E"; } /* Hero Adjuster only */
.inventory-item-options .item-option-primary::before{ content: "\2726"; }
.inventory-item-options .item-option-move::before{ content: "\2192"; }
.inventory-item-options .item-option-secondary::before{ content: "\21A9"; }
.inventory-item-options .item-option-danger::before{ content: "\2715"; }
.inventory-item-options .item-use-option:hover{
    transform: translateX(3px);
    color: #fff;
    border-color: var(--color-gold);
    background: linear-gradient(180deg, #655936, #3c3525);
    text-shadow: 0 1px 1px #000;
}
.inventory-item-options .item-option-primary{
    border-color: #657655;
}
.inventory-item-options .item-option-primary:hover{
    background: linear-gradient(180deg, #42643d, #294126);
}
.inventory-item-options .item-option-danger{
    margin-top: 3px;
    border-color: #83484a;
    color: #ffb4b4;
}
.inventory-item-options .item-option-danger:hover{
    border-color: #ef6868;
    background: linear-gradient(180deg, #702d31, #461b1e);
}

/* Ammo container compartments on the paperdoll (2026-10-18, renderAmmoCompartments()): a small
   toggle beside the worn container, and a column of compartment slots rising above it. */
.inventory-center-wrapper{ position: relative; }
.ammo-compartments-toggle{
    align-self: stretch;
    width: 16px;
    padding: 0;
    border: 1px solid var(--color-gameSlate);
    border-radius: 4px;
    background: var(--color-gameDark);
    color: var(--zone-gold, #C9A544);
    font-family: var(--font-ui);
    font-size: 0.6rem;
    line-height: 1;
    cursor: pointer;
}
.ammo-compartments-toggle:hover,
.ammo-compartments-toggle.open{
    border-color: var(--color-gold);
    color: #fff1a4;
}
.ammo-compartments-column{
    position: absolute;
    bottom: calc(100% + 6px);
    z-index: 5;
    display: flex;
    flex-direction: column-reverse; /* compartment 1 nearest the container */
    gap: 5px;
    padding: 5px;
    border: 1px solid var(--color-gameSlate);
    border-radius: 5px;
    background-color: var(--color-gameDark);
}
/* A compartment's fill bar - shorter than a charges bar, so the count fits beside it. */
.ammo-compartment-bar{
    position: absolute;
    left: 4px;
    bottom: 4px;
    width: 22px;
    height: 3px;
    border-radius: 1px;
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}
.ammo-compartment-bar-fill{
    height: 100%;
    border-radius: 1px;
}

/* Ammo swap prompt (2026-10-18, promptForAmmoSwap()): the container's compartments in a row, like
   the paperdoll's compartment slots - the ones it could replace are clickable, the rest dimmed. */
.ammo-swap-choices{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 4px;
}
.ammo-swap-choices > .ammo-compartment-slot.selectable:hover{
    border-color: var(--color-gold);
    transform: translateY(-1px) scale(1.06);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.55);
}
.ammo-swap-choices > .ammo-compartment-slot.disabled{
    cursor: default;
    opacity: 0.38;
    filter: grayscale(0.7);
}

/* Withdraw from the Coin Purse (2026-10-18, promptForCoinAmount()): a typed amount above the slider. */
.coin-amount-card{
    width: min(410px, calc(100vw - 40px));
}
.coin-amount-available{
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid rgba(183,138,57,0.42);
    border-radius: 6px;
    background: rgba(0,0,0,0.24);
    color: var(--color-gameSlate);
}
.coin-amount-available strong{
    color: var(--color-gold);
    font-size: 1.05rem;
    text-shadow: var(--text-shadow-black-outline);
}
.coin-amount-icon{
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}
.coin-amount-field{
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.coin-amount-label{
    color: var(--color-gold);
    font-size: 0.78rem;
    font-weight: bold;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.coin-amount-row{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(183,138,57,0.65);
    border-radius: 5px;
    background: rgba(12,12,12,0.72);
    font-family: var(--font-ui);
    color: var(--color-gameLight);
}
.coin-amount-input{
    width: 100%;
    min-width: 0;
    height: 38px;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--color-gameLight);
    font-size: 1.05rem;
    font-weight: bold;
    text-align: right;
    appearance: textfield;
    -moz-appearance: textfield;
}
.coin-amount-input:focus{ outline: none; }
.coin-amount-input::-webkit-inner-spin-button,
.coin-amount-input::-webkit-outer-spin-button{
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}
.coin-amount-unit{
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 11px;
    border-left: 1px solid rgba(183,138,57,0.35);
    color: var(--color-gameSlate);
    font-size: 0.82rem;
}
.coin-amount-card .split-slider{
    accent-color: var(--color-gold);
    cursor: pointer;
}
.coin-amount-quick{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}
.coin-amount-quick-button{
    min-height: 30px;
    border: 1px solid rgba(183,138,57,0.48);
    border-radius: 5px;
    background: rgba(0,0,0,0.2);
    color: var(--color-gameLight);
    font: inherit;
    cursor: pointer;
}
.coin-amount-quick-button:hover{
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: rgba(183,138,57,0.12);
}
.coin-amount-confirm{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

/* Standard Town-dashboard window shell (owner request 2026-10-31). Market establishes the
   geometry for the content-heavy Town screens; the two ornament marker classes document which
   pieces of the shared inspect frame each screen intentionally uses. Future Rumors, Town Board,
   and Local Map windows can opt into all three classes without copying component-specific CSS. */
.item-use-wrapper.inspect-frame.town-screen-standard{
    top: clamp(58px, 7vh, 78px);
    bottom: clamp(58px, 7vh, 78px);
    width: min(97vw, 1500px);
    height: auto;
    max-height: none;
    box-sizing: border-box;
    /* The center ornament extends beyond the border by design (as it does on the Inn). Content
       overflow is owned by .item-use-inspect-details, so clipping the frame only amputates the
       ornament without providing any layout benefit. */
    overflow: visible;
}
.town-screen-standard .item-use-title-wrapper{
    flex: 0 0 auto;
}
.town-screen-standard .item-use-inspect-details{
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}
/* These ornaments are drawn by the base inspect frame. Named Town-screen hooks keep their use
   deliberate and give the future dashboard screens a stable shared contract. */
.town-screen-center-ornament > .inspect-frame-ornament,
.town-screen-market-corners > .inspect-frame-corner{
    display: block;
}

/* Marketplace (2026-10-20) - scripts/town.js renderMarketBody(). Fonts come from the shared UI role. */
.market-frame .item-use-title-wrapper{
    flex: 0 0 auto;
}
.market-frame .item-use-inspect-details{
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}
.market-body{
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.market-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(183,138,57,0.5);
    padding-bottom: 8px;
}
.market-tabs{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.market-tab{
    padding: 6px 12px;
    border: 1px solid rgba(183,138,57,0.45);
    border-radius: 6px;
    background: rgba(0,0,0,0.35);
    color: var(--color-gameLight);
    cursor: pointer;
    transition: 0.15s all ease-in-out;
}
.market-tab:hover{ border-color: var(--color-gold); }
.market-tab.active{
    color: var(--color-gold);
    border-color: var(--color-gold);
    background: rgba(183,138,57,0.18);
    font-weight: bold;
}
.market-balance{
    display: flex;
    align-items: center;
    gap: 8px;
}
.market-balance-text{
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-gold);
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
}
.market-balance-coin{
    width: 21px;
    height: 21px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}
.market-small-button{
    min-height: 29px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 3px 8px;
    font-size: 0.86rem;
    line-height: 1;
    white-space: nowrap;
}
.market-action-icon{
    width: 17px;
    height: 17px;
    object-fit: contain;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.85));
}
.market-small-button.disabled{
    opacity: 0.45;
    cursor: default;
}
.market-content{
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.market-browse-workspace{
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
}
.market-category-panel,
.market-results-pane{
    min-height: 0;
    border: 1px solid rgba(183,138,57,0.42);
    border-radius: 8px;
    background: rgba(0,0,0,0.24);
}
.market-category-panel{
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.market-category-title,
.market-results-title{
    color: var(--color-gold);
    font-family: var(--font-display);
    font-weight: bold;
    text-shadow: var(--text-shadow-black-outline);
}
.market-category-title{
    padding: 11px 12px 9px;
    border-bottom: 1px solid rgba(183,138,57,0.38);
}
.market-category-tree{
    overflow-y: auto;
    padding: 7px;
}
.market-category-branch{
    display: flex;
    flex-direction: column;
}
.market-category-row{
    --tree-indent: 0px;
    width: 100%;
    min-height: 31px;
    display: grid;
    grid-template-columns: calc(14px + var(--tree-indent)) 23px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 6px;
    padding: 5px 7px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--color-gameLight);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.market-category-depth-1 > .market-category-row{ --tree-indent: 15px; }
.market-category-depth-2 > .market-category-row{ --tree-indent: 30px; color: var(--color-gameSlate); }
.market-category-row:hover{
    color: var(--color-gold);
    background: rgba(183,138,57,0.1);
}
.market-category-row.active{
    color: var(--color-gold);
    border-color: rgba(183,138,57,0.72);
    background: linear-gradient(90deg, rgba(183,138,57,0.25), rgba(183,138,57,0.06));
    box-shadow: inset 3px 0 0 var(--color-gold);
}
.market-category-icon{
    width: 23px;
    height: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-gold);
}
.market-category-icon img{
    width: 23px;
    height: 23px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.85));
}
.market-category-toggle{
    justify-self: end;
    color: var(--color-gameSlate);
    line-height: 1;
}
.market-category-row.has-children:hover .market-category-toggle,
.market-category-row.has-children.active .market-category-toggle{
    color: var(--color-gold);
}
.market-category-label{
    min-width: 0;
}
.market-category-count{
    width: 30px;
    box-sizing: border-box;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(0,0,0,0.32);
    color: var(--color-gameSlate);
    font-size: 0.72rem;
    text-align: center;
}
.market-results-pane{
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden;
}
.market-results-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 3px 7px;
    border-bottom: 1px solid rgba(183,138,57,0.32);
}
.market-results-count{
    color: var(--color-gameSlate);
    font-size: 0.8rem;
}
.market-filters{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.market-body .inventory-backpack-search,
.crafting-body .inventory-backpack-search{
    flex: 1 1 260px;
    height: 34px;
    box-sizing: border-box;
    padding: 6px 12px;
    border: 1px solid #8c7b5f;
    border-radius: 6px;
    background: #202020;
    color: var(--color-gameLight);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}
.market-body .inventory-backpack-search:focus,
.crafting-body .inventory-backpack-search:focus{
    outline: none;
    border-color: var(--color-gold);
}
.market-filter-select{
    flex: 0 0 auto;
    height: 34px;
    min-width: 116px;
    padding: 4px 28px 4px 9px;
    border: 1px solid rgba(183,138,57,0.62);
    border-radius: 5px;
    background-color: rgba(15,15,15,0.86);
    color: var(--color-gameLight);
}
.market-location-filter{
    position: relative;
    flex: 0 0 166px;
}
.market-filter-button{
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    padding: 5px 9px;
    border: 1px solid rgba(183,138,57,0.62);
    border-radius: 5px;
    background: rgba(15,15,15,0.82);
    color: var(--color-gameLight);
    font: inherit;
    cursor: pointer;
}
.market-filter-button:hover{
    border-color: var(--color-gold);
    color: var(--color-gold);
}
.market-filter-button.active{
    border-color: var(--color-gold);
    background: rgba(183,138,57,0.22);
    color: var(--color-gold);
    box-shadow: inset 0 0 7px rgba(183,138,57,0.16);
}
.market-location-button{
    width: 100%;
    justify-content: flex-start;
}
.market-filter-button-label{
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.market-filter-caret{
    color: var(--color-gameSlate);
}
.market-location-menu{
    position: absolute;
    z-index: 20;
    top: calc(100% + 5px);
    left: 0;
    width: 224px;
    max-height: 360px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    background: linear-gradient(160deg, #3d3932, #202020 70%);
    box-shadow: 0 8px 20px rgba(0,0,0,0.72);
}
.market-location-menu[hidden]{ display: none; }
.market-location-option{
    width: 100%;
    min-height: 35px;
    display: block;
    align-items: center;
    gap: 7px;
    padding: 4px 7px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--color-gameLight);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.market-location-option:hover,
.market-location-option.active{
    border-color: rgba(183,138,57,0.65);
    background: rgba(183,138,57,0.18);
    color: var(--color-gold);
}
.market-filter-group{
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
}
.market-mode-filter,
.market-sort-filter{
    margin-left: 9px;
}
.market-filter-group .market-filter-button{
    border-radius: 4px;
    white-space: nowrap;
}
.market-filter-icon{
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.8));
}
.market-mode-filter .market-filter-button{ min-width: 76px; }
.market-sort-filter .market-filter-button{ min-width: 64px; }
.market-list{
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 330px);
    overflow-y: auto;
    padding: 7px 4px 4px;
}
.market-row{
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 250px 164px;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    border: 1px solid rgba(183,138,57,0.25);
    border-radius: 6px;
    background: rgba(0,0,0,0.3);
}
.market-row.is-mine{
    border-color: rgba(183,138,57,0.55);
}
.market-row-tile{
    width: 56px;
    height: 56px;
    position: relative;
}
.market-row-tile .inventory-equipment-slot{
    width: 56px;
    height: 56px;
}
.market-row-name{
    color: var(--color-gameLight);
    font-weight: bold;
}
.market-row-meta{
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 0.82rem;
    color: var(--color-gameSlate);
    margin-top: 2px;
}
.market-tag{
    color: var(--color-gold);
}
.market-row-location.is-here{
    color: #8fc48f;
}
.market-time-left::before{
    content: "\23F1 ";
}
.market-price-main{
    color: var(--color-gold);
    font-weight: bold;
}
.market-price-sub{
    font-size: 0.8rem;
    color: var(--color-gameLight);
}
.market-price-sub.is-locked{
    color: var(--color-gameSlate);
    text-decoration: line-through;
}
.market-row-actions{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    width: 164px;
}
.market-row-note{
    font-size: 0.85rem;
    color: var(--color-gameSlate);
}
.market-row-note.is-good{ color: #8fc48f; }
.market-row-note.is-bad{ color: #d98b7a; }
.market-row-note.market-empty{
    padding: 18px;
    text-align: center;
}
.market-sell-layout{
    display: grid;
    grid-template-columns: minmax(440px, 1fr) minmax(520px, 0.82fr);
    gap: 14px;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
}
.market-sell-inventory{
    min-height: 0;
}
.market-sell-inventory .inventory-backpack-search{
    flex: 0 0 34px;
    width: 100%;
}
.market-sell-inventory .npc-shop-tile-grid{
    flex: 1 1 auto;
    align-content: start;
    max-height: none;
    min-height: 0;
    grid-template-columns: repeat(auto-fill, 56px);
    border: 1px solid rgba(183,138,57,0.32);
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
}
.market-body .inventory-equipment-slot.selected{
    outline: 2px solid var(--color-gold);
    outline-offset: 1px;
}
.market-sell-form{
    padding: 10px 12px;
    border: 1px solid rgba(183,138,57,0.35);
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    align-self: start;
}
.market-sell-title{
    display: flex;
    align-items: center;
    gap: 10px;
}
.market-sell-fields{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.market-sell-fields > .market-mode-toggle,
.market-sell-fields > .market-lockout-toggle,
.market-sell-fields > .market-hint{
    grid-column: 1 / -1;
}
.market-mode-toggle{
    display: flex;
    gap: 6px;
}
.market-mode-option{
    flex: 1 1 0;
    text-align: center;
    padding: 6px;
    border: 1px solid rgba(183,138,57,0.45);
    border-radius: 6px;
    cursor: pointer;
    color: var(--color-gameLight);
}
.market-mode-option.active{
    color: var(--color-gold);
    border-color: var(--color-gold);
    background: rgba(183,138,57,0.18);
    font-weight: bold;
}
.market-prompt-field{
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.market-prompt-label{
    color: var(--color-gold);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.04em;
}
.market-prompt-input{
    width: 100%;
    box-sizing: border-box;
    min-height: 32px;
    border: 1px solid rgba(183,138,57,0.55);
    border-radius: 4px;
    background: rgba(15,15,15,0.72);
    color: var(--color-gameLight);
    padding: 5px 8px;
}
.market-body input[type="number"],
.market-prompt-card input[type="number"]{
    appearance: textfield;
    -moz-appearance: textfield;
}
.market-body input[type="number"]::-webkit-inner-spin-button,
.market-body input[type="number"]::-webkit-outer-spin-button,
.market-prompt-card input[type="number"]::-webkit-inner-spin-button,
.market-prompt-card input[type="number"]::-webkit-outer-spin-button{
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}
.market-lockout-toggle{
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-gameLight);
    cursor: pointer;
}
.market-hint{
    font-size: 0.8rem;
}
.market-sell-preview{
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    border-top: 1px solid rgba(183,138,57,0.3);
}
.market-prompt-line{
    font-size: 0.85rem;
    color: var(--color-gameLight);
}
.market-prompt-card{
    width: min(92vw, 520px);
}
.market-prompt-body{
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.market-prompt-card .item-use-title-text{
    min-height: 0;
    padding-right: 34px;
}
.market-prompt-card .market-prompt-line{
    padding: 5px 7px;
    border-left: 2px solid rgba(183,138,57,0.5);
    background: rgba(0,0,0,0.18);
}
.market-prompt-input-wrap{
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(183,138,57,0.7);
    border-radius: 5px;
    background: rgba(0,0,0,0.32);
}
.market-prompt-coin-icon{
    width: 20px;
    height: 20px;
    justify-self: center;
    object-fit: contain;
}
.market-prompt-input-wrap .market-prompt-input{
    height: 34px;
    border: 0;
    border-left: 1px solid rgba(183,138,57,0.4);
    border-radius: 0;
    background: rgba(15,15,15,0.78);
    color: var(--color-gameLight);
}
.market-prompt-card .item-use-option{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.market-confirm-coin-icon{
    width: 20px;
    height: 20px;
    object-fit: contain;
}
.market-list-button{
    margin-top: 4px;
}
@media (max-width: 760px){
    .item-use-wrapper.inspect-frame.town-screen-standard{ top: 58px; bottom: 14px; height: auto; }
    .market-browse-workspace{ grid-template-columns: 180px minmax(0, 1fr); }
    .market-row{ grid-template-columns: 56px minmax(0, 1fr); }
    .market-row-prices, .market-row-actions{ grid-column: 2; justify-content: flex-start; }
    .market-sell-layout{ grid-template-columns: 1fr; overflow-y: auto; }
    .market-sell-fields{ grid-template-columns: 1fr; }
}
@media (max-width: 560px){
    .market-browse-workspace{ grid-template-columns: 1fr; }
    .market-category-panel{ max-height: 190px; }
}

/* Material deposits (2026-10-21) - overworld pins, dungeon markers, and the info popup. */
.overworld-pin.deposit-pin{
    background-color: #b58a3a;
    border-color: rgba(30,20,8,0.85);
    border-radius: 3px;
    transform: rotate(45deg);
}
.overworld-pin.deposit-pin.in-range:hover{
    transform: rotate(45deg) scale(1.4);
}
.overworld-pin.deposit-pin.has-image{
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-radius: 50%;
    transform: none;
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
}
.overworld-pin.deposit-pin.has-image.in-range:hover{
    transform: scale(1.3);
}
/* Harvesting (2026-11-01) - a green leaf for a patch, a brown-and-green tree mark for a grove, until the type has art. */
.overworld-pin.harvest-pin-patch{
    background-color: #6fae4a;
    border-color: rgba(14,32,8,0.85);
    border-radius: 50% 0;
}
.overworld-pin.harvest-pin-grove{
    width: 17px;
    height: 18px;
    margin: -9px 0 0 -8.5px;
    border: 0;
    border-radius: 0;
    background: linear-gradient(90deg,#70472b 0 40%,#9a6737 41% 59%,#70472b 60%) center bottom/5px 8px no-repeat,
        linear-gradient(145deg,#71964a,#365b38 72%);
    clip-path: polygon(50% 0,67% 12%,84% 12%,89% 27%,100% 41%,88% 58%,69% 64%,61% 61%,61% 100%,39% 100%,39% 61%,31% 64%,12% 58%,0 41%,11% 27%,16% 12%,33% 12%);
    filter: drop-shadow(0 0 1px #15271a) drop-shadow(0 1px 1px rgba(0,0,0,.9));
    opacity:.82;
}
.overworld-pin.harvest-pin-grove.in-range{ opacity:1; }
.overworld-pin.harvest-pin.in-range:hover{
    transform: scale(1.4);
}
.overworld-pin.harvest-pin.has-image{
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-radius: 50%;
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
}
.overworld-pin.harvest-pin-grove.has-image{
    margin:-11px 0 0 -11px;
    border:2px solid #5a3a1c;
    clip-path:none;
    filter:none;
}
/* Fishing pools (2026-10-31) - a blue circle until the pool type has art. */
.overworld-pin.pool-pin{
    background-color: #3f86c9;
    border-color: rgba(8,22,40,0.85);
    border-radius: 50%;
}
.overworld-pin.pool-pin.in-range:hover{
    transform: scale(1.4);
}
.overworld-pin.pool-pin.has-image{
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
}
.dungeon-view-marker-dot.deposit-marker-dot{
    border-radius: 2px;
    transform: rotate(45deg);
    background-color: #b58a3a;
}
.deposit-info{
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}
.deposit-info-row{
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.deposit-info-label{
    color: var(--color-gameSlate);
}
.deposit-info-value{
    color: var(--color-gameLight);
    font-weight: bold;
}
.deposit-info-bar{
    height: 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(183,138,57,0.45);
    overflow: hidden;
}
.deposit-info-bar-fill{
    height: 100%;
    background: linear-gradient(90deg, #8a6a2c, #d4aa3f);
}
/* Mining box (2026-10-22, Phase 2) - openMiningPanel() in world_map.js. */
.mining-card{
    position: relative;
    width: min(600px, calc(100vw - 32px));
    max-width: none; /* the shared .item-use-wrapper caps dialogs at 420px - too narrow for Grade / Remaining / Success */
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    overflow: visible;
    border: 1px solid #8b6b4b;
    border-radius: 13px;
    box-shadow:
        inset 0 0 0 1px rgba(199,142,91,.24),
        inset 0 0 26px rgba(23,17,12,.34),
        0 12px 32px rgba(0,0,0,.72),
        0 0 0 3px rgba(31,24,18,.88);
    background:
        radial-gradient(ellipse at 18% 0%, rgba(139,91,54,.08), transparent 52%),
        radial-gradient(ellipse at 86% 100%, rgba(79,88,58,.055), transparent 48%),
        #302e2a;
}
.deposit-inspect-frame .item-use-title-wrapper{
    width: 100%;
}
.deposit-inspect-frame .game-close,
.mining-title-wrapper .game-close{
    margin-left: auto;
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border: 1px solid transparent;
    border-radius: 0;
    clip-path: polygon(22% 0, 78% 0, 100% 22%, 100% 78%, 78% 100%, 22% 100%, 0 78%, 0 22%);
    background:
        linear-gradient(45deg, transparent 46%, #d6ad83 47% 53%, transparent 54%) center / 12px 12px no-repeat,
        linear-gradient(-45deg, transparent 46%, #d6ad83 47% 53%, transparent 54%) center / 12px 12px no-repeat,
        linear-gradient(#34302b, #201e1b) padding-box,
        linear-gradient(145deg, #c28758, #503a2b 72%) border-box;
    box-shadow: inset 0 0 0 1px rgba(216,158,105,.12), 0 3px 8px rgba(0,0,0,.48);
    filter: none;
    transition: filter .14s ease, transform .14s ease;
}
.deposit-inspect-frame .game-close:hover,
.mining-title-wrapper .game-close:hover{
    border-color: transparent;
    background:
        linear-gradient(45deg, transparent 46%, #f0c99f 47% 53%, transparent 54%) center / 12px 12px no-repeat,
        linear-gradient(-45deg, transparent 46%, #f0c99f 47% 53%, transparent 54%) center / 12px 12px no-repeat,
        linear-gradient(#40382f, #27221e) padding-box,
        linear-gradient(145deg, #dfa06c, #70503a 72%) border-box;
    box-shadow: inset 0 0 0 1px rgba(232,176,124,.18), 0 3px 9px rgba(0,0,0,.52);
    filter: brightness(1.08);
    transform: translateY(-1px);
}
.deposit-inspect-frame .game-close:active,
.mining-title-wrapper .game-close:active{
    transform: translateY(1px);
    filter: brightness(.92);
}
.deposit-inspect-frame .game-close:focus-visible,
.mining-title-wrapper .game-close:focus-visible{
    outline-color: #d49a68;
}
/* The vein preview is the first half of the mining experience, so it receives the same restrained
   forged-copper frame rather than falling back to the shared inspect-window ornaments. */
.item-use-wrapper.inspect-frame.deposit-inspect-frame{
    border: 1px solid #8b6b4b;
    border-radius: 13px;
    box-shadow: inset 0 0 0 1px rgba(199,142,91,.24), inset 0 0 24px rgba(23,17,12,.32), 0 12px 30px rgba(0,0,0,.7), 0 0 0 3px rgba(31,24,18,.88);
    background:
        radial-gradient(ellipse at 18% 0%, rgba(139,91,54,.08), transparent 52%),
        radial-gradient(ellipse at 86% 100%, rgba(79,88,58,.055), transparent 48%),
        #302e2a;
}
.item-use-wrapper.inspect-frame.deposit-inspect-frame::before,
.item-use-wrapper.inspect-frame.deposit-inspect-frame::after,
.deposit-inspect-frame .inspect-frame-corner::before,
.deposit-inspect-frame .inspect-frame-corner::after{
    width: 45px;
    height: 45px;
    border-top: 2px solid #a56f47;
    border-left: 2px solid #725239;
    border-radius: 13px 0 0;
    background: radial-gradient(circle at 8px 8px, #d09a67 0 2px, #5c3d2b 3px, transparent 4px);
    clip-path: none;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,.7));
}
.item-use-wrapper.inspect-frame.deposit-inspect-frame::before{ top: -5px; left: -5px; }
.item-use-wrapper.inspect-frame.deposit-inspect-frame::after{ right: -5px; bottom: -5px; transform: rotate(180deg); }
.deposit-inspect-frame .inspect-frame-corner::before{ top: -5px; right: -5px; transform: rotate(90deg); }
.deposit-inspect-frame .inspect-frame-corner::after{ bottom: -5px; left: -5px; transform: rotate(270deg); }
.deposit-inspect-frame .inspect-frame-ornament::before,
.deposit-inspect-frame .inspect-frame-ornament::after{
    width: 118px;
    height: 12px;
    background:
        radial-gradient(circle at 38% 50%, #9b6846 0 3px, transparent 4px),
        radial-gradient(circle at 50% 50%, #d09a67 0 4px, #66452f 5px, transparent 6px),
        radial-gradient(circle at 62% 50%, #718064 0 3px, transparent 4px),
        linear-gradient(90deg, transparent, #725039 20% 44%, transparent 45% 55%, #725039 56% 80%, transparent);
    clip-path: none;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.8));
}
.deposit-inspect-frame .inspect-frame-ornament::before{ top: -6px; }
.deposit-inspect-frame .inspect-frame-ornament::after{ bottom: -6px; }
/* Fine forged-copper corner lines and small mineral nodes give mining its own quieter silhouette. */
.mining-card::before,
.mining-card::after,
.mining-frame-corner::before,
.mining-frame-corner::after{
    content: "";
    position: absolute;
    z-index: 2;
    width: 45px;
    height: 45px;
    border-top: 2px solid #a56f47;
    border-left: 2px solid #725239;
    border-radius: 13px 0 0;
    background: radial-gradient(circle at 8px 8px, #d09a67 0 2px, #5c3d2b 3px, transparent 4px);
    clip-path: none;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,.7));
    pointer-events: none;
}
.mining-card::before{ top: -5px; left: -5px; }
.mining-card::after{ right: -5px; bottom: -5px; transform: rotate(180deg); }
.mining-frame-corner{
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.mining-frame-corner::before{ top: -5px; right: -5px; transform: rotate(90deg); }
.mining-frame-corner::after{ bottom: -5px; left: -5px; transform: rotate(270deg); }
.mining-frame-ornament{
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.mining-frame-ornament::before,
.mining-frame-ornament::after{
    content: "";
    position: absolute;
    z-index: 2;
    left: 50%;
    width: 118px;
    height: 12px;
    background:
        radial-gradient(circle at 38% 50%, #9b6846 0 3px, transparent 4px),
        radial-gradient(circle at 50% 50%, #d09a67 0 4px, #66452f 5px, transparent 6px),
        radial-gradient(circle at 62% 50%, #718064 0 3px, transparent 4px),
        linear-gradient(90deg, transparent, #725039 20% 44%, transparent 45% 55%, #725039 56% 80%, transparent);
    clip-path: none;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.8));
}
.mining-frame-ornament::before{ top: -6px; transform: translateX(-50%); }
.mining-frame-ornament::after{ bottom: -6px; transform: translateX(-50%) rotate(180deg); }
.mining-title-wrapper{
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(173,105,59,.62);
}
.mining-title-identity{
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}
.mining-deposit-portrait{
    width: 66px;
    height: 66px;
    flex: 0 0 66px;
    border: 1px solid color-mix(in srgb, var(--color-gold) 72%, #33280d);
    border-radius: 9px;
    background: rgba(0,0,0,0.28) var(--mining-image) center / 88% 88% no-repeat;
    box-shadow: inset 0 0 14px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.25);
}
.mining-deposit-portrait:not(.has-image)::before{
    content: "⛏";
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--color-gold);
    font-size: 30px;
}
.mining-title-copy{
    min-width: 0;
}
.mining-title-copy .item-use-title-text{
    text-align: left;
}
.mining-title-status{
    margin-top: 3px;
    color: var(--color-gameSlate);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.mining-card .mining-info{
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* Grade, Remaining, Success */
    gap: 7px;
}
.mining-card .mining-info .deposit-info-row{
    align-items: center;
    padding: 8px 10px;
    border: 1px solid rgba(183,138,57,0.24);
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
}
/* Fishing bait toggles (2026-10-31) - one on at a time. */
.fishing-bait-bar{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 8px 10px;
    border: 1px solid rgba(183,138,57,0.24);
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
}
.fishing-bait-label{ color: #dfc86f; font-family: var(--font-display); }
.fishing-bait-buttons{ display: flex; flex-wrap: wrap; gap: 6px; }
.fishing-bait-button{ opacity: 0.55; }
.fishing-bait-button:hover, .fishing-bait-button:focus-visible{ opacity: 0.85; }
.fishing-bait-button.is-on{ opacity: 1; box-shadow: 0 0 0 2px var(--color-gold), 0 0 10px rgba(207,159,52,0.55); }
.fishing-bait-empty, .fishing-bait-note{ color: var(--color-gameSlate); font-size: 0.85rem; }
.fishing-bait-note{ flex-basis: 100%; }
.mining-strike-panel{
    padding: 10px 12px 12px;
    border: 1px solid rgba(183,138,57,0.34);
    border-radius: 7px;
    background: rgba(0,0,0,0.28);
}
.mining-strike-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.mining-state{
    color: var(--color-gameLight);
    font-weight: bold;
}
.mining-countdown{
    min-width: 2.5em;
    color: var(--color-gold);
    font-size: 12px;
    font-weight: bold;
    text-align: right;
}
.mining-progress-track{
    height: 12px;
    overflow: hidden;
    border: 1px solid #191713;
    border-radius: 999px;
    background: repeating-linear-gradient(135deg, #171614 0 8px, #1d1b18 8px 16px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.65);
}
.mining-progress-fill{
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8e681d, var(--color-gold) 72%, #fff1a1);
    box-shadow: 0 0 10px color-mix(in srgb, var(--color-gold) 55%, transparent);
}
.mining-strike-panel:not(.is-active){
    opacity: .58;
}
@keyframes mining-strike-progress{
    from{ width: 0; }
    to{ width: 100%; }
}
.mining-result{
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid rgba(183,138,57,0.3);
    border-left-width: 4px;
    border-radius: 7px;
    background: rgba(0,0,0,0.24);
}
.mining-result-mark{
    --mining-mark-arm: 14px;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: var(--color-gold);
    font-size: 24px;
    font-weight: bold;
    position: relative;
}
.mining-result-copy{
    min-width: 0;
}
.mining-result-title{
    font-family: var(--font-display);
    color: var(--color-gameLight);
    font-weight: bold;
}
.mining-result-message{
    margin-top: 3px;
    color: var(--color-gameSlate);
    font-size: 13px;
    line-height: 1.25;
}
.mining-result.is-success{
    border-color: rgba(99,174,98,.55);
    background: linear-gradient(90deg, rgba(42,92,49,.3), rgba(0,0,0,.2));
}
.mining-result.is-success .mining-result-mark,
.mining-result.is-success .mining-result-title{
    color: #9bd494;
}
.mining-result.is-success .mining-result-mark{
    font-size: 0;
}
.mining-result.is-success .mining-result-mark::before,
.mining-result.is-success .mining-result-mark::after{
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--mining-mark-arm);
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 1px 2px rgba(0,0,0,.42);
    transform: translate(-50%, -50%);
}
.mining-result.is-success .mining-result-mark::after{
    transform: translate(-50%, -50%) rotate(90deg);
}
.mining-result.is-idle .mining-result-mark,
.mining-result.is-notice .mining-result-mark{
    color: #c8905f;
    font-size: 0;
}
/* Ready state: a small hand-drawn pick rather than the placeholder asterisk. */
.mining-result.is-idle .mining-result-mark::before,
.mining-result.is-notice .mining-result-mark::before{
    content: "";
    position: absolute;
    top: 51%;
    left: 50%;
    width: 3px;
    height: 19px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 1px 1px 2px rgba(0,0,0,.5);
    transform: translate(-50%, -50%) rotate(38deg);
}
.mining-result.is-idle .mining-result-mark::after,
.mining-result.is-notice .mining-result-mark::after{
    content: "";
    position: absolute;
    top: 34%;
    left: 50%;
    width: 18px;
    height: 8px;
    border-top: 3px solid currentColor;
    border-radius: 50% 50% 0 0;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.48));
    transform: translate(-50%, -50%) rotate(-7deg);
}
.mining-result.is-failure{
    border-color: rgba(166,91,75,.55);
    background: linear-gradient(90deg, rgba(91,42,35,.28), rgba(0,0,0,.2));
}
.mining-result.is-failure .mining-result-mark{
    color: #d08a78;
    font-size: 0;
}
/* Failed strike: draw the cross geometrically so it remains balanced at either badge size. */
.mining-result.is-failure .mining-result-mark::before,
.mining-result.is-failure .mining-result-mark::after{
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--mining-mark-arm);
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 1px 2px rgba(0,0,0,.42);
    transform: translate(-50%, -50%) rotate(45deg);
}
.mining-result.is-failure .mining-result-mark::after{
    transform: translate(-50%, -50%) rotate(-45deg);
}
.mining-result-pop{
    animation: mining-result-pop .24s ease-out;
}
.mining-result.is-success.mining-result-pop{
    animation: mining-result-pop .24s ease-out, mining-success-flash .9s ease-out;
}
@keyframes mining-result-pop{
    from{ opacity: .35; transform: translateY(4px); }
    to{ opacity: 1; transform: translateY(0); }
}
@keyframes mining-success-flash{
    0%{
        border-color: #fff2a0;
        box-shadow: 0 0 0 0 rgba(255,215,0,.85), inset 0 0 24px rgba(255,215,0,.5);
        filter: brightness(1.45);
    }
    45%{
        box-shadow: 0 0 0 5px rgba(255,215,0,.2), 0 0 24px rgba(255,215,0,.75), inset 0 0 12px rgba(255,215,0,.24);
        filter: brightness(1.12);
    }
    100%{
        border-color: rgba(99,174,98,.55);
        box-shadow: 0 0 0 9px rgba(255,215,0,0), 0 0 0 rgba(255,215,0,0), inset 0 0 0 rgba(255,215,0,0);
        filter: brightness(1);
    }
}
.mining-loot-header{
    font-family: var(--font-display);
    color: var(--color-gold);
    padding-top: 2px;
}
.mining-card .loot-screen-grid{
    min-height: 0;
    padding: 7px;
    border: 1px solid #625b50;
    border-radius: 7px;
    background: rgba(0,0,0,0.35);
}
/* Fishing shares mining's behavior, but not its forged-copper visual language. Water-blue
   edging, curling corners and flowing wave crests keep this panel distinct from deposits. */
.gathering-card-fishing{
    border-color:#357f99;
    background:
        radial-gradient(ellipse at 14% 0%,rgba(54,155,183,.16),transparent 48%),
        radial-gradient(ellipse at 88% 100%,rgba(24,91,126,.16),transparent 52%),
        linear-gradient(155deg,#28353a,#20292d 48%,#1b2428);
    box-shadow:
        inset 0 0 0 1px rgba(141,225,232,.18),
        inset 0 0 30px rgba(7,32,47,.48),
        0 12px 32px rgba(0,0,0,.72),
        0 0 0 3px rgba(8,27,39,.9),
        0 0 18px rgba(45,147,179,.16);
}
.gathering-card-fishing::before,
.gathering-card-fishing::after,
.gathering-card-fishing .mining-frame-corner::before,
.gathering-card-fishing .mining-frame-corner::after{
    width:56px;
    height:56px;
    border:0;
    border-radius:0;
    background:url("../images/icons/fishing/frame-corner.svg") center/contain no-repeat;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.72)) drop-shadow(0 0 3px rgba(76,191,211,.25));
}
.gathering-card-fishing::before{ top:-7px; left:-7px; }
.gathering-card-fishing::after{ right:-7px; bottom:-7px; transform:rotate(180deg); }
.gathering-card-fishing .mining-frame-corner::before{ top:-7px; right:-7px; transform:rotate(90deg); }
.gathering-card-fishing .mining-frame-corner::after{ bottom:-7px; left:-7px; transform:rotate(270deg); }
.gathering-card-fishing .mining-frame-ornament::before,
.gathering-card-fishing .mining-frame-ornament::after{
    width:190px;
    height:26px;
    background:url("../images/icons/fishing/frame-wave.svg") center/contain no-repeat;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.76)) drop-shadow(0 0 4px rgba(73,190,211,.3));
}
.gathering-card-fishing .mining-frame-ornament::before{ top:-13px; }
.gathering-card-fishing .mining-frame-ornament::after{ bottom:-13px; }
.gathering-card-fishing .mining-title-wrapper{ border-bottom-color:rgba(71,169,195,.58); }
.gathering-card-fishing .mining-deposit-portrait{ border-color:#4fa8c0; box-shadow:inset 0 0 14px rgba(0,19,31,.62),0 4px 12px rgba(0,0,0,.3),0 0 9px rgba(73,183,202,.12); }
.gathering-card-fishing .mining-info .deposit-info-row,
.gathering-card-fishing .fishing-bait-bar,
.gathering-card-fishing .mining-strike-panel{ border-color:rgba(71,164,191,.34); background:rgba(4,20,29,.3); }
.gathering-card-fishing .mining-result.is-idle,
.gathering-card-fishing .mining-result.is-notice{ border-color:rgba(71,164,191,.34); background:rgba(4,20,29,.3); }
.gathering-card-fishing .fishing-bait-label,
.gathering-card-fishing .mining-loot-header,
.gathering-card-fishing .mining-countdown{ color:#83d8e2; }
.gathering-card-fishing .fishing-bait-button.is-on{ box-shadow:0 0 0 2px #57b8cb,0 0 11px rgba(71,185,205,.62); }
.gathering-card-fishing .mining-progress-track{ border-color:#0b2939; background:repeating-linear-gradient(135deg,#102630 0 8px,#15323d 8px 16px); }
.gathering-card-fishing .mining-progress-fill{ background:linear-gradient(90deg,#216a87,#54bdd0 70%,#b4f1ed); box-shadow:0 0 10px rgba(74,188,207,.58); }
.gathering-card-fishing .mining-result.is-idle .mining-result-mark,
.gathering-card-fishing .mining-result.is-notice .mining-result-mark{ color:#69c5d4; }
.gathering-card-fishing .mining-result.is-idle .mining-result-mark::before,
.gathering-card-fishing .mining-result.is-notice .mining-result-mark::before{
    top:50%;
    left:50%;
    width:30px;
    height:30px;
    border:0;
    border-radius:0;
    background:url("../images/icons/fishing/rod.svg") center/contain no-repeat;
    box-shadow:none;
    transform:translate(-50%,-50%);
}
.gathering-card-fishing .mining-result.is-idle .mining-result-mark::after,
.gathering-card-fishing .mining-result.is-notice .mining-result-mark::after{ display:none; }
.gathering-card-fishing .mining-deposit-portrait:not(.has-image)::before{
    content:"";
    background:url("../images/icons/fishing/rod.svg") center/34px 34px no-repeat;
}
.gathering-card-fishing .game-close{
    background:
        linear-gradient(45deg,transparent 46%,#9be8ec 47% 53%,transparent 54%) center/12px 12px no-repeat,
        linear-gradient(-45deg,transparent 46%,#9be8ec 47% 53%,transparent 54%) center/12px 12px no-repeat,
        linear-gradient(#243d48,#142a34) padding-box,
        linear-gradient(145deg,#65c4d2,#24556d 72%) border-box;
    box-shadow:inset 0 0 0 1px rgba(154,232,237,.12),0 3px 8px rgba(0,0,0,.48);
}
.gathering-card-fishing .game-close:hover{
    background:
        linear-gradient(45deg,transparent 46%,#d0ffff 47% 53%,transparent 54%) center/12px 12px no-repeat,
        linear-gradient(-45deg,transparent 46%,#d0ffff 47% 53%,transparent 54%) center/12px 12px no-repeat,
        linear-gradient(#31515c,#19343e) padding-box,
        linear-gradient(145deg,#8be3e8,#34758c 72%) border-box;
}
.gathering-card-fishing .game-close:focus-visible{ outline-color:#79d9e1; }
/* Harvesting patches use living vinework rather than Mining's forged-copper frame. The darker
   stems keep the ornament legible over the map while moss and new-growth greens identify the
   activity without recoloring the dense interface content. */
.gathering-card-patch{
    border-color:#527345;
    box-shadow:
        inset 0 0 0 1px rgba(139,174,99,.22),
        inset 0 0 28px rgba(18,45,25,.3),
        0 12px 32px rgba(0,0,0,.72),
        0 0 0 3px rgba(20,31,22,.9),
        0 0 17px rgba(94,145,65,.12);
}
.gathering-card-patch::before,
.gathering-card-patch::after,
.gathering-card-patch .mining-frame-corner::before,
.gathering-card-patch .mining-frame-corner::after{
    width:56px;
    height:56px;
    border:0;
    border-radius:0;
    background:url("../images/icons/harvesting/patch-frame-corner.svg") center/contain no-repeat;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.72)) drop-shadow(0 0 3px rgba(116,170,80,.24));
}
.gathering-card-patch::before{ top:-7px; left:-7px; }
.gathering-card-patch::after{ right:-7px; bottom:-7px; transform:rotate(180deg); }
.gathering-card-patch .mining-frame-corner::before{ top:-7px; right:-7px; transform:rotate(90deg); }
.gathering-card-patch .mining-frame-corner::after{ bottom:-7px; left:-7px; transform:rotate(270deg); }
.gathering-card-patch .mining-frame-ornament::before,
.gathering-card-patch .mining-frame-ornament::after{
    width:190px;
    height:28px;
    background:url("../images/icons/harvesting/patch-frame-vine.svg") center/contain no-repeat;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.78)) drop-shadow(0 0 4px rgba(126,181,82,.24));
}
.gathering-card-patch .mining-frame-ornament::before{ top:-14px; }
.gathering-card-patch .mining-frame-ornament::after{ bottom:-14px; }
.gathering-card-patch .mining-title-wrapper{ border-bottom-color:rgba(105,151,75,.56); }
.gathering-card-patch .mining-deposit-portrait{ border-color:#65934e; }
.gathering-card-patch .mining-info .deposit-info-row,
.gathering-card-patch .mining-strike-panel{ border-color:rgba(101,148,76,.3); }
.gathering-card-patch .mining-loot-header,
.gathering-card-patch .mining-countdown{ color:#a8ce79; }
.gathering-card-patch .mining-progress-track{ border-color:#1b3823; }
.gathering-card-patch .mining-progress-fill{ background:linear-gradient(90deg,#38643a,#79aa50 70%,#c9df89); box-shadow:0 0 10px rgba(109,166,72,.48); }
.gathering-card-patch .mining-result.is-idle .mining-result-mark,
.gathering-card-patch .mining-result.is-notice .mining-result-mark{ color:#87b55d; }
.gathering-card-patch .mining-result.is-idle .mining-result-mark::before,
.gathering-card-patch .mining-result.is-notice .mining-result-mark::before{
    top:50%;
    left:50%;
    width:30px;
    height:30px;
    border:0;
    border-radius:0;
    background:url("../images/icons/harvesting/sickle.svg") center/contain no-repeat;
    box-shadow:none;
    transform:translate(-50%,-50%);
}
.gathering-card-patch .mining-result.is-idle .mining-result-mark::after,
.gathering-card-patch .mining-result.is-notice .mining-result-mark::after{ display:none; }
.gathering-card-patch .mining-result.is-idle .mining-result-mark,
.gathering-card-patch .mining-result.is-notice .mining-result-mark{
    border-color:#8dbb62;
    box-shadow:inset 0 0 8px rgba(91,139,65,.12),0 0 5px rgba(108,160,75,.1);
}
.gathering-card-patch .mining-deposit-portrait:not(.has-image)::before{
    content:"";
    background:url("../images/icons/harvesting/sickle.svg") center/38px 38px no-repeat;
}
/* Groves pair bark-brown structure with restrained canopy green. This keeps them related to
   Patches while reading as woodcutting rather than another leafy harvesting panel. */
.gathering-card-grove{
    border-color:#745037;
    background:
        radial-gradient(ellipse at 15% 0%,rgba(91,128,65,.1),transparent 48%),
        radial-gradient(ellipse at 86% 100%,rgba(111,70,40,.1),transparent 50%),
        #302e2a;
    box-shadow:
        inset 0 0 0 1px rgba(166,119,75,.22),
        inset 0 0 28px rgba(47,32,22,.34),
        0 12px 32px rgba(0,0,0,.72),
        0 0 0 3px rgba(35,27,21,.9),
        0 0 17px rgba(86,125,62,.1);
}
.gathering-card-grove::before,
.gathering-card-grove::after,
.gathering-card-grove .mining-frame-corner::before,
.gathering-card-grove .mining-frame-corner::after{
    width:56px;
    height:56px;
    border:0;
    border-radius:0;
    background:url("../images/icons/harvesting/grove-frame-corner.svg") center/contain no-repeat;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.74)) drop-shadow(0 0 3px rgba(93,136,67,.18));
}
.gathering-card-grove::before{ top:-7px; left:-7px; }
.gathering-card-grove::after{ right:-7px; bottom:-7px; transform:rotate(180deg); }
.gathering-card-grove .mining-frame-corner::before{ top:-7px; right:-7px; transform:rotate(90deg); }
.gathering-card-grove .mining-frame-corner::after{ bottom:-7px; left:-7px; transform:rotate(270deg); }
.gathering-card-grove .mining-frame-ornament::before{
    top:-19px;
    width:min(62%,380px);
    height:38px;
    background:url("../images/icons/harvesting/grove-frame-canopy.svg") center/contain no-repeat;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.76)) drop-shadow(0 0 4px rgba(105,145,74,.16));
}
.gathering-card-grove .mining-frame-ornament::after{
    bottom:-20px;
    width:80%;
    height:40px;
    background:url("../images/icons/harvesting/grove-frame-roots.svg?v=2") center/contain no-repeat;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.78));
    transform:translateX(-50%);
}
.gathering-card-grove .mining-title-wrapper{ border-bottom-color:rgba(128,91,56,.62); }
.gathering-card-grove .mining-deposit-portrait{ border-color:#7f6740; }
.gathering-card-grove .mining-info .deposit-info-row,
.gathering-card-grove .mining-strike-panel{ border-color:rgba(120,91,57,.38); background:rgba(28,24,18,.28); }
.gathering-card-grove .mining-loot-header,
.gathering-card-grove .mining-countdown{ color:#a8c477; }
.gathering-card-grove .mining-progress-track{ border-color:#2d241b; }
.gathering-card-grove .mining-progress-fill{ background:linear-gradient(90deg,#65452d,#7f9d50 68%,#c1d681); box-shadow:0 0 10px rgba(105,149,73,.4); }
.gathering-card-grove .mining-result.is-idle .mining-result-mark,
.gathering-card-grove .mining-result.is-notice .mining-result-mark{ color:#a67a49; border-color:#a67a49; box-shadow:inset 0 0 8px rgba(90,126,61,.1); }
.gathering-card-grove .mining-result.is-idle .mining-result-mark::before,
.gathering-card-grove .mining-result.is-notice .mining-result-mark::before{
    top:50%;
    left:50%;
    width:38px;
    height:38px;
    border:0;
    border-radius:0;
    background:url("../images/icons/harvesting/woodcutters-axe.svg") center/contain no-repeat;
    box-shadow:none;
    transform:translate(-50%,-50%);
}
.gathering-card-grove .mining-result.is-idle .mining-result-mark::after,
.gathering-card-grove .mining-result.is-notice .mining-result-mark::after{ display:none; }
.gathering-card-grove .mining-deposit-portrait:not(.has-image)::before{
    content:"";
    background:url("../images/icons/harvesting/woodcutters-axe.svg") center/42px 42px no-repeat;
}
@media (max-width: 560px){
    .mining-card .mining-info{ grid-template-columns: 1fr; }
    .mining-deposit-portrait{ width: 54px; height: 54px; flex-basis: 54px; }
}
.item-use-option.disabled{
    filter: grayscale(100%) brightness(0.7);
    cursor: default;
}
.mining-loot-button{
    margin-left: auto;
}
/* The owner's Discernment debug toggle (navbar eye) while it's on. */
.iconsButton.discern-debug-on{
    box-shadow: 0 0 0 2px var(--color-gold) inset;
    filter: drop-shadow(0 0 4px var(--color-gold));
}
/* The mining window docked in the Inventory screen ("Manage inventory" from mining, 2026-10-23) - a
   full-width row under the paperdoll + backpack, like the Available Loot panel, still mining. */
.inventory-main-outter-wrapper > .mining-card.mining-card-docked{
    grid-column: 1 / -1;
    width: auto;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    box-shadow:
        inset 0 0 0 1px rgba(199,142,91,.24),
        inset 0 0 26px rgba(23,17,12,.34);
}
/* Docked (owner layout 2026-10-23), three rows:
     1. the deposit's name, with Remaining / Success at the right (no close X - Close is in the buttons)
     2. the strike countdown | the last strike's result | the mined loot
     3. Mine / Loot All / Close, centred
   The "Mined" heading is dropped - the loot box speaks for itself. */
.inventory-main-outter-wrapper > .mining-card.mining-card-docked{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 10px;
    padding: 10px 14px;
}
.mining-card-docked > .mining-title-wrapper{ grid-column: 1 / -1; grid-row: 1; padding-bottom: 8px; }
.mining-card-docked > .mining-title-wrapper > .game-close{ display: none; }
.mining-card-docked > .mining-info{
    grid-column: 2 / -1; grid-row: 1;
    justify-self: end; align-self: center;
    display: flex; flex-direction: row; gap: 8px; margin-bottom: 8px;
    position: relative; z-index: 1;
}
.mining-card-docked > .mining-info .deposit-info-row{ padding: 5px 10px; gap: 14px; }
.mining-card-docked > .mining-strike-panel{ grid-column: 1; grid-row: 2; padding: 8px 10px; align-self: stretch; }
.mining-card-docked > .mining-result{ grid-column: 2; grid-row: 2; min-height: 0; padding: 8px 10px; align-self: stretch; }
.mining-card-docked > .mining-loot-header{ display: none; }
.mining-card-docked > .container-loot-empty,
.mining-card-docked > .loot-screen-grid{ grid-column: 3; grid-row: 2; align-self: stretch; max-height: 110px; overflow-y: auto; margin: 0; }
.mining-card-docked > .loot-screen-actions{ grid-column: 1 / -1; grid-row: 3; justify-content: center; }
.mining-card-docked > .loot-screen-actions .item-use-option{ flex: 0 0 180px; }
.mining-card-docked .mining-deposit-portrait{ width: 40px; height: 40px; flex: 0 0 40px; }
.mining-card-docked .mining-result-mark{ --mining-mark-arm: 11px; width: 26px; height: 26px; flex: 0 0 26px; }
/* Docked fishing keeps its controls in one centered vertical lane: status, bait, then actions.
   Mining has no bait bar and retains the original three-column action layout. */
.inventory-main-outter-wrapper > .gathering-card-fishing.mining-card-docked > .fishing-bait-bar{
    grid-column:2;
    grid-row:3;
    justify-self:stretch;
    justify-content:center;
    margin:0;
}
.inventory-main-outter-wrapper > .gathering-card-fishing.mining-card-docked > .loot-screen-actions{
    grid-column:2;
    grid-row:4;
    width:100%;
    justify-self:stretch;
}
.inventory-main-outter-wrapper > .gathering-card-fishing.mining-card-docked > .loot-screen-actions .item-use-option{
    min-width:0;
    flex:1 1 0;
}
@media (max-width: 760px){
    .inventory-main-outter-wrapper > .mining-card.mining-card-docked{ grid-template-columns: 1fr; }
    .mining-card-docked > *{ grid-column: 1 !important; grid-row: auto !important; }
    .mining-card-docked > .mining-info{ justify-self: stretch; }
}
/* ---------- Crafting station gallery + workshop window (scripts/crafting.js, 2026-10-24) ---------- */
/* Wide enough for three station tiles a row; the same 80px gap below as above (owner request 2026-10-24). */
.item-use-wrapper.inspect-frame.npc-shop-frame.crafting-frame{
    box-sizing:border-box;
    overflow:visible;
}
.crafting-frame .item-use-title-wrapper{ flex:0 0 auto; }
.crafting-frame .item-use-inspect-details{
    flex:1 1 auto;
    min-height:0;
    max-height:none;
    box-sizing:border-box;
    overflow:hidden;
    align-items:stretch;
}
.crafting-body{ display:flex; flex:1 1 auto; flex-direction:column; gap:10px; width:100%; height:100%; min-height:0; overflow:hidden; }
.crafting-empty{ padding: 18px; color: var(--color-gameSlate); text-align: center; }
.crafting-station-intro{ display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.crafting-station-heading{ font-family: var(--font-display); color: var(--color-gold); font-size: 1.15rem; }
.crafting-station-grid{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.crafting-body.station-gallery .crafting-station-grid{ flex:1 1 auto; min-height:0; padding-right:5px; overflow-y:auto; align-content:start; scrollbar-gutter:stable; }
@media (max-width: 1100px){ .crafting-station-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.crafting-station-card{ position: relative; display: flex; flex-direction: column; height: 310px; min-height: 310px; padding: 0; overflow: hidden; border: 1px solid rgba(183,138,57,0.58); border-radius: 9px; background: rgba(16,14,12,0.72); color: var(--color-gameLight); text-align: left; cursor: pointer; isolation: isolate; transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease; }
.crafting-station-card:hover{ border-color: var(--color-gold); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.38), inset 0 0 18px rgba(183,138,57,0.08); }
.crafting-station-card:focus-visible{ outline: 2px solid var(--color-gold); outline-offset: 3px; }
.crafting-station-art{ position:relative; display:block; flex:0 0 190px; height:190px; box-sizing:border-box; overflow:hidden; background:#17130e var(--bg) center / contain no-repeat; border-bottom:1px solid rgba(183,138,57,0.35); }
.crafting-station-art::after{ content:""; position:absolute; inset:0; z-index:0; background:linear-gradient(180deg,rgba(0,0,0,.58),transparent 34%,transparent 68%,rgba(16,14,12,.74)); pointer-events:none; }
.crafting-station-copy{ display:flex; flex:1 1 auto; flex-direction:column; gap:6px; min-height:0; padding:10px 14px 11px; }
.crafting-station-title{ position:absolute; z-index:1; top:12px; left:14px; max-width:calc(100% - 120px); overflow:hidden; color:var(--color-gold); font-family:var(--font-display); font-size:1.08rem; line-height:1.2; text-overflow:ellipsis; text-shadow:0 2px 3px #000,0 0 8px #000; white-space:nowrap; }
.crafting-station-description{ display:-webkit-box; min-height:2.7em; overflow:hidden; color:var(--color-gameLight); opacity:.78; line-height:1.35; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.crafting-facilities.crafting-station-facilities{ display:block; flex:0 0 22px; min-width:0; overflow:hidden; color:#cbb77b; font-size:.75rem; line-height:22px; text-overflow:ellipsis; white-space:nowrap; }
.crafting-station-slots{ margin-top:auto; }
.crafting-station-ready{
    position: absolute;
    z-index: 2;
    top: 11px;
    right: 11px;
    padding: 6px 11px;
    border: 1px solid var(--color-gold);
    border-radius: 13px;
    color: #251c08;
    background: linear-gradient(180deg, #f1d35a, #c99c28);
    box-shadow: 0 3px 9px rgba(0,0,0,0.55);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}
.crafting-station-slots{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    padding-top: 7px;
    border-top: 1px solid rgba(183,138,57,0.2);
}
.crafting-station-slots-label{ margin-right: 3px; color: var(--color-gameSlate); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.crafting-station-slot{
    width: 12px;
    height: 12px;
    border: 1px solid rgba(183,138,57,0.5);
    border-radius: 2px;
    box-sizing: border-box;
}
.crafting-station-slot.empty{ background: rgba(0,0,0,0.34); box-shadow: inset 0 0 3px rgba(0,0,0,0.72); }
.crafting-station-slot.used{ border-color: #e0ba48; background: #c99c28; box-shadow: 0 0 5px rgba(212,175,55,0.52), inset 0 1px rgba(255,244,176,0.52); }
.crafting-back{ align-self: flex-start; padding: 2px 0; border: 0; background: none; color: #cbb77b; cursor: pointer; }
.crafting-back:hover{ color: var(--color-gold); text-decoration: underline; }
.crafting-title{ align-items: stretch !important; }
.crafting-title-copy{ display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 4px; }
.crafting-title-name{ color: var(--color-gold) !important; }
.crafting-title-description{ color: var(--color-gameLight) !important; opacity: 0.92; font-size: 1rem; font-weight: 400; line-height: 1.25; text-shadow: none; }
.crafting-title-facilities{ font-family: var(--font-body); font-weight: 400; text-shadow: none; }
.crafting-head-info{ display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.crafting-description{ color: var(--color-gameSlate); }
.crafting-facilities{ display: flex; flex-wrap: wrap; gap: 5px; }
.crafting-chip{ padding: 2px 8px; border: 1px solid rgba(183,138,57,0.45); border-radius: 10px; font-size: 0.75rem; color: #cbb77b; }
.crafting-slots{ text-align: right; flex: 0 0 auto; }
.crafting-slots-count{ font-family: var(--font-display); color: var(--color-gold); }
.crafting-slots-fee{ display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 0.8rem; color: var(--color-gameSlate); }
.crafting-tabs{ display: flex; gap: 6px; border-bottom: 1px solid rgba(183,138,57,0.35); }
.crafting-tab{ display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; cursor: pointer; color: var(--color-gameSlate); border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; }
.crafting-tab.active{ color: var(--color-gold); border-color: rgba(183,138,57,0.45); background: rgba(0,0,0,0.25); }
.crafting-tab.has-ready{ color: #e4cc70; }
.crafting-tab-ready{
    color: var(--color-gold);
    font-size: 0.78rem;
    line-height: 1;
    text-shadow: 0 0 5px rgba(255,215,0,0.8);
    animation: crafting-ready-pulse 2.2s ease-in-out infinite;
}
@keyframes crafting-ready-pulse{
    0%, 100%{ opacity: 0.58; transform: scale(0.88); text-shadow: 0 0 3px rgba(255,215,0,0.42); }
    50%{ opacity: 1; transform: scale(1.14); text-shadow: 0 0 8px rgba(255,215,0,0.95); }
}
.crafting-pane{ display:flex; flex:1 1 auto; flex-direction:column; gap:8px; min-height:0; overflow:hidden; }
.crafting-workshop-footer{ display: flex; align-items: center; min-height: 22px; margin-top: auto; padding-top: 7px; border-top: 1px solid rgba(183,138,57,0.28); }
.crafting-workshop-footer-slots{ display: flex; align-items: center; gap: 4px; }
.crafting-workshop-footer-label{ margin-right: 3px; color: #cbb77b; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.crafting-pane.crafting-jobs-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; align-content:start; overflow-y:auto; padding-right:4px; scrollbar-gutter:stable; }
.crafting-recipes-split{ display:grid; flex:1 1 auto; grid-template-columns:280px minmax(0,1fr); gap:12px; height:100%; min-height:0; overflow:hidden; }
/* Recipe list = the Market's category panel / tree / filters (owner request 2026-10-24: one style, both windows).
   Only the crafting-specific layout lives here. */
.crafting-recipe-panel{ height:100%; max-height:none; min-width:0; }
.crafting-recipe-tools{ padding: 8px; border-bottom: 1px solid rgba(183,138,57,0.38); }
.crafting-recipe-search-row{ display:flex; align-items:stretch; gap:6px; width:100%; min-width:0; }
.crafting-recipe-search-row .market-search{ flex:1 1 auto; width:auto; min-width:0; }
.crafting-can-make-filter{ flex:0 0 36px; width:36px; min-width:36px; min-height:34px; padding:5px; border-radius:5px; }
.crafting-can-make-filter svg{ display:block; width:22px; height:22px; fill:rgba(183,138,57,.12); stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.crafting-can-make-filter .crafting-can-make-check{ fill:none; stroke-width:2.15; }
.crafting-can-make-filter.active svg{ fill:rgba(183,138,57,.28); }
.crafting-recipe-panel .market-category-row.untrained{ opacity: 0.55; }
.crafting-recipe-detail{ display:flex; flex-direction:column; gap:10px; height:100%; min-width:0; min-height:0; overflow:hidden; }
.crafting-recipe-workspace{ display:flex; flex:1 1 auto; flex-direction:column; gap:10px; min-width:0; min-height:0; overflow:hidden; }
.crafting-recipe-materials{ display:grid; flex:1 1 auto; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; align-content:start; gap:10px; min-width:0; min-height:0; padding-right:4px; overflow-y:auto; scrollbar-gutter:stable; }
.crafting-recipe-setup{ display:grid; flex:0 0 auto; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:center; gap:10px; min-width:0; padding:9px 10px; border:1px solid rgba(183,138,57,0.32); border-radius:7px; background:rgba(0,0,0,0.18); }
.crafting-detail-name{ font-family: var(--font-display); color: var(--color-gold); font-size: 1.15rem; }
.crafting-skill-line{ color: var(--color-gameLight); }
.crafting-skill-line.untrained{ color: #e07a6a; }
.crafting-section{ display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border: 1px solid rgba(183,138,57,0.28); border-radius: 7px; background: rgba(0,0,0,0.22); }
.crafting-section-title{ font-family: var(--font-display); color: #cbb77b; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.crafting-item{ display: flex; align-items: center; gap: 10px; }
/* Ingredient / result icons are the Market's 56px item tile (.market-row-tile + makeShopTile()). */
.crafting-item-tile{ flex: 0 0 56px; }
.crafting-item-name{ flex: 1; min-width: 0; }
.crafting-item-qty{ color: var(--color-gameLight); }
.crafting-item.short .crafting-item-qty{ color: #e07a6a; }
.crafting-choice{ display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.crafting-choice-name{ color: #cbb77b; }
.crafting-option{ display: flex; align-items: flex-start; gap: 8px; padding: 5px 8px; border: 1px solid rgba(183,138,57,0.2); border-radius: 6px; cursor: pointer; }
.crafting-option > input[type="radio"]{ position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap; }
.crafting-option:has(> input[type="radio"]:focus-visible){ outline: 2px solid var(--color-gold); outline-offset: 2px; }
.crafting-option:hover{ border-color: rgba(183,138,57,0.62); background: rgba(183,138,57,0.06); }
.crafting-option.chosen{ border-color: var(--color-gold); background: rgba(183,138,57,0.1); }
.crafting-option-items{ display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.crafting-note{ color: var(--color-gameSlate); font-size: 0.8rem; }
.crafting-batch{ display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.crafting-batch-controls{ display: flex; align-items: center; justify-content: center; gap: 8px; }
.crafting-step{ width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(183,138,57,0.5); background: rgba(0,0,0,0.3); color: var(--color-gameLight); cursor: pointer; }
.crafting-step:disabled{ opacity: 0.38; filter: grayscale(1); cursor: default; }
.crafting-qty{ width: 64px; text-align: center; padding: 4px; border-radius: 6px; border: 1px solid rgba(183,138,57,0.5); background: rgba(0,0,0,0.35); color: var(--color-gameLight); appearance: textfield; -moz-appearance: textfield; }
.crafting-qty::-webkit-inner-spin-button,
.crafting-qty::-webkit-outer-spin-button{ margin: 0; appearance: none; -webkit-appearance: none; }
.crafting-estimate{ display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 3px 9px; border-left: 1px solid rgba(183,138,57,0.28); }
.crafting-production-label{ color: var(--color-gameSlate); }
.crafting-production-value{ display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; text-align: right; }
.crafting-coin-icon{ width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }
.crafting-start{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 34px;
    padding: 6px 14px;
    border: 1px solid rgba(224,186,72,0.72);
    border-radius: 5px;
    color: var(--color-gameLight);
    background: rgba(77,57,18,0.28);
    font-weight: 700;
    cursor: pointer;
}
.crafting-start:hover:not(:disabled),
.crafting-start:focus-visible:not(:disabled){ border-color: var(--color-gold); color: var(--color-gold); background: rgba(116,88,25,0.3); }
.crafting-start-price{ display: inline-flex; align-items: center; gap: 4px; color: #dfc86f; }
.crafting-start.disabled,
.crafting-collect.disabled{ filter: grayscale(100%) brightness(0.7); cursor: default; }
.crafting-job{ display: flex; flex: 0 0 auto; flex-direction: column; gap: 6px; min-height: 120px; box-sizing: border-box; padding: 9px 11px; border: 1px solid rgba(183,138,57,0.3); border-radius: 8px; background-color: rgba(0,0,0,0.22); }
.crafting-job.attended{
    background-image: linear-gradient(108deg, transparent 0%, rgba(255,224,112,0.13) 46%, rgba(255,238,164,0.2) 50%, rgba(255,224,112,0.13) 54%, transparent 100%);
    background-repeat: no-repeat;
    background-size: 12% 100%;
    background-position: -15% 0;
    animation: crafting-attended-shimmer 5.5s ease-in-out infinite;
}
@keyframes crafting-attended-shimmer{
    0%, 66%{ background-position: -15% 0; }
    89%, 100%{ background-position: 115% 0; }
}
.crafting-job.done{ border-color: var(--color-gold); }
.crafting-job-empty{
    align-items: center;
    justify-content: center;
    border-style: dashed;
    border-color: rgba(183,138,57,0.24);
    background-color: rgba(0,0,0,0.1);
    text-align: center;
}
.crafting-job-empty-title{ color: #a99770; font-family: var(--font-display); font-size: 0.82rem; }
.crafting-job-empty-detail{ color: var(--color-gameSlate); font-size: 0.75rem; }
.crafting-job-head{ display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.crafting-job-name{ font-family: var(--font-display); color: var(--color-gold); }
.crafting-job-pp{ color: var(--color-gameSlate); font-size: 0.85rem; white-space: nowrap; }
.crafting-job-head-actions{ display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.crafting-job-results{ color: var(--color-gameSlate); font-size: 0.8rem; white-space: nowrap; }
.crafting-job-bar{ height: 10px; border-radius: 5px; background: rgba(0,0,0,0.45); border: 1px solid rgba(183,138,57,0.45); overflow: hidden; }
.crafting-job-fill{ height: 100%; background: linear-gradient(90deg, #8a6a2c, #d4aa3f); transition: width 0.4s ease; }
.crafting-job-controls{ display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.crafting-job-timer{ color: var(--color-gameSlate); font-size: 0.85rem; white-space: nowrap; transition: color 0.12s ease; }
.crafting-job-timer.preview{ color: #dfc86f; }
.crafting-attend-button{
    min-width: 112px;
    padding: 5px 12px;
    border: 1px solid rgba(183,138,57,0.55);
    border-radius: 5px;
    color: var(--color-gameLight);
    background: rgba(0,0,0,0.28);
    cursor: pointer;
}
.crafting-attend-button:hover:not(:disabled),
.crafting-attend-button:focus-visible{
    border-color: var(--color-gold);
    color: #f2df91;
    background: rgba(116,88,25,0.28);
}
.crafting-attend-button.active{
    border-color: var(--color-gold);
    color: #211b0d;
    background: var(--color-gold);
}
.crafting-attend-button.blocked{ opacity: 0.42; cursor: not-allowed; }
.crafting-attendance-summary{
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 14px;
    padding: 8px 11px;
    border-top: 1px solid rgba(183,138,57,0.36);
    color: var(--color-gameSlate);
    font-size: 0.8rem;
}
.crafting-attendance-summary-label{ color: #cbb77b; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.crafting-attendance-summary-item{ display: flex; align-items: center; gap: 7px; }
.crafting-attendance-summary-item + .crafting-attendance-summary-item{ padding-left: 14px; border-left: 1px solid rgba(183,138,57,0.3); }
.crafting-attendance-summary-item strong{ color: var(--color-gameLight); font-weight: 700; }
.crafting-attendance-workshops{ display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.crafting-attendance-separator{ color: var(--color-gameSlate); }
.crafting-attendance-workshop{
    padding: 1px 3px;
    border: 0;
    color: #cbb77b;
    background: none;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.crafting-attendance-workshop:hover,
.crafting-attendance-workshop:focus-visible{ color: var(--color-gold); }
.crafting-job-loot{ padding: 7px; border: 1px solid #625b50; border-radius: 7px; background: rgba(0,0,0,0.35); }
.crafting-salvage{ opacity: 0.85; outline: 1px dashed rgba(224,122,106,0.6); outline-offset: -2px; }
.crafting-collect{
    flex: 0 0 auto;
    padding: 3px 9px;
    border: 1px solid rgba(183,138,57,0.48);
    border-radius: 4px;
    color: #d5c9ad;
    background: rgba(0,0,0,0.18);
    font-size: 0.76rem;
    cursor: pointer;
}
.crafting-collect:hover,
.crafting-collect:focus-visible{ border-color: var(--color-gold); color: var(--color-gold); background: rgba(116,88,25,0.2); }
@media (prefers-reduced-motion: reduce){
    .crafting-job.attended{ animation: none; background-image: none; }
    .crafting-tab-ready{ animation: none; opacity: 1; }
}
@media (max-width: 1100px){
    .crafting-recipe-materials{ grid-template-columns: 1fr; }
    .crafting-recipe-setup{ grid-template-columns: 1fr; align-items: stretch; }
    .crafting-estimate{ border-left: 0; border-top: 1px solid rgba(183,138,57,0.28); border-bottom: 1px solid rgba(183,138,57,0.28); }
}
@media (max-width: 850px){
    .crafting-pane.crafting-jobs-grid{ grid-template-columns: 1fr; }
    .crafting-attendance-summary{ align-items: flex-start; flex-direction: column; }
    .crafting-attendance-summary-item + .crafting-attendance-summary-item{ padding-left: 0; border-left: 0; }
}
@media (max-width: 700px){
    .crafting-station-grid{ grid-template-columns: 1fr; }
    .crafting-station-card{ height:290px; min-height:290px; }
    .crafting-station-art{ height:170px; flex-basis:170px; }
    .crafting-recipes-split{ grid-template-columns:1fr; overflow-y:auto; }
    .crafting-recipe-panel{ height:220px; min-height:220px; }
    .crafting-recipe-detail{ height:auto; min-height:520px; overflow:visible; }
    .crafting-recipe-workspace{ overflow:visible; }
    .crafting-production{ grid-template-columns: 1fr; }
}
.crafting-frame .crafting-description{ color: var(--color-gameLight); opacity: 0.8; }
.crafting-tab{ color: var(--color-gameLight); opacity: 0.7; }
.crafting-tab.active{ opacity: 1; }

/* ---------- Player chat (scripts/chat.js, 2026-10-26) - movable, resizable, collapsible ---------- */
.chat-panel{ position: fixed; left: 12px; bottom: 12px; z-index: 900; width: min(380px, calc(100vw - 24px)); height: min(280px, calc(100vh - 24px));
    box-sizing: border-box; min-width: 300px; min-height: 190px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid rgba(183,138,57,0.6); border-radius: 8px; background: var(--chat-window-bg, rgba(18,16,13,0.92)); box-shadow: 0 8px 22px rgba(0,0,0,0.55);
    color: var(--color-gameLight); font-family: var(--font-ui); font-size: var(--chat-window-font-size, 14px); }
.chat-panel-extra{ z-index: 901; }
.chat-panel.dragging,
.chat-panel.resizing{ user-select: none; }
.chat-panel.repositioning{ transition: left 260ms ease, top 260ms ease; }
.chat-head{ display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-bottom: 1px solid rgba(183,138,57,0.35); cursor: move; touch-action: none; }
.chat-panel.collapsed{ height: auto !important; min-height: 0; resize: none; }
.chat-panel.collapsed .chat-head{ border-bottom: 0; }
.chat-resize-handle{ position: absolute; z-index: 2; width: 15px; height: 15px; touch-action: none; }
.chat-resize-n{ top:0; left:15px; right:15px; width:auto; height:7px; cursor:ns-resize; }
.chat-resize-s{ bottom:0; left:15px; right:15px; width:auto; height:7px; cursor:ns-resize; }
.chat-resize-w{ top:15px; bottom:15px; left:0; width:7px; height:auto; cursor:ew-resize; }
.chat-resize-e{ top:15px; right:0; bottom:15px; width:7px; height:auto; cursor:ew-resize; }
.chat-resize-nw{ z-index:3; top:0; left:0; cursor:nwse-resize; }
.chat-resize-ne{ z-index:3; top:0; right:0; cursor:nesw-resize; }
.chat-resize-sw{ z-index:3; bottom:0; left:0; cursor:nesw-resize; }
.chat-resize-se{ z-index:3; right:0; bottom:0; cursor:nwse-resize; }
.chat-panel.collapsed .chat-resize-handle{ display: none; }
.chat-tabs{ display: flex; gap: 2px; flex: 0 1 auto; min-width: 42px; }
.chat-tab{ padding: 2px 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--color-gameSlate); font: inherit; font-size: 0.78rem; cursor: pointer; }
.chat-tab:hover{ color: var(--color-gold); }
.chat-tab.active{ border-color: rgba(183,138,57,0.6); background: rgba(183,138,57,0.16); color: var(--color-gold); }
.chat-tab.dragging-tab{ opacity:.45; cursor:grabbing; }
.chat-unread{ min-width: 18px; padding: 0 5px; border-radius: 9px; background: #b5462f; color: #fff; font-size: 0.72rem; text-align: center; }
.chat-toggle{ width: 24px; height: 22px; border: 1px solid rgba(183,138,57,0.45); border-radius: 4px; background: transparent; color: var(--color-gold); cursor: pointer; }
.chat-window-action{ flex: 0 0 24px; width: 24px; height: 22px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #86b8d4; font: inherit; line-height: 20px; cursor: pointer; }
.chat-settings-toggle{ margin-left:auto; }
.chat-window-action:hover,
.chat-window-action:focus-visible,
.chat-window-action.active{ border-color: rgba(134,184,212,.5); background: rgba(134,184,212,.12); color: #b9dcf0; outline: none; }
.chat-window-close:hover,
.chat-window-close:focus-visible{ color: #e07a6a; }
.chat-drop-preview{ position:fixed; z-index:899; box-sizing:border-box; border:2px dashed #86b8d4; border-radius:8px; background:rgba(134,184,212,.12); box-shadow:0 0 14px rgba(134,184,212,.45); pointer-events:none; }
.chat-drop-preview.tab-dock{ z-index:904; border-color:var(--color-gold); background:rgba(183,138,57,.18); }
.chat-drop-preview.window-stick{ border-style:solid; background:rgba(134,184,212,.08); }
.chat-workspace-window .chat-tabs{ flex:1 1 auto; overflow-x:auto; scrollbar-width:thin; }
.chat-workspace-window .chat-tab{ flex:0 0 auto; display:flex; align-items:center; gap:4px; }
.chat-tab-unread{ min-width:16px; padding:0 4px; border-radius:8px; background:#b5462f; color:#fff; font-size:.66rem; text-align:center; }
.chat-window-grip{ flex:0 0 18px; color:var(--color-gameSlate); text-align:center; cursor:move; user-select:none; }
.chat-drop-preview{ display:flex; align-items:center; justify-content:center; color:#d9f1ff; font-size:12px; font-weight:bold; text-shadow:0 1px 2px #000; }
.chat-drop-preview.tab-reorder,
.chat-drop-preview.tab-dock,
.chat-drop-preview.window-dock{ border-radius:2px; }
.chat-drop-preview.window-snap{ border-style:solid; }
.chat-snap-bridge{
    position:fixed;
    z-index:898;
    pointer-events:none;
    background:
        repeating-linear-gradient(135deg,rgba(134,184,212,.42) 0 5px,rgba(134,184,212,.13) 5px 10px),
        rgba(36,79,105,.34);
    border:1px solid rgba(167,216,241,.7);
    box-sizing:border-box;
    filter:drop-shadow(0 0 5px rgba(134,184,212,.55));
}

/* Chat management is rendered inside the shared Settings overlay. */
.chat-manager{ position:fixed; left:10px; bottom:42px; z-index:935; box-sizing:border-box; width:min(430px,calc(100vw - 20px)); max-height:min(650px,calc(100vh - 54px)); display:flex; flex-direction:column; overflow:hidden; border:1px solid rgba(183,138,57,.7); border-radius:8px; background:rgba(18,16,13,.98); color:var(--color-gameLight); font-family:var(--font-ui); box-shadow:0 10px 28px rgba(0,0,0,.65); }
.chat-manager-head{ display:flex; align-items:center; gap:8px; padding:8px 10px; border-bottom:1px solid rgba(183,138,57,.35); }
.chat-manager-title{ flex:1; margin:0; color:var(--color-gold); font-family:var(--font-display); font-size:1rem; font-weight:normal; }
.chat-manager-actions,
.chat-manager-recovery,
.chat-box-manager-buttons{ display:flex; flex-wrap:wrap; gap:6px; }
.chat-manager-actions{ padding:7px 9px 0; }
.chat-manager-content{ min-height:0; overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding:9px; }
.chat-manager-recovery{ padding:8px 9px; border-top:1px solid rgba(183,138,57,.25); }
.chat-manager-tab,
.chat-manager-button,
.chat-manager-primary{ padding:4px 9px; border:1px solid rgba(183,138,57,.4); border-radius:4px; background:rgba(183,138,57,.08); color:var(--color-gameLight); font:inherit; font-size:.78rem; cursor:pointer; }
.chat-manager-tab.active,
.chat-manager-primary{ border-color:rgba(183,138,57,.75); background:rgba(183,138,57,.2); color:var(--color-gold); }
.chat-manager-button.danger{ margin-left:auto; border-color:rgba(224,122,106,.45); color:#e7a095; }
.chat-manager-field{ display:grid; gap:4px; color:var(--color-gameSlate); font-size:.75rem; }
.chat-manager-field input,
.chat-box-manager-top input{ min-width:0; padding:5px 7px; border:1px solid rgba(183,138,57,.45); border-radius:4px; background:rgba(0,0,0,.35); color:var(--color-gameLight); font:inherit; }
.chat-filter-editor{ margin:0; padding:7px; border:1px solid rgba(183,138,57,.28); border-radius:5px; }
.chat-filter-editor legend{ padding:0 4px; color:var(--color-gameSlate); font-size:.72rem; }
.chat-filter-channels{ display:flex; flex-wrap:wrap; gap:4px 12px; margin-top:5px; }
.chat-filter-channels.disabled{ opacity:.4; pointer-events:none; }
.chat-filter-choice{ color:var(--color-gameLight); font-size:.76rem; cursor:pointer; }
.chat-box-manager-row{ display:grid; gap:6px; padding:8px; border:1px solid rgba(183,138,57,.28); border-radius:6px; background:rgba(255,255,255,.025); }
.chat-box-manager-top{ display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; }
.chat-box-state{ color:var(--color-gameSlate); font-size:.7rem; }
.chat-filter-editor.compact{ padding:5px 7px; }
.chat-manager-empty{ margin:6px 0; color:var(--color-gameSlate); font-size:.8rem; }
@media (max-width:600px){.chat-manager{ left:8px; width:calc(100vw - 16px); }}
.chat-settings{ position: absolute; z-index: 5; top: 34px; right: 34px; display: none; width: 210px; padding: 9px; border: 1px solid rgba(183,138,57,.55); border-radius: 6px; background: rgba(16,14,12,.98); box-shadow: 0 6px 18px rgba(0,0,0,.55); }
.chat-settings.open{ display: grid; gap: 8px; }
.chat-setting{ display: grid; grid-template-columns: 1fr 88px; align-items: center; gap: 8px; color: var(--color-gameLight); font-size: 12px; }
.chat-setting input,
.chat-setting select{ min-width: 0; width: 88px; font: inherit; }
.chat-setting input[type="color"]{ height: 24px; padding: 1px; border: 1px solid rgba(183,138,57,.45); background: transparent; }
.chat-panel.collapsed .chat-body{ display: none; }
.chat-body{ flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; padding: 6px; }
.chat-scope,
.chat-status{ color: var(--color-gameSlate); font-size: 0.72rem; }
.chat-status:empty{ display: none; }
.chat-log{ flex: 1; min-height: 70px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; }
.chat-line{ line-height: 1.3; word-wrap: break-word; }
.chat-combat-active .chat-scope{ color:var(--color-gold); }
.combat-chat-line{ display:flex; align-items:flex-start; gap:6px; padding:3px 2px; border-bottom:1px solid rgba(183,138,57,.13); }
.combat-chat-text{ flex:1 1 auto; min-width:0; color:var(--color-gameLight); }
.combat-chat-details{ flex:0 0 auto; padding:0 2px; border:0; background:transparent; color:inherit; font:inherit; cursor:pointer; opacity:.68; }
.combat-chat-details:hover,
.combat-chat-details:focus-visible{ opacity:1; outline:1px solid rgba(183,138,57,.45); border-radius:3px; }
.combat-chat-empty{ color:var(--color-gameSlate); font-style:italic; }
.chat-time{ margin-right: 5px; color: var(--color-gameSlate); font-size: 0.7rem; }
.chat-tag{ margin-right: 4px; font-size: 0.75rem; }
.chat-town .chat-tag{ color: #d8b660; }
.chat-region .chat-tag{ color: #8fc28a; }
.chat-whisper .chat-tag,
.chat-whisper .chat-text{ color: #c9a3e6; }
.chat-name{ margin-right: 4px; color: var(--color-gold); cursor: pointer; }
.chat-name.mine{ color: #e8d9a8; cursor: default; }
.chat-notice{ color: #e07a6a; font-style: italic; }
/* Report this line (2026-11-08): a small flag on others' lines, shown on hover / keyboard focus. */
.chat-report{ margin-left: 4px; padding: 0 2px; border: 0; background: transparent; color: #86b8d4; font: inherit; font-size: 0.75rem; line-height: 1; opacity: 0; cursor: pointer; }
.chat-line:hover .chat-report,
.chat-report:focus-visible{ opacity: 0.75; }
.chat-report:hover,
.chat-report:focus-visible{ opacity: 1; color: #e07a6a; outline: none; }
/* Moderators' open-reports alert on the main navbar (scripts/social.js modReportsAlert*): a red warning triangle that
   pulses while any report is open. Hidden (display:none from the script) when there are none. */
.iconsButton.mod-reports-alert{ border-color: #ff5a4a; background-color: rgba(120,20,16,0.55); animation: mod-reports-glow 1.6s ease-in-out infinite; }
.iconsButton.mod-reports-alert svg{ width: 34px; height: 34px; animation: mod-reports-pulse 1.6s ease-in-out infinite; }
.iconsButton.mod-reports-alert:hover,
.iconsButton.mod-reports-alert:focus-visible{ background-color: rgba(170,30,24,0.75); outline: none; }
@keyframes mod-reports-pulse{ 0%, 100%{ transform: scale(1); } 50%{ transform: scale(1.14); } }
@keyframes mod-reports-glow{ 0%, 100%{ box-shadow: 0 0 2px rgba(255,70,50,0.4); } 50%{ box-shadow: 0 0 12px rgba(255,70,50,0.95); } }
@media (prefers-reduced-motion: reduce){
    .iconsButton.mod-reports-alert,
    .iconsButton.mod-reports-alert svg{ animation: none; }
}
/* Report Player dialog (scripts/social.js): the reasons are clickable chips (guild-perm-chip's look). */
.report-player-wrapper{ max-width: 420px; }
.report-player-reasons{ display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.report-player-reasons .guild-perm-chip{ font-size: 0.8rem; padding: 3px 10px; }
.chat-form{ display: flex; gap: 4px; }
.chat-kind,
.chat-to,
.chat-input{ min-width: 0; padding: 4px 6px; border: 1px solid rgba(183,138,57,0.45); border-radius: 4px; background: rgba(0,0,0,0.4); color: var(--color-gameLight); font: inherit; }
.chat-kind{ flex: 0 0 auto; }
.chat-to{ flex: 0 0 80px; }
.chat-input{ flex: 1; }
.chat-kind:focus-visible,
.chat-to:focus-visible,
.chat-input:focus-visible{ outline: 1px solid var(--color-gold); }
@media (max-width: 600px){
    .chat-panel{ left: 8px !important; right: 8px !important; bottom: 8px !important; top: auto !important; width: auto !important; height: min(280px, calc(100vh - 16px)) !important; min-width: 0; resize: vertical; }
    .chat-panel.collapsed{ height: auto !important; }
    .chat-head{ cursor: default; }
    .chat-resize-handle{ display: none; }
    .chat-panel-extra{ display: none; }
}

/* Other players on the overworld map (2026-10-26, scripts/world_map.js drawNearbyHeroes). Silver-ringed so
   they read apart from your own gold token; a group shows a count, and a stacked second ring behind it. */
.overworld-other-hero{
    position: absolute;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 50%;
    border: 1px solid #c9d3de;
    background-color: var(--color-gameDark);
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 0 1px rgba(0,0,0,.72), 0 0 6px 1px rgba(170,200,230,.35);
    cursor: pointer;
    transition: transform 0.12s ease-in-out;
}
.overworld-other-hero:hover{ transform: scale(1.15); }
.overworld-hero-marker.over-others{
    /* Standing on other heroes: yours stays on top but see-through, and the mouse goes through it to theirs. */
    z-index: 2;
    opacity: 0.5;
    pointer-events: none;
}
.overworld-other-hero-count{
    position: absolute;
    right: -7px;
    bottom: -5px;
    min-width: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #2f4a63;
    border: 1px solid #c9d3de;
    color: #fff;
    font-family: var(--font-ui);
    font-size: 0.68rem;
    line-height: 14px;
    text-align: center;
}
.nearby-heroes-list{ display: flex; flex-direction: column; gap: 6px; min-width: 260px; max-height: 50vh; overflow-y: auto; }
.nearby-heroes-row{ display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; background: rgba(0,0,0,0.25); }
.nearby-heroes-face{
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #c9d3de;
    background: var(--color-gameDark) var(--bg) center / cover no-repeat;
}
.nearby-heroes-info{ flex: 1; min-width: 0; font-family: var(--font-ui); }
.nearby-heroes-name{ color: var(--color-gameLight); font-weight: bold; }
.nearby-heroes-class{ color: var(--color-gameSlate); font-size: 0.78rem; }
.nearby-heroes-whisper{
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 5px;
    border: 1px solid var(--color-gold);
    background: var(--color-gold);
    color: var(--color-gameDark);
    font-family: var(--font-ui);
    font-weight: bold;
    cursor: pointer;
}
.nearby-heroes-whisper:hover{ filter: brightness(1.1); }
/* Players in a town's Notable People panel (2026-10-26) - the hero's face icon, silver-ringed like on the map. */
.town-players-title{ margin-top: 10px; }
.town-npc-avatar.town-player-avatar{
    border-radius: 50%;
    border: 1px solid #c9d3de;
    background: var(--color-gameDark) var(--bg) center / cover no-repeat;
}
/* Group token (2026-10-26): a "G" until there's real art, keeping the count badge. */
.overworld-other-hero.group{ display: flex; align-items: center; justify-content: center; background-image: none; }
.overworld-other-hero-letter{
    color: var(--color-gameLight);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
    pointer-events: none;
}
/* The nearby-heroes hover menu - the hover tooltip's frame, but interactive. */
.hover-tooltip.nearby-heroes-menu{ pointer-events: auto; min-width: 230px; max-width: 280px; z-index: 1600; }
.nearby-heroes-menu-title{ font-size: 1rem; color: #f3d889; }
.nearby-heroes-menu-list{ display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.nearby-heroes-menu-row{ border-radius: 6px; }
.nearby-heroes-menu-main{ display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 6px; cursor: pointer; transition: background-color 0.12s ease-in-out; }
.nearby-heroes-menu-main:hover, .nearby-heroes-menu-row.open .nearby-heroes-menu-main{ background-color: rgba(255,255,255,0.09); }
.nearby-heroes-menu-main .nearby-heroes-face{ width: 32px; height: 32px; }
.nearby-heroes-menu-actions{ display: none; gap: 6px; padding: 4px 6px 6px 48px; }
.nearby-heroes-menu-row.open .nearby-heroes-menu-actions{ display: flex; }

/* Social screen - live Party / Friends cards, and the friend / invite toasts (2026-10-27, scripts/social.js). */
.social-card-live{ font-family: var(--font-ui); }
.social-live-body{ display:flex; flex:1; min-height:0; flex-direction:column; gap:8px; overflow-y:auto; }
.social-card-guild .social-live-body{ overflow:visible; }
.social-vassal-section{ display:flex; flex:1 1 auto; min-height:0; flex-direction:column; gap:8px; }
.social-vassal-section .social-list{ flex:1 1 0; min-height:0; overflow-y:auto; padding-right:4px; scrollbar-gutter:stable; }
.social-vassal-section .social-row{ flex:0 0 auto; }
.social-live-form{ display:flex; gap:6px; margin-top:auto; }
.social-section-title{ color:#cbb77b; font-size:.74rem; letter-spacing:.05em; text-transform:uppercase; }
.social-list{ display:flex; flex-direction:column; gap:4px; }
.social-row{ border-radius:6px; background:rgba(0,0,0,0.18); }
.social-row-main{ display:flex; align-items:center; gap:9px; padding:6px 8px; border-radius:6px; }
.social-row-main.clickable{ cursor:pointer; }
.social-row-main.clickable:hover, .social-row.open .social-row-main{ background:rgba(255,255,255,0.07); }
.social-face{ flex-shrink:0; width:32px; height:32px; border:1px solid #c9d3de; border-radius:50%; background:var(--color-gameDark) var(--bg) center / cover no-repeat; }
.social-row:not(.online) .social-face{ filter:grayscale(.8); opacity:.6; }
.social-row-info{ min-width:0; }
.social-row-name{ display:flex; align-items:center; gap:6px; color:var(--color-gameLight); font-weight:bold; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.social-tag{ padding:1px 6px; border:1px solid rgba(183,138,57,0.42); border-radius:8px; color:#cbb77b; font-size:.64rem; font-weight:normal; }
.social-row-status{ color:var(--color-gameSlate); font-size:.76rem; }
.social-row.online .social-row-status{ color:#9fc79a; }
.social-row-actions{ display:none; flex-wrap:wrap; gap:5px; padding:2px 8px 8px 49px; }
.social-row.open .social-row-actions{ display:flex; }
.social-btn{ padding:4px 10px; border:1px solid var(--color-gold); border-radius:5px; background:var(--color-gold); color:var(--color-gameDark); font-family:var(--font-ui); font-size:.78rem; font-weight:bold; cursor:pointer; }
.social-btn:hover{ filter:brightness(1.1); }
.social-btn.secondary{ background:transparent; color:#e6d38c; border-color:rgba(183,138,57,0.6); }
.social-btn:disabled{ filter:grayscale(1) brightness(.7); cursor:default; }
.social-input{ flex:1; min-width:0; padding:5px 8px; border:1px solid rgba(183,138,57,0.45); border-radius:5px; background:rgba(0,0,0,0.35); color:var(--color-gameLight); font-family:var(--font-ui); }
.social-empty{ padding:10px; color:#cbb77b; font-size:.82rem; text-align:center; }
.social-note{ color:var(--color-gameSlate); font-size:.76rem; }
.social-footer{ display:flex; justify-content:flex-end; }
.social-toasts{ position:fixed; right:14px; bottom:14px; z-index:950; display:flex; flex-direction:column; gap:8px; width:min(320px, calc(100vw - 28px)); }
.social-toast{ position:relative; display:flex; gap:10px; padding:10px 28px 10px 10px; border:1px solid var(--color-gold); border-radius:8px; background:linear-gradient(160deg, var(--color-gameSlate) 0%, var(--color-gameDark) 65%); color:var(--color-gameLight); font-family:var(--font-ui); box-shadow:0 6px 16px rgba(0,0,0,.45); }
.social-toast .social-face{ width:38px; height:38px; }
.social-toast-main{ display:flex; min-width:0; flex-direction:column; gap:7px; }
.social-toast-text{ font-size:.86rem; }
.social-toast-actions{ display:flex; flex-wrap:wrap; gap:6px; }
.social-toast-close{ position:absolute; top:4px; right:6px; border:0; background:none; color:var(--color-gameSlate); font-size:1.1rem; line-height:1; cursor:pointer; }
.social-toast-close:hover{ color:var(--color-gameLight); }
/* The map menu / town popup rows now carry several buttons. */
.nearby-heroes-row{ flex-wrap:wrap; }
.nearby-heroes-menu-actions{ flex-wrap:wrap; }
/* Party combat (2026-10-27, scripts/combat.js renderCombatPartyTimer) - whose turn it is and the 60s clock. */
.combat-party-timer{
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    padding: 4px 14px;
    border: 1px solid var(--color-gold);
    border-radius: 14px;
    background: rgba(20,18,15,0.88);
    color: var(--color-gameLight);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    pointer-events: none;
    white-space: nowrap;
}
.combat-party-timer.urgent{ border-color: #c0504d; color: #f1b0a8; }
/* A party member in a fight (2026-10-27): bold crossed swords above their map token. */
.overworld-other-hero-fight{
    position: absolute;
    left: 50%;
    top: -31px;
    transform: translateX(-50%);
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.95)) drop-shadow(0 0 4px rgba(224,52,42,.7));
    pointer-events: none;
}
.nearby-heroes-join{ order: -1; }
/* "What's here" (2026-10-27, scripts/world_map.js): a player / group token over a town, dungeon, NPC or deposit is
   see-through so the place shows under it; the menu lists the places, a rule, then the players. */
.overworld-other-hero.over-place{ opacity: 0.55; }
.overworld-other-hero.over-place:hover{ opacity: 1; }
.nearby-menu-rule{ width: 100%; margin: 2px 0; border: 0; border-top: 1px solid rgba(183,138,57,0.45); }
.nearby-place-face{ border-radius: 6px; border-color: rgba(183,138,57,0.6); }
.nearby-place-row.out-of-range .nearby-heroes-menu-main{ opacity: 0.55; cursor: default; }
/* A place you can enter / use right now stands out (2026-10-27): on the map it sits above player tokens with a gold
   glow; in the "what's here" menu its picture glows and its name is gold. */
.overworld-pin.in-range{ z-index: 3; box-shadow: 0 0 0 2px rgba(255,215,0,.85), 0 0 10px 3px rgba(255,215,0,.55); }
.nearby-place-row:not(.out-of-range) .nearby-place-face{ border-color: var(--color-gold); box-shadow: 0 0 8px 2px rgba(255,215,0,.5); }
.nearby-place-row:not(.out-of-range) .nearby-heroes-name{ color: var(--color-gold); }
/* Guild card + hierarchy (2026-10-27, scripts/social.js socialDrawGuild / openGuildHierarchy). */
.social-guild-head{ display: flex; flex-direction: column; gap: 2px; }
.social-guild-name{ color: #f3d889; font-family: var(--font-display); font-size: 1.05rem; }
.social-guild-rename{ margin-top: 0; }
.guild-tree-popup{ max-width: min(640px, calc(100vw - 32px)); width: 640px; }
.guild-tree-wrap{ display: flex; flex-direction: column; gap: 8px; font-family: var(--font-ui); }
.guild-tree-top{ display: flex; align-items: center; gap: 10px; }
.guild-tree{ max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.guild-node-children{ margin-left: 22px; padding-left: 8px; border-left: 1px solid rgba(183,138,57,0.28); }
.guild-node-line{ display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; }
.guild-node-line.me{ background: rgba(255,215,0,0.10); }
.guild-node-line.match .guild-node-name{ color: var(--color-gold); }
.guild-node-toggle{ width: 16px; padding: 0; border: 0; background: none; color: #cbb77b; font-size: 0.85rem; cursor: pointer; }
.guild-node-toggle:disabled{ cursor: default; }
.guild-node-line .social-face{ width: 26px; height: 26px; }
.guild-node-line .social-face.offline{ filter: grayscale(.8); opacity: .6; }
.guild-node-name{ color: var(--color-gameLight); font-weight: bold; white-space: nowrap; }
.guild-node-stats{ color: var(--color-gameSlate); font-size: 0.76rem; white-space: nowrap; }
/* Guild family tree (2026-10-27, scripts/social.js openGuildHierarchy) - three rows, link lines up to each patron. */
.guild-tree-popup{ width: min(1040px, calc(100vw - 32px)); max-width: min(1040px, calc(100vw - 32px)); }
.gtree{ display: flex; flex-direction: column; gap: 10px; font-family: var(--font-ui); }
.gtree-top{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gtree-crumbs{ display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; flex-wrap: wrap; }
.gtree-crumb{ padding: 2px 6px; border: 0; border-radius: 4px; background: none; color: #cbb77b; font-family: var(--font-ui); font-size: 0.85rem; cursor: pointer; }
.gtree-crumb:hover{ background: rgba(255,255,255,0.07); }
.gtree-crumb.current{ color: var(--color-gold); font-weight: bold; cursor: default; }
.gtree-crumb-sep{ color: var(--color-gameSlate); }
.gtree-finder{ position: relative; width: 240px; }
.gtree-finder .social-input{ width: 100%; box-sizing: border-box; }
.gtree-results{ position: absolute; top: 100%; left: 0; right: 0; z-index: 5; display: flex; flex-direction: column; margin-top: 2px; border-radius: 6px; background: var(--color-gameDark); box-shadow: 0 6px 14px rgba(0,0,0,.5); }
.gtree-result{ padding: 6px 10px; border: 0; background: none; color: var(--color-gameLight); font-family: var(--font-ui); text-align: left; cursor: pointer; }
.gtree-result:hover{ background: rgba(255,215,0,0.12); }
.gtree-result.none{ color: var(--color-gameSlate); cursor: default; }
.gtree-stage{ position: relative; max-height: 66vh; overflow: auto; padding: 8px 0 4px; }
.gtree-lines{ position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.gtree-lines path{ fill: none; stroke: rgba(183,138,57,0.55); stroke-width: 1.5; }
.gtree-lines path.focus{ stroke: var(--color-gold); stroke-width: 2.2; }
.gtree-row{ position: relative; z-index: 1; display: flex; justify-content: center; align-items: flex-start; gap: 26px; width: max-content; min-width: 100%; margin-bottom: 40px; }
.gtree-group{ display: flex; gap: 10px; padding: 6px; border-radius: 10px; background: rgba(0,0,0,0.16); }
.gtree-card{ position: relative; width: 104px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; box-sizing: border-box;
    border: 1px solid rgba(183,138,57,0.35); border-radius: 8px; background: linear-gradient(165deg, rgba(60,55,48,0.96), rgba(28,27,25,0.96));
    text-align: center; cursor: pointer; transition: border-color .12s ease-in-out, transform .12s ease-in-out; }
.gtree-card:hover{ border-color: var(--color-gold); transform: translateY(-2px); }
.gtree-card.focus{ border-color: var(--color-gold); box-shadow: 0 0 12px 2px rgba(255,215,0,0.4); }
.gtree-face{ width: 48px; height: 48px; border-radius: 50%; border: 1px solid #c9d3de; background: var(--color-gameDark) var(--bg) center / cover no-repeat; }
.gtree-card.offline .gtree-face{ filter: grayscale(.8); opacity: .65; }
.gtree-name{ max-width: 100%; overflow: hidden; color: var(--color-gameLight); font-weight: bold; font-size: 0.86rem; text-overflow: ellipsis; white-space: nowrap; }
.gtree-card.me .gtree-name{ color: var(--color-gold); }
.gtree-stats{ color: var(--color-gameSlate); font-size: 0.68rem; line-height: 1.25; }
.gtree-empty{ position: relative; z-index: 1; color: var(--color-gameSlate); font-size: 0.82rem; text-align: center; }
.guild-tree-popup .item-use-inspect-details{ align-items: stretch; max-height: 80vh; overflow: hidden; }
.gtree{ width: 100%; }
.gtree-card{ width: 118px; }
.gtree-role{ color: var(--color-gold); font-size: 0.66rem; letter-spacing: .04em; text-transform: uppercase; }
.gtree-branches{ gap: 18px; }
.gtree-branch{ display: flex; flex-direction: column; align-items: center; gap: 40px; }
.gtree-canvas{ position: relative; z-index: 1; width: max-content; min-width: 100%; }
.gtree-canvas .gtree-row{ width: auto; min-width: 0; }
/* Guild tree - nearly the whole screen (owner 2026-10-27), and no empty picture box beside the title. */
.guild-tree-popup{ width:min(1600px,calc(100vw - 32px)); max-width:min(1600px,calc(100vw - 32px)); height:min(840px,calc(100vh - 24px)); max-height:calc(100vh - 24px); box-sizing:border-box; padding:24px 26px 22px; overflow:visible; border-color:#c99a38; border-radius:7px; background:radial-gradient(circle at 50% -10%,rgba(183,138,57,.18),transparent 36%),linear-gradient(155deg,#49443b,#22211f 72%); box-shadow:inset 0 0 0 3px rgba(24,18,8,.82),inset 0 0 0 4px rgba(218,171,58,.18),0 16px 44px rgba(0,0,0,.74); }
.guild-tree-popup > .item-use-title-wrapper{ position:absolute; top:14px; right:14px; z-index:12; width:30px; height:30px; min-height:0; }
.guild-tree-popup > .item-use-title-wrapper .inspect-title-image,.guild-tree-popup > .item-use-title-wrapper .item-use-title-text{ display:none; }
.guild-tree-popup > .item-use-title-wrapper .game-close{ position:absolute; inset:0; }
.guild-tree-popup .item-use-inspect-details{ flex:1; min-height:0; max-height:none; align-items:stretch; overflow:hidden; }
.guild-tree-popup .gtree{ flex:1; min-height:0; height:100%; }
.guild-tree-popup .gtree-stage{ flex:1; min-height:0; max-height:none; }
/* The hierarchy carries the same heraldic language as guild customization, at a broader ceremonial scale. */
.item-use-wrapper.inspect-frame.guild-tree-popup::before,
.item-use-wrapper.inspect-frame.guild-tree-popup::after,
.guild-tree-popup > .inspect-frame-corner::before,
.guild-tree-popup > .inspect-frame-corner::after{ width:86px; height:86px; clip-path:none; background:url("../images/guilds/hierarchy-corner-loop.svg") center/contain no-repeat; filter:drop-shadow(0 1px 2px rgba(0,0,0,.65)); }
.item-use-wrapper.inspect-frame.guild-tree-popup::before{ top:-1px; left:-1px; transform:none; }
.item-use-wrapper.inspect-frame.guild-tree-popup::after{ right:-1px; bottom:-1px; transform:rotate(180deg); }
.guild-tree-popup > .inspect-frame-corner::before{ top:-1px; right:-1px; transform:rotate(90deg); }
.guild-tree-popup > .inspect-frame-corner::after{ bottom:-1px; left:-1px; transform:rotate(-90deg); }
.guild-tree-popup > .inspect-frame-ornament::before,
.guild-tree-popup > .inspect-frame-ornament::after{ width:240px; height:30px; clip-path:none; background:url("../images/guilds/hierarchy-border-loop.svg") center/contain no-repeat; filter:drop-shadow(0 2px 2px rgba(0,0,0,.68)); }
.guild-tree-popup > .inspect-frame-ornament::before{ top:-15px; }
.guild-tree-popup > .inspect-frame-ornament::after{ bottom:-15px; }
.gtree-masthead{ display:flex; flex:0 0 112px; align-items:center; justify-content:center; gap:20px; box-sizing:border-box; min-height:112px; padding:2px 58px 4px; border-bottom:1px solid rgba(183,138,57,.34); background:radial-gradient(ellipse at center,rgba(183,138,57,.15),transparent 66%); }
.gtree-masthead-crest{ width:104px; height:104px; flex:0 0 104px; background:var(--bg) center/contain no-repeat; filter:drop-shadow(0 5px 8px rgba(0,0,0,.72)) drop-shadow(0 0 10px rgba(218,171,58,.2)); }
.gtree-masthead-title{ max-width:760px; margin:0; color:#f0d675; font-size:2.25rem; line-height:1.05; letter-spacing:.055em; text-align:center; text-shadow:0 2px 3px #000,0 0 14px rgba(183,138,57,.22); overflow-wrap:anywhere; }
.guild-tree-popup .gtree-top{ flex:0 0 auto; min-height:34px; padding:4px 7px; border:1px solid rgba(183,138,57,.25); border-radius:6px; background:rgba(0,0,0,.18); }
.guild-tree-popup .gtree-stage{ border:1px solid rgba(183,138,57,.38); border-radius:8px; box-shadow:inset 0 0 24px rgba(0,0,0,.25); }
@media (max-height:700px){ .gtree-masthead{ flex-basis:88px; min-height:88px; } .gtree-masthead-crest{ width:80px; height:80px; flex-basis:80px; } .gtree-masthead-title{ font-size:1.8rem; } }
/* Guild tree transitions (2026-10-27): a card leaving fades out where it stood. */
.gtree-ghost{ position: absolute; z-index: 2; margin: 0; pointer-events: none; transition: opacity 380ms ease, transform 380ms ease; }
.gtree-ghost.leaving{ opacity: 0; transform: scale(.9); }
.gtree-result.active{ background: rgba(255,215,0,0.18); color: var(--color-gold); }
/* Solid strokes in a faded group: overlapping lines look the same as one line (2026-10-27). */
.gtree-lines path{ stroke: rgb(183,138,57); }
.gtree-lines-base{ opacity: 0.55; }
/* Guild crests + colors, personal colors (2026-10-27, scripts/social.js). */
.social-header{ position: relative; }
.social-guild-head{ display: flex; align-items: center; gap: 10px; border-radius: 8px; }
.social-guild-head.styled{ padding: 8px 10px; border: 1px solid rgba(183,138,57,0.4); }
.social-guild-head-text{ display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.social-guild-head.styled .social-note{ color: #e2d6b4; }
.social-guild-crest{ flex-shrink: 0; width: 48px; height: 48px; background: var(--bg) center / contain no-repeat; }
.social-guild-tools{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.gtree-plate{ display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%; background: rgba(0,0,0,0.25); }
.gtree-crest{ flex-shrink: 0; width: 34px; height: 34px; background: var(--bg) center / contain no-repeat; }
.gtree-stage.styled{ border-radius: 8px; }
.style-editor-popup{ width:min(560px,calc(100vw - 40px)); max-width:560px; overflow:visible; border-color:#c99a38; border-radius:6px; background:radial-gradient(circle at 50% 0,rgba(183,138,57,.1),transparent 34%),linear-gradient(155deg,#504b42,#282725 72%); box-shadow:inset 0 0 0 3px rgba(25,20,12,.72),inset 0 0 0 4px rgba(205,160,62,.18),0 12px 32px rgba(0,0,0,.65); }
.style-editor-popup > .item-use-title-wrapper{ position:absolute; top:14px; right:14px; z-index:8; width:30px; height:30px; min-height:0; }
.style-editor-popup > .item-use-title-wrapper .inspect-title-image,.style-editor-popup > .item-use-title-wrapper .item-use-title-text{ display:none; }
.style-editor-popup > .item-use-title-wrapper .game-close{ position:absolute; inset:0; }
/* A restrained heraldic frame: smaller corner flourishes and simple centre clasps than the crest gallery. */
.item-use-wrapper.inspect-frame.style-editor-popup::before,
.item-use-wrapper.inspect-frame.style-editor-popup::after,
.style-editor-popup > .inspect-frame-corner::before,
.style-editor-popup > .inspect-frame-corner::after{ width:48px; height:48px; clip-path:none; background:url("../images/portal_gateways/corners/top-right.svg") center/contain no-repeat; opacity:.72; filter:drop-shadow(0 2px 2px rgba(0,0,0,.75)); }
.item-use-wrapper.inspect-frame.style-editor-popup::before{ top:-2px; left:-2px; transform:rotate(-90deg); }
.item-use-wrapper.inspect-frame.style-editor-popup::after{ right:-2px; bottom:-2px; transform:rotate(90deg); }
.style-editor-popup > .inspect-frame-corner::before{ top:-2px; right:-2px; transform:none; }
.style-editor-popup > .inspect-frame-corner::after{ bottom:-2px; left:-2px; transform:rotate(180deg); }
.style-editor-popup > .inspect-frame-ornament::before,
.style-editor-popup > .inspect-frame-ornament::after{ width:96px; height:15px; background:linear-gradient(90deg,transparent,#9c6e20 18%,#e0b64e 42%,#fff0a0 50%,#e0b64e 58%,#9c6e20 82%,transparent); clip-path:polygon(0 43%,38% 43%,45% 15%,50% 0,55% 15%,62% 43%,100% 43%,100% 57%,62% 57%,55% 85%,50% 100%,45% 85%,38% 57%,0 57%); opacity:.88; }
.style-editor-popup > .inspect-frame-ornament::before{ top:-8px; }
.style-editor-popup > .inspect-frame-ornament::after{ bottom:-8px; }
.style-editor{ display:flex; flex-direction:column; gap:10px; box-sizing:border-box; width:100%; padding:42px 12px 10px; font-family:var(--font-ui); }
.style-editor-preview{ height: 110px; border: 1px solid rgba(183,138,57,0.5); border-radius: 8px; }
.style-editor-types{ display: flex; gap: 4px; }
.style-editor-type{ flex: 1; padding: 5px 0; border: 1px solid rgba(183,138,57,0.5); border-radius: 5px; background: rgba(0,0,0,0.3); color: #e6d38c; font-family: var(--font-ui); font-weight: bold; cursor: pointer; }
.style-editor-type.active{ background: var(--color-gold); color: var(--color-gameDark); }
.style-editor-controls{ display: flex; flex-direction: column; gap: 8px; }
.style-editor-row{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.style-editor-label{ width: 52px; color: #cbb77b; font-size: 0.8rem; }
.style-editor-color{ width: 44px; height: 30px; padding: 0; border: 1px solid rgba(183,138,57,0.5); border-radius: 5px; background: none; cursor: pointer; }
.style-editor-angle{ flex: 1; accent-color: var(--color-gold); }
.style-editor-patterns{ display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; }
.style-editor-pattern{ display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--color-gameLight); font-family: var(--font-ui); font-size: 0.72rem; cursor: pointer; }
.style-editor-pattern.active{ border-color: var(--color-gold); }
.style-editor-swatch{ width:100%; height:36px; border-radius:5px; border:1px solid rgba(183,138,57,0.4); }
.style-editor-foot{ display: flex; justify-content: flex-end; gap: 6px; }
@media (max-width:620px){ .style-editor-patterns{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
.crest-picker{ display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; width: 100%; }
.crest-tile{ aspect-ratio: 1; border: 1px solid rgba(183,138,57,0.4); border-radius: 8px; background: rgba(0,0,0,0.3) var(--bg) center / 80% no-repeat; cursor: pointer; }
.crest-tile:hover, .crest-tile.active{ border-color: var(--color-gold); box-shadow: 0 0 8px rgba(255,215,0,0.4); }
/* A member's own colors fill their tree card (2026-10-27) - text shadowed so it reads on any color. */
.gtree-card.styled .gtree-name, .gtree-card.styled .gtree-stats, .gtree-card.styled .gtree-role{ text-shadow: 0 1px 2px rgba(0,0,0,.95), 0 0 6px rgba(0,0,0,.8); }
.gtree-card.styled .gtree-stats{ color: #e2d6b4; }
.gtree-plate{ background: none; }
/* Guild founding + pending week (2026-10-27, scripts/social.js socialDrawGuild). */
.social-guild-pending{ position:relative; z-index:5; flex:0 0 auto; overflow:visible; border:1px solid rgba(192,80,77,.88); border-radius:8px; background:rgba(120,25,20,.28); }
.social-guild-pending.open{ z-index:40; }
.social-guild-pending-toggle{ display:grid; width:100%; grid-template-columns:30px minmax(0,1fr) auto; align-items:center; gap:9px; padding:9px 10px; border:0; border-radius:7px; background:linear-gradient(90deg,rgba(137,35,29,.42),rgba(83,25,22,.18)); color:var(--color-gameLight); text-align:left; cursor:pointer; transition:border-radius .22s ease; }
.social-guild-pending-toggle:hover,.social-guild-pending-toggle:focus-visible{ background:linear-gradient(90deg,rgba(164,43,35,.55),rgba(96,29,25,.28)); }
.social-guild-pending-toggle:focus-visible{ outline:2px solid #f1b0a8; outline-offset:-2px; }
.social-guild-pending-mark{ display:grid; width:26px; height:26px; place-items:center; border:1px solid #e18d83; border-radius:50%; color:#ffd6d0; font-weight:bold; }
.social-guild-pending-summary{ display:flex; min-width:0; flex-direction:column; gap:1px; }
.social-guild-pending-title{ color: #f1b0a8; font-weight: bold; letter-spacing: .05em; text-transform: uppercase; font-size: 0.78rem; }
.social-guild-pending-hint{ overflow:hidden; color:#e3c2bc; font-size:.76rem; text-overflow:ellipsis; white-space:nowrap; }
.social-guild-pending-clock{ color:#ffd6d0; font-size:.8rem; font-weight:bold; font-variant-numeric:tabular-nums; white-space:nowrap; }
.social-guild-pending.open .social-guild-pending-toggle{ border-radius:7px 7px 0 0; }
.social-guild-pending-details{ position:absolute; top:calc(100% + 1px); right:10px; left:10px; z-index:2; box-sizing:border-box; min-height:0; max-height:0; padding:0 12px; overflow:hidden; visibility:hidden; opacity:0; transform:translateY(-3px); transform-origin:top; border:1px solid transparent; border-top:0; border-radius:0 0 8px 8px; background:linear-gradient(155deg,#4b211f,#251817 82%); box-shadow:0 10px 22px rgba(0,0,0,0); pointer-events:none; transition:min-height .3s cubic-bezier(.2,.75,.25,1),max-height .3s cubic-bezier(.2,.75,.25,1),padding .3s cubic-bezier(.2,.75,.25,1),opacity .18s ease,transform .3s cubic-bezier(.2,.75,.25,1),border-color .18s ease,box-shadow .25s ease,visibility 0s linear .3s; }
.social-guild-pending.open .social-guild-pending-details{ min-height:168px; max-height:260px; padding:12px; visibility:visible; opacity:1; transform:translateY(0); border-color:rgba(192,80,77,.72); box-shadow:0 10px 22px rgba(0,0,0,.65); pointer-events:auto; transition-delay:0s; }
.social-guild-pending-explanation{ margin-bottom:7px; color:#ffd6d0; font-size:.82rem; line-height:1.35; }
.social-guild-pending-guidance{ padding:9px 0; border-top:1px solid rgba(241,176,168,.2); color:#e3c2bc; font-size:.78rem; line-height:1.35; }
.social-guild-losses{ padding:9px 10px; border:1px dashed rgba(241,176,168,.38); border-radius:7px; background:rgba(0,0,0,.2); }
.social-guild-losses-title{ color:#f1b0a8; font-weight:bold; font-size:.76rem; letter-spacing:.05em; text-transform:uppercase; }
.social-guild-losses-placeholder{ margin-top:3px; color:#c99f99; font-size:.75rem; line-height:1.35; }
.social-guild-founding{ display:flex; flex-direction:column; gap:8px; padding:11px 12px; border:1px dashed rgba(183,138,57,.4); border-radius:8px; background:linear-gradient(135deg,rgba(183,138,57,.08),rgba(0,0,0,.12)); }
.social-guild-founding-copy{ color:var(--color-gameSlate); font-size:.82rem; line-height:1.4; }
.social-founding-structure{ margin-top:1px; }
.social-founding-structure .social-hierarchy-icon{ width:40px; height:40px; }
.social-founding-structure .social-hierarchy-icon svg{ width:27px; height:27px; }
.social-guild-founding-count{ color: #e6d38c; font-size: 0.84rem; font-weight: bold; }
.social-guild-founding-count.done{ color: #9fc79a; }
.gtree-pending{ padding: 3px 10px; border: 1px solid #c0504d; border-radius: 12px; background: rgba(120,25,20,0.4); color: #f1b0a8; font-size: 0.78rem; white-space: nowrap; }
/* The founding hierarchy, spelled out (2026-10-27, scripts/social.js guildFoundingChain). */
.guild-founding-chain{ display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 2px 0; }
.guild-founding-step{ padding: 2px 8px; border: 1px solid rgba(183,138,57,0.5); border-radius: 10px; background: rgba(0,0,0,0.25); color: var(--color-gameLight); font-size: 0.78rem; font-weight: bold; white-space: nowrap; }
.guild-founding-note{ color: #cbb77b; font-weight: normal; }
.guild-founding-arrow{ color: var(--color-gold); font-weight: bold; }
.social-guild-pending .social-guild-founding-count{ color: #f1d3ce; font-size: 0.78rem; font-weight: normal; }
/* The guildmaster's branches toward the founding shape (2026-10-27). */
.guild-branch-list{ display: flex; flex-direction: column; gap: 2px; }
.guild-branch{ display: flex; align-items: baseline; gap: 6px; font-size: 0.8rem; }
.guild-branch-mark{ width: 12px; color: #cbb77b; text-align: center; }
.guild-branch.done .guild-branch-mark{ color: #9fc79a; font-weight: bold; }
.guild-branch-name{ color: var(--color-gameLight); font-weight: bold; }
.guild-branch-state{ color: var(--color-gameSlate); }
.guild-branch.done .guild-branch-state{ color: #9fc79a; }
.social-guild-pending .guild-branch-state{ color: #e3c2bc; }
/* Empty seats in the founding shape (2026-10-28, scripts/social.js openGuildHierarchy) - dashed, not clickable. */
.gtree-card.gtree-placeholder{ border: 1px dashed rgba(203,183,123,0.55); background: rgba(0,0,0,0.18); cursor: default; }
.gtree-card.gtree-placeholder:hover{ transform: none; border-color: rgba(203,183,123,0.55); }
.gtree-seat{ border:1px dashed rgba(203,183,123,.6); color:rgba(203,183,123,.72); }
.gtree-seat svg{ width:42px; height:42px; fill:rgba(203,183,123,.12); stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.gtree-card.gtree-placeholder .gtree-name{ color: #cbb77b; }
.gtree-lines path.seat{ stroke-dasharray: 5 4; }
.gtree-group-empty{ background: rgba(0,0,0,0.08); }
.gtree-needs{ margin-top: 2px; padding: 1px 6px; border: 1px solid #c0504d; border-radius: 8px; color: #f1b0a8; font-size: 0.62rem; }
/* Pre-guild readiness view: neutral allegiance cards, exactly the minimum four-tier founding shape. */
.gtree-masthead-copy{ display:flex; min-width:0; flex-direction:column; align-items:center; gap:7px; }
.gtree-top.founding{ display:none; }
.guild-founding-popup .gtree-masthead{ position:relative; flex-basis:92px; min-height:92px; }
.gtree-rank-control{ position:absolute; left:18px; bottom:8px; display:grid; width:190px; grid-template-columns:auto 1fr; align-items:center; gap:2px 9px; color:#cbb77b; font-size:.72rem; }
.gtree-rank-label{ font-weight:bold; white-space:nowrap; }
.gtree-rank-value{ justify-self:end; color:#ead27c; font-weight:bold; white-space:nowrap; }
.gtree-rank-slider{ position:relative; z-index:2; grid-column:1 / -1; width:100%; height:14px; margin:0; direction:rtl; appearance:none; -webkit-appearance:none; background:transparent; cursor:pointer; }
.gtree-rank-slider::-webkit-slider-runnable-track{ height:2px; border-radius:2px; background:rgba(203,183,123,.55); }
.gtree-rank-slider::-webkit-slider-thumb{ width:14px; height:14px; margin-top:-6px; appearance:none; -webkit-appearance:none; border:1px solid #ead27c; border-radius:50%; background:#302b21; box-shadow:0 1px 4px rgba(0,0,0,.65); }
.gtree-rank-slider::-moz-range-track,.gtree-rank-slider::-moz-range-progress{ height:2px; border-radius:2px; background:rgba(203,183,123,.55); }
.gtree-rank-slider::-moz-range-thumb{ width:12px; height:12px; border:1px solid #ead27c; border-radius:50%; background:#302b21; box-shadow:0 1px 4px rgba(0,0,0,.65); }
.gtree-rank-ticks{ grid-column:1 / -1; display:flex; justify-content:space-between; padding:0 6px; margin-top:-8px; pointer-events:none; }
.gtree-rank-ticks i{ display:block; width:1px; height:5px; background:rgba(203,183,123,.72); }
.gtree-rank-slider:focus-visible{ outline:2px solid var(--color-gameLight); outline-offset:3px; }
.gtree-rank-rewards{ position:absolute; left:230px; bottom:5px; z-index:6; display:flex; max-width:calc(50% - 245px); align-items:center; gap:5px; overflow:visible; padding:2px 3px; }
.gtree-rank-reward{ position:relative; display:grid; width:27px; height:27px; flex:0 0 27px; box-sizing:border-box; place-items:center; border:1px solid rgba(203,183,123,.28); border-radius:6px; background:rgba(22,21,19,.42); color:#a69d89; opacity:.38; filter:grayscale(1); transition:opacity .16s,border-color .16s,background-color .16s,color .16s,filter .16s,box-shadow .16s; }
.gtree-rank-reward > svg{ width:19px; height:19px; overflow:visible; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.gtree-rank-reward.active{ border-color:rgba(234,210,124,.76); background:rgba(74,62,31,.72); color:#f0d77f; opacity:1; filter:none; box-shadow:inset 0 0 0 1px rgba(255,228,137,.1),0 0 7px rgba(199,157,47,.2); }
.gtree-rank-reward:focus-visible{ outline:2px solid var(--color-gameLight); outline-offset:2px; }
.gtree-rank-reward-tooltip{ position:absolute; top:calc(100% + 8px); left:50%; z-index:30; display:none; width:220px; box-sizing:border-box; padding:8px 10px; transform:translateX(-50%); border:1px solid rgba(218,190,105,.62); border-radius:6px; background:linear-gradient(155deg,#37332b,#1d1c1a); color:var(--color-gameLight); box-shadow:0 8px 20px rgba(0,0,0,.68); font-family:var(--font-ui); line-height:1.3; pointer-events:none; }
.gtree-rank-reward-tooltip strong,.gtree-rank-reward-tooltip span,.gtree-rank-reward-tooltip small{ display:block; }
.gtree-rank-reward-tooltip strong{ color:#ead27c; font-family:var(--font-display); font-size:.78rem; }
.gtree-rank-reward-tooltip span{ margin-top:3px; font-size:.72rem; }
.gtree-rank-reward-tooltip small{ margin-top:5px; color:#b8ac8d; font-size:.66rem; }
.gtree-rank-reward:hover .gtree-rank-reward-tooltip,.gtree-rank-reward:focus-visible .gtree-rank-reward-tooltip{ display:block; }
.gtree-founding-stage{ background:radial-gradient(circle at 50% 0,rgba(183,138,57,.08),transparent 45%),rgba(18,17,15,.34); }
.gtree-founding-stage .gtree-card.gtree-neutral{ cursor:default; background:linear-gradient(165deg,rgba(58,55,49,.96),rgba(29,28,26,.96)); }
.gtree-founding-stage .gtree-card.gtree-neutral:hover{ border-color:rgba(183,138,57,.35); transform:none; }
.gtree-founding-stage .gtree-card{ width:118px; height:126px; min-height:126px; justify-content:flex-start; padding-top:5px; padding-bottom:5px; }
.gtree-founding-stage .gtree-card .gtree-name{ min-height:18px; display:flex; align-items:center; justify-content:center; }
.gtree-founding-stage .gtree-card.gtree-placeholder{ justify-content:flex-start; }
.gtree-founding-stage .gtree-card.gtree-placeholder .gtree-name{ flex:1; min-height:0; color:#cbb77b; line-height:1.2; white-space:normal; }
.gtree-founding-root{ margin:18px 0 34px; }
.gtree-founding-branches{ align-items:flex-start; gap:56px; padding:0 28px 24px; margin:0; }
.gtree-founding-branch{ position:relative; display:flex; flex:0 0 auto; flex-direction:column; align-items:center; gap:30px; padding:32px 50px 14px; border-radius:10px; background:rgba(0,0,0,.12); }
.gtree-founding-lineages{ display:flex; width:max-content; align-items:flex-start; justify-content:center; gap:44px; }
.gtree-founding-subbranch{ position:relative; display:flex; width:max-content; min-width:118px; flex-direction:column; align-items:center; }
.gtree-founding-subbranch::before{ content:""; position:absolute; inset:-8px -7px -9px; z-index:0; border-radius:8px; background:linear-gradient(180deg,rgba(112,96,65,.1),rgba(78,68,51,.1)); box-shadow:inset 0 1px rgba(255,231,164,.08); pointer-events:none; }
.gtree-rank-node{ position:relative; z-index:1; display:flex; width:max-content; min-width:118px; flex:0 0 auto; flex-direction:column; align-items:center; }
.gtree-rank-descendants{ position:relative; z-index:1; display:flex; width:max-content; align-items:flex-start; justify-content:center; gap:30px; margin-top:30px; }
.gtree-requirement-missing{ border-style:dashed; }
.gtree-stat-missing{ color:#e47f74; font-weight:bold; text-decoration:underline dotted rgba(228,127,116,.72); text-underline-offset:2px; cursor:default; }
.gtree-stat-missing:focus-visible, .gtree-slot-alert:focus-visible{ outline:1px solid #e8695c; outline-offset:1px; border-radius:3px; }
.gtree-slot-check{ position:absolute; top:5px; right:6px; display:grid; width:18px; height:18px; place-items:center; border:1px solid rgba(159,199,154,.62); border-radius:50%; background:#213124; color:#bce0b7; font-size:.68rem; font-weight:bold; box-shadow:0 1px 4px rgba(0,0,0,.45); }
.guild-founding-popup .gtree-card.me .gtree-name{ color:var(--color-gameLight); }
.guild-founding-popup .gtree-card.offline .gtree-face{ filter:none; opacity:1; }
.guild-founding-popup .gtree-lines path{ stroke:rgba(190,166,95,.72); }
@media (max-width:900px){ .gtree-founding-branches{ gap:28px; padding-inline:12px; } .gtree-founding-branch{ padding:32px 36px 14px; } .gtree-founding-lineages{ gap:32px; } .gtree-founding-subbranch,.gtree-rank-node{ min-width:104px; } .gtree-rank-descendants{ gap:22px; } .gtree-founding-stage .gtree-card{ width:104px; } }
@media (max-width:900px){ .gtree-rank-rewards{ left:195px; max-width:calc(50% - 205px); } }
@media (max-width:760px){ .gtree-rank-control{ width:150px; } .gtree-rank-rewards{ left:178px; max-width:calc(50% - 188px); } }
/* Row actions as a drawer (owner request 2026-10-28): clicking a person slides their buttons in from the row's right
   edge, right-aligned on the same line - the portrait and name stay in view on the left. Friends / Party / Guild rows,
   the town Players popup, and the overworld hover menu all share it. */
.social-row, .nearby-heroes-menu-row{ position: relative; overflow: hidden; transition: min-height .22s ease; }
.social-row-actions, .nearby-heroes-menu-actions,
.social-row.open .social-row-actions, .nearby-heroes-menu-row.open .nearby-heroes-menu-actions{
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 46px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-content: center;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 28px;
    background: linear-gradient(to right, rgba(28,26,23,0) 0, rgba(28,26,23,0.94) 26px);
    transform: translateX(105%);
    opacity: 0;
    pointer-events: none;
    transition: transform .26s cubic-bezier(.2,.75,.25,1), opacity .2s ease;
}
.social-row.open .social-row-actions, .nearby-heroes-menu-row.open .nearby-heroes-menu-actions{
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}
.social-row-actions:empty, .nearby-heroes-menu-actions:empty{ display: none; }
/* Compact buttons inside the drawer. */
.social-row-actions .social-btn, .nearby-heroes-menu-actions .social-btn, .nearby-heroes-menu-actions .nearby-heroes-whisper{
    padding: 3px 9px;
    font-size: 0.74rem;
    line-height: 1.25;
    white-space: nowrap;
}
/* Icon-only row actions leave room for names. Their labels remain available to screen readers and appear
   in the established short-label display face on hover or keyboard focus. */
.social-row.open, .nearby-heroes-menu-row.open{ z-index:2; overflow:visible; }
.social-row-actions .social-action-icon,
.nearby-heroes-menu-actions .social-action-icon{
    position:relative;
    display:inline-grid;
    width:30px;
    height:30px;
    place-items:center;
    padding:0;
}
.social-action-icon svg{
    width:17px;
    height:17px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
    pointer-events:none;
}
.social-action-icon[data-tooltip]::after{
    content:attr(data-tooltip);
    position:absolute;
    right:0;
    bottom:calc(100% + 7px);
    z-index:30;
    padding:4px 8px;
    border:1px solid var(--color-gold);
    border-radius:4px;
    background:#111;
    color:var(--color-gameLight);
    box-shadow:0 2px 6px rgba(0,0,0,.5);
    font-family:var(--font-display);
    font-size:.76rem;
    font-weight:600;
    line-height:1.2;
    white-space:nowrap;
    opacity:0;
    visibility:hidden;
    transform:translateY(3px);
    transition:opacity .12s ease, transform .12s ease, visibility .12s;
    pointer-events:none;
}
.social-action-icon[data-tooltip]:hover::after,
.social-action-icon[data-tooltip]:focus-visible::after{
    opacity:1;
    visibility:visible;
    transform:translateY(0);
}
.social-action-icon:focus-visible{
    outline:2px solid var(--color-gameLight);
    outline-offset:2px;
}
/* An open row grows a little when its buttons need two lines (the narrow overworld menu). */
.nearby-heroes-menu-row.open{ min-height: 58px; }
.hover-tooltip.nearby-heroes-menu{ max-width: 340px; }
.nearby-heroes-menu-row .nearby-heroes-menu-main{ min-height: 44px; }
/* The drawer is only as wide as its buttons - so the name beside it stays readable. */
.social-row-actions, .nearby-heroes-menu-actions,
.social-row.open .social-row-actions, .nearby-heroes-menu-row.open .nearby-heroes-menu-actions{
    left: auto;
    max-width: calc(100% - 46px);
}
/* The overworld menu widens while a row's drawer is open, so the name and its buttons sit side by side. */
.hover-tooltip.nearby-heroes-menu:has(.nearby-heroes-menu-row.open){ min-width: 430px; max-width: 470px; }

/* Guild card: a named guild's banner (crest inset at the left, spilling past the edges; name centred in the rest),
   and the on-your-own panel (2026-10-28, scripts/social.js socialDrawGuild). */
.social-guild-head{ position: relative; display: flex; align-items: center; justify-content: center; min-height: 68px; margin: 12px 0 10px;
    padding: 10px 18px; border: 1px solid rgba(183,138,57,0.4); border-radius: 8px; background: rgba(183,138,57,0.1); }
.social-guild-head.has-crest,.social-guild-head.has-crest-slot{ padding-left:108px; }
.social-guild-head .social-guild-crest{ position: absolute; left: 4px; top: 50%; width: 96px; height: 96px; transform: translateY(-50%);
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.6)); }
.social-guild-head button.social-guild-crest{ padding:0; border:0; background-color:transparent; cursor:pointer; }
.social-guild-head button.social-guild-crest:hover,.social-guild-head button.social-guild-crest:focus-visible{ filter:drop-shadow(0 3px 6px rgba(0,0,0,.6)) drop-shadow(0 0 9px rgba(255,215,0,.55)); }
.social-guild-head button.social-guild-crest:focus-visible{ outline:2px solid var(--color-gold); outline-offset:2px; border-radius:12px; }
.social-guild-crest.empty{ display:grid; box-sizing:border-box; place-items:center; border:2px dashed rgba(223,200,111,.62); border-radius:18px; background:rgba(0,0,0,.22); filter:none; }
.social-guild-crest.empty svg{ width:68%; height:68%; fill:none; stroke:#cbb77b; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; opacity:.76; }
.social-guild-head .social-guild-name{ min-width: 0; text-align: center; font-size: 1.35rem; line-height: 1.2; overflow-wrap: anywhere;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.social-guild-alone{ display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px dashed rgba(183,138,57,0.45);
    border-radius: 8px; text-align: center; }
.social-guild-alone-title{ color: #f3d889; font-family: var(--font-display); font-size: 1.05rem; }
.social-guild-alone .social-note{ line-height: 1.45; }
/* Bigger crest and name on the guild banner (owner request 2026-10-28). */
.social-guild-head{ min-height: 80px; margin: 22px 0 18px; }
.social-guild-head.has-crest,.social-guild-head.has-crest-slot{ padding-left:140px; }
.social-guild-head .social-guild-crest{ width: 128px; height: 128px; left: 2px; }
.social-guild-head .social-guild-name{ font-size: 1.8rem; }
.social-guild-head.editable{ padding-right:50px; }
.social-guild-banner-actions{ position:absolute; top:7px; right:8px; bottom:7px; display:flex; flex-direction:column; align-items:center; justify-content:space-evenly; }
.social-guild-colors-compact{ position:relative; width:34px; height:34px; padding:0; border:1px solid rgba(223,200,111,.58); border-radius:50%; background:rgba(20,18,15,.72); box-shadow:0 3px 8px rgba(0,0,0,.42); cursor:pointer; }
.social-guild-colors-compact:hover,.social-guild-colors-compact:focus-visible{ border-color:var(--color-gold); box-shadow:0 0 9px rgba(255,215,0,.34); }
.social-guild-colors-compact:focus-visible{ outline:2px solid var(--color-gameLight); outline-offset:2px; }
.social-guild-colors-compact .social-guild-color-swatch{ width:14px; height:14px; }
.social-guild-colors-compact .social-guild-color-swatch.a{ left:4px; top:6px; }
.social-guild-colors-compact .social-guild-color-swatch.b{ right:4px; top:6px; }
.social-guild-colors-compact .social-guild-color-swatch.c{ left:9px; bottom:3px; }
.social-guild-hierarchy-compact{ position:relative; display:grid; width:34px; height:34px; place-items:center; padding:0; border:1px solid rgba(223,200,111,.58); border-radius:50%; background:rgba(20,18,15,.72); color:#dfc86f; box-shadow:0 3px 8px rgba(0,0,0,.42); cursor:pointer; }
.social-guild-hierarchy-compact:hover,.social-guild-hierarchy-compact:focus-visible{ border-color:var(--color-gold); box-shadow:0 0 9px rgba(255,215,0,.34); }
.social-guild-hierarchy-compact:focus-visible{ outline:2px solid var(--color-gameLight); outline-offset:2px; }
.social-guild-hierarchy-compact svg{ width:21px; height:21px; fill:rgba(223,200,111,.14); stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
/* Guild management uses visual, descriptive controls instead of a row of small utility buttons. */
.social-guild-tool{ display:grid; min-width:0; grid-template-columns:46px minmax(0,1fr) auto; align-items:center; gap:9px; min-height:62px; padding:8px 10px; border:1px solid rgba(183,138,57,.42); border-radius:8px; background:linear-gradient(135deg,rgba(183,138,57,.13),rgba(0,0,0,.25)); color:var(--color-gameLight); text-align:left; cursor:pointer; transition:border-color .16s ease,background .16s ease,transform .16s ease; }
.social-guild-tool:hover,.social-guild-tool:focus-visible{ border-color:var(--color-gold); background:linear-gradient(135deg,rgba(183,138,57,.24),rgba(0,0,0,.2)); transform:translateY(-1px); }
.social-guild-tool:focus-visible,.social-hierarchy-cta:focus-visible{ outline:2px solid var(--color-gameLight); outline-offset:2px; }
.social-guild-tool-icon{ position:relative; display:grid; width:44px; height:44px; place-items:center; overflow:hidden; border:1px solid rgba(223,200,111,.5); border-radius:50%; background:rgba(0,0,0,.34); color:#dfc86f; font-size:1.8rem; }
.social-guild-tool-icon.has-crest{ border-radius:8px; background:rgba(0,0,0,.28) var(--bg) center/88% no-repeat; }
.social-guild-color-swatch{ position:absolute; width:19px; height:19px; border:1px solid rgba(255,255,255,.48); border-radius:50%; box-shadow:0 2px 4px rgba(0,0,0,.45); }
.social-guild-color-swatch.a{ left:6px; top:8px; background:#8e2d2d; }
.social-guild-color-swatch.b{ right:6px; top:8px; background:#254a7c; }
.social-guild-color-swatch.c{ left:12px; bottom:5px; background:#d1a944; }
.social-guild-tool-copy{ display:flex; min-width:0; flex-direction:column; gap:2px; }
.social-guild-tool-title{ color:#e6d38c; font-weight:bold; }
.social-guild-tool-detail{ color:var(--color-gameSlate); font-size:.72rem; line-height:1.25; }
.social-guild-tool-arrow,.social-hierarchy-arrow{ color:#dfc86f; font-size:1.5rem; }
.social-guild-footer{ margin-top:4px; }
.social-hierarchy-cta{ display:grid; width:100%; grid-template-columns:48px minmax(0,1fr) auto; align-items:center; gap:11px; padding:10px 12px; border:1px solid rgba(207,159,52,.68); border-radius:8px; background:linear-gradient(105deg,rgba(138,91,17,.32),rgba(52,42,25,.54) 55%,rgba(183,138,57,.13)); color:var(--color-gameLight); text-align:left; box-shadow:inset 0 1px rgba(255,229,151,.08); cursor:pointer; transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease; }
.social-hierarchy-cta:hover,.social-hierarchy-cta:focus-visible{ border-color:var(--color-gold); box-shadow:inset 0 1px rgba(255,229,151,.14),0 4px 12px rgba(0,0,0,.28); transform:translateY(-1px); }
.social-hierarchy-icon{ display:grid; width:46px; height:46px; place-items:center; border:1px solid rgba(223,200,111,.48); border-radius:8px; background:radial-gradient(circle at 50% 30%,rgba(183,138,57,.26),rgba(0,0,0,.34)); color:#dfc86f; }
.social-hierarchy-icon svg{ width:30px; height:30px; fill:rgba(223,200,111,.18); stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.social-hierarchy-copy{ display:flex; min-width:0; flex-direction:column; gap:2px; }
.social-hierarchy-title{ color:#f0da87; font-family:var(--font-display); font-size:.95rem; }
.social-hierarchy-detail{ color:#cbb77b; font-size:.74rem; }
@media (max-width:1250px){ .social-guild-tools{ grid-template-columns:1fr; } }
@media (max-width:620px){ .social-guild-pending-toggle{ grid-template-columns:30px minmax(0,1fr); } .social-guild-pending-clock{ grid-column:2; } }
/* Guild crest picker: roomy two-step gallery. A pending crest lifts forward while the rest recede; saving only
   happens from the explicit confirmation control, so browsing never changes the guild by accident. */
.crest-picker-popup{ width:min(1200px, calc(100vw - 64px)); max-width:min(1200px, calc(100vw - 64px)); max-height:calc(100vh - 120px); overflow:visible; border-color:#d9ad3f; border-radius:4px; background:radial-gradient(circle at 50% 0,rgba(183,138,57,.13),transparent 28%),linear-gradient(155deg,#504a40,#242320 72%); box-shadow:inset 0 0 0 3px rgba(31,23,10,.88),inset 0 0 0 4px rgba(224,181,69,.25),inset 0 0 30px rgba(0,0,0,.48),0 14px 40px rgba(0,0,0,.72); }
.crest-picker-popup > .item-use-title-wrapper{ position:absolute; top:12px; right:12px; z-index:12; width:30px; height:30px; min-height:0; }
.crest-picker-popup > .item-use-title-wrapper .inspect-title-image,.crest-picker-popup > .item-use-title-wrapper .item-use-title-text{ display:none; }
.crest-picker-popup > .item-use-title-wrapper .game-close{ position:absolute; inset:0; }
/* Heraldic frame: portal-scale corner filigree with crown-like centre clasps, reserved for the guild crest gallery. */
.item-use-wrapper.inspect-frame.crest-picker-popup::before,
.item-use-wrapper.inspect-frame.crest-picker-popup::after,
.crest-picker-popup > .inspect-frame-corner::before,
.crest-picker-popup > .inspect-frame-corner::after{ width:82px; height:82px; clip-path:none; background:url("../images/portal_gateways/corners/top-right.svg") center/contain no-repeat; filter:drop-shadow(0 2px 3px rgba(0,0,0,.8)) drop-shadow(0 0 3px rgba(217,173,63,.24)); }
.item-use-wrapper.inspect-frame.crest-picker-popup::before{ top:-3px; left:-3px; transform:rotate(-90deg); }
.item-use-wrapper.inspect-frame.crest-picker-popup::after{ right:-3px; bottom:-3px; transform:rotate(90deg); }
.crest-picker-popup > .inspect-frame-corner::before{ top:-3px; right:-3px; transform:none; }
.crest-picker-popup > .inspect-frame-corner::after{ bottom:-3px; left:-3px; transform:rotate(180deg); }
.crest-picker-popup > .inspect-frame-ornament::before,
.crest-picker-popup > .inspect-frame-ornament::after{ width:190px; height:25px; background:linear-gradient(90deg,transparent 0,#7e5818 12%,#d9ad3f 28%,#fff0a0 47%,#fff8c9 50%,#fff0a0 53%,#d9ad3f 72%,#7e5818 88%,transparent 100%); clip-path:polygon(0 46%,28% 46%,34% 30%,40% 46%,44% 12%,48% 40%,50% 0,52% 40%,56% 12%,60% 46%,66% 30%,72% 46%,100% 46%,100% 58%,68% 58%,62% 78%,56% 58%,50% 100%,44% 58%,38% 78%,32% 58%,0 58%); filter:drop-shadow(0 2px 2px rgba(0,0,0,.72)); }
.crest-picker-popup > .inspect-frame-ornament::before{ top:-13px; }
.crest-picker-popup > .inspect-frame-ornament::after{ bottom:-13px; }
.crest-picker-popup .item-use-inspect-details{ width:100%; min-height:0; max-height:calc(100vh - 250px); align-items:stretch; overflow:hidden; }
.crest-picker-popup .crest-picker{ display:grid; box-sizing:border-box; width:100%; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:14px; min-height:300px; padding:90px;
    overflow-y:auto; overflow-x:hidden; border:1px solid rgba(183,138,57,.28); border-radius:8px; background:rgba(0,0,0,.18); }
.crest-picker-divider{ grid-column:1 / -1; display:flex; align-items:baseline; gap:10px; margin:8px 0 0; padding:10px 4px 8px; border-bottom:1px solid rgba(217,173,63,.5); }
.crest-picker-divider:first-child{ margin-top:0; }
.crest-picker-divider.pending{ border-bottom-color:rgba(134,184,212,.72); }
.crest-picker-divider-title{ color:#f0da87; font-family:var(--font-display); font-size:1rem; }
.crest-picker-divider.pending .crest-picker-divider-title{ color:#b9dced; }
.crest-picker-divider-detail{ color:var(--color-gameSlate); font-family:var(--font-ui); font-size:.72rem; }
.crest-picker-popup .crest-tile{ position:relative; min-width:0; background-size:90%;
    transition:opacity .2s ease, filter .2s ease, transform .22s cubic-bezier(.2,.8,.2,1), border-color .2s ease, box-shadow .2s ease; }
.crest-picker-popup .crest-tile.pending{ border-color:rgba(134,184,212,.58); background-color:rgba(20,38,48,.42); }
.crest-picker-popup .crest-tile.pending:hover,.crest-picker-popup .crest-tile.pending:focus-visible{ border-color:#b9dced; box-shadow:0 0 9px rgba(134,184,212,.42); }
.crest-picker-popup .crest-tile:hover, .crest-picker-popup .crest-tile:focus-visible{ z-index:2; border-color:var(--color-gold); box-shadow:0 0 8px rgba(255,215,0,.4); }
.crest-picker-popup .crest-tile.current::after{ content:"Current"; position:absolute; right:6px; top:6px; padding:2px 6px;
    border:1px solid rgba(183,138,57,.7); border-radius:9px; background:rgba(17,17,17,.88); color:#e6d38c;
    font-family:var(--font-ui); font-size:.65rem; }
.crest-picker.has-selection .crest-tile:not(.selected){ opacity:.2; filter:grayscale(.75) brightness(.65); }
.crest-picker.has-selection .crest-tile.selected{ z-index:4; opacity:1; filter:none; transform:scale(2); border-color:var(--color-gold);
    box-shadow:0 10px 26px rgba(0,0,0,.7), 0 0 18px 4px rgba(255,215,0,.48); }
.crest-picker.has-selection .crest-tile.selected:hover, .crest-picker.has-selection .crest-tile.selected:focus-visible{ transform:scale(2); }
.crest-tile-preview{ position:absolute; right:5px; bottom:-38px; left:5px; display:none; flex-direction:column; gap:4px; padding:5px; border:1px solid rgba(223,200,111,.62); border-radius:5px; background:linear-gradient(to bottom,rgba(35,29,17,.96),rgba(12,11,9,.99)); box-shadow:0 5px 10px rgba(0,0,0,.55); text-align:center; }
.crest-tile.selected .crest-tile-preview{ display:flex; }
.crest-tile-name{ overflow:hidden; color:#f0da87; font-family:var(--font-display); font-size:.46rem; font-weight:600; line-height:1.2; text-overflow:ellipsis; white-space:nowrap; }
.crest-tile-confirm{ display:flex; align-items:center; justify-content:center; gap:3px; min-height:18px; padding:2px 5px; border:1px solid #d7ac3e; border-radius:4px; background:linear-gradient(#f2cf57,#c68d16); color:#211707; font-family:var(--font-ui); font-size:.4rem; font-weight:bold; line-height:1; box-shadow:inset 0 1px rgba(255,255,255,.38),0 2px 4px rgba(0,0,0,.4); cursor:pointer; }
.crest-tile-confirm:hover,.crest-tile-confirm:focus-visible{ background:linear-gradient(#ffe27a,#d9a72d); border-color:#ffe08a; }
.crest-tile-confirm:focus-visible{ outline:1px solid #fff4c2; outline-offset:1px; }
.crest-tile-confirm svg{ width:10px; height:10px; fill:rgba(80,48,4,.12); stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
@media (max-width:700px){
    .crest-picker-popup{ width:calc(100vw - 24px); max-width:calc(100vw - 24px); }
    .crest-picker-popup .crest-picker{ grid-template-columns:repeat(auto-fill, minmax(112px, 1fr)); gap:10px; padding:62px; }
    .crest-picker-divider{ align-items:flex-start; flex-direction:column; gap:3px; }
}
/* An open row clips only sideways (2026-10-28): the icon labels still rise above it, but the drawer sliding in from
   the right never sticks out and makes the card scroll for a moment. */
.social-row.open, .nearby-heroes-menu-row.open{ overflow-x: clip; overflow-y: visible; }
.social-live-body{ overflow-x: hidden; }
.social-card-guild .social-live-body{ overflow:visible; }
/* The overworld menu's drawer holds icon buttons now (2026-10-28) - the menu keeps its own width and height when a
   row opens, instead of widening for text buttons. */
.hover-tooltip.nearby-heroes-menu:has(.nearby-heroes-menu-row.open){ min-width: 230px; max-width: 340px; }
.nearby-heroes-menu-row.open{ min-height: 0; }
/* Icon labels float on the page (scripts/social.js socialShowActionTip) - nothing clips them; the in-row version is
   retired. The overworld menu's drawer stays on one line, the same width as the closed menu (2026-10-28). */
.social-action-icon[data-tooltip]::after{ display: none; }
.social-action-tip{
    position: fixed;
    z-index: 20000;
    padding: 4px 8px;
    border: 1px solid var(--color-gold);
    border-radius: 4px;
    background: #111;
    color: var(--color-gameLight);
    box-shadow: 0 2px 6px rgba(0,0,0,.5);
    font-family: var(--font-display);
    font-size: .76rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}
.nearby-heroes-menu-row .nearby-heroes-menu-actions, .nearby-heroes-menu-row.open .nearby-heroes-menu-actions{ flex-wrap: nowrap; padding-left: 18px; }
/* Town Players rows carry the same slide-in drawer (2026-10-28, scripts/town.js renderTownPlayers) - keeping the
   town's own row look rather than the Social card's row background. */
.town-player-list .social-row.town-player-drawer-row{ background: none; border-radius: 4px; }
.town-player-drawer-row.open .town-player-row{ background-color: rgba(255,255,255,0.08); }
/* Notable People rows carry the same drawer (2026-10-28, scripts/town.js) - in the town's own row look. */
.town-people .social-row.town-drawer-row{ background: none; border-radius: 4px; }
.town-drawer-row.open .town-npc-row{ background-color: rgba(255,255,255,0.08); }

/* Hero drawer buttons that apply but can't be used right now - Invite to Party while they're in a party or Do Not
   Disturb (social.js SOCIAL_HERO_ACTIONS). Not :disabled, so the hover label still says why. */
.social-btn.disabled, .social-btn.disabled:hover{ filter:grayscale(1) brightness(.6); opacity:.6; cursor:not-allowed; }
/* My Colors + Do Not Disturb side by side on the Social screen's top edge (2026-10-30) - the pair takes My Colors' old spot. */
.social-top-buttons{ position:absolute; top:-13px; left:50%; z-index:6; display:flex; gap:10px; transform:translateX(-50%); }
.social-top-buttons .social-my-colors-border{ position:static; transform:none; white-space:nowrap; }
.social-dnd-btn.on{ border-color:var(--color-gold); background:var(--color-gold); color:var(--color-gameDark); }
.social-dnd-btn.on:hover,.social-dnd-btn.on:focus-visible{ color:var(--color-gameDark); filter:brightness(1.1); }
/* A trainer's fixed-height curriculum window (2026-10-31, openNpcTrainingPopup in town.js). The two panes own their
   scroll independently: adding paths never moves the catalog and adding recipes never resizes the popup. */
.item-use-wrapper.inspect-frame.npc-shop-frame.npc-training-frame{
    top: clamp(72px, 8vh, 92px);
    bottom: auto;
    width: min(96vw, 1320px);
    height: min(820px, calc(100vh - 112px));
    max-height: none;
    box-sizing: border-box;
    overflow: hidden;
}
.npc-training-frame .item-use-title-wrapper{ flex: 0 0 auto; }
.npc-training-frame .item-use-inspect-details{
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    box-sizing: border-box;
    padding: 10px 14px 14px;
    overflow: hidden;
    align-items: stretch;
}
.npc-training-body{ width: 100%; height: 100%; min-height: 0; box-sizing: border-box; }
.npc-training-layout{
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    height: 100%;
    min-height: 0;
}
.npc-training-sidebar,
.npc-training-main{
    min-width: 0;
    min-height: 0;
    border: 1px solid rgba(183,138,57,.42);
    border-radius: 9px;
    background: linear-gradient(180deg,rgba(16,13,10,.74),rgba(8,8,8,.48));
    box-shadow: inset 0 1px rgba(255,255,255,.035), 0 6px 18px rgba(0,0,0,.18);
    overflow: hidden;
}
.npc-training-sidebar{ display:flex; flex-direction:column; }
.npc-training-sidebar-head{
    flex: 0 0 auto;
    padding: 15px 15px 13px;
    border-bottom: 1px solid rgba(183,138,57,.38);
    background: radial-gradient(circle at 16% 10%,rgba(183,138,57,.14),transparent 58%),rgba(0,0,0,.18);
}
.npc-training-sidebar-kicker,
.npc-training-main-kicker{
    margin-bottom: 3px;
    color: #aa9662;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.npc-training-sidebar-title,
.npc-training-main-title{
    color: var(--color-gold);
    font-family: var(--font-display);
    font-weight: 700;
    text-shadow: var(--text-shadow-black-outline);
}
.npc-training-sidebar-title{ font-size: 1.05rem; }
.npc-training-sidebar-summary,
.npc-training-main-meta{
    margin-top: 3px;
    color: rgba(255,255,255,.57);
    font-size: .75rem;
}
.npc-training-nav{
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 5px;
    min-height: 0;
    padding: 8px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}
.npc-training-nav-button{
    display: grid;
    grid-template-columns: 36px minmax(0,1fr) auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 54px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--color-gameLight);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease,background .15s ease,color .15s ease,box-shadow .15s ease;
}
.npc-training-nav-button:hover,
.npc-training-nav-button:focus-visible{
    color: var(--color-gold);
    border-color: rgba(183,138,57,.42);
    background: rgba(183,138,57,.1);
    outline: none;
}
.npc-training-nav-button.active{
    color: var(--color-gold);
    border-color: rgba(183,138,57,.72);
    background: linear-gradient(90deg,rgba(183,138,57,.25),rgba(183,138,57,.055));
    box-shadow: inset 3px 0 0 var(--color-gold),0 0 12px rgba(183,138,57,.06);
}
.npc-training-nav-button.disabled{ opacity:.46; cursor:not-allowed; }
.npc-training-nav-button.disabled:hover{ color:var(--color-gameLight); border-color:transparent; background:transparent; }
.npc-training-nav-icon{
    display:grid;
    place-items:center;
    width:34px;
    height:34px;
    box-sizing:border-box;
    border:1px solid rgba(183,138,57,.42);
    border-radius:6px;
    background:rgba(0,0,0,.36) var(--bg) center/contain no-repeat;
    color:#c9ad5e;
    box-shadow:inset 0 0 8px rgba(0,0,0,.35);
}
.npc-training-nav-icon svg{ width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.npc-training-nav-copy{ display:flex; flex-direction:column; min-width:0; gap:2px; }
.npc-training-nav-label{ overflow:hidden; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.npc-training-nav-progress{ overflow:hidden; color:rgba(255,255,255,.48); font-size:.7rem; text-overflow:ellipsis; white-space:nowrap; }
.npc-training-nav-count,
.npc-training-nav-soon{
    min-width:26px;
    box-sizing:border-box;
    padding:2px 6px;
    border-radius:999px;
    background:rgba(0,0,0,.35);
    color:#c9b77f;
    font-size:.68rem;
    font-weight:700;
    text-align:center;
    white-space:nowrap;
}
.npc-training-nav-sep{ height:1px; flex:0 0 auto; margin:4px 5px; background:linear-gradient(90deg,transparent,rgba(183,138,57,.48),transparent); }
.npc-training-main{ display:flex; flex-direction:column; }
.npc-training-main-head{
    display:flex;
    flex:0 0 auto;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    min-height:73px;
    box-sizing:border-box;
    padding:12px 15px;
    border-bottom:1px solid rgba(183,138,57,.3);
    background:radial-gradient(circle at 3% 0,rgba(183,138,57,.13),transparent 42%),rgba(0,0,0,.13);
}
.npc-training-main-heading{ min-width:0; }
.npc-training-main-title{ overflow:hidden; font-size:1.28rem; text-overflow:ellipsis; white-space:nowrap; }
.npc-training-main-head .npc-shop-coins{
    display:flex;
    flex:0 0 auto;
    align-items:center;
    gap:7px;
    padding:7px 10px;
    border:1px solid rgba(183,138,57,.4);
    border-radius:999px;
    background:rgba(0,0,0,.28);
    text-align:left;
    white-space:nowrap;
}
.npc-training-coins-label{ color:#b9aa82; font-size:.75rem; font-weight:400; text-shadow:none; }
.npc-training-coin-icon,
.npc-training-price-coin{ display:block; object-fit:contain; filter:drop-shadow(0 1px 2px rgba(0,0,0,.8)); }
.npc-training-coin-icon{ width:21px; height:21px; }
.npc-training-coins-value{ color:#f0d675; font-size:.9rem; }
.npc-training-controls{ display:flex; flex:0 0 auto; align-items:stretch; gap:7px; padding:9px 12px; border-bottom:1px solid rgba(183,138,57,.22); background:rgba(0,0,0,.1); }
.npc-training-search-wrap{
    display:flex;
    align-items:center;
    gap:8px;
    flex:1 1 auto;
    width:auto;
    box-sizing:border-box;
    padding:0 10px;
    border:1px solid rgba(183,138,57,.4);
    border-radius:6px;
    background:rgba(0,0,0,.3);
}
.npc-training-search-wrap:focus-within{ border-color:var(--color-gold); box-shadow:0 0 0 2px rgba(183,138,57,.1); }
.npc-training-search-wrap.disabled{ opacity:.42; }
.npc-training-search-wrap svg{ flex:0 0 18px; width:18px; height:18px; fill:none; stroke:#b9a66a; stroke-width:1.7; stroke-linecap:round; }
.npc-training-player-search{ width:100%; min-width:0; padding:9px 0; border:0; outline:0; background:transparent; color:var(--color-gameLight); }
.npc-training-player-search::placeholder{ color:rgba(255,255,255,.38); }
.npc-training-known-toggle{ flex:0 0 auto; min-width:92px; padding:0 11px; border:1px solid rgba(183,138,57,.48); border-radius:6px; background:rgba(0,0,0,.26); color:#c9b77f; font:inherit; font-size:.75rem; font-weight:700; cursor:pointer; white-space:nowrap; }
.npc-training-known-toggle:hover,.npc-training-known-toggle:focus-visible{ border-color:var(--color-gold); color:var(--color-gold); outline:none; }
.npc-training-known-toggle.active{ border-color:var(--color-gold); background:rgba(183,138,57,.2); color:var(--color-gold); box-shadow:inset 0 0 8px rgba(183,138,57,.12); }
.npc-training-known-toggle:disabled{ opacity:.38; cursor:not-allowed; }
.npc-training-player-list{
    display:grid;
    flex:1 1 auto;
    grid-template-columns:repeat(auto-fill,minmax(330px,1fr));
    align-content:start;
    gap:7px 10px;
    min-height:0;
    padding:10px 12px 15px;
    overflow-y:auto;
    scrollbar-gutter:stable;
}
.npc-training-player-group{
    grid-column:1/-1;
    margin-top:9px;
    padding:0 0 6px;
    border-bottom:1px solid rgba(183,138,57,.4);
    color:var(--color-gold);
    font-family:var(--font-display);
    font-size:.88rem;
    letter-spacing:.045em;
}
.npc-training-player-group:first-child{ margin-top:0; }
.npc-training-player-list > .crafting-empty{ grid-column:1/-1; align-self:start; margin:20px; }
.npc-training-player-row{
    display:flex;
    align-items:center;
    gap:10px;
    min-height:58px;
    box-sizing:border-box;
    padding:6px 8px;
    border:1px solid rgba(183,138,57,.25);
    border-radius:7px;
    background:linear-gradient(105deg,rgba(38,32,25,.76),rgba(20,18,16,.68));
    box-shadow:inset 0 1px rgba(255,255,255,.025);
}
.npc-training-player-row:hover{ border-color:rgba(183,138,57,.58); background:linear-gradient(105deg,rgba(48,39,28,.8),rgba(24,21,18,.72)); }
.npc-training-player-row.known{ opacity:.5; }
.npc-training-player-tile{
    flex:0 0 44px;
    width:44px;
    height:44px;
    border:1px solid rgba(183,138,57,.48);
    border-radius:6px;
    background:var(--bg) center/contain no-repeat,rgba(0,0,0,.38);
    box-shadow:inset 0 0 8px rgba(0,0,0,.42);
}
.npc-training-player-tile:hover{ border-color:rgba(183,138,57,.9); }
.npc-training-player-info{ flex:1 1 auto; min-width:0; }
.npc-training-player-name{ overflow:hidden; color:var(--color-gameLight); font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.npc-training-player-meta{ margin-top:2px; color:rgba(255,255,255,.52); font-size:.75rem; }
.npc-training-player-action{ flex:0 0 auto; }
.npc-training-player-status{ display:inline-flex; padding:4px 7px; border-radius:999px; background:rgba(0,0,0,.24); color:rgba(255,255,255,.62); font-size:.75rem; }
.npc-training-player-status.needs{ border:1px solid rgba(196,102,72,.38); color:#e0a070; }
.npc-training-learn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:64px;
    min-height:34px;
    box-sizing:border-box;
    padding:4px 6px;
    border:1px solid var(--color-gold);
    border-radius:6px;
    background:linear-gradient(180deg,#f2cc47,#c99713);
    color:var(--color-gameDark);
    font-size:.77rem;
    font-weight:700;
    cursor:pointer;
    box-shadow:inset 0 1px rgba(255,255,255,.42),0 2px 5px rgba(0,0,0,.25);
}
.npc-training-learn:hover,
.npc-training-learn:focus-visible{ filter:brightness(1.1); outline:none; }
.npc-training-learn-price{
    display:grid;
    grid-template-columns:16px minmax(0,1fr);
    align-items:center;
    gap:4px;
    width:48px;
    min-height:22px;
    box-sizing:border-box;
    padding:2px 4px;
    border-radius:4px;
    background:rgba(0,0,0,.12);
    text-align:center;
}
.npc-training-price-coin{ width:16px; height:16px; }
.npc-training-learn.short{ border-color:rgba(183,138,57,.6); background:rgba(0,0,0,.26); color:#e6d38c; box-shadow:none; }
.npc-training-abilities-empty{
    grid-column:1/-1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    min-height:300px;
    padding:30px;
    text-align:center;
}
.npc-training-abilities-mark{
    display:grid;
    place-items:center;
    width:68px;
    height:68px;
    margin-bottom:15px;
    border:1px solid rgba(183,138,57,.5);
    border-radius:50%;
    background:radial-gradient(circle,rgba(183,138,57,.2),rgba(0,0,0,.18) 68%);
    color:#d3b459;
    box-shadow:0 0 24px rgba(183,138,57,.12);
}
.npc-training-abilities-mark svg{ width:35px; height:35px; fill:none; stroke:currentColor; stroke-width:1.3; stroke-linecap:round; }
.npc-training-abilities-title{ color:var(--color-gold); font-family:var(--font-display); font-size:1.05rem; }
.npc-training-abilities-copy{ max-width:430px; margin-top:7px; color:#c8bea5; }
@media (max-width:900px){
    .npc-training-layout{ grid-template-columns:minmax(205px,235px) minmax(0,1fr); }
    .npc-training-player-list{ grid-template-columns:minmax(0,1fr); }
    .npc-training-coins-label{ display:none; }
}

/* Player / NPC rows whose drawer opens on hover (socialRowDrawer, owner request 2026-10-31) - nothing to click. */
.drawer-hover-main, .social-row-main.clickable.drawer-hover-main{ cursor: default; }

/* Owner scroll maker (2026-11-03, toggleScrollMakerPanel() in game.js) - a floating panel, not a modal, so the
   inventory under it stays usable while scrolls are made into it. */
.scroll-maker-panel{
    position: fixed;
    top: 96px;
    right: 24px;
    z-index: 1400;
    width: min(340px, calc(100vw - 32px));
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    background: var(--color-gameDark);
    border: 1px solid var(--color-gold);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
    color: var(--color-gameLight);
    font-family: var(--font-ui);
    font-size: 0.85rem;
}
.scroll-maker-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,215,0,0.25);
}
.scroll-maker-title{ color: var(--color-gold); font-weight: bold; }
.scroll-maker-close{ cursor: pointer; font-size: 1.3rem; line-height: 1; padding: 0 4px; }
.scroll-maker-close:hover{ color: var(--color-gold); }
.scroll-maker-body{
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px 14px;
    overflow-y: auto;
}
.scroll-maker-form{ display: flex; flex-direction: column; gap: 10px; }
.scroll-maker-field{ display: flex; flex-direction: column; gap: 4px; }
.scroll-maker-label{
    color: #cbb77b;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.scroll-maker-choices{ display: flex; gap: 4px; flex-wrap: wrap; }
.scroll-maker-choice{
    flex: 1 1 0;
    padding: 4px 8px;
    border: 1px solid rgba(255,215,0,0.35);
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.scroll-maker-choice:hover{ border-color: var(--color-gold); }
.scroll-maker-choice.active{ background: var(--color-gold); border-color: var(--color-gold); color: #1a1a1a; font-weight: bold; }
.scroll-maker-input{
    width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 4px;
    background: #1f1f1f;
    color: var(--color-gameLight);
    font-family: var(--font-ui);
}
.scroll-maker-number{ width: 90px; }
.scroll-maker-status{ min-height: 1.2em; font-size: 0.8rem; color: #9fd49f; }
.scroll-maker-status.is-error{ color: #f0a04b; }
.scroll-maker-create{
    padding: 8px;
    border-radius: 6px;
    background: var(--color-gold);
    color: #1a1a1a;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    user-select: none;
}
.scroll-maker-create:hover{ filter: brightness(1.1); }
.scroll-maker-create:active{ transform: translateY(1px); }

/* Owner debug Discernment (2026-11-03, toggleDiscernmentDebug() in game.js) - a small slider panel under its
   toolbar button: 0-999, or off (the real skill). */
.discern-debug-panel{
    position: fixed;
    z-index: 1400;
    width: 280px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    background: var(--color-gameDark);
    border: 1px solid var(--color-gold);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    color: var(--color-gameLight);
    font-family: var(--font-ui);
    font-size: 0.85rem;
}
.discern-debug-head{ display: flex; align-items: baseline; justify-content: space-between; }
.discern-debug-title{ color: var(--color-gold); font-weight: bold; }
.discern-debug-state{ font-weight: bold; }
.discern-debug-row{ display: flex; align-items: center; gap: 8px; }
.discern-debug-slider{ flex: 1 1 auto; min-width: 0; accent-color: var(--color-gold); }
.discern-debug-number{
    width: 64px;
    box-sizing: border-box;
    padding: 3px 6px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 4px;
    background: #1f1f1f;
    color: var(--color-gameLight);
    font-family: var(--font-ui);
}
.discern-debug-off{
    padding: 4px 8px;
    border: 1px solid rgba(255,215,0,0.35);
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    user-select: none;
}
.discern-debug-off:hover{ border-color: var(--color-gold); color: var(--color-gold); }

/* The tooltip's Enchantments section, one block per enchantment (2026-11-03): its name and MP, then each spell it
   casts - a half-size icon beside the spell's name, description, what it does and (for tuning) its MP / CS / SSL. */
.item-details-enchant-block{
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.item-details-enchant-block + .item-details-enchant-block{
    border-top: 1px solid rgba(199,151,255,.25);
    padding-top: 5px;
}
.item-details-enchant-name{
    color: #f2eaff;
    font-family: var(--font-ui);
    font-weight: bold;
    text-align: center;
    text-shadow: 0 1px 2px #000;
}
.item-details-enchant-mp{ color: #c797ff; font-weight: normal; }
.item-details-enchant-spell{
    display: grid;
    grid-template-columns: 26px minmax(0,1fr);
    align-items: start;
    gap: 7px;
    text-align: left;
    color: #f2eaff;
    text-shadow: 0 1px 2px #000;
}
.item-details-enchant-spell-icon{
    width: 26px;
    height: 26px;
    box-sizing: border-box;
    border: 1px solid var(--color-gold);
    border-radius: 3px;
    background-color: rgba(0,0,0,.38);
    background-image: var(--bg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 22px;
}
.item-details-enchant-spell-info{ min-width: 0; line-height: 1.3; }
.item-details-enchant-spell-name{
    color: var(--color-gold);
    font-family: var(--font-ui);
    font-weight: bold;
}
.item-details-enchant-spell-cost{ color: #f2eaff; font-weight: normal; font-size: .85em; }
.item-details-enchant-spell-desc{ font-size: .85em; opacity: .85; }
.item-details-enchant-spell-effects{ color: #bfffcf; font-size: .9em; }
.item-details-enchant-spell-debug{ font-family: var(--font-ui); font-size: .75em; opacity: .6; }

/* Guild rank, management and calendar (owner spec 2026-11-05; scripts/social.js socialGuildRankStrip / openGuildFinalize /
   openGuildManage / openGuildCalendar) + guild chat lines (scripts/chat.js). */
.chat-guild .chat-tag{ color: #7fb6e0; }
.social-guild-rank{ display:flex; flex-direction:column; gap:6px; margin:-4px 0 10px; padding:8px 10px; border:1px solid rgba(183,138,57,.32); border-radius:8px; background:rgba(0,0,0,.16); }
.social-guild-rank-line{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.social-guild-rank-badge{ font-family:var(--font-display); color:var(--color-gold); font-size:.95rem; letter-spacing:.04em; }
.social-guild-rank-name{ color:#e6d38c; font-size:.82rem; }
.social-guild-my-title{ padding:1px 7px; border:1px solid rgba(183,138,57,.42); border-radius:8px; color:#cbb77b; font-size:.7rem; }
.social-guild-muted{ color:#d98b80; font-size:.72rem; }
.social-guild-rewards{ display:flex; flex-wrap:wrap; gap:5px; margin-top:4px; }
.social-guild-reward{ padding:2px 7px; border-radius:8px; background:rgba(127,182,224,.14); color:#bcd8ec; font-size:.7rem; }
.social-guild-reward.at-risk{ background:rgba(201,159,153,.16); color:#e2bab4; }
.social-guild-next{ color:var(--color-gameSlate); font-size:.7rem; align-self:center; }
.social-guild-rank-actions{ display:flex; gap:6px; }
.gtree-role.gtree-title{ color:#cbb77b; }

.guild-finalize, .guild-manage, .guild-calendar{ display:flex; flex-direction:column; gap:10px; width:min(640px, 92vw); max-height:78vh; min-height:0; font-family:var(--font-ui); }
.guild-finalize-title{ margin:0; font-family:var(--font-display); color:var(--color-gold); font-size:1.15rem; font-weight:normal; }
.guild-finalize-look{ display:flex; flex-wrap:wrap; gap:16px; }
.guild-finalize-choice{ display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.guild-finalize-crest{ width:64px; height:64px; }
.guild-finalize-swatch{ width:64px; height:40px; border:1px solid rgba(183,138,57,.42); border-radius:6px; background:rgba(0,0,0,.25); }
.guild-finalize-actions, .guild-manage-actions{ display:flex; justify-content:flex-end; gap:8px; }
.guild-manage-scroll{ display:flex; flex-direction:column; gap:14px; min-height:0; overflow-y:auto; padding-right:4px; }
.guild-manage-section{ display:flex; flex-direction:column; gap:6px; }
.guild-title-list, .guild-member-list{ display:flex; flex-direction:column; gap:4px; }
.guild-title-row{ display:flex; align-items:center; flex-wrap:wrap; gap:6px; padding:5px 8px; border:1px solid rgba(183,138,57,.24); border-radius:6px; background:rgba(0,0,0,.14); }
.guild-title-row.default{ border-color:rgba(183,138,57,.5); }
.guild-title-place{ min-width:16px; color:var(--color-gameSlate); font-size:.72rem; text-align:right; }
.guild-title-name{ flex:0 1 150px; min-width:90px; color:var(--color-gameLight); font-size:.82rem; }
.guild-title-perms{ display:flex; flex-wrap:wrap; gap:4px; flex:1 1 auto; }
.guild-perm-chip{ padding:2px 8px; border:1px solid rgba(183,138,57,.36); border-radius:10px; background:transparent; color:var(--color-gameSlate); font-family:var(--font-ui); font-size:.7rem; cursor:pointer; }
span.guild-perm-chip{ cursor:default; }
.guild-perm-chip.on{ border-color:var(--color-gold); background:rgba(255,215,0,.14); color:#f0dd8c; }
.guild-perm-chip.locked{ border-style:dashed; opacity:.55; }
.guild-perm-chip:focus-visible, .guild-title-move-btn:focus-visible, .guild-title-remove:focus-visible{ outline:1px solid var(--color-gold); outline-offset:1px; }
.guild-title-move{ display:inline-flex; gap:2px; }
.guild-title-move-btn, .guild-title-remove{ width:22px; height:22px; padding:0; border:0; border-radius:3px; background:transparent; color:#86b8d4; font-size:.75rem; opacity:.7; cursor:pointer; }
.guild-title-move-btn:hover, .guild-title-remove:hover{ background:rgba(92,154,190,.14); color:#b6dcf0; opacity:1; }
.guild-title-move-btn:disabled, .guild-title-remove:disabled{ opacity:.25; cursor:default; background:transparent; }
.guild-member-row{ display:flex; align-items:center; gap:8px; padding:4px 6px; border-radius:6px; background:rgba(0,0,0,.12); }
.guild-member-row .social-face{ flex:0 0 auto; }
.guild-member-info{ flex:1 1 auto; min-width:0; }
.guild-member-controls{ display:flex; align-items:center; gap:6px; }
.guild-member-title{ max-width:150px; padding:3px 6px; font-size:.76rem; }
.guild-member-title-label{ color:#cbb77b; font-size:.74rem; }
.guild-mute-btn.on{ border-color:#d98b80; color:#e2bab4; }
.guild-calendar-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.guild-calendar-day{ margin-top:4px; }
.guild-event{ display:flex; flex-direction:column; gap:4px; padding:8px 10px; border:1px solid rgba(183,138,57,.26); border-radius:6px; background:rgba(0,0,0,.14); }
.guild-event.past{ opacity:.55; }
.guild-event-top{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.guild-event-time{ color:#e6d38c; font-size:.78rem; }
.guild-event-title{ flex:1 1 auto; color:var(--color-gameLight); font-size:.88rem; font-weight:bold; }
.guild-event-tools{ display:flex; gap:4px; }
.guild-event-description{ color:var(--color-gameLight); font-size:.8rem; line-height:1.4; white-space:pre-wrap; }
.guild-event-by{ color:var(--color-gameSlate); font-size:.7rem; }
.guild-event-form{ display:flex; flex-direction:column; gap:8px; padding:10px; border:1px dashed rgba(183,138,57,.4); border-radius:8px; }
.guild-event-times{ display:flex; flex-wrap:wrap; gap:10px; }
.guild-event-field{ display:flex; flex-direction:column; gap:3px; flex:1 1 180px; }
.guild-event-label{ color:#cbb77b; font-size:.72rem; }
.guild-event-form textarea.social-input{ min-height:64px; resize:vertical; }
@media (max-width: 600px){
    .guild-title-name{ flex-basis:100%; }
    .guild-member-row{ flex-wrap:wrap; }
}
/* Guild crest / colors locked after a change (owner spec 2026-11-05) - still clickable, to say when it frees up. */
.social-guild-crest.locked, .social-guild-colors-compact.locked{ opacity:.6; cursor:not-allowed; }
/* Founding Structure requirements (owner request 2026-11-05): an unmet requirement stands out - red border, a red "!"
   badge in place of the check (the short stat stays red); an empty seat lists what it requires in columns -
   Level / Followers headers with the minimums beneath - and grows to fit. */
.gtree-founding-stage .gtree-card.gtree-has-reqs{ height:auto; }
.gtree-founding-stage .gtree-card.gtree-has-unmet{ border:1px solid #e8695c; background:linear-gradient(165deg,rgba(120,38,32,.62),rgba(44,22,20,.95)); box-shadow:0 0 0 1px rgba(232,105,92,.45), 0 0 18px rgba(232,105,92,.42), inset 0 0 14px rgba(232,105,92,.14); }
.gtree-slot-alert{ position:absolute; top:5px; right:6px; display:grid; width:18px; height:18px; place-items:center; border:1px solid rgba(228,127,116,.75); border-radius:50%; background:#3a1f1c; color:#ffc2b9; font-size:.72rem; font-weight:bold; box-shadow:0 1px 4px rgba(0,0,0,.45); }
.gtree-seat-reqs{ display:grid; grid-template-columns:repeat(var(--req-cols, 2), 1fr); column-gap:8px; row-gap:1px; width:100%; margin-top:5px; text-align:center; }
.gtree-seat-req-head{ font-size:.58rem; letter-spacing:.05em; text-transform:uppercase; color:rgba(203,183,123,.75); }
.gtree-seat-req-value{ font-size:.82rem; font-weight:bold; color:#ecd98f; }
.gtree-founding-stage .gtree-card.gtree-placeholder.gtree-has-reqs .gtree-name{ flex:0 0 auto; }
/* The line down to a vassal who falls short of their seat: red and glowing (owner request 2026-11-05). */
.guild-founding-popup .gtree-lines path.unmet, .gtree-stage .gtree-lines path.unmet{ stroke:#e8695c; stroke-width:2.2; filter:drop-shadow(0 0 3px rgba(232,105,92,.85)); }
/* An empty Required Fealty seat is a problem too (owner request 2026-11-05): the unmet red, dashed - and so is its line. */
.gtree-founding-stage .gtree-card.gtree-placeholder.gtree-seat-missing{ border:1px dashed #e8695c; background:linear-gradient(165deg,rgba(120,38,32,.42),rgba(44,22,20,.85)); box-shadow:0 0 14px rgba(232,105,92,.3), inset 0 0 12px rgba(232,105,92,.1); }
.gtree-founding-stage .gtree-card.gtree-placeholder.gtree-seat-missing:hover{ border-color:#f08a7f; }
.gtree-founding-stage .gtree-card.gtree-seat-missing .gtree-name{ color:#f2b5ad; }
.gtree-founding-stage .gtree-card.gtree-seat-missing .gtree-seat{ border-color:rgba(232,105,92,.55); }
.gtree-founding-stage .gtree-card.gtree-seat-missing .gtree-seat svg{ stroke:#f2b5ad; }
.gtree-founding-stage .gtree-card.gtree-seat-missing .gtree-seat-req-head{ color:rgba(242,181,173,.75); }
.gtree-founding-stage .gtree-card.gtree-seat-missing .gtree-seat-req-value{ color:#ffd0c9; }
.guild-founding-popup .gtree-lines path.seat.unmet, .gtree-stage .gtree-lines path.seat.unmet{ stroke-dasharray:5 4; }
/* Establish Guild's name prompt (owner request 2026-11-05): the Founding Structure frame (guild-tree-popup - its corner
   loops, border ornaments and close button) at prompt size - just the question, the name box and Confirm. */
.guild-tree-popup.guild-name-popup{ width:min(520px,calc(100vw - 32px)); max-width:min(520px,calc(100vw - 32px)); height:auto; max-height:none; padding:44px 40px 34px; }
.guild-name-popup .item-use-inspect-details{ overflow:visible; }
.guild-name-prompt{ display:flex; flex-direction:column; align-items:stretch; gap:18px; width:100%; }
.guild-name-question{ margin:0; font-family:var(--font-display); font-weight:normal; font-size:1.45rem; color:var(--color-gold); text-align:center; text-shadow:0 2px 6px rgba(0,0,0,.6); }
.guild-name-input{ width:100%; box-sizing:border-box; padding:9px 12px; font-size:1rem; text-align:center; }
.guild-name-actions{ display:flex; justify-content:center; }
.guild-name-actions .social-btn{ min-width:120px; padding:6px 18px; font-size:.85rem; }
/* Establish Guild (owner request 2026-11-05): once the lowest rank is met it's THE call to action - a full-width gold
   button with the crest mark; View Founding Structure drops to a quiet link beneath it. */
.social-guild-founding.ready{ border-style:solid; border-color:rgba(218,171,58,.55); }
.social-establish-cta{ display:grid; width:100%; grid-template-columns:52px minmax(0,1fr) auto; align-items:center; gap:12px; padding:12px 14px; border:1px solid #e3b743; border-radius:8px;
    background:linear-gradient(105deg,rgba(214,160,42,.55),rgba(120,82,20,.6) 55%,rgba(214,160,42,.32)); color:#fff4cc; text-align:left; cursor:pointer;
    box-shadow:inset 0 1px rgba(255,236,170,.25), 0 0 16px rgba(227,183,67,.32); transition:box-shadow .16s ease, transform .16s ease, border-color .16s ease; }
.social-establish-cta:hover, .social-establish-cta:focus-visible{ border-color:#ffd65c; box-shadow:inset 0 1px rgba(255,236,170,.3), 0 0 22px rgba(255,214,92,.5); transform:translateY(-1px); outline:none; }
.social-establish-icon{ display:grid; width:50px; height:50px; place-items:center; border:1px solid rgba(255,226,140,.7); border-radius:8px; background:radial-gradient(circle at 50% 30%,rgba(255,214,92,.35),rgba(0,0,0,.35)); }
.social-establish-icon svg{ width:34px; height:34px; fill:rgba(255,214,92,.18); stroke:#ffe08a; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.social-establish-copy{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.social-establish-title{ font-family:var(--font-display); font-size:1.12rem; color:#fff0b8; text-shadow:0 1px 3px rgba(0,0,0,.55); }
.social-establish-detail{ font-size:.76rem; color:rgba(255,240,200,.82); }
.social-establish-cta .social-hierarchy-arrow{ color:#ffe08a; font-size:1.3rem; }
.social-founding-link{ align-self:center; padding:2px 4px; border:0; background:none; color:#cbb77b; font-family:var(--font-ui); font-size:.76rem; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.social-founding-link:hover, .social-founding-link:focus-visible{ color:#f0da87; outline:none; }
/* Manage Guild + Guild Calendar (owner request 2026-11-05): the Founding Structure frame (guild-tree-popup) at panel
   size; the heading stays put and the list scrolls inside - nothing wider than the frame. */
.guild-tree-popup.guild-panel-popup{ width:min(780px,calc(100vw - 32px)); max-width:min(780px,calc(100vw - 32px)); height:min(760px,calc(100vh - 32px)); padding:40px 34px 30px; }
.guild-panel-popup .item-use-inspect-details{ display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.guild-panel-popup .guild-manage, .guild-panel-popup .guild-calendar{ width:100%; max-height:none; flex:1; min-height:0; box-sizing:border-box; }
.guild-panel-popup .guild-finalize-title{ text-align:center; font-size:1.45rem; text-shadow:0 2px 6px rgba(0,0,0,.6); }
.guild-panel-popup .guild-manage-scroll{ flex:1; min-height:0; overflow-x:hidden; padding:2px 8px 2px 2px; }
.guild-panel-popup .guild-manage-section{ padding:10px 12px; border:1px solid rgba(183,138,57,.25); border-radius:8px; background:rgba(0,0,0,.16); }
.guild-panel-popup .guild-manage-section > .social-input{ width:100%; box-sizing:border-box; }
.guild-panel-popup .guild-calendar-head{ position:relative; justify-content:center; }
.guild-panel-popup .guild-calendar-head .social-btn{ position:absolute; right:0; }
/* Guild card trims (owner request 2026-11-05): Manage / Calendar pills on the screen's top border over the guild column
   (left set by socialDrawGuildPills); an unlocked-but-unchosen crest is a plain shield with +, no dotted outline; the
   Guild Hierarchy popup's Hierarchy | Rank N Requirements switch. */
.social-guild-pills{ position:absolute; top:-13px; z-index:6; display:flex; gap:10px; transform:translateX(-50%); }
.social-guild-pills:empty{ display:none; }
.social-guild-pills .social-my-colors-border{ position:static; transform:none; white-space:nowrap; }
.social-guild-crest.empty{ border:0; background:none; }
.social-guild-crest.empty svg{ opacity:.9; }
.gtree-view-switch{ display:inline-flex; padding:3px; border:1px solid rgba(207,159,52,.55); border-radius:15px; background:rgba(0,0,0,.28); gap:2px; }
.gtree-view-tab{ padding:4px 14px; border:0; border-radius:12px; background:transparent; color:#cbb77b; font-family:var(--font-ui); font-size:.76rem; font-weight:bold; cursor:pointer; }
.gtree-view-tab:hover, .gtree-view-tab:focus-visible{ color:#f0da87; outline:none; }
.gtree-view-tab.active{ background:linear-gradient(180deg,rgba(214,160,42,.55),rgba(140,98,24,.55)); color:#fff0b8; box-shadow:inset 0 1px rgba(255,236,170,.25); cursor:default; }
/* Guild Hierarchy popup's two pages (owner request 2026-11-05): both built at once and stacked; switching slides the new
   page over the old - the requirements in from the right, the hierarchy back from the left (GTREE_VIEW_SLIDE_MS). */
.guild-tree-popup .gtree-views{ position:relative; display:flex; flex:1; width:100%; min-height:0; height:100%; overflow:hidden; }
.gtree-pane{ position:absolute; inset:0; display:flex; flex-direction:column; min-height:0; background:linear-gradient(155deg,#49443b,#22211f 72%); transition:transform 480ms cubic-bezier(.2,.75,.25,1); }
.gtree-pane > .gtree{ flex:1; min-height:0; height:100%; }
.gtree-pane:not(.active){ visibility:hidden; pointer-events:none; }
.gtree-pane.outgoing{ z-index:1; }
.gtree-pane.incoming{ z-index:2; box-shadow:0 0 28px rgba(0,0,0,.6); }
/* The two stacked pages are solid layers, so keep their stacking inside .gtree-views and lift the frame's corner loops and
   border ornaments back above them (owner report 2026-11-05: the corners had dropped behind the pages). */
.guild-tree-popup .gtree-views{ isolation:isolate; z-index:0; }
.item-use-wrapper.inspect-frame.guild-tree-popup::before,
.item-use-wrapper.inspect-frame.guild-tree-popup::after,
.guild-tree-popup > .inspect-frame-corner::before,
.guild-tree-popup > .inspect-frame-corner::after,
.guild-tree-popup > .inspect-frame-ornament::before,
.guild-tree-popup > .inspect-frame-ornament::after{ z-index:8; pointer-events:none; }
/* At rest a page is see-through (the popup's own lighting shows, no inner box); only the page sliding in is solid, to
   cover the one beneath. */
.gtree-pane{ background:none; }
.gtree-pane.incoming{ background:radial-gradient(circle at 50% -10%,rgba(183,138,57,.18),transparent 36%),linear-gradient(155deg,#49443b,#22211f 72%); }
/* Both pages stay see-through while sliding (the old one is trimmed away by clip-path in step - scripts/social.js
   switchView), so the page looks the same during and after the slide. Replaces the solid incoming background above. */
.gtree-pane.incoming{ background:none; box-shadow:none; }

/* Magic ammunition (Conjuration, 2026-11-07): a conjured launcher's own shot - the base ammo picture, made to look magical. */
.combat-hero-ability.combat-magic-ammo{
    filter: hue-rotate(185deg) saturate(1.8) brightness(1.15) drop-shadow(0 0 5px rgba(120, 190, 255, 0.95));
    animation: combat-magic-ammo-pulse 2.4s ease-in-out infinite;
}
@keyframes combat-magic-ammo-pulse{
    0%, 100%{ filter: hue-rotate(185deg) saturate(1.8) brightness(1.1) drop-shadow(0 0 4px rgba(120, 190, 255, 0.8)); }
    50%{ filter: hue-rotate(185deg) saturate(2) brightness(1.3) drop-shadow(0 0 9px rgba(150, 210, 255, 1)); }
}

/* A summoned minion's card poofs away when it dies or fades - no corpse (combatPoofSummon(), 2026-11-07). */
.combat-party-block.combat-summon-poof{
    animation: combat-summon-poof .45s ease-in forwards;
    pointer-events: none;
}
@keyframes combat-summon-poof{
    0%{ opacity: 1; transform: scale(1); filter: none; }
    60%{ opacity: .6; transform: scale(1.08); filter: brightness(1.8) blur(1px); }
    100%{ opacity: 0; transform: scale(.6); filter: brightness(2.2) blur(4px); }
}
