/* =========================================================
   Dune.Tips — Dune: Awakening-inspired UI skin (hard-edge)
   Drop-in replacement for styles.css
   ========================================================= */

/* -----------------------------
   1) Design tokens
   ----------------------------- */
:root{
  /* Surfaces */
  --bg-0:#07080a;          /* page */
  --bg-1:#0d0f12;          /* main panel */
  --bg-2:#12151a;          /* raised */
  --bg-3:#171b22;          /* hover/active */
  --bg-glow:rgba(226,192,137,.10);

  /* Text */
  --text:#e9e2d7;
  --muted:#b8aa93;
  --muted2:#8f8574;

  /* Strokes */
  --stroke-1:rgba(226,192,137,.18);
  --stroke-2:rgba(226,192,137,.38);
  --stroke-3:rgba(226,192,137,.65);

  /* Accents */
  --sand:#e2c089;
  --brass:#c9a86a;
  --purple:#9b6bd6;

  /* Status */
  --good:#78e2a2;
  --warn:#f1d27a;
  --bad:#ff7d7d;

  /* Geometry */
  --radius:0px;
  --radius2:0px;
  --pad:14px;

  /* Typography */
  --font-ui:"Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  --font-title:"Cinzel", ui-serif, Georgia, "Times New Roman", serif;

  /* Max width */
  --results-max:762px;

  /* Type colors (used by your existing JS data-type-color attr) */
  --type-1:rgba(255, 128, 128,1);     /* Houses */
  --type-2:rgb(205, 205, 205);        /* Refined Materials */
  --type-3:rgba(114,180,70,1);        /* Components */
  --type-4:rgba(248, 131, 54,1);      /* Consumables */
  --type-5:rgb(224, 185, 160);        /* Raw Materials */
  --type-6:rgba(100, 146, 255,1);     /* Fuel */
  --type-7:rgba(198,157,247,1);       /* Schematics */
  --type-8:rgba(230,197,109,.75);     /* Variants */
  --type-9:rgba(230, 109, 204, 0.75);     /* Dungeons */
  --type-10:rgba(56, 189, 248, 0.75);    /* Augments */
}

/* -----------------------------
   2) Base + page background
   ----------------------------- */
*{
  box-sizing:border-box;
  /* Hard-edge reset */
  border-radius:0 !important;
}

html{scrollbar-gutter:stable}
body{
  margin:0;
  font-family:var(--font-ui);
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 25% 0%, var(--bg-glow), transparent 55%),
    radial-gradient(900px 700px at 80% 18%, rgba(155,107,214,.10), transparent 55%),
    linear-gradient(180deg, #050607, var(--bg-0) 35%, #050607);
  min-height:100vh;
}

body.modalOpen{
  overflow: hidden;
}

.pill:empty{
  display:none !important;
}

a{color:var(--sand); text-decoration:none}
a:hover{color:var(--brass); text-decoration:underline}
img{max-width:100%; display:block}

/* Selection */
::selection{background:rgba(226,192,137,.22)}

/* Scrollbar (WebKit) */
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:#07080a}
::-webkit-scrollbar-thumb{
  background:rgba(226,192,137,.22);
  border:1px solid rgba(226,192,137,.28);
}
::-webkit-scrollbar-thumb:hover{background:rgba(226,192,137,.34)}

/* -----------------------------
   3) Layout containers
   ----------------------------- */
.container{
  width:min(1100px, calc(100% - 32px));
  margin-inline:auto;
}
.container__center{
  padding:18px 0 60px;
}

/* -----------------------------
   4) Header / branding
   ----------------------------- */
.header__container{
  position:sticky;
  top:0;
  z-index:50;
  background:
    linear-gradient(180deg, rgba(13,15,18,.92), rgba(7,8,10,.75));
  backdrop-filter: blur(8px);
  border-bottom:1px solid rgba(226,192,137,.14);
}
body.isIdle .header__container{
  display:none;
}
.header__inner{
  width:min(1100px, calc(100% - 32px));
  margin-inline:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:14px 0;
}

.logo{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.logo__image{
  width:38px;
  height:38px;
  object-fit:contain;
  border:1px solid rgba(226,192,137,.18);
  background:linear-gradient(180deg, rgba(18,21,26,.9), rgba(11,12,14,.9));
  padding:6px;
}
.logo__title{
  font-family:var(--font-title);
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:18px;
  line-height:1.1;
}
.logo__subtitle{
  font-size:12px;
  color:var(--muted2);
  margin-top:2px;
  letter-spacing:.02em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.beta__badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-left:8px;
  padding:2px 8px;
  border:1px solid rgba(226,192,137,.20);
  color:var(--sand);
  text-transform:uppercase;
  letter-spacing:.10em;
  font-weight:700;
  font-size:10px;
  background:linear-gradient(180deg, rgba(226,192,137,.10), rgba(0,0,0,0));
}

.meta{
  font-size:12px;
  color:var(--muted);
  letter-spacing:.04em;
  text-transform:uppercase;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}



/* -----------------------------
   5) Hero / search
   ----------------------------- */
.hero{padding:16px 0 10px}
.hero__inner{display:flex; justify-content:center}
.hero__search{
  width:min(var(--results-max), 100%);
}
html, body{ overflow-x: hidden; }
.searchbar{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 12px;
  background:black;
  border:1px solid rgba(226,192,137,.18);
  position:relative;
}
.searchbar::before{
  content:"";
  position:absolute;
  inset:-1px;
  pointer-events:none;
  border:1px solid rgba(255,255,255,.03);
}
.searchbar:focus-within{
  border-color:rgba(226,192,137,.45);
  box-shadow:0 0 0 1px rgba(226,192,137,.18) inset;
}
.searchbar__icon{
  color:var(--sand);
  opacity:.9;
  font-size:22px;
  user-select:none;
}
.searchbar__input{
  flex:1;
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
  font-size:16px;
  letter-spacing:.02em;
}
.searchbar__input::placeholder{color:rgba(184,170,147,.70);font-size:14px;}
.searchbar__clear{
  border:1px solid rgba(226,192,137,.18);
  background:transparent;
  color:var(--muted);
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  opacity: 0;
  cursor:pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.searchbar__clear:hover{
  color:var(--sand);
  border-color:rgba(226,192,137,.42);
  background:rgba(226,192,137,.08);
}
.homeHero{
  display:none;
}
body.search-has-text .searchbar__clear{
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
body.isIdle .homeHero{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  margin-bottom:28px;
  text-align:center;
}

body.isIdle .homeHero__title{
  font-family: var(--font-title);
  font-size:82px;
  font-weight:800;
  letter-spacing:3px;
}

body.isIdle .homeHero__sub{
  font-size:14px;
  opacity:.65;
  letter-spacing:.3px;
}

/* =========================================
   Type tiles row (filters)
   ========================================= */

.typeTiles{
  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(120px, 1fr));
  gap:10px;
}

/* Base tile styling (JS creates these) */
.typeTiles > button,
.typeTile,
.filterTile,
.tile{
  appearance:none;
  position:relative;
  overflow:hidden;

  /* Default accent (overridden per-type below) */
  --corner: var(--sand);

  border:1px solid rgba(226,192,137,.18);
  background:linear-gradient(180deg, rgba(18,21,26,.70), rgba(11,12,14,.82));
  color:var(--text);

  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:flex-start;  /* LEFT aligned always */
  text-align:left;

  min-height:44px;
  padding:10px 10px 10px 28px; /* room for diamond */
  gap:8px;

  text-transform:uppercase;
  font-weight:600;
  font-size:12px;

  transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}

/* Prevent child spans from "stretching" and creating weird spacing */
.typeTiles > button > *,
.typeTile > *,
.filterTile > *,
.tile > *{
  flex: 1 1 auto;
  min-width: 0;

  /* 2-line clamp */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

/* Type color mapping (expects data-type-color on the BUTTON) */
.typeTiles > button[data-type-color="1"]{ --corner: var(--type-1); }
.typeTiles > button[data-type-color="2"]{ --corner: var(--type-2); }
.typeTiles > button[data-type-color="3"]{ --corner: var(--type-3); }
.typeTiles > button[data-type-color="4"]{ --corner: var(--type-4); }
.typeTiles > button[data-type-color="5"]{ --corner: var(--type-5); }
.typeTiles > button[data-type-color="6"]{ --corner: var(--type-6); }
.typeTiles > button[data-type-color="7"]{ --corner: var(--type-7); }
.typeTiles > button[data-type-color="8"]{ --corner: var(--type-8); }
.typeTiles > button[data-type-color="9"]{ --corner: var(--type-9); }
.typeTiles > button[data-type-color="10"]{ --corner: var(--type-10); }

/* Diamond indicator */
.typeTiles > button::before,
.typeTile::before,
.filterTile::before,
.tile::before{
  content:"◆";
  position:absolute;
  left:10px;
  top:50%;
  transform:translateY(-50%);
  font-size:10px;
  line-height:1;
  color:var(--corner);
  opacity:.9;
  pointer-events:none;
}

/* Hover */
.typeTiles > button:hover,
.typeTile:hover,
.filterTile:hover,
.tile:hover{
  border-color: color-mix(in srgb, var(--corner) 70%, rgba(226,192,137,.25));
  background:linear-gradient(180deg, rgba(23,27,34,.80), rgba(13,15,18,.92));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--corner) 28%, transparent) inset,
    0 0 12px color-mix(in srgb, var(--corner) 14%, transparent);
}

/* Active state (your real class) */
.typeTile.typeTile--active{
  border-color: var(--corner);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--corner) 10%, rgba(18,21,26,.85)),
      rgba(11,12,14,.92)
    );
  box-shadow:
    0 0 0 1px var(--corner) inset,
    0 0 18px color-mix(in srgb, var(--corner) 22%, transparent);
  color: var(--sand);
}

/* Ensure active doesn't get overridden by hover */
.typeTile.typeTile--active:hover{
  border-color: var(--corner);
}

/* Count + actions row */
.hero__subrow{
  margin-top:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.count{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.10em;
}
.hero__actions{display:flex; gap:10px; align-items:center}

/* Results view toggle (created by JS) */
.results__view__toggle{
  display:flex;
  border:1px solid rgba(226,192,137,.18);
  background:linear-gradient(180deg, rgba(18,21,26,.78), rgba(11,12,14,.86));
}
.results__view__toggle--small{transform:scale(.95); transform-origin:right}
.results__view__toggle__btn{
  border:0;
  background:transparent;
  color:var(--muted);
  padding:10px 12px;
  cursor:pointer;
  text-transform:uppercase;
  letter-spacing:.10em;
  font-weight:700;
  font-size:11px;
  border-right:1px solid rgba(226,192,137,.12);
}
.results__view__toggle__btn:last-child{border-right:0}
.results__view__toggle__btn:hover{color:var(--sand); background:rgba(226,192,137,.08)}
.results__view__toggle__btn--active{
  color:var(--sand);
  background:linear-gradient(180deg, rgba(226,192,137,.12), rgba(0,0,0,0));
}

/* -----------------------------
   6) Results containers
   ----------------------------- */
.results{margin-top:8px}
.results--hidden{display:none}

/* Card grid container */
.tiles__container{
  width:min(var(--results-max), 100%);
  margin-inline:auto;
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(230px, 1fr));
  gap:12px;
}
.tiles__container--tight{gap:10px}

/* Cards created by JS */
.card, .tileCard, .resultCard, .itemCard{
  border:1px solid rgba(226,192,137,.18);
  background:linear-gradient(180deg, rgba(18,21,26,.70), rgba(11,12,14,.86));
  padding:12px;
  position:relative;
  transition: background .12s ease, border-color .12s ease;
}
.card::before, .tileCard::before, .resultCard::before, .itemCard::before{
  content:"";
  position:absolute;
  inset:-1px;
  border:1px solid rgba(255,255,255,.03);
  pointer-events:none;
}

.card__h{
  margin:0 0 8px 0;
  font-family:var(--font-title);
  text-transform:uppercase;
  letter-spacing:.10em;
  font-weight:800;
  font-size:16px;
  color:var(--sand);
}
.card__p{
  margin:0;
  color:var(--muted);
  line-height:1.45;
  font-size:16px;
}
.card__p--small{font-size:12.5px}

/* List view */
.list__container{
  width:min(var(--results-max), 100%);
  margin-inline:auto;
  border:1px solid rgba(226,192,137,.18);
  background:linear-gradient(180deg, rgba(18,21,26,.55), rgba(11,12,14,.88));
}
.list{
  width:100%;
  border-collapse:collapse;
  font-size:16px;
}
.list thead th{
  text-align:left;
  padding:12px 12px;
  border-bottom:1px solid rgba(226,192,137,.16);
  color:var(--sand);
  text-transform:uppercase;
  letter-spacing:.10em;
  font-size:11px;
  font-weight:800;
}
.list tbody td{
  padding:12px 12px;
  border-bottom:1px solid rgba(226,192,137,.10);
  color:var(--text);
}
.list tbody tr{
  transition:background .12s ease;
  cursor:pointer;
}
.list tbody tr:hover{
  background:rgba(226,192,137,.06);
}
.list__column{width:44px}

/* Sort indicators (JS may inject arrows) */
.list thead th[data-sort-index]{
  cursor:pointer;
  user-select:none;
}
.list thead th[data-sort-index]:hover{color:var(--brass)}


/* -----------------------------
   7) Tags / pills / badges
   ----------------------------- */
.tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border:1px solid rgba(226,192,137,.18);
  background:rgba(226,192,137,.06);
  color:var(--sand);
  text-transform:uppercase;
  letter-spacing:.10em;
  font-weight:600;
  font-size:12px;
  line-height:1;
  white-space:nowrap;
}
.pill, .badge{border-radius:0}
.pill--inline, .badge--inline{margin-right:6px}

/* Type-color badge support */
[data-type-color="1"]{border-color:color-mix(in srgb, var(--type-1) 40%, rgba(226,192,137,.18)); color:color-mix(in srgb, var(--type-1) 70%, var(--sand))}
[data-type-color="2"]{border-color:color-mix(in srgb, var(--type-2) 40%, rgba(226,192,137,.18)); color:color-mix(in srgb, var(--type-2) 70%, var(--sand))}
[data-type-color="3"]{border-color:color-mix(in srgb, var(--type-3) 40%, rgba(226,192,137,.18)); color:color-mix(in srgb, var(--type-3) 70%, var(--sand))}
[data-type-color="4"]{border-color:color-mix(in srgb, var(--type-4) 40%, rgba(226,192,137,.18)); color:color-mix(in srgb, var(--type-4) 70%, var(--sand))}
[data-type-color="5"]{border-color:color-mix(in srgb, var(--type-5) 40%, rgba(226,192,137,.18)); color:color-mix(in srgb, var(--type-5) 70%, var(--sand))}
[data-type-color="6"]{border-color:color-mix(in srgb, var(--type-6) 40%, rgba(226,192,137,.18)); color:color-mix(in srgb, var(--type-6) 70%, var(--sand))}
[data-type-color="7"]{border-color:color-mix(in srgb, var(--type-7) 40%, rgba(226,192,137,.18)); color:color-mix(in srgb, var(--type-7) 70%, var(--sand))}
[data-type-color="8"]{border-color:color-mix(in srgb, var(--type-8) 40%, rgba(226,192,137,.18)); color:color-mix(in srgb, var(--type-8) 70%, var(--sand))}
[data-type-color="9"]{border-color:color-mix(in srgb, var(--type-9) 40%, rgba(226,192,137,.18)); color:color-mix(in srgb, var(--type-9) 70%, var(--sand))}
[data-type-color="10"]{border-color:color-mix(in srgb, var(--type-10) 40%, rgba(226,192,137,.18)); color:color-mix(in srgb, var(--type-10) 70%, var(--sand))}

/* Thumb */
.thumb{
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;

  border: 1px solid rgba(226,192,137,.20);
  background: linear-gradient(180deg, rgba(23,27,34,.45), rgba(11,12,14,.80));
}
.thumb--xl{ width: 124px; height: 124px; }
.thumb__img{ width: 100%; object-fit: cover; }
.thumb--fallback{ opacity: .75; }

/* Only dungeons: fill the entire square */
.thumb__img--dungeon{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Only augment thumbnails */
.thumb__img--augment {
  width: 70%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* -----------------------------
   8) Detail modal (dialog)
----------------------------- */

/* Base dialog reset */
dialog{
  border: 0;
  padding: 0;
  color: inherit;
}
dialog:focus,
dialog:focus-visible{
  outline: none;
}

/* Modal shell (ensure this selector matches your <dialog>) */
dialog.detail__container{
  width: min(900px, calc(100% - 24px));
  max-height: min(92dvh, 1000px);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18,21,26,.96), rgba(11,12,14,.96));
  border: 1px solid rgba(226,192,137,.22);
}
dialog.detail__container::backdrop{
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(2px);
}

/* Form wrapper */
dialog.detail__container > .detail__form{
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: inherit;     /* <-- no need to hardcode min(92dvh...) twice */
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Header (sticky within dialog scroll) */
dialog.detail__container .detail__header{
  position: sticky;
  top: 0;
  z-index: 50;             /* 9999 usually unnecessary once stacking is sane */
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid rgba(226,192,137,.14);
  /* Make it opaque enough for “sticky” */
  background: linear-gradient(180deg, rgba(23,27,34,.85), rgba(11,12,14,.95));
  overflow: visible;       /* <-- this was the key fix */
}

.detail__header__content{
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-wrap: nowrap;
}
.detail__header__content__info{ min-width: 0; }

.detail__header__content__name{
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: .10em;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.15;
  margin: 0 0 6px;
}
.detail__header__content__meta{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* Dungeon header background image */
.detail__header--bg{
  isolation: isolate;
  transform: translateZ(0);
}
.detail__header--bg::before,
.detail__header--bg::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events: none;
  clip-path: inset(0 round 0px);
  z-index: 0;
}
.detail__header--bg::before{
  background: var(--detail-header-bg, none) center / cover no-repeat;
  filter: saturate(1.05) contrast(1.05);
}
.detail__header--bg::after{
  background:
    linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.38) 55%, rgba(0,0,0,.10) 100%),
    linear-gradient(180deg, rgba(0,0,0,.20) 0%, rgba(0,0,0,.55) 100%);
  z-index: 1;
}
.detail__header--bg > *{
  position: relative;
  z-index: 2;
}

/* Dungeon-specific tweaks */
.detail__header--dungeon .detail__imgWrap{ display: none; }
.detail__header--dungeon .detail__header__content__info{ padding: 30px; }

/* Body + cards */
.detail__body{
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail__card{
  border: 1px solid rgba(226,192,137,.16);
  background: linear-gradient(180deg, rgba(18,21,26,.62), rgba(11,12,14,.90));
  padding: 12px;
}
.detail__card--full{ width: 100%; }

/* Compact header tuning for short viewports */
@media (max-height: 520px){
  .detail__header{ padding: 10px 12px; }
  .detail__header__content__name{ font-size: 16px; margin-bottom: 4px; }
  .detail__header--dungeon .detail__header__content__info{ padding: 16px; }
  .close__btn{ width: 32px; height: 32px; }
}

/* Recipe list styling (keeps your previous structure) */
.recipeList{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.recipeRow{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 0;
  border-bottom:1px solid rgba(226,192,137,.10);
}
.recipeRow:last-child{border-bottom:0}
.recipeRow__img{
  width:33px;
  height:33px;
  object-fit:cover;
  border:1px solid rgba(226,192,137,.16);
  background:rgba(226,192,137,.06);
}
.recipeRow__name{flex:1; font-size:16px; color:var(--text)}
.recipeRow__qty{font-size:16px; font-weight:800; color:var(--sand); letter-spacing:.06em}

/* Dune-style number input */
/* Layout: label left, control right (or left if you want) */
.recipeHeader{
  display:flex;
  align-items:center;
  justify-content:space-between; /* keep label left, control right */
  gap:12px;
  margin-top:10px;
}

/* If you want the whole control moved LEFT under the header, do this instead:
.recipeHeader{ justify-content:flex-start; }
*/

.recipeCraft{
  display:flex;
  align-items:center;
  gap:8px;
}

.recipeCraft__x{
  color: var(--muted2);
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}

/* Dune-style number input */
.recipeCraft__input{
  width:72px;
  height:33px;
  padding: 0 10px;

  border-radius:0;
  border:1px solid rgba(226,192,137,.22);
  background: linear-gradient(180deg, rgba(18,21,26,.80), rgba(11,12,14,.92));
  color: var(--sand);

  font-weight:800;
  letter-spacing:.06em;
  text-align:center;
  outline:none;
}

.recipeCraft__input:focus{
  border-color: rgba(226,192,137,.45);
  box-shadow: 0 0 0 1px rgba(226,192,137,.28) inset;
}

/* Optional: remove native spinners for a cleaner look */
.recipeCraft__input::-webkit-outer-spin-button,
.recipeCraft__input::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}
.recipeCraft__input{
  -moz-appearance: textfield;
}
.stepperBtn{
  width:33px;
  height:33px;
  display:grid;
  place-items:center;

  border-radius:0;
  border:1px solid rgba(226,192,137,.22);
  background: rgba(0,0,0,.22);
  color: var(--sand);

  font-weight:900;
  font-size:16px;
  line-height:1;
  cursor:pointer;
  transition: background .12s ease, border-color .12s ease;
}

.stepperBtn:hover{
  border-color: rgba(226,192,137,.45);
  background: rgba(226,192,137,.08);
}

.stepperBtn:active{
  background: rgba(226,192,137,.12);
}

/* Variant preview grid */
.variantImages{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
  gap:10px;
}

/* Variant preview image button
   - Removes default white button background/border
   - Makes the expand icon (.imgToggle) anchor to the image corner */
.variantImages__btn{
  width:100%;
  border:1px solid rgba(226,192,137,.18);
  background:rgba(226,192,137,.04);
  padding:8px;
  cursor:pointer;
  position:relative;
  display:block;
}
.variantImages__btn:hover{
  border-color:rgba(226,192,137,.45);
  background:rgba(226,192,137,.08);
}
.variantImages__img{
  width:100%;
  height:auto;
  display:block;
  object-fit:contain;
  background:transparent;
}

/* If any browser default focus ring looks off, keep it subtle */
.variantImages__btn:focus-visible{
  outline:2px solid rgba(226,192,137,.35);
  outline-offset:2px;
}

/* The generic mediaFrame adds a background; remove it for variant preview images */
.variantImages__img.mediaFrame{
  background:transparent;
  border:none;
}


/* Variant modal: 40/60 preview split (left info / right image) */
.variantPreviewSplit{
  display:flex;
  gap:14px;
  align-items:stretch;
}
.variantPreviewSplit__left{
  flex:0 0 40%;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:220px;
}
.variantPreviewSplit__right{
  flex:1 1 60%;
  min-width:0;
}

.variantSideCard{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  border-radius:14px;
  padding:10px 12px;
}

.card__h--sub{
  font-size:14px;
  margin:0 0 8px;
  letter-spacing:.10em;
  text-transform:uppercase;
  opacity:.9;
}

.variantCompatList{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.variantCompatRow{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 0;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.variantCompatRow:last-child{ border-bottom:none; }
.variantCompatName{
  font-size:16px;
  font-weight:600;
  opacity:.95;
}


.variantCompatLink{ color:inherit; text-decoration:none; display:inline-flex; }
.variantCompatLink:hover{ text-decoration:underline; }
/* Set pieces list (variants) */
.setPiecesList{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.setPieceRow{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 0;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.setPieceRow:last-child{ border-bottom:none; }
.setPieceRow__img{
  width:22px;
  height:22px;
  border-radius:6px;
  object-fit:cover;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  flex:0 0 auto;
}
.setPieceRow__dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background: rgba(255,255,255,.20);
  flex:0 0 auto;
}
.setPieceRow__name{
  flex:1;
  font-size:16px;
  font-weight:600;
  opacity:.95;
}

@media (max-width: 760px){
  .variantPreviewSplit{ flex-direction:column; }
  .variantPreviewSplit__left{ flex:1 1 auto; min-width:0; }
  .variantPreviewSplit__right{ flex:1 1 auto; }
}

/* Swatch */
.swatch__container{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
}
.swatch__container__label{
  color:var(--muted2);
  font-size:14px;
  text-transform:uppercase;
  letter-spacing:.10em;
  margin:16px 0 12px;
}
.swatch__container__row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.swatch__chip{
  width:44px;
  height:44px;
  border:1px solid rgba(226,192,137,.18);
}
.swatch__container__img__btn{
  border:1px solid rgba(226,192,137,.18);
  background:rgba(226,192,137,.04);
  padding:8px;
  cursor:pointer;
  position:relative;
  transition:border-color .12s ease, background .12s ease;
}
.swatch__container__img__btn:hover{
  border-color:rgba(226,192,137,.45);
  background:rgba(226,192,137,.08);
}
.imgToggle{
  position:absolute;
  right:8px;
  bottom:8px;
  display:grid;
  place-items:center;
  width:22px;
  height:22px;
  border:1px solid rgba(226,192,137,.18);
  background:rgba(0,0,0,.35);
  color:var(--sand);
}

/* Map image */
.mapImgWrap{
  margin-top:10px;
  border:1px solid rgba(226,192,137,.18);
  background:rgba(226,192,137,.04);
  padding:8px;
  cursor:pointer;
}
.mapImgWrap:hover{border-color:rgba(226,192,137,.45); background:rgba(226,192,137,.08)}

/* Media frames */
.mediaFrame{
  border:1px solid rgba(226,192,137,.14);
  background:rgba(226,192,137,.03);
}

/* -----------------------------
   9) Lightbox
   ----------------------------- */
.lightbox{
  width:min(1100px, calc(100% - 24px));
  background:linear-gradient(180deg, rgba(18,21,26,.96), rgba(11,12,14,.96));
  border:1px solid rgba(226,192,137,.22);
}
.lightbox::backdrop{background:rgba(0,0,0,.80)}
.lightbox__form{
  margin:0;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.lightbox__img{
  max-height:min(78vh, 900px);
  width:100%;
  object-fit:contain;
}

/* Close button */
.close__btn{
  appearance:none;
  border:1px solid rgba(226,192,137,.18);
  background:transparent;
  color:var(--muted);
  width:36px;
  height:36px;
  cursor:pointer;
  display:grid;
  place-items:center;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.close__btn:hover{
  color:var(--sand);
  border-color:rgba(226,192,137,.45);
  background:rgba(226,192,137,.08);
}
dialog.lightbox .lightbox__form .close__btn{
  align-self: flex-end;
  flex: 0 0 auto;
}

/* -----------------------------
   10) Return to top
   ----------------------------- */
.return__top{
  position:fixed;
  right:16px;
  bottom:16px;
  width:44px;
  height:44px;
  border:1px solid rgba(226,192,137,.18);
  background:linear-gradient(180deg, rgba(18,21,26,.75), rgba(11,12,14,.88));
  color:var(--sand);
  cursor:pointer;
  display:grid;
  place-items:center;
  opacity:0;
  pointer-events:none;
  transition: opacity .15s ease, border-color .12s ease, background .12s ease;
}
.return__top.isVisible{opacity:1; pointer-events:auto}
.return__top:hover{border-color:rgba(226,192,137,.45); background:rgba(226,192,137,.08)}
.return__top__icon{width:18px; height:18px; fill:currentColor}

/* -----------------------------
   11) Hover preview (recipe tooltip)
   ----------------------------- */

.hoverPreview{
  /* Layering / positioning */
  position:absolute;
  z-index:999999;
  pointer-events:none;
  margin:0;
  contain:layout paint;

  /* Box (Dune plate) */
  width: max-content;        /* size to content */
  max-width: 360px;          /* safety cap so it never gets absurd */
  min-width: 220px;          /* keeps small items from looking cramped */
  padding: 12px;
  border-radius: 0; /* hard edges */
  background: linear-gradient(180deg, rgba(18,21,26,.92), rgba(11,12,14,.98));
  border: 1px solid rgba(226,192,137,.22);
  box-shadow:
    0 18px 50px rgba(0,0,0,.70),
    inset 0 0 0 1px rgba(226,192,137,.06);

  /* Text */
  color: var(--text);

  /* Motion */
  transform-origin: top left;
  animation: hoverPreviewIn 120ms ease-out;
}

@keyframes hoverPreviewIn{
  from{ opacity:0; transform:translateY(4px); }
  to  { opacity:1; transform:none; }
}

.hoverPreview__row{
  display:flex;
  gap:10px;
  flex-direction: column;   /* ← vertical stack */
}

/* Image area: fixed height, fits weapon without cropping */
#hoverPreview .hoverPreview__img{
  width: 100%;
  height: 140px;          /* adjust: 120–170 */
  object-fit: contain;    /* ✅ shows whole image */
  display: block;
  background: rgba(255,255,255,.03);
  border-radius: 10px;
  padding: 10px;          /* gives contain-mode breathing room */
  box-sizing: border-box;
}

/* Optional: tighten spacing under image */
#hoverPreview .hoverPreview__info{
  padding-top: 10px;
}

.hoverPreview__title{
  min-width:0;
  flex:1;
}

.hoverPreview__name{
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: .10em;
  font-weight: 800;
  font-size: 12px;
  color: var(--sand);
  margin: 0 0 6px 0;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hoverPreview__pills{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

/* Optional pills if you use them */
.hoverPreview__pill{
  border-radius:0;
  background: rgba(226,192,137,.10);
  border: 1px solid rgba(226,192,137,.18);
  color: var(--sand);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height:1;
}

.hoverPreview__meta{
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.hoverPreview__stats{
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.hoverPreview__stat{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size: 11px;
  letter-spacing: .02em;
}

.hoverPreview__statKey{
  color: var(--sand);
  opacity: .9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hoverPreview__statVal{
  color: var(--text);
  opacity: .95;
  text-align: right;
  white-space: nowrap;
}

.hoverPreview__metaRow{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size: 12px;
  line-height: 1.25;
  padding-top: 6px;
  border-top: 1px solid rgba(226,192,137,.10);
}

.hoverPreview__metaLabel{
  color: var(--muted2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
}

.hoverPreview__metaVal{
  color: var(--text);
  font-weight: 750;
  text-align:right;
}

/* Ensure it truly doesn't render when hidden */
.hoverPreview[hidden]{ display:none !important; }

.hoverPreview__boss{
  display:block;
  margin-top:4px;
  font-size:13px;
  opacity:.85;
}

/* -----------------------------
   12) Schematics: Unique Effect + Stats
   ----------------------------- */

/* Unique Effect callout */
.uniqueEffect{
  border:1px solid rgba(226,192,137,.16);
  background:linear-gradient(180deg, rgba(18,21,26,.62), rgba(11,12,14,.90));
  padding:12px;
  margin-top:10px;
}
.uniqueEffect__label{
  color:var(--muted2);
  font-size:16px;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-weight:800;
  margin:0 0 6px;
}
.uniqueEffect__text{
  color:var(--text);
  font-size:16px;
  line-height:1.45;
}

/* Layout: text + (optional) GIF preview */
.uniqueEffect__content{
  display:flex;
  gap:14px;
  align-items:flex-start;
  justify-content:space-between;
}
.uniqueEffect__body{ flex:1 1 auto; min-width:0; }
.uniqueEffect__media{
  flex:0 0 auto;
  width:280px;
  height:180px;
  border-radius:10px;
  overflow:hidden;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(226,192,137,.16);
}
.uniqueEffect__img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.uniqueEffect__placeholder{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--muted2);
  background:linear-gradient(135deg, rgba(226,192,137,.10), rgba(0,0,0,0));
}

/* Stats panel */
.card--stats{
  border:1px solid rgba(226,192,137,.16);
  background:linear-gradient(180deg, rgba(18,21,26,.62), rgba(11,12,14,.90));
  padding:12px;
}

/* Rows */
.statRow{
  display:grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 220px);
  gap:12px;
  align-items:baseline;
  padding:8px 10px; /* small horizontal padding so hover has “plate” feel */
  margin:0 -10px;   /* keeps alignment with container padding */
  border-bottom:1px solid rgba(226,192,137,.10);
}
.statRow:last-child{border-bottom:0}

/* ✅ Per-row hover */
.statRow:hover{
  background:linear-gradient(90deg, rgba(226,192,137,.10), transparent);
}

/* Optional: make hovered row text pop slightly */
.statRow:hover .statLabel{ color:var(--sand); }
.statRow:hover .statUnit{ color:var(--muted); }

/* Existing */
.statLabel{
  color:var(--text);
  font-size:14px;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.statValue{
  display:flex;
  justify-content:flex-end;
  align-items:baseline;
  gap:8px;
  color:var(--sand);
  font-weight:800;
  font-size:14px;
  text-align:right;
  letter-spacing:.02em;
}
.statUnit{color:var(--muted2); font-weight:700; font-size:13px}
.statDelta{color:var(--good); font-weight:700; font-size:13px}

/* Keep your “changed” state stronger than hover */
.statRow--changed{
  background:linear-gradient(90deg, rgba(226,192,137,.14), transparent);
}
.statRow--changed:hover{
  background:linear-gradient(90deg, rgba(226,192,137,.18), transparent);
}

.statValue--good { color: #27b146; } /* green */
.statValue--bad  { color: #cd3d3d; } /* red */

.dropSourceRow{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 10px;
}

.dropSourceThumb{ flex:0 0 auto; }
.dropSourceThumb .thumb{ 
  height: 40px; 
  width: 40px;
}
.dropSourceText{ flex:1; }

.dropSourceMeta{
  opacity:.85;
  margin-left:6px;
}

/* -----------------------------
   12b) Stats grade toggle (schematics)
   ----------------------------- */
.gradeToggle{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:8px;
}
.gradeBtn{
  appearance:none;
  border:1px solid rgba(226,192,137,.18);
  background:rgba(226,192,137,.03);
  color:var(--muted);
  padding:8px 10px;
  cursor:pointer;
  text-transform:uppercase;
  letter-spacing:.10em;
  font-weight:600;
  font-size:14px;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.gradeBtn:hover{color:var(--sand); border-color:rgba(226,192,137,.45); background:rgba(226,192,137,.08)}
.gradeBtn.active{
  color:var(--sand);
  border-color:rgba(226,192,137,.70);
  background:linear-gradient(180deg, rgba(226,192,137,.12), rgba(0,0,0,0));
}

/* ==========================
   13) DUNGEON STATS: TOP BAR
========================== */

.lootHeadBtn{
  background: transparent;
  border: 0;
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .6px;
  cursor: pointer;
  text-align: left;
}

.lootHeadBtn:hover{
  opacity: .95;
  color: var(--sand)
}

/* Tab bar container (bottom-right) */
#detail__container.isDungeon .detailTabs{
  position: absolute;
  right: 8px;
  bottom: 6px;
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  margin: 0;
}

/* Individual tab buttons */
#detail__container.isDungeon .detailTabs__tab{
  appearance: none;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0, 0, 0, 0.651);
  color: rgba(255,255,255,.82);

  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .2px;
  cursor: pointer;

  transition:
    transform .12s ease,
    background .15s ease,
    border-color .15s ease,
    box-shadow .15s ease,
    color .15s ease,
    opacity .15s ease;
}

/* Hover: theme lift + glow */
#detail__container.isDungeon .detailTabs__tab:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.20);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--dungeon-accent-2) 82%, rgba(0,0,0,.25)),
      rgba(0,0,0,.18)
    );
  box-shadow:
    0 10px 22px rgba(0,0,0,.30),
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 0 14px color-mix(in srgb, var(--dungeon-accent-2) 80%, transparent);
  color: rgba(255,255,255,.94);
}

/* Active: stronger theme pill + inner highlight */
#detail__container.isDungeon .detailTabs__tab.is-active{
  border-color: color-mix(in srgb, var(--dungeon-accent-2) 85%, rgba(255,255,255,.25));
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--dungeon-accent-2) 65%, rgba(0,0,0,.12)),
      color-mix(in srgb, var(--dungeon-accent-1) 62%, rgba(0,0,0,.18))
    );
  box-shadow:
    0 10px 24px rgba(0,0,0,.34),
    0 0 0 1px rgba(255,255,255,.10) inset,
    0 0 18px color-mix(in srgb, var(--dungeon-accent-2) 38%, transparent);
  color: rgba(255,255,255,.98);
}

/* Press feedback */
#detail__container.isDungeon .detailTabs__tab:active{
  transform: translateY(0px);
  opacity: .95;
}

/* Keyboard focus */
#detail__container.isDungeon .detailTabs__tab:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 2px rgba(255,255,255,.18),
    0 0 0 4px color-mix(in srgb, var(--dungeon-accent-2) 85%, transparent);
}

.tabComingSoon{
  padding: 60px 20px;
  text-align: center;
  opacity: .9;
}

.tabComingSoon__title{
  font-size: 18px;
  font-weight: 650;
  margin-bottom: 8px;
  letter-spacing: .3px;
}

.tabComingSoon__sub{
  font-size: 14px;
  opacity: .6;
  letter-spacing: .2px;
}

.dungeonStatsTop{
  padding:12px 14px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  background:rgba(0,0,0,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  margin-bottom:10px;

  display:grid;
  grid-template-columns: 1fr auto;    /* title | pill */
  grid-template-areas:
    "title pill"
    "row   row";
  row-gap:10px;
  column-gap:12px;
}

.dungeonStatsTop .card__h{
  grid-area:title;
  margin:0;
}

#dDungeonLevelValue{
  grid-area:pill;
}

.dungeonLevelRow{
  grid-area:row;
  display:grid;
  grid-template-columns: 36px 1fr 36px; /* - | slider | + */
  align-items:center;
  gap:12px;
}

/* Level pill */
.lvlPill{
  min-width:88px;
  text-align:right;
  font-variant-numeric: tabular-nums;
  letter-spacing:.12em;
  font-weight:650;
  font-size:14px;
}

/* +/- buttons */
.lvlBtn{
  width:34px;
  height:34px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.92);

  display:inline-flex;
  align-items:center;
  justify-content:center;

  font-size:18px;
  line-height:1;
  cursor:pointer;

  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.lvlBtn:hover{
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  transform: translateY(-1px);
}
.lvlBtn:active{
  transform: translateY(0) scale(.98);
}

/* Slider wrapper + ticks overlay */
/* ===== Dungeon level slider: gold fill + vertical thumb ===== */
.lvlSliderWrap{
  --thumbW: 6px;            /* vertical bar width */
  --thumbH: 18px;           /* vertical bar height */
  --trackH: 8px;            /* track thickness */
  --fill: rgba(210, 176, 105, .95);   /* gold */
  --track: rgba(255,255,255,.10);     /* base track */
  --border: rgba(255,255,255,.14);

  position: relative;
  padding: 8px 0;
}

/* We’ll paint the fill by setting a CSS variable from JS:
   ui.slider.style.setProperty('--pct', '35%') */
.dungeonLevelSlider{
  width: 100%;
  height: 28px;            /* room for thumb */
  background: transparent;
  -webkit-appearance: none;
  appearance: none;

  /* fallback if JS hasn’t set --pct yet */
  --pct: 0%;
}

/* Track (Chrome/Safari) */
.dungeonLevelSlider::-webkit-slider-runnable-track{
  height: var(--trackH);
  border-radius: 2px; /* slightly squared */
  border: 1px solid var(--border);
  background:
    linear-gradient(to right,
      var(--fill) 0,
      var(--fill) var(--pct),
      var(--track) var(--pct),
      var(--track) 100%
    );
}

/* Thumb (Chrome/Safari) = small vertical white bar */
.dungeonLevelSlider::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;

  width: var(--thumbW);
  height: var(--thumbH);
  border-radius: 1px;
  background: rgba(255,255,255,.95);

  /* center thumb on track */
  margin-top: calc((var(--trackH) - var(--thumbH)) / 2);

  box-shadow:
    0 0 0 1px rgba(0,0,0,.35),
    0 8px 16px rgba(0,0,0,.45);
}

/* Track (Firefox) */
.dungeonLevelSlider::-moz-range-track{
  height: var(--trackH);
  border-radius: 2px;
  border: 1px solid var(--border);
  background: var(--track);
}

/* Fill (Firefox) */
.dungeonLevelSlider::-moz-range-progress{
  height: var(--trackH);
  border-radius: 2px;
  background: var(--fill);
}

/* Thumb (Firefox) */
.dungeonLevelSlider::-moz-range-thumb{
  width: var(--thumbW);
  height: var(--thumbH);
  border-radius: 1px;
  border: none;
  background: rgba(255,255,255,.95);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.35),
    0 8px 16px rgba(0,0,0,.45);
}

/* Remove focus outline glow (optional) */
.dungeonLevelSlider:focus{ outline: none; }

/* ===============================
   13b) DUNGEON STATS: PANELS GRID
=============================== */
#dDungeonStatsGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}
@media (max-width: 900px){
  #dDungeonStatsGrid{ grid-template-columns: 1fr; }
}

.dungeonStatsPanel{
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 16px;
  display:flex;
  flex-direction:column;
}

.dungeonStatsPanel__title{
  display:flex;
  align-items:center;
  gap:10px;

  padding-bottom:10px;
  margin-bottom:12px;
  border-bottom: 1px solid rgba(255,255,255,.08);

  font-size:12px;
  letter-spacing:.16em;
  opacity:.95;
}
.dungeonStatsPanel__title::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background: linear-gradient(
    135deg,
    var(--dungeon-accent-2),
    var(--dungeon-accent-1)
  );
  box-shadow:
    0 0 8px color-mix(in srgb, var(--dungeon-accent-2) 45%, transparent);
}

.dungeonStatsPanel__body{
  overflow:auto;
  max-height:280px;
  padding-right:6px;
}
@media (max-width: 900px){
  .dungeonStatsPanel__body{
    max-height:none;
    overflow:visible;
    padding-right:0;
  }
}

/* Stat rows (default sections) */
.dungeonStatRow{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:14px;
  padding:6px 0;
}
.dungeonStatRow + .dungeonStatRow{
  border-top: 1px solid rgba(255,255,255,.06);
}
.dungeonStatKey{
  opacity:.82;
  font-size:14px;
}
.dungeonStatVal{
  font-weight:650;
  font-size:14px;
  font-variant-numeric: tabular-nums;
  letter-spacing:.02em;
}

/* ========================================
   13c) SHARED 3-COLUMN TABLE (Party + Loot)
========================================= */
.dungeonTable{
  display:flex;
  flex-direction:column;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  overflow:hidden;
}

.dungeonTable__headRow{
  display:grid;
  grid-template-columns: 1.1fr 1fr 1fr;
    background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--dungeon-accent-2) 30%, transparent),
    color-mix(in srgb, var(--dungeon-accent-2) 30%, transparent)
  );
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.dungeonTable__head{
  padding:10px 12px;
  font-size:12px;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-weight:700;
  opacity:.85;
}

.dungeonTable__row{
  display:grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  transition: background .18s ease, box-shadow .18s ease;
}

.dungeonTable__row:not(:last-child){
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.dungeonTable__cell{
  padding:10px 12px;
}

#detail__container.isDungeon .lootTable__row{
  position: relative;
  transition: background .18s ease, border-color .18s ease;
  z-index: 0; /* establish stacking context */
}

/* Themed background hover (no overlay element needed) */
#detail__container.isDungeon .lootTable__row:hover{
  background:
    linear-gradient(90deg,
      color-mix(in oklab, var(--dungeon-accent-2) 16%, transparent),
      transparent 65%);
  border-color: color-mix(in oklab, var(--dungeon-accent-2) 25%, rgba(255,255,255,.06));
}

/* If you want the left accent bar, put it BEHIND content */
#detail__container.isDungeon .lootTable__row::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:2px;
  background: linear-gradient(
    180deg,
    var(--dungeon-accent-2),
    var(--dungeon-accent-1)
  );
  opacity:0;
  z-index:-1; /* ← THIS is the fix */
  transition: opacity .18s ease;
}

#detail__container.isDungeon .lootTable__row:hover::before{
  opacity:.9;
}

/* Grade label styling */
.gradeLabel{
  letter-spacing: .3px;
}

/* 0 = Ungraded (keep current look / neutral) */
.grade--0{ color: inherit; }

/* Grade colors */
.grade--1{ color: #8cff8f; }  /* green */
.grade--2{ color: #f3ff8c; }  /* deeper green */
.grade--3{ color: #ffc966; }  /* cyan/blue */
.grade--4{ color: #ed9337; }  /* purple */
.grade--5{
  color: #e15757;             /* gold */
  text-shadow: 0 0 6px rgba(250, 204, 21, .35);
}
.grade--6{
  color: #fb7185;             /* “mythic” pink/red */
  text-shadow: 0 0 6px rgba(251, 113, 133, .30);
}
.lootDropNote{
  font-size:12px;
  opacity:.65;
  line-height: 1.5em;
}

.lootFilters{
  display:flex;
  gap:8px;
  margin: 0 0 10px 0;
  flex-wrap: wrap;
}

.lootFilterBtn{
  appearance:none;
  border:1px solid rgba(226,192,137,.18);
  background:rgba(226,192,137,.03);
  color:var(--muted);
  padding:7px 10px;
  cursor:pointer;
  text-transform:uppercase;
  letter-spacing:.10em;
  font-weight:650;
  font-size:12px;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.lootFilterBtn:hover{
  color:var(--sand);
  border-color:rgba(226,192,137,.45);
  background:rgba(226,192,137,.08);
}

.lootFilterBtn.is-active{
  color:var(--sand);
  border-color:rgba(226,192,137,.70);
  background:linear-gradient(180deg, rgba(226,192,137,.12), rgba(0,0,0,0));
}

.lootTable{
  display:flex;
  flex-direction:column;
  border:1px solid rgba(255,255,255,.08);
  border-radius:6px;

  /* IMPORTANT: allow sticky to work while modal scrolls */
  overflow: visible;
}

.lootTable__head,
.lootTable__row{
  display:grid;
  grid-template-columns: 52px 1.6fr 1fr .6fr;
  align-items:center;
}

.lootTable__head{
  background: rgba(255,255,255,.05);
  font-size:12px;
  letter-spacing:.6px;
  text-transform:uppercase;
  position: sticky;
  top: 137px;
  z-index: 40;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.lootTable__row{
  border-top:1px solid rgba(255,255,255,.05);
  font-size:14px;
}
.lootRow__link {
  color:white;
}

.lootTable__cell{
  padding:10px 14px;
}

.lootTable__cell--chance{
  text-align:right;
  font-weight:600;
}

.lootTable__cell--thumb{
  display: flex !important;
  align-items: center !important;
  justify-content: center;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 0 !important;
  width:60px;
}

/* Ensure the thumb wrapper has a real box to center */
.lootThumb{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
}

/* Ensure image doesn't create baseline spacing */
.lootThumb img,
.lootThumb .thumb__img{
  display: block;
  object-fit: cover;
}

/* ==============================
   13d) SCROLLBAR POLISH (WebKit)
=============================== */
.dungeonStatsPanel__body::-webkit-scrollbar{ width:10px; }
.dungeonStatsPanel__body::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.30);
}
.dungeonStatsPanel__body::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.18);
}

/* Dungeon theme defaults */
#detail__container.isDungeon{
  --dungeon-accent-1: #c8a96a;
  --dungeon-accent-2: #6f8cff;
}

/* ===== Themed slider fill ===== */
/* NOTE: uses --pct which we set from JS */
#detail__container.isDungeon .dungeonLevelSlider::-webkit-slider-runnable-track{
  background:
    linear-gradient(to right,
      var(--dungeon-accent-1) 0%,
      var(--dungeon-accent-2) var(--pct, 0%),
      rgba(255,255,255,.10) var(--pct, 0%),
      rgba(255,255,255,.10) 100%
    );
}

/* Firefox uses progress */
#detail__container.isDungeon .dungeonLevelSlider::-moz-range-progress{
  background: linear-gradient(90deg, var(--dungeon-accent-1), var(--dungeon-accent-2));
}

/* ===============================================================
   13e) Hover style for div-based stat rows (Core + Environmental)
=============================================================== */

#detail__container.isDungeon .dungeonStatRow{
  transition: background .16s ease, box-shadow .16s ease;
}

#detail__container.isDungeon .dungeonStatRow:hover{
    background:
    linear-gradient(90deg,
      color-mix(in oklab, var(--dungeon-accent-2) 16%, transparent),
      transparent 65%);
  border-color: color-mix(in oklab, var(--dungeon-accent-2) 25%, rgba(255,255,255,.06));
}

#detail__container.isDungeon .dungeonTable__row{
  transition: background .18s ease, box-shadow .18s ease;
}

#detail__container.isDungeon .dungeonTable__row:hover{
    background:
    linear-gradient(90deg,
      color-mix(in oklab, var(--dungeon-accent-2) 16%, transparent),
      transparent 65%);
  border-color: color-mix(in oklab, var(--dungeon-accent-2) 25%, rgba(255,255,255,.06));
}

/* ==================
   14) Footer styling
   ================ */
.footer{
  border-top:1px solid rgba(226,192,137,.14);
  background:linear-gradient(180deg, rgba(7,8,10,.75), rgba(13,15,18,.92));
  padding:16px 0;
  color:var(--muted2);
  font-size:12px;
}
.footer__inner p{margin:0}

/* =====================
   15) Responsive tweaks
   ================== */
@media (max-width:720px){
  .header__inner{flex-direction:column; align-items:flex-start}
  .hero__subrow{flex-direction:column; align-items:flex-start}
  .tiles__container{grid-template-columns:repeat(auto-fill, minmax(180px, 1fr))}
  .detail__header__content__name{font-size:16px}
}
/* =========================================================
   Patch: Restore centered hero + search animation & sticky footer
   ========================================================= */

/* Sticky footer layout (keeps footer at bottom on short pages) */
body.app{
  display:flex;
  flex-direction:column;
  min-height:100vh;
}
main.container__center{
  flex:1 0 auto;
}
.footer{
  margin-top:auto;
}

/* Restore the original "search slides up when results appear" behavior.
   JS toggles body.app__searched. */
.hero__inner{
  display:block; /* allow hero__center to control width */
}
.hero__center{
  width:100%;
  max-width:var(--results-max);
  margin:0 auto;
  position:relative;
  z-index:50;
  padding-top:8px;
  transition: margin-top 260ms ease, transform 260ms ease;
}
.hero__search{
  width:100%;
  max-width:var(--results-max);
  margin:0 auto;
  border:1px solid rgba(226,192,137,.18);
  background:linear-gradient(180deg, rgba(18,21,26,.70), rgba(11,12,14,.90));
  padding:18px;
  position:relative;
}

/* Not searched: keep the hero lower on the page */
body.app:not(.app__searched) .hero__center{
  margin-top:clamp(120px, 26vh, 280px);
}

/* Searched: tuck hero near top to reveal results */
body.app.app__searched .hero__center{
  margin-top:12px;
}
/* =========================================================
   Patch: return-to-top visibility class + hide native search clear
   ========================================================= */

/* JS toggles .is-visible (hyphen), not .isVisible */
.return__top{ z-index: 80; } /* ensure above content */
.return__top.is-visible{
  opacity:1;
  pointer-events:auto;
}

/* Hide browser-provided clear (X) for type="search" inputs */
.searchbar__input::-webkit-search-cancel-button,
.searchbar__input::-webkit-search-decoration,
.searchbar__input::-webkit-search-results-button,
.searchbar__input::-webkit-search-results-decoration{
  -webkit-appearance:none;
  appearance:none;
  display:none;
}
.searchbar__input::-ms-clear{ display:none; width:0; height:0; }
/* =========================================================
   Patch: Return-to-top position near results (bottom-left)
   ========================================================= */

/* Anchor the button relative to the results width instead of viewport */
.return__top{
  position:fixed;
  right:auto;
  left:50%;
  bottom:16px;
  transform:translateX(calc(-1 * var(--results-max) / 2));
}

/* On smaller screens, keep it safely inside the viewport */
@media (max-width: 820px){
  .return__top{
    left:16px;
    transform:none;
  }
}
/* =========================================================
   Patch: Move return-to-top outside results, bottom-right of results column
   ========================================================= */

/* Place button just OUTSIDE the results column on the right */
.return__top{
  position:fixed;
  left:50%;
  right:auto;
  bottom:18px;
  transform:translateX(calc(var(--results-max) / 2 + 16px));
}

/* Keep it accessible on smaller screens */
@media (max-width: 900px){
  .return__top{
    left:auto;
    right:16px;
    transform:none;
  }
}
/* =========================================================
   Patch: Remove "empty scrollbar gutter" white line
   ========================================================= */

/* Don't reserve scrollbar space when not needed */
html{ scrollbar-gutter: auto; }

/* Ensure any gutter/background matches the page */
html, body{ background-color: var(--bg-0); }
/* =========================================================
   Patch: Prevent layout "jump" when scrollbar appears + keep results below sticky header
   ========================================================= */

/* Prevent horizontal "jerk" when the vertical scrollbar appears/disappears */
html{ scrollbar-gutter: stable; }            /* modern browsers */
body{ overflow-y: scroll; }                  /* fallback */

/* Ensure sticky header always stays on top */
.header__container{ z-index: 120; }
.hero__center{ z-index: 60; }                /* below header */

/* Push hero + results below the sticky header when searched */
:root{ --header-h: 66px; } /* adjust if you change header padding/logo size */
body.app.app__searched .hero__center{
  margin-top: calc(var(--header-h) + 10px);
}
/* Also ensure the results block starts below header */
body.app.app__searched .results{
  padding-top: 6px;
}

@media (max-width: 560px){

  /* Let the dungeon header wrap instead of forcing everything into one line */
  #detail__container.isDungeon .detail__header{
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 10px;
    padding-bottom: 10px; /* gives tabs breathing room */
  }

  /* Make header content take full width so the tabs can sit beneath */
  #detail__container.isDungeon .detail__header__content{
    width: 100%;
  }

  /* Critical: stop absolute positioning on mobile */
  dialog#detail__container.detail__container.isDungeon .detailTabs{
    position: static;        /* beats the absolute rule */
    width: 100%;
    margin-top: -16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  #detail__container.isDungeon .detailTabs__tab{
    flex: 0 0 auto;
    padding: 8px 8px;
    font-size: 12px;
  }

  /* Keep the close button pinned top-right */
  #detail__container.isDungeon .close__btn{
    position: absolute;
    top: 10px;
    right: 10px;
    margin: 0;
  }
  dialog.detail__container > .detail__form{
    overflow-y: scroll;
      /* For Chrome, Safari, and Opera */
    &::-webkit-scrollbar {
    display: none;
   }
    /* For IE, Edge, and Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
  }
  html, body {
       overflow-y: scroll;
      /* For Chrome, Safari, and Opera */
    &::-webkit-scrollbar {
    display: none;
   }
    /* For IE, Edge, and Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
  }
}

@media (max-width: 560px){
  /* Hide header on mobile */
  body.app.app__searched .hero__center {
    margin-top: 0;
  }
  body.app:not(.app__searched) .hero__center {
        margin-top: clamp(120px, 12vh, 280px);
  }
  body.isIdle .homeHero__title{
    font-size: 60px;
  }
  .list tbody td{
    font-size:14px;
  }
  .list tbody tr{
    height: 100px;
  }
  .tag{
    padding:4px 4px;
    font-size:10px;
    font-weight: 400;
    letter-spacing:.08em;
    overflow-wrap:anywhere;
    white-space: normal;
  }
  .thumb {
    width:44px;
    height:44px;
  }
  .card__p  {
    font-size:14px;
    line-height:1.4;
  }
  .recipeRow__name {
    font-size:14px;
    font-weight: 500;
    letter-spacing:.02em;
  }
  .recipeRow__qty {
    font-size:14px;
    font-weight: 600;
    letter-spacing:.02em;
  }
  .statLabel {
    font-size:12px;
  }
  .statValue {
    font-size:12px;
  }
  .gradeBtn {
    padding:6px 8px;
    font-size:12px;
  }
  .uniqueEffect__content{
    display:flex;
    flex-direction: column;  /* 👈 key change */
    gap:14px;
  }
  .uniqueEffect__text {
    font-size:14px;
    line-height:1.4;
  }
  .uniqueEffect__media {
    width: auto;
    height: auto;
    border: none;
  }
  .footer {
    font-size:11px;
    line-height: 1.6;
    padding:12px 0;
  }
}