/* Modern mobile UI overrides */
:root{
  --bg:#1b1410;
  --panel:rgba(0,0,0,.35);
  --panel2:rgba(0,0,0,.22);
  --text:#f5efe6;
  --muted:rgba(245,239,230,.75);
  --accent:#d6a85b;
  --danger:#ff5c5c;
  --ok:#3ddc97;
  --radius:18px;
}
html,body{background:var(--bg); color:var(--text); font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;}
body{min-height:100vh;}
a{color:var(--accent); text-decoration:none;}
.shadow{max-width:520px; margin:0 auto; padding-bottom:84px;}
.gl-obv{background:var(--panel); border:1px solid rgba(255,255,255,.08); border-radius:var(--radius); padding:12px 14px; color:var(--text); margin:10px 0;}
button, input[type=submit]{border-radius:14px; border:1px solid rgba(255,255,255,.12); background:rgba(214,168,91,.18); color:var(--text); padding:10px 14px; font-weight:600;}
button:disabled,input[type=submit]:disabled{opacity:.55; filter:grayscale(.2);}
input,select{border-radius:14px; border:1px solid rgba(255,255,255,.12); background:rgba(0,0,0,.22); color:var(--text); padding:10px 12px;}
/* Cards */
.card{background:var(--panel); border:1px solid rgba(255,255,255,.08); border-radius:var(--radius); padding:14px; margin:12px 0; box-shadow:0 10px 26px rgba(0,0,0,.25);}
.card h2,.card h3{margin:0 0 10px 0;}
.row{display:flex; gap:10px; flex-wrap:wrap;}
.stat{flex:1 1 120px; background:var(--panel2); border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:10px;}
.muted{color:var(--muted); font-size:13px;}
/* Progress */
.bar{height:10px; background:rgba(255,255,255,.12); border-radius:999px; overflow:hidden; border:1px solid rgba(255,255,255,.10);}
.bar > i{display:block; height:100%; background:linear-gradient(90deg, rgba(214,168,91,.45), rgba(214,168,91,.95)); width:0%;}
/* Hero page */
.hero-wrap{display:flex; gap:14px; align-items:flex-start;}
.hero-avatar{width:120px; height:160px; border-radius:18px; object-fit:cover; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.25);}
.hero-title{font-size:20px; font-weight:800; line-height:1.1; margin:0;}
.hero-sub{margin-top:4px;}
.eq-grid{display:grid; grid-template-columns:repeat(4, 1fr); gap:10px;}
.eq-slot{aspect-ratio:1/1; border-radius:14px; background:rgba(0,0,0,.22); border:1px solid rgba(255,255,255,.10); display:flex; align-items:center; justify-content:center; font-size:12px; color:var(--muted);}
.eq-slot img{max-width:70%; max-height:70%;}
.eq-link{position:relative; text-decoration:none;}
.eq-badge{position:absolute; right:8px; bottom:6px; font-size:11px; color:var(--text); background:rgba(0,0,0,.45); border:1px solid rgba(255,255,255,.12); padding:2px 6px; border-radius:999px;}
.eq-row{display:flex; align-items:center; gap:10px; background:var(--panel2); border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:10px;}

/* Inventory */
.chips{display:flex; gap:8px; flex-wrap:wrap;}
.chip{padding:8px 10px; border-radius:999px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.10); color:var(--muted); font-weight:800; font-size:12px;}
.chip.active{color:var(--text); background:rgba(214,168,91,.18); border-color:rgba(214,168,91,.35);}
.btn-link{padding:8px 10px; border-radius:12px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.10); color:var(--text); font-weight:800;}
.item-row{display:flex; gap:12px;}
.item-icon{width:54px; height:54px; border-radius:14px; background:rgba(0,0,0,.22); border:1px solid rgba(255,255,255,.10); display:flex; align-items:center; justify-content:center; overflow:hidden;}
.item-icon img{max-width:70%; max-height:70%;}
.item-name{font-weight:900; font-size:16px;}
.item-power{font-weight:900; font-size:16px; color:var(--accent);}
.badge{display:inline-block; padding:6px 10px; border-radius:999px; background:rgba(61,220,151,.12); border:1px solid rgba(61,220,151,.35); color:var(--text); font-weight:900; font-size:12px;}
.inv-tools{display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-top:10px;}
.pager{display:flex; gap:10px; align-items:center; justify-content:center; flex-wrap:wrap;}

/* Rarity colors */
.rarity-common{border-color:rgba(255,255,255,.12) !important;}
.rarity-uncommon{border-color:rgba(61,220,151,.55) !important; box-shadow:0 0 0 1px rgba(61,220,151,.12) inset;}
.rarity-rare{border-color:rgba(90,160,255,.65) !important; box-shadow:0 0 0 1px rgba(90,160,255,.14) inset;}
.rarity-epic{border-color:rgba(180,90,255,.65) !important; box-shadow:0 0 0 1px rgba(180,90,255,.14) inset;}
.rarity-legendary{border-color:rgba(255,170,70,.75) !important; box-shadow:0 0 0 1px rgba(255,170,70,.16) inset;}

.item.rarity-common{border-left:4px solid rgba(255,255,255,.14);}
.item.rarity-uncommon{border-left:4px solid rgba(61,220,151,.55);}
.item.rarity-rare{border-left:4px solid rgba(90,160,255,.65);}
.item.rarity-epic{border-left:4px solid rgba(180,90,255,.65);}
.item.rarity-legendary{border-left:4px solid rgba(255,170,70,.75);}
/* Bottom nav */
.bottom-nav{
  position:fixed; left:0; right:0; bottom:0;
  background:rgba(10,8,7,.92);
  border-top:1px solid rgba(255,255,255,.10);
  padding:10px 10px calc(10px + env(safe-area-inset-bottom));
  display:flex; gap:10px; justify-content:center;
  z-index:999;
}
.bottom-nav a{
  flex:1 1 120px; max-width:170px;
  text-align:center;
  padding:10px 8px;
  border-radius:14px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  color:var(--muted);
  font-weight:700;
}
.bottom-nav a.active{color:var(--text); background:rgba(214,168,91,.18); border-color:rgba(214,168,91,.35);}

/* Home menu */
.home-banner{
  border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.08);
  padding:16px;
  margin:12px 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.55)),
    url(/style/img/fortress.jpeg) center/cover no-repeat;
  box-shadow:0 12px 30px rgba(0,0,0,.25);
}
.home-title{font-size:26px; font-weight:900; letter-spacing:.2px;}
.home-sub{margin-top:2px;}
.home-res{margin-top:10px; display:flex; flex-wrap:wrap; gap:10px; font-weight:800;}
.home-res span{background:rgba(0,0,0,.22); border:1px solid rgba(255,255,255,.10); padding:6px 10px; border-radius:999px;}

.menu-row{
  display:flex; align-items:center; gap:12px;
  padding:12px;
  border-radius:16px;
  background:rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.08);
  margin:10px 0;
}
.menu-row:hover{border-color:rgba(214,168,91,.30);}
.menu-row.disabled{opacity:.55; pointer-events:none;}
.menu-ic{width:38px; height:38px; flex:0 0 38px; filter:drop-shadow(0 6px 10px rgba(0,0,0,.35));}
.menu-text{flex:1 1 auto; min-width:0;}
.menu-name{font-weight:900; font-size:16px; line-height:1.1; color:var(--text);}
.menu-desc{margin-top:3px;}
.menu-badge{font-weight:900; color:var(--muted); padding:6px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.05);} 


/* HUD */
.hud{display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap; margin:10px 0;}
.hud-left{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}
.hud-chip{display:flex; gap:8px; align-items:center; padding:8px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.12); background:rgba(0,0,0,.25);}
.hud-chip img{width:18px; height:18px; opacity:.9;}
.hud-chip b{font-weight:900;}

/* Home menu list */
.menu-list{display:flex; flex-direction:column; gap:10px;}
.menu-item{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 14px; border-radius:16px; border:1px solid rgba(255,255,255,.12); background:rgba(0,0,0,.22); text-decoration:none; color:var(--text);}
.menu-item:active{transform:scale(.99)}
.menu-left{display:flex; align-items:center; gap:12px;}
.menu-ico{width:34px; height:34px; border-radius:12px; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.10);}
.menu-ico img{width:22px; height:22px;}
.menu-title{font-weight:900;}
.menu-sub{font-size:12px; color:var(--muted); margin-top:2px;}
.menu-badge{font-weight:900; font-size:12px; padding:6px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.06);}

/* Rarity glow */
.item.rarity-uncommon{box-shadow:0 0 0 1px rgba(61,220,151,.12) inset, 0 10px 24px rgba(0,0,0,.25), 0 0 18px rgba(61,220,151,.10);} 
.item.rarity-rare{box-shadow:0 0 0 1px rgba(90,160,255,.14) inset, 0 10px 24px rgba(0,0,0,.25), 0 0 18px rgba(90,160,255,.12);} 
.item.rarity-epic{box-shadow:0 0 0 1px rgba(180,90,255,.14) inset, 0 10px 24px rgba(0,0,0,.25), 0 0 20px rgba(180,90,255,.12);} 
.item.rarity-legendary{box-shadow:0 0 0 1px rgba(255,170,70,.16) inset, 0 10px 24px rgba(0,0,0,.25), 0 0 22px rgba(255,170,70,.14);} 

.eq-slot.rarity-uncommon{box-shadow:0 0 0 1px rgba(61,220,151,.12) inset, 0 0 14px rgba(61,220,151,.10);} 
.eq-slot.rarity-rare{box-shadow:0 0 0 1px rgba(90,160,255,.14) inset, 0 0 14px rgba(90,160,255,.12);} 
.eq-slot.rarity-epic{box-shadow:0 0 0 1px rgba(180,90,255,.14) inset, 0 0 14px rgba(180,90,255,.12);} 
.eq-slot.rarity-legendary{box-shadow:0 0 0 1px rgba(255,170,70,.16) inset, 0 0 14px rgba(255,170,70,.14);} 


/* HUD */
.hud{display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap; margin:10px 0;}
.hud-left{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}
.hud-chip{display:flex; gap:8px; align-items:center; padding:8px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.12); background:rgba(0,0,0,.25);}
.hud-chip img{width:18px; height:18px; opacity:.95;}
.hud-chip span{font-size:13px; color:var(--muted);}
.hud-chip b{font-weight:900;}

/* Home menu list (blocks with icons) */
.menu-list{display:flex; flex-direction:column; gap:10px;}
.menu-item{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 12px; border-radius:18px; border:1px solid rgba(255,255,255,.10); background:rgba(0,0,0,.22); text-decoration:none; color:var(--text);}
.menu-item:active{transform:translateY(1px);}
.menu-left{display:flex; gap:12px; align-items:center;}
.menu-ico{width:44px; height:44px; border-radius:14px; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.10);}
.menu-ico img{width:24px; height:24px; opacity:.95;}
.menu-title{font-weight:900; font-size:16px;}
.menu-sub{color:var(--muted); font-size:13px; margin-top:2px;}
.menu-badge{font-weight:900; font-size:12px; padding:6px 10px; border-radius:999px; border:1px solid rgba(215,181,109,.35); background:rgba(215,181,109,.12); color:var(--text);}

/* Stronger rarity glow */
.item.rarity-uncommon{border-left:4px solid rgba(61,220,151,.60); box-shadow:0 0 0 1px rgba(61,220,151,.12) inset, 0 0 18px rgba(61,220,151,.10);}
.item.rarity-rare{border-left:4px solid rgba(90,160,255,.70); box-shadow:0 0 0 1px rgba(90,160,255,.14) inset, 0 0 18px rgba(90,160,255,.12);}
.item.rarity-epic{border-left:4px solid rgba(180,90,255,.70); box-shadow:0 0 0 1px rgba(180,90,255,.14) inset, 0 0 18px rgba(180,90,255,.12);}
.item.rarity-legendary{border-left:4px solid rgba(255,170,70,.80); box-shadow:0 0 0 1px rgba(255,170,70,.16) inset, 0 0 20px rgba(255,170,70,.14);}
.eq-slot.rarity-uncommon{box-shadow:0 0 0 1px rgba(61,220,151,.18) inset, 0 0 14px rgba(61,220,151,.10);}
.eq-slot.rarity-rare{box-shadow:0 0 0 1px rgba(90,160,255,.18) inset, 0 0 14px rgba(90,160,255,.10);}
.eq-slot.rarity-epic{box-shadow:0 0 0 1px rgba(180,90,255,.18) inset, 0 0 14px rgba(180,90,255,.10);}
.eq-slot.rarity-legendary{box-shadow:0 0 0 1px rgba(255,170,70,.20) inset, 0 0 16px rgba(255,170,70,.12);}

