﻿:root {
  --brand:#00cc00;
  --brand-light:#33ff33;
  --gold:#d4af37;
  --bg:#003300;
  --bg-darker:#002400;
  --text:#e8ffe8;
  --heading:#f5e6b3;
  --inset-top:16%;
  --inset-right:10%;
  --inset-bottom:28%;
  --inset-left:10%;
}

/* Global base */
* {
  box-sizing:border-box;
  -webkit-tap-highlight-color: transparent; /* removes blue flash on iOS tap */
}

html {
  font-size:clamp(14px, 1.1vw + 12px, 18px);
  overflow-x: hidden; /* prevent horizontal scroll on mobile */
}

body {
  margin:0;
  background:linear-gradient(180deg,#032703 0%, #003300 40%, #002400 100%);
  color:var(--text);
  font-family:'Lora', serif;
  overflow-x: hidden; /* belt-and-suspenders */
}

/* Compendium page variant matching uorenn.com */
body.comp-page {
  background:#000 url('../images/britannia_map.jpg') center 40% / cover no-repeat fixed;
  font-family:'Cardo', serif;
  text-align:left;
  color:#f5e6c8;
  overflow-x:hidden;
  padding-bottom:72px;
}

@media (max-width:900px){
  body.comp-page{
    background-attachment:scroll;
    background-position:center 30%;
  }
}

/* Headings */
h1,h2,h3,h4,h5 {
  color:var(--heading);
  margin:0;
  font-family:'Cinzel Decorative', serif !important;
}

/* NAVBAR REFACTOR */
.uor-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  width: 100%;
  background: rgba(10, 8, 5, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gold);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.uor-navwrap {
  max-width: 1420px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.7rem, 1.4vw, 1.4rem);
  padding: 10px 16px;
  position: relative;
}

.uor-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
  text-decoration: none;
  font-size: 1.2rem;
  color: #f5e6c8 !important;
  font-family: 'Cinzel Decorative', serif;
  z-index: 2100;
  transition: opacity 0.2s ease;
}
.uor-brand img {
  height: 32px;
  width: auto;
  object-fit: contain;
}
.uor-brand:hover {
  opacity: 0.85;
}

/* Nav Menu Wrapper */
.uor-nav-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.7rem, 1.4vw, 1.4rem);
  flex-grow: 1;
  margin-left: clamp(1rem, 2vw, 2rem);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Text navigation links */
.uor-nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 1.4vw, 1.4rem);
}
.uor-nav-link {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f5e6c8 !important;
  text-decoration: none;
  position: relative;
  padding: 0.3rem 0;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}
.uor-nav-link:hover {
  color: #fff !important;
  text-decoration: none !important;
}
.uor-nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1.5px;
  bottom: 0;
  left: 50%;
  background-color: var(--gold);
  transition: width 0.25s ease, left 0.25s ease;
}
.uor-nav-link:hover::after {
  width: 100%;
  left: 0;
}

/* Actions container */
.uor-nav-actions {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1vw, 0.8rem);
}

/* Buttons */
.uor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-family: 'Cardo', serif;
  font-weight: bold;
  text-decoration: none;
  font-size: 0.85rem;
  color: #1a1300 !important;
  background: linear-gradient(180deg, #ffd700, #b8860b);
  border: 1px solid #caa700;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.35), 0 2px 4px rgba(0,0,0,0.3);
  transition: transform .15s, box-shadow .15s, filter 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.uor-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,.5), inset 0 1px 2px rgba(255,255,255,.4);
  filter: brightness(1.05);
}
.uor-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,.4);
}

/* Discord Button */
.uor-btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-family: 'Cardo', serif;
  font-weight: bold;
  font-size: 0.85rem;
  text-decoration: none;
  color: #fff !important;
  background: #5865F2;
  border: 1px solid #4752C4;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.uor-btn-discord:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,.4);
}
.uor-btn-discord:active {
  transform: translateY(0);
}
.uor-btn-discord svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* Dropdown Menu (More / Tools) */
.uor-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.uor-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  cursor: pointer;
}

.uor-dropdown-arrow {
  display: inline-block;
  font-size: 0.65rem;
  transition: transform 0.2s ease;
  color: var(--gold);
}

.uor-dropdown:hover .uor-dropdown-arrow,
.uor-dropdown.is-open .uor-dropdown-arrow {
  transform: rotate(180deg);
}

.uor-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  width: max-content;
  background: rgba(10, 8, 5, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.75), 0 0 15px rgba(212, 175, 55, 0.15);
  padding: 0.5rem 0;
  margin-top: 4px;
  z-index: 2500;
}

/* Invisible bridge so moving mouse downward maintains hover */
.uor-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}

/* Open on hover on desktop */
@media (min-width: 1181px) {
  .uor-dropdown:hover .uor-dropdown-menu {
    display: block;
  }
}

.uor-dropdown.is-open .uor-dropdown-menu {
  display: block;
}

.uor-dropdown-item {
  display: block;
  padding: 0.65rem 1.3rem;
  font-family: 'Cardo', serif;
  font-size: 0.95rem;
  color: #e5f5e0 !important;
  text-decoration: none;
  transition: all 0.18s ease;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
  text-align: left;
  white-space: nowrap;
}

.uor-dropdown-item:last-child {
  border-bottom: none;
}

.uor-dropdown-item:hover {
  background: rgba(212, 175, 55, 0.15);
  color: #ffdf6a !important;
  padding-left: 1.3rem;
  text-decoration: none !important;
}

@media (max-width: 1180px) {
  .uor-dropdown {
    flex-direction: column;
    width: 100%;
  }
  
  .uor-dropdown-toggle {
    width: 100%;
    justify-content: center;
  }
  
  .uor-dropdown-menu {
    position: static;
    transform: none;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: none;
    margin-top: 0.5rem;
  }
  
  .uor-dropdown-item {
    text-align: center;
    font-size: 1rem;
    padding: 0.6rem 1rem;
  }
}

/* Toggle button (Hamburger) */
.uor-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(0.7rem, 1.4vw, 1.4rem);
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 2100;
}
.uor-nav-toggle:focus {
  outline: none;
}
.hamburger-bar {
  width: 100%;
  height: 2px;
  background-color: #f5e6c8;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 1180px) {
  .uor-nav-toggle {
    display: flex;
  }
  
  .uor-nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100%;
    max-height: 100dvh;
    overflow-y: auto;
    background: rgba(12, 10, 8, 0.97);
    border-left: 1px solid var(--gold);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 90px 24px 90px;
    gap: 2.5rem;
    margin-left: 0;
    box-shadow: -5px 0 25px rgba(0,0,0,0.8);
  }
  
  .uor-nav-menu.is-active {
    right: 0;
  }
  
  .uor-nav-links {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 1.8rem;
  }
  
  .uor-nav-link {
    font-size: 1.05rem;
    width: 100%;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  }
  .uor-nav-link::after {
    display: none; /* Hide hover line effect on mobile menu */
  }
  
  .uor-nav-actions {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
    margin-top: 1rem;
  }
  
  .uor-btn, .uor-btn-discord {
    width: 100%;
    padding: 0.6rem 1.1rem;
  }

  /* Hamburger Animations when open */
  .uor-nav-toggle.is-active .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .uor-nav-toggle.is-active .hamburger-bar:nth-child(2) {
    opacity: 0;
  }
  .uor-nav-toggle.is-active .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

/* FROSTED CONTENT WRAPPER */
.uor-content {
  max-width:clamp(320px, 95vw, 1250px);
  margin:clamp(110px, 12vh, 160px) auto clamp(70px, 9vh, 110px);
  padding:clamp(16px, 2.5vw, 32px);
  background:rgba(0,0,0,0.65) !important;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  border-radius:14px;
  box-shadow:0 10px 28px rgba(0,0,0,.6);
  border:1px solid rgba(212, 175, 55, 0.4);
}

@media (max-width:768px){
  .uor-content{
    margin:clamp(130px, 14vh, 180px) 10px clamp(70px, 9vh, 110px);
  }
}

@media (max-width:480px){
  .uor-content{
    margin:clamp(140px, 16vh, 200px) 8px clamp(70px, 9vh, 110px);
  }
}

/* REACT APP COMPONENT INTEGRATION IN UORENN COMPENDIUM THEME */
#app header h2 {
  font-family:'Cinzel Decorative', serif !important;
  color:#ffdf6a !important;
  font-size:clamp(1.5rem, 3vw, 2.2rem) !important;
  text-shadow:0 0 12px rgba(255,223,106,.8) !important;
  border-bottom:1px solid #325e38;
  padding-bottom:0.5rem;
  margin-bottom:0.8rem;
}

.disclaimer {
  color:#cde7c8 !important;
  font-size:0.85rem !important;
  background:rgba(3, 22, 12, 0.85) !important;
  padding:0.75rem 1.25rem;
  border-radius:8px;
  border-left:3px solid var(--gold);
  margin-bottom:1.75rem !important;
}

.content {
  background-color:transparent !important;
  border:none !important;
  overflow:visible !important;
}

/* React Top Row Cards (Stats & Skills, Weapon Info, Enemy Info) */
.calculator-section .row.col-12,
#app .row.col-12 {
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:wrap !important;
  align-items:stretch !important;
  justify-content:space-between !important;
  margin:0 0 2rem 0 !important;
  padding:0 !important;
  gap:1.5rem !important;
}

/* 1. Stats & Skills Card */
.stats-section {
  flex:1 1 340px !important;
  min-width:300px !important;
  margin:0 !important;
  padding:1.25rem 1.5rem !important;
  border-radius:12px !important;
  border:1px solid #325e38 !important;
  background:rgba(3,22,12,.92) !important;
  box-shadow:0 8px 18px rgba(0,0,0,.55) !important;
}

/* 2. Weapon Info Card (Positioned directly to the right of Stats & Skills on the same level) */
.weapon-info-container {
  flex:1 1 300px !important;
  min-width:280px !important;
  margin:0 !important;
  padding:1.25rem 1.5rem !important;
  border-radius:12px !important;
  border:1px solid #325e38 !important;
  background:rgba(3,22,12,.92) !important;
  box-shadow:0 8px 18px rgba(0,0,0,.55) !important;
}

/* 3. Enemy Info Card */
#app .row.col-12 > section:not(.stats-section):not(.weapon-info-container) {
  flex:1 1 340px !important;
  min-width:300px !important;
  margin:0 !important;
  padding:1.25rem 1.5rem !important;
  border-radius:12px !important;
  border:1px solid #325e38 !important;
  background:rgba(3,22,12,.92) !important;
  box-shadow:0 8px 18px rgba(0,0,0,.55) !important;
}

/* Form Inputs */
.input-group-text {
  background:#061b10 !important;
  border:1px solid #27492f !important;
  color:#dfeedd !important;
  font-weight:bold;
  border-radius:6px 0 0 6px !important;
}

.form-control {
  background:#040f09 !important;
  border:1px solid #325e38 !important;
  color:#f5f5e6 !important;
  border-radius:0 6px 6px 0 !important;
}

.form-control:focus {
  border-color:#dec14a !important;
  box-shadow:0 0 10px rgba(222, 193, 74, 0.4) !important;
}

/* Dropdown Buttons & Controls */
.btn-info, .dropdown-toggle {
  background:linear-gradient(180deg,#ffd700,#b8860b) !important;
  border:1px solid #caa700 !important;
  color:#1a1300 !important;
  font-weight:bold !important;
  border-radius:999px !important;
  box-shadow:inset 0 1px 2px rgba(255,255,255,.35), inset 0 -1px 2px rgba(0,0,0,.4) !important;
}

.dropdown-menu {
  background:#061b10 !important;
  border:1px solid #325e38 !important;
  box-shadow:0 8px 18px rgba(0,0,0,.7) !important;
  border-radius:8px !important;
}

.dropdown-item {
  color:#dfeedd !important;
  font-weight:500;
}

.dropdown-item:hover, .dropdown-item.active {
  background:#dec14a !important;
  color:#1c2209 !important;
}

/* Sticky Header in Weapon Table */
.fixed {
  background:#061b10 !important;
  border-bottom:2px solid #dec14a !important;
  color:#ffdf6a !important;
  padding-top:0.5rem !important;
  padding-bottom:0.5rem !important;
}

/* Weapon List Row Cards */
.weapon-row {
  background:#071c10 !important;
  border:1px solid #325e38 !important;
  border-radius:8px !important;
  color:#f5e6c8 !important;
  padding:0.4rem 0.2rem;
  transition:all 0.2s ease;
}

.weapon-row:hover {
  background:#0d2a18 !important;
  border-color:#d4af37 !important;
  transform:translateY(-1px);
  box-shadow:0 4px 10px rgba(0,0,0,.5);
}

.weapon-row.highest {
  background:rgba(222, 193, 74, 0.25) !important;
  border-color:#dec14a !important;
  box-shadow:0 0 14px rgba(255,215,0,.3) !important;
}

.highest-legend {
  background:#dec14a !important;
  border:1px solid #f6e27d !important;
  box-shadow:0 0 10px rgba(255,215,0,.5);
}

.form-check {
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:0.5rem;
}

.form-check-input {
  position:static !important;
  margin-top:0 !important;
  width:16px;
  height:16px;
  accent-color:#dec14a;
}

.form-check-label {
  color:#f5e6c8;
  font-weight:500;
  cursor:pointer;
}

/* FOOTER matching uorenn.com */
.uor-footer {
  position:fixed;
  bottom:0;
  left:0;
  width:100%;
  background:rgba(0,0,0,.88);
  border-top:1px solid var(--gold);
  color:#cfcfcf;
  font-size:.8rem;
  z-index:2000;
}

.uor-footwrap {
  max-width:1280px;
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 14px;
}

.uor-footer a {
  color:#ddd;
  text-decoration:none;
}

.uor-footer a:hover {
  color:var(--gold);
}

.uor-footwrap > div:first-child {
  display:flex;
  align-items:center;
  gap:8px;
}

.uor-footer .social a {
  margin-left:4px;
  padding:4px;
  color:#ddd;
  display:inline-flex;
  align-items:center;
  line-height:1;
}

.uor-footer .social a svg {
  width:24px;
  height:24px;
  vertical-align:middle;
  transition:transform 0.2s ease, color 0.2s ease;
}

.uor-footer .social a:hover {
  color:var(--gold);
}

.uor-footer .social a:hover svg {
  transform:scale(1.15);
}

@media (max-width:600px) {
  .uor-footwrap {
    flex-direction:column;
    gap:6px;
    text-align:center;
  }
  .uor-footwrap > div:first-child {
    justify-content:center;
  }
  .uor-footer .social {
    margin-top:4px;
  }
}

/* ============================================================
   ENHANCEMENT STYLES — enhancements.js features
   ============================================================ */

/* ── Toolbar wrapper ── */
.enh-toolbar {
  background: rgba(0,12,4,0.92) !important;
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 0 0 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.6), inset 0 1px 0 rgba(212,175,55,0.14);
}

/* ── Common button base ── */
.enh-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px;
  padding: 5px 13px !important;
  border-radius: 20px !important;
  border: 1px solid rgba(212,175,55,0.5) !important;
  background: rgb(8,28,12) !important;
  color: #d4af37 !important;
  font-size: 0.8rem !important;
  font-family: 'Cardo', serif !important;
  cursor: pointer !important;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: none !important;
  text-decoration: none !important;
  outline: none;
}
.enh-btn:hover {
  background: rgb(15,45,20) !important;
  border-color: #d4af37 !important;
  color: #ffe580 !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(212,175,55,0.25) !important;
}
.enh-btn:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(212,175,55,0.35) !important;
}
.enh-btn.active {
  background: rgb(20,55,18) !important;
  border-color: #d4af37 !important;
  color: #ffe580 !important;
}

/* ── Action row ── */
.enh-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ── Top-3 Banner ── */
.enh-top-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgb(5,20,8) !important;
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 8px;
  font-size: 0.85rem;
}
.enh-top-label {
  color: #d4af37;
  font-weight: bold;
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.enh-top-weapon {
  display: inline-block;
  padding: 3px 10px;
  background: rgb(12,35,14) !important;
  border-radius: 12px;
  color: #e5d9a0;
  font-size: 0.82rem;
  border: 1px solid rgba(212,175,55,0.25);
}
.enh-top-weapon small {
  color: #94a3b8;
  font-size: 0.73em;
  margin-left: 4px;
}

/* ── Preset Panel ── */
.enh-preset-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.enh-preset-label {
  color: #94a3b8;
  font-size: 0.78rem;
  font-family: 'Cardo', serif;
  white-space: nowrap;
  min-width: 70px;
}
.enh-preset-btn {
  font-size: 0.75rem;
  padding: 4px 10px;
}

/* ── Type Filter Tabs ── */
.enh-type-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.enh-type-tab {
  padding: 4px 12px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(212,175,55,0.3) !important;
  background: rgb(8,24,10) !important;
  color: #8a9a7a !important;
  font-size: 0.78rem !important;
  font-family: 'Cardo', serif !important;
  cursor: pointer !important;
  transition: all 0.18s;
  box-shadow: none !important;
  outline: none;
}
.enh-type-tab:hover {
  border-color: rgba(212,175,55,0.6) !important;
  color: #d4af37 !important;
  background: rgb(12,38,15) !important;
}
.enh-type-tab:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(212,175,55,0.25) !important;
}
.enh-type-tab.active {
  background: rgb(18,52,16) !important;
  border-color: #d4af37 !important;
  color: #ffe580 !important;
  font-weight: bold !important;
}

/* ── Sort Controls ── */
.enh-sort-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.enh-sort-btn {
  font-size: 0.75rem;
  padding: 4px 10px;
}

/* ── Damage Bars on weapon rows ── */
.enh-dmg-bar-wrap {
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  overflow: hidden;
}
.enh-dmg-bar {
  height: 100%;
  background: linear-gradient(90deg, #b8860b 0%, #ffd700 100%);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.weapon-row.highest .enh-dmg-bar {
  background: linear-gradient(90deg, #00aa00 0%, #44ff44 100%);
}

/* ── Compare Button on weapon rows ── */
.enh-compare-btn {
  font-size: 0.65rem !important;
  padding: 3px 9px !important;
  border-radius: 10px !important;
  border: 1px solid #27492f !important;
  background: #071c10 !important;
  color: #a8c8a0 !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  margin-left: 6px !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  font-family: inherit !important;
  line-height: 1.4 !important;
  display: inline-block !important;
}
.enh-compare-btn:hover {
  background: #0d2a18 !important;
  color: #d4af37 !important;
  border-color: #d4af37 !important;
}
.enh-compare-btn.active {
  background: rgba(212,175,55,0.2) !important;
  color: #ffdf6a !important;
  border-color: #d4af37 !important;
}

/* ── Weapon Comparison Modal ── */
.enh-compare-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.enh-compare-modal {
  background: linear-gradient(160deg, rgba(2,12,4,0.97) 0%, rgba(0,18,6,0.97) 100%);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 14px;
  max-width: 760px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(212,175,55,0.15);
}
.enh-compare-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.7rem, 1.4vw, 1.4rem);
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(212,175,55,0.2);
}
.enh-compare-header h3 {
  color: #d4af37;
  font-family: 'Cinzel Decorative', serif;
  font-size: 1rem;
  margin: 0;
}
.enh-compare-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #94a3b8;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
}
.enh-compare-close:hover {
  background: rgba(255,80,80,0.2);
  color: #ff9999;
  border-color: rgba(255,80,80,0.4);
}
.enh-compare-body {
  padding: 16px 20px 20px;
}
.enh-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  color: #e2e8f0;
}
.enh-compare-table th {
  background: rgba(212,175,55,0.12);
  color: #d4af37;
  padding: 8px 14px;
  text-align: center;
  border-bottom: 1px solid rgba(212,175,55,0.25);
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.78rem;
}
.enh-compare-table th:first-child { text-align: left; }
.enh-compare-table td {
  padding: 8px 14px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.enh-compare-table td:first-child { text-align: left; color: #94a3b8; }
.enh-compare-table tr:hover td { background: rgba(255,255,255,0.03); }
.enh-compare-best {
  color: #4ade80 !important;
  font-weight: bold;
}
.enh-compare-clear {
  margin-top: 14px;
  text-align: center;
}

/* ── Chart Panel ── */
.enh-chart-panel {
  background: linear-gradient(135deg, rgba(0,20,0,0.85) 0%, rgba(0,15,5,0.9) 100%);
  border: 1px solid rgba(212,175,55,0.22);
  border-radius: 12px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.enh-chart-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.7rem, 1.4vw, 1.4rem);
  padding: 12px 18px;
  border-bottom: 1px solid rgba(212,175,55,0.15);
}
.enh-chart-header h4 {
  color: #d4af37;
  margin: 0;
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.enh-chart-toggle {
  font-size: 0.72rem;
  padding: 3px 10px;
}
#enh-chart-wrap {
  padding: 14px 18px 14px;
  height: 280px;
}

/* ── Enemy Info dropdown scrollbar ── */
.dropdown-scroll {
  max-height: 260px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background-color: rgb(6,22,8) !important;
  border: 1px solid rgba(212,175,55,0.3) !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,0.5) rgba(0,15,0,0.8);
}
.dropdown-scroll .dropdown-item {
  color: #c8b87a !important;
  background-color: transparent !important;
  padding: 4px 16px !important;
  font-size: 0.85rem !important;
}
.dropdown-scroll .dropdown-item:hover,
.dropdown-scroll .dropdown-item:focus {
  background-color: rgba(212,175,55,0.15) !important;
  color: #ffe580 !important;
}
.dropdown-scroll .dropdown-item.active {
  background-color: rgba(212,175,55,0.25) !important;
  color: #ffe580 !important;
  font-weight: bold !important;
}
.dropdown-scroll::-webkit-scrollbar {
  width: 6px;
}
.dropdown-scroll::-webkit-scrollbar-track {
  background: rgba(0,15,0,0.8);
  border-radius: 3px;
}
.dropdown-scroll::-webkit-scrollbar-thumb {
  background: rgba(212,175,55,0.5);
  border-radius: 3px;
}
.dropdown-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(212,175,55,0.8);
}


/* ── Responsive enhancements ── */
@media (max-width: 768px) {
  .enh-toolbar { padding: 10px 12px; gap: 8px; }
  .enh-top-banner { flex-direction: column; align-items: flex-start; }
  .enh-top-weapon { font-size: 0.78rem; }
  .enh-action-row { gap: 6px; }
  .enh-btn { font-size: 0.73rem !important; padding: 4px 10px !important; }
  .enh-type-tab { font-size: 0.73rem !important; padding: 3px 9px !important; }
  .enh-sort-btn { font-size: 0.7rem; padding: 3px 8px; }
  #enh-chart-wrap { height: 220px; }
  .enh-compare-modal { max-width: 100%; border-radius: 10px; }
  .enh-compare-table { font-size: 0.78rem; }
  .enh-compare-table th, .enh-compare-table td { padding: 6px 8px; }
}
@media (max-width: 480px) {
  .enh-toolbar { border-radius: 8px; }
  .enh-type-tabs, .enh-sort-controls { gap: 4px; }
  .enh-preset-label { min-width: unset; }
  .enh-top-weapon { padding: 2px 8px; }
  #enh-chart-wrap { height: 190px; }
}

/* ============================================================
   COMPREHENSIVE MOBILE STYLES
   ============================================================ */

/* ── Tablets & large phones (≤ 768px) ── */
@media (max-width: 768px) {

  /* Stack the three info-panel cards vertically */
  .calculator-section .row.col-12,
  #app .row.col-12 {
    flex-direction: column !important;
    gap: 0.85rem !important;
  }

  .stats-section,
  .weapon-info-container,
  #app .row.col-12 > section:not(.stats-section):not(.weapon-info-container) {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Touch-friendly input heights (Apple HIG: 44px min) */
  .input-group-sm .form-control,
  .input-group-sm .input-group-text {
    min-height: 42px !important;
    font-size: 0.95rem !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Dropdown toggle buttons */
  .btn-info,
  .dropdown-toggle {
    padding: 8px 14px !important;
    font-size: 0.9rem !important;
    min-height: 42px !important;
  }

  /* Weapon table: smaller text so columns fit */
  .weapon-row { font-size: 0.82rem !important; }
  .weapon-header { font-size: 0.78rem !important; }
  .weapon-row div.col,
  .weapon-header div.col { padding-left: 4px !important; padding-right: 4px !important; }

  /* Reduce panel padding */
  .stats-section,
  .weapon-info-container,
  #app .row.col-12 > section { padding: 1rem 1.1rem !important; }

  /* Content horizontal padding */
  .uor-content { padding: clamp(10px, 3vw, 20px) !important; }
}

/* ── Large phones (≤ 600px) ── */
@media (max-width: 600px) {

  /* Weapon table: wrap in horizontal scroll */
  .weapon-list {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Ensure header + rows maintain a minimum width so columns are readable */
  .weapon-header.row,
  .weapon-row.row {
    min-width: 420px !important;
    flex-wrap: nowrap !important;
  }

  /* Weapon name column: allow truncation */
  .weapon-row .col.overflow {
    max-width: 110px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Stat panel headings */
  .stats-section h4,
  .weapon-info-container h4,
  #app section h4 {
    font-size: 1.05rem !important;
    margin-bottom: 0.6rem !important;
  }

  /* Stat input labels — allow wrapping for long names */
  .stats-section .input-group-text {
    font-size: 0.8rem !important;
    white-space: normal !important;
    min-width: 110px !important;
    max-width: 130px !important;
    line-height: 1.2 !important;
    padding: 4px 6px !important;
  }

  /* Bonus text next to stat input */
  .stats-section .row > .col {
    font-size: 0.8rem !important;
    padding-left: 6px !important;
  }

  /* Enemy info dropdown button */
  .weapon-info-container .dropdown-toggle,
  #app section .dropdown-toggle {
    width: 100% !important;
    text-align: left !important;
    justify-content: space-between !important;
    min-height: 42px !important;
  }

  /* Toolbar: preset buttons wrap */
  .enh-preset-panel {
    flex-wrap: wrap !important;
    gap: 5px !important;
  }

  .enh-preset-btn {
    font-size: 0.72rem !important;
    padding: 4px 10px !important;
  }
}

/* ── Small phones (≤ 480px) ── */
@media (max-width: 480px) {

  /* Reduce top margin (fixed header is shorter on mobile) */
  .uor-content {
    margin-top: clamp(110px, 17vh, 160px) !important;
    padding: 10px !important;
  }

  /* Panel padding */
  .stats-section,
  .weapon-info-container,
  #app .row.col-12 > section {
    padding: 0.75rem 0.85rem !important;
  }

  /* Stat input row — full width, no wrapping */
  .stats-section .input-group.col-12 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Number input wider on small screens */
  .stats-section .col-4.form-control {
    flex: 0 0 38% !important;
    max-width: 38% !important;
  }

  /* Smaller weapon header / row text */
  .weapon-row { font-size: 0.76rem !important; }
  .weapon-header { font-size: 0.72rem !important; }

  /* Top 3 banner: compact */
  .enh-top-banner {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
  }

  .enh-top-weapon { font-size: 0.76rem !important; }

  /* Sort/filter controls: smaller */
  .enh-sort-controls,
  .enh-type-tabs {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

  .enh-type-tab,
  .enh-sort-btn {
    font-size: 0.68rem !important;
    padding: 3px 8px !important;
  }

  /* Footer */
  .uor-footwrap { font-size: 0.73rem; }
  .uor-footer .social a svg { width: 20px; height: 20px; }

  /* Chart panel */
  #enh-chart-wrap { height: 180px !important; }

  /* Hide damage bars on tiny screens to save space */
  .enh-dmg-bar-wrap { display: none !important; }
}

/* ── Very small phones (≤ 360px) ── */
@media (max-width: 360px) {
  .uor-content { padding: 8px !important; }

  .stats-section,
  .weapon-info-container,
  #app .row.col-12 > section { padding: 0.6rem 0.7rem !important; }

  .enh-toolbar { padding: 8px !important; gap: 6px !important; }

  /* Stack toolbar rows */
  .enh-action-row {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .enh-preset-panel {
    flex-direction: row !important;
    flex-wrap: wrap !important;
  }
}
