/* Yugara fullscreen: BrowserQuest's native fixed layout (30x16 @ scale 3,
   1440x768 canvas) is scaled as ONE unit via a #container CSS transform
   (app.scaleContainer). We do NOT override #container/#canvas/#bar-container
   geometry — the media block lays them out and scaleContainer() fits the whole
   composite to the window. We only kill page chrome, drop the in-game border,
   keep pixels crisp, and hide the leftover BrowserQuest logo. */

html, body { width:100%; height:100%; margin:0; padding:0; overflow:hidden; background:#000; }

/* In-game: pure-black letterbox, no decorative frame/border, no dark overlay. */
body.game { background:#000 !important; }
.game #canvasborder { padding:0 !important; background:none !important; }
.game #container { width:960px !important; background:transparent !important; }

/* Crisp nearest-neighbour upscale of the transform-scaled canvases. */
#canvas canvas { image-rendering:pixelated; image-rendering:crisp-edges; }

/* Hide the leftover BrowserQuest title-screen logo (sprite of spritesheet.png). */
#logo, #logosparks { display:none !important; }

/* Facing-only combat: no in-game tile cursor, but keep the OS pointer visible
   (you click to attack). BQ normally hides it via .started #canvas{cursor:none}. */
.started #canvas, .started #foreground { cursor: default !important; }

/* ===========================================================================
   Inventory + Stats panel (press I). A tabbed RPG window: grid of item-slot
   boxes with real pixel icons, rarity-tinted frames, quantity/tier badges and
   an inspect detail rail; a second tab shows the character sheet. Palette and
   GraphicPixel font match the HUD bar (parchment/brass over near-black wood).
   These rules load after main.css, so they override the legacy #inventorybox.
   =========================================================================== */
#inventorybox {
    display:none; position:absolute; left:50%; top:50%;
    width:560px; margin-left:-280px; margin-top:-215px;
    z-index:1100; box-sizing:border-box;
    background:linear-gradient(180deg,#241a0f 0%,#1a120a 100%);
    border:3px solid #6b4f2a; border-radius:8px; padding:0;
    font-family:'GraphicPixel',sans-serif; color:#f0e6d2;
    box-shadow:0 10px 40px rgba(0,0,0,.7), inset 0 0 0 1px rgba(232,184,115,.18);
}
#inventorybox.active { display:block; }

/* --- header / tabs --- */
#inv-header {
    display:flex; align-items:stretch; justify-content:space-between;
    border-bottom:2px solid #6b4f2a;
    background:linear-gradient(180deg,#2e2113,#1d150c);
    border-radius:6px 6px 0 0;
}
#inv-tabs { display:flex; gap:2px; padding:8px 8px 0 8px; }
.inv-tab {
    cursor:pointer; padding:7px 18px 6px; font-size:13px; color:#b39a78;
    background:#1b130b; border:1px solid #4a371d; border-bottom:none;
    border-radius:5px 5px 0 0; letter-spacing:.5px; user-select:none;
    transition:color .12s, background .12s;
}
.inv-tab:hover { color:#f0e6d2; }
.inv-tab.active {
    color:#ffd9a0; background:#3a2a16; border-color:#6b4f2a;
    box-shadow:inset 0 2px 0 #e8b873;
}
#inv-close {
    cursor:pointer; color:#cc9988; font-size:16px; padding:10px 14px;
    align-self:center; line-height:1; transition:color .12s, transform .12s;
}
#inv-close:hover { color:#ff7a66; transform:scale(1.15); }

/* --- panes --- */
#inv-body { padding:14px; }
.inv-pane { display:none; }
.inv-pane.active { display:block; }

/* --- gear grid --- */
#inv-pane-gear { display:none; }
#inv-pane-gear.active { display:flex; gap:14px; align-items:flex-start; }
#inv-grid {
    display:grid; grid-template-columns:repeat(5,58px); gap:8px;
    align-content:start; flex:0 0 auto;
    max-height:296px; overflow-y:auto; padding-right:4px;   /* ~4 rows then scroll, so the box stays compact */
}
#inv-detail { max-height:340px; overflow-y:auto; }   /* tall weapon detail scrolls; box never runs off-screen */
.inv-slot {
    position:relative; width:58px; height:58px; box-sizing:border-box;
    background:radial-gradient(circle at 50% 38%,#2b2013,#140e07);
    border:2px solid #4a371d; border-radius:6px;
    box-shadow:inset 0 0 6px rgba(0,0,0,.6);
}
.inv-slot.filled { cursor:pointer; transition:transform .08s, border-color .12s, box-shadow .12s; }
.inv-slot.filled:hover { transform:translateY(-2px); box-shadow:0 4px 10px rgba(0,0,0,.5),inset 0 0 6px rgba(0,0,0,.5); }
.inv-slot.selected { outline:2px solid #ffd9a0; outline-offset:1px; }
.inv-icon {
    position:absolute; inset:0; margin:auto; width:40px; height:40px;
    object-fit:contain; image-rendering:pixelated; image-rendering:-moz-crisp-edges;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.7));
}
/* rarity frames (by tier) */
.inv-slot.r1 { border-color:#7d8085; }
.inv-slot.r2 { border-color:#5cb85c; box-shadow:inset 0 0 8px rgba(92,184,92,.25); }
.inv-slot.r3 { border-color:#4a90d9; box-shadow:inset 0 0 8px rgba(74,144,217,.3); }
.inv-slot.r4 { border-color:#b56bd9; box-shadow:inset 0 0 9px rgba(181,107,217,.35); }
.inv-slot.r5 { border-color:#e8b873; box-shadow:inset 0 0 10px rgba(232,184,115,.45); }
/* badges */
.inv-qty {
    position:absolute; right:2px; bottom:1px; font-size:11px; color:#fff;
    text-shadow:0 0 3px #000,1px 1px 0 #000; padding:0 2px;
}
.inv-tier {
    position:absolute; left:2px; top:1px; font-size:9px; color:#241a0f;
    background:#e8b873; border-radius:3px; padding:0 3px; line-height:13px;
    font-weight:bold;
}
.inv-eqbadge {
    position:absolute; right:2px; top:1px; font-size:9px; color:#0c1a0c;
    background:#8fdc8f; border-radius:3px; padding:0 3px; line-height:13px;
    font-weight:bold;
}

/* --- detail rail --- */
#inv-detail {
    flex:1; min-width:0; background:rgba(0,0,0,.28);
    border:1px solid #4a371d; border-radius:6px; padding:12px;
    font-size:12px; display:flex; flex-direction:column;
}
.inv-detail-empty { color:#8a7a5e; font-style:italic; line-height:1.6; margin:auto; text-align:center; }
.inv-d-name { font-size:14px; color:#ffd9a0; margin-bottom:4px; line-height:1.3; }
.inv-d-sub { color:#9fb8c8; margin-bottom:10px; }
.inv-d-row { display:flex; justify-content:space-between; padding:4px 0; border-bottom:1px solid #2a1f12; }
.inv-d-row span:first-child { color:#b39a78; }
.inv-d-row span:last-child { color:#f0e6d2; }
.inv-d-flavor { color:#a59a82; font-style:italic; line-height:1.5; margin:10px 0; }
.inv-d-equip {
    margin-top:auto; cursor:pointer; text-align:center; user-select:none;
    background:linear-gradient(180deg,#7a5a2e,#5a4220); color:#fff;
    border:1px solid #8a6838; border-radius:5px; padding:8px; font-size:13px;
    transition:filter .12s;
}
.inv-d-equip:hover { filter:brightness(1.18); }
.inv-d-equipped { margin-top:auto; text-align:center; color:#8fdc8f; padding:8px; }
.inv-empty-note { color:#8a7a5e; font-style:italic; line-height:1.6; padding:18px 6px; text-align:center; max-width:420px; }

/* --- rich weapon card --- */
.inv-d-head { display:flex; gap:10px; align-items:flex-start; margin-bottom:10px; }
.inv-d-icon {
    width:52px; height:52px; flex:0 0 52px; object-fit:contain;
    image-rendering:pixelated; image-rendering:-moz-crisp-edges;
    background:radial-gradient(circle at 50% 40%,#2b2013,#120c06);
    border:2px solid #4a371d; border-radius:6px; padding:3px;
    filter:drop-shadow(0 2px 2px rgba(0,0,0,.6));
}
.inv-d-headtext { min-width:0; }
.inv-d-role { color:#b39a78; font-style:italic; margin-top:3px; line-height:1.35; }
/* rarity-coloured names + icon frames */
.inv-d-name.r1, .inv-slot.r1 .inv-tier { color:#cfd2d6; }
.inv-d-name.r2 { color:#6fd96f; } .inv-d-icon.r2 { border-color:#5cb85c; }
.inv-d-name.r3 { color:#69a9e6; } .inv-d-icon.r3 { border-color:#4a90d9; }
.inv-d-name.r4 { color:#c98fe6; } .inv-d-icon.r4 { border-color:#b56bd9; }
.inv-d-name.r5 { color:#f0c87a; } .inv-d-icon.r5 { border-color:#e8b873; }
.inv-d-stats { display:grid; grid-template-columns:1fr; gap:0; margin:6px 0 2px; }
.inv-d-stats > div { display:flex; justify-content:space-between; gap:8px; padding:4px 0; border-bottom:1px solid #2a1f12; }
.inv-d-stats span { color:#b39a78; } .inv-d-stats b { color:#f0e6d2; font-weight:600; text-align:right; }
.inv-d-ench { margin:9px 0 4px; color:#e8c98a; }
.inv-d-ench .t1{color:#cfd2d6;} .inv-d-ench .t2{color:#6fd96f;} .inv-d-ench .t3{color:#69a9e6;} .inv-d-ench .t4{color:#c98fe6;} .inv-d-ench .t5{color:#f0c87a;}
.inv-d-ench b { color:#fff; }
.inv-d-lore { margin:8px 0; display:flex; flex-direction:column; gap:5px; }
.inv-d-lore .ln { line-height:1.4; padding-left:2px; border-left:3px solid #444; padding-left:7px; }
.inv-d-lore .ln b { display:block; font-size:10px; letter-spacing:.5px; text-transform:uppercase; margin-bottom:1px; }
.inv-d-lore .sw { border-left-color:#5cb85c; color:#cfe6cf; } .inv-d-lore .sw b { color:#6fd96f; }
.inv-d-lore .wk { border-left-color:#d9694a; color:#e6d2cc; } .inv-d-lore .wk b { color:#e0805f; }
.inv-d-lore .ct { border-left-color:#4a90d9; color:#cdd9e6; } .inv-d-lore .ct b { color:#69a9e6; }
button.inv-d-equip { width:100%; font-family:inherit; }

/* --- low-resource flash: pulses the stamina/mana bar red when an action is blocked --- */
@keyframes barEmptyFlash {
    0%, 100% { box-shadow:inset 0 0 0 1px rgba(0,0,0,.6),0 1px 2px rgba(0,0,0,.6); }
    35%, 65% { box-shadow:0 0 0 2px #ff5a5a, 0 0 10px 2px rgba(255,60,60,.95); }
}
.bar-empty-flash { animation:barEmptyFlash 0.45s ease-in-out 1; }

/* --- stats / character sheet --- */
#inv-stats { display:flex; flex-direction:column; gap:14px; }
.inv-s-head { display:flex; align-items:center; gap:16px; }
.inv-s-medal {
    position:relative; width:64px; height:64px; flex:0 0 auto; border-radius:50%;
    background:radial-gradient(circle at 42% 34%,#5b554d,#1a1613 78%);
    border:3px solid #6b4f2a;
    box-shadow:inset 0 0 0 1px rgba(232,184,115,.35), 0 2px 6px rgba(0,0,0,.6);
    display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.inv-s-medal .lv-num { font-size:26px; color:#ffd9a0; line-height:1; text-shadow:0 1px 2px rgba(0,0,0,.8); }
.inv-s-medal .lv-cap { font-size:9px; color:#b39a78; letter-spacing:1px; margin-top:2px; }
.inv-s-headinfo { flex:1; min-width:0; }
.inv-s-name { font-size:18px; color:#ffd9a0; }
.inv-s-level { font-size:12px; color:#b39a78; margin-top:3px; }
.inv-s-xpwrap { margin-top:8px; width:100%; }
.inv-s-bar { height:12px; border-radius:6px; background:#160f08; border:1px solid #4a371d; overflow:hidden; }
.inv-s-bar > i { display:block; height:100%; border-radius:6px; }
.inv-s-xp > i { background:linear-gradient(90deg,#6fa8ff,#4a90d9); }
.inv-s-barlabel { font-size:10px; color:#9aa0a6; margin-top:3px; }
.inv-s-vitals { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; }
.inv-s-vital { background:rgba(0,0,0,.28); border:1px solid #4a371d; border-radius:6px; padding:9px 10px; }
.inv-s-vital .lbl { display:flex; align-items:center; gap:6px; font-size:11px; color:#b39a78; margin-bottom:6px; }
.inv-s-vital .ico { width:16px; height:16px; image-rendering:pixelated; }
.inv-s-vital .val { font-size:13px; color:#f0e6d2; margin-top:5px; }
.inv-s-hp > i { background:linear-gradient(90deg,#ff6b6b,#d83939); }
.inv-s-stam > i { background:linear-gradient(90deg,#86e986,#5cb85c); }
.inv-s-mana > i { background:linear-gradient(90deg,#6fb8ff,#4a90d9); }
.inv-s-equip { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.inv-s-eqslot { display:flex; align-items:center; gap:10px; background:rgba(0,0,0,.28); border:1px solid #4a371d; border-radius:6px; padding:8px 10px; }
.inv-s-eqslot img { width:36px; height:36px; image-rendering:pixelated; object-fit:contain; }
.inv-s-eqslot .eq-slot { font-size:10px; color:#b39a78; text-transform:uppercase; letter-spacing:.5px; }
.inv-s-eqslot .eq-name { font-size:13px; color:#ffd9a0; }
.inv-s-eqslot .eq-mech { font-size:11px; color:#9fb8c8; }
.inv-s-section { font-size:11px; color:#e8b873; letter-spacing:1px; text-transform:uppercase; border-bottom:1px solid #4a371d; padding-bottom:4px; }
