/* ===== 01_style_01.css ===== */

:root {
  --bg:#0a0c0f; --surface:#111418; --surface2:#181d24; --border:#2a3040;
  --gold:#c9a84c; --gold-light:#e8c96a; --silver:#8a9bb5;
  --red:#c94c4c; --red-light:#e87070;
  --green:#4c8a6a; --green-light:#6ab89a;
  --blue:#4c6ac9; --blue-light:#6a8ae8;
  --purple:#7a4cc9; --purple-light:#9a6ae8;
  --orange:#c97a2a; --orange-light:#e8a040;
  --text:#d8dde8; --text-dim:#6a7890;
  /* Reward tiers */
  --tier-grey:#6a7890; --tier-green:#4c8a6a; --tier-blue:#4c6ac9;
  --tier-purple:#7a4cc9; --tier-gold:#c9a84c; --tier-orange:#e87830;
  --scrollbar-thumb:rgba(130,110,80,.22);
  --scrollbar-thumb-hover:rgba(160,140,100,.38);
  --scrollbar-track:transparent;
}
html{
  scrollbar-width:thin;
  scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);
}
*::-webkit-scrollbar{width:8px;height:8px;}
*::-webkit-scrollbar-track{background:var(--scrollbar-track);}
*::-webkit-scrollbar-thumb{
  background:var(--scrollbar-thumb);
  border-radius:4px;
}
*:hover::-webkit-scrollbar-thumb,
*:focus-within::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb-hover);}
*{box-sizing:border-box;margin:0;padding:0;}
body{background:var(--bg);color:var(--text);font-family:'Crimson Pro',serif;font-size:16px;min-height:100vh;overflow-x:hidden;}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after{animation:none !important;transition:none !important;scroll-behavior:auto !important;}
body.high-contrast{filter:contrast(1.15) saturate(1.08);}
body.cb-protanopia{filter:hue-rotate(12deg) saturate(.9) contrast(1.05);}
body.cb-deuteranopia{filter:hue-rotate(-8deg) saturate(.88) contrast(1.04);}
body.cb-tritanopia{filter:hue-rotate(22deg) saturate(.86) contrast(1.04);}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after{animation:none !important;transition:none !important;scroll-behavior:auto !important;}
body.high-contrast{filter:contrast(1.15) saturate(1.08);}
body.cb-protanopia{filter:hue-rotate(12deg) saturate(.9) contrast(1.05);}
body.cb-deuteranopia{filter:hue-rotate(-8deg) saturate(.88) contrast(1.04);}
body.cb-tritanopia{filter:hue-rotate(22deg) saturate(.86) contrast(1.04);}
body::before{content:'';position:fixed;inset:0;background-image:radial-gradient(1px 1px at 20% 30%,rgba(200,180,120,.4) 0%,transparent 100%),radial-gradient(1px 1px at 50% 80%,rgba(180,200,255,.3) 0%,transparent 100%),radial-gradient(2px 2px at 80% 20%,rgba(200,180,120,.2) 0%,transparent 100%),radial-gradient(1px 1px at 10% 60%,rgba(180,200,255,.2) 0%,transparent 100%),radial-gradient(1px 1px at 70% 50%,rgba(200,180,120,.15) 0%,transparent 100%);pointer-events:none;z-index:0;}
#app{position:relative;z-index:1;max-width:1100px;margin:0 auto;padding:20px;min-height:100vh;}
#app:has(#screen-start.active){
  max-width:none;
  width:100%;
  margin:0;
  padding:0;
  min-height:100vh;
}
#app:has(#screen-select.active) > header{display:none !important;}
#app:has(#screen-battle.active) > header{padding:10px 0 8px;margin-bottom:10px;}
#app:has(#screen-battle.active) > header h1{font-size:1.55rem;}
#app:has(#screen-battle.active) > header .menu-btn,
#app:has(#screen-battle.active) > header .nest-btn{font-size:.78rem;padding:4px 12px;margin:0;}
#app:has(#screen-battle.active) > header .sound-btn{font-size:.7rem;padding:4px 8px;}
#app:has(#screen-map-forge.active){
  max-width:none;
  width:100%;
  margin:0;
  padding:8px 12px;
  min-height:100vh;
}
#app:has(#screen-map-forge.active) > header{display:none !important;}
header{text-align:center;padding:24px 0 16px;border-bottom:1px solid rgba(201,168,76,.25);margin-bottom:24px;}
header h1{font-family:'Cinzel',serif;font-size:2.6rem;font-weight:900;letter-spacing:.1em;background:linear-gradient(135deg,var(--gold) 0%,var(--gold-light) 50%,var(--gold) 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;}
header p{color:var(--text-dim);font-style:italic;font-size:1rem;margin-top:4px;}
.page-header-controls{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:8px;}
.battle-header-controls{display:none;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;}
#app:has(#screen-battle.active) > header .battle-header-controls{display:flex;}
.screen{display:none;}.screen.active{display:block;}

/* ---- Title / start (place art at assets/ui/start-screen.png) ---- */
#app:has(#screen-start.active) > header{display:none !important;}
.screen-start{
  position:relative;
  min-height:100vh;
  min-height:100dvh;
  overflow:hidden;
}
.screen-start.active{
  position:fixed !important;
  inset:0;
  z-index:30;
  width:100vw;
  max-width:none;
  min-height:100vh;
  min-height:100dvh;
  display:flex !important;
  align-items:center;
  justify-content:center;
  /* Portrait title art (e.g. 1024×1536): avoid cover — it crops and looks “zoomed” on desktop and worse on mobile */
  box-sizing:border-box;
  padding:max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
}
.start-screen-bg{
  position:absolute;
  inset:0;
  pointer-events:none;
  background-image:url("../assets/ui/start-screen.png"), linear-gradient(165deg,#1c2838 0%,#0d121a 42%,#06080e 100%);
  background-position:center center, center center;
  /* PNG: show entire image (letterboxing). Gradient: always fill behind it */
  background-size:contain, cover;
  background-repeat:no-repeat, no-repeat;
  background-color:#0a0c12;
}
.start-screen-vignette{
  position:absolute;
  inset:0;
  pointer-events:none;
  background:radial-gradient(ellipse at 50% 45%, transparent 0%, rgba(6,8,14,.28) 55%, rgba(4,5,10,.65) 100%);
}
.start-screen-inner{
  position:relative;
  z-index:2;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  width:100%;
  flex:1 1 auto;
  min-height:0;
  padding:16px 16px max(20px, env(safe-area-inset-bottom, 0px));
}
@media (min-height:520px){
  .start-screen-inner{
    align-items:center;
    padding-bottom:max(32px, env(safe-area-inset-bottom, 0px));
  }
}
.take-flight-btn{
  font-family:'Cinzel',serif;
  font-weight:700;
  font-size:clamp(0.95rem,2.8vw,1.4rem);
  letter-spacing:.28em;
  text-indent:.28em;
  text-transform:uppercase;
  padding:16px 40px;
  border:2px solid rgba(201,168,76,.9);
  border-radius:6px;
  background:rgba(12,14,22,.58);
  color:#e8d5a0;
  cursor:pointer;
  box-shadow:0 4px 28px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  transition:transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.take-flight-btn:hover{
  transform:translateY(-2px);
  border-color:rgba(232,210,150,.95);
  color:#fff4d2;
  background:rgba(24,28,42,.72);
}
.take-flight-btn:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:4px;
}
/* Hidden theme audio: avoid display:none so browsers still decode/load the file */
.theme-bgm-audio{
  position:fixed;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
  pointer-events:none;
}
/* Menu theme (Blakiston_Theme.mp3) — compact; start + war room: bottom-right */
.theme-music-btn{
  font-family:'Cinzel',serif;
  font-size:.95rem;
  line-height:1;
  padding:6px 8px;
  border-radius:8px;
  border:1px solid rgba(201,168,76,.45);
  background:rgba(8,10,16,.72);
  color:var(--text);
  cursor:pointer;
  box-shadow:0 2px 10px rgba(0,0,0,.35);
  transition:transform .15s ease,border-color .15s ease,background .15s ease;
  z-index:25;
}
.theme-music-btn:hover{
  transform:scale(1.04);
  border-color:rgba(232,201,106,.75);
  background:rgba(20,24,36,.85);
}
.theme-music-btn:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:2px;
}
.theme-music-btn--start{
  position:absolute;
  bottom:max(16px, env(safe-area-inset-bottom, 0px));
  right:max(16px, env(safe-area-inset-right, 0px));
}
.theme-music-btn--select{
  position:absolute;
  bottom:max(14px, env(safe-area-inset-bottom, 0px));
  right:max(14px, env(safe-area-inset-right, 0px));
}
/* Select screen: keep music control above hotspots */
#screen-select .theme-music-btn--select{z-index:50;}
.music-menu-modal{
  position:fixed;
  inset:0;
  z-index:1200;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(4,6,10,.72);
  padding:20px;
}
.music-menu-modal[hidden]{display:none;}
.music-menu-modal.is-open{display:flex;}
.music-menu-panel{
  width:min(560px, 94vw);
  max-height:min(86vh, 720px);
  overflow:auto;
  background:linear-gradient(160deg,#12161f,#0a0c12);
  border:1px solid rgba(201,168,76,.35);
  border-radius:14px;
  padding:18px 20px 20px;
  box-shadow:0 18px 48px rgba(0,0,0,.55);
}
.music-menu-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.music-menu-header h2{
  margin:0;
  font-family:'Cinzel',serif;
  font-size:1.1rem;
  color:var(--gold-l,#f0d060);
  letter-spacing:.06em;
}
.music-menu-close{
  background:transparent;
  border:1px solid rgba(201,168,76,.3);
  color:var(--gold-l,#f0d060);
  width:32px;
  height:32px;
  border-radius:8px;
  cursor:pointer;
  font-size:1.2rem;
  line-height:1;
}
.music-menu-hint{
  margin:0 0 14px;
  color:var(--text-dim,#8a9bb5);
  font-size:.85rem;
}
.music-menu-section{
  border:1px solid rgba(201,168,76,.14);
  border-radius:12px;
  background:rgba(255,255,255,.018);
  padding:12px;
  margin:12px 0;
}
.music-menu-section-title{
  margin:0 0 10px;
  color:var(--gold-l,#f0d060);
  font-family:'Cinzel',serif;
  font-size:.86rem;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.music-menu-check{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--text,#d8e0ec);
  font-size:.9rem;
  margin-bottom:10px;
}
.music-menu-range-label{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:var(--text-dim,#8a9bb5);
  font-size:.82rem;
  margin-bottom:6px;
}
.music-menu-range-label strong{color:var(--gold-l,#f0d060);}
.music-menu-range{width:100%;}
.music-role-row{
  display:grid;
  grid-template-columns:minmax(120px,.6fr) minmax(180px,1fr);
  gap:10px;
  align-items:center;
  margin:8px 0;
}
.music-role-row label{
  color:var(--text,#d8e0ec);
  font-size:.86rem;
}
.music-role-row select{
  width:100%;
  color:var(--text,#d8e0ec);
  background:#10141d;
  border:1px solid rgba(201,168,76,.28);
  border-radius:8px;
  padding:8px 10px;
}
.music-menu-note{
  margin:10px 0 0;
  color:var(--text-dim,#8a9bb5);
  font-size:.78rem;
  line-height:1.35;
}
.music-menu-list{
  list-style:none;
  margin:0 0 14px;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.music-menu-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid rgba(201,168,76,.18);
  border-radius:10px;
  background:rgba(255,255,255,.02);
}
.music-menu-track-title{
  font-size:.92rem;
  color:var(--text,#d8e0ec);
}
.music-menu-play-btn,
.music-menu-stop-btn{
  font-family:'Cinzel',serif;
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  background:rgba(201,168,76,.1);
  border:1px solid rgba(201,168,76,.35);
  color:var(--gold-l,#f0d060);
  border-radius:8px;
  padding:8px 12px;
  cursor:pointer;
}
.music-menu-play-btn.is-playing{
  background:rgba(201,168,76,.28);
  border-color:rgba(240,208,96,.65);
}
.music-menu-stop-btn{
  width:100%;
}
/* Select screen shell + layered art (assets/ui/select-screen.png, landscape ~1536×1024) */
#screen-select{
  position:relative;
  overflow:hidden;
  border:1px solid rgba(201,168,76,.24);
  border-radius:14px;
  min-height:min(100dvh - 40px, 960px);
  box-sizing:border-box;
}
/* Give the hub overlay a definite height on phones (dvh/svh) */
#screen-select:has(#select-hub-door.is-open){
  min-height:min(100dvh, 100svh, 960px);
}
.select-screen-bg{
  position:absolute;
  inset:-6%;
  z-index:0;
  background:url("../assets/ui/select-screen.png") center 40% / cover no-repeat;
  background-color:#0a0806;
  transform:scale(0.88);
  transform-origin:50% 40%;
}
.select-screen-scrim{
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    linear-gradient(180deg, rgba(5,4,3,.72) 0%, rgba(10,8,6,.32) 30%, rgba(8,7,5,.48) 58%, rgba(3,2,2,.72) 100%),
    radial-gradient(100% 55% at 50% 0%, rgba(0,0,0,.38) 0%, transparent 58%);
}
.select-screen-content{
  position:relative;
  z-index:3;
  display:flex;
  flex-direction:column;
  gap:clamp(12px, 2.2vw, 20px);
  padding:clamp(10px, 2.2vw, 18px) clamp(10px, 2.8vw, 22px) max(12px, env(safe-area-inset-bottom, 0px));
  max-width:1220px;
  margin:0 auto;
  min-height:0;
  pointer-events:none;
}
.select-screen-content .splash-top,
.select-screen-content .splash-menu-left,
.select-screen-content .splash-menu-actions,
.select-screen-content .splash-settings-btn,
.select-screen-content .splash-discord-link,
.select-screen-content .splash-roster-hint{
  pointer-events:auto;
}
/* Click targets aligned to art in assets/ui/select-screen.png (cover + scale) — tweak % if art changes */
.splash-hotspot-layer{
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
}
.splash-hotspot-layer .splash-hotspot{
  pointer-events:auto;
}
/* War-room navigation splash (hotspots: supplies | map | door) */
.select-splash{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.splash-top{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px 16px;
  padding:4px 2px 8px;
}
.splash-menu-left{
  position:relative;
  z-index:5;
  display:flex;
  flex-shrink:0;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-start;
  pointer-events:auto;
}
.splash-menu-actions{
  position:relative;
  z-index:5;
  display:flex;
  flex-shrink:0;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
  pointer-events:auto;
}
.splash-brand{min-width:0;flex:1 1 220px;}
.splash-title{
  font-family:'Cinzel',serif;
  font-size:clamp(1.15rem, 4vw, 1.65rem);
  color:var(--gold-light);
  margin:0 0 4px;
  text-shadow:0 2px 18px rgba(0,0,0,.92), 0 0 14px rgba(232,201,106,.2);
  letter-spacing:.06em;
}
.splash-sub{
  margin:0;
  font-size:clamp(.72rem, 2.2vw, .84rem);
  color:rgba(210,204,192,.82);
  font-style:italic;
  line-height:1.35;
  max-width:36rem;
}
.splash-settings-btn{
  flex-shrink:0;
  background:rgba(6,8,12,.52);
  backdrop-filter:blur(10px) saturate(1.05);
  -webkit-backdrop-filter:blur(10px) saturate(1.05);
  border:1px solid rgba(201,168,76,.42);
  border-radius:10px;
  color:rgba(230,220,200,.88);
  box-shadow:0 2px 10px rgba(0,0,0,.22);
}
.splash-settings-btn:hover{
  border-color:rgba(232,201,106,.72);
  color:#fffaf0;
  background:rgba(14,12,8,.62);
  box-shadow:0 4px 18px rgba(0,0,0,.28);
}
.splash-settings-btn:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:3px;
}
a.splash-settings-btn{
  display:inline-flex;
  align-items:center;
  text-decoration:none;
  padding:6px 12px;
  font-family:'Cinzel',serif;
  font-size:.8rem;
  letter-spacing:.06em;
  cursor:pointer;
  transition:border-color .15s ease,background .15s ease,color .15s ease,box-shadow .15s ease;
}
.splash-discord-link:hover{
  border-color:rgba(114,137,218,.72);
  color:#eef2ff;
}
.splash-hotspot{
  appearance:none;
  -webkit-appearance:none;
  font:inherit;
  position:absolute;
  cursor:pointer;
  border-radius:12px;
  border:1px solid rgba(201,168,76,.42);
  background:rgba(6,8,12,.42);
  backdrop-filter:blur(12px) saturate(1.05);
  -webkit-backdrop-filter:blur(12px) saturate(1.05);
  padding:10px 14px;
  box-shadow:0 6px 24px rgba(0,0,0,.28);
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-width:min(44px, 11vw);
  min-height:48px;
  max-width:min(200px, 42vw);
  color:inherit;
  transition:transform .2s ease,border-color .2s ease,background .2s ease,box-shadow .2s ease;
}
.splash-hotspot--supplies{
  /* Burlap sacks / crates — lower-left */
  left:clamp(4%, 5vw, 14%);
  bottom:clamp(12%, 10vh, 24%);
  transform:none;
  align-items:flex-start;
  text-align:left;
  max-width:min(190px, 40vw);
}
.splash-hotspot--map{
  /* Mission table — lower-right (symmetric to supplies) */
  right:clamp(4%, 5vw, 14%);
  left:auto;
  bottom:clamp(12%, 10vh, 24%);
  transform:none;
  align-items:flex-end;
  text-align:right;
  max-width:min(200px, 40vw);
}
.splash-hotspot--fortune{
  /* Feathers & Fortune — middle-right, below Inventory */
  right:clamp(4%, 5vw, 14%);
  left:auto;
  top:clamp(48%, 44vh, 54%);
  bottom:auto;
  transform:translateY(-50%);
  align-items:flex-end;
  text-align:right;
  max-width:min(260px, 48vw);
}
.splash-hotspot--hatchery{
  /* The Hatchery — middle-right, below Emporium */
  right:clamp(4%, 5vw, 14%);
  left:auto;
  top:clamp(62%, 58vh, 68%);
  bottom:auto;
  transform:translateY(-50%);
  align-items:flex-end;
  text-align:right;
  max-width:min(220px, 44vw);
}
.splash-hotspot--inventory{
  /* Inventory — middle-right, above Feathers & Fortune */
  right:clamp(4%, 5vw, 14%);
  left:auto;
  top:clamp(34%, 30vh, 40%);
  bottom:auto;
  transform:translateY(-50%);
  align-items:flex-end;
  text-align:right;
  max-width:min(260px, 48vw);
}
.fortune-egg-badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:1.4em;
  padding:2px 6px;
  border-radius:999px;
  font-size:.62rem;
  font-family:'Cinzel',serif;
  letter-spacing:.04em;
  color:#1a1408;
  background:linear-gradient(180deg,#f0d878,#c9a84c);
  border:1px solid rgba(255,240,200,.65);
  box-shadow:0 2px 8px rgba(0,0,0,.35);
}
.inventory-artifact-badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:1.4em;
  padding:2px 6px;
  border-radius:999px;
  font-size:.62rem;
  font-family:'Cinzel',serif;
  letter-spacing:.04em;
  color:#f0e8ff;
  background:linear-gradient(180deg,#9a72d8,#6a48a8);
  border:1px solid rgba(220,200,255,.55);
  box-shadow:0 2px 8px rgba(0,0,0,.35);
}
.splash-hotspot--door{
  /* Open doorway — upper-center */
  left:50%;
  top:clamp(26%, 20vh, 40%);
  right:auto;
  bottom:auto;
  transform:translate(-50%,-50%);
  max-width:min(260px, 80vw);
}
.splash-hotspot--forge{
  /* Workbench / nest corner — upper-left near supplies */
  left:clamp(4%, 5vw, 14%);
  top:clamp(18%, 14vh, 28%);
  bottom:auto;
  transform:none;
  align-items:flex-start;
  text-align:left;
  max-width:min(190px, 40vw);
}
.splash-hotspot--combat-scenarios{
  /* Left column under Build Nest / above Supplies */
  left:clamp(4%, 5vw, 14%);
  top:clamp(32%, 28vh, 42%);
  bottom:auto;
  transform:none;
  align-items:flex-start;
  text-align:left;
  max-width:min(210px, 44vw);
}
.splash-hotspot.is-buildnest-hidden,
.splash-hotspot.is-combattest-hidden{
  display:none;
}
body.build-nest-unlocked .splash-hotspot--forge.is-buildnest-hidden{
  display:flex;
}
body.combat-scenario-test-unlocked .splash-hotspot--combat-scenarios.is-combattest-hidden{
  display:flex;
}
.splash-hotspot--primary{
  border-width:2px;
  border-color:rgba(232,201,106,.78);
  background:rgba(14,16,24,.5);
  padding:12px 16px;
  min-height:52px;
}
.splash-hotspot:hover{
  transform:translateY(-2px);
  border-color:rgba(232,201,106,.6);
  background:rgba(16,18,26,.52);
  box-shadow:0 10px 32px rgba(0,0,0,.35);
}
.splash-hotspot--inventory:hover,
.splash-hotspot--inventory:focus-visible,
.splash-hotspot--fortune:hover,
.splash-hotspot--fortune:focus-visible,
.splash-hotspot--hatchery:hover,
.splash-hotspot--hatchery:focus-visible{
  transform:translateY(calc(-50% - 2px));
}
.splash-hotspot--map:hover{
  transform:translateY(-2px);
}
.splash-hotspot--door:hover{
  transform:translate(-50%,calc(-50% - 2px));
}
.splash-hotspot--supplies:hover{
  transform:translateY(-2px);
}
.splash-hotspot:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:3px;
}
.splash-hotspot-title{
  font-family:'Cinzel',serif;
  font-size:clamp(.72rem, 2.2vw, .88rem);
  letter-spacing:.1em;
  text-transform:uppercase;
  color:rgba(232,201,106,.96);
  margin:0;
  line-height:1.2;
  text-shadow:0 1px 12px rgba(0,0,0,.8);
}
.splash-hotspot-desc{
  margin:0;
  font-size:clamp(.62rem, 1.8vw, .72rem);
  color:rgba(210,204,192,.76);
  line-height:1.3;
}
@media (max-width: 520px){
  .splash-hotspot--supplies{
    left:2%;
    bottom:clamp(10%, 7vh, 20%);
    max-width:42vw;
    padding:8px 10px;
  }
  .splash-hotspot--map{
    right:2%;
    bottom:clamp(10%, 7vh, 20%);
    max-width:42vw;
    padding:8px 10px;
  }
  .splash-hotspot--fortune{
    right:2%;
    top:clamp(46%, 42vh, 52%);
    max-width:44vw;
    padding:8px 10px;
  }
  .splash-hotspot--hatchery{
    right:2%;
    top:clamp(58%, 54vh, 64%);
    max-width:44vw;
    padding:8px 10px;
  }
  .splash-hotspot--inventory{
    right:2%;
    top:clamp(32%, 28vh, 38%);
    max-width:44vw;
    padding:8px 10px;
  }
  .splash-hotspot--door{
    left:50%;
    top:clamp(24%, 18vh, 36%);
    max-width:min(200px, 76vw);
  }
}
.select-hub-panels{
  display:none;
  position:absolute;
  inset:0;
  z-index:4;
  pointer-events:none;
}
.select-hub-panels.is-open{
  display:block;
  pointer-events:auto;
}
.select-hub-backdrop{
  position:absolute;
  inset:0;
  z-index:0;
  margin:0;
  padding:0;
  border:none;
  border-radius:inherit;
  background:rgba(2,2,3,.52);
  backdrop-filter:blur(5px) saturate(1.05);
  -webkit-backdrop-filter:blur(5px) saturate(1.05);
  cursor:pointer;
}
.select-hub-panel{
  display:none;
  position:absolute;
  inset:0;
  z-index:1;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding:clamp(10px, 2.5vw, 22px);
  align-items:flex-start;
  justify-content:center;
}
.select-hub-panel.is-open{
  display:flex;
  pointer-events:none;
}
.select-hub-panel-inner{
  pointer-events:auto;
  width:100%;
  max-width:520px;
  margin:0 auto;
  border-radius:16px;
  border:1px solid rgba(201,168,76,.35);
  background:rgba(8,9,12,.82);
  backdrop-filter:blur(18px) saturate(1.1);
  -webkit-backdrop-filter:blur(18px) saturate(1.1);
  box-shadow:0 16px 48px rgba(0,0,0,.45);
  padding:16px 18px 20px;
  box-sizing:border-box;
  max-height:min(90dvh, 92vh);
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
}
.select-hub-panel-inner--wide{max-width:min(1420px, 99vw);}
.select-hub-panel-inner--supplies{
  max-width:min(640px, 94vw);
}
.select-hub-panel-inner--combat-scenarios{
  max-width:min(720px, 94vw);
}
.combat-scenario-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:0 0 12px;
}
.combat-scenario-summary{
  font-family:'Cinzel',serif;
  font-size:.78rem;
  letter-spacing:.04em;
  color:rgba(220,210,190,.9);
  margin:0 0 10px;
  padding:10px 12px;
  border:1px solid rgba(120,100,70,.35);
  border-radius:8px;
  background:rgba(14,16,22,.45);
}
.combat-scenario-summary.is-ok{
  border-color:rgba(90,160,110,.55);
  color:#c8efd0;
}
.combat-scenario-summary.is-failed{
  border-color:rgba(180,70,70,.55);
  color:#f0c0c0;
}
.combat-scenario-log{
  margin:0 0 12px;
  padding:12px 14px;
  max-height:min(42vh, 360px);
  overflow:auto;
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:.72rem;
  line-height:1.45;
  color:#e8e0d0;
  background:rgba(8,10,14,.72);
  border:1px solid rgba(100,90,70,.4);
  border-radius:8px;
  white-space:pre-wrap;
}
.combat-scenario-note{
  margin:0;
  font-size:.78rem;
  color:rgba(200,190,160,.82);
  line-height:1.4;
}
.supplies-subnav{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:0 0 12px;
}
.supplies-subnav-btn{
  font:inherit;
  font-size:.72rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  cursor:pointer;
  padding:10px 8px;
  border-radius:10px;
  border:1px solid rgba(120,100,70,.4);
  background:rgba(14,16,22,.55);
  color:rgba(210,204,192,.85);
  transition:border-color .2s ease,background .2s ease,color .2s ease,box-shadow .2s ease;
}
.supplies-subnav-btn:hover{
  border-color:rgba(232,201,106,.45);
  color:#f0e8d8;
}
.supplies-subnav-btn.is-active{
  border-color:rgba(232,201,106,.65);
  background:rgba(28,32,44,.72);
  color:var(--gold-light);
  box-shadow:0 0 0 1px rgba(232,201,106,.12) inset;
}
.supplies-subnav-btn:focus-visible{outline:2px solid var(--gold);outline-offset:2px;}
.supplies-subview{display:none;flex-direction:column;gap:12px;}
.supplies-subview.is-active{display:flex;}
.supplies-records-lead{margin-bottom:0;}
/* ── Feathers & Fortune store ── */
.select-hub-panel-inner--fortune{max-width:min(720px,96vw);}
.fortune-balance-bar{
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  margin:0 0 12px;
}
.fortune-balance-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 12px;
  border-radius:10px;
  border:1px solid rgba(201,168,76,.35);
  background:rgba(8,10,14,.55);
  font-size:.78rem;
  color:rgba(220,214,200,.9);
}
.fortune-balance-chip strong{color:var(--gold-light);font-family:'Cinzel',serif;}
.fortune-balance-chip--goose{border-color:rgba(180,140,255,.35);}
.fortune-welcome{
  margin:0 0 4px;
  font-family:'Cinzel',serif;
  font-size:.88rem;
  color:var(--gold-light);
  letter-spacing:.04em;
}
.fortune-owner-note{
  margin:0 0 10px;
  font-size:.74rem;
  color:rgba(200,198,190,.62);
  line-height:1.35;
  font-style:italic;
}
.fortune-subnav{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:8px;
  margin:0 0 12px;
}
.fortune-subnav-btn{
  font:inherit;
  font-size:.72rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  cursor:pointer;
  padding:10px 8px;
  border-radius:10px;
  border:1px solid rgba(120,100,70,.4);
  background:rgba(14,16,22,.55);
  color:rgba(210,204,192,.85);
  transition:border-color .2s ease,background .2s ease,color .2s ease,box-shadow .2s ease;
}
.fortune-subnav-btn:hover{border-color:rgba(232,201,106,.45);color:#f0e8d8;}
.fortune-subnav-btn.is-active{
  border-color:rgba(232,201,106,.65);
  background:rgba(28,32,44,.72);
  color:var(--gold-light);
  box-shadow:0 0 0 1px rgba(232,201,106,.12) inset;
}
.fortune-subnav-btn:focus-visible{outline:2px solid var(--gold);outline-offset:2px;}
.fortune-subview{display:none;flex-direction:column;gap:10px;}
.fortune-subview.is-active{display:flex;}
.fortune-tab-lead{margin:0;font-size:.78rem;color:rgba(200,198,190,.75);line-height:1.4;}
.fortune-shop-msg{min-height:1.2em;font-size:.76rem;color:var(--text-dim);margin-bottom:4px;}
.fortune-trade-progress{
  margin:0;
  font-size:.7rem;
  color:rgba(200,198,190,.68);
}
.fortune-trade-bulk-btns{
  display:flex;
  flex-direction:column;
  gap:6px;
  width:100%;
}
.fortune-buy-btn--bulk{font-size:.72rem;}
.fortune-hiring-grid,.fortune-artifacts-grid,.fortune-trade-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(100%,200px),1fr));
  gap:10px;
}
.fortune-hire-card,.fortune-artifact-card{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(120,100,70,.35);
  background:rgba(6,8,12,.52);
}
.fortune-hire-card.is-affordable,.fortune-artifact-card.is-affordable{border-color:rgba(201,168,76,.45);}
.fortune-hire-card.is-owned,.fortune-artifact-card.is-owned{
  border-color:rgba(106,184,154,.45);
  background:rgba(8,16,12,.55);
  opacity:.92;
}
.fortune-hire-top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;flex-wrap:wrap;}
.fortune-hire-cost{font-size:.62rem;color:var(--gold);letter-spacing:.04em;}
.fortune-hire-icon,.fortune-artifact-icon{display:flex;justify-content:center;font-size:2rem;line-height:1;}
.fortune-hire-name,.fortune-artifact-name{
  font-family:'Cinzel',serif;
  font-size:.82rem;
  color:var(--gold-light);
  text-align:center;
}
.fortune-hire-hint,.fortune-artifact-desc{
  margin:0;
  font-size:.68rem;
  color:var(--text-dim);
  line-height:1.35;
  flex:1 1 auto;
}
.fortune-artifact-note{margin:0;font-size:.62rem;color:rgba(180,175,165,.7);font-style:italic;}
.fortune-buy-btn{
  width:100%;
  font:inherit;
  font-family:'Cinzel',serif;
  font-size:.68rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  cursor:pointer;
  padding:9px 10px;
  border-radius:8px;
  border:1px solid rgba(201,168,76,.45);
  background:rgba(201,168,76,.12);
  color:var(--gold-light);
  transition:background .2s ease,border-color .2s ease,transform .2s ease;
}
.fortune-buy-btn:hover:not(:disabled){
  background:rgba(201,168,76,.22);
  border-color:var(--gold);
  transform:translateY(-1px);
}
.fortune-buy-btn:disabled{opacity:.45;cursor:not-allowed;}
.fortune-buy-btn--artifact{border-color:rgba(180,140,255,.45);background:rgba(120,80,200,.12);color:#d8c0ff;}
.fortune-empty{margin:0;font-size:.78rem;color:var(--text-dim);text-align:center;padding:16px 8px;}
/* ── War room Inventory panel ── */
.select-hub-panel-inner--inventory{max-width:min(720px,96vw);}
.inventory-balance-bar{margin-bottom:16px;}
.inventory-section{margin:0 0 18px;}
.inventory-section-title{
  margin:0 0 4px;
  font-family:'Cinzel',serif;
  font-size:.78rem;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--gold-light);
}
.inventory-section-lead{margin:0 0 10px;font-size:.74rem;color:rgba(200,198,190,.72);line-height:1.4;}
.inventory-empty{margin:0 0 10px;font-size:.76rem;color:var(--text-dim);font-style:italic;line-height:1.4;}
.inventory-empty[hidden]{display:none;}
.inventory-items-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(100%,180px),1fr));
  gap:10px;
}
.inventory-item-card{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(120,100,70,.35);
  background:rgba(6,8,12,.52);
}
.inventory-item-card--artifact{border-color:rgba(180,140,255,.35);background:rgba(12,8,20,.55);}
.inventory-item-card--equipped{
  border-color:rgba(232,201,106,.65);
  background:rgba(20,14,32,.68);
  box-shadow:0 0 0 1px rgba(232,201,106,.18) inset,0 8px 24px rgba(120,80,200,.18);
}
.inventory-item-card--misc{border-color:rgba(106,184,154,.35);}
.inventory-nest-open{display:flex;flex-direction:column;gap:8px;margin-top:4px;}
.inventory-nest-stepper{display:flex;align-items:center;justify-content:center;gap:6px;}
.inventory-nest-qty{
  min-width:1.6rem;
  text-align:center;
  font-family:'Cinzel',serif;
  font-size:.95rem;
  color:var(--gold-light);
}
.inventory-nest-qty-btn,
.inventory-nest-all-btn{
  width:32px;height:32px;padding:0;
  border-radius:8px;
  border:1px solid rgba(106,184,154,.45);
  background:linear-gradient(145deg,rgba(28,40,36,.95),rgba(14,20,18,.98));
  color:#9ed9c4;
  font-size:1.1rem;line-height:1;cursor:pointer;font-weight:700;
  transition:transform .12s ease,border-color .12s,opacity .12s;
}
.inventory-nest-all-btn{
  width:auto;min-width:40px;padding:0 8px;
  font-family:'Cinzel',serif;font-size:.68rem;letter-spacing:.04em;text-transform:uppercase;
}
.inventory-nest-qty-btn:hover:not(:disabled),
.inventory-nest-all-btn:hover:not(:disabled){border-color:#9ed9c4;transform:scale(1.05);}
.inventory-nest-qty-btn:disabled,
.inventory-nest-all-btn:disabled{opacity:.35;cursor:not-allowed;}
.inventory-open-btn{width:100%;}
.inventory-equipped-note{
  margin:0 0 8px;
  font-size:.76rem;
  color:rgba(200,198,190,.72);
  line-height:1.35;
}
.inventory-equipped-note[hidden]{display:none;}
.inventory-item-equipped-badge{
  position:absolute;
  top:-4px;
  right:calc(50% - 36px);
  font-size:.58rem;
  font-family:'Cinzel',serif;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:#1a1408;
  background:linear-gradient(180deg,#f0d878,#c9a84c);
  border:1px solid rgba(255,240,200,.55);
  border-radius:999px;
  padding:2px 7px;
}
.inventory-equip-btn{margin-top:4px;width:100%;}
.inventory-item-icon{
  position:relative;
  display:flex;
  justify-content:center;
  font-size:2rem;
  line-height:1;
}
.inventory-item-qty{
  position:absolute;
  top:-4px;
  right:calc(50% - 28px);
  font-size:.62rem;
  font-family:'Cinzel',serif;
  color:var(--gold-light);
  background:rgba(0,0,0,.55);
  border-radius:999px;
  padding:1px 6px;
}
.inventory-item-name{
  font-family:'Cinzel',serif;
  font-size:.8rem;
  color:var(--gold-light);
  text-align:center;
}
.inventory-item-desc{
  margin:0;
  font-size:.68rem;
  color:var(--text-dim);
  line-height:1.35;
  flex:1 1 auto;
  text-align:center;
}
.inventory-item-note{margin:0;font-size:.62rem;color:rgba(180,175,165,.7);font-style:italic;text-align:center;}
.inventory-subnav{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:0 0 14px;
}
.inventory-subnav-btn{
  font:inherit;
  font-family:'Cinzel',serif;
  font-size:.64rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  cursor:pointer;
  padding:7px 10px;
  border-radius:8px;
  border:1px solid rgba(120,100,70,.4);
  background:rgba(14,16,22,.55);
  color:rgba(210,204,192,.85);
  transition:border-color .2s ease,color .2s ease,background .2s ease;
}
.inventory-subnav-btn.is-active{
  border-color:rgba(232,201,106,.65);
  background:rgba(201,168,76,.14);
  color:var(--gold-light);
}
.inventory-subview{display:block;}
.inventory-subview[hidden]{display:none!important;}
.inventory-feather-tabs{
  display:flex;
  gap:8px;
  margin:0 0 12px;
  padding:4px;
  border:1px solid rgba(120,100,70,.28);
  border-radius:12px;
  background:rgba(8,10,16,.42);
}
.inventory-feather-tab-btn{
  flex:1;
  font:inherit;
  font-size:.74rem;
  font-weight:700;
  letter-spacing:.04em;
  cursor:pointer;
  padding:9px 12px;
  border-radius:9px;
  border:1px solid transparent;
  background:transparent;
  color:rgba(210,204,192,.78);
}
.inventory-feather-tab-btn.is-active{
  border-color:rgba(232,201,106,.55);
  background:linear-gradient(180deg,rgba(201,168,76,.18),rgba(90,70,30,.16));
  color:var(--gold-light);
}
.inventory-feather-filters{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:0 0 10px;
}
.inventory-feather-filter-btn{
  font:inherit;
  font-size:.62rem;
  letter-spacing:.04em;
  cursor:pointer;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid rgba(120,100,70,.35);
  background:rgba(10,12,18,.5);
  color:rgba(210,204,192,.82);
}
.inventory-feather-filter-btn.is-active{
  border-color:rgba(232,201,106,.55);
  color:var(--gold-light);
  background:rgba(201,168,76,.12);
}
.inventory-feathers-scroll{
  max-height:min(52vh,420px);
  overflow-y:auto;
  padding-right:4px;
}
.inventory-feathers-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(100%,150px),1fr));
  gap:10px;
}
.inventory-feather-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding:12px 10px;
  border-radius:12px;
  border:2px solid rgba(120,100,70,.35);
  background:rgba(8,10,16,.58);
  text-align:center;
  position:relative;
}
.inventory-feather-card.is-upgradable{
  box-shadow:0 0 0 1px rgba(120,220,140,.2),0 10px 24px rgba(0,0,0,.18);
}
.inventory-feather-card.has-no-feathers{
  opacity:.72;
  filter:saturate(.75);
}
.inventory-feather-card.tier-grey{background:linear-gradient(180deg,rgba(106,120,144,.14),rgba(42,38,32,.9));border-color:rgba(106,120,144,.55);}
.inventory-feather-card.tier-green{background:linear-gradient(180deg,rgba(76,138,106,.14),rgba(36,44,36,.9));border-color:rgba(76,138,106,.55);}
.inventory-feather-card.tier-blue{background:linear-gradient(180deg,rgba(76,106,201,.14),rgba(34,38,52,.9));border-color:rgba(76,106,201,.55);}
.inventory-feather-card.tier-purple{background:linear-gradient(180deg,rgba(120,76,180,.14),rgba(40,34,50,.9));border-color:rgba(120,76,180,.55);}
.inventory-feather-card.tier-gold{background:linear-gradient(180deg,rgba(180,140,40,.16),rgba(48,40,24,.92));border-color:rgba(180,140,40,.6);}
.inventory-feather-card.tier-orange{background:linear-gradient(180deg,rgba(200,100,40,.16),rgba(52,36,24,.92));border-color:rgba(200,100,40,.6);}
.inventory-feather-portrait{display:flex;justify-content:center;min-height:52px;}
.inventory-feather-icon{font-size:1.4rem;line-height:1;margin-top:-4px;}
.inventory-feather-name{
  font-family:'Cinzel',serif;
  font-size:.72rem;
  color:var(--gold-light);
  line-height:1.2;
}
.inventory-feather-tier{font-size:.58rem;color:rgba(200,198,190,.72);text-transform:uppercase;letter-spacing:.05em;}
.inventory-feather-count{
  font-family:'Cinzel',serif;
  font-size:.82rem;
  color:#e8e0d0;
  margin-top:2px;
}
.inventory-feather-amount-filters{margin-bottom:6px;}
.bird-card-upgrade-wrap{
  width:100%;
  margin-top:6px;
}
.bird-card-upgrade-wrap--inventory{margin-top:8px;}
.bird-card-upgrade-btn{
  font:inherit;
  font-size:.68rem;
  cursor:pointer;
  padding:6px 10px;
  border-radius:8px;
  border:1px solid rgba(120,180,120,.45);
  background:rgba(30,50,36,.55);
  color:#b8e8c8;
}
.bird-card-upgrade-btn:hover{border-color:rgba(160,220,160,.65);}
.bird-card-upgrade-btn--inventory{
  width:100%;
  font-size:.78rem;
  padding:10px 12px;
  min-height:40px;
  border-radius:10px;
}
.bird-card-upgrade-hint{
  font-size:.72rem;
  color:rgba(200,198,190,.65);
  margin:0;
  line-height:1.35;
}
.bird-card-upgrade-wrap--inventory .bird-card-upgrade-hint{font-size:.68rem;}
.bird-upgrade-modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:9550;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(2,4,8,.72);
  backdrop-filter:blur(6px);
}
.bird-upgrade-modal.is-open{display:flex;}
.bird-upgrade-panel{
  width:min(760px,96vw);
  max-height:min(88vh,760px);
  overflow:auto;
  border:1px solid rgba(232,201,106,.38);
  border-radius:18px;
  background:linear-gradient(180deg,rgba(30,26,18,.98),rgba(10,12,18,.98));
  box-shadow:0 24px 70px rgba(0,0,0,.55);
  padding:16px;
  color:var(--text);
}
.bird-upgrade-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.bird-upgrade-head h2{
  margin:0;
  color:var(--gold-light);
  font-family:'Cinzel',serif;
}
.bird-upgrade-close{
  width:36px;
  height:36px;
  border-radius:50%;
  border:1px solid rgba(232,201,106,.32);
  background:rgba(0,0,0,.24);
  color:var(--gold-light);
  cursor:pointer;
  font-size:1.25rem;
}
.bird-upgrade-summary{
  display:flex;
  gap:14px;
  align-items:center;
  border:1px solid rgba(120,100,70,.32);
  border-radius:14px;
  padding:12px;
  background:rgba(8,10,16,.46);
}
.bird-upgrade-portrait{
  width:82px;
  min-width:82px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.bird-upgrade-summary h3{
  margin:0 0 8px;
  font-family:'Cinzel',serif;
  color:var(--gold-light);
}
.bird-upgrade-tier-line{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}
.bird-upgrade-arrow{
  color:var(--gold-light);
  font-weight:800;
}
.bird-upgrade-cost{
  margin:8px 0 0;
  color:rgba(220,214,202,.8);
  font-size:.86rem;
}
.bird-upgrade-stats{
  margin-top:14px;
  border:1px solid rgba(120,100,70,.32);
  border-radius:14px;
  overflow:hidden;
}
.bird-upgrade-stat-head,
.bird-upgrade-stat-row{
  display:grid;
  grid-template-columns:1.1fr .8fr 24px .8fr .7fr;
  align-items:center;
  gap:8px;
  padding:8px 10px;
}
.bird-upgrade-stat-head{
  background:rgba(201,168,76,.12);
  color:var(--gold-light);
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.bird-upgrade-stat-row{
  border-top:1px solid rgba(120,100,70,.22);
  background:rgba(8,10,16,.28);
}
.bird-upgrade-stat-row span{font-weight:700;color:rgba(232,224,208,.9);}
.bird-upgrade-stat-row strong{text-align:right;}
.bird-upgrade-stat-row i{text-align:center;color:var(--gold-light);font-style:normal;}
.bird-upgrade-stat-row em{
  justify-self:end;
  min-width:44px;
  padding:3px 7px;
  border-radius:999px;
  background:rgba(160,160,160,.12);
  color:rgba(220,214,202,.78);
  text-align:center;
  font-style:normal;
  font-size:.76rem;
}
.bird-upgrade-stat-row em.is-positive{background:rgba(60,170,90,.18);color:#baf0c8;}
.bird-upgrade-stat-row em.is-negative{background:rgba(180,70,70,.18);color:#ffb8b8;}
.bird-upgrade-passive{
  margin-top:14px;
  border:1px solid rgba(120,100,70,.32);
  border-radius:14px;
  padding:12px;
  background:rgba(8,10,16,.36);
}
.bird-upgrade-passive.is-changed{
  border-color:rgba(232,201,106,.42);
  background:rgba(201,168,76,.08);
}
.bird-upgrade-passive h4{
  margin:0 0 10px;
  color:var(--gold-light);
}
.bird-upgrade-passive-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.bird-upgrade-passive-grid p{
  margin:0;
  padding:10px;
  border-radius:10px;
  background:rgba(0,0,0,.2);
  color:rgba(232,224,208,.86);
  line-height:1.4;
}
.bird-upgrade-passive-grid span{
  display:block;
  margin-bottom:4px;
  color:rgba(232,201,106,.8);
  font-size:.7rem;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.bird-upgrade-passive-note,
.bird-upgrade-result-banner{
  margin-top:10px;
  border:1px solid rgba(120,220,140,.28);
  border-radius:10px;
  background:rgba(50,120,70,.16);
  color:#baf0c8;
  padding:8px 10px;
}
.bird-upgrade-result-banner{margin:0 0 12px;text-align:center;font-weight:800;}
.bird-upgrade-warning{
  margin:12px 0 0;
  border:1px solid rgba(220,100,80,.32);
  border-radius:10px;
  background:rgba(120,40,30,.18);
  color:#ffb8a8;
  padding:8px 10px;
}
.bird-upgrade-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:14px;
}
@media (max-width:640px){
  .bird-upgrade-summary{align-items:flex-start;}
  .bird-upgrade-passive-grid{grid-template-columns:1fr;}
  .bird-upgrade-stat-head,
  .bird-upgrade-stat-row{grid-template-columns:1fr .72fr 18px .72fr .62fr;font-size:.82rem;}
}
.select-hub-panel--hatchery .select-hub-panel-inner--hatchery{max-width:min(920px,96vw);}
.hatchery-balance-bar{margin-bottom:8px;}
.mother-goose-hatch-modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:9500;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:rgba(0,0,0,.72);
}
.mother-goose-hatch-modal.open{display:flex;}
.mother-goose-hatch-panel{
  width:min(720px,calc(100vw - 32px));
  max-height:calc(100vh - 32px);
  overflow-y:auto;
  padding:22px 18px 16px;
  border-radius:14px;
  border:1px solid rgba(201,168,76,.45);
  background:linear-gradient(180deg,rgba(18,14,8,.97),rgba(10,8,6,.98));
  box-shadow:0 18px 50px rgba(0,0,0,.55);
  text-align:center;
}
.mother-goose-hatch-panel--batch{
  width:min(980px,calc(100vw - 24px));
  padding:26px 20px 18px;
}
.mother-goose-hatch-panel--single{padding:28px 22px 18px;}
.mother-goose-hatch-title{
  margin:0 0 12px;
  font-family:'Cinzel',serif;
  font-size:1rem;
  color:var(--gold-light);
  letter-spacing:.06em;
}
.mother-goose-hatch-egg-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:100px;
  margin-bottom:8px;
}
.mother-goose-hatch-egg-wrap--single{min-height:220px;margin-bottom:12px;}
.mother-goose-hatch-egg-grid{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
  align-items:center;
  max-width:100%;
}
.mother-goose-hatch-egg-grid--batch{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:12px;
  width:100%;
  max-width:920px;
  margin:0 auto;
}
.mother-goose-hatch-egg-grid--single{
  display:flex;
  justify-content:center;
  width:100%;
}
.mother-goose-hatch-slot{width:100%;min-width:0;}
.mother-goose-hatch-egg-grid--single .mother-goose-hatch-slot{max-width:260px;}
.mother-goose-hatch-flip{
  position:relative;
  width:100%;
  aspect-ratio:3/4;
  min-height:132px;
  perspective:900px;
  transform-style:preserve-3d;
  transition:transform .52s cubic-bezier(.4,.2,.2,1);
}
.mother-goose-hatch-egg-grid--single .mother-goose-hatch-flip{
  aspect-ratio:4/5;
  min-height:240px;
}
.mother-goose-hatch-flip-front,
.mother-goose-hatch-flip-back{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
}
.mother-goose-hatch-flip-front{
  border:2px solid rgba(201,168,76,.35);
  background:rgba(12,10,8,.82);
}
.mother-goose-hatch-flip-back{
  transform:rotateY(180deg);
  padding:4px;
  overflow:hidden;
}
.mother-goose-hatch-flip.is-flipped{transform:rotateY(180deg);}
.mother-goose-hatch-flip.is-shaking .mother-goose-hatch-flip-front .mother-goose-hatch-egg{
  animation:mother-goose-egg-shake .45s ease-in-out infinite;
}
.mother-goose-hatch-flip-back .mother-goose-hatch-card{
  width:100%;
  max-width:none;
  margin:0;
  padding:8px 6px;
  box-sizing:border-box;
}
.mother-goose-hatch-flip-back .mother-goose-hatch-portrait{margin:4px 0;}
.mother-goose-hatch-flip-back .mother-goose-hatch-card-name{font-size:.72rem;margin:4px 0 2px;}
.mother-goose-hatch-flip-back .mother-goose-hatch-feather-glyph{font-size:1.8rem;}
.mother-goose-hatch-flip-back .mother-goose-hatch-feather-gain{font-size:1.05rem;}
.mother-goose-hatch-flip-back .class-badge{font-size:.55rem;padding:2px 6px;}
.mother-goose-hatch-flip-back .bird-card-tier-badge{font-size:.58rem;}
.mother-goose-hatch-egg-grid--single .mother-goose-hatch-flip-back .mother-goose-hatch-card{padding:14px 10px;}
.mother-goose-hatch-egg-grid--single .mother-goose-hatch-flip-back .mother-goose-hatch-card-name{font-size:.9rem;}
.mother-goose-hatch-egg-grid--single .mother-goose-hatch-flip-back .mother-goose-hatch-feather-glyph{font-size:2.4rem;}
.mother-goose-hatch-egg-grid--batch .mother-goose-hatch-flip-front .mother-goose-hatch-egg{font-size:2.4rem;}
.mother-goose-hatch-egg-grid--batch .mother-goose-hatch-flip-front .mother-goose-hatch-egg.mother-goose-egg-icon--cracked{font-size:2.1rem;}
.mother-goose-hatch-egg-grid--batch .mother-goose-hatch-flip-front .mother-goose-hatch-egg.mother-goose-egg-icon--feathered{font-size:2.5rem;}
.mother-goose-hatch-egg-grid--batch .mother-goose-hatch-flip-front .mother-goose-hatch-egg.mother-goose-egg-icon--gleaming{font-size:2.7rem;}
.mother-goose-hatch-egg-grid--batch .mother-goose-hatch-flip-front .mother-goose-hatch-egg.mother-goose-egg-icon--royal{font-size:2.9rem;}
.mother-goose-hatch-egg-grid--batch .mother-goose-hatch-flip-front .mother-goose-hatch-egg.mother-goose-egg-icon--ancestral{font-size:3.1rem;}
.mother-goose-hatch-egg{
  font-size:3.2rem;
  line-height:1;
  display:inline-block;
  transform-origin:center bottom;
}
@media (max-width:600px){
  .mother-goose-hatch-egg-grid--batch{grid-template-columns:repeat(3,1fr);gap:8px;}
  .mother-goose-hatch-panel--batch{width:min(100%,calc(100vw - 16px));padding:18px 12px 14px;}
  .mother-goose-hatch-flip{min-height:108px;}
}
.mother-goose-egg-icon{font-size:2rem;line-height:1;}
.mother-goose-egg-icon--cracked{font-size:2.25rem;}
.mother-goose-egg-icon--feathered{font-size:2.75rem;}
.mother-goose-egg-icon--gleaming{font-size:3.25rem;}
.mother-goose-egg-icon--royal{font-size:3.75rem;}
.mother-goose-egg-icon--ancestral{font-size:4.25rem;}
.mother-goose-hatch-egg.mother-goose-egg-icon--cracked{font-size:2.5rem;}
.mother-goose-hatch-egg.mother-goose-egg-icon--feathered{font-size:2.9rem;}
.mother-goose-hatch-egg.mother-goose-egg-icon--gleaming{font-size:3.3rem;}
.mother-goose-hatch-egg.mother-goose-egg-icon--royal{font-size:3.7rem;}
.mother-goose-hatch-egg.mother-goose-egg-icon--ancestral{font-size:4.1rem;}
.mother-goose-hatch-btns{
  display:flex;
  flex-direction:column;
  gap:6px;
  width:100%;
}
.mother-goose-hatch-reveal--batch{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(120px,1fr));
  gap:8px;
  text-align:center;
}
.mother-goose-hatch-reveal--batch .mother-goose-hatch-card{
  padding:8px 6px;
  margin:0;
}
.mother-goose-hatch-reveal--batch .mother-goose-hatch-portrait{margin:4px 0;}
.mother-goose-hatch-reveal--batch .mother-goose-hatch-card-name{font-size:.72rem;}
.mother-goose-hatch-reveal--batch .mother-goose-hatch-feather-glyph{font-size:1.8rem;}
@keyframes mother-goose-egg-shake{
  0%,100%{transform:rotate(0deg) translateY(0);}
  20%{transform:rotate(-8deg) translateY(-2px);}
  40%{transform:rotate(8deg) translateY(0);}
  60%{transform:rotate(-6deg) translateY(-3px);}
  80%{transform:rotate(6deg) translateY(-1px);}
}
.mother-goose-hatch-reveal[hidden]{display:none!important;}
.mother-goose-hatch-card{
  margin:0 auto 12px;
  padding:14px 12px;
  border-radius:12px;
  border:2px solid rgba(201,168,76,.35);
  background:rgba(12,10,8,.75);
  max-width:240px;
}
.mother-goose-hatch-card.tier-grey{border-color:rgba(106,120,144,.55);}
.mother-goose-hatch-card.tier-green{border-color:rgba(76,138,106,.55);}
.mother-goose-hatch-card.tier-blue{border-color:rgba(76,106,201,.55);}
.mother-goose-hatch-card.tier-purple{border-color:rgba(120,76,180,.55);}
.mother-goose-hatch-card.tier-gold{border-color:rgba(180,140,40,.65);box-shadow:0 0 16px rgba(201,168,76,.15);}
.mother-goose-hatch-card.tier-orange{border-color:rgba(200,100,40,.65);}
.mother-goose-hatch-card--feather .mother-goose-hatch-feather-glyph{font-size:2.6rem;line-height:1;margin:4px 0;}
.mother-goose-hatch-portrait{display:flex;justify-content:center;margin:8px 0;}
.mother-goose-hatch-card-name{
  font-family:'Cinzel',serif;
  font-size:.95rem;
  color:var(--gold-light);
  margin:6px 0 4px;
}
.mother-goose-hatch-feather-gain{font-family:'Cinzel',serif;font-size:1.35rem;color:var(--gold-light);margin-top:4px;}
.mother-goose-hatch-feather-total{font-family:'Cinzel',serif;font-size:1rem;color:#e8e0d0;}
.mother-goose-hatch-feather-total--secondary{font-size:.72rem;color:rgba(200,198,190,.75);margin-top:2px;}
.mother-goose-hatch-msg{
  margin:0 0 14px;
  font-size:.78rem;
  line-height:1.45;
  color:rgba(210,204,192,.9);
}
.mother-goose-hatch-close{
  font:inherit;
  font-family:'Cinzel',serif;
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  cursor:pointer;
  padding:10px 18px;
  border-radius:8px;
  border:1px solid rgba(201,168,76,.5);
  background:rgba(201,168,76,.14);
  color:var(--gold-light);
}
.mother-goose-hatch-close:hover{background:rgba(201,168,76,.24);}
#supplies-view-records .supplies-records-block{
  margin:0;
  max-width:none;
  padding:12px 14px 14px;
  border-radius:12px;
  border:1px solid rgba(120,100,70,.32);
  background:rgba(4,5,6,.42);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
#supplies-view-records .supplies-records-block .run-history-title{margin-top:0;}
#supplies-view-records .run-history-grid{justify-content:flex-start;}
/* ==========================================================================
   CHARACTER SELECT — base presentation
   Scoped to the open hub door so shared roster, portrait, and ascent classes
   remain available to Battle, Nest, and other screens without presentation leaks.
   Responsive overrides follow below in desktop-to-tablet-to-mobile order.
   ========================================================================== */
#select-hub-door.select-hub-panel.is-open{
  position:fixed !important;
  inset:0 !important;
  z-index:100 !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  justify-content:flex-start !important;
  overflow:hidden !important;
  padding:0 !important;
  background:linear-gradient(160deg,#09090d 0%,#0b0806 100%);
  pointer-events:auto !important;
}
/* sfsel layout ─ fills the full viewport when the door panel is open */
#select-hub-door .sfsel{
  display:flex;
  flex-direction:column;
  width:100%;
  height:100%;
  height:100dvh;
  min-width:0;
  overflow:hidden;
}
/* ── Top bar: title | filters | return button ── */
#select-hub-door .sfsel__topbar{
  flex-shrink:0;
  display:flex;
  align-items:center;
  gap:10px 16px;
  flex-wrap:wrap;
  padding:10px 18px 10px 20px;
  border-bottom:2px solid rgba(201,168,76,.28);
  background:rgba(4,4,7,.88);
  min-height:0;
}
#select-hub-door .sfsel__title-block{
  flex-shrink:0;
  min-width:0;
  max-width:min(100%,320px);
}
#select-hub-door .sfsel__title{
  font-family:'Cinzel',serif;
  font-size:clamp(.95rem,2.2vw,1.3rem);
  color:var(--gold-light);
  margin:0;
  letter-spacing:.08em;
  text-shadow:0 2px 12px rgba(0,0,0,.7);
}
#select-hub-door .sfsel__subtitle{
  margin:4px 0 0;
  font-size:clamp(.62rem,1.4vw,.74rem);
  color:rgba(200,192,175,.72);
  letter-spacing:.03em;
  line-height:1.35;
  font-style:normal;
}
#select-hub-door .sfsel__filters{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px 10px;
  flex:1 1 auto;
  min-width:0;
}
#select-hub-door .sfsel__return-btn,
#select-hub-door .sfsel__settings-btn{
  flex-shrink:0;
  font:inherit;
  font-size:.75rem;
  padding:8px 14px;
  border-radius:10px;
  border:1px solid rgba(120,100,70,.45);
  background:rgba(20,22,30,.7);
  color:rgba(230,224,210,.9);
  cursor:pointer;
  letter-spacing:.04em;
}
#select-hub-door .sfsel__return-btn:hover,
#select-hub-door .sfsel__settings-btn:hover{
  border-color:rgba(232,201,106,.55);
  color:#fffaf0;
}
#select-hub-door .sfsel__settings-btn{border-color:rgba(201,168,76,.6);color:var(--gold-light);}
/* ── Main area: grid + detail column ── */
#select-hub-door .sfsel__main{
  flex:1 1 auto;
  display:grid;
  grid-template-columns:minmax(0,1fr) clamp(360px,38vw,620px);
  width:100%;
  min-height:0;
  min-width:0;
  overflow:hidden;
}
.sfsel__view-tabs,
.sfsel__back-to-birds{display:none;}
/* LEFT: roster grid */
#select-hub-door .sfsel__roster{
  flex:1 1 0;
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:14px 12px 14px 16px;
  gap:0;
}
#select-hub-door .sfsel__roster .bird-grid-scroller{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  overflow-x:hidden;
  border-radius:14px;
  border:1px solid rgba(120,100,70,.22);
  background:rgba(4,6,10,.32);
  padding:14px 16px;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  touch-action:pan-y;
  scrollbar-color:rgba(200,180,140,.2) transparent;
  scrollbar-width:thin;
}
#select-hub-door .sfsel__roster .bird-grid-scroller::-webkit-scrollbar{width:7px;}
#select-hub-door .sfsel__roster .bird-grid-scroller::-webkit-scrollbar-track{background:transparent;}
#select-hub-door .sfsel__roster .bird-grid-scroller::-webkit-scrollbar-thumb{background:transparent;border-radius:4px;}
#select-hub-door .sfsel__roster .bird-grid-scroller:hover::-webkit-scrollbar-thumb,
#select-hub-door .sfsel__roster .bird-grid-scroller:focus-within::-webkit-scrollbar-thumb{background:rgba(130,110,80,.25);}
#select-hub-door .sfsel__roster #bird-grid{
  overflow:visible !important;
  min-height:min-content !important;
  flex:none !important;
  max-height:none !important;
}
/* Grid card sizing — SSB-style with many visible fighters */
#select-hub-door .sfsel__roster .size-birds-row{
  grid-template-columns:repeat(auto-fill,minmax(130px,1fr));
  gap:12px;
}
/* RIGHT: character detail sidebar */
#select-hub-door .sfsel__detail{
  min-width:0;
  width:auto;
  display:flex;
  flex-direction:column;
  border-left:1px solid rgba(201,168,76,.22);
  background:linear-gradient(180deg,rgba(10,12,18,.98) 0%,rgba(6,8,14,.99) 100%);
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  scrollbar-color:rgba(200,180,140,.15) transparent;
  scrollbar-width:thin;
}
/* Empty state when no fighter is selected */
#select-hub-door .sfsel__detail-empty{
  flex:1 1 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  color:rgba(180,170,155,.55);
  font-style:normal;
  font-size:.92rem;
  text-align:center;
  padding:28px 20px;
  letter-spacing:.04em;
  line-height:1.45;
}
#select-hub-door .sfsel__detail-empty::before{
  content:'🐦';
  display:block;
  font-size:1.6rem;
  margin-bottom:10px;
  opacity:.45;
}
/* Hide empty state (toggled by JS via #select-hub-door .sfsel__detail-empty--hidden) */
#select-hub-door .sfsel__detail-empty.sfsel__detail-empty--hidden{
  display:none;
}
/* Ascent panel fills the scrollable area of the detail column */
#select-hub-door .sfsel__detail #ascent-panel{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding:14px 16px 10px;
  margin:0;
  border-radius:0;
  border:none;
  background:transparent;
  max-height:none !important;
}
#select-hub-door .sfsel__detail #ascent-panel.is-empty{
  flex:0 0 0;
  padding:0;
  overflow:hidden;
}
/* Vertical layout inside the detail panel — no horizontal scroll */
#select-hub-door .sfsel__detail .ascent-strip-hscroll{
  flex-direction:column !important;
  flex-wrap:nowrap !important;
  overflow-x:visible !important;
  overflow-y:visible !important;
  gap:12px !important;
  max-width:100% !important;
}
#select-hub-door .sfsel__detail .ascent-hblock{
  min-width:0 !important;
  max-width:100% !important;
  width:100% !important;
  flex:0 0 auto !important;
}
#select-hub-door .sfsel__detail .ascent-abilities-row{
  flex-wrap:wrap !important;
  overflow-x:visible !important;
  max-width:100% !important;
}
#select-hub-door .sfsel__detail .ascent-ability-card{
  width:auto !important;
  flex:1 1 160px !important;
}
/* Make portrait area work in sidebar */
#select-hub-door .sfsel__detail .ascent-strip--filled{
  flex-direction:column;
}
#select-hub-door .sfsel .ascent-strip--tier-grey{border-color:rgba(106,120,144,.45);background:linear-gradient(180deg,rgba(106,120,144,.1),rgba(14,12,10,.94));}
#select-hub-door .sfsel .ascent-strip--tier-green{border-color:rgba(76,138,106,.45);background:linear-gradient(180deg,rgba(76,138,106,.1),rgba(12,16,12,.94));}
#select-hub-door .sfsel .ascent-strip--tier-blue{border-color:rgba(76,106,201,.45);background:linear-gradient(180deg,rgba(76,106,201,.1),rgba(12,14,22,.94));}
#select-hub-door .sfsel .ascent-strip--tier-purple{border-color:rgba(120,76,180,.45);background:linear-gradient(180deg,rgba(120,76,180,.1),rgba(16,12,20,.94));}
#select-hub-door .sfsel .ascent-strip--tier-gold{border-color:rgba(180,140,40,.5);background:linear-gradient(180deg,rgba(180,140,40,.12),rgba(18,14,8,.94));}
#select-hub-door .sfsel .ascent-strip--tier-orange{border-color:rgba(200,100,40,.5);background:linear-gradient(180deg,rgba(200,100,40,.12),rgba(20,12,8,.94));}
#select-hub-door .sfsel__detail .ascent-strip-portrait-wrap{
  width:auto !important;
  max-width:100%;
  display:flex;
  justify-content:center;
  padding:10px 0 2px;
}
#select-hub-door .sfsel__detail .ascent-panel-portrait{
  width:min(160px,50%);
  height:min(160px,50%);
}
#select-hub-door .sfsel__detail .ascent-strip-body{
  flex:1 1 auto;
  min-width:0;
}
/* CTA row at the bottom of the detail column */
#select-hub-door .sfsel__actions{
  flex-shrink:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(190px,260px);
  align-items:center;
  gap:8px 10px;
  padding:7px 12px max(7px,env(safe-area-inset-bottom,0px));
  border-top:1px solid rgba(201,168,76,.18);
  background:rgba(4,5,8,.88);
}
#select-hub-door .sfsel__run-summary{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  min-height:0;
  min-width:0;
}
#select-hub-door .sfsel__run-summary:empty{display:none;}
#select-hub-door .sfsel__run-chip{
  font-size:.62rem;
  letter-spacing:.04em;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid rgba(120,100,70,.35);
  background:rgba(12,14,20,.65);
  color:rgba(220,214,200,.88);
}
#select-hub-door .sfsel__run-chip--mode{border-color:rgba(201,168,76,.35);color:var(--gold-light);}
#select-hub-door .sfsel__selected-label{
  font-family:'Cinzel',serif;
  font-size:.78rem;
  color:var(--gold-light);
  letter-spacing:.06em;
  text-align:center;
  padding:2px 4px 0;
}
#select-hub-door .sfsel__selected-label[hidden]{display:none;}
#select-hub-door .sfsel__actions .take-flight-select-btn{
  width:100%;
  font-size:clamp(.85rem,1.8vw,1rem);
  padding:10px 18px;
  min-height:42px;
  letter-spacing:.14em;
}
#select-hub-door .sfsel__run-controls{min-width:0;}
#select-hub-door .sfsel__actions .sel-continue-run-wrap{
  grid-column:1 / -1;
  max-width:none;
  width:100%;
}
#select-hub-door .sfsel__roster .bird-card.selected{
  transform:translateY(-1px);
}
#select-hub-door .sfsel__roster .bird-card.bird-card--tier-grey.selected{border-color:#d8dde8;box-shadow:0 0 0 2px rgba(216,221,232,.45),0 0 28px rgba(106,120,144,.32);}
#select-hub-door .sfsel__roster .bird-card.bird-card--tier-green.selected{border-color:#b8e8c8;box-shadow:0 0 0 2px rgba(184,232,200,.45),0 0 28px rgba(76,138,106,.32);}
#select-hub-door .sfsel__roster .bird-card.bird-card--tier-blue.selected{border-color:#c8d4ff;box-shadow:0 0 0 2px rgba(200,212,255,.45),0 0 28px rgba(76,106,201,.32);}
#select-hub-door .sfsel__roster .bird-card.bird-card--tier-purple.selected{border-color:#e0c8ff;box-shadow:0 0 0 2px rgba(224,200,255,.45),0 0 28px rgba(120,76,180,.32);}
#select-hub-door .sfsel__roster .bird-card.bird-card--tier-gold.selected{border-color:#ffe8a0;box-shadow:0 0 0 2px rgba(255,232,160,.5),0 0 28px rgba(201,168,76,.34);}
#select-hub-door .sfsel__roster .bird-card.bird-card--tier-orange.selected{border-color:#ffd0a8;box-shadow:0 0 0 2px rgba(255,208,168,.45),0 0 28px rgba(200,100,40,.32);}
/* Bird card hover/tap in the sfsel roster */
#select-hub-door .sfsel__roster .bird-card:not(.bird-locked){
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(232,201,106,.12);
}
/* Compact bird cards for the SF/SSB grid */
#select-hub-door .sfsel__roster .bird-card{
  padding:10px 8px;
}
#select-hub-door .sfsel__roster .bird-nm{
  font-size:.72rem !important;
  margin-bottom:2px;
}
#select-hub-door .sfsel__roster .bird-tagline-mini{
  font-size:.56rem !important;
  min-height:2em;
  line-height:1.2;
}
#select-hub-door .sfsel__roster .class-badge{
  font-size:.54rem;
  padding:1px 5px;
}
#select-hub-door .sfsel__roster .bird-size-chip{
  font-size:.5rem;
  padding:1px 5px;
}
#select-hub-door .sfsel__roster .bird-card-head{
  margin-bottom:4px;
  gap:4px;
  flex-wrap:wrap;
}
.bird-card-tier-badge{
  font-size:.5rem;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  padding:1px 5px;
  border-radius:4px;
  border:1px solid rgba(255,255,255,.12);
}
.bird-card-tier-badge.tier-grey{background:rgba(106,120,144,.35);color:#d8dde8;}
.bird-card-tier-badge.tier-green{background:rgba(76,138,106,.35);color:#b8e8c8;}
.bird-card-tier-badge.tier-blue{background:rgba(76,106,201,.35);color:#c8d4ff;}
.bird-card-tier-badge.tier-purple{background:rgba(120,76,180,.35);color:#e0c8ff;}
.bird-card-tier-badge.tier-gold{background:rgba(180,140,40,.35);color:#ffe8a0;}
.bird-card-tier-badge.tier-orange{background:rgba(200,100,40,.35);color:#ffd0a8;}
.bird-feather-chip{
  font-size:.5rem;
  color:rgba(210,204,192,.9);
  padding:1px 4px;
  border-radius:4px;
  background:rgba(20,22,30,.5);
}
.bird-card-stars,.ascent-card-stars-wrap,.inventory-feather-stars{
  display:inline-flex;
  align-items:center;
  gap:1px;
  line-height:1;
}
.bird-card-star{
  font-size:.58rem;
  color:rgba(120,115,105,.55);
  letter-spacing:0;
}
.bird-card-star.is-filled{color:var(--gold-light);text-shadow:0 0 6px rgba(232,201,106,.35);}
.bird-card-rarity-badge{
  font-size:.48rem;
  font-weight:600;
  letter-spacing:.04em;
  text-transform:uppercase;
  padding:1px 5px;
  border-radius:4px;
  border:1px solid rgba(255,255,255,.1);
  opacity:.88;
}
.bird-card-rarity-badge.tier-grey{background:rgba(106,120,144,.28);color:#d8dde8;}
.bird-card-rarity-badge.tier-green{background:rgba(76,138,106,.28);color:#b8e8c8;}
.bird-card-rarity-badge.tier-blue{background:rgba(76,106,201,.28);color:#c8d4ff;}
.bird-card-rarity-badge.tier-purple{background:rgba(120,76,180,.28);color:#e0c8ff;}
.bird-card-rarity-badge.tier-gold{background:rgba(180,140,40,.28);color:#ffe8a0;}
.bird-card-rarity-badge.tier-orange{background:rgba(200,100,40,.28);color:#ffd0a8;}
.ascent-card-progress .ascent-card-rarity{font-size:.72rem;color:rgba(210,204,192,.85);}
.ascent-card-progress .ascent-card-stars-wrap{margin:0 4px;}
.ascent-card-progress{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px 12px;
  margin:6px 0 8px;
  font-size:.72rem;
  color:rgba(210,204,192,.88);
}
.ascent-mutate-btn,
.bird-card-upgrade-btn--panel{
  font:inherit;
  font-size:.68rem;
  cursor:pointer;
  padding:6px 10px;
  border-radius:8px;
  border:1px solid rgba(120,180,120,.45);
  background:rgba(30,50,36,.55);
  color:#b8e8c8;
}
.ascent-mutate-btn:hover,
.bird-card-upgrade-btn--panel:hover{border-color:rgba(160,220,160,.65);}
.ascent-passive-next{
  margin-top:6px;
  font-size:.72rem;
  color:rgba(200,198,190,.75);
}
.ascent-tier-unlocks{
  margin:6px 0 0;
  padding-left:1.1rem;
  font-size:.68rem;
  color:rgba(200,198,190,.7);
}
.ascent-card-hint,.ascent-mutate-hint,.bird-card-upgrade-hint{
  font-size:.72rem;
  color:rgba(200,198,190,.65);
  margin:4px 0 6px;
}
.mother-goose-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
  gap:10px;
  margin-bottom:12px;
}
.mother-goose-pity{
  font-size:.72rem;
  color:rgba(210,204,192,.8);
  margin-bottom:10px;
}
.mother-goose-class-pick{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin:8px 0;
}
.mother-goose-class-btn{
  font:inherit;
  font-size:.58rem;
  text-transform:capitalize;
  padding:4px 6px;
  border-radius:6px;
  border:1px solid rgba(120,100,70,.4);
  background:rgba(14,16,22,.55);
  color:rgba(210,204,192,.85);
  cursor:pointer;
}
.mother-goose-class-btn.is-active{
  border-color:rgba(232,201,106,.65);
  color:var(--gold-light);
}
.mother-goose-result{
  font-size:.78rem;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(120,100,70,.35);
  background:rgba(14,16,22,.45);
}
.mother-goose-result--success{border-color:rgba(120,180,120,.45);color:#c8e8d0;}
.mother-goose-result--error{border-color:rgba(180,80,80,.45);color:#e8b8b8;}
.mother-goose-egg-card.is-disabled{opacity:.55;}
/* Filter dropdown in the topbar */
#select-hub-door .sfsel__filter-wrap{
  display:flex;
  align-items:center;
  gap:6px;
}
#select-hub-door .sfsel__filter-label{
  font-size:.72rem;
  color:rgba(210,204,192,.8);
  white-space:nowrap;
  flex-shrink:0;
}
#select-hub-door .sfsel__filter-select{
  font:inherit;
  font-size:.72rem;
  padding:5px 26px 5px 8px;
  border-radius:8px;
  border:1px solid rgba(120,100,70,.5);
  background:rgba(12,14,20,.8);
  color:rgba(230,224,210,.9);
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(200,180,140,0.6)'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 8px center;
  min-width:110px;
}
#select-hub-door .sfsel__filter-select:focus{
  outline:2px solid rgba(232,201,106,.5);
  outline-offset:2px;
  border-color:rgba(232,201,106,.45);
}
/* Panel state and portrait sizing are local to Character Select. */
#select-hub-door .sfsel .ascent-panel{overflow:hidden;transition:max-height .35s ease,transform .25s ease,opacity .25s ease;}
#select-hub-door .sfsel .ascent-panel.is-empty{max-height:120px;opacity:.85;}
#select-hub-door .sfsel .ascent-panel.is-filled{max-height:1400px;opacity:1;}
#select-hub-door .sfsel .ascent-panel-portrait{display:flex;align-items:center;justify-content:center;overflow:visible;}
#select-hub-door .sfsel .ascent-panel-portrait .sprite4.tiny{width:76px;height:76px;}
#select-hub-door .sfsel .ascent-panel-portrait .sprite4.small{width:88px;height:88px;}
#select-hub-door .sfsel .ascent-panel-portrait .sprite4.medium{width:104px;height:104px;}
#select-hub-door .sfsel .ascent-panel-portrait .sprite4.large{width:116px;height:116px;}
#select-hub-door .sfsel .ascent-panel-portrait .sprite4.xl,
#select-hub-door .sfsel .ascent-panel-portrait .sprite4.xlarge{width:132px;height:132px;}
/* Character profile emitted by updateAscentPanel */
#select-hub-door .sfsel .ascent-strip{
  display:flex;
  flex-direction:row;
  align-items:stretch;
  gap:10px;
}
#select-hub-door .sfsel .ascent-strip-portrait-wrap{
  flex-shrink:0;
  width:72px;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:88px;
}
#select-hub-door .sfsel .ascent-strip-portrait-wrap .ascent-panel-portrait{
  display:flex;
  align-items:center;
  justify-content:center;
  max-height:88px;
}
#select-hub-door .sfsel .ascent-strip-portrait-wrap .sprite4,
#select-hub-door .sfsel .ascent-strip-portrait-wrap .bird-emo,
#select-hub-door .sfsel .ascent-strip-portrait-wrap .bird-fallback-svg{
  transform:scale(0.88);
  transform-origin:center center;
}
#select-hub-door .sfsel .ascent-strip-body{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
#select-hub-door .sfsel .ascent-strip-title-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:5px 7px;
}
#select-hub-door .sfsel .ascent-strip-title-row .ascent-panel-name{
  font-size:clamp(1rem, 2.8vw, 1.2rem);
  margin:0;
  font-size:clamp(1rem,2.8vw,1.2rem);
}
#select-hub-door .sfsel .ascent-strip-tagline{
  font-size:.62rem;
  color:rgba(180,188,200,.85);
  font-size:.62rem;
  font-style:italic;
}
#select-hub-door .sfsel .ascent-strip-hscroll{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px 10px;
  margin-top:7px;
  color:rgba(210,204,192,.88);
  font-size:.68rem;
}
.sfsel-profile__details{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:10px;
}
#select-hub-door .sfsel .ascent-strip-hscroll::-webkit-scrollbar{height:6px;}
#select-hub-door .sfsel .ascent-strip-hscroll::-webkit-scrollbar-track{background:transparent;}
#select-hub-door .sfsel .ascent-strip-hscroll::-webkit-scrollbar-thumb{background:transparent;border-radius:3px;}
#select-hub-door .sfsel .ascent-strip-hscroll:hover::-webkit-scrollbar-thumb{background:rgba(140,120,90,.22);}
#select-hub-door .sfsel .ascent-hblock{
  flex:0 0 auto;
  min-width:min(160px, 42vw);
  max-width:min(280px, 70vw);
  padding:6px 8px;
  border-radius:10px;
  border:1px solid rgba(120,100,70,.28);
  border-radius:10px;
  background:rgba(4,6,10,.35);
}
#select-hub-door .sfsel .ascent-hblock-label{
  font-family:'Cinzel',serif;
  font-size:.58rem;
  letter-spacing:.1em;
  text-transform:uppercase;
}
#select-hub-door .sfsel .ascent-hblock-stats{min-width:min(320px, 85vw);max-width:520px;}
#select-hub-door .sfsel .ascent-stats-strip{
  display:flex;
  flex-wrap:wrap;
  gap:4px 8px;
  align-items:center;
}
#select-hub-door .sfsel .ascent-stat-chip{
  font-size:.62rem;
  color:rgba(200,205,215,.9);
  padding:2px 6px;
  border-radius:6px;
  background:rgba(0,0,0,.2);
  color:rgba(200,205,215,.9);
  font-size:.62rem;
}
#select-hub-door .sfsel .ascent-stat-chip abbr{text-decoration:none;border-bottom:0;}
#select-hub-door .sfsel .ascent-stat-chip strong{color:var(--text);font-weight:700;}
#select-hub-door .sfsel .ascent-hblock-passive{min-width:min(200px, 55vw);max-width:360px;}
#select-hub-door .sfsel .ascent-panel-passive--inline{
  font-size:.65rem;
  line-height:1.35;
  color:var(--text-dim);
  margin:0;
}
#select-hub-door .sfsel .ascent-hblock-abilities{min-width:min(260px, 90vw);max-width:none;}
#select-hub-door .sfsel .ascent-abilities-row{
  display:flex;
  flex-direction:row;
  flex-wrap:nowrap;
  gap:8px;
  overflow-x:auto;
  padding-bottom:2px;
  -webkit-overflow-scrolling:touch;
  scrollbar-color: rgba(200,180,140,.1) transparent;
  scrollbar-width:thin;
}
#select-hub-door .sfsel .ascent-abilities-row::-webkit-scrollbar{height:4px;}
#select-hub-door .sfsel .ascent-abilities-row::-webkit-scrollbar-thumb{background:transparent;}
#select-hub-door .sfsel .ascent-ability-card{
  flex:0 0 auto;
  width:min(168px, 48vw);
  padding:6px 8px;
  border-radius:8px;
  border:1px solid rgba(140,160,190,.22);
  background:rgba(14,20,28,.65);
  font-size:.62rem;
}
#select-hub-door .sfsel .ascent-hblock-playstyle{min-width:min(140px, 40vw);max-width:220px;}
#select-hub-door .sfsel .ascent-hblock-playstyle .showcase-summary{font-size:.65rem;margin:0;line-height:1.3;}
/* Character profile text and ability cards emitted by updateAscentPanel */
#select-hub-door .sfsel .ascent-panel-name{font-family:'Cinzel',serif;font-size:1.1rem;color:var(--gold-light);margin-bottom:2px;}
#select-hub-door .sfsel .ascent-panel-passive{font-size:.72rem;color:var(--purple-light);background:rgba(122,76,201,.1);border:1px solid rgba(122,76,201,.22);border-radius:6px;padding:6px 8px;text-align:left;line-height:1.4;}
#select-hub-door .sfsel .ascent-panel-passive strong{color:#c090ff;}
#select-hub-door .sfsel .ascent-ability-top{display:flex;justify-content:space-between;gap:8px;font-size:.73rem;}
#select-hub-door .sfsel .ascent-ability-name{color:var(--text);font-weight:700;}
#select-hub-door .sfsel .ascent-ability-en{color:#e8c96a;font-weight:700;}
#select-hub-door .sfsel .ascent-ability-tags{font-size:.6rem;color:#93a8bf;letter-spacing:.05em;margin-top:2px;}
#select-hub-door .sfsel .ascent-ability-desc{font-size:.66rem;color:var(--text-dim);margin-top:3px;line-height:1.25;}
#select-hub-door .sfsel .ascent-ability-desc.btn-desc-lines{display:flex;flex-direction:column;gap:1px;}
#select-hub-door .sfsel .ascent-ability-desc.btn-desc-lines .btn-desc-line{font-size:.62rem;color:var(--text-dim);line-height:1.25;}
#select-hub-door .sfsel .ascent-aspect-chip{margin-left:4px;}
#select-hub-door .sfsel .aspect-chip{align-self:center;}
#select-hub-door .sfsel .ascent-card-tier,
#select-hub-door .sfsel .ascent-card-feathers{color:rgba(210,204,192,.88);}
#select-hub-door .sfsel .ascent-empty{color:var(--text-dim);font-style:italic;font-size:.82rem;padding:30px 10px;opacity:.6;}
#select-hub-door .sfsel .ascent-hblock-class-perk{min-width:min(200px,55vw);max-width:360px;}
#select-hub-door .sfsel .showcase-summary{font-size:.65rem;color:#c9d5e2;margin:0;line-height:1.3;}

/* Character Select responsive presentation: tablet */
/* ── Tablet (701–1024px): slightly narrower detail ── */
@media (min-width:701px) and (max-width:1024px){
  #select-hub-door .sfsel__main{grid-template-columns:minmax(0,1fr) clamp(320px,42vw,430px);}
  #select-hub-door .sfsel__roster .size-birds-row{grid-template-columns:repeat(auto-fill,minmax(115px,1fr));}
  #select-hub-door .sfsel__actions{grid-template-columns:1fr;}
  #select-hub-door .sfsel__actions .sel-continue-run-wrap{grid-column:auto;}
}

/* Character Select responsive presentation: mobile */
/* ── Mobile (≤700px): roster stacked above detail ── */
@media (max-width:700px){
  #select-hub-door .sfsel__main{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:minmax(0,1fr);
  }

  /* Mobile uses explicit Birds/Profile views instead of squeezing two panels
     into the same short viewport. JS keeps aria-hidden in sync with the tabs. */
  #select-hub-door .sfsel[data-mobile-view="birds"] .sfsel__detail,
  #select-hub-door .sfsel[data-mobile-view="profile"] .sfsel__roster{display:none;}

  .sfsel__view-tabs{
    flex:0 0 auto;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:4px;
    padding:6px 10px;
    border-bottom:1px solid rgba(201,168,76,.22);
    background:rgba(5,7,11,.94);
  }
  .sfsel__view-tab{
    min-width:0;
    min-height:40px;
    border:1px solid rgba(120,100,70,.45);
    border-radius:8px;
    background:rgba(20,22,30,.72);
    color:rgba(230,224,210,.82);
    font:700 .76rem 'Cinzel',serif;
    letter-spacing:.06em;
    cursor:pointer;
  }
  .sfsel__view-tab[aria-selected="true"]{
    border-color:rgba(232,201,106,.72);
    background:rgba(201,168,76,.18);
    color:#fff4c8;
  }
  .sfsel__view-tab:focus-visible,
  .sfsel__back-to-birds:focus-visible{outline:2px solid #f0cf70;outline-offset:2px;}

  /* Topbar: allow title + return to sit on one line, filters wrap below */
  #select-hub-door .sfsel__topbar{
    padding:8px 12px;
    gap:6px 10px;
    align-items:center;
  }
  #select-hub-door .sfsel__title{font-size:.84rem;flex:1 1 auto;}
  #select-hub-door .sfsel__subtitle{display:none;}
  #select-hub-door .sfsel__return-btn{flex-shrink:0;font-size:.72rem;padding:6px 10px;}
  #select-hub-door .sfsel__filters{
    flex:0 0 100%; /* own row */
    order:3;
    padding-bottom:2px;
  }

  /* Roster: fills all remaining space above the detail strip */
  #select-hub-door .sfsel__roster{
    flex:1 1 auto;
    min-height:160px;
    padding:8px 10px 8px 12px;
  }
  #select-hub-door .sfsel__roster .size-birds-row{
    grid-template-columns:repeat(auto-fill,minmax(88px,1fr));
    gap:7px;
  }
  /* Slightly tighter bird cards on phones */
  #select-hub-door .sfsel__roster .bird-card{padding:8px 6px;}
  #select-hub-door .sfsel__roster .bird-nm{font-size:.68rem;}
  #select-hub-door .sfsel__roster .bird-tagline-mini{font-size:.52rem;min-height:1.8em;}

  /* Detail: fixed-height strip at bottom with internal scroll for panel */
  #select-hub-door .sfsel__detail{
    min-height:0;
    width:100%;
    border-left:none;
    border-top:1px solid rgba(201,168,76,.22);
    overflow:hidden; /* internal panel handles scrolling */
  }
  /* When no fighter selected: collapse to just the CTA bar to free roster space */
  #select-hub-door .sfsel__detail:has(#ascent-panel.is-empty){
    max-height:64px;
  }
  #select-hub-door .sfsel__detail:has(#ascent-panel.is-empty) .sfsel__detail-empty{
    display:none;
  }

  /* Portrait: stay compact in horizontal strip mode */
  #select-hub-door .sfsel__detail .ascent-strip--filled{flex-direction:row;}
  #select-hub-door .sfsel__detail .ascent-strip-portrait-wrap{
    width:56px !important;
    flex-shrink:0;
    padding:4px 0;
  }
  #select-hub-door .sfsel__detail .ascent-panel-portrait{width:56px;height:56px;}
  /* Abilities wrap tighter on mobile */
  #select-hub-door .sfsel__detail .ascent-ability-card{flex:1 1 130px;}
  #select-hub-door .sfsel__actions{
    grid-template-columns:minmax(0,1fr);
    padding:8px 10px max(8px,env(safe-area-inset-bottom,0px));
  }
  #select-hub-door .sfsel__actions .sel-continue-run-wrap{grid-column:auto;}
  #select-hub-door .sfsel__actions .take-flight-select-btn{min-height:48px;}
  #select-hub-door .sfsel__back-to-birds{
    display:block;
    margin:8px 10px 0;
    padding:7px 10px;
    border:1px solid rgba(120,100,70,.45);
    border-radius:8px;
    background:rgba(20,22,30,.72);
    color:var(--gold-light);
    font:700 .7rem 'Cinzel',serif;
  }
}
/* ── Very small phones (≤400px): maximise roster space ── */
@media (max-width:400px){
  #select-hub-door .sfsel__roster .size-birds-row{
    grid-template-columns:repeat(auto-fill,minmax(78px,1fr));
    gap:6px;
  }
  #select-hub-door .sfsel__roster .bird-nm{font-size:.64rem;}
  #select-hub-door .sfsel__roster .bird-tagline-mini{display:none;} /* hide tagline — too cramped */
  #select-hub-door .sfsel__filter-select{min-width:90px;font-size:.68rem;}
}
/* Continue run wrap */
#continue-row.sel-continue-run-wrap{
  display:none;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  margin-right:auto;
  flex:0 1 auto;
  min-width:0;
  max-width:min(100%, 320px);
}
.take-flight-select-btn{
  font-family:'Cinzel',serif;
  font-weight:700;
  font-size:clamp(.78rem, 2.2vw, .92rem);
  letter-spacing:.12em;
  text-transform:uppercase;
  padding:12px 22px;
  min-height:48px;
  border-radius:12px;
  border:2px solid rgba(232,201,106,.78);
  background:linear-gradient(180deg,rgba(36,42,56,.92),rgba(22,26,36,.95));
  color:#f2e6c8;
  cursor:pointer;
  touch-action:manipulation;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:opacity .2s ease,border-color .2s ease,background .2s ease,color .2s ease;
}
.take-flight-select-btn:hover:not(:disabled){
  border-color:rgba(255,230,180,.9);
  color:#fffaf0;
}
.take-flight-select-btn:disabled,
.take-flight-select-btn.take-flight-select-btn--disabled{
  opacity:0.4;
  cursor:not-allowed;
  border-color:rgba(100,90,70,.4);
  color:rgba(190,185,175,.5);
  background:rgba(14,16,20,.55);
}
/* Character profile regions */
#select-hub-door .sfsel .ascent-strip.sfsel-profile{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  align-items:stretch;
  gap:12px;
  width:100%;
  min-width:0;
}
.sfsel-profile__identity{
  display:grid;
  grid-template-columns:88px minmax(0,1fr);
  align-items:center;
  gap:10px;
}
.sfsel-profile__portrait{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:88px;
}
.sfsel-profile__portrait .ascent-panel-portrait{
  display:flex;
  align-items:center;
  justify-content:center;
  max-height:88px;
}
.sfsel-profile__portrait .sprite4,
.sfsel-profile__portrait .bird-emo,
.sfsel-profile__portrait .bird-fallback-svg{
  transform:scale(.88);
  transform-origin:center;
}
.sfsel-profile__identity-copy{min-width:0;}
.sfsel-profile__title{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:5px 7px;
}
.sfsel-profile__title .ascent-panel-name{
  flex:1 1 100%;
  margin:0;
  font-size:clamp(1rem,2.8vw,1.2rem);
}
.ascent-strip-tagline{
  margin-top:3px;
  color:rgba(180,188,200,.85);
  font-size:.62rem;
  font-style:italic;
}
.sfsel-profile__progression{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px 10px;
  margin-top:7px;
  color:rgba(210,204,192,.88);
  font-size:.68rem;
}
.sfsel-profile__details{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:10px;
  min-width:0;
}
.sfsel-profile__region{
  min-width:0;
  padding:8px;
  border:1px solid rgba(120,100,70,.28);
  border-radius:10px;
  background:rgba(4,6,10,.35);
}
.sfsel-profile__heading{
  margin:0 0 6px;
  color:rgba(232,201,106,.75);
  font:600 .58rem/1.2 'Cinzel',serif;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.sfsel-profile__skills{grid-column:1 / -1;}
.sfsel-profile__trait{
  display:grid;
  gap:2px;
  color:var(--text-dim);
  font-size:.65rem;
  line-height:1.35;
}
.sfsel-profile__trait + .sfsel-profile__trait{
  margin-top:7px;
  padding-top:7px;
  border-top:1px solid rgba(120,100,70,.18);
}
.sfsel-profile__trait strong{color:var(--text);} 
.ascent-hblock-stats{min-width:min(520px, 90vw);max-width:680px;}
.ascent-stats-strip{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:6px;
}
.ascent-stat-chip{
  display:flex;
  justify-content:space-between;
  gap:5px;
  padding:3px 6px;
  border:1px solid rgba(100,110,130,.2);
  border-radius:6px;
  background:rgba(0,0,0,.2);
  color:rgba(200,205,215,.9);
  font-size:.62rem;
}
.ascent-stat-group h4{
  margin:0 0 3px;
  color:rgba(232,201,106,.82);
  font-family:'Cinzel',serif;
  font-size:.52rem;
  letter-spacing:.08em;
  line-height:1.2;
  text-transform:uppercase;
}
.ascent-stat-group dl{
  display:grid;
  grid-template-columns:minmax(0, 1fr) max-content;
  gap:1px 8px;
  align-items:baseline;
  margin:0;
  font-size:.62rem;
}
.ascent-stat-group dt{
  min-width:0;
  color:rgba(200,205,215,.9);
  line-height:1.25;
}
.ascent-stat-group dd{
  margin:0;
  color:var(--text);
  font-variant-numeric:tabular-nums;
  font-weight:700;
  line-height:1.25;
  text-align:right;
}
@media (max-width:600px){
  .ascent-stats-strip{grid-template-columns:repeat(2, minmax(0, 1fr));}
  .ascent-stat-group:last-child{grid-column:1 / -1;}
}
.ascent-hblock-passive{min-width:min(200px, 55vw);max-width:360px;}
.ascent-panel-passive--inline{
  font-size:.65rem;
  line-height:1.35;
  color:var(--text-dim);
  margin:0;
}
.ascent-hblock-abilities{min-width:min(260px, 90vw);max-width:none;}
.ascent-stat-chip abbr{text-decoration:none;border-bottom:0;}
.ascent-stat-chip strong{color:var(--text);font-weight:700;}
.ascent-abilities-row{
  display:flex;
  flex-direction:row;
  flex-wrap:nowrap;
  gap:8px;
  overflow-x:auto;
  padding-bottom:2px;
  -webkit-overflow-scrolling:touch;
  scrollbar-color: rgba(200,180,140,.1) transparent;
  scrollbar-width:thin;
}
.ascent-abilities-row::-webkit-scrollbar{height:4px;}
.ascent-abilities-row::-webkit-scrollbar-thumb{background:transparent;}
.ascent-ability-card{
  flex:0 0 auto;
  width:min(168px, 48vw);
  padding:6px 8px;
  border-radius:8px;
  border:1px solid rgba(140,160,190,.22);
  background:rgba(14,20,28,.65);
  font-size:.62rem;
}
@media (max-width:1024px){
  .sfsel-profile__identity{
    grid-template-columns:64px minmax(0,1fr);
    align-items:start;
  }
  .sfsel-profile__portrait{min-height:64px;}
  .sfsel-profile__portrait .ascent-panel-portrait{width:56px;height:56px;}
  .sfsel-profile__details{grid-template-columns:minmax(0,1fr);}
  .sfsel-profile__skills{grid-column:auto;}
}
.select-hub-panel-head{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px 14px;
  margin-bottom:10px;
  padding-bottom:10px;
  border-bottom:1px solid rgba(120,100,70,.25);
}
.select-hub-panel-title{
  font-family:'Cinzel',serif;
  font-size:clamp(1rem, 2.8vw, 1.2rem);
  color:var(--gold-light);
  margin:0;
  letter-spacing:.06em;
}
.select-hub-return-btn{
  font:inherit;
  font-size:.75rem;
  letter-spacing:.04em;
  cursor:pointer;
  padding:8px 12px;
  border-radius:10px;
  border:1px solid rgba(120,100,70,.45);
  background:rgba(20,22,30,.6);
  color:rgba(230,224,210,.9);
  white-space:nowrap;
  transition:background .2s ease,border-color .2s ease,color .2s ease;
}
.select-hub-return-btn:hover{
  border-color:rgba(232,201,106,.5);
  color:#fff8e8;
  background:rgba(32,36,48,.75);
}
.select-hub-return-btn:focus-visible{outline:2px solid var(--gold);outline-offset:2px;}
.select-hub-confirm-btn{
  display:block;
  width:100%;
  margin-top:16px;
  padding:11px 16px;
  border:1px solid rgba(232,201,106,.72);
  border-radius:10px;
  background:linear-gradient(135deg,#c9a84c,#8f6d22);
  color:#090805;
  font-family:'Cinzel',serif;
  font-weight:700;
  letter-spacing:.05em;
  cursor:pointer;
}
.select-hub-confirm-btn:hover{filter:brightness(1.12);}
.select-hub-lead{
  margin:0 0 12px;
  font-size:.8rem;
  color:rgba(200,198,190,.75);
  line-height:1.4;
}
.select-hub-continue{margin-bottom:12px;}
.select-hub-panel .diff-picker{margin-bottom:0;}
.select-hub-panel .diff-desc{margin-bottom:0;max-width:100%;}
.splash-mode-row{margin:0 !important;justify-content:center !important;padding-top:4px;}
.splash-codex-btn{
  width:100%;
  white-space:normal;
  line-height:1.3;
  padding:9px 12px;
  font-size:.74rem;
  background:rgba(6,8,12,.52);
  backdrop-filter:blur(10px) saturate(1.05);
  -webkit-backdrop-filter:blur(10px) saturate(1.05);
  border:1px solid rgba(201,168,76,.42);
  border-radius:10px;
  color:rgba(230,220,200,.88);
  box-shadow:0 2px 10px rgba(0,0,0,.22);
}
.splash-codex-btn:hover{
  border-color:rgba(232,201,106,.72);
  color:#fffaf0;
  background:rgba(14,12,8,.62);
  box-shadow:0 4px 18px rgba(0,0,0,.28);
}
.splash-codex-btn:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:3px;
}
.splash-unlock{display:flex;flex-direction:column;gap:6px;margin-top:4px;}
.splash-unlock-label{font-size:.65rem;letter-spacing:.08em;text-transform:uppercase;color:rgba(180,175,165,.75);}
.splash-unlock-input{
  width:100%;
  box-sizing:border-box;
  background:rgba(10,8,4,.55);
  border:1px solid rgba(120,100,70,.45);
  border-radius:8px;
  color:var(--text-dim);
  font-size:.76rem;
  padding:8px 10px;
  outline:none;
  text-align:center;
  letter-spacing:.05em;
}
.splash-unlock-msg{font-size:.7rem;color:var(--text-dim);min-height:14px;}
.splash-erase-btn{
  margin-top:8px;
  width:100%;
  box-sizing:border-box;
  background:rgba(180,60,50,.15);
  border:1px solid rgba(200,90,80,.45);
  border-radius:8px;
  color:#e8a0a0;
  font-family:'Cinzel',serif;
  font-size:.72rem;
  letter-spacing:.06em;
  padding:8px 10px;
  cursor:pointer;
  transition:background .2s,border-color .2s;
}
.splash-erase-btn:hover{background:rgba(180,60,50,.28);border-color:rgba(220,110,100,.65);}
.splash-cache-btn{
  margin-top:6px;
  width:100%;
  box-sizing:border-box;
  background:rgba(201,168,76,.1);
  border:1px solid rgba(201,168,76,.35);
  border-radius:8px;
  color:var(--gold-light);
  font-family:'Cinzel',serif;
  font-size:.72rem;
  letter-spacing:.06em;
  padding:8px 10px;
  cursor:pointer;
  transition:background .2s,border-color .2s;
}
.splash-cache-btn:hover{background:rgba(201,168,76,.2);border-color:rgba(201,168,76,.55);}
.splash-continue-wrap{margin-top:0;padding-top:0;}
.splash-continue-wrap .sel-continue-row{margin-bottom:0;}
.splash-roster-hint{
  margin:0;
  text-align:center;
  font-size:.68rem;
  color:rgba(190,186,178,.55);
  font-style:italic;
}
.select-roster-deck{
  scroll-margin-top:16px;
  padding-top:12px;
  margin-top:8px;
  border-top:1px solid rgba(201,168,76,.18);
}
.select-hub-panel--door .select-roster-deck{
  border-top-color:rgba(201,168,76,.12);
  margin-top:4px;
  padding-top:10px;
}
.roster-deck-title{
  font-family:'Cinzel',serif;
  font-size:clamp(1rem, 3vw, 1.25rem);
  color:var(--gold-light);
  text-align:center;
  margin:8px 0 4px;
  text-shadow:0 2px 16px rgba(0,0,0,.85);
}
.select-roster-deck--focus > .roster-deck-head .roster-deck-title{
  text-align:left;
}
.roster-deck-sub{
  margin:0 0 12px;
  text-align:center;
  font-size:.8rem;
  color:rgba(210,204,192,.78);
  font-style:italic;
}
@media (max-width: 900px){
  .select-hub-panel-inner--wide{padding:14px 12px 16px;}
}
.sel-continue-info{
  color:var(--text-dim);
  font-size:.78rem;
  margin-top:6px;
  text-align:center;
}
.sel-bird-count{
  font-size:.7rem;
  color:var(--text-dim);
  font-style:italic;
}
.sel-highscores,.sel-run-history{
  max-width:none;
  margin-left:0;
  margin-right:0;
}
@media (max-width: 520px){
  .select-screen-bg{background-position:center 36%;}
}


/* ===== OPENING MENU ===== */
#screen-main{display:none;position:relative;min-height:72vh;border:1px solid rgba(201,168,76,.22);border-radius:18px;overflow:hidden;background:linear-gradient(180deg,#7ec9ff 0%,#b7e1ff 45%,#5a8f58 46%,#3d693c 100%);}
#screen-main.active{display:block;}
#screen-main::before{content:'';position:absolute;inset:0;background:
  radial-gradient(120px 55px at 16% 16%,rgba(255,255,255,.9) 0%,rgba(255,255,255,.4) 55%,transparent 58%),
  radial-gradient(150px 60px at 42% 22%,rgba(255,255,255,.85) 0%,rgba(255,255,255,.35) 52%,transparent 56%),
  radial-gradient(140px 56px at 76% 14%,rgba(255,255,255,.85) 0%,rgba(255,255,255,.35) 52%,transparent 56%),
  linear-gradient(180deg,transparent 0%,rgba(255,255,255,.15) 36%,transparent 60%);
  pointer-events:none;}
.main-mountains{position:absolute;left:0;right:0;bottom:24%;height:35%;background:linear-gradient(160deg,#6e7d90 0 28%,transparent 29%),linear-gradient(205deg,#556575 0 34%,transparent 35%),linear-gradient(150deg,#7c8d9e 0 30%,transparent 31%);opacity:.55;}
.main-trees{position:absolute;left:0;right:0;bottom:0;height:34%;background:repeating-linear-gradient(90deg,#2f572f 0 14px,#295029 14px 26px,#336133 26px 42px);} 
.main-menu-content{position:relative;z-index:2;text-align:center;padding-top:90px;}
.main-start-btn{margin-top:22px;padding:14px 36px;border:none;border-radius:999px;background:linear-gradient(135deg,#6a4e1a,var(--gold),#6a4e1a);font-family:'Cinzel',serif;font-size:1rem;font-weight:700;cursor:pointer;}
.main-start-btn:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(0,0,0,.25);}

/* ===== SELECTION ===== */
.sel-intro{text-align:center;margin-bottom:14px;}
.sel-intro h2{font-family:'Cinzel',serif;font-size:1.5rem;color:var(--gold-light);margin-bottom:6px;text-shadow:0 0 20px rgba(232,201,106,.4);}

/* DIFFICULTY PICKER */
.diff-picker{display:flex;gap:10px;justify-content:center;margin-bottom:20px;flex-wrap:wrap;}
.diff-btn{padding:8px 18px;border-radius:8px;border:2px solid rgba(80,70,50,.4);background:rgba(20,15,5,.7);color:var(--text-dim);font-family:'Cinzel',serif;font-size:.78rem;letter-spacing:.05em;cursor:pointer;transition:all .25s;display:flex;align-items:center;gap:6px;}
.diff-btn:hover{border-color:var(--gold);color:var(--gold);}
.diff-btn.active{color:#0a0c0f;font-weight:700;box-shadow:0 0 14px rgba(255,255,255,.2);}
.diff-btn.locked-diff{opacity:.45;cursor:not-allowed;filter:grayscale(0.5);}
.diff-btn.locked-diff:hover{border-color:rgba(80,70,50,.4);color:var(--text-dim);}
.diff-desc{text-align:center;font-size:.75rem;color:var(--text-dim);margin-bottom:16px;min-height:18px;font-style:italic;}

/* SELECTION LAYOUT */
.sel-layout{display:grid;grid-template-columns:1fr 280px;gap:18px;max-width:1100px;margin:0 auto;align-items:start;}
.sel-left{min-width:0;}
.sel-right{position:sticky;top:10px;}

/* VIEW TOGGLE */
.view-toggle{display:flex;flex-wrap:wrap;gap:0;justify-content:flex-start;border-radius:8px;overflow:visible;border:1px solid rgba(80,70,50,.4);width:100%;scrollbar-width:thin;}
.view-toggle-btn{padding:6px 18px;background:rgba(20,15,5,.7);color:var(--text-dim);font-size:.75rem;font-family:'Cinzel',serif;letter-spacing:.05em;cursor:pointer;border:none;transition:all .2s;flex:0 0 auto;white-space:nowrap;}
.view-toggle-btn.active{background:rgba(80,60,18,.95);color:var(--gold);}
.class-filter-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px;}
.class-filter-tab{padding:6px 10px;background:rgba(20,15,5,.72);border:1px solid rgba(201,168,76,.26);border-radius:8px;color:var(--text-dim);font-family:'Cinzel',serif;font-size:.68rem;letter-spacing:.04em;cursor:pointer;}
.class-filter-tab.active{background:rgba(80,60,18,.95);border-color:rgba(232,201,106,.7);color:var(--gold-light);}
.class-opt{padding:7px 10px;border-radius:8px;color:var(--text);font-size:.78rem;cursor:pointer;display:flex;justify-content:space-between;gap:8px;}
.class-opt:hover,.class-opt.active{background:rgba(201,168,76,.12);color:var(--gold-light);}

/* SIZE SECTION HEADERS */
.size-section{margin-bottom:6px;}
.size-header{display:flex;align-items:center;gap:10px;padding:6px 4px;margin-bottom:8px;border-bottom:1px solid rgba(201,168,76,.2);}
.size-header-title{font-family:'Cinzel',serif;font-size:.75rem;letter-spacing:.12em;color:var(--gold);text-transform:uppercase;opacity:.85;}
.size-header-line{flex:1;height:1px;background:rgba(201,168,76,.12);}
.size-birds-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;}

/* CLASS SECTION */
.class-section{margin-bottom:6px;}
.class-header{display:flex;align-items:center;gap:10px;padding:6px 4px;margin-bottom:8px;border-bottom:1px solid rgba(80,70,50,.3);}
.class-birds-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;}

/* CLASS BADGE on card */
.class-badge{display:inline-block;font-size:.62rem;padding:2px 7px;border-radius:10px;letter-spacing:.06em;margin-bottom:4px;font-weight:700;text-transform:uppercase;}
.class-striker{background:rgba(180,30,30,.25);color:#ff9090;border:1px solid rgba(180,30,30,.4);}
.class-singer{background:rgba(100,40,200,.25);color:#c090ff;border:1px solid rgba(100,40,200,.4);}
.class-trickster{background:rgba(200,120,20,.25);color:#ffc060;border:1px solid rgba(200,120,20,.4);}
.class-bruiser{background:rgba(60,100,200,.25);color:#90c0ff;border:1px solid rgba(60,100,200,.4);}
.class-tank{background:rgba(20,140,80,.25);color:#70e8a0;border:1px solid rgba(20,140,80,.4);}
.class-predator{background:rgba(220,80,160,.25);color:#ff90d0;border:1px solid rgba(220,80,160,.4);}
.class-tank{background:rgba(80,180,220,.25);color:#80e0ff;border:1px solid rgba(80,180,220,.4);}
.class-striker{background:rgba(180,30,30,.25);color:#ff9090;border:1px solid rgba(180,30,30,.4);}
.class-bruiser{background:rgba(60,100,200,.25);color:#90c0ff;border:1px solid rgba(60,100,200,.4);}
.class-trickster{background:rgba(200,120,20,.25);color:#ffc060;border:1px solid rgba(200,120,20,.4);}
.class-predator{background:rgba(220,80,160,.25);color:#ff90d0;border:1px solid rgba(220,80,160,.4);}
.class-knight{background:rgba(20,120,72,.28);color:#70e8a8;border:1px solid rgba(20,140,80,.45);}
.class-brute{background:rgba(150,72,36,.30);color:#ffb07a;border:1px solid rgba(190,92,46,.5);}
.class-rogue{background:rgba(180,50,30,.28);color:#ff9a7a;border:1px solid rgba(200,70,40,.45);}
.class-mage{background:rgba(90,50,180,.28);color:#c8a0ff;border:1px solid rgba(110,70,200,.45);}
.class-siren{background:rgba(40,120,160,.28);color:#90e0ff;border:1px solid rgba(60,150,200,.45);}
.class-inquisitor{background:rgba(160,120,40,.28);color:#ffe08a;border:1px solid rgba(180,140,50,.45);}
.class-bard{background:rgba(160,60,140,.28);color:#f0a8e8;border:1px solid rgba(180,80,160,.45);}


/* BIRD CARD compact */
.bird-card{background:rgba(52,40,16,.88);border:2px solid rgba(201,168,76,.35);border-radius:10px;padding:14px 12px;cursor:pointer;transition:all .25s;position:relative;}
.bird-card.bird-card--tier-grey{background:linear-gradient(180deg,rgba(106,120,144,.14),rgba(42,38,32,.9));border-color:rgba(106,120,144,.5);}
.bird-card.bird-card--tier-green{background:linear-gradient(180deg,rgba(76,138,106,.14),rgba(36,44,36,.9));border-color:rgba(76,138,106,.52);}
.bird-card.bird-card--tier-blue{background:linear-gradient(180deg,rgba(76,106,201,.14),rgba(34,38,52,.9));border-color:rgba(76,106,201,.52);}
.bird-card.bird-card--tier-purple{background:linear-gradient(180deg,rgba(120,76,180,.14),rgba(40,34,50,.9));border-color:rgba(120,76,180,.55);}
.bird-card.bird-card--tier-gold{background:linear-gradient(180deg,rgba(180,140,40,.16),rgba(48,40,24,.92));border-color:rgba(180,140,40,.58);}
.bird-card.bird-card--tier-orange{background:linear-gradient(180deg,rgba(200,100,40,.16),rgba(52,36,24,.92));border-color:rgba(200,100,40,.58);}
.bird-card:hover:not([class*="bird-card--tier-"]){transform:translateY(-2px);border-color:var(--gold);background:rgba(68,52,18,.95);box-shadow:0 4px 18px rgba(201,168,76,.2);}
.bird-card.bird-card--tier-grey:hover{transform:translateY(-2px);background:linear-gradient(180deg,rgba(106,120,144,.2),rgba(42,38,32,.94));border-color:var(--tier-grey);box-shadow:0 4px 18px rgba(106,120,144,.28);}
.bird-card.bird-card--tier-green:hover{transform:translateY(-2px);background:linear-gradient(180deg,rgba(76,138,106,.2),rgba(36,44,36,.94));border-color:var(--tier-green);box-shadow:0 4px 18px rgba(76,138,106,.28);}
.bird-card.bird-card--tier-blue:hover{transform:translateY(-2px);background:linear-gradient(180deg,rgba(76,106,201,.2),rgba(34,38,52,.94));border-color:var(--tier-blue);box-shadow:0 4px 18px rgba(76,106,201,.28);}
.bird-card.bird-card--tier-purple:hover{transform:translateY(-2px);background:linear-gradient(180deg,rgba(120,76,180,.2),rgba(40,34,50,.94));border-color:var(--tier-purple);box-shadow:0 4px 18px rgba(120,76,180,.28);}
.bird-card.bird-card--tier-gold:hover{transform:translateY(-2px);background:linear-gradient(180deg,rgba(180,140,40,.22),rgba(48,40,24,.95));border-color:var(--tier-gold);box-shadow:0 4px 18px rgba(201,168,76,.32);}
.bird-card.bird-card--tier-orange:hover{transform:translateY(-2px);background:linear-gradient(180deg,rgba(200,100,40,.22),rgba(52,36,24,.95));border-color:var(--tier-orange);box-shadow:0 4px 18px rgba(200,100,40,.32);}
.bird-card.selected:not([class*="bird-card--tier-"]){border-color:var(--gold-light);background:rgba(80,60,18,.98);box-shadow:0 0 22px rgba(232,201,106,.35);}
.bird-card.bird-card--tier-grey.selected{background:linear-gradient(180deg,rgba(106,120,144,.22),rgba(42,38,32,.95));border-color:#d8dde8;box-shadow:0 0 0 1px rgba(216,221,232,.35) inset,0 0 20px rgba(106,120,144,.35);}
.bird-card.bird-card--tier-green.selected{background:linear-gradient(180deg,rgba(76,138,106,.22),rgba(36,44,36,.95));border-color:#b8e8c8;box-shadow:0 0 0 1px rgba(184,232,200,.35) inset,0 0 20px rgba(76,138,106,.35);}
.bird-card.bird-card--tier-blue.selected{background:linear-gradient(180deg,rgba(76,106,201,.22),rgba(34,38,52,.95));border-color:#c8d4ff;box-shadow:0 0 0 1px rgba(200,212,255,.35) inset,0 0 20px rgba(76,106,201,.35);}
.bird-card.bird-card--tier-purple.selected{background:linear-gradient(180deg,rgba(120,76,180,.22),rgba(40,34,50,.95));border-color:#e0c8ff;box-shadow:0 0 0 1px rgba(224,200,255,.35) inset,0 0 20px rgba(120,76,180,.35);}
.bird-card.bird-card--tier-gold.selected{background:linear-gradient(180deg,rgba(180,140,40,.24),rgba(48,40,24,.96));border-color:#ffe8a0;box-shadow:0 0 0 1px rgba(255,232,160,.4) inset,0 0 22px rgba(201,168,76,.4);}
.bird-card.bird-card--tier-orange.selected{background:linear-gradient(180deg,rgba(200,100,40,.24),rgba(52,36,24,.96));border-color:#ffd0a8;box-shadow:0 0 0 1px rgba(255,208,168,.35) inset,0 0 22px rgba(200,100,40,.38);}
@keyframes bird-card-tier-up-flash{
  0%,100%{filter:brightness(1);box-shadow:0 0 0 rgba(255,255,255,0);}
  45%{filter:brightness(1.28);box-shadow:0 0 28px rgba(255,255,255,.22);}
}
.bird-card.bird-card--tier-up-flash{animation:bird-card-tier-up-flash .6s ease-out;}
.bird-card.bird-locked{opacity:.65;cursor:not-allowed;border-color:rgba(60,50,35,.4);}
.bird-card.bird-locked:hover{transform:none;box-shadow:none;border-color:rgba(60,50,35,.4);}
.bird-card.bird-locked .sprite4{filter:grayscale(1) brightness(0) contrast(1.1) !important; opacity:.92;}
.bird-card.bird-locked .sprite4{filter:grayscale(1) brightness(0) contrast(1.1) !important; opacity:.92;}

.bird-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;}
.bird-size-chip{font-size:.58rem;letter-spacing:.08em;color:var(--text-dim);text-transform:uppercase;border:1px solid rgba(201,168,76,.2);border-radius:999px;padding:2px 7px;background:rgba(201,168,76,.08);}
.stat-bars{display:grid;grid-template-columns:1fr 1fr;gap:4px 8px;}
.stat-row.compact{display:grid;grid-template-columns:46px 1fr auto;align-items:center;gap:6px;font-size:.72rem;}
.stat-row.compact .stat-lbl{width:auto;font-size:.58rem;letter-spacing:.04em;color:#c7ad73;}
.stat-row.compact .stat-bg{height:5px;}
.stat-row.compact .stat-val{width:auto;min-width:30px;font-size:.58rem;}

.lock-overlay{text-align:center;padding:5px 0 4px;}
.lock-icon{font-size:1.3rem;display:block;margin-bottom:3px;}

.ascent-btn{display:block;width:100%;padding:13px;font-family:'Cinzel',serif;font-size:1rem;letter-spacing:.1em;background:linear-gradient(135deg,#7a5c22,var(--gold),#7a5c22);color:#0a0c0f;border:none;border-radius:8px;cursor:pointer;font-weight:700;transition:all .3s;margin-bottom:10px;}
.ascent-btn:hover{transform:scale(1.03);box-shadow:0 0 18px rgba(201,168,76,.5);}
.ascent-empty{color:var(--text-dim);font-style:italic;font-size:.82rem;padding:30px 10px;opacity:.6;}
.ascent-abilities{display:flex;flex-wrap:wrap;gap:4px;justify-content:center;margin-bottom:10px;}
.ascent-ab-tag{font-size:.65rem;padding:2px 7px;background:rgba(201,168,76,.1);border:1px solid rgba(201,168,76,.2);border-radius:10px;color:var(--text-dim);}
.bird-nm{font-family:'Cinzel',serif;font-size:.95rem;color:var(--gold-light);text-align:center;margin-bottom:2px;text-shadow:0 1px 6px rgba(232,201,106,.25);}
.bird-tag{color:#bfa870;font-style:italic;font-size:.72rem;text-align:center;margin-bottom:8px;}
.bird-abs{margin-top:6px;padding-top:6px;border-top:1px solid var(--border);}
.bird-passive-preview{margin-top:6px;padding:4px 6px;background:rgba(122,76,201,.08);border:1px solid rgba(122,76,201,.2);border-radius:4px;font-size:.64rem;color:var(--purple-light);line-height:1.35;}
.bird-passive-preview span{color:var(--text-dim);font-style:italic;}
.start-btn{display:none;} /* hidden — replaced by ascent-btn */.lock-label{color:var(--text-dim);font-size:.76rem;font-style:italic;}
.bird-portrait{display:flex;align-items:center;justify-content:center;height:76px;margin-bottom:10px;}
.bird-portrait svg{height:90px;width:auto;image-rendering:pixelated;}
.bird-nm{font-family:'Cinzel',serif;font-size:1.2rem;color:var(--gold-light);text-align:center;margin-bottom:4px;text-shadow:0 1px 8px rgba(232,201,106,.3);}
.bird-tag{color:#bfa870;font-style:italic;font-size:.88rem;text-align:center;margin-bottom:12px;}
.stat-bars{display:grid;grid-template-columns:1fr 1fr;gap:4px 8px;}
.stat-row{display:flex;align-items:center;gap:6px;font-size:.83rem;}
.stat-lbl{width:44px;color:#b89a60;font-size:.74rem;flex-shrink:0;}
.stat-bg{flex:1;height:6px;background:rgba(201,168,76,.1);border-radius:3px;overflow:hidden;position:relative;}
.stat-fill{height:100%;border-radius:3px;transition:width .5s;}
.stat-val{width:28px;font-size:.72rem;color:var(--text-dim);text-align:right;flex-shrink:0;font-variant-numeric:tabular-nums;}
.bird-abs{margin-top:10px;padding-top:8px;border-top:1px solid var(--border);}
.bird-passive-preview{margin-top:8px;padding:5px 7px;background:rgba(122,76,201,.08);border:1px solid rgba(122,76,201,.25);border-radius:5px;font-size:.72rem;color:var(--purple-light);line-height:1.4;}
.bird-passive-preview span{color:var(--text-dim);font-style:italic;}
.ab-tag{display:inline-block;background:rgba(201,168,76,.1);border:1px solid rgba(201,168,76,.3);border-radius:4px;padding:2px 7px;margin:2px;font-size:.76rem;color:var(--gold);}
.start-btn{display:block;margin:24px auto 0;padding:13px 48px;font-family:'Cinzel',serif;font-size:1.05rem;letter-spacing:.1em;background:linear-gradient(135deg,#8a6c28,var(--gold),#8a6c28);color:#0a0c0f;border:none;border-radius:8px;cursor:pointer;transition:all .3s;font-weight:700;}
.start-btn:hover{transform:scale(1.05);box-shadow:0 0 20px rgba(201,168,76,.5);}
.start-btn:disabled{opacity:.4;cursor:not-allowed;transform:none;}

/* ===== BATTLE ===== */
.battle-layout{position:relative;z-index:1;display:grid;grid-template-rows:auto auto 1fr auto auto;gap:13px;}
#screen-battle .combatants{position:relative;z-index:2;}
#screen-battle .battle-below-combatants{position:relative;z-index:1;}
.battle-top{display:flex;justify-content:space-between;align-items:center;background:linear-gradient(180deg,rgba(3,6,3,.97),rgba(5,9,5,.95));border:1px solid rgba(200,160,32,.28);border-radius:10px;padding:10px 18px;gap:12px;flex-wrap:wrap;}
.level-badge{font-family:'Cinzel',serif;color:var(--gold);font-size:.88rem;letter-spacing:.08em;}

/* EXP BAR */
.exp-row{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:8px 16px;}
.exp-label{font-family:'Cinzel',serif;font-size:.78rem;color:var(--gold);white-space:nowrap;}
.exp-bg{flex:1;height:8px;background:var(--surface2);border-radius:4px;overflow:hidden;border:1px solid var(--border);}
.exp-fill{height:100%;border-radius:4px;background:linear-gradient(90deg,#8844dd,#aa66ff);transition:width .5s ease;}
.exp-txt{font-size:.78rem;color:var(--text-dim);white-space:nowrap;min-width:70px;text-align:right;}
.bird-lv{font-family:'Cinzel',serif;font-size:.85rem;color:var(--purple-light);white-space:nowrap;}

.combatants{display:grid;grid-template-columns:1fr auto 1fr;gap:14px;align-items:start;position:relative;direction:ltr;}
.combatant-panel{background:linear-gradient(180deg,rgba(5,12,5,.96),rgba(3,8,3,.97));border:1px solid rgba(200,160,32,.3);border-radius:14px;padding:14px 14px 12px;position:relative;overflow:visible;box-shadow:0 8px 22px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);}
.combatant-panel::before{content:"";position:absolute;left:10px;right:10px;top:0;height:2px;border-radius:2px;background:linear-gradient(90deg,rgba(255,255,255,0),rgba(201,168,76,.48),rgba(255,255,255,0));opacity:.8;}
.combatant-panel.player{border-color:rgba(80,160,80,.45);}
.combatant-panel.enemy{border-color:rgba(201,76,76,.45);}
.combatant-panel.boss-panel{border-color:rgba(201,168,76,.58);box-shadow:0 0 18px rgba(201,168,76,.15),0 10px 26px rgba(0,0,0,.42);}
.combatant-name{font-family:'Cinzel',serif;font-size:1.05rem;margin-bottom:3px;}
.player .combatant-name{color:var(--blue-light);}
.enemy  .combatant-name{color:var(--red-light);}
.boss-name{color:var(--gold)!important;}
.boss-crown{font-size:.8rem;color:var(--gold);margin-left:6px;}
.avatar-wrap{position:relative;display:flex;justify-content:center;align-items:center;margin:10px 0;height:132px;min-width:120px;}
.avatar-wrap::after{content:'';position:absolute;bottom:2px;left:20%;right:20%;height:2px;background:radial-gradient(ellipse at center,rgba(200,160,32,.35),transparent);border-radius:50%;}
.battle-ailment-symbol-layer{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:0;}
.battle-ailment-symbol-layer[hidden]{display:none!important;}
.battle-ailment-symbol{position:absolute;font-size:5.9rem;line-height:1;opacity:.5;filter:blur(.1px) drop-shadow(0 0 12px currentColor);transform:translate(-50%,-50%);left:50%;top:50%;font-family:"Apple Color Emoji","Segoe UI Emoji",serif;}
.battle-ailment-symbol--slot-1{transform:translate(-50%,-50%) rotate(-10deg) scale(.82);left:36%;top:54%;}
.battle-ailment-symbol--slot-2{transform:translate(-50%,-50%) rotate(10deg) scale(.82);left:64%;top:54%;}
.battle-ailment-symbol--slot-3{transform:translate(-50%,-50%) rotate(4deg) scale(.68);left:50%;top:36%;}
.battle-ailment-symbol--toxic{color:#6ae86a;}
.battle-ailment-symbol--burning{color:#ff8c40;}
.battle-ailment-symbol--weakness{color:#b990ff;}
.battle-ailment-symbol--chilled{color:#9fd0ff;}
.avatar-inner{display:flex;align-items:center;justify-content:center;font-size:3.8rem;line-height:1;animation:sprite-idle 3.2s ease-in-out infinite;position:relative;z-index:1;}
.avatar-inner svg{height:96px;width:auto;image-rendering:pixelated;}
@keyframes sprite-idle{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
.do-smash-r .avatar-inner,.do-smash-l .avatar-inner,.do-hit .avatar-inner{animation:none;}
.hp-bar-wrap{margin-bottom:9px;}
.hp-label{display:flex;justify-content:space-between;font-size:.8rem;color:var(--text-dim);margin-bottom:4px;font-weight:600;}
.hp-label span:last-child{font-family:'Cinzel',serif;letter-spacing:.03em;}
.hp-label .hp-delta-down{color:var(--red-light);text-shadow:0 0 10px rgba(201,76,76,.28);}
.hp-label .hp-delta-up{color:var(--green-light);text-shadow:0 0 10px rgba(76,180,76,.28);}
.hp-bar-bg{height:12px;background:linear-gradient(180deg,rgba(8,12,20,.92),rgba(20,26,40,.82));border-radius:8px;overflow:hidden;border:1px solid rgba(201,168,76,.22);position:relative;box-shadow:inset 0 0 8px rgba(0,0,0,.45);}
.prot-bar-temp{position:absolute;top:0;height:100%;border-radius:0 8px 8px 0;width:0;left:0;transition:width .35s ease,left .35s ease;pointer-events:none;z-index:2;opacity:0;}
.prot-bar-temp.active{opacity:1;}
.arm-bar-temp{background:linear-gradient(90deg,rgba(255,255,255,.55),rgba(255,255,255,.95));box-shadow:0 0 8px rgba(255,255,255,.35);}
.marm-bar-temp{background:linear-gradient(90deg,rgba(160,210,255,.55),rgba(220,240,255,.95));box-shadow:0 0 8px rgba(160,210,255,.4);}
.status-badge.shield,.status-badge.fortify{background:rgba(240,240,245,.12);border-color:rgba(255,255,255,.45);color:#f0f0f5;}
.status-badge.ward{background:rgba(140,190,240,.12);border-color:rgba(140,190,240,.5);color:#b8dcff;}
.hp-bar-bg::after{content:"";position:absolute;inset:1px;border-radius:6px;pointer-events:none;background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,0));}
.hp-bar-fill{height:100%;border-radius:8px;transition:width .35s ease, filter .3s ease;background:linear-gradient(90deg,#2f9e56,var(--green-light));box-shadow:0 0 12px rgba(76,180,76,.25);}
.hp-bar-fill.low{background:linear-gradient(90deg,#b53a3a,var(--red-light));box-shadow:0 0 12px rgba(201,76,76,.35);}
.hp-bar-fill.mid{background:linear-gradient(90deg,#c97a2a,#e8a040);box-shadow:0 0 10px rgba(232,160,64,.28);}
.hp-bar-fill.recent-hit{filter:brightness(1.18) saturate(1.25);}
.hp-bar-fill.recent-heal{filter:brightness(1.15) saturate(1.2);}
.status-effects{display:flex;flex-wrap:wrap;gap:3px;min-height:24px;margin-bottom:6px;margin-top:0;}
.combat-status-stack{display:flex;flex-direction:column;gap:4px;min-height:24px;margin-bottom:6px;margin-top:0;}
.combat-status-section{display:flex;flex-wrap:wrap;gap:3px;align-items:center;min-height:0;}
.combat-status-section:empty{display:none;}
.combat-status-ailments{order:1;}
.combat-status-modifiers{order:2;}
.status-badge--ailment{border-color:rgba(120,200,120,.55);}
.status-badge--buff,.status-badge.buffed,.status-badge.crit{background:rgba(232,201,106,.15);border-color:rgba(232,201,106,.55);color:#e8c96a;}
.status-badge--debuff{background:rgba(120,174,232,.12);border-color:rgba(120,174,232,.5);color:#78aee8;}
.status-badge--ailment:not(.poison):not(.burning):not(.bleed):not(.paralyzed):not(.confused):not(.slow){background:rgba(120,200,120,.12);border-color:rgba(120,200,120,.45);color:#78c878;}
.status-badge.crit::before{content:'CRT';}
.status-badge.buffed::before{content:'BUF';}
.status-badge{padding:1px 7px;border-radius:20px;font-size:.72rem;border:1px solid;display:inline-flex;align-items:center;gap:4px;}
.status-badge::before{font-size:.64rem;opacity:.9;letter-spacing:.03em;color:currentColor;}
.status-badge.poison::before{content:'PSN';}
.status-badge.burning::before{content:'BRN';}
.status-badge.bleed::before{content:'BLD';}
.status-badge.weaken::before{content:'WKN';}
.status-badge.paralyzed::before{content:'PAR';}
.status-badge.slow::before{content:'SLW';}
.status-badge.delayed::before{content:'RZN';}
.status-badge.confused::before{content:'CNF';}
.status-badge.feared::before{content:'FER';}
.status-badge.defending::before{content:'BLK';}
.status-badge.evading::before{content:'EVD';}
.status-badge{padding:1px 7px;border-radius:20px;font-size:.72rem;border:1px solid;display:inline-flex;align-items:center;gap:4px;}
.status-badge::before{font-size:.64rem;opacity:.9;letter-spacing:.03em;color:currentColor;}
.status-badge.poison::before{content:'PSN';}
.status-badge.burning::before{content:'BRN';}
.status-badge.bleed::before{content:'BLD';}
.status-badge.weaken::before{content:'WKN';}
.status-badge.paralyzed::before{content:'PAR';}
.status-badge.slow::before{content:'SLW';}
.status-badge.delayed::before{content:'RZN';}
.status-badge.confused::before{content:'CNF';}
.status-badge.feared::before{content:'FER';}
.status-badge.defending::before{content:'BLK';}
.status-badge.evading::before{content:'EVD';}
.status-badge.stunned{background:rgba(201,168,76,.15);border-color:var(--gold);color:var(--gold);}
.status-badge.confused{background:rgba(122,76,201,.15);border-color:var(--purple);color:var(--purple-light);}
.status-badge.feared{background:rgba(201,76,76,.15);border-color:var(--red);color:var(--red-light);}
.status-badge.defending{background:rgba(74,106,201,.15);border-color:var(--blue);color:var(--blue-light);}
.status-badge.guarded::before{content:'GRD';}
.status-badge.guarded{background:rgba(74,106,201,.18);border-color:rgba(106,138,232,.65);color:var(--blue-light);}
.story-cinematic-scroll{min-height:92px;max-height:170px;overflow:auto;white-space:pre-wrap;line-height:1.45;color:var(--text-dim);font-size:.9rem;}
.status-badge.roosting{background:rgba(76,138,106,.15);border-color:var(--green);color:var(--green-light);}
.status-badge.lullabied{background:rgba(122,76,201,.1);border-color:var(--purple);color:var(--purple-light);}
.status-badge.evading{background:rgba(74,106,201,.1);border-color:var(--blue);color:var(--blue-light);}
.status-badge.poison{background:rgba(76,180,76,.15);border-color:#4cb44c;color:#6ae86a;}
.status-badge.weaken{background:rgba(180,140,60,.15);border-color:#c9a840;color:#e8c840;}
.status-badge.paralyzed{background:rgba(200,200,60,.15);border-color:#c8c840;color:#e8e840;}
.status-badge.burning{background:rgba(220,100,30,.15);border-color:#dc641e;color:#ff8c40;}
.status-badge.bleed{background:rgba(190,56,76,.18);border-color:#be384c;color:#ff8396;}
.status-badge.bleed{background:rgba(190,56,76,.18);border-color:#be384c;color:#ff8396;}
.status-badge.delayed{background:rgba(200,80,200,.15);border-color:#c850c8;color:#e870e8;}
.status-badge.mud{background:rgba(139,90,43,.2);border-color:#8b5a2b;color:#c8a060;}
.status-badge.slow{background:rgba(120,170,220,.18);border-color:#78aee8;color:#9fd0ff;}
.stats-mini,.enemy-stats-mini{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;font-size:.76rem;margin-top:7px;padding-top:6px;border-top:1px solid rgba(201,168,76,.16);}
.stat-status-hint{grid-column:1/-1;font-size:.64rem;color:#a8b8cc;line-height:1.35;padding:5px 2px 1px;margin-top:3px;border-top:1px solid rgba(120,140,170,.22);opacity:.95;}
.stat-status-hint.est-hint{color:#d4b8b0;border-top-color:rgba(200,120,100,.22);}
.stat-mini,.est{color:var(--text-dim);display:flex;justify-content:space-between;align-items:center;padding:3px 6px;border:1px solid rgba(201,168,76,.16);border-radius:7px;background:rgba(7,10,16,.52);min-height:24px;}
.stat-k{font-weight:700;letter-spacing:.02em;opacity:.92;}
.stat-v{font-family:'Cinzel',serif;font-weight:700;color:var(--silver);}
.stat-trend{font-size:.9rem;margin-left:3px;font-weight:900;line-height:1;vertical-align:middle;}
.stat-trend.up{color:var(--red-light);}
.stat-trend.down{color:var(--purple-light);}
.stat-trend.beneficial{color:#8ee889;}
.stat-trend.harmful{color:#e87878;}
.stat-atk .stat-k,.stat-atk .stat-v{color:#ff6e6e;}
.stat-def .stat-k,.stat-def .stat-v{color:#7db4ff;}
.stat-dodge .stat-k,.stat-dodge .stat-v{color:#8fe8ff;}
.stat-matk .stat-k,.stat-matk .stat-v{color:#c995ff;}
.stat-mdef .stat-k,.stat-mdef .stat-v{color:#b88cff;}
.stat-mdodge .stat-k,.stat-mdodge .stat-v{color:#9fd1ff;}
.stat-acc .stat-k,.stat-acc .stat-v{color:#f3cf6d;}
.stat-spd .stat-k,.stat-spd .stat-v{color:#8ee889;}
.stat-cc .stat-k,.stat-cc .stat-v{color:#ffb880;}
.stat-cd .stat-k,.stat-cd .stat-v{color:#ffe08a;}
.stat-cd-bonus{font-size:.62em;color:var(--gold-light);margin-left:3px;font-family:system-ui,sans-serif;vertical-align:super;font-weight:700;}
.enemy-abilities-list{display:flex;flex-wrap:wrap;gap:3px;margin-top:4px;}
.enemy-ab-tag{background:rgba(201,76,76,.1);border:1px solid rgba(201,76,76,.3);border-radius:3px;padding:1px 6px;font-size:.69rem;color:var(--red-light);}
.enemy-intent{background:linear-gradient(180deg,rgba(201,76,76,.12),rgba(255,255,255,.04));border:1px solid rgba(201,76,76,.28);border-radius:8px;padding:7px 9px;font-size:.78rem;color:var(--text);margin-top:7px;text-align:left;}
.enemy-plan .intent-row{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:4px;}
.enemy-plan .intent-row--compact{margin-bottom:0;}
.enemy-plan .intent-name{color:var(--red-light);font-weight:700;}
.enemy-plan .intent-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.enemy-plan .intent-cost{color:var(--gold);font-size:.72rem;}
.enemy-plan .intent-ap{color:var(--gold-light);font-family:'Cinzel',serif;font-size:.72rem;}
.enemy-plan .intent-list{display:flex;flex-wrap:wrap;gap:4px;}
.enemy-plan .intent-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 6px;border-radius:999px;background:rgba(201,168,76,.08);border:1px solid rgba(201,168,76,.18);color:var(--text);font-size:.72rem;}
.enemy-plan .intent-chip.spent{opacity:.45;filter:saturate(.6);}
.enemy-plan .intent-chip.wait{opacity:.85;font-style:italic;}
.enemy-plan .intent-cost-sm{color:var(--gold);font-size:.68rem;}
.vs-separator{display:flex;align-items:center;justify-content:center;font-family:'Cinzel',serif;font-size:1.3rem;color:var(--text-dim);padding-top:55px;}
.bird-grid{width:100%;}
.shield-overlay{position:absolute;inset:-3px;border-radius:14px;border:2px solid transparent;pointer-events:none;transition:border-color .3s,box-shadow .3s;z-index:10;}
.shield-overlay.active{border-color:var(--blue-light);box-shadow:0 0 18px rgba(106,138,232,.35),inset 0 0 10px rgba(106,138,232,.08);}

/* ===== COMBAT ANIMATIONS ===== */
@keyframes smash-r{0%{transform:translateX(0) rotate(0) scale(1)}35%{transform:translateX(68px) rotate(10deg) scale(1.18)}60%{transform:translateX(62px) rotate(8deg) scale(1.15)}100%{transform:translateX(0) rotate(0) scale(1)}}
@keyframes smash-l{0%{transform:translateX(0) rotate(0) scale(1)}35%{transform:translateX(-68px) rotate(-10deg) scale(1.18)}60%{transform:translateX(-62px) rotate(-8deg) scale(1.15)}100%{transform:translateX(0) rotate(0) scale(1)}}
@keyframes hit-shake{0%{transform:translateX(0) scale(1)}12%{transform:translateX(-11px) scale(.95)}28%{transform:translateX(10px) scale(1.02)}44%{transform:translateX(-8px) scale(.97)}60%{transform:translateX(6px) scale(1.01)}76%{transform:translateX(-3px)}100%{transform:translateX(0) scale(1)}}
@keyframes dodge-r{0%{transform:translateX(0) rotate(0)}30%{transform:translateX(42px) rotate(15deg) scaleX(-1)}70%{transform:translateX(34px) rotate(12deg) scaleX(-1)}100%{transform:translateX(0) rotate(0) scaleX(1)}}
@keyframes dodge-r-flat{0%{transform:translateX(0) rotate(0)}30%{transform:translateX(42px) rotate(15deg)}70%{transform:translateX(34px) rotate(12deg)}100%{transform:translateX(0) rotate(0)}}
@keyframes dodge-l{0%{transform:translateX(0) rotate(0)}30%{transform:translateX(-42px) rotate(-15deg)}70%{transform:translateX(-34px) rotate(-12deg)}100%{transform:translateX(0) rotate(0)}}
@keyframes miss-r{0%{transform:translateX(0) rotate(0)}20%{transform:translateX(50px) rotate(12deg)}38%{transform:translateX(22px) rotate(-4deg)}55%{transform:translateX(40px) rotate(9deg)}72%{transform:translateX(12px) rotate(-2deg)}100%{transform:translateX(0) rotate(0)}}
@keyframes miss-l{0%{transform:translateX(0) rotate(0)}20%{transform:translateX(-50px) rotate(-12deg)}38%{transform:translateX(-22px) rotate(4deg)}55%{transform:translateX(-40px) rotate(-9deg)}72%{transform:translateX(-12px) rotate(2deg)}100%{transform:translateX(0) rotate(0)}}
@keyframes shield-glow{0%{transform:scale(1);filter:drop-shadow(0 0 0 #6a8ae8)}40%{transform:scale(1.07);filter:drop-shadow(0 0 16px #6a8ae8) drop-shadow(0 0 32px rgba(106,138,232,.55))}100%{transform:scale(1);filter:drop-shadow(0 0 2px rgba(106,138,232,.3))}}
@keyframes flash-r{0%{box-shadow:inset 0 0 0 rgba(201,76,76,0)}35%{box-shadow:inset 0 0 30px rgba(201,76,76,.35)}100%{box-shadow:inset 0 0 0 rgba(201,76,76,0)}}
@keyframes flash-b{0%{box-shadow:inset 0 0 0 rgba(74,106,201,0)}35%{box-shadow:inset 0 0 30px rgba(74,106,201,.35)}100%{box-shadow:inset 0 0 0 rgba(74,106,201,0)}}
@keyframes float-up{0%{opacity:1;transform:translateX(-50%) translateY(0) scale(1)}18%{transform:translateX(-50%) translateY(-12px) scale(1.25)}100%{opacity:0;transform:translateX(-50%) translateY(-58px) scale(.82)}}
@keyframes crit-pop{0%{opacity:1;transform:translateX(-50%) translateY(0) scale(1) rotate(-4deg)}18%{transform:translateX(-50%) translateY(-10px) scale(1.55) rotate(4deg)}100%{opacity:0;transform:translateX(-50%) translateY(-66px) scale(.88) rotate(2deg)}}
@keyframes miss-fade{0%{opacity:1;transform:translateX(-50%) translateY(0)}100%{opacity:0;transform:translateX(-50%) translateY(-42px)}}
@keyframes danger-pulse{0%,100%{box-shadow:inset 0 0 0 rgba(201,76,76,0)}50%{box-shadow:inset 0 0 22px rgba(201,76,76,.28),0 0 12px rgba(201,76,76,.15)}}
@keyframes boss-phase{0%{box-shadow:0 0 18px rgba(201,168,76,.15)}50%{box-shadow:0 0 36px rgba(201,76,76,.45),0 0 60px rgba(201,76,76,.15)}100%{box-shadow:0 0 18px rgba(201,168,76,.15)}}
@keyframes score-pop{0%{transform:scale(0.5) translateY(10px);opacity:0}70%{transform:scale(1.1) translateY(-2px);opacity:1}100%{transform:scale(1) translateY(0);opacity:1}}
.player-danger{animation:danger-pulse 1.1s ease-in-out infinite;}
.boss-phase-two{animation:boss-phase 1.8s ease-in-out infinite!important;}
/* High score badge */
.hs-badge{display:inline-block;background:linear-gradient(135deg,rgba(201,168,76,.2),rgba(232,201,106,.1));border:1px solid var(--gold);border-radius:20px;padding:3px 12px;font-family:'Cinzel',serif;font-size:.75rem;color:var(--gold);margin-top:8px;animation:score-pop .5s ease forwards;}
/* Kill feed — tiny floater label */
.fn-kill{color:#ffd700;font-size:1.4rem;animation:crit-pop 1.3s ease-out forwards;}
/* Phase warning banner */
.phase-banner{text-align:center;font-family:'Cinzel',serif;font-size:.8rem;color:var(--red-light);letter-spacing:.06em;padding:3px 0;margin-top:3px;opacity:0;transition:opacity .4s;}
.phase-banner.visible{opacity:1;}
@keyframes screen-shake{0%{transform:translate(0)}15%{transform:translate(-8px,3px)}30%{transform:translate(7px,-4px)}45%{transform:translate(-5px,5px)}60%{transform:translate(4px,-3px)}75%{transform:translate(-3px,2px)}100%{transform:translate(0)}}
@keyframes boss-slam{0%{transform:translate(0)}10%{transform:translate(-14px,6px) scale(1.02)}25%{transform:translate(12px,-8px)}40%{transform:translate(-8px,7px)}55%{transform:translate(6px,-4px)}70%{transform:translate(-4px,3px)}100%{transform:translate(0)}}
@keyframes reward-reveal{0%{opacity:0;transform:translateY(20px) scale(.96)}100%{opacity:1;transform:translateY(0) scale(1)}}
@keyframes badge-pop{0%{transform:scale(0) rotate(-12deg)}60%{transform:scale(1.18) rotate(4deg)}100%{transform:scale(1) rotate(0)}}
.do-screen-shake{animation:screen-shake .4s ease forwards;}
.do-screen-shake-heavy{animation:boss-slam .55s ease forwards;}
/* Stage progress bar */
.stage-progress-wrap{display:flex;align-items:center;gap:8px;margin-bottom:6px;}
.stage-progress-bg{flex:1;height:4px;background:rgba(201,168,76,.1);border-radius:2px;overflow:visible;position:relative;}
.stage-progress-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,var(--gold),var(--gold-light));transition:width .6s ease;}
.stage-progress-bosses{position:absolute;top:0;left:0;right:0;height:100%;pointer-events:none;}
.boss-pip{position:absolute;top:-3px;width:10px;height:10px;background:var(--red);border:1px solid var(--red-light);border-radius:50%;transform:translateX(-50%);font-size:0;}
/* Enemy info modal (click enemy portrait in combat) */
.enemy-info-popup{display:none;position:absolute;inset:0;z-index:200;align-items:center;justify-content:center;padding:12px;box-sizing:border-box;}
.enemy-info-popup.enemy-info-popup--open{display:flex;}
.enemy-info-popup-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55);cursor:pointer;}
.enemy-info-popup-panel{position:relative;z-index:1;max-width:420px;width:100%;max-height:min(88vh,640px);overflow:auto;padding:20px 22px 18px;border:1px solid rgba(200,160,32,.32);border-radius:10px;background:linear-gradient(145deg,#0a0e08,#141a12);box-shadow:0 12px 40px rgba(0,0,0,.45);font-family:'EB Garamond',Georgia,serif;color:#e8e0c0;}
.enemy-info-popup-close{position:absolute;top:6px;right:10px;background:none;border:none;color:#c8a040;font-size:22px;line-height:1;cursor:pointer;padding:4px 8px;}
.enemy-info-popup-close:hover{color:var(--gold-light);}
.enemy-info-popup-sprite{display:flex;justify-content:center;margin-bottom:10px;}
.enemy-info-popup-sprite .sprite4{width:80px;height:80px;}
.enemy-info-popup-header{font-family:'Cinzel',serif;font-size:1rem;color:var(--gold);margin-bottom:6px;text-align:center;}
.enemy-info-popup-meta{font-size:.88rem;color:var(--text-dim);line-height:1.45;margin-bottom:12px;text-align:center;}
.enemy-info-popup-abilities-h{font-family:'Cinzel',serif;font-size:.58rem;letter-spacing:.12em;text-transform:uppercase;color:var(--gold);margin-bottom:6px;}
.enemy-info-popup-abilities ul{list-style:none;padding:0;margin:0;}
.enemy-info-popup-abilities li{margin:8px 0;font-size:.88rem;line-height:1.35;color:var(--silver);}
.enemy-info-popup-abilities em{font-style:normal;opacity:.75;font-size:.82rem;}
.enemy-info-popup-section-h{font-family:'Cinzel',serif;font-size:.58rem;letter-spacing:.12em;text-transform:uppercase;color:var(--gold);margin:12px 0 6px;}
.enemy-info-popup-mutations,.enemy-info-popup-passive{margin-bottom:4px;}
.enemy-info-mut-row{display:flex;gap:8px;align-items:flex-start;margin:8px 0;padding:8px 8px 7px;border-radius:8px;border:1px solid rgba(201,168,76,.18);background:rgba(8,12,8,.45);font-size:.86rem;}
.enemy-info-eq-row{cursor:help;}
.enemy-info-eq-row:hover,.enemy-info-eq-row:focus-visible{border-color:rgba(201,168,76,.45);background:rgba(16,20,12,.65);outline:none;}
.enemy-info-mut-icon{flex-shrink:0;font-size:1rem;line-height:1.3;margin-top:2px;}
.enemy-info-mut-body{min-width:0;flex:1;}
.enemy-info-mut-slot{font-size:.68rem;letter-spacing:.04em;text-transform:uppercase;color:var(--text-dim);margin-bottom:2px;display:flex;flex-wrap:wrap;gap:4px;align-items:center;}
.enemy-info-mut-tier{font-size:.72rem;margin-bottom:2px;opacity:.9;}
.enemy-info-mut-name{font-weight:600;color:var(--silver);margin-bottom:4px;}
.enemy-info-mut-class{display:inline-block;font-size:.62rem;padding:1px 5px;border-radius:4px;border:1px solid rgba(201,168,76,.35);color:var(--gold-light);}
.enemy-info-mut-stats{margin:2px 0 4px;}
.enemy-info-mut-stats .mut-stat-line,.enemy-info-mut-stats .tt-row{text-align:left;font-size:.78rem;margin:1px 0;}
.enemy-info-mut-skills{margin:2px 0 4px;opacity:.92;}
.enemy-info-mut-skills .tt-row{font-size:.76rem;margin:1px 0;}
.enemy-info-mut-effect{font-size:.78rem;color:var(--silver);line-height:1.35;margin:3px 0 0;opacity:.92;}
.enemy-info-mut-effect--unique{color:var(--gold-light);}
.enemy-info-mut-effect--tradeoff{color:#e8a878;opacity:.95;}
.enemy-info-passive-name{font-size:.9rem;color:var(--gold-light);margin-bottom:4px;}
.enemy-info-passive-desc{font-size:.86rem;color:var(--silver);line-height:1.4;}
.enemy-info-empty{font-size:.84rem;color:var(--text-dim);margin:0;font-style:italic;}
.enc-preview-mut-stats{margin-top:2px;font-size:.72rem;}
.enc-preview-mut-stats .tt-row,.enc-preview-mut-stats .mut-stat-line{text-align:left;margin:1px 0;}
.combat-items-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-bottom:6px;padding-bottom:6px;border-bottom:1px solid rgba(120,140,170,.22);}
.combat-item-btn{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;min-width:0;width:100%;padding:5px 6px;border-radius:6px;border:1px solid rgba(74,130,180,.45);background:rgba(12,18,28,.75);color:var(--silver);font-family:'EB Garamond',Georgia,serif;font-size:.68rem;cursor:pointer;transition:border-color .15s,background .15s;text-align:left;}
.combat-item-btn:hover:not(:disabled){border-color:var(--blue-light);background:rgba(20,32,48,.9);}
.combat-item-btn:disabled{opacity:.45;cursor:not-allowed;}
.combat-item-main{display:flex;flex-direction:row;align-items:center;gap:4px;width:100%;min-width:0;}
.combat-item-icon{font-size:.9rem;line-height:1;flex-shrink:0;}
.combat-item-label{font-family:'Cinzel',serif;font-size:.62rem;color:var(--blue-light);line-height:1.2;min-width:0;}
.combat-item-meta{font-size:.52rem;color:var(--text-dim);line-height:1.2;padding-left:1px;}
.mut-stat-line{font-size:.82rem;line-height:1.45;margin:1px 0;text-align:center;}
.mut-stat-atk{color:#e87878;}
.mut-stat-matk{color:#e87878;}
.mut-stat-def{color:#78a8e8;}
.mut-stat-mdef{color:#78a8e8;}
.mut-stat-spd{color:#78c878;}
.mut-stat-acc{color:#d4b050;}
.mut-stat-dodge{color:#50c8d4;}
.mut-stat-crit{color:#b878e8;}
.mut-stat-hp{color:#c8a878;}
.mut-stat-ail{color:#e8a050;}
.mut-stat-misc{color:var(--text-dim);}
.tt-mut-stats .mut-stat-line{font-size:.84rem;text-align:left;}
.reward-card .reward-desc .mut-stat-line,
.shop-item .reward-desc .mut-stat-line{text-align:center;}
.mut-stat-delta{font-size:.72em;margin-left:.35em;font-weight:600;}
.mut-stat-delta-up{color:var(--green-light);}
.mut-stat-delta-down{color:var(--red-light);}
/* Encounter preview panel (standalone under stage graph) */
.encounter-preview-wrap{margin-bottom:8px;padding:8px 10px 6px;background:linear-gradient(180deg,rgba(8,14,8,.92),rgba(5,10,5,.88));border:1px solid rgba(201,168,76,.35);border-radius:10px;max-width:100%;box-shadow:0 4px 16px rgba(0,0,0,.32),inset 0 1px 0 rgba(255,255,255,.04);}
.encounter-preview-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:5px;}
.encounter-preview-title{font-family:'Cinzel',serif;font-size:.66rem;letter-spacing:.12em;text-transform:uppercase;color:var(--gold);opacity:.85;}
.encounter-preview-toggle{background:none;border:none;color:var(--gold);font-size:.72rem;cursor:pointer;padding:2px 6px;line-height:1;opacity:.7;transition:opacity .2s,transform .2s;}
.encounter-preview-toggle::after{content:'▾';}
.encounter-preview-toggle:hover{opacity:1;}
.encounter-preview-wrap.collapsed .encounter-preview-toggle::after{content:'▸';}
.encounter-preview-body{overflow:hidden;max-height:200px;opacity:1;transition:max-height .3s ease,opacity .2s ease,padding .2s ease;}
.encounter-preview-wrap.collapsed .encounter-preview-body{max-height:0;opacity:0;pointer-events:none;}
.encounter-preview-inner{display:flex;flex-wrap:wrap;gap:8px;align-items:stretch;justify-content:flex-start;}
.encounter-preview-inner.encounter-preview--single{justify-content:center;}
.enc-preview-empty{font-size:.72rem;color:var(--text-dim);padding:4px 2px;}
.enc-preview-card{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 150px;max-width:240px;padding:6px 9px;border-radius:8px;border:1px solid rgba(201,168,76,.22);background:rgba(12,10,18,.5);cursor:default;transition:border-color .15s,background .15s,box-shadow .15s;}
.enc-preview-card:hover,.enc-preview-card:focus-visible{border-color:rgba(201,168,76,.6);background:rgba(24,20,32,.7);box-shadow:0 0 8px rgba(201,168,76,.12);outline:none;}
.enc-preview-card--current{border-color:rgba(201,168,76,.58);box-shadow:0 0 0 2px rgba(201,168,76,.15),0 0 10px rgba(201,168,76,.08);}
.enc-preview-sprite{flex-shrink:0;width:42px;height:42px;display:flex;align-items:center;justify-content:center;font-size:1.7rem;line-height:1;overflow:hidden;border-radius:6px;background:rgba(0,0,0,.25);}
.enc-preview-sprite img{max-width:100%;max-height:100%;object-fit:contain;display:block;}
.enc-preview-emoji{font-size:1.5rem;line-height:1;}
.enc-preview-text{min-width:0;flex:1;}
.enc-preview-name{font-size:.8rem;font-weight:600;color:var(--silver);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.enc-preview-crown{font-size:.72rem;}
.enc-preview-sub{font-size:.67rem;color:var(--text-dim);margin-top:2px;white-space:nowrap;}
#action-tooltip:has(.enc-preview-tt){max-width:320px;min-width:220px;}
#action-tooltip .tt-desc:has(.enc-preview-tt){margin-top:0;padding-top:0;border-top:none;}
.enc-preview-tt{font-size:.78rem;color:var(--silver);line-height:1.35;}
.enc-preview-tt-head{display:flex;align-items:center;gap:6px;margin-bottom:6px;font-size:.84rem;}
.enc-preview-tt-head img{width:32px;height:32px;object-fit:contain;}
.enc-preview-tt-meta{font-size:.72rem;color:var(--text-dim);margin-bottom:8px;}
.enc-preview-tt-skills-h{font-family:'Cinzel',serif;font-size:.6rem;letter-spacing:.1em;text-transform:uppercase;color:var(--gold);margin-bottom:4px;}
.enc-preview-tt-ul{margin:0;padding-left:1.1em;color:var(--silver);font-size:.74rem;}
.enc-preview-tt-ul li{margin:2px 0;}
@media (max-width:720px){
  .enc-preview-card{flex:1 1 calc(50% - 8px);max-width:none;}
  .encounter-preview-inner.encounter-preview--single .enc-preview-card{flex:0 1 auto;max-width:260px;}
  .encounter-preview-toggle{display:inline-block;}
}
@media (min-width:721px){
  .encounter-preview-toggle{display:none;}
}
/* Battle summary toast */
.battle-summary{background:var(--surface);border:1px solid rgba(201,168,76,.4);border-radius:10px;padding:12px 18px;margin-bottom:10px;display:grid;grid-template-columns:repeat(4,1fr);gap:8px;text-align:center;animation:reward-reveal .4s ease;}
.bsum-val{font-family:'Cinzel',serif;font-size:1.1rem;color:var(--gold);}
.bsum-lbl{font-size:.72rem;color:var(--text-dim);margin-top:2px;}
/* Keyboard hints */
.kb-hint{position:absolute;bottom:3px;right:5px;font-size:.6rem;color:rgba(201,168,76,.4);font-family:'Cinzel',serif;pointer-events:none;}
/* Sound toggle button (SFX — battle top bar) */
.sound-btn{background:none;border:1px solid var(--border);border-radius:5px;color:var(--text-dim);padding:2px 6px;cursor:pointer;font-size:.62rem;line-height:1.2;min-width:0;transition:all .2s;}
.sound-btn:hover{border-color:var(--gold);color:var(--gold);}
/* Reward card reveal animation */
.reward-card{animation:reward-reveal .35s ease both;}
.reward-card:nth-child(2){animation-delay:.07s;}
.reward-card:nth-child(3){animation-delay:.14s;}
/* Victory stats */
.victory-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:18px 0;text-align:center;}
.vstat{background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:12px 8px;}
.vstat-val{font-family:'Cinzel',serif;font-size:1.3rem;color:var(--gold);}
.vstat-lbl{font-size:.74rem;color:var(--text-dim);margin-top:3px;}

.do-smash-r{animation:smash-r .52s cubic-bezier(.3,0,.2,1) forwards;}
.do-smash-l{animation:smash-l .52s cubic-bezier(.3,0,.2,1) forwards;}
.do-hit{animation:hit-shake .42s ease forwards;}
.do-dodge-r{animation:dodge-r .55s ease forwards;}
.do-dodge-r-flat{animation:dodge-r-flat .55s ease forwards;}
.do-dodge-l{animation:dodge-l .55s ease forwards;}
.do-miss-r{animation:miss-r .58s ease forwards;}
.do-miss-l{animation:miss-l .58s ease forwards;}
.do-shield{animation:shield-glow .65s ease forwards;}
.flash-red{animation:flash-r .5s ease forwards;}
.flash-blue{animation:flash-b .5s ease forwards;}

.float-number{position:absolute;left:50%;top:0;transform:translateX(-50%);font-family:'Cinzel',serif;font-weight:900;pointer-events:none;z-index:200;white-space:nowrap;text-shadow:0 2px 10px rgba(0,0,0,.9);display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;}
.float-icon{font-size:.95em;line-height:1;display:inline-flex;align-items:center;}
.float-text{line-height:1;}
.float-number.float-damage{background:rgba(90,12,12,.34);border:1px solid rgba(255,90,90,.38);}
.float-number.float-ailment{background:rgba(28,20,4,.46);border:1px solid rgba(201,168,76,.38);}
.float-number.float-buff{background:rgba(10,28,16,.42);border:1px solid rgba(106,184,154,.35);}
.fn-dmg{color:#ff5252;font-size:1.95rem;animation:float-up 1.08s ease-out forwards;}
.fn-magic{color:var(--purple-light);font-size:1.95rem;animation:float-up 1.08s ease-out forwards;}
.fn-buff-trend{color:var(--red-light);font-size:1.35rem;font-weight:900;animation:float-up 1.05s ease-out forwards;}
.fn-debuff-trend{color:var(--purple-light);font-size:1.35rem;font-weight:900;animation:float-up 1.05s ease-out forwards;}
.float-number.float-magic{background:rgba(40,12,60,.34);border:1px solid rgba(201,149,255,.38);}
.float-number.float-buff-trend{background:rgba(40,12,12,.28);border:1px solid rgba(255,100,100,.35);}
.float-number.float-debuff-trend{background:rgba(40,12,60,.28);border:1px solid rgba(201,149,255,.35);}
.fn-crit{color:#ffd700;font-size:2.35rem;animation:crit-pop 1.1s ease-out forwards;}
.fn-miss{color:#8a9bb5;font-size:1.15rem;font-style:italic;animation:miss-fade .95s ease-out forwards;}
.fn-heal{color:#6ab89a;font-size:1.55rem;animation:float-up 1.05s ease-out forwards;}
.fn-dodge{color:#6a8ae8;font-size:1.2rem;font-style:italic;animation:miss-fade .9s ease-out forwards;}
.fn-status{color:#e8c96a;font-size:1.08rem;animation:miss-fade 1.2s ease-out forwards;}
.fn-poison{color:#6ae86a;font-size:1.2rem;animation:float-up .95s ease-out forwards;}
.fn-burn{color:#ff8c40;font-size:1.2rem;animation:float-up .95s ease-out forwards;}
.fn-exp{color:#aa66ff;font-size:1.25rem;animation:float-up 1.2s ease-out forwards;}

/* ===== LOG ===== */

.battle-caption{position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);padding:10px 18px;border:1px solid rgba(201,168,76,.5);border-radius:10px;background:rgba(10,14,22,.85);font-family:'Cinzel',serif;font-weight:700;letter-spacing:.08em;color:var(--gold-light);opacity:0;pointer-events:none;z-index:220;transition:opacity .28s ease;}
.battle-caption.show{opacity:1;}

.battle-log{background:linear-gradient(180deg,rgba(3,7,3,.96),rgba(2,5,2,.98));border:1px solid rgba(200,160,32,.18);border-radius:12px;padding:12px 14px;height:124px;overflow-y:auto;font-size:.88rem;line-height:1.6;box-shadow:inset 0 1px 0 rgba(255,255,255,.04);}
.battle-log::-webkit-scrollbar{width:4px;}
.battle-log::-webkit-scrollbar-track{background:var(--scrollbar-track);}
.battle-log::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:2px;}
.battle-log:hover::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb-hover);}
.log-entry{margin-bottom:1px;}
.log-entry.player-action{color:var(--blue-light);}
.log-entry.enemy-action{color:var(--red-light);}
.log-entry.system{color:var(--gold);font-style:italic;}
.log-entry.crit{color:var(--gold-light);font-weight:bold;}
.log-entry.miss{color:var(--text-dim);font-style:italic;}
.log-entry.dodge{color:#8aa8e8;font-style:italic;}
.log-entry.poison-tick{color:#6ae86a;}
.log-entry.burn-tick{color:#ff8c40;}
.log-entry.exp-gain{color:#aa66ff;font-style:italic;}
.log-entry.boss{color:var(--gold);font-weight:bold;}

/* ===== ACTIONS ===== */
.action-panel{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:10px 12px;}
.action-panel h3{font-family:'Cinzel',serif;font-size:.72rem;color:var(--text-dim);letter-spacing:.1em;margin-bottom:7px;}
.actions-grid{display:flex;flex-wrap:wrap;gap:6px;}
.energy-orbs{display:flex;gap:5px;align-items:center;justify-content:flex-start;margin-bottom:6px;}
.energy-orb{width:14px;height:14px;border-radius:50%;border:1px solid var(--border);box-shadow:inset 0 0 6px rgba(0,0,0,.35);}
.energy-orb.full{background:rgba(74,106,201,.65);border-color:rgba(74,106,201,.9);}
.energy-orb.empty{background:rgba(40,45,58,.5);opacity:.55;}
.energy-text{font-size:.7rem;color:var(--text-dim);margin-left:2px;}
.action-btn{padding:6px 10px;border-radius:8px;border:1px solid rgba(200,160,32,.28);background:rgba(5,10,5,.85);color:var(--text);cursor:pointer;font-family:'Crimson Pro',serif;font-size:.84rem;transition:all .2s;display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:96px;position:relative;}
.action-btn:hover:not(:disabled){border-color:var(--gold);background:rgba(200,160,32,.12);transform:translateY(-2px);}
.action-btn:disabled{opacity:.35;cursor:not-allowed;}
.btn-name{font-weight:bold;font-size:.95rem;line-height:1.15;}
.btn-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 8px;width:100%;}
.btn-meta{display:inline-flex;flex-wrap:wrap;align-items:center;gap:4px 6px;flex-shrink:0;}
.btn-type-chip{font-size:.62rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;padding:1px 6px;border-radius:999px;border:1px solid rgba(255,255,255,.12);background:rgba(0,0,0,.25);}
.btn-type-chip--physical{color:var(--red-light);border-color:rgba(255,140,112,.35);}
.btn-type-chip--spell{color:var(--purple-light);border-color:rgba(201,160,255,.35);}
.btn-type-chip--ranged{color:var(--orange-light);border-color:rgba(255,180,100,.35);}
.btn-type-chip--utility{color:var(--green-light);border-color:rgba(120,200,120,.35);}
.btn-type-chip--hybrid{color:#e8a0ff;border-color:rgba(255,140,112,.28);background:linear-gradient(135deg,rgba(255,140,112,.12),rgba(201,160,255,.12));}
.float-offset-left{margin-left:-18px;}
.float-offset-right{margin-left:18px;}
.btn-en-chip{font-size:.68rem;color:var(--gold);font-weight:600;white-space:nowrap;}
.btn-dmg-row{width:100%;margin-top:2px;}
.btn-desc-full{font-size:.68rem;color:#b8c7d8;line-height:1.35;margin:4px 0 0;width:100%;display:block;}
.btn-desc-lines{display:flex;flex-direction:column;gap:1px;width:100%;}
.btn-desc-line{font-size:.62rem;color:#b8c7d8;line-height:1.25;}
.nest-ab-desc.btn-desc-lines .btn-desc-line{font-size:.58rem;}
.btn-type{font-size:.69rem;}
.btn-cost{font-size:.72rem;color:var(--text-dim);}
.btn-dmg-est{font-size:.68rem;color:var(--gold);opacity:.92;line-height:1.2;white-space:nowrap;}
.btn-dmg-hybrid{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center;font-size:.62rem;line-height:1.25;max-width:100%;}
.btn-dmg-atk{color:#ff8c70;font-weight:600;white-space:nowrap;}
.btn-dmg-matk{color:#c9a0ff;font-weight:600;white-space:nowrap;}
.btn-stat-preview{display:block;font-size:.6rem;color:#92a8bc;line-height:1.25;margin-top:3px;opacity:.94;}
body.ui-mobile-mode #screen-battle .btn-dmg-est{font-size:.6rem;}
.action-btn.physical .btn-type{color:var(--red-light);}
.action-btn.spell .btn-type{color:var(--purple-light);}
.action-btn.ranged .btn-type{color:var(--orange-light);}
.action-btn.utility .btn-type{color:var(--green-light);}

.stat-hp{color:#6ae86a}.stat-atk{color:#ff8c70}.stat-def{color:#90c0ff}.stat-spd{color:#ffd36a}.stat-dodge{color:#b0f0ff}.stat-acc{color:#e8e0a0}.stat-crit{color:#f0a0ff}.stat-magic{color:#6ae8e8}
.action-btn.endturn-mini{min-height:auto;padding:4px 9px;min-width:auto;font-size:.62rem;line-height:1.15;border-width:1px;border-radius:6px;background:rgba(40,45,58,.9);justify-content:center;align-items:center;}
.actions-grid-footer{grid-column:1/-1;width:100%;flex-basis:100%;margin-top:8px;padding-top:10px;border-top:1px solid rgba(120,140,170,.22);display:flex;justify-content:center;align-items:center;}
.actions-grid-footer .end-turn-bar__btn{min-width:0;padding:3px 8px;font-size:.58rem;}
.ab-lv-badge{position:absolute;top:4px;right:6px;font-size:.65rem;font-family:'Cinzel',serif;color:var(--gold);}

/* Ailment icons on buttons */
.ailment-icons{display:flex;gap:3px;margin-top:2px;}
.ail-dot{width:8px;height:8px;border-radius:50%;}
.ail-dot.poison{background:#4cb44c;}
.ail-dot.toxic{background:#2d8a2d;}
.ail-dot.weaken{background:#c9a840;}
.ail-dot.paralyzed{background:#c8c840;}
.ail-dot.burning{background:#dc641e;}
.ail-dot.scorched{background:#ff4500;}
.ail-dot.chilled{background:#7fd6ff;}
.ail-dot.frozen{background:#a8d8ff;}
.ail-dot.bleed{background:#be384c;}
.ail-dot.delayed{background:#c850c8;}
.ail-dot.blinded{background:#888888;}
.ail-dot.marked{background:#e8c040;}
.ail-dot.decreed{background:#6f88c2;}

.combat-stats-btn{margin-top:7px;width:100%;padding:6px 10px;border:1px solid rgba(201,168,76,.28);border-radius:8px;background:rgba(9,12,18,.55);color:var(--text-dim);font-family:'Cinzel',serif;font-size:.72rem;letter-spacing:.05em;cursor:pointer;transition:background .15s,border-color .15s,color .15s;}
.combat-stats-btn:hover,.combat-stats-btn:focus-visible{background:rgba(201,168,76,.12);border-color:rgba(201,168,76,.45);color:var(--gold);outline:none;}

.combat-stats-modal{display:none;position:absolute;inset:0;z-index:210;align-items:center;justify-content:center;padding:12px;box-sizing:border-box;}
.combat-stats-modal.combat-stats-modal--open{display:flex;}
.combat-stats-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55);cursor:pointer;}
.combat-stats-modal-panel{position:relative;z-index:1;max-width:420px;width:100%;max-height:min(88vh,640px);display:flex;flex-direction:column;padding:18px 20px 16px;border:1px solid rgba(200,160,32,.32);border-radius:10px;background:linear-gradient(145deg,#0a0e08,#141a12);box-shadow:0 12px 40px rgba(0,0,0,.45);font-family:'EB Garamond',Georgia,serif;color:#e8e0c0;}
.combat-stats-modal-close{position:absolute;top:6px;right:10px;background:none;border:none;color:#c8a040;font-size:22px;line-height:1;cursor:pointer;padding:4px 8px;z-index:2;}
.combat-stats-modal-close:hover{color:var(--gold-light);}
#combat-stats-modal-body{overflow-y:auto;flex:1;min-height:0;padding-right:4px;}
.combat-stats-modal-title{font-family:'Cinzel',serif;font-size:.95rem;color:var(--gold);margin:0 0 12px;text-align:center;}
.combat-details-section{margin-bottom:14px;}
.combat-details-section-h{font-family:'Cinzel',serif;font-size:.58rem;letter-spacing:.12em;text-transform:uppercase;color:var(--gold);margin:0 0 8px;}
.combat-details-stat-block{margin-bottom:8px;}
.combat-details-stat-name{font-size:.78rem;color:var(--gold);font-family:'Cinzel',serif;margin-bottom:3px;}
.combat-details-mod-list,.combat-details-status-list{list-style:none;padding:0;margin:0;}
.combat-details-mod-list li,.combat-details-status-list li{font-size:.84rem;line-height:1.4;color:var(--silver);margin:3px 0;padding-left:10px;border-left:2px solid rgba(201,168,76,.2);}
.combat-details-empty{font-size:.84rem;color:var(--text-dim);font-style:italic;margin:0;}
.combat-details-perk{margin-bottom:10px;padding:8px 10px;border:1px solid rgba(201,168,76,.15);border-radius:8px;background:rgba(7,10,16,.35);}
.combat-details-perk-name{font-family:'Cinzel',serif;font-size:.82rem;color:var(--gold);}
.combat-details-perk-type{font-size:.68rem;color:var(--text-dim);letter-spacing:.06em;text-transform:uppercase;margin-left:6px;}
.combat-details-perk-trigger{font-size:.78rem;color:var(--text-dim);margin-top:4px;}
.combat-details-perk-desc{font-size:.84rem;color:var(--silver);margin-top:4px;line-height:1.4;}
.combat-details-status-group{margin-bottom:8px;}
.combat-details-status-cat{font-size:.72rem;color:var(--gold);font-family:'Cinzel',serif;margin-bottom:4px;}
.combat-details-status-name{display:block;font-weight:600;color:var(--silver);}
.combat-details-status-detail{display:block;font-size:.78rem;color:var(--text-dim);margin-top:2px;}
.combat-stats-modal .stats-mini,.combat-stats-modal .enemy-stats-mini{gap:5px 6px;}
.combat-stats-modal .stat-mini,.combat-stats-modal .est{padding:4px 8px;min-height:26px;background:rgba(7,10,16,.42);border:1px solid rgba(201,168,76,.14);border-radius:8px;}

/* Combat layout scale vars (rules at end of file) */
#screen-battle{
  --combat-avatar-scale:100;
  --combat-combatants-scale:100;
  --combat-action-scale:100;
  --combat-log-scale:100;
}

/* Mobile battle layout mode (accessibility setting) */
body.ui-mobile-mode #screen-battle .battle-layout{display:flex;flex-direction:column;gap:8px;}
body.ui-mobile-mode #screen-battle .combatants{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:stretch;min-height:clamp(160px,32vh,280px);}
/* Keep player on the left, enemy on the right (same as desktop) */
body.ui-mobile-mode #screen-battle #player-panel{order:0;}
body.ui-mobile-mode #screen-battle #enemy-panel{order:1;}
body.ui-mobile-mode #screen-battle .vs-separator{display:none;}
body.ui-mobile-mode #screen-battle .combatant-panel{border-radius:10px;}
body.ui-mobile-mode #screen-battle .combatant-name{min-height:2.1em;}
body.ui-mobile-mode #screen-battle .avatar-wrap{margin:0;}
body.ui-mobile-mode #screen-battle .hp-bar-bg{height:8px;}
body.ui-mobile-mode #screen-battle .hp-label{font-size:.66rem;margin-bottom:2px;}
body.ui-mobile-mode #screen-battle .status-effects{gap:3px;margin-top:4px;}
body.ui-mobile-mode #screen-battle .status-badge{font-size:.62rem;padding:1px 5px;}
body.ui-mobile-mode #screen-battle .enemy-abilities-list,
body.ui-mobile-mode #screen-battle .enemy-intent{display:none;}
body.ui-mobile-mode #screen-battle .combat-stats-btn{padding:4px 6px;font-size:.62rem;}
body.ui-mobile-mode #screen-battle .action-panel h3{margin-bottom:4px;font-size:.63rem;}
body.ui-mobile-mode #screen-battle .actions-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
body.ui-mobile-mode #screen-battle .action-btn{min-width:0;width:100%;}
body.ui-mobile-mode #screen-battle .btn-name{font-size:.8rem;}
body.ui-mobile-mode #screen-battle .btn-type,
body.ui-mobile-mode #screen-battle .btn-cost{font-size:.62rem;}
body.ui-mobile-mode #screen-battle .energy-orb{width:10px;height:10px;}
body.ui-mobile-mode #screen-battle .energy-free-chip{width:10px;height:10px;min-width:10px;min-height:10px;}
body.ui-mobile-mode #screen-battle .energy-text{font-size:.62rem;}
body.ui-mobile-mode #screen-battle .combat-items-row{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;}
body.ui-mobile-mode #screen-battle .combat-item-btn{padding:4px 5px;font-size:.6rem;}
body.ui-mobile-mode #screen-battle .combat-item-label{font-size:.56rem;}
body.ui-mobile-mode #screen-battle .combat-item-meta{font-size:.48rem;}
body.ui-mobile-mode #screen-battle .battle-log{padding:8px 9px;}
body.ui-mobile-mode #screen-battle .battle-log-toggle{font-size:.7rem;padding:6px 9px;}
body.ui-mobile-mode #screen-battle .battle-top{padding:7px 9px;}
body.ui-mobile-mode #screen-battle .bird-lv,
body.ui-mobile-mode #screen-battle .level-badge{font-size:.7rem;}

/* ===== REWARD SCREEN ===== */
#screen-reward.active{
  position:fixed;
  inset:0;
  z-index:25;
  overflow-y:auto;
  background:var(--bg);
  padding:max(16px,env(safe-area-inset-top,0px)) 20px max(16px,env(safe-area-inset-bottom,0px));
  box-sizing:border-box;
}
.reward-screen-inner{max-width:920px;margin:0 auto;text-align:center;min-height:min(100%,calc(100dvh - 32px));display:flex;flex-direction:column;justify-content:center;gap:10px;}
.reward-heading{padding:18px 20px 14px;border:1px solid rgba(201,168,76,.28);border-radius:16px;background:radial-gradient(circle at 50% 0,rgba(201,168,76,.16),transparent 68%),rgba(16,18,24,.72);}
.reward-kicker{font-family:'Cinzel',serif;font-size:.68rem;letter-spacing:.24em;text-transform:uppercase;color:var(--text-dim);margin-bottom:3px;}
.reward-screen-inner h2{font-family:'Cinzel',serif;font-size:1.9rem;color:var(--gold);margin-bottom:6px;}
.reward-heading #reward-sub{color:var(--text-dim);margin:0;}
.reward-utility{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--text-dim);font-size:.74rem;padding:0 4px;}
.reward-continue{position:sticky;bottom:0;padding:4px 0 8px;background:linear-gradient(180deg,transparent,var(--bg) 36%);z-index:3;}
.reward-tabs{display:flex;gap:10px;justify-content:center;margin:16px 0;}
.reward-tab{padding:8px 20px;border-radius:20px;border:1px solid var(--border);background:var(--surface2);cursor:pointer;font-family:'Cinzel',serif;font-size:.82rem;transition:all .2s;letter-spacing:.06em;}
.reward-tab.active{background:rgba(201,168,76,.15);border-color:var(--gold);color:var(--gold);}
.nest-reward-scene{display:flex;flex-direction:column;align-items:center;min-height:180px;margin:0 auto;padding:14px 18px 10px;max-width:760px;width:100%;border-radius:16px;background:rgba(255,255,255,.025);border:1px solid rgba(255,255,255,.06);}
.reward-nest{display:block;margin:0 auto;font-size:4.2rem;line-height:1;background:transparent;border:none;cursor:default;filter:drop-shadow(0 6px 14px rgba(0,0,0,.35));transition:transform .2s ease;position:relative;z-index:2;}
.reward-nest.nest-shakeable{cursor:pointer;}
.reward-nest.nest-shakeable:hover{transform:scale(1.06);}
.reward-nest.nest-shaking{animation:nest-shake .48s ease;}
@keyframes nest-shake{0%,100%{transform:rotate(0) translateY(0)}15%{transform:rotate(-8deg) translateY(-4px)}30%{transform:rotate(7deg) translateY(2px)}45%{transform:rotate(-6deg) translateY(-2px)}60%{transform:rotate(5deg) translateY(1px)}75%{transform:rotate(-3deg) translateY(-1px)}}
.nest-shake-hint{font-size:.82rem;color:var(--text-dim);margin:8px 0 10px;text-align:center;}
.nest-reward-tray{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;width:100%;margin-top:4px;min-height:0;}
.nest-reward-tray:empty{display:none;}
.nest-reward-card{opacity:0;transform:translateY(-28px);animation:nest-reward-fall .55s cubic-bezier(.22,1,.24,1) forwards;background:var(--surface);border:2px solid var(--border);border-radius:12px;padding:14px 12px;text-align:center;position:relative;overflow:hidden;}
.nest-reward-card.tier-grey{border-color:rgba(106,120,144,.4);background:linear-gradient(180deg,rgba(106,120,144,.10),var(--surface));}
.nest-reward-card.tier-green{border-color:rgba(76,138,106,.4);background:linear-gradient(180deg,rgba(76,138,106,.10),var(--surface));}
.nest-reward-card.tier-blue{border-color:rgba(74,106,201,.4);background:linear-gradient(180deg,rgba(74,106,201,.10),var(--surface));}
.nest-reward-card.tier-purple{border-color:rgba(122,76,201,.4);background:linear-gradient(180deg,rgba(122,76,201,.10),var(--surface));}
.nest-reward-card.tier-gold{border-color:rgba(201,168,76,.6);background:linear-gradient(180deg,rgba(201,168,76,.12),var(--surface));box-shadow:0 0 16px rgba(201,168,76,.18);}
.nest-reward-card.tier-orange{border-color:rgba(232,120,48,.65);background:linear-gradient(180deg,rgba(232,120,48,.14),var(--surface));box-shadow:0 0 18px rgba(232,120,48,.22);}
.nest-reward-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;}
.nest-reward-card.tier-grey::before{background:var(--tier-grey);}
.nest-reward-card.tier-green::before{background:var(--tier-green);}
.nest-reward-card.tier-blue::before{background:var(--tier-blue);}
.nest-reward-card.tier-purple::before{background:var(--tier-purple);}
.nest-reward-card.tier-gold::before{background:linear-gradient(90deg,var(--gold),var(--gold-light),var(--gold));}
.nest-reward-card.tier-orange::before{background:linear-gradient(90deg,var(--tier-orange),#ffb080,var(--tier-orange));}
@keyframes nest-reward-fall{0%{opacity:0;transform:translateY(-28px)}100%{opacity:1;transform:translateY(0)}}
.nest-reward-card .reward-tier-label{font-size:.68rem;letter-spacing:.1em;font-family:'Cinzel',serif;margin-bottom:6px;text-transform:uppercase;}
.nest-reward-card .reward-icon{font-size:2rem;display:block;margin-bottom:6px;}
.nest-reward-card .reward-name{font-family:'Cinzel',serif;font-size:.88rem;color:var(--gold-light);margin-bottom:4px;}
.nest-reward-card .reward-desc{font-size:.72rem;color:var(--text-dim);line-height:1.35;}
.nest-reward-footnote{font-size:.72rem;color:var(--text-dim);margin:10px 0 4px;text-align:center;font-style:italic;opacity:.9;}
.reward-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:4px;}
.reward-card{background:var(--surface);border:2px solid var(--border);border-radius:12px;padding:18px 14px;cursor:pointer;transition:all .3s;position:relative;overflow:hidden;}
.reward-card:hover{transform:translateY(-3px);box-shadow:0 8px 24px rgba(0,0,0,.4);}
.reward-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;}
.reward-card.tier-grey::before{background:var(--tier-grey);}
.reward-card.tier-green::before{background:var(--tier-green);}
.reward-card.tier-blue::before{background:var(--tier-blue);}
.reward-card.tier-purple::before{background:var(--tier-purple);}
.reward-card.tier-gold::before{background:linear-gradient(90deg,var(--gold),var(--gold-light),var(--gold));}
.reward-card.tier-grey{border-color:rgba(106,120,144,.4);background:linear-gradient(180deg,rgba(106,120,144,.10),var(--surface));}
.reward-card.tier-green{border-color:rgba(76,138,106,.4);background:linear-gradient(180deg,rgba(76,138,106,.10),var(--surface));}
.reward-card.tier-blue{border-color:rgba(74,106,201,.4);background:linear-gradient(180deg,rgba(74,106,201,.10),var(--surface));}
.reward-card.tier-purple{border-color:rgba(122,76,201,.4);background:linear-gradient(180deg,rgba(122,76,201,.10),var(--surface));}
.reward-card.tier-gold{border-color:rgba(201,168,76,.6);box-shadow:0 0 20px rgba(201,168,76,.2);background:linear-gradient(180deg,rgba(201,168,76,.12),var(--surface));}
.reward-card.tier-orange{border-color:rgba(232,120,48,.65);box-shadow:0 0 22px rgba(232,120,48,.24);background:linear-gradient(180deg,rgba(232,120,48,.14),var(--surface));}
.reward-card:hover.tier-grey{border-color:var(--tier-grey);}
.reward-card:hover.tier-green{border-color:var(--tier-green);}
.reward-card:hover.tier-blue{border-color:var(--tier-blue);}
.reward-card:hover.tier-purple{border-color:var(--tier-purple);}
.reward-card:hover.tier-gold{border-color:var(--tier-gold);}
.reward-card:hover.tier-orange{border-color:var(--tier-orange);}
.reward-tier-label{font-size:.7rem;letter-spacing:.12em;font-family:'Cinzel',serif;margin-bottom:8px;text-transform:uppercase;}
.tier-grey .reward-tier-label{color:var(--tier-grey);}
.tier-green .reward-tier-label{color:var(--tier-green);}
.tier-blue .reward-tier-label{color:var(--tier-blue);}
.tier-purple .reward-tier-label{color:var(--tier-purple);}
.tier-gold .reward-tier-label{color:var(--tier-gold);}
.tier-orange .reward-tier-label{color:var(--tier-orange);}
.reward-icon{font-size:2.2rem;margin-bottom:8px;display:block;}
.reward-name{font-family:'Cinzel',serif;font-size:.95rem;margin-bottom:5px;}
.tier-grey .reward-name{color:var(--tier-grey);}
.tier-green .reward-name{color:var(--tier-green);}
.tier-blue .reward-name{color:var(--tier-blue);}
.tier-purple .reward-name{color:var(--tier-purple);}
.tier-gold .reward-name{color:var(--tier-gold);}
.reward-desc{font-size:.82rem;color:var(--text-dim);line-height:1.5;}
.reward-class-row{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center;margin-top:12px;}
.reward-tag{font-size:.68rem;letter-spacing:.08em;text-transform:uppercase;padding:3px 7px;border-radius:999px;border:1px solid rgba(201,168,76,.28);background:rgba(255,255,255,.04);color:var(--text-dim);}
.reward-card-class-perk{background:linear-gradient(180deg,rgba(38,20,56,.96),rgba(20,12,34,.96));border-color:rgba(180,108,255,.55);box-shadow:0 0 24px rgba(148,90,255,.18);}
.reward-card-class-perk::before{background:linear-gradient(90deg,#8e5cff,#d3a4ff);}

/* Skill upgrade cards */
.skill-upgrade-card{background:var(--surface);border:2px solid rgba(122,76,201,.4);border-radius:12px;padding:18px 14px;cursor:pointer;transition:all .3s;}
.skill-upgrade-card:hover{border-color:var(--purple);transform:translateY(-3px);box-shadow:0 8px 24px rgba(122,76,201,.25);}
.skill-upgrade-card .su-name{font-family:'Cinzel',serif;font-size:1rem;color:var(--purple-light);margin-bottom:5px;}
.skill-upgrade-card .su-lv{font-size:.75rem;color:var(--text-dim);margin-bottom:8px;}
.skill-upgrade-card .su-effect{font-size:.83rem;color:var(--text);line-height:1.5;}

/* ===== LEVEL-UP SCREEN ===== */
.levelup-screen-inner{max-width:800px;margin:0 auto;text-align:center;}
.levelup-screen-inner h2{font-family:'Cinzel',serif;font-size:2.2rem;color:var(--purple-light);margin-bottom:6px;}
.levelup-sub{color:var(--text-dim);font-style:italic;margin-bottom:20px;}
.levelup-choice-row{display:flex;gap:16px;justify-content:center;margin-bottom:24px;}
.levelup-choice-btn{padding:12px 28px;border-radius:10px;border:1px solid;cursor:pointer;font-family:'Cinzel',serif;font-size:.9rem;letter-spacing:.06em;transition:all .3s;}
.levelup-choice-btn.upgrade-skill{background:rgba(122,76,201,.12);border-color:var(--purple);color:var(--purple-light);}
.levelup-choice-btn.new-cards{background:rgba(74,106,201,.12);border-color:var(--blue);color:var(--blue-light);}
.levelup-choice-btn:hover{transform:scale(1.04);}
.levelup-panel{display:none;}
.levelup-panel.active{display:block;}
.lu-feather-remaining{font-family:'Cinzel',serif;font-size:.95rem;color:var(--gold-light);margin:0 0 14px;letter-spacing:.04em;}
.lu-feather-remaining:empty{display:none;}
#lu-skill-grid.lu-feather-grid{display:flex;flex-direction:column;gap:10px;max-width:640px;margin:0 auto;text-align:left;}
.lu-feather-row{display:flex;align-items:center;justify-content:space-between;gap:12px;background:rgba(28,22,14,.72);border:1px solid rgba(201,168,76,.28);border-radius:10px;padding:10px 14px;}
.lu-feather-info{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1;}
.lu-feather-name{font-family:'Cinzel',serif;font-size:.82rem;color:var(--gold);letter-spacing:.05em;}
.lu-feather-desc{font-size:.74rem;color:var(--text-dim);line-height:1.35;}
.lu-feather-stepper{display:flex;align-items:center;gap:8px;flex-shrink:0;}
.lu-feather-count{min-width:1.5rem;text-align:center;font-family:'Cinzel',serif;font-size:1rem;color:var(--text-bright);}
.lu-feather-btn{width:36px;height:36px;padding:0;border-radius:8px;border:1px solid rgba(201,168,76,.45);background:linear-gradient(145deg,rgba(55,48,32,.95),rgba(35,30,22,.98));color:var(--gold-light);font-size:1.25rem;line-height:1;cursor:pointer;font-weight:700;transition:transform .12s ease,border-color .12s,opacity .12s;}
.lu-feather-btn:hover:not(:disabled){border-color:var(--gold);transform:scale(1.05);}
.lu-feather-btn:disabled{opacity:.35;cursor:not-allowed;}
.skill-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;max-width:600px;margin:0 auto;}
.new-card-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;max-width:600px;margin:0 auto;}

/* ===== GAMEOVER ===== */
.gameover-inner{text-align:center;max-width:500px;margin:60px auto;}
.gameover-inner h2{font-family:'Cinzel',serif;font-size:3rem;margin-bottom:16px;}
.gameover-inner.win h2{color:var(--gold);}
.gameover-inner.lose h2{color:var(--red-light);}

@media(max-width:760px){
  .sel-layout{grid-template-columns:1fr;}
  .sel-right{position:static;}
  .size-birds-row,.class-birds-row{grid-template-columns:repeat(2,1fr);}
}
@media(max-width:460px){
  .size-birds-row,.class-birds-row{grid-template-columns:1fr;}
  .combatants{grid-template-columns:1fr;}
  .vs-separator{display:none;}
  .reward-grid{grid-template-columns:1fr;}
  .nest-reward-tray{grid-template-columns:1fr;}
  .skill-grid,.new-card-grid{grid-template-columns:1fr;}
  header h1{font-size:1.8rem;}
}
/* ===== CONFIRM BUTTON ===== */
.confirm-btn{display:none;margin:18px auto 0;padding:12px 40px;font-family:'Cinzel',serif;font-size:1rem;letter-spacing:.08em;background:linear-gradient(135deg,#6a4e1a,var(--gold),#6a4e1a);color:#0a0c0f;border:none;border-radius:8px;cursor:pointer;transition:all .3s;font-weight:700;}
.confirm-btn:hover{transform:scale(1.05);box-shadow:0 0 18px rgba(201,168,76,.5);}
.confirm-btn.visible{display:block;}
.lu-confirm-row{text-align:center;margin-top:16px;}
/* ===== SELECTION STATES ===== */
.reward-card.selected{outline:3px solid var(--gold);transform:translateY(-4px);box-shadow:0 10px 28px rgba(201,168,76,.35) !important;}
.skill-upgrade-card.selected{border-color:var(--purple) !important;background:rgba(122,76,201,.12);transform:translateY(-3px);box-shadow:0 8px 24px rgba(122,76,201,.3);}
/* ===== ENDLESS / SELECTION EXTRAS ===== */
.endless-row{text-align:center;margin:14px 0 0;color:#b89a60;font-size:.9rem;}
.endless-row label{cursor:pointer;display:inline-flex;align-items:center;gap:8px;}
.endless-row input[type=checkbox]{width:16px;height:16px;accent-color:var(--gold);}
.mode-toggle{display:inline-flex;border:1px solid rgba(201,168,76,.35);border-radius:10px;overflow:hidden;background:rgba(12,10,5,.65);}
.mode-toggle-btn{padding:7px 16px;border:none;background:transparent;color:var(--text-dim);font-family:'Cinzel',serif;font-size:.76rem;letter-spacing:.06em;cursor:pointer;transition:all .2s;}
.mode-toggle-btn.active{background:linear-gradient(135deg,rgba(201,168,76,.25),rgba(201,168,76,.12));color:var(--gold-light);}
#lu-stat-preview{margin:8px auto 0;max-width:760px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;}
.lu-stat-row{display:flex;justify-content:space-between;align-items:center;background:rgba(10,12,18,.5);border:1px solid rgba(201,168,76,.2);border-radius:7px;padding:5px 8px;font-size:.78rem;color:var(--text-dim);}
.lu-stat-row .v-new{color:var(--green-light);font-weight:700;}
.lu-stat-row .v-old{color:var(--silver);}
.lu-stat-arrow{color:var(--green-light);font-weight:900;margin:0 5px;}

/* ===== ACTION TOOLTIP ===== */
#action-tooltip{position:fixed;background:var(--surface);border:1px solid var(--gold);border-radius:10px;padding:12px 15px;z-index:9999;pointer-events:none;max-width:240px;min-width:170px;font-size:.83rem;line-height:1.5;box-shadow:0 6px 28px rgba(0,0,0,.7);display:none;}
#action-tooltip.is-touch-open{pointer-events:auto;max-width:min(92vw,320px);}
body.ui-desktop-mode #action-tooltip:not(.is-touch-open){
  max-width:260px;
  min-width:140px;
  padding:8px 10px;
  font-size:.76rem;
  line-height:1.4;
}
body.ui-desktop-mode #action-tooltip:not(.is-touch-open) .tt-row{margin-bottom:2px;}
body.ui-desktop-mode #action-tooltip:not(.is-touch-open) .tt-desc{font-size:.74rem;max-height:none;}
body.ui-desktop-mode #action-tooltip:not(.is-touch-open) .tt-name{font-size:.84rem;}
body.ui-desktop-mode #action-tooltip:not(.is-touch-open) .tt-type{font-size:.66rem;margin-bottom:5px;padding-bottom:4px;}
.tt-name{font-family:'Cinzel',serif;color:var(--gold);font-size:.92rem;margin-bottom:1px;}
.tt-type{color:var(--text-dim);font-size:.7rem;letter-spacing:.1em;text-transform:uppercase;margin-bottom:7px;padding-bottom:5px;border-bottom:1px solid var(--border);}
.tt-row{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:3px;}
.tt-lbl{color:var(--text-dim);font-size:.8rem;}.tt-val{color:var(--text);font-weight:bold;font-size:.83rem;}
.tt-hit-great{color:#6ab89a;}.tt-hit-good{color:#e8c96a;}.tt-hit-bad{color:#e87070;}
.tt-dmg-atk{color:#ff8c70;font-weight:600;}
.tt-dmg-matk{color:#c9a0ff;font-weight:600;}
.tt-desc{color:var(--silver);font-size:.79rem;margin-top:5px;padding-top:5px;border-top:1px solid var(--border);line-height:1.45;}
.tt-divider{border-top:1px solid var(--border);margin:6px 0;}
.tt-ail-row{display:flex;justify-content:space-between;font-size:.79rem;margin-bottom:1px;}
.tt-ail-pct{font-weight:bold;margin-left:4px;}.tt-ail-desc{color:var(--text-dim);font-size:.75rem;margin-bottom:4px;}
/* ===== LEVEL-UP ABILITIES PANEL ===== */
.ability-card-outer{max-width:480px;margin:0 auto 14px;}

/* ===== NEST / INVENTORY MODAL ===== */
.nest-btn{background:rgba(201,168,76,.1);border:1px solid rgba(201,168,76,.4);border-radius:8px;padding:6px 12px;cursor:pointer;color:var(--gold);font-family:"Cinzel",serif;font-size:.8rem;letter-spacing:.06em;transition:all .2s;}
.nest-btn:hover{background:rgba(201,168,76,.2);transform:scale(1.05);}
/* Overworld iframe embed: hide chrome until nest modal opens (script adds class in <head>). */
html.avian-ow-ui-embed #app > *:not(#nest-modal):not(#settings-modal):not(#ref-guide-modal):not(#abandon-modal){display:none!important;}
html.avian-ow-ui-embed--nest #app > *:not(#nest-modal){display:none!important;}
html.avian-ow-ui-embed--settings #app > *:not(#settings-modal):not(#abandon-modal){display:none!important;}
html.avian-ow-ui-embed--reference #app > *:not(#ref-guide-modal){display:none!important;}
html.avian-ow-nest-embed #app > *:not(#nest-modal){display:none!important;}
html.avian-ow-ui-embed #app,html.avian-ow-nest-embed #app{min-height:100vh;background:#0a0c0f;}
html.avian-ow-ui-embed #action-tooltip,html.avian-ow-nest-embed #action-tooltip{z-index:99999;}
html.avian-ow-ui-embed--settings #settings-modal.open,
html.avian-ow-ui-embed--settings #abandon-modal.open,
html.avian-ow-ui-embed--reference #ref-guide-modal.open{display:flex!important;}
html.avian-ow-ui-embed--nest .nest-close,
html.avian-ow-nest-embed .nest-close{display:none!important;}

#nest-modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.82);z-index:8000;align-items:flex-start;justify-content:center;padding:20px;overflow-y:auto;}
#nest-modal.open{display:flex;}
.nest-inner{background:var(--surface);border:1px solid rgba(201,168,76,.4);border-radius:16px;max-width:min(96vw,960px);width:100%;padding:28px 30px;position:relative;margin:auto;max-height:min(92vh,920px);overflow-y:auto;}
.nest-inner h2{font-family:"Cinzel",serif;color:var(--gold);font-size:1.4rem;margin-bottom:4px;text-align:center;}
.nest-subtitle{color:var(--text-dim);font-size:.82rem;text-align:center;margin-bottom:18px;}
.nest-tabs{position:sticky;top:-28px;z-index:5;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:0 0 20px;padding:10px 0;background:linear-gradient(180deg,var(--surface) 75%,transparent);}
.nest-tabs button{min-height:40px;padding:8px 10px;border:1px solid var(--border);border-radius:9px;background:var(--surface2);color:var(--text-dim);font:600 .72rem 'Cinzel',serif;letter-spacing:.04em;cursor:pointer;transition:border-color .15s,background .15s,color .15s;}
.nest-tabs button:hover{border-color:rgba(201,168,76,.55);color:var(--text);}
.nest-tabs button.active{border-color:var(--gold);background:rgba(201,168,76,.14);color:var(--gold-light);box-shadow:inset 0 -2px 0 var(--gold);}
[data-nest-panel][hidden]{display:none!important;}
@media(max-width:600px){
  .nest-inner{padding:22px 14px;}
  .nest-tabs{top:-22px;grid-template-columns:repeat(2,minmax(0,1fr));}
}
.nest-close{position:absolute;top:14px;right:16px;background:none;border:none;color:var(--text-dim);font-size:1.4rem;cursor:pointer;line-height:1;}
.nest-close:hover{color:var(--gold);}
.nest-mutate-modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:8100;align-items:center;justify-content:center;padding:16px;}
.nest-mutate-modal.open{display:flex;}
.nest-mutate-inner{background:var(--surface);border:1px solid rgba(201,168,76,.55);border-radius:14px;max-width:min(92vw,920px);width:100%;padding:22px 24px 18px;position:relative;max-height:min(85vh,720px);overflow-y:auto;box-shadow:0 12px 40px rgba(0,0,0,.45);}
.nest-mutate-close{position:absolute;top:10px;right:12px;background:none;border:none;color:var(--text-dim);font-size:1.25rem;cursor:pointer;line-height:1;}
.nest-mutate-close:hover{color:var(--gold);}
.nest-mutate-title{font-family:"Cinzel",serif;color:var(--gold);font-size:1.1rem;margin:0 0 6px;text-align:center;}
.nest-mutate-sub{color:var(--text-dim);font-size:.82rem;text-align:center;margin:0 0 14px;}
.nest-mutate-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px;width:100%;}
.nest-mutate-grid .skill-upgrade-card{cursor:pointer;}
@media (max-width:640px){
  .nest-mutate-grid{grid-template-columns:1fr;}
}
.nest-mutate-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;}
.nest-section{margin-bottom:20px;}
.nest-section-title{font-family:"Cinzel",serif;font-size:.78rem;letter-spacing:.12em;color:var(--text-dim);margin-bottom:10px;padding-bottom:6px;border-bottom:1px solid var(--border);text-transform:uppercase;}
.nest-stats-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:6px;}
.nest-stat-card{background:var(--surface2);border:1px solid var(--border);border-radius:7px;padding:6px 7px;text-align:center;}
.nest-stat-val{font-family:"Cinzel",serif;font-size:.96rem;color:var(--gold);line-height:1.2;}
.nest-stat-lbl{font-size:.62rem;color:var(--text-dim);margin-top:1px;}
.nest-abilities-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;}
.nest-ab-card{background:var(--surface2);border:1px solid var(--border);border-radius:10px;padding:12px;}
.nest-ab-name{font-family:"Cinzel",serif;font-size:.9rem;margin-bottom:3px;}
.nest-ab-name.physical{color:var(--red-light);}
.nest-ab-name.spell{color:var(--purple-light);}
.nest-ab-name.utility{color:var(--green-light);}
.nest-ab-lv{font-size:.72rem;color:var(--gold);margin-bottom:5px;}
.nest-ab-desc{font-size:.78rem;color:var(--text-dim);line-height:1.4;}
.nest-rewards-list{display:flex;flex-direction:column;gap:6px;}
.nest-reward-row{display:flex;align-items:center;gap:10px;background:var(--surface2);border-radius:8px;padding:8px 12px;font-size:.83rem;}
.nest-reward-icon{font-size:1.2rem;}
.nest-reward-name{flex:1;font-weight:bold;}
.nest-reward-desc{color:var(--text-dim);font-size:.78rem;}
.nest-passive{background:rgba(201,168,76,.08);border:1px solid rgba(201,168,76,.3);border-radius:8px;padding:10px 14px;margin-bottom:14px;font-size:.82rem;}
.nest-passive-title{font-family:"Cinzel",serif;color:var(--gold);font-size:.78rem;letter-spacing:.1em;margin-bottom:4px;}
.nest-ledger-section{background:rgba(201,168,76,.06);border:1px solid rgba(201,168,76,.22);border-radius:12px;padding:12px 14px;}
.nest-ledger-note{font-size:.72rem;color:var(--text-dim);line-height:1.45;margin:0 0 10px;}
.nest-ledger-subtitle{font-family:"Cinzel",serif;font-size:.68rem;letter-spacing:.08em;color:var(--gold-light);margin:10px 0 6px;text-transform:uppercase;}
.nest-ledger-subtitle:first-of-type{margin-top:0;}
.nest-ledger-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 12px;}
.nest-ledger-row{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-size:.8rem;padding:4px 8px;background:var(--surface2);border-radius:6px;border:1px solid var(--border);}
.nest-ledger-k{color:var(--text-dim);font-weight:600;}
.nest-ledger-v{color:#6ab89a;font-family:"Cinzel",serif;font-weight:700;}
.nest-ledger-mech-block{display:flex;flex-direction:column;gap:4px;}
.nest-ledger-mech{font-size:.78rem;color:var(--silver);padding:4px 0;border-bottom:1px solid rgba(255,255,255,.06);}
.nest-ledger-mech:last-child{border-bottom:none;}
.nest-crit-bonus{font-size:.75em;color:var(--gold-light);font-weight:600;}

/* Nest mutations / equipment */
.nest-equip-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:10px;}
.nest-equip-grid-all{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));}
.nest-equip-slot{background:var(--surface2);border:1px dashed rgba(201,168,76,.35);border-radius:10px;padding:10px;min-height:96px;cursor:pointer;transition:all .15s;text-align:center;display:flex;flex-direction:column;align-items:center;}
.nest-equip-slot:hover{border-color:var(--gold);background:rgba(201,168,76,.08);}
.nest-equip-locked .nest-equip-slot.is-locked,
.nest-equip-locked .nest-inv-item.is-locked{cursor:not-allowed;opacity:.62;filter:saturate(.65);}
.nest-equip-locked .nest-equip-slot.is-locked:hover,
.nest-equip-locked .nest-inv-item.is-locked:hover{border-color:var(--border);background:var(--surface2);transform:none;}
.nest-lock-note{font-size:.76rem;line-height:1.4;color:var(--gold-light);background:rgba(201,168,76,.08);border:1px solid rgba(201,168,76,.22);border-radius:10px;padding:8px 10px;margin:0 0 10px;text-align:center;}
.nest-equip-slot.filled{border-style:solid;border-color:rgba(201,168,76,.5);}
.nest-equip-slot-lbl{font-size:.62rem;color:var(--text-dim);letter-spacing:.06em;text-transform:uppercase;margin-bottom:4px;}
.nest-equip-slot-name{font-size:.72rem;color:var(--gold);line-height:1.25;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;}
.nest-equip-action{display:inline-block;margin-top:auto;padding:4px 9px;border-radius:999px;background:rgba(106,184,154,.14);border:1px solid rgba(106,184,154,.35);color:#9ed9c4;font:600 .62rem 'Cinzel',serif;letter-spacing:.04em;}
.nest-equip-action--remove{background:rgba(201,76,76,.1);border-color:rgba(201,76,76,.32);color:var(--red-light);}
.nest-equip-mut-stats{margin-top:4px;font-size:.62rem;}
.nest-equip-mut-stats .mut-stat-compact{text-align:center;line-height:1.3;}
.nest-equip-slot.tier-white{border-color:rgba(200,200,200,.4);}
.nest-equip-slot.tier-green{border-color:rgba(106,184,154,.5);}
.nest-equip-slot.tier-blue{border-color:rgba(106,168,232,.5);}
.nest-equip-slot.tier-purple{border-color:rgba(168,106,232,.5);}
.nest-equip-slot.tier-gold{border-color:rgba(201,168,76,.7);}
.nest-equip-slot.tier-orange{border-color:rgba(232,120,48,.75);}
.nest-equip-slot.tier-ui-grey,.nest-inv-item.tier-ui-grey{border-color:rgba(106,120,144,.45);background:linear-gradient(180deg,rgba(106,120,144,.08),var(--surface2));}
.nest-equip-slot.tier-ui-green,.nest-inv-item.tier-ui-green{border-color:rgba(76,138,106,.45);background:linear-gradient(180deg,rgba(76,138,106,.10),var(--surface2));}
.nest-equip-slot.tier-ui-blue,.nest-inv-item.tier-ui-blue{border-color:rgba(74,106,201,.45);background:linear-gradient(180deg,rgba(74,106,201,.10),var(--surface2));}
.nest-equip-slot.tier-ui-purple,.nest-inv-item.tier-ui-purple{border-color:rgba(122,76,201,.45);background:linear-gradient(180deg,rgba(122,76,201,.10),var(--surface2));}
.nest-equip-slot.tier-ui-gold,.nest-inv-item.tier-ui-gold{border-color:rgba(201,168,76,.55);background:linear-gradient(180deg,rgba(201,168,76,.12),var(--surface2));}
.nest-equip-slot.tier-ui-orange,.nest-inv-item.tier-ui-orange{border-color:rgba(232,120,48,.58);background:linear-gradient(180deg,rgba(232,120,48,.14),var(--surface2));}
.nest-inv-item.nest-inv-ineligible{opacity:.55;cursor:not-allowed;filter:saturate(.7);}
.nest-inv-item.nest-inv-ineligible:hover{border-color:var(--border);transform:none;}
.nest-class-tag{display:inline-block;font-size:.62rem;letter-spacing:.06em;text-transform:uppercase;color:var(--tier-orange);margin-left:4px;}
.nest-tier-label{font-size:.58rem;letter-spacing:.08em;text-transform:uppercase;margin:2px 0;font-family:'Cinzel',serif;}
.nest-slot-filters{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 10px;}
.nest-slot-filter{font-size:.68rem;padding:4px 10px;border-radius:999px;border:1px solid var(--border);background:var(--surface2);color:var(--text-dim);cursor:pointer;transition:all .15s;font-family:'Cinzel',serif;}
.nest-slot-filter:hover{border-color:var(--gold);color:var(--text);}
.nest-slot-filter.active{border-color:var(--gold);background:rgba(201,168,76,.12);color:var(--gold-light);}
.nest-slot-badge{display:inline-block;font-size:.65rem;margin-right:3px;vertical-align:middle;opacity:.9;}
.nest-compare-toggle-row{display:flex;justify-content:center;margin:4px 0 10px;}
.nest-compare-toggle{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:.72rem;color:var(--text-dim);user-select:none;}
.nest-compare-toggle input{position:absolute;opacity:0;width:0;height:0;pointer-events:none;}
.nest-compare-switch{position:relative;width:34px;height:18px;border-radius:999px;background:rgba(80,70,50,.5);border:1px solid rgba(201,168,76,.25);transition:background .2s,border-color .2s;flex-shrink:0;}
.nest-compare-switch::after{content:'';position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:var(--text-dim);transition:transform .2s,background .2s;}
.nest-compare-toggle input:checked+.nest-compare-switch{background:rgba(201,168,76,.25);border-color:rgba(201,168,76,.55);}
.nest-compare-toggle input:checked+.nest-compare-switch::after{transform:translateX(16px);background:var(--gold-light);}
.nest-compare-toggle input:checked~.nest-compare-label{color:var(--gold-light);}
.nest-compare-label{font-family:'Cinzel',serif;letter-spacing:.04em;}
.nest-equip-bonus{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 4px;}
.nest-equip-bonus-chip{font-size:.72rem;padding:3px 8px;border-radius:999px;background:rgba(106,184,154,.15);border:1px solid rgba(106,184,154,.35);color:#6ab89a;}
.nest-inventory-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px;max-height:320px;overflow-y:auto;}
.nest-inv-item{background:var(--surface2);border:1px solid var(--border);border-radius:8px;padding:10px;min-height:130px;cursor:pointer;font-size:.72rem;line-height:1.3;transition:all .15s;text-align:center;display:flex;flex-direction:column;align-items:center;}
.nest-mut-stats{margin-top:5px;font-size:.65rem;line-height:1.35;}
.nest-mut-stats .mut-stat-line{font-size:.65rem;margin:0;}
.nest-inv-item:hover{border-color:var(--gold);transform:translateY(-1px);}
.nest-inv-empty{color:var(--text-dim);font-size:.82rem;text-align:center;padding:12px 0;}

/* ===== PASSIVE TRAIT BADGE ===== */
.passive-badge{display:inline-block;background:rgba(201,168,76,.1);border:1px solid rgba(201,168,76,.3);border-radius:12px;padding:2px 10px;font-size:.72rem;color:var(--gold);margin-top:5px;cursor:help;}

/* ===== BOSS RAGE PHASE ===== */
.boss-rage-bar{height:4px;border-radius:2px;background:linear-gradient(90deg,#c94c4c,#ff6060);margin-top:4px;animation:rage-pulse .5s ease infinite alternate;}
@keyframes rage-pulse{0%{opacity:.7;}100%{opacity:1;box-shadow:0 0 8px rgba(201,76,76,.8);}}
.rage-badge{background:rgba(201,76,76,.2);border:1px solid var(--red);border-radius:12px;padding:1px 8px;font-size:.7rem;color:var(--red-light);font-family:"Cinzel",serif;letter-spacing:.06em;}

/* ===== WHISPERING GROVE ===== */
#screen-grove{padding-top:2px;}
.grove-inner{max-width:700px;margin:0 auto;padding:14px 30px 24px;background:var(--surface);border:2px solid rgba(76,138,106,.35);border-radius:16px;text-align:center;}
#screen-grove{padding-top:2px;}
.grove-inner{max-width:700px;margin:0 auto;padding:14px 30px 24px;background:var(--surface);border:2px solid rgba(76,138,106,.35);border-radius:16px;text-align:center;}
.grove-intro{color:var(--text-dim);margin-bottom:20px;line-height:1.6;}
.grove-intro em{color:var(--gold-light);font-style:italic;}
.grove-opt-row{display:flex;gap:12px;justify-content:center;margin-bottom:24px;flex-wrap:wrap;}
.grove-btn-opt{background:var(--surface2);color:var(--text-dim);border:1px solid var(--border);border-radius:8px;padding:8px 22px;cursor:pointer;font-family:'Cinzel',serif;font-size:.82rem;transition:all .2s;}
.grove-btn-opt:hover{border-color:var(--text-dim);color:var(--text);}
.grove-btn-enter{background:linear-gradient(135deg,rgba(76,138,106,.25),rgba(76,138,106,.1));color:#6ae86a;border:1px solid rgba(76,138,106,.5);border-radius:8px;padding:8px 22px;cursor:pointer;font-family:'Cinzel',serif;font-size:.82rem;transition:all .2s;}
.grove-btn-enter:hover{background:rgba(76,138,106,.3);border-color:#4cb44c;box-shadow:0 0 14px rgba(76,138,106,.3);}
#grove-trees{display:none;grid-template-columns:repeat(3,1fr);gap:16px;max-width:560px;margin:0 auto 16px;}
.grove-tree{background:var(--surface2);border:2px solid rgba(76,138,106,.3);border-radius:14px;padding:30px 16px;cursor:pointer;transition:all .25s;font-size:3.2rem;display:flex;align-items:center;justify-content:center;height:130px;flex-direction:column;gap:6px;user-select:none;}
.grove-tree:hover{transform:translateY(-4px) scale(1.04);border-color:rgba(76,138,106,.7);box-shadow:0 8px 24px rgba(0,0,0,.35),0 0 18px rgba(76,138,106,.2);}
.grove-tree .grove-rustle{font-size:.65rem;color:var(--text-dim);opacity:0;transition:opacity .2s;}
.grove-tree:hover .grove-rustle{opacity:1;}
.grove-tree.revealed{animation:grove-flip .55s ease both;pointer-events:none;}
@keyframes grove-flip{0%{transform:rotateY(0) scale(1);}40%{transform:rotateY(90deg) scale(.88);}100%{transform:rotateY(0) scale(1);}}
.grove-tree.outcome-nest{border-color:rgba(201,168,76,.7);background:linear-gradient(135deg,rgba(201,168,76,.18),rgba(201,168,76,.05));box-shadow:0 0 28px rgba(201,168,76,.35);}
.grove-tree.outcome-ambush{border-color:rgba(201,76,76,.6);background:linear-gradient(135deg,rgba(201,76,76,.2),rgba(201,76,76,.05));}
.grove-tree.outcome-fruit{border-color:rgba(76,138,106,.7);background:linear-gradient(135deg,rgba(76,138,106,.2),rgba(76,138,106,.05));}
.grove-tree.outcome-egg{border-color:rgba(201,168,76,.5);background:linear-gradient(135deg,rgba(201,168,76,.15),rgba(201,168,76,.04));}
.grove-tree.outcome-goose{border-color:rgba(232,120,48,.65);background:linear-gradient(135deg,rgba(232,120,48,.18),rgba(201,168,76,.06));box-shadow:0 0 24px rgba(232,120,48,.28);}
.grove-outcome-label{font-size:.72rem;font-family:'Cinzel',serif;letter-spacing:.06em;margin-top:4px;}
.outcome-nest .grove-outcome-label{color:var(--gold);}
.outcome-ambush .grove-outcome-label{color:var(--red-light);}
.outcome-fruit .grove-outcome-label{color:#6ae86a;}
.outcome-egg .grove-outcome-label{color:var(--gold-light);}
.outcome-goose .grove-outcome-label{color:#ffd0a8;}
#grove-result-msg{min-height:40px;margin:14px 0;font-size:.92rem;font-weight:600;color:var(--text);}
.grove-other-trees{opacity:.35;transform:scale(.95);}
#grove-reward-section{display:none;margin-top:18px;}
#grove-reward-section h3{font-family:'Cinzel',serif;font-size:.9rem;color:var(--gold);margin-bottom:14px;letter-spacing:.08em;}
.grove-reward-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;max-width:500px;margin:0 auto 14px;}

/* ===== REFERENCE CODEX (modal) ===== */
.ref-guide-modal{display:none;position:fixed;inset:0;z-index:12000;align-items:flex-start;justify-content:center;padding:16px;overflow:auto;box-sizing:border-box;}
.ref-guide-modal.open{display:flex;}
.ref-guide-modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.58);cursor:pointer;z-index:0;}
.ref-guide-modal-panel{position:relative;z-index:1;margin:3vh auto 20px;width:min(960px,calc(100vw - 24px));height:min(86vh,880px);min-height:320px;display:flex;flex-direction:column;background:rgba(14,12,10,.94);border:1px solid rgba(201,168,76,.4);border-radius:14px;box-shadow:0 24px 80px rgba(0,0,0,.65);}
.ref-guide-modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid rgba(201,168,76,.22);flex-shrink:0;}
.ref-guide-modal-head h3{font-family:'Cinzel',serif;font-size:.95rem;color:var(--gold);letter-spacing:.1em;margin:0;}
.ref-guide-modal-close{border:none;background:rgba(255,255,255,.06);color:var(--text);width:36px;height:36px;border-radius:8px;font-size:1.35rem;line-height:1;cursor:pointer;transition:background .2s ease,color .2s ease;}
.ref-guide-modal-close:hover{background:rgba(201,168,76,.15);color:var(--gold-light);}
.ref-guide-modal-scroll{overflow-y:auto;overflow-x:hidden;padding:10px 14px 16px;flex:1;min-height:0;}
/* tabs */
.ref-codex-toolbar{display:flex;gap:8px;margin-bottom:8px;width:100%;flex:1 1 100%;}
.ref-search-input{flex:1;background:rgba(0,0,0,.25);border:1px solid var(--border);color:var(--text);padding:7px 9px;border-radius:8px;font-size:.85rem;}
.ref-show-locked-label{font-size:.72rem;color:var(--text-dim);white-space:nowrap;display:flex;align-items:center;gap:4px;}
.ref-filter-bar{display:flex;flex-wrap:wrap;gap:10px 14px;width:100%;flex:1 1 100%;margin-bottom:8px;padding:8px 10px;background:rgba(10,14,20,.45);border:1px solid rgba(201,168,76,.2);border-radius:8px;}
.ref-filter-bar label{font-size:.72rem;color:var(--text-dim);display:flex;flex-direction:column;gap:3px;}
.ref-filter-bar select{background:rgba(0,0,0,.3);border:1px solid var(--border);color:var(--text);padding:4px 8px;border-radius:6px;font-size:.78rem;min-width:100px;}
.ref-tabs{display:flex;flex-wrap:wrap;gap:4px;padding:10px 12px 0;border-bottom:1px solid rgba(255,255,255,.07);}
.ref-birds-intro{grid-column:1/-1;margin:0 0 10px;padding:0 2px;}
.ref-tab{font-family:'Cinzel',serif;font-size:.7rem;letter-spacing:.08em;padding:5px 12px;border-radius:6px 6px 0 0;cursor:pointer;border:1px solid transparent;border-bottom:none;color:var(--text-dim);background:transparent;transition:all .18s;}
.ref-tab:hover{color:var(--text);background:rgba(255,255,255,.04);}
.ref-tab.active{color:var(--gold);background:rgba(201,168,76,.1);border-color:rgba(201,168,76,.25);}
/* panels */
.ref-panel{display:none;padding:14px 14px 18px;}
.ref-panel.active{display:block;}
/* mechanics panel — 4 columns */
.ref-mechanics-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;}
/* skill panels — flexible card grid */
.ref-skills-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;}
.ref-col{background:rgba(255,255,255,.02);border:1px solid rgba(255,255,255,.06);border-radius:8px;padding:10px 12px;}
.ref-col-title{font-family:'Cinzel',serif;font-size:.7rem;letter-spacing:.12em;margin-bottom:8px;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.08);display:flex;align-items:center;gap:6px;}
.ref-entry{display:flex;align-items:flex-start;gap:7px;margin-bottom:6px;font-size:.75rem;line-height:1.35;}
.ref-entry-icon{font-size:.9rem;flex-shrink:0;margin-top:1px;}
.ref-entry-name{color:var(--text);font-weight:600;margin-bottom:1px;}
.ref-entry-desc{color:var(--text-dim);font-size:.7rem;}
/* skill cards (learnable abilities) */
.ref-skill-card{background:rgba(255,255,255,.02);border:1px solid rgba(255,255,255,.06);border-radius:8px;padding:10px 12px;}
.ref-skill-header{display:flex;align-items:center;gap:7px;margin-bottom:6px;}
.ref-skill-name{font-family:'Cinzel',serif;font-size:.78rem;color:var(--text);}
.ref-skill-type{font-size:.62rem;padding:1px 6px;border-radius:4px;margin-left:auto;flex-shrink:0;}
.ref-skill-type.physical{background:rgba(232,120,120,.15);color:#e87878;border:1px solid rgba(232,120,120,.25);}
.ref-skill-type.spell{background:rgba(168,138,232,.15);color:#a88ae8;border:1px solid rgba(168,138,232,.25);}
.ref-skill-type.utility{background:rgba(232,201,106,.15);color:var(--gold);border:1px solid rgba(201,168,76,.25);}
.ref-skill-base{font-size:.71rem;color:var(--text-dim);margin-bottom:6px;font-style:italic;}
.ref-skill-levels{display:flex;flex-direction:column;gap:3px;}
.ref-skill-lv{display:flex;gap:5px;font-size:.69rem;line-height:1.3;}
.ref-skill-lv-badge{flex-shrink:0;font-family:'Cinzel',serif;font-size:.6rem;color:var(--gold);background:rgba(201,168,76,.12);border:1px solid rgba(201,168,76,.2);border-radius:3px;padding:0 4px;height:fit-content;margin-top:1px;}
.ref-skill-lv-text{color:var(--text-dim);}
/* category pill colours */
.ref-title-physical{color:#e87878;}
.ref-title-song{color:#a88ae8;}
.ref-title-ailment{color:#78c878;}
.ref-title-buff{color:#e8c96a;}
.ref-title-debuff{color:#78aee8;}
#screen-stork-shop{padding-top:2px;}
.stork-shop-inner{max-width:760px;margin:0 auto;padding:10px 20px 16px;display:flex;flex-direction:column;justify-content:flex-start;min-height:0;}
#screen-stork-shop{padding-top:2px;}
.stork-shop-inner{max-width:760px;margin:0 auto;padding:10px 20px 16px;display:flex;flex-direction:column;justify-content:flex-start;min-height:0;}
.stork-shop-inner h2{font-family:'Cinzel',serif;font-size:1.6rem;color:var(--gold-light);text-align:center;margin-bottom:4px;}
.shiny-bar{display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:18px;font-family:'Cinzel',serif;font-size:1rem;color:var(--gold);}
.shiny-val{font-size:1.4rem;font-weight:700;}
.shop-items-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:16px;}
.shop-item{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:14px 12px 12px;cursor:pointer;transition:all .25s;position:relative;text-align:center;}
.shop-item:hover{transform:translateY(-2px);border-color:var(--gold);}
.shop-item.selected{border-color:var(--gold-light);box-shadow:0 0 18px rgba(232,201,106,.25);}
.shop-item.cant-afford{opacity:.45;cursor:not-allowed;}
.shop-item-head{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:8px;min-height:1.4em;}
.shop-item .reward-tier-label{font-family:'Cinzel',serif;font-size:.65rem;letter-spacing:.12em;margin-bottom:0;flex:1;text-align:left;}
.shop-item .reward-icon{font-size:1.6rem;display:block;margin-bottom:5px;}
.shop-item .reward-name{font-size:.85rem;font-weight:700;margin-bottom:3px;color:var(--text);}
.shop-item .reward-desc{font-size:.72rem;color:var(--text-dim);line-height:1.35;}
.shop-item-cost{position:static;flex-shrink:0;font-family:'Cinzel',serif;font-size:.68rem;color:var(--gold);background:rgba(20,15,5,.9);border:1px solid rgba(201,168,76,.3);border-radius:8px;padding:1px 6px;}
.shop-item-select-tick{position:absolute;top:6px;right:7px;width:20px;height:20px;border-radius:50%;background:rgba(201,168,76,.25);border:1px solid var(--gold-light);color:var(--gold-light);font-size:.72rem;line-height:18px;text-align:center;display:none;pointer-events:none;}
.shop-item.selected .shop-item-select-tick{display:block;}
.shop-section-heading{grid-column:1/-1;font-family:'Cinzel',serif;font-size:.82rem;letter-spacing:.12em;color:var(--gold-light);padding:2px 4px 0;margin-top:4px;}
.shop-section-heading:first-child{margin-top:0;}
.shop-tier-collapsible{grid-column:1/-1;border:1px solid var(--border);border-radius:10px;background:rgba(7,10,16,.35);overflow:hidden;}
.shop-tier-collapsible+.shop-tier-collapsible{margin-top:8px;}
.shop-tier-collapsible-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;cursor:pointer;list-style:none;font-family:'Cinzel',serif;font-size:.78rem;letter-spacing:.08em;color:var(--gold-light);user-select:none;}
.shop-tier-collapsible-summary::-webkit-details-marker{display:none;}
.shop-tier-collapsible-summary::before{content:'▾';display:inline-block;margin-right:8px;color:var(--gold);transition:transform .18s ease;}
.shop-tier-collapsible:not([open]) .shop-tier-collapsible-summary::before{transform:rotate(-90deg);}
.shop-tier-collapsible-count{font-size:.68rem;color:var(--text-dim);letter-spacing:.04em;}
.shop-tier-collapsible-body{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;padding:0 12px 12px;}
.shop-tier-collapsible.tier-grey{border-color:rgba(160,170,185,.28);}
.shop-tier-collapsible.tier-green{border-color:rgba(76,138,106,.35);}
.shop-tier-collapsible.tier-blue{border-color:rgba(74,106,201,.35);}
.shop-tier-collapsible.tier-purple{border-color:rgba(122,76,201,.38);}
.shop-tier-collapsible.tier-gold{border-color:rgba(201,168,76,.42);}
.shop-tier-collapsible.tier-orange{border-color:rgba(232,120,48,.42);}
.shop-tier-collapsible.tier-grey .shop-tier-collapsible-label{color:var(--text-dim);}
.shop-tier-collapsible.tier-green .shop-tier-collapsible-label{color:var(--green-light);}
.shop-tier-collapsible.tier-blue .shop-tier-collapsible-label{color:var(--blue-light);}
.shop-tier-collapsible.tier-purple .shop-tier-collapsible-label{color:var(--purple-light);}
.shop-tier-collapsible.tier-gold .shop-tier-collapsible-label{color:var(--gold-light);}
.shop-tier-collapsible.tier-orange .shop-tier-collapsible-label{color:var(--tier-orange);}
.shop-btn-row{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:12px;}
.shop-buy-btn{background:linear-gradient(135deg,rgba(201,168,76,.25),rgba(201,168,76,.1));border:1px solid var(--gold);color:var(--gold);padding:8px 22px;border-radius:8px;font-family:'Cinzel',serif;font-size:.85rem;cursor:pointer;transition:all .2s;}
.shop-buy-btn:hover{background:rgba(201,168,76,.3);}
.shop-buy-btn:disabled{opacity:.4;cursor:not-allowed;}
.shop-refresh-btn{background:rgba(74,106,201,.15);border:1px solid var(--blue);color:var(--blue-light);padding:8px 18px;border-radius:8px;font-family:'Cinzel',serif;font-size:.8rem;cursor:pointer;transition:all .2s;}
.shop-refresh-btn:hover{background:rgba(74,106,201,.25);}
.shop-exit-btn{background:linear-gradient(135deg,rgba(76,138,106,.2),rgba(76,138,106,.1));border:1px solid var(--green);color:var(--green-light);padding:8px 22px;border-radius:8px;font-family:'Cinzel',serif;font-size:.85rem;cursor:pointer;transition:all .2s;}
.shop-exit-btn:hover{background:rgba(76,138,106,.25);}
.shop-purchase-log{text-align:center;font-size:.8rem;color:var(--green-light);min-height:22px;margin-bottom:8px;}
/* Abandon run modal */
.abandon-modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.75);z-index:200;align-items:center;justify-content:center;}
.abandon-modal.open{display:flex;}
.abandon-inner{background:var(--surface);border:1px solid var(--red);border-radius:12px;padding:26px 30px;max-width:360px;text-align:center;}
.abandon-inner h3{font-family:'Cinzel',serif;color:var(--red-light);font-size:1.1rem;margin-bottom:8px;}
.abandon-inner p{color:var(--text-dim);font-size:.88rem;margin-bottom:18px;line-height:1.5;}
.settings-modal-inner{border-color:rgba(201,168,76,.45);max-width:620px!important;text-align:left;}
.settings-modal-inner h3{color:var(--gold);text-align:center;}
.settings-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 10px;}
.settings-tab{padding:6px 12px;border-radius:999px;border:1px solid var(--border);background:var(--surface2);color:var(--text-dim);font-family:'Cinzel',serif;font-size:.72rem;cursor:pointer;transition:all .15s;}
.settings-tab:hover{border-color:var(--gold);color:var(--text);}
.settings-tab.active{border-color:var(--gold);background:rgba(201,168,76,.12);color:var(--gold-light);}
.settings-panel{display:none;gap:10px;margin-bottom:4px;}
.settings-panel.active{display:grid;}
.settings-row{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:.85rem;}
.settings-row-range{flex-wrap:wrap;}
.settings-row-range input[type=range]{flex:1;min-width:140px;max-width:220px;}
.settings-hint{font-size:.72rem;color:var(--text-dim);margin:0;line-height:1.4;}
.settings-subsection{margin-top:14px;padding-top:12px;border-top:1px solid rgba(201,168,76,.18);}
.settings-subsection-title{font-family:'Cinzel',serif;font-size:.78rem;color:var(--gold-light);margin:0 0 10px;letter-spacing:.06em;}
.settings-subsection .settings-row input[type=range]{flex:1;min-width:120px;}
.settings-reset-btn{width:100%;margin-top:8px;font-size:.78rem;}
.mut-stat-compact{font-size:.72rem;line-height:1.35;text-align:center;color:var(--text-dim);}
.mut-stat-compact .mut-stat-chip{margin:0 2px;}
.reward-desc.mut-stat-compact-wrap,.nest-mut-stats.mut-stat-compact-wrap{padding-top:4px;}
.abandon-confirm-btn{background:linear-gradient(135deg,rgba(201,76,76,.25),rgba(201,76,76,.1));border:1px solid var(--red);color:var(--red-light);padding:8px 22px;border-radius:8px;font-family:'Cinzel',serif;font-size:.85rem;cursor:pointer;margin-right:8px;}
.abandon-cancel-btn{background:rgba(30,35,55,.9);border:1px solid var(--border);color:var(--text-dim);padding:8px 18px;border-radius:8px;cursor:pointer;font-size:.85rem;}
/* Unlock toast */
.unlock-toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%) translateY(80px);background:linear-gradient(135deg,rgba(122,76,201,.9),rgba(80,40,160,.9));border:1px solid var(--purple-light);border-radius:10px;padding:10px 22px;font-family:'Cinzel',serif;font-size:.85rem;color:#d4b8ff;z-index:300;pointer-events:none;transition:transform .4s ease,opacity .4s ease;opacity:0;}
.unlock-toast.show{transform:translateX(-50%) translateY(0);opacity:1;}
/* mdef/matk stat badge */
.stat-mdef{color:#6ae8b8;}
.nest-stats-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;}
/* post-battle panel (non-boss) */
.postbattle-panel{max-width:520px;margin:0 auto;padding:26px;text-align:center;}
.postbattle-panel h2{font-family:'Cinzel',serif;color:var(--gold-light);font-size:1.4rem;margin-bottom:10px;}
.postbattle-rewards{display:flex;justify-content:center;gap:16px;margin:14px 0;}
.pbr-item{text-align:center;}
.pbr-val{font-family:'Cinzel',serif;font-size:1.4rem;color:var(--gold);}
.pbr-lbl{font-size:.72rem;color:var(--text-dim);}
/* Soft cap glow on stats */
.softcap{color:var(--orange-light)!important;}
.hardcap{color:var(--red-light)!important;}
.sel-continue-row{text-align:center;margin-bottom:16px;}
.continue-run-btn{background:linear-gradient(135deg,rgba(76,138,106,.2),rgba(76,138,106,.1));border:1px solid var(--green);color:var(--green-light);padding:10px 28px;border-radius:8px;font-family:"Cinzel",serif;font-size:.9rem;cursor:pointer;transition:all .3s;letter-spacing:.06em;}
.continue-run-btn:hover{background:rgba(76,138,106,.25);transform:scale(1.03);}
.menu-row{display:flex;gap:10px;justify-content:flex-end;margin-bottom:8px;}
.menu-btn{background:rgba(200,160,32,.08);border:1px solid rgba(200,160,32,.38);color:var(--gold);padding:5px 14px;border-radius:8px;cursor:pointer;font-family:'Cinzel',serif;font-size:.8rem;letter-spacing:.06em;transition:all .2s;}
.menu-btn:hover{background:rgba(200,160,32,.18);border-color:var(--gold);}
/* Run history */
.run-history{max-width:960px;margin:18px auto 0;border-top:1px solid var(--border);padding-top:14px;}
.run-history-title{font-family:"Cinzel",serif;font-size:.75rem;color:var(--text-dim);letter-spacing:.1em;text-align:center;margin-bottom:8px;}
.run-history-grid{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;}
.run-entry{background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:8px 14px;font-size:.78rem;text-align:center;min-width:120px;}
.run-entry.run-win{border-color:rgba(201,168,76,.4);}
.run-entry.run-lose{border-color:rgba(201,76,76,.3);}
.run-bird{font-family:"Cinzel",serif;font-size:.8rem;color:var(--silver);margin-bottom:3px;}
.run-result{font-size:.72rem;color:var(--text-dim);}
#run-unlocks{margin-top:12px;display:flex;flex-direction:column;gap:8px;}
.unlock-popup{background:var(--surface2);border:1px solid rgba(201,168,76,.35);border-radius:10px;padding:10px 12px;text-align:left;}
.unlock-title{font-family:'Cinzel',serif;color:var(--gold-light);font-size:.8rem;margin-bottom:6px;}
.unlock-card{display:flex;align-items:center;gap:10px;}
.unlock-statline{color:var(--text-dim);font-size:.78rem;}

/* ===== NEXT STAGE PREVIEW ===== */
.next-stage-preview{background:var(--surface2);border:1px solid var(--border);border-radius:10px;padding:12px 16px;margin-top:12px;text-align:center;}
.nsp-title{font-family:"Cinzel",serif;font-size:.75rem;color:var(--text-dim);letter-spacing:.1em;margin-bottom:8px;text-transform:uppercase;}
.nsp-enemy{font-size:1.5rem;margin-bottom:4px;}
.nsp-name{font-family:"Cinzel",serif;font-size:.95rem;color:var(--red-light);}
.nsp-stats{font-size:.78rem;color:var(--text-dim);margin-top:4px;}

/* ===== STATUS RESISTANCE ===== */
.resist-badge{background:rgba(74,106,201,.1);border:1px solid rgba(74,106,201,.3);border-radius:12px;padding:1px 8px;font-size:.7rem;color:var(--blue-light);}

@media(max-width:600px){
  .nest-stats-grid{grid-template-columns:repeat(2,1fr);}
  .nest-abilities-grid{grid-template-columns:1fr;}
  #nest-modal{padding:10px;}
}

/* Enemy sprites face left via a non-animated wrapper (avoids transform conflicts with idle/combat anims). */
.sprite-face-left{
  display:flex;
  align-items:center;
  justify-content:center;
  transform:scaleX(-1);
  transform-origin:center bottom;
}

/* ===== Pixel Sprite System (2x2 frames) ===== */
.sprite4{
  width:96px;height:96px;
  background-size:200% 200%;
  background-position:0% 0%;
  image-rendering:pixelated;
  border-radius:16px;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.55));
}
.sprite4.small{ width:72px; height:72px; border-radius:14px; }
.sprite4.frame-0{ background-position:  0%   0%; }
.sprite4.frame-1{ background-position:100%   0%; }
.sprite4.frame-2{ background-position:  0% 100%; }
.sprite4.frame-3{ background-position:100% 100%; }
.sprite-sparrow{background-image:url("../assets/sprites/sparrow.png");}
.sprite-goose{background-image:url("../assets/sprites/goose.png");}
.sprite-blackbird{background-image:url("../assets/sprites/blackbird.png");}
.sprite-crow{background-image:url("../assets/sprites/crow.png");}
.sprite-macaw{background-image:url("../assets/sprites/macaw.png");}
.sprite-hummingbird{background-image:url("../assets/sprites/hummingbird.png");}
.sprite-shoebill{background-image:url("../assets/sprites/shoebill.png");}
.sprite-secretarybird{background-image:url("../assets/sprites/Secretary Bird.png");}
.sprite-secretary{background-image:url("../assets/sprites/Secretary Bird.png");}
.sprite-robin{background-image:url("../assets/sprites/Robin.png");}
.sprite-kiwi{background-image:url("../assets/sprites/kiwi.png");}
.sprite-magpie{background-image:url("../assets/sprites/magpie.png");}
.sprite-kookaburra{background-image:url("../assets/sprites/kookaburra.png");}
.sprite-penguin{background-image:url("../assets/sprites/Emperor Penguin.png");}
.sprite-emperorpenguin{background-image:url("../assets/sprites/Emperor Penguin.png");}
.sprite-flamingo{background-image:url("../assets/sprites/flamingo.png");}
.sprite-seagull{background-image:url("../assets/sprites/Seagull.png");}
.sprite-swan{background-image:url("../assets/sprites/swan.png");}
.sprite-emu{background-image:url("../assets/sprites/emu.png");}
.sprite-ostrich{background-image:url("../assets/sprites/ostrich.png");}
.sprite-cassowary{background-image:url("../assets/sprites/cassowary.png");}
.sprite-albatross{background-image:url("../assets/sprites/albatross.png");}
.sprite-raven{background-image:url("../assets/sprites/raven.png");}
.sprite-lyrebird{background-image:url("../assets/sprites/lyrebird.png");}
.sprite-bowerbird{background-image:url("../assets/sprites/bowerbird.png");}
.sprite-peregrine{background-image:url("../assets/sprites/peregrine.png");}
.sprite-snowyowl{background-image:url("../assets/sprites/snowyowl.png");}
.sprite-toucan{background-image:url("../assets/sprites/toucan.png");}
.sprite-shoebillstork{background-image:url("../assets/sprites/shoebill.png");}
.sprite-baldeagle{background-image:url("../assets/sprites/baldeagle.png");}
.sprite-harpy{background-image:url("../assets/sprites/harpyeagle.png");}
.sprite-harpyeagle{background-image:url("../assets/sprites/harpyeagle.png");}
.sprite-blackcockatoo{background-image:url("../assets/sprites/blackcockatoo.png");}
.sprite-dukeblakiston{background-image:url("../assets/sprites/Duke Blakiston.png");}
.sprite-barnowl{background-image:url("../assets/sprites/barnowl.png");}
.sprite-bluejay{background-image:url("../assets/sprites/bluejay.png");}
.sprite-bushturkey{background-image:url("../assets/sprites/bushturkey.png");}
.sprite-bustard{background-image:url("../assets/sprites/bustard.png");}
.sprite-cardinal{background-image:url("../assets/sprites/cardinal.png");}
.sprite-dodo{background-image:url("../assets/sprites/dodo.png");}
.sprite-fairywren{background-image:url("../assets/sprites/fairywren.png");}
.sprite-finch{background-image:url("../assets/sprites/finch.png");}
.sprite-firecrest{background-image:url("../assets/sprites/firecrest.png");}
.sprite-galah{background-image:url("../assets/sprites/galah.png");}
.sprite-goldeneagle{background-image:url("../assets/sprites/goldeneagle.png");}
.sprite-pigeon{background-image:url("../assets/sprites/pigeon.png");}
.sprite-mutatedpigeon{background-image:url("../assets/sprites/mutatedpigeon.png");}
.sprite-wagtail{background-image:url("../assets/sprites/williewagtail.png");}
.sprite-williewagtail{background-image:url("../assets/sprites/williewagtail.png");}
.sprite-chickadee{background-image:url("../assets/sprites/chikadee.png");}
.sprite-chikadee{background-image:url("../assets/sprites/chikadee.png");}
/* Character Select portrait slot */
.bird-portrait .sprite4.small{ margin:0 auto; display:block; }
.bird-portrait .sprite4.locked{ filter: grayscale(1) brightness(0.35); }

@media (max-width: 820px){
  .sel-layout{grid-template-columns: 1fr;}
  .sel-right{position:sticky; top:0; z-index:5;}
}


/* ===== Medium bird sizing (avoid squish) ===== */
.sprite4.medium{ width:88px; height:88px; border-radius:16px; }
/* Battle can stay default 96px; but allow slightly bigger if desired */
.sprite4.battle-medium{ width:110px; height:110px; border-radius:18px; }

/* ===== Stage 10/Starter + Medium birds ===== */





/* ===== Sprite scaling (prevents squish; supports sizes) ===== */
.sprite-bird{display:flex;align-items:center;justify-content:center;}
.sprite-bird img{width:auto;image-rendering:pixelated;image-rendering:crisp-edges;}
.sprite-bird.tiny img{height:38px;}
.sprite-bird.small img{height:46px;}
.sprite-bird.medium img{height:64px;}
.sprite-bird.large img{height:96px;}
.sprite-bird.xl img{height:92px;}
/* Battle sizing guide */
.battle-sprite.tiny img{height:70px;}
.battle-sprite.small img{height:90px;}
.battle-sprite.medium img{height:110px;}
.battle-sprite.large img{height:130px;}
.battle-sprite.xl img{height:150px;}
/* Global pixel rendering */
img{image-rendering:pixelated;image-rendering:crisp-edges;}

/* ===== Sprite4 size variants ===== */
.sprite4.tiny{width:60px;height:60px;border-radius:14px;}
.sprite4.small{width:72px;height:72px;border-radius:14px;}
.sprite4.medium{width:84px;height:84px;border-radius:14px;}
.sprite4.large{width:96px;height:96px;border-radius:16px;}
.sprite4.xl{width:110px;height:110px;border-radius:18px;}

/* ===== Portrait sizing / pixel art standardization ===== */
.sprite4.medium{width:92px;height:92px;border-radius:16px;}
.sprite4.large{width:104px;height:104px;border-radius:18px;}
.sprite4.small{width:76px;height:76px;border-radius:14px;}
.sprite4.tiny{width:64px;height:64px;border-radius:12px;}
.bird-portrait .sprite4.medium{width:86px;height:105px;}.ascent-face .sprite4.medium{width:96px;height:96px;}

/* MAGPIE SPRITE CLEAN */
.sprite-magpie{background-image:url("../assets/sprites/magpie.png");background-size:200% 200%;}

/* Magpie uses a 2x2 sheet */
.sprite-magpie.frame-0{background-position:0% 0%;}
.sprite-magpie.frame-1{background-position:100% 0%;}
.sprite-magpie.frame-2{background-position:0% 100%;}
.sprite-magpie.frame-3{background-position:100% 100%;}

/* magpie frame positions are explicit here because the sheet is 2x2 *//* frame positions are handled by shared .sprite4.frame-0..3 rules exactly like sparrow */


/* XL sprite sizing for Emu / other very large birds */
.sprite4.xlarge,.sprite4.xl{width:128px;height:128px;border-radius:18px;}
.bird-portrait .sprite4.xlarge,.bird-portrait .sprite4.xl{width:112px;height:112px;}.ascent-face .sprite4.xlarge,
.ascent-face .sprite4.xl{width:128px;height:128px;}
/* shared frame mapping already handles frame-0..3 like Sparrow */



/* Restored Take Flight button visuals */
.cta{
  background:linear-gradient(180deg,#d4b15a 0%, #9a7423 55%, #6f5318 100%);
  color:#1a1406;
  border:1px solid #e6c76a;
  border-radius:999px;
  padding:14px 36px;
  font-family:'Cinzel',serif;
  font-weight:700;
  font-size:1rem;
  letter-spacing:.02em;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,245,200,.35);
  transition:transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.cta:hover{
  transform:translateY(-1px);
  filter:brightness(1.04);
  box-shadow:0 8px 20px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,245,200,.35);
}
.cta:active{
  transform:translateY(0);
  box-shadow:0 3px 8px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,245,200,.25);
}
.cta:disabled{
  opacity:.55;
  cursor:not-allowed;
  filter:saturate(.7);
}

/* ===== Unified bird icon tiers =====
   UI now uses three visible tiers:
   - small/tiny  -> small
   - medium      -> medium
   - large/xl    -> medium (reduced one step for cleaner UI)
   Hidden fourth tier:
   - boss        -> reserved for boss battles / final encounters
*/
.sprite4.tiny,.sprite4.small{width:64px;height:64px;border-radius:12px;}
.sprite4.medium,.sprite4.large,.sprite4.xl,.sprite4.xlarge{width:88px;height:88px;border-radius:16px;}
.sprite4.boss{width:118px;height:118px;border-radius:18px;}

.bird-portrait .sprite4.tiny,.bird-portrait .sprite4.small{width:60px;height:60px;}
.bird-portrait .sprite4.medium,.bird-portrait .sprite4.large,.bird-portrait .sprite4.xl,.bird-portrait .sprite4.xlarge{width:82px;height:82px;}
.bird-portrait .sprite4.boss{width:102px;height:102px;}

.ascent-face .sprite4.tiny,
.ascent-face .sprite4.small{width:72px;height:72px;}
.ascent-face .sprite4.medium,
.ascent-face .sprite4.large,
.ascent-face .sprite4.xl,
.ascent-face .sprite4.xlarge{width:94px;height:94px;}
.ascent-face .sprite4.boss{width:112px;height:112px;}

#player-avatar .sprite4.tiny,#enemy-avatar .sprite4.tiny,
#player-avatar .sprite4.small,#enemy-avatar .sprite4.small{width:82px;height:82px;}
#player-avatar .sprite4.medium,#enemy-avatar .sprite4.medium,
#player-avatar .sprite4.large,#enemy-avatar .sprite4.large,
#player-avatar .sprite4.xl,#enemy-avatar .sprite4.xl,
#player-avatar .sprite4.xlarge,#enemy-avatar .sprite4.xlarge{width:98px;height:98px;}
#player-avatar .sprite4.boss,#enemy-avatar .sprite4.boss{width:122px;height:122px;}


/* Penguin sprite ratio fix */
.sprite-emperor-penguin{
  width:120px !important;
  height:96px !important;
  background-size:200% 200%;
}
.sprite-emperor-penguin.small{
  width:96px !important;
  height:78px !important;
}



/* ============================================================
   PATCH: Unified sprite sizing across portraits, ascent, battle
   - fixes duplicate/overriding square rules by adding one final authority block
   - preserves wider penguin proportions everywhere
   ============================================================ */
.sprite4.tiny{width:64px;height:64px;border-radius:12px;}
.sprite4.small{width:72px;height:72px;border-radius:14px;}
.sprite4.medium{width:88px;height:88px;border-radius:16px;}
.sprite4.large{width:100px;height:100px;border-radius:18px;}
.sprite4.xl,.sprite4.xlarge{width:112px;height:112px;border-radius:20px;}
.sprite4.boss{width:128px;height:128px;border-radius:22px;}

.bird-portrait .sprite4.tiny{width:60px;height:60px;}
.bird-portrait .sprite4.small{width:68px;height:68px;}
.bird-portrait .sprite4.medium{width:84px;height:84px;}
.bird-portrait .sprite4.large{width:94px;height:94px;}
.bird-portrait .sprite4.xl,.bird-portrait .sprite4.xlarge{width:102px;height:102px;}
.bird-portrait .sprite4.boss{width:112px;height:112px;}

.ascent-face .sprite4.tiny{width:70px;height:70px;}
.ascent-face .sprite4.small{width:78px;height:78px;}
.ascent-face .sprite4.medium{width:96px;height:96px;}
.ascent-face .sprite4.large{width:108px;height:108px;}
.ascent-face .sprite4.xl,
.ascent-face .sprite4.xlarge{width:120px;height:120px;}
.ascent-face .sprite4.boss{width:130px;height:130px;}

#player-avatar .sprite4.tiny,#enemy-avatar .sprite4.tiny{width:82px;height:82px;}
#player-avatar .sprite4.small,#enemy-avatar .sprite4.small{width:90px;height:90px;}
#player-avatar .sprite4.medium,#enemy-avatar .sprite4.medium{width:104px;height:104px;}
#player-avatar .sprite4.large,#enemy-avatar .sprite4.large{width:116px;height:116px;}
#player-avatar .sprite4.xl,#enemy-avatar .sprite4.xl,
#player-avatar .sprite4.xlarge,#enemy-avatar .sprite4.xlarge{width:128px;height:128px;}
#player-avatar .sprite4.boss,#enemy-avatar .sprite4.boss{width:138px;height:138px;}

.avatar-wrap{height:132px;min-width:132px;}
.bird-portrait,.ascent-face{display:flex;align-items:center;justify-content:center;}

/* Penguin-specific ratio overrides using the actual sprite class name */
/* ===== FINAL UNIFIED AVATAR / PORTRAIT OVERRIDES ===== */
.bird-portrait,
.ascent-face,
.avatar-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Generic sprite sizing by location */
.bird-portrait .sprite4.tiny{width:60px !important;height:60px !important;}
.bird-portrait .sprite4.small{width:70px !important;height:70px !important;}
.bird-portrait .sprite4.medium{width:84px !important;height:84px !important;}
.bird-portrait .sprite4.large{width:96px !important;height:96px !important;}
.bird-portrait .sprite4.xl,
.bird-portrait .sprite4.xlarge{width:108px !important;height:108px !important;}
.bird-portrait .sprite4.boss{width:118px !important;height:118px !important;}

.ascent-face .sprite4.tiny{width:70px !important;height:70px !important;}
.ascent-face .sprite4.small{width:80px !important;height:80px !important;}
.ascent-face .sprite4.medium{width:96px !important;height:96px !important;}
.ascent-face .sprite4.large{width:108px !important;height:108px !important;}
.ascent-face .sprite4.xl,
.ascent-face .sprite4.xlarge{width:122px !important;height:122px !important;}
.ascent-face .sprite4.boss{width:132px !important;height:132px !important;}

#player-avatar .sprite4.tiny,#enemy-avatar .sprite4.tiny{width:84px !important;height:84px !important;}
#player-avatar .sprite4.small,#enemy-avatar .sprite4.small{width:94px !important;height:94px !important;}
#player-avatar .sprite4.medium,#enemy-avatar .sprite4.medium{width:108px !important;height:108px !important;}
#player-avatar .sprite4.large,#enemy-avatar .sprite4.large{width:122px !important;height:122px !important;}
#player-avatar .sprite4.xl,#enemy-avatar .sprite4.xl,
#player-avatar .sprite4.xlarge,#enemy-avatar .sprite4.xlarge{width:136px !important;height:136px !important;}
#player-avatar .sprite4.boss,#enemy-avatar .sprite4.boss{width:146px !important;height:146px !important;}

.avatar-wrap{height:142px !important;min-width:142px !important;}
#player-avatar-wrap,#enemy-avatar-wrap{overflow:visible;}

/* Penguin-specific ratio fixes across every location */
/* Keep old svg portraits consistent too */
.bird-portrait svg{height:90px !important;width:auto !important;image-rendering:pixelated;}
.avatar-inner svg{height:96px !important;width:auto !important;image-rendering:pixelated;}


/* ===== FINAL SMALL PENGUIN SPRITE ===== */
.sprite-penguin{
  background-image:url("../assets/sprites/Emperor Penguin.png") !important;
  background-image:url("../assets/sprites/Emperor Penguin.png") !important;
  background-repeat:no-repeat !important;
  background-size:200% 200% !important;
  image-rendering:pixelated !important;
}

/* keep penguin small everywhere */
.sprite4.sprite-penguin{
  width:72px !important;
  height:72px !important;
}.bird-portrait .sprite4.sprite-penguin,
.bird-portrait .sprite4.sprite-penguin.small{
  width:72px !important;
  height:72px !important;
}

#player-avatar .sprite4.sprite-penguin,
#enemy-avatar .sprite4.sprite-penguin,
.avatar-wrap .sprite4.sprite-penguin{
  width:72px !important;
  height:72px !important;
}

/* cancel older penguin-only stretch overrides */
.sprite4.sprite-penguin.medium,
.sprite4.sprite-penguin.large,
.sprite4.sprite-penguin.xl,
.sprite4.sprite-penguin.xlarge,
.sprite-penguin.small,
.sprite-penguin.medium,
.sprite-penguin.large,
.sprite-penguin.xl,
.sprite-penguin.xlarge{
  width:72px !important;
  height:72px !important;
}


/* ===== AUTHORITATIVE SMALL PENGUIN RENDER ===== */
.sprite-penguin,
.sprite4.sprite-penguin,
.sprite-penguin.small,
.sprite-penguin.medium,
.sprite-penguin.large,
.sprite-penguin.xl,
.sprite-penguin.xlarge,
.sprite4.sprite-penguin.small,
.sprite4.sprite-penguin.medium,
.sprite4.sprite-penguin.large,
.sprite4.sprite-penguin.xl,
.sprite4.sprite-penguin.xlarge{
  width:72px !important;
  height:72px !important;
}

/* select cards */
.bird-portrait .sprite-penguin,
.bird-portrait .sprite4.sprite-penguin,
.bird-portrait .sprite-penguin.small,
.bird-portrait .sprite4.sprite-penguin.small,
.bird-portrait .sprite-penguin.medium,
.bird-portrait .sprite4.sprite-penguin.medium,
.bird-portrait .sprite-penguin.large,
.bird-portrait .sprite4.sprite-penguin.large,
.bird-portrait .sprite-penguin.xl,
.bird-portrait .sprite4.sprite-penguin.xl,
.bird-portrait .sprite-penguin.xlarge,
.bird-portrait .sprite4.sprite-penguin.xlarge{
  width:72px !important;
  height:72px !important;
}

/* ascent/selected portrait */
.ascent-face .sprite-penguin,
.ascent-face .sprite4.sprite-penguin{
  width:72px !important;
  height:72px !important;
}

/* battle avatars */
#player-avatar .sprite-penguin,
#player-avatar .sprite4.sprite-penguin,
#enemy-avatar .sprite-penguin,
#enemy-avatar .sprite4.sprite-penguin,
.avatar-wrap .sprite-penguin,
.avatar-wrap .sprite4.sprite-penguin,
.avatar-inner .sprite-penguin,
.avatar-inner .sprite4.sprite-penguin{
  width:72px !important;
  height:72px !important;
}

/* keep frame math intact */
.sprite-penguin{
  background-size:200% 200% !important;
  background-repeat:no-repeat !important;
  image-rendering:pixelated !important;
}


/* ===== AUTHORITATIVE PENGUIN SMALL RENDER ===== */
/* Penguin should behave like a normal small bird everywhere. */
.sprite4.small.sprite-penguin,
.sprite4.sprite-penguin.small,
.sprite-penguin.small,
.bird-portrait .sprite4.sprite-penguin.small,
.ascent-face .sprite4.sprite-penguin.small,
#player-avatar .sprite4.sprite-penguin.small,
#enemy-avatar .sprite4.sprite-penguin.small,
.avatar-wrap .sprite4.sprite-penguin.small,
.avatar-inner .sprite4.sprite-penguin.small{
  width:72px !important;
  height:72px !important;
}

/* Defensive catch-all: if penguin is rendered without a size class, keep it small. */
.sprite4.sprite-penguin{
  background-size:200% 200% !important;
  background-repeat:no-repeat !important;
  image-rendering:pixelated !important;
}


/* Energy colors */
.energy-orb{background:#3aa0ff;} /* normal EN blue */
.energy-orb.bonus{background:#36c36c;} /* bonus EN green */


/* Energy tooltip + pulse */
.energy-orb{
  position:relative;
  width:14px;
  height:14px;
  border-radius:50%;
  display:inline-block;
  margin:0 3px;
  box-shadow:0 0 6px rgba(58,160,255,.35);
}
.energy-orb.bonus{
  box-shadow:0 0 8px rgba(54,195,108,.45);
}
.energy-orb.new-bonus{
  animation: energyPulse 1s ease-in-out 3;
}
@keyframes energyPulse{
  0%{ transform:scale(1); box-shadow:0 0 8px rgba(54,195,108,.45); }
  35%{ transform:scale(1.28); box-shadow:0 0 18px rgba(54,195,108,.95); }
  70%{ transform:scale(1.08); box-shadow:0 0 12px rgba(54,195,108,.65); }
  100%{ transform:scale(1); box-shadow:0 0 8px rgba(54,195,108,.45); }
}
.energy-summary{
  cursor:default;
}


/* Energy spent state */
.energy-orb.spent{
  opacity:.22;
  filter:grayscale(.25);
  box-shadow:none !important;
}

/* First free attack / spell (0 EN) — purple square, combat row */
.energy-free-sep{
  width:1px;
  align-self:stretch;
  min-height:14px;
  margin:0 2px 0 6px;
  background:rgba(255,255,255,.12);
}
.energy-free-chip{
  width:12px;
  height:12px;
  min-width:12px;
  min-height:12px;
  padding:0;
  margin:0 2px;
  border:1px solid rgba(160,110,240,.95);
  border-radius:3px;
  background:linear-gradient(145deg, rgba(120,70,200,.55), rgba(90,40,160,.75));
  box-shadow:0 0 8px rgba(140,80,220,.4);
  cursor:help;
  flex-shrink:0;
  vertical-align:middle;
}
.energy-free-chip.is-spent{
  opacity:.35;
  filter:grayscale(.35);
  box-shadow:none;
  border-color:rgba(120,120,140,.5);
  background:rgba(50,45,65,.5);
  cursor:default;
}
.energy-free-chip:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:2px;
}


/* ===== 19_stability-cleanup-style.css ===== */

.bird-fallback-svg{width:82px;height:82px;display:block;image-rendering:pixelated}
#player-avatar .bird-fallback-svg,#enemy-avatar .bird-fallback-svg{width:98px;height:98px}

.shop-item{
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease, opacity .18s ease, border-color .18s ease !important;
}
.shop-item.tier-grey{
  box-shadow:0 0 10px rgba(160,170,185,.10), inset 0 0 8px rgba(160,170,185,.04);
  background:linear-gradient(180deg,rgba(106,120,144,.10),var(--surface));
}
.shop-item.tier-green{
  box-shadow:0 0 14px rgba(76,138,106,.22), inset 0 0 10px rgba(76,138,106,.08);
  background:linear-gradient(180deg,rgba(76,138,106,.10),var(--surface));
}
.shop-item.tier-blue{
  box-shadow:0 0 16px rgba(74,106,201,.24), inset 0 0 10px rgba(74,106,201,.08);
  background:linear-gradient(180deg,rgba(74,106,201,.10),var(--surface));
}
.shop-item.tier-purple{
  box-shadow:0 0 18px rgba(122,76,201,.28), inset 0 0 10px rgba(122,76,201,.10);
  background:linear-gradient(180deg,rgba(122,76,201,.10),var(--surface));
}
.shop-item.tier-gold{
  box-shadow:0 0 20px rgba(201,168,76,.32), 0 0 34px rgba(232,201,106,.14), inset 0 0 12px rgba(201,168,76,.10);
  animation:storkGoldShimmer 2.2s ease-in-out infinite;
  background:linear-gradient(180deg,rgba(201,168,76,.12),var(--surface));
}
.shop-item.tier-orange{
  box-shadow:0 0 18px rgba(232,120,48,.28), inset 0 0 10px rgba(232,120,48,.10);
  background:linear-gradient(180deg,rgba(232,120,48,.12),var(--surface));
}
.shop-item.shop-locked-visit{
  pointer-events:none !important; opacity:.55 !important; filter:saturate(.82) !important;
}
@keyframes storkGoldShimmer{
  0%{box-shadow:0 0 18px rgba(201,168,76,.24),0 0 30px rgba(232,201,106,.10),inset 0 0 10px rgba(201,168,76,.08)}
  50%{box-shadow:0 0 24px rgba(201,168,76,.40),0 0 42px rgba(232,201,106,.18),inset 0 0 14px rgba(201,168,76,.14)}
  100%{box-shadow:0 0 18px rgba(201,168,76,.24),0 0 30px rgba(232,201,106,.10),inset 0 0 10px rgba(201,168,76,.08)}
}


/* ===== 21_style_21.css ===== */

/* ===== FINAL PENGUIN AVATAR FIX ===== */


/* Clean, final size authority */
.bird-portrait,
.ascent-face,
.avatar-wrap,
.avatar-inner,
#player-avatar,
#enemy-avatar{
  display:flex;
  align-items:center;
  justify-content:center;
}

.bird-portrait{min-height:120px !important; overflow:visible !important;}
.ascent-face{min-height:112px !important; overflow:visible !important;}
.avatar-wrap{height:148px !important; min-width:160px !important; overflow:visible !important;}
#player-avatar-wrap,#enemy-avatar-wrap,#player-avatar,#enemy-avatar{overflow:visible !important;}

/* Generic sprites by location */
.bird-portrait .sprite4.tiny{width:64px !important;height:64px !important;}
.bird-portrait .sprite4.small{width:76px !important;height:76px !important;}
.bird-portrait .sprite4.medium{width:92px !important;height:92px !important;}
.bird-portrait .sprite4.large{width:104px !important;height:104px !important;}
.bird-portrait .sprite4.xl,.bird-portrait .sprite4.xlarge{width:120px !important;height:120px !important;}

.ascent-face .sprite4.tiny{width:76px !important;height:76px !important;}
.ascent-face .sprite4.small{width:88px !important;height:88px !important;}
.ascent-face .sprite4.medium{width:104px !important;height:104px !important;}
.ascent-face .sprite4.large{width:116px !important;height:116px !important;}
.ascent-face .sprite4.xl,
.ascent-face .sprite4.xlarge{width:132px !important;height:132px !important;}

#player-avatar .sprite4.tiny,#enemy-avatar .sprite4.tiny{width:88px !important;height:88px !important;}
#player-avatar .sprite4.small,#enemy-avatar .sprite4.small{width:102px !important;height:102px !important;}
#player-avatar .sprite4.medium,#enemy-avatar .sprite4.medium{width:118px !important;height:118px !important;}
#player-avatar .sprite4.large,#enemy-avatar .sprite4.large{width:132px !important;height:132px !important;}
#player-avatar .sprite4.xl,#enemy-avatar .sprite4.xl,
#player-avatar .sprite4.xlarge,#enemy-avatar .sprite4.xlarge{width:148px !important;height:148px !important;}

/* Penguin-specific ratio: wide, not square */
.ascent-face .sprite4.sprite-penguin.small{width:102px !important;height:76px !important;}
.ascent-face .sprite4.sprite-penguin.medium{width:120px !important;height:88px !important;}
.ascent-face .sprite4.sprite-penguin.large{width:134px !important;height:98px !important;}
.ascent-face .sprite4.sprite-penguin.xl,
.ascent-face .sprite4.sprite-penguin.xlarge{width:154px !important;height:112px !important;}


/* Energy colors */
.energy-orb{background:#3aa0ff;} /* normal EN blue */
.energy-orb.bonus{background:#36c36c;} /* bonus EN green */


/* Final select-panel sprite sizing fixes */
.bird-portrait .sprite4.large,
.bird-portrait .sprite4.xl,
.bird-portrait .sprite4.xlarge{
  width:112px !important;
  height:112px !important;
}

/* Species tuning requested */

/* Robin sheet reads large vs frame; keep small-bird sizes tighter than default .small */
.sprite4.sprite-robin.tiny{width:46px !important;height:46px !important;}
.sprite4.sprite-robin.small{width:54px !important;height:54px !important;}
.sprite4.sprite-robin.medium{width:68px !important;height:68px !important;}
.sprite4.sprite-seagull.medium{
  width:84px !important;
  height:84px !important;
}


/* Mobile landscape support */
@media (max-width: 960px) and (orientation: landscape){
  .battle-layout{grid-template-rows:auto auto 1fr auto;gap:8px;}
  .avatars{gap:10px;}
  .avatar-wrap{height:auto !important;min-height:112px;}
  #actions-grid{max-height:38vh;overflow:auto;padding-right:4px;}
  .screen{padding:8px;}
}


/* Shop/Grove top alignment */
#screen-stork-shop,#screen-grove{padding-top:0 !important;}
.stork-shop-inner,.grove-inner{margin-top:0 !important;}

.levelup-choice-title{padding:8px 0;font-family:'Cinzel',serif;font-size:.95rem;letter-spacing:.08em;color:var(--gold-light);text-transform:uppercase;}

.nest-ab-path{margin-top:6px;font-size:.7rem;line-height:1.35;color:var(--text-dim);background:rgba(0,0,0,.2);border:1px solid rgba(201,168,76,.2);border-radius:6px;padding:6px;}
.btn-mod{display:block;font-size:.62rem;color:var(--gold-light);opacity:.9;line-height:1.2;}

/* ===== Battle UI Redesign: Tactical Roguelike Layout ===== */
#screen-battle{background:radial-gradient(1100px 420px at 50% -80px, rgba(40,80,40,.14), transparent 62%),linear-gradient(180deg,#070c07 0%,#090e09 55%,#0b110b 100%);position:relative;overflow:hidden;}
.battle-screen-inner{position:relative;display:flex;flex-direction:column;min-height:100%;flex:1;}
.battle-arena-layer{position:absolute;inset:0;z-index:0;pointer-events:none;}
.battle-arena-backdrop{position:absolute;inset:0;background-position:center center;background-size:cover;background-repeat:no-repeat;opacity:0;transition:opacity .45s ease;}
#battle-arena-layer.arena-has-art .battle-arena-backdrop{opacity:.92;}
#battle-arena-layer.arena-has-art .battle-arena-vignette{background:radial-gradient(ellipse 100% 85% at 50% 45%, transparent 35%, rgba(4,8,4,.45) 78%, rgba(0,0,0,.55) 100%);box-shadow:inset 0 0 60px rgba(0,0,0,.25);}
#battle-arena-layer.arena-has-art .battle-arena-floor{opacity:.35;}
#screen-battle .combatant-panel{background:transparent;border:none;box-shadow:none;}
#screen-battle .combatant-panel::before{display:none;}
#screen-battle .combatant-panel.player,#screen-battle .combatant-panel.enemy,#screen-battle .combatant-panel.boss-panel{border:none;box-shadow:none;}
#screen-battle .combatant-name{text-shadow:0 1px 4px rgba(0,0,0,.85),0 0 8px rgba(0,0,0,.6);}
#screen-battle #player-avatar .sprite4,#screen-battle #enemy-avatar .sprite4{border-radius:0;}
.battle-arena-vignette{position:absolute;inset:0;background:radial-gradient(ellipse 95% 75% at 50% 42%, transparent 18%, rgba(4,8,4,.78) 72%, rgba(0,0,0,.88) 100%);box-shadow:inset 0 0 100px rgba(0,0,0,.5);}
.battle-arena-floor{position:absolute;left:0;right:0;bottom:0;height:32%;background:linear-gradient(180deg,transparent,rgba(0,0,0,.42));pointer-events:none;}
.tactical-topbar{display:flex;align-items:center;justify-content:center;gap:12px;padding:0 14px;min-height:0;}
.topbar-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.topbar-left .sound-btn{margin-left:2px;}
.topbar-center{text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;}
.topbar-battle-btns{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px 20px;width:100%;max-width:min(520px,100%);}
.topbar-battle-btns .nest-btn,.topbar-battle-btns .menu-btn{margin:0;white-space:nowrap;}
#screen-battle .tactical-topbar .battle-caption{position:static;left:auto;top:auto;transform:none;padding:0;margin:0;min-height:0;border:none;background:transparent;box-shadow:none;pointer-events:none;opacity:0;font-size:.72rem;color:var(--gold-light);transition:opacity .25s ease;}
#screen-battle .tactical-topbar .battle-caption.show{opacity:1;padding:4px 10px;margin-bottom:2px;border:1px solid rgba(201,168,76,.45);border-radius:8px;background:rgba(10,14,22,.88);}
.battle-abandon-btn{color:var(--red-light)!important;border-color:rgba(201,76,76,.45)!important;}
.battle-abandon-btn:hover{border-color:var(--red-light)!important;background:rgba(201,76,76,.12)!important;}
.shiny-topbar{font-size:.78rem;color:var(--gold-light);background:rgba(201,168,76,.12);border:1px solid rgba(201,168,76,.3);border-radius:999px;padding:3px 10px;}

#screen-battle .combatants,.tactical-battlefield{min-height:clamp(200px,38vh,420px);}
.tactical-battlefield{grid-template-columns:1fr 1fr;align-items:stretch;direction:ltr;gap:10px;}
#screen-battle .combatant-panel{display:flex;flex-direction:column;height:100%;}
#screen-battle .avatar-wrap{flex:1 1 auto;display:flex;align-items:center;justify-content:center;margin:0;}
.combatant-meta{font-size:.7rem;color:var(--text-dim);letter-spacing:.08em;text-transform:uppercase;margin-bottom:2px;}
#player-class-label,#enemy-class-label{cursor:help;}
.tactical-center{display:none;}
.center-banner{font-family:'Cinzel',serif;color:var(--gold-light);font-size:.76rem;letter-spacing:.12em;text-transform:uppercase;border:1px solid rgba(201,168,76,.3);border-radius:999px;padding:5px 12px;background:rgba(201,168,76,.08);}
.tactical-exp-row{width:100%;padding:8px 10px;}

.en-bar-wrap{margin-top:-2px;margin-bottom:7px;}
.en-bar-bg{height:10px;border-color:rgba(106,138,232,.3);background:linear-gradient(180deg,rgba(10,14,24,.95),rgba(20,24,40,.84));}
.en-bar-fill{background:linear-gradient(90deg,#2f6cca,#5ea5ff);box-shadow:0 0 10px rgba(106,138,232,.35);}
.arm-bar-wrap,.marm-bar-wrap{margin-top:-2px;margin-bottom:7px;}
.arm-bar-bg{height:10px;border-color:rgba(230,235,245,.35);background:linear-gradient(180deg,rgba(12,14,18,.95),rgba(22,26,32,.84));}
.arm-bar-fill{background:linear-gradient(90deg,#d8dde6,#ffffff);box-shadow:0 0 10px rgba(255,255,255,.32);}
.marm-bar-bg{height:10px;border-color:rgba(140,190,240,.35);background:linear-gradient(180deg,rgba(8,14,22,.95),rgba(14,22,34,.84));}
.marm-bar-fill{background:linear-gradient(90deg,#6eb6ea,#b8dcff);box-shadow:0 0 10px rgba(140,200,255,.35);}
.arm-bar-wrap .hp-label span:first-child{color:#f0f2f6;letter-spacing:.05em;}
.marm-bar-wrap .hp-label span:first-child{color:#a8d0f5;letter-spacing:.05em;}
.stat-arm .stat-k,.stat-arm .stat-v{color:#f0f2f6;}
.stat-marm .stat-k,.stat-marm .stat-v{color:#a8d0f5;}

#screen-battle .action-panel.tactical-action-tray{background:linear-gradient(180deg,rgba(4,8,4,.5),rgba(3,6,3,.5));border:1px solid rgba(200,160,32,.25);border-radius:14px;padding:14px 14px 12px;margin-top:6px;box-shadow:none;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);}
.tactical-action-tray{background:linear-gradient(180deg,rgba(4,8,4,.5),rgba(3,6,3,.5));border:1px solid rgba(200,160,32,.25);border-radius:14px;padding:14px 14px 12px;margin-top:6px;box-shadow:none;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);}
.tactical-action-tray h3{margin-bottom:10px;font-size:.86rem;letter-spacing:.1em;padding-bottom:6px;border-bottom:1px solid rgba(200,160,32,.14);}
#screen-battle .actions-grid-footer{margin-top:4px;padding-top:6px;border-top:1px solid rgba(200,160,32,.15);}
#screen-battle .actions-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.action-btn{min-height:120px;min-width:0;padding:9px 10px;border-radius:10px;gap:4px;align-items:stretch;}
#screen-battle.combat-arr--compact .action-btn,
body.ui-mobile-mode #screen-battle .action-btn{
  min-height:calc(88px * var(--combat-action-scale) / 100);
}
#screen-battle.combat-arr--compact .btn-desc,
body.ui-mobile-mode #screen-battle .btn-desc{
  min-height:20px;
}
@media (max-width:520px){
  #screen-battle[data-ability-count="6"] .actions-grid,
  #screen-battle[data-ability-count="7"] .actions-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

/* Equipment v0.3 — six action sources (Phase 9) */
#screen-battle.equipment-v2-mode .actions-grid,
.actions-grid--equipment-v2{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
#screen-battle.equipment-v2-mode .action-btn--empty{
  opacity:.62;
  border-style:dashed;
  cursor:not-allowed;
}
#screen-battle.equipment-v2-mode .btn-source-chip{
  font-size:.56rem;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--gold-light);
  border:1px solid rgba(201,168,76,.35);
  border-radius:999px;
  padding:0 5px;
  line-height:1.35;
}
.nest-ultimate-bank{margin-bottom:12px;}
.nest-ultimate-bank-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(100%,200px),1fr));
  gap:10px;
}
.nest-ult-bank-card{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(201,168,76,.28);
  background:rgba(12,10,6,.55);
}
.nest-ult-bank-card.is-active{
  border-color:rgba(232,201,106,.65);
  box-shadow:0 0 0 1px rgba(232,201,106,.15) inset;
}
.nest-ult-bank-card.is-banked{opacity:.92;}
.nest-ult-bank-src{font-size:.68rem;line-height:1.3;}
.nest-ult-pick-btn{
  margin-top:4px;
  width:100%;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid rgba(201,168,76,.45);
  background:linear-gradient(145deg,rgba(55,48,32,.95),rgba(35,30,22,.98));
  color:var(--gold-light);
  font-family:'Cinzel',serif;
  font-size:.72rem;
  letter-spacing:.04em;
  cursor:pointer;
}
.nest-ult-pick-btn.active,
.nest-ult-pick-btn:hover{border-color:var(--gold);color:#fff4d0;}
.nest-equip-grid--v2{
  grid-template-columns:repeat(4,minmax(0,1fr));
}
@media (max-width:720px){
  .nest-equip-grid--v2{grid-template-columns:repeat(2,minmax(0,1fr));}
}
.nest-hand-badge{
  display:inline-block;
  margin-left:4px;
  font-size:.62rem;
  font-family:'Cinzel',serif;
  color:var(--gold-light);
  border:1px solid rgba(201,168,76,.35);
  border-radius:999px;
  padding:0 5px;
  vertical-align:middle;
}
.nest-ultimate-options{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}
.nest-ult-pick-btn{
  font-family:'Cinzel',serif;
  font-size:.72rem;
  color:var(--text);
  background:rgba(20,24,32,.75);
  border:1px solid rgba(201,168,76,.35);
  border-radius:8px;
  padding:8px 10px;
  cursor:pointer;
}
.nest-ult-pick-btn.active,
.nest-ult-pick-btn:hover{
  border-color:var(--gold);
  background:rgba(201,168,76,.12);
}
@media (min-width:900px){
  #screen-battle.equipment-v2-mode .actions-grid,
  .actions-grid--equipment-v2{
    grid-template-columns:repeat(6,minmax(0,1fr));
  }
}
@media (max-width:520px){
  #screen-battle.equipment-v2-mode .actions-grid,
  .actions-grid--equipment-v2{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
#screen-battle .action-btn.endturn-mini{min-height:unset;padding:2px 14px;min-width:unset;font-size:.54rem;line-height:1;border-width:1px;border-radius:999px;background:rgba(40,45,58,.65);align-self:center;}
#screen-battle .actions-grid-footer .end-turn-bar__btn{padding:2px 14px;font-size:.54rem;line-height:1;}
.btn-name{font-size:.83rem;line-height:1.2;}
.btn-type{font-size:.62rem;opacity:.95;}
.btn-cost{font-size:.72rem;}
.btn-desc{font-size:.63rem;color:#b8c7d8;line-height:1.2;display:block;min-height:28px;}
#screen-battle .btn-desc-full{font-size:.66rem;line-height:1.35;}
#screen-battle .btn-desc-line{font-size:.58rem;line-height:1.22;}
#screen-battle .btn-dmg-row .btn-dmg-est{font-size:.72rem;}
#screen-battle .btn-stat-preview{font-size:.57rem;margin-top:2px;}
#screen-battle .btn-dmg-hybrid{font-size:.55rem;gap:3px 6px;}
#screen-battle .btn-dmg-atk,#screen-battle .btn-dmg-matk{font-size:.54rem;}

.battle-support-area{display:grid;grid-template-columns:1fr;gap:10px;align-items:start;}
.battle-log-section{display:flex;flex-direction:column;gap:6px;min-width:0;}
.battle-log-toggle{display:none;align-items:center;justify-content:space-between;width:100%;font-family:'Cinzel',serif;font-size:.76rem;letter-spacing:.06em;color:var(--gold);background:rgba(200,160,32,.08);border:1px solid rgba(200,160,32,.3);border-radius:8px;padding:7px 11px;cursor:pointer;transition:background .2s;}
.battle-log-toggle:hover{background:rgba(200,160,32,.16);}
.battle-log-toggle::after{content:'▾';font-size:.72rem;opacity:.85;transition:transform .2s;}
.battle-log-section.collapsed .battle-log-toggle::after{transform:rotate(-90deg);}
@media (max-width:900px){
  .battle-log-toggle{display:flex;}
  .battle-log-section.collapsed .battle-log{max-height:0;min-height:0!important;padding:0!important;border-width:0!important;margin:0;opacity:0;overflow:hidden!important;pointer-events:none;}
}
.battle-log{height:94px;font-size:.8rem;line-height:1.35;padding:8px 10px;transition:opacity .25s ease,max-height .3s ease;}
.intent-type{font-size:.62rem;letter-spacing:.08em;text-transform:uppercase;color:#ffbd8a;border:1px solid rgba(232,160,64,.45);border-radius:999px;padding:1px 7px;background:rgba(232,160,64,.14);}
.enemy-intent{margin-top:8px;}
#screen-battle .enemy-intent.enemy-plan,#screen-battle #enemy-intent-panel.enemy-intent{font-size:.86rem;line-height:1.35;padding:11px 14px;border-radius:999px;border:1px solid rgba(232,140,90,.45);background:linear-gradient(165deg,rgba(48,18,16,.72),rgba(14,8,8,.58));box-shadow:0 0 0 1px rgba(0,0,0,.35),0 6px 18px rgba(0,0,0,.28);margin-top:10px;font-weight:600;}
#screen-battle .enemy-plan .intent-name{font-size:.9rem;}

@media (max-width: 1100px){
  .tactical-topbar{flex-wrap:wrap;}
  .topbar-left{justify-content:center;flex-wrap:wrap;}
  .tactical-battlefield{grid-template-columns:1fr;}
  .tactical-center{order:2;}
  .actions-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .battle-support-area{grid-template-columns:1fr;}
  .topbar-battle-btns{gap:8px 12px;max-width:100%;}
  .avatar-wrap{height:110px;}
}

@media (min-width: 900px){
  #bird-grid, .battle-log, .ref-guide-modal-scroll{
    scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);
  }
  #bird-grid::-webkit-scrollbar, .battle-log::-webkit-scrollbar{width:8px;height:8px;}
  #bird-grid::-webkit-scrollbar-thumb, .battle-log::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);}
  #bird-grid::-webkit-scrollbar-track, .battle-log::-webkit-scrollbar-track{background:var(--scrollbar-track);}
  #bird-grid:hover::-webkit-scrollbar-thumb, .battle-log:hover::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb-hover);}
}


/* Nest ability vault + mutate */
.nest-ab-slot-card{background:var(--surface2);border:1px solid var(--border);border-radius:10px;padding:12px;transition:border-color .15s;}
.nest-ab-slot-card.selected{border-color:var(--gold);box-shadow:0 0 0 1px rgba(201,168,76,.35);}
.nest-ab-slot-card.empty{opacity:.85;border-style:dashed;}
.nest-ab-slot-card.is-tier-locked{opacity:.55;border-style:dashed;border-color:rgba(120,130,150,.35);background:rgba(8,12,18,.5);}
.nest-ab-slot-card.nest-ab-slot-missing{border-color:rgba(220,120,80,.55);box-shadow:0 0 0 1px rgba(220,120,80,.2);}
.nest-ab-warn{font-size:.72rem;color:#e8a060;line-height:1.35;margin-top:4px;}
.nest-ab-warn code{font-size:.68rem;color:#f0c090;}
.nest-ab-lock-tag{font-size:.62rem;color:var(--text-dim);letter-spacing:.05em;text-transform:uppercase;border:1px solid rgba(120,130,150,.35);border-radius:4px;padding:1px 6px;}
.nest-ab-slot-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;}
.nest-ab-slot-idx{font-size:.68rem;color:var(--text-dim);letter-spacing:.06em;text-transform:uppercase;}
.nest-ab-unequip-btn{font-size:.65rem;padding:2px 8px;border-radius:6px;border:1px solid rgba(201,168,76,.4);background:rgba(201,168,76,.08);color:var(--gold);cursor:pointer;}
.nest-ab-unequip-btn:hover{background:rgba(201,168,76,.18);}
.nest-ability-vault-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px;margin-top:8px;}
.nest-ab-vault-item{background:var(--surface2);border:1px dashed rgba(201,168,76,.35);border-radius:8px;padding:10px;cursor:pointer;font-size:.82rem;transition:all .15s;}
.nest-ab-vault-item:hover{border-color:var(--gold);background:rgba(201,168,76,.08);}
.nest-equip-locked .nest-ab-slot-card.is-locked,
.nest-equip-locked .nest-ab-vault-item.is-locked{cursor:not-allowed;opacity:.65;filter:saturate(.65);}
.nest-equip-locked .nest-ab-vault-item.is-locked:hover{border-color:rgba(201,168,76,.35);background:var(--surface2);}
.nest-ab-unequip-btn.is-locked,
.nest-ab-unequip-btn:disabled{opacity:.45;cursor:not-allowed;border-color:var(--border);background:var(--surface2);color:var(--text-dim);}
.nest-mutate-btn{margin-top:8px;width:100%;padding:6px 10px;border-radius:8px;border:1px solid rgba(168,106,232,.55);background:rgba(168,106,232,.15);color:var(--purple-light);font-family:"Cinzel",serif;font-size:.72rem;cursor:pointer;letter-spacing:.04em;}
.nest-mutate-btn:hover:not(.disabled):not(:disabled){background:rgba(168,106,232,.28);}
.nest-mutate-btn.disabled,.nest-mutate-btn:disabled{opacity:.45;cursor:not-allowed;border-color:var(--border);background:var(--surface2);color:var(--text-dim);}

/* Map Forge (BuildNest) */
#screen-map-forge{
  overflow:auto;
  background:linear-gradient(180deg,#06080c,#0a0e14);
  min-height:calc(100dvh - 16px);
}
.map-forge-inner{
  max-width:none;
  width:100%;
  margin:0 auto;
  padding:12px 14px 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:calc(100dvh - 24px);
  box-sizing:border-box;
}
.map-forge-head{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px 18px;
}
.map-forge-head-left{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;min-width:0;}
.map-forge-title{
  font-family:'Cinzel',serif;
  font-size:clamp(1rem,3vw,1.35rem);
  color:var(--gold-light);
  margin:0;
  letter-spacing:.06em;
  width:100%;
}
.map-forge-name-label{font-size:.72rem;color:var(--text-dim);}
.mission-test-map-wrap{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:0 0 12px;
}
.mission-test-map-label{font-size:.72rem;color:var(--text-dim);}
.mission-test-map-select{max-width:320px;}
.mission-test-map-readout{
  display:block;
  margin-top:4px;
  font-size:.78rem;
  color:var(--gold-light,#c9a84c);
  letter-spacing:.03em;
}
.map-forge-name-input,.map-forge-draft-select{
  background:rgba(8,10,14,.85);
  border:1px solid rgba(201,168,76,.35);
  border-radius:8px;
  color:var(--text);
  padding:6px 10px;
  font-size:.85rem;
  min-width:140px;
}
.map-forge-head-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;}
.map-forge-btn-accent{border-color:rgba(96,136,58,.55)!important;color:#b8e070!important;}
.map-forge-status{min-height:1.2em;font-size:.78rem;margin:0;color:var(--text-dim);}
.map-forge-status--warn{color:#e8c060!important;}
.map-forge-body{
  display:grid;
  grid-template-columns:minmax(260px,320px) 1fr;
  gap:14px;
  align-items:stretch;
  flex:1;
  min-height:0;
}
.map-forge-sidebar{
  display:flex;
  flex-direction:column;
  gap:10px;
  background:rgba(8,10,14,.72);
  border:1px solid rgba(201,168,76,.22);
  border-radius:12px;
  padding:12px;
}
.map-forge-toolbar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;}
.map-forge-toolbar-label{font-size:.7rem;color:var(--text-dim);width:100%;}
.map-forge-tool-btn,.map-forge-tool-btn.is-active{
  font-family:'Cinzel',serif;
  font-size:.72rem;
  padding:6px 10px;
  border-radius:8px;
  border:1px solid rgba(201,168,76,.35);
  background:rgba(201,168,76,.06);
  color:var(--gold);
  cursor:pointer;
}
.map-forge-tool-btn.is-active{background:rgba(201,168,76,.22);border-color:var(--gold);}
.map-forge-tool-danger{border-color:rgba(180,60,60,.45)!important;color:#ff9090!important;}
.map-forge-upload-label{display:block;cursor:pointer;}
.map-forge-upload-label .menu-btn{width:100%;text-align:center;}
.map-forge-node-editor{display:flex;flex-direction:column;gap:6px;padding-top:6px;border-top:1px solid rgba(201,168,76,.16);}
.map-forge-field-label{font-size:.68rem;color:var(--text-dim);}
.map-forge-field-input{
  background:rgba(4,6,10,.9);
  border:1px solid rgba(201,168,76,.28);
  border-radius:6px;
  color:var(--text);
  padding:5px 8px;
  font-size:.82rem;
}
.map-forge-field-check{font-size:.78rem;color:var(--text-dim);display:flex;align-items:center;gap:6px;}
.map-forge-node-list-wrap{flex:1;min-height:0;display:flex;flex-direction:column;gap:4px;}
.map-forge-node-list-title{font-family:'Cinzel',serif;font-size:.72rem;color:var(--gold-dim,var(--gold-light));letter-spacing:.08em;}
.map-forge-node-list{
  overflow-y:auto;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:4px;
  max-height:220px;
}
.map-forge-node-row{
  display:flex;
  gap:4px;
  align-items:stretch;
}
.map-forge-node-row.is-selected .map-forge-node-pick{border-color:var(--gold);background:rgba(201,168,76,.14);}
.map-forge-node-pick{
  flex:1;
  text-align:left;
  font-size:.72rem;
  padding:5px 8px;
  border-radius:6px;
  border:1px solid rgba(201,168,76,.22);
  background:rgba(4,6,10,.6);
  color:var(--text);
  cursor:pointer;
}
.map-forge-node-move{
  width:28px;
  flex-shrink:0;
  border:1px solid rgba(201,168,76,.22);
  background:rgba(4,6,10,.6);
  color:var(--gold);
  border-radius:6px;
  cursor:pointer;
  font-size:.75rem;
}
.map-forge-node-move:disabled{opacity:.35;cursor:not-allowed;}
.map-forge-breadcrumb{font-size:.72rem;color:var(--gold-dim,var(--text-dim));margin:0 0 4px;font-family:'Cinzel',serif;letter-spacing:.06em;}
.map-forge-encounter-panel,.map-forge-bonus-panel,.map-forge-clear-rewards-panel{display:flex;flex-direction:column;gap:6px;padding-top:8px;border-top:1px solid rgba(201,168,76,.16);}
.map-forge-panel-tabs{display:flex;gap:4px;margin:8px 0 6px;border-bottom:1px solid rgba(201,168,76,.2);padding-bottom:4px;}
.map-forge-panel-tab{flex:1;padding:6px 10px;border:1px solid rgba(201,168,76,.22);border-radius:6px;background:rgba(8,12,8,.4);color:var(--muted,#a8a090);font-family:'Cinzel',serif;font-size:.75rem;letter-spacing:.06em;cursor:pointer;}
.map-forge-panel-tab.is-active{background:rgba(201,168,76,.14);border-color:var(--gold,#c9a84c);color:var(--gold,#c9a84c);}
.map-forge-panel-pane{display:none;flex-direction:column;gap:6px;}
.map-forge-panel-pane.is-active{display:flex;}
.map-forge-shop-panel{display:flex;flex-direction:column;gap:6px;padding-top:8px;border-top:1px solid rgba(201,168,76,.16);}
.map-forge-shop-tab-row{justify-content:flex-start;margin:4px 0 8px;}
.map-forge-shop-stock-list{display:flex;flex-direction:column;gap:4px;max-height:240px;overflow:auto;}
.map-forge-shop-stock-row{display:flex;align-items:center;gap:8px;font-size:.72rem;color:var(--text-dim);padding:4px 0;}
.map-forge-shop-stock-row span{flex:1;min-width:0;}
.map-forge-path-order-field{display:flex;flex-direction:column;gap:4px;}
.map-forge-clear-reward-card{flex-wrap:wrap;align-items:center;gap:6px;padding:8px;border:1px solid rgba(201,168,76,.14);border-radius:8px;background:rgba(0,0,0,.18);}
.map-forge-reward-chance{display:inline-flex;align-items:center;gap:2px;font-size:.7rem;color:var(--muted,#a8a090);}
.map-forge-reward-chance .map-forge-reward-num{width:3.2em;}
.map-forge-reward-mutation-id{min-width:8em;flex:1;}
.map-forge-advanced{
  padding:6px 0;
  border-top:1px solid rgba(201,168,76,.12);
}
.map-forge-advanced summary{
  cursor:pointer;
  font-size:.7rem;
  color:var(--text-dim);
  list-style:none;
  user-select:none;
}
.map-forge-advanced summary::-webkit-details-marker{display:none;}
.map-forge-advanced[open] summary{margin-bottom:6px;color:var(--gold-dim,var(--gold-light));}
.map-forge-encounter-presets{display:flex;flex-wrap:wrap;gap:6px;align-items:center;}
.map-forge-encounter-row{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:8px;
  padding:6px;
  border:1px solid rgba(201,168,76,.14);
  border-radius:8px;
  background:rgba(4,6,10,.35);
}
.map-forge-encounter-row-head{
  font-family:'Cinzel',serif;
  font-size:.68rem;
  color:var(--gold-dim,var(--gold-light));
  letter-spacing:.06em;
}
.map-forge-encounter-row-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
}
.map-forge-encounter-field{
  display:flex;
  flex-direction:column;
  gap:2px;
  font-size:.62rem;
  color:var(--text-dim);
}
.map-forge-encounter-field--wide{grid-column:1/-1;}
.map-forge-variant-summary{
  font-size:.62rem;
  color:var(--gold-dim,var(--gold-light));
  font-style:italic;
  margin-top:2px;
}
.map-forge-label-ui-hint{margin:2px 0 6px;font-size:.62rem;}
.map-forge-label-panel{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding-top:8px;
  margin-top:6px;
  border-top:1px solid rgba(201,168,76,.16);
}
.map-forge-field-range{
  width:100%;
  accent-color:var(--gold,#c9a84c);
  cursor:pointer;
}
.map-forge-field-color{
  width:100%;
  height:32px;
  padding:2px;
  border:1px solid rgba(201,168,76,.28);
  border-radius:4px;
  background:rgba(0,0,0,.35);
  cursor:pointer;
}
.map-forge-nest-slots{display:flex;flex-direction:column;gap:4px;width:100%;}
.map-forge-nest-slot-row{display:flex;align-items:center;gap:6px;font-size:.68rem;}
.map-forge-nest-slot-label{min-width:3.5em;color:var(--text-dim);}
.map-forge-clear-rewards-add select{flex:1;min-width:8em;}
.map-forge-clear-reward-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:.72rem;color:var(--text-dim);padding:4px 0;}
.map-forge-reward-type-label{min-width:4.5em;font-family:'Cinzel',serif;font-size:.68rem;color:var(--gold-dim,var(--gold-light));}
.map-forge-reward-num{width:3.5em;padding:4px 6px;font-size:.72rem;background:rgba(0,0,0,.35);border:1px solid rgba(201,168,76,.22);color:var(--text);border-radius:3px;}
.map-forge-reward-dash{color:var(--text-dim);}
.map-forge-reward-tier{flex:1;min-width:8em;}
.map-forge-clear-rewards-add{display:flex;flex-wrap:wrap;gap:6px;}
.map-forge-bonus-reward-row{display:flex;justify-content:space-between;align-items:center;font-size:.72rem;color:var(--text-dim);padding:4px 0;}
.map-forge-canvas-wrap{
  position:relative;
  background:#060804;
  border:1px solid rgba(201,168,76,.28);
  border-radius:12px;
  overflow:hidden;
  aspect-ratio:1536/1024;
  max-height:min(72vh,720px);
  min-height:280px;
}
@media (min-width:1024px){
  .map-forge-body{min-height:min(82vh,900px);}
  .map-forge-canvas-wrap{
    height:100%;
    min-height:520px;
    max-height:min(88vh,980px);
    aspect-ratio:auto;
  }
}
.map-forge-canvas-wrap.is-grab-tool{cursor:grab;}
.map-forge-canvas-wrap.is-grab-tool.is-panning{cursor:grabbing;}
.map-forge-canvas-wrap.is-grab-tool .map-forge-svg{cursor:grab;}
.map-forge-canvas-wrap.is-grab-tool.is-panning .map-forge-svg{cursor:grabbing;}
.map-forge-canvas-wrap.is-panning{user-select:none;}
.map-forge-canvas-wrap.is-space-pan{cursor:grab;}
.map-forge-canvas-wrap.is-space-pan.is-panning{cursor:grabbing;}
.map-forge-canvas-inner{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  will-change:transform;
}
.map-forge-bg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:fill;
  pointer-events:none;
}
.map-forge-svg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
}
.map-forge-minimap{
  position:absolute;
  right:8px;
  bottom:8px;
  width:160px;
  height:107px;
  border:1px solid rgba(201,168,76,.45);
  border-radius:6px;
  cursor:crosshair;
  z-index:4;
  box-shadow:0 2px 10px rgba(0,0,0,.45);
}
.map-forge-fight-btn{
  position:absolute;
  left:8px;
  bottom:8px;
  z-index:4;
}
.map-forge-arena-preview{
  display:block;
  margin:4px 0 8px;
  border:1px solid rgba(201,168,76,.28);
  border-radius:6px;
  background:rgba(0,0,0,.35);
  object-fit:cover;
}
.map-forge-validation-wrap{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding-top:8px;
  border-top:1px solid rgba(201,168,76,.16);
}
.map-forge-validation-panel{
  display:flex;
  flex-direction:column;
  gap:4px;
  max-height:140px;
  overflow:auto;
}
.map-forge-validation-row{
  text-align:left;
  font-size:.68rem;
  padding:5px 8px;
  border-radius:4px;
  border:1px solid transparent;
  cursor:pointer;
  background:rgba(0,0,0,.25);
  color:var(--text-dim);
}
.map-forge-validation-row:hover{border-color:rgba(201,168,76,.35);color:var(--text);}
.map-forge-validation-error{color:#ff9090;border-color:rgba(180,60,60,.35);}
.map-forge-validation-warning{color:#e8c060;border-color:rgba(200,160,40,.3);}
.map-forge-validation-ok{font-size:.72rem;color:#90c870;padding:4px 0;}
.map-forge-map-summary{
  font-size:.7rem;
  color:var(--text-dim);
  padding:6px 0;
  border-top:1px solid rgba(201,168,76,.16);
  line-height:1.4;
}
.map-forge-hint{
  font-size:.65rem;
  color:var(--text-dim);
  margin:6px 0 0;
  line-height:1.35;
}
.map-forge-filter-row{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin:4px 0;
}
.map-forge-filter-btn{
  font-size:.65rem;
  padding:3px 8px;
  border-radius:3px;
  border:1px solid rgba(201,168,76,.22);
  background:rgba(0,0,0,.25);
  color:var(--text-dim);
  cursor:pointer;
}
.map-forge-filter-btn.is-active{background:rgba(201,168,76,.2);border-color:var(--gold);color:var(--text);}
.map-forge-bulk-chk{margin-right:4px;flex-shrink:0;}
.map-forge-bulk-actions{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0;}
.map-forge-encounter-presets{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px;}
.map-forge-boss-stats-panel{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding-top:6px;
  border-top:1px dashed rgba(201,168,76,.2);
}
.map-forge-boss-stat-row{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:.68rem;
  color:var(--text-dim);
  text-transform:capitalize;
}
.map-forge-world-rename{padding-top:4px;}
@media (max-width:900px){
  .map-forge-body{grid-template-columns:1fr;min-height:auto;}
  .map-forge-canvas-wrap{max-height:50vh;}
}

/* ===== Combat layout scale (Display settings) — authoritative ===== */
#screen-battle .avatar-wrap{
  flex:1 1 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:calc(148px * var(--combat-avatar-scale) / 100) !important;
  height:auto !important;
  min-width:calc(160px * var(--combat-avatar-scale) / 100) !important;
  margin:0 !important;
}
#screen-battle .avatar-inner{
  transform:scale(calc(var(--combat-avatar-scale) / 100));
  transform-origin:center bottom;
}
#screen-battle .combatant-panel{
  display:flex;
  flex-direction:column;
  height:100%;
  padding:calc(12px * var(--combat-combatants-scale) / 100) calc(10px * var(--combat-combatants-scale) / 100) !important;
}
#screen-battle .combatant-name{
  font-size:calc(.9rem * var(--combat-combatants-scale) / 100) !important;
}
#screen-battle .action-panel{
  padding:calc(12px * var(--combat-action-scale) / 100) !important;
}
#screen-battle .actions-grid{
  gap:calc(6px * var(--combat-action-scale) / 100) !important;
}
#screen-battle .action-btn{
  padding:calc(6px * var(--combat-action-scale) / 100) calc(8px * var(--combat-action-scale) / 100) !important;
  font-size:calc(.78rem * var(--combat-action-scale) / 100) !important;
}
#screen-battle .battle-log{
  height:calc(120px * var(--combat-log-scale) / 100) !important;
  font-size:calc(.8rem * var(--combat-log-scale) / 100) !important;
}
#screen-battle .action-btn.endturn-mini{
  min-height:unset !important;
  padding:2px 14px !important;
  font-size:.54rem !important;
  line-height:1 !important;
}
body.ui-mobile-mode #screen-battle .avatar-wrap{
  min-height:calc(70px * var(--combat-avatar-scale) / 100) !important;
  height:auto !important;
  min-width:calc(70px * var(--combat-avatar-scale) / 100) !important;
  margin:0 !important;
}
body.ui-mobile-mode #screen-battle .avatar-inner{
  font-size:calc(2.4rem * var(--combat-avatar-scale) / 100);
}
body.ui-mobile-mode #screen-battle .combatant-panel{
  padding:calc(9px * var(--combat-combatants-scale) / 100) calc(8px * var(--combat-combatants-scale) / 100) calc(8px * var(--combat-combatants-scale) / 100) !important;
}
body.ui-mobile-mode #screen-battle .combatant-name{
  font-size:calc(.8rem * var(--combat-combatants-scale) / 100) !important;
}
body.ui-mobile-mode #screen-battle .action-panel{
  padding:calc(8px * var(--combat-action-scale) / 100) !important;
}
body.ui-mobile-mode #screen-battle .actions-grid{
  gap:calc(5px * var(--combat-action-scale) / 100) !important;
}
body.ui-mobile-mode #screen-battle .action-btn{
  padding:calc(5px * var(--combat-action-scale) / 100) calc(7px * var(--combat-action-scale) / 100) !important;
  font-size:calc(.74rem * var(--combat-action-scale) / 100) !important;
}
body.ui-mobile-mode #screen-battle .battle-log{
  height:calc(88px * var(--combat-log-scale) / 100) !important;
  font-size:calc(.72rem * var(--combat-log-scale) / 100) !important;
}

/* ===== Combat screen arrangements (Display settings) ===== */
#screen-battle.combat-arr--tactical .battle-layout{
  display:grid !important;
  grid-template-columns:minmax(0,1.65fr) minmax(240px,.75fr);
  grid-template-rows:auto minmax(300px,auto) auto;
  gap:12px 14px;
  align-items:start;
}
#screen-battle.combat-arr--tactical .battle-top,
#screen-battle.combat-arr--tactical .combatants{grid-column:1 / -1;}
#screen-battle.combat-arr--tactical .combatants{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  gap:clamp(16px,4vw,56px);
  padding:8px clamp(4px,3vw,36px) 14px;
  align-items:stretch;
}
#screen-battle.combat-arr--tactical .battle-below-combatants{display:contents;}
#screen-battle.combat-arr--tactical .action-panel{
  grid-column:1;
  border-color:rgba(201,168,76,.4);
  box-shadow:0 12px 28px rgba(0,0,0,.34),inset 0 1px rgba(255,255,255,.035);
}
#screen-battle.combat-arr--tactical .battle-support-area{grid-column:2;align-self:stretch;min-height:0;}
#screen-battle.combat-arr--tactical .battle-log-section{height:100%;display:flex;flex-direction:column;}
#screen-battle.combat-arr--tactical .battle-log{height:auto !important;min-height:180px;flex:1;}
#screen-battle.combat-arr--tactical .actions-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
#screen-battle.combat-arr--tactical .combatant-panel{padding-inline:clamp(10px,2vw,24px) !important;}
#screen-battle.combat-arr--tactical .combatant-name{text-align:center;font-size:1rem !important;}
#screen-battle.combat-arr--tactical .combatant-meta{text-align:center;}
@media(max-width:767px){
  #screen-battle.combat-arr--tactical .battle-layout{display:flex !important;flex-direction:column;gap:8px;}
  #screen-battle.combat-arr--tactical .combatants{grid-template-columns:1fr 1fr !important;gap:8px;padding:0;}
  #screen-battle.combat-arr--tactical .actions-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  #screen-battle.combat-arr--tactical .battle-log{min-height:88px;}
}

#screen-battle.combat-arr--classic .battle-layout{
  display:grid !important;
  grid-template-rows:auto auto 1fr auto auto;
  gap:13px;
  flex-direction:unset;
}
#screen-battle.combat-arr--classic .combatants{
  display:grid !important;
  grid-template-columns:1fr 1fr !important;
  order:unset;
  gap:10px;
}
#screen-battle.combat-arr--classic .combatants,
#screen-battle.combat-arr--classic .battle-below-combatants,
#screen-battle.combat-arr--classic .action-panel,
#screen-battle.combat-arr--classic .battle-support-area,
#screen-battle.combat-arr--classic #player-panel,
#screen-battle.combat-arr--classic #enemy-panel{
  order:unset;
}
#screen-battle.combat-arr--classic .enemy-abilities-list,
#screen-battle.combat-arr--classic .enemy-intent{
  display:block !important;
}

#screen-battle.combat-arr--compact .battle-layout{
  display:flex !important;
  flex-direction:column;
  gap:8px;
  grid-template-rows:unset;
}
#screen-battle.combat-arr--compact .combatants{
  display:grid !important;
  grid-template-columns:1fr 1fr;
  gap:8px;
  align-items:stretch;
}
#screen-battle.combat-arr--compact #player-panel{order:0;}
#screen-battle.combat-arr--compact #enemy-panel{order:1;}
#screen-battle.combat-arr--compact .combatant-panel{border-radius:10px;}
#screen-battle.combat-arr--compact .combatant-name{min-height:2.1em;}
#screen-battle.combat-arr--compact .avatar-wrap{margin:4px 0;}
#screen-battle.combat-arr--compact .hp-bar-bg{height:8px;}
#screen-battle.combat-arr--compact .hp-label{font-size:.66rem;margin-bottom:2px;}
#screen-battle.combat-arr--compact .status-effects{gap:3px;margin-top:4px;}
#screen-battle.combat-arr--compact .status-badge{font-size:.62rem;padding:1px 5px;}
#screen-battle.combat-arr--compact .enemy-abilities-list,
#screen-battle.combat-arr--compact .enemy-intent{display:none !important;}
#screen-battle.combat-arr--compact .combat-stats-btn{padding:4px 6px;font-size:.62rem;}
#screen-battle.combat-arr--compact .action-panel h3{margin-bottom:4px;font-size:.63rem;}
#screen-battle.combat-arr--compact .actions-grid{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr));
}
#screen-battle.combat-arr--compact .action-btn{min-width:0;width:100%;}
#screen-battle.combat-arr--compact .btn-name{font-size:.8rem;}
#screen-battle.combat-arr--compact .btn-type,
#screen-battle.combat-arr--compact .btn-cost{font-size:.62rem;}
#screen-battle.combat-arr--compact .energy-orb{width:10px;height:10px;}
#screen-battle.combat-arr--compact .energy-free-chip{width:10px;height:10px;min-width:10px;min-height:10px;}
#screen-battle.combat-arr--compact .energy-text{font-size:.62rem;}
#screen-battle.combat-arr--compact .combat-items-row{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;}
#screen-battle.combat-arr--compact .combat-item-btn{padding:4px 5px;font-size:.6rem;}
#screen-battle.combat-arr--compact .combat-item-label{font-size:.56rem;}
#screen-battle.combat-arr--compact .combat-item-meta{font-size:.48rem;}
#screen-battle.combat-arr--compact .battle-log{padding:8px 9px;}
#screen-battle.combat-arr--compact .battle-log-toggle{font-size:.7rem;padding:6px 9px;}
#screen-battle.combat-arr--compact .battle-top{padding:7px 9px;}
#screen-battle.combat-arr--compact .bird-lv,
#screen-battle.combat-arr--compact .level-badge{font-size:.7rem;}

#screen-battle.combat-arr--actionsFirst .battle-layout{
  display:flex !important;
  flex-direction:column;
  gap:8px;
  grid-template-rows:unset;
}
#screen-battle.combat-arr--actionsFirst .battle-top,
#screen-battle.combat-arr--actionsFirst .stage-progress-wrap,
#screen-battle.combat-arr--actionsFirst .encounter-preview-wrap,
#screen-battle.combat-arr--actionsFirst .tactical-exp-row{
  order:0;
  flex:0 0 auto;
}
#screen-battle.combat-arr--actionsFirst .battle-below-combatants{display:contents;}
#screen-battle.combat-arr--actionsFirst .action-panel{order:2;}
#screen-battle.combat-arr--actionsFirst .combatants{order:3;}
#screen-battle.combat-arr--actionsFirst .battle-support-area{order:4;}
#screen-battle.combat-arr--actionsFirst .combatants{
  display:grid !important;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
#screen-battle.combat-arr--actionsFirst .enemy-abilities-list,
#screen-battle.combat-arr--actionsFirst .enemy-intent{
  display:block !important;
}

#screen-battle.combat-arr--logFocus .battle-layout{
  display:flex !important;
  flex-direction:column;
  gap:8px;
}
#screen-battle.combat-arr--logFocus .battle-support-area .battle-log{
  min-height:calc(140px * var(--combat-log-scale) / 100) !important;
}
@media (min-width:768px){
  #screen-battle.combat-arr--logFocus .battle-layout{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(220px,34%);
    grid-template-rows:auto auto minmax(0,1fr) auto;
    gap:10px 12px;
    align-items:start;
  }
  #screen-battle.combat-arr--logFocus .battle-top,
  #screen-battle.combat-arr--logFocus .stage-progress-wrap,
  #screen-battle.combat-arr--logFocus .encounter-preview-wrap,
  #screen-battle.combat-arr--logFocus .tactical-exp-row{
    grid-column:1 / -1;
  }
  #screen-battle.combat-arr--logFocus .combatants{
    grid-column:1;
    grid-row:3;
    display:grid !important;
    grid-template-columns:1fr 1fr;
    gap:10px;
  }
  #screen-battle.combat-arr--logFocus .action-panel{
    grid-column:1;
    grid-row:4;
    order:unset;
  }
  #screen-battle.combat-arr--logFocus .battle-support-area{
    grid-column:2;
    grid-row:3 / span 2;
    display:flex;
    flex-direction:column;
    min-height:0;
    height:100%;
    align-self:stretch;
  }
  #screen-battle.combat-arr--logFocus .battle-log-section{
    flex:1;
    display:flex;
    flex-direction:column;
    min-height:0;
  }
  #screen-battle.combat-arr--logFocus .battle-log{
    flex:1;
    min-height:calc(280px * var(--combat-log-scale) / 100) !important;
    height:auto !important;
    max-height:none;
  }
}

#screen-battle.combat-arr--custom .battle-layout{
  display:flex !important;
  flex-direction:column;
  gap:8px;
}
#screen-battle.combat-arr--custom .combatants{
  display:contents;
}
#screen-battle.combat-arr--custom .battle-below-combatants{
  display:contents;
}
#screen-battle.combat-arr--custom [data-combat-panel].combat-panel-hidden{
  display:none !important;
}
#screen-battle.combat-arr--custom #player-panel,
#screen-battle.combat-arr--custom #enemy-panel{
  width:100%;
  max-width:none;
}

.combat-custom-panel-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin:12px 0;
  max-height:min(50vh,360px);
  overflow-y:auto;
}
.combat-custom-panel-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px 12px;
  padding:8px 10px;
  background:rgba(0,0,0,.18);
  border-radius:8px;
}
.combat-custom-panel-label{
  flex:1;
  min-width:140px;
  font-weight:600;
  font-size:.88rem;
}
.combat-custom-panel-show{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:.82rem;
  color:var(--text-dim);
}
.combat-custom-panel-moves{
  display:flex;
  gap:4px;
  margin-left:auto;
}
.settings-custom-layout-row{
  margin:6px 0 10px;
}

@media (max-width:520px){.music-role-row{grid-template-columns:1fr;gap:5px;}}

/* ============================================================
   COMBAT SCREEN CLEANUP & POLISH (authoritative — keep last)
   ============================================================ */

/* --- Ultimate meter (under the player's EN bar) --- */
.ultimate-meter-bar{border-color:rgba(232,160,64,.4);background:linear-gradient(180deg,rgba(24,16,6,.95),rgba(40,26,10,.84));}
.ultimate-meter-fill{width:0%;background:linear-gradient(90deg,#c97a2a,#e8a040);box-shadow:0 0 10px rgba(232,160,64,.35);}
.ultimate-meter-fill.ult-ready{background:linear-gradient(90deg,#e8a040,#ffd76a);box-shadow:0 0 14px rgba(255,200,90,.6);animation:ultReadyPulse 1.1s ease-in-out infinite alternate;}
@keyframes ultReadyPulse{from{filter:brightness(1);}to{filter:brightness(1.25) saturate(1.2);}}
.ultimate-meter-wrap .hp-label span:first-child{color:#e8c96a;letter-spacing:.05em;}

/* --- Nest EXP bar (moved here from combat) --- */
.nest-exp-section .nest-exp-row{display:flex;align-items:center;gap:10px;}
.nest-exp-bg{flex:1;height:12px;border-radius:8px;overflow:hidden;background:linear-gradient(180deg,rgba(8,12,20,.92),rgba(20,26,40,.82));border:1px solid rgba(201,168,76,.22);box-shadow:inset 0 0 8px rgba(0,0,0,.45);}
.nest-exp-fill{height:100%;border-radius:8px;background:linear-gradient(90deg,#7a5ad0,#b990ff);box-shadow:0 0 10px rgba(160,120,240,.35);transition:width .35s ease;}
.nest-exp-txt{font-size:.78rem;color:var(--text-dim);white-space:nowrap;font-weight:600;}

/* --- Stats modal: cleaner, more readable cells --- */
#screen-battle .combat-stats-modal .stats-mini,#screen-battle .combat-stats-modal .enemy-stats-mini{gap:5px 6px;}
#screen-battle .combat-stats-modal .stat-mini,#screen-battle .combat-stats-modal .est{padding:4px 8px;min-height:26px;background:rgba(7,10,16,.42);border-color:rgba(201,168,76,.14);border-radius:8px;}
body.ui-mobile-mode .combat-stats-modal-panel{max-width:96vw;max-height:90vh;padding:14px 16px 12px;}
body.ui-mobile-mode .combat-stats-btn{font-size:.68rem;padding:5px 8px;}

/* --- Remove the box/frame around the battling birds --- */
#screen-battle .shield-overlay{display:none;}
#screen-battle #player-avatar-wrap:focus,
#screen-battle #enemy-avatar-wrap:focus{outline:none;}
#screen-battle #player-avatar .sprite4,
#screen-battle #enemy-avatar .sprite4{
  border:none !important;
  border-radius:0 !important;
  background-color:transparent !important;
  /* keep only a soft grounded shadow so the bird reads as standing in the arena */
  filter:drop-shadow(0 6px 10px rgba(0,0,0,.45));
}
#screen-battle .avatar-wrap::after{
  /* subtle ground contact shadow, no boxy framing */
  height:6px;left:28%;right:28%;bottom:4px;
  background:radial-gradient(ellipse at center,rgba(0,0,0,.45),transparent 72%);
  opacity:.55;
}
#screen-battle #player-avatar .bird-fallback-svg,
#screen-battle #enemy-avatar .bird-fallback-svg{filter:drop-shadow(0 6px 10px rgba(0,0,0,.45));}
/* Fallback flip when render path omits .sprite-face-left wrapper (wrapper path uses global .sprite-face-left rule). */
#screen-battle #enemy-avatar > .sprite4,
#screen-battle #enemy-avatar > .bird-fallback-svg{
  transform:scaleX(-1);
  transform-origin:center bottom;
}

/* --- Authoritative battle-avatar sizing (each size class distinct) --- */
#screen-battle #player-avatar .sprite4.tiny,#screen-battle #enemy-avatar .sprite4.tiny{width:84px !important;height:84px !important;}
#screen-battle #player-avatar .sprite4.small,#screen-battle #enemy-avatar .sprite4.small{width:96px !important;height:96px !important;}
#screen-battle #player-avatar .sprite4.medium,#screen-battle #enemy-avatar .sprite4.medium{width:112px !important;height:112px !important;}
#screen-battle #player-avatar .sprite4.large,#screen-battle #enemy-avatar .sprite4.large{width:128px !important;height:128px !important;}
#screen-battle #player-avatar .sprite4.xl,#screen-battle #enemy-avatar .sprite4.xl,
#screen-battle #player-avatar .sprite4.xlarge,#screen-battle #enemy-avatar .sprite4.xlarge{width:146px !important;height:146px !important;}
#screen-battle #player-avatar .sprite4.boss,#screen-battle #enemy-avatar .sprite4.boss{width:160px !important;height:160px !important;}
/* Penguin keeps its wider-than-tall proportions in battle */
#screen-battle #player-avatar .sprite4.sprite-penguin,
#screen-battle #enemy-avatar .sprite4.sprite-penguin{width:128px !important;height:96px !important;}

/* ============================================================
   Sticky combatants while scrolling (Display setting)
   ============================================================ */
body.combat-sticky-combatants #app:has(#screen-battle.active){
  display:flex;
  flex-direction:column;
  max-height:100dvh;
  overflow:hidden;
  padding-top:8px;
  padding-bottom:8px;
}
body.combat-sticky-combatants #app:has(#screen-battle.active) > header{
  flex-shrink:0;
}
body.combat-sticky-combatants #screen-battle{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  min-height:0;
  max-height:none;
  overflow:hidden;
}
body.combat-sticky-combatants #screen-battle .battle-screen-inner{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
body.combat-sticky-combatants #screen-battle .battle-layout{
  flex:1 1 auto;
  min-height:0;
  display:flex !important;
  flex-direction:column !important;
  gap:8px;
  overflow:hidden;
  grid-template-rows:unset !important;
}
body.combat-sticky-combatants #screen-battle .tactical-topbar,
body.combat-sticky-combatants #screen-battle .stage-progress-wrap,
body.combat-sticky-combatants #screen-battle .encounter-preview-wrap,
body.combat-sticky-combatants #screen-battle .tactical-exp-row{
  flex-shrink:0;
}
body.combat-sticky-combatants #screen-battle .combatants{
  flex-shrink:0;
  z-index:4;
  position:relative;
  padding-bottom:4px;
  background:linear-gradient(180deg,rgba(7,12,7,.55) 0%,rgba(7,12,7,.45) 72%,rgba(7,12,7,0) 100%);
  box-shadow:0 8px 18px rgba(0,0,0,.18);
}
body.combat-sticky-combatants #screen-battle .battle-below-combatants{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  display:flex;
  flex-direction:column;
  gap:8px;
}
body.combat-sticky-combatants #screen-battle .action-panel,
body.combat-sticky-combatants #screen-battle .battle-support-area{
  flex-shrink:0;
  overflow:visible;
  min-height:auto;
}
body.combat-sticky-combatants #screen-battle #actions-grid{
  max-height:none !important;
  overflow:visible !important;
}
/* Actions First: birds sit below the tray — only pin the top bar */
body.combat-sticky-combatants #screen-battle.combat-arr--actionsFirst .combatants{
  flex-shrink:1;
  z-index:auto;
  background:transparent;
  box-shadow:none;
  padding-bottom:0;
}
body.combat-sticky-combatants #screen-battle.combat-arr--actionsFirst .battle-layout{
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}
body.combat-sticky-combatants #screen-battle.combat-arr--actionsFirst .battle-below-combatants{
  flex:0 1 auto;
  overflow:visible;
  min-height:auto;
}
body.combat-sticky-combatants #screen-battle.combat-arr--actionsFirst .action-panel{
  flex:0 1 auto;
  overflow:visible;
  min-height:auto;
}
/* Custom arrangement: player/enemy panels are direct flex children */
body.combat-sticky-combatants #screen-battle.combat-arr--custom .battle-below-combatants{
  display:contents !important;
}
body.combat-sticky-combatants #screen-battle.combat-arr--custom .action-panel{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
}
body.combat-sticky-combatants #screen-battle.combat-arr--custom .combatants{
  display:contents !important;
  background:transparent;
  box-shadow:none;
  padding-bottom:0;
}
body.combat-sticky-combatants #screen-battle.combat-arr--custom #player-panel,
body.combat-sticky-combatants #screen-battle.combat-arr--custom #enemy-panel{
  flex-shrink:0;
  z-index:4;
  position:relative;
}
/* Log Focus (desktop): pin combatants; scroll actions + log column */
@media (min-width:768px){
  body.combat-sticky-combatants #screen-battle.combat-arr--logFocus .battle-layout{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(220px,34%);
    grid-template-rows:auto auto minmax(0,1fr) auto;
    gap:10px 12px;
    align-items:start;
    overflow:hidden;
  }
  body.combat-sticky-combatants #screen-battle.combat-arr--logFocus .combatants{
    grid-column:1;
    grid-row:3;
  }
  body.combat-sticky-combatants #screen-battle.combat-arr--logFocus .battle-below-combatants{
    display:contents;
  }
  body.combat-sticky-combatants #screen-battle.combat-arr--logFocus .action-panel{
    grid-column:1;
    grid-row:4;
    flex:none;
    overflow-y:auto;
    min-height:0;
    max-height:100%;
  }
  body.combat-sticky-combatants #screen-battle.combat-arr--logFocus .battle-support-area{
    grid-column:2;
    grid-row:3 / span 2;
    display:flex;
    flex-direction:column;
    min-height:0;
    overflow-y:auto;
    align-self:stretch;
  }
}

/* ========== Endless STS node map ========== */
#app:has(#screen-endless-map.active) > header{display:none !important;}
#screen-endless-map{
  display:none;
  min-height:100vh;
  background:#000;
  padding:0;
  margin:0;
}
#screen-endless-map.active{display:block;}
.em-map-shell{
  min-height:100vh;
  background:#050505;
  color:#d6c28a;
  display:flex;
  flex-direction:column;
  padding:16px 18px 28px;
  box-sizing:border-box;
}
.em-map-hud{
  display:flex;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  align-items:baseline;
  margin-bottom:10px;
  font-family:'Cinzel',serif;
}
.em-map-hud-left,.em-map-hud-right{display:flex;gap:14px;align-items:baseline;flex-wrap:wrap;}
.em-map-title{font-size:1.35rem;letter-spacing:.12em;color:#e8d39a;text-transform:uppercase;}
.em-map-meta,.em-map-hud-right{font-size:.82rem;color:#9a8a5c;}
.em-map-msg{
  margin:0 0 10px;
  padding:8px 12px;
  border:1px solid rgba(201,168,76,.28);
  background:rgba(20,16,8,.7);
  color:#cfc09a;
  font-family:'Crimson Pro',Georgia,serif;
  font-size:.95rem;
}
.em-map-canvas{
  position:relative;
  flex:1;
  min-height:min(78vh,820px);
  border:1px solid rgba(201,168,76,.2);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(40,32,18,.35), transparent 55%),
    #000;
  overflow:hidden;
}
.em-map-edges{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:1;
}
.em-map-edges line{
  stroke:rgba(180,150,70,.35);
  stroke-width:.35;
}
.em-node{
  position:absolute;
  transform:translate(-50%,-50%);
  z-index:2;
  width:64px;
  height:64px;
  border-radius:50%;
  border:2px solid rgba(201,168,76,.45);
  background:#0c0c0c;
  color:#d6c28a;
  cursor:default;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  font-family:'Cinzel',serif;
  padding:0;
  transition:box-shadow .2s, border-color .2s, transform .15s, opacity .2s;
}
.em-node-icon{font-size:1.15rem;line-height:1;}
.em-node-label{font-size:.55rem;letter-spacing:.04em;text-transform:uppercase;opacity:.85;}
.em-node.is-locked{opacity:.28;filter:grayscale(.4);}
.em-node.is-visited{opacity:.55;border-color:rgba(120,110,80,.4);}
.em-node.is-current{
  border-color:#e8d39a;
  box-shadow:0 0 0 2px rgba(232,211,154,.25), 0 0 18px rgba(201,168,76,.35);
}
.em-node.is-available{
  cursor:pointer;
  border-color:#f0d78a;
  box-shadow:0 0 16px rgba(240,215,138,.45);
  animation:em-node-pulse 1.8s ease-in-out infinite;
}
.em-node.is-available:hover{
  transform:translate(-50%,-50%) scale(1.08);
  box-shadow:0 0 22px rgba(240,215,138,.65);
}
.em-node-boss.is-available,.em-node-boss.is-current{
  border-color:#c45c4a;
  box-shadow:0 0 18px rgba(196,92,74,.45);
}
.em-node-elite{border-color:rgba(180,70,70,.55);}
.em-node-rest{border-color:rgba(90,140,110,.55);}
.em-node-merchant{border-color:rgba(180,150,60,.55);}
.em-node-unknown{border-color:rgba(120,120,160,.55);}
.em-map-hint{
  margin:12px 0 0;
  text-align:center;
  color:#7a6e4e;
  font-family:'Crimson Pro',Georgia,serif;
  font-size:.9rem;
}
@keyframes em-node-pulse{
  0%,100%{box-shadow:0 0 12px rgba(240,215,138,.35);}
  50%{box-shadow:0 0 22px rgba(240,215,138,.6);}
}
@media (max-width:700px){
  .em-node{width:52px;height:52px;}
  .em-node-label{font-size:.48rem;}
  .em-map-canvas{min-height:70vh;}
}
