/* Shadow Wolf Stylesheet - WebGame standard */
:root {
  --font-main: "Outfit", system-ui, -apple-system, sans-serif;
  --bg-dark: #070a13;
  --bg-card: #0e1424;
  --bg-input: #17203a;
  --primary: #facc15;
  --primary-hover: #eab308;
  --accent-cyan: #06b6d4;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  --border-radius: 12px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Header standard navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(7, 10, 19, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(-2px);
}

.game-brand {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.locale-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
}

.locale-picker select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.locale-picker select option {
  background-color: var(--bg-dark);
  color: var(--text-main);
}

/* Relic App Container layout */
.relic-app {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  min-height: calc(100vh - 120px);
  position: relative;
}

.panel {
  width: 100%;
  animation: fadeIn 0.3s ease-out;
}

.hidden {
  display: none !important;
}

/* Start Menu panel styles */
.menu-panel {
  max-width: 900px;
  margin: 0 auto;
}

.world-map-panel { position: relative; max-width: 1120px; min-height: 720px; margin: 0 auto; padding: 28px; border: 1px solid rgba(103,232,249,.35); border-radius: 8px; background: #091827 url("../../assets/shadow-wolf-world-map.webp") center / cover; overflow: hidden; box-shadow: inset 0 0 0 999px rgba(5,13,25,.16); }
.world-map-heading { position: relative; z-index: 2; text-align: center; margin-bottom: 0; text-shadow: 0 2px 8px #020617; }
.world-map-heading > span { color: var(--accent-cyan); font-weight: 800; }
.world-map-heading h2 { margin: 6px 0; font-size: 1.8rem; }
.world-map-heading p { color: var(--text-muted); }
.world-map-grid { position: absolute; inset: 0; }
.zone-node { position: absolute; width: 132px; min-height: 76px; padding: 9px 11px; border: 1px solid rgba(186,230,253,.72); border-radius: 8px; background: rgba(6,20,34,.88); color: #fff; text-align: left; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.zone-node:hover { border-color: var(--accent-cyan); background: rgba(8,65,86,.9); transform: translateY(-2px); }
.zone-node b,.zone-node span,.zone-node small { display:block; }.zone-node b{color:#67e8f9}.zone-node span{font-weight:800;margin:4px 0}.zone-node small{color:#cbd5e1}.boss-zone{border-color:#fb7185}.world-map-panel .secondary-btn{position:absolute;z-index:2;left:28px;bottom:24px;width:auto}
.zone-node::after{display:block;margin-top:3px;color:#fde68a;font-size:.68rem;font-weight:800}.zone-node:nth-child(1){left:11%;top:28%}.zone-node:nth-child(1)::after{content:"建議 Lv. 1"}.zone-node:nth-child(2){left:33%;top:18%}.zone-node:nth-child(2)::after{content:"建議 Lv. 3"}.zone-node:nth-child(3){left:55%;top:16%}.zone-node:nth-child(3)::after{content:"建議 Lv. 5"}.zone-node:nth-child(4){left:68%;top:34%}.zone-node:nth-child(4)::after{content:"建議 Lv. 8"}.zone-node:nth-child(5){left:46%;top:52%}.zone-node:nth-child(5)::after{content:"建議 Lv. 11"}.zone-node:nth-child(6){left:61%;top:63%}.zone-node:nth-child(6)::after{content:"建議 Lv. 15"}.zone-node:nth-child(7){left:17%;top:62%}.zone-node:nth-child(7)::after{content:"建議 Lv. 20"}.zone-node:nth-child(8){left:73%;top:74%}.zone-node:nth-child(8)::after{content:"建議 Lv. 28"}
.attribute-list { display:grid; gap:8px; }
.attribute-row { display:grid; grid-template-columns:minmax(0,1fr) 34px 34px; align-items:center; gap:8px; padding:9px; border:1px solid rgba(148,163,184,.22); border-radius:8px; background:rgba(5,16,29,.68); }
.attribute-row div { display:grid; grid-template-columns:28px 1fr; column-gap:7px; align-items:center; }.attribute-row b{grid-row:span 2; display:grid; place-items:center; width:28px;height:28px;border-radius:6px;background:#164e63;color:#a5f3fc}.attribute-row span{font-weight:800}.attribute-row small{color:var(--text-muted);font-size:.68rem}.attribute-row strong{text-align:center}.attribute-row button{width:30px;height:30px;border:0;border-radius:6px;background:#0891b2;color:#fff;font-size:1.2rem;cursor:pointer}.attribute-row button:disabled{opacity:.35}
@media(max-width:800px){.world-map-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

.menu-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .menu-layout {
    grid-template-columns: 1fr;
  }
}

.menu-main {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  box-shadow: var(--shadow);
}

.menu-cover-box {
  width: 100%;
  max-height: 240px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-cover-box .cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.menu-cover-box:hover .cover {
  transform: scale(1.05);
}

.menu-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.menu-hint {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.stage-select {
  margin: 0 0 1rem;
  text-align: left;
}

.stage-select-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text-main);
  font-size: 0.9rem;
}

.stage-select-heading span { color: var(--accent-cyan); font-weight: 700; }

.stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stage-card {
  min-height: 96px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(10, 24, 39, 0.8);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
}

.stage-card b, .stage-card span, .stage-card small { display: block; }
.stage-card b { color: var(--accent-cyan); font-size: 0.76rem; }
.stage-card span { margin: 5px 0 3px; font-size: 0.88rem; font-weight: 800; }
.stage-card small { color: var(--text-muted); font-size: 0.72rem; }
.stage-card:hover, .stage-card.is-selected { border-color: var(--accent-cyan); background: rgba(6, 182, 212, 0.16); }
.stage-card.is-selected { box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.35); }

@media (max-width: 560px) { .stage-grid { grid-template-columns: 1fr; } }

.goals-card {
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 8px;
  padding: 1rem;
  text-align: left;
  margin-bottom: 2rem;
}

.goals-card h3 {
  color: var(--accent-cyan);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.goals-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #0891b2 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
  transition: var(--transition);
  width: 100%;
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Diamond Shop panel */
.menu-shop {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.menu-shop h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.shop-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.shop-badge strong {
  color: var(--primary);
}

.shop-item-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.shop-item-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(250, 204, 21, 0.05);
}

.shop-item-btn.is-confirming {
  border-color: var(--primary);
  background: rgba(250, 204, 21, 0.12);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.12);
}

.shop-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 75%;
}

.shop-item-meta strong {
  font-size: 0.95rem;
}

.shop-item-meta small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.shop-cost-tag {
  background: rgba(250, 204, 21, 0.15);
  color: var(--primary);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.shop-status-text {
  font-size: 0.8rem;
  color: var(--accent-green);
  margin-top: 0.5rem;
}

/* Gameplay Grid layout */
.game-panel {
  width: min(100%, 1280px);
  max-width: calc(100vw - 32px);
  margin: 0 auto;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(640px, 4fr) minmax(220px, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

.arena-viewport {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.arena-hud {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 500px) {
  .arena-hud {
    grid-template-columns: 1fr;
  }
}

.hud-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.health-meta, .exp-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.health-meta strong { color: var(--accent-red); }
.exp-meta strong { color: var(--accent-cyan); }

.bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.2s ease-out;
}

.bar-fill.health { background: linear-gradient(90deg, #f43f5e 0%, #e11d48 100%); }
.bar-fill.exp { background: linear-gradient(90deg, #22d3ee 0%, #06b6d4 100%); }

.hud-meta-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.meta-badge {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 500;
  background-color: #0c0f1d;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.desktop-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(94, 234, 212, 0.12);
  color: #d9fff7;
  font-weight: 800;
  line-height: 1.5;
}

.desktop-controls span { display: inline-flex; align-items: center; gap: 5px; }
.desktop-controls kbd { min-width: 26px; padding: 3px 6px; border: 1px solid rgba(255,255,255,.48); border-bottom-width: 3px; border-radius: 5px; background: rgba(8,19,32,.8); color: #fff; font: 800 .76rem system-ui; text-align: center; }

.desktop-only-notice { display: none; }

@media (min-width: 1025px) {
  .relic-app { max-width: min(1440px, calc(100vw - 48px)); }
  .canvas-container { max-width: 1120px; margin: 0 auto; }
}

@media (max-width: 1024px) {
  .relic-app > .panel { display: none !important; }
  .desktop-only-notice {
    min-height: 100vh;
    display: grid;
    place-content: center;
    gap: 12px;
    padding: 32px;
    text-align: center;
    background: #081320;
    color: #f5fbff;
  }
  .desktop-only-notice strong { font-size: 1.6rem; }
  .desktop-only-notice span { color: #b8cad8; line-height: 1.5; }
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Mobile Virtual D-Pad buttons styling */
.mobile-controls-row {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

/* Show only on touch devices or smaller screens */
@media (min-width: 1025px) {
  .mobile-controls-row {
    display: none !important;
  }
}

.mobile-dpad, .mobile-actions {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.ctrl-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(14, 20, 36, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.1s ease;
}

.ctrl-btn:active {
  background: rgba(6, 182, 212, 0.6);
  border-color: var(--accent-cyan);
  transform: scale(0.9);
}

/* Equipped Gear Inventory Sidebar */
.inventory-sidebar {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.inventory-sidebar h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Screen-flow contract: Main owns lobby/link/guide; Stage and Battle own a fixed play shell. */
.home-link {
  width: 58px;
  min-height: 44px;
  display: grid;
  grid-template-columns: 16px 28px;
  place-items: center;
  gap: 4px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: var(--text-main);
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
}
.home-link img { width: 28px; height: 28px; object-fit: contain; }
.top-nav { grid-template-columns: 58px minmax(0, 1fr) auto; }

.play-return {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(186,230,253,.5);
  border-radius: 8px;
  background: rgba(7,24,43,.92);
  color: #7dd3fc;
  font: 800 1.45rem/1 var(--font-main);
  cursor: pointer;
}

body[data-shadow-wolf-screen="stage"],
body[data-shadow-wolf-screen="battle"] {
  overflow: hidden;
  height: 100dvh;
}
body[data-shadow-wolf-screen="stage"] .top-nav,
body[data-shadow-wolf-screen="battle"] .top-nav,
body[data-shadow-wolf-screen="stage"] .game-page-info,
body[data-shadow-wolf-screen="battle"] .game-page-info,
body[data-shadow-wolf-screen="stage"] .desktop-only-notice,
body[data-shadow-wolf-screen="battle"] .desktop-only-notice,
body[data-shadow-wolf-screen="stage"] .sound-toggle,
body[data-shadow-wolf-screen="battle"] .sound-toggle {
  display: none !important;
}
body[data-shadow-wolf-screen="stage"] .relic-app,
body[data-shadow-wolf-screen="battle"] .relic-app {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  min-height: 0;
  height: 100dvh;
  margin: 0;
  padding: 0;
}

.world-map-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 56px;
  gap: 12px;
  width: 100%;
  max-width: none;
  min-height: 0;
  height: 100dvh;
  margin: 0;
  padding: 12px 12px 0;
  border: 0;
  border-radius: 0;
  background: #091827 url("../../assets/shadow-wolf-world-map.webp") center / cover;
  box-shadow: inset 0 0 0 999px rgba(5,13,25,.62);
  animation: none;
}
.stage-header { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.stage-header > div { min-width: 0; }
.stage-header span { color: #67e8f9; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.stage-header h2 { margin: 2px 0 0; color: #f8fafc; font-size: clamp(1.05rem, 3vw, 1.45rem); }
.stage-subtitle { position: absolute; top: 72px; left: 72px; right: 12px; z-index: 1; color: #cbd5e1; font-size: .82rem; }
.world-map-grid.stage-rail {
  position: relative;
  inset: auto;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 56px max(12px, calc(50% - 132px)) 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x;
}
.world-map-grid.stage-rail::-webkit-scrollbar { display: none; }
.world-map-grid.stage-rail .stage-card {
  position: relative;
  left: auto;
  top: auto;
  width: 264px;
  min-width: 264px;
  height: 190px;
  min-height: 190px;
  padding: 22px;
  scroll-snap-align: center;
  text-align: left;
  background: rgba(6,20,34,.92);
}
.world-map-grid.stage-rail .stage-card::after { content: none; }
.world-map-grid.stage-rail .stage-card b { font-size: .76rem; }
.world-map-grid.stage-rail .stage-card span { margin: 18px 0 8px; font-size: 1.1rem; color: #fff; }
.world-map-grid.stage-rail .stage-card small { font-size: .84rem; color: #cbd5e1; }
.world-map-grid.stage-rail .stage-card.is-cleared { border-color:#6ee7b7; box-shadow:inset 0 0 0 1px rgba(110,231,183,.3); }
.world-map-grid.stage-rail .stage-card:disabled { opacity:.48; cursor:not-allowed; filter:saturate(.45); }
.stage-ad-reserve,
.battle-ad-reserve { height: 56px; min-height: 56px; pointer-events: none; background: #081320; }

.game-panel {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 56px;
  width: 100%;
  max-width: none;
  height: 100dvh;
  margin: 0;
  animation: none;
}
.game-layout { position: relative; min-height: 0; grid-template-columns: 1fr; gap: 0; }
.attribute-sidebar { display: none; }
.arena-viewport {
  position: relative;
  min-height: 0;
  padding: 60px 12px 10px;
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.attribute-draft {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 58px 12px 12px;
  background: rgba(3, 10, 20, .88);
  backdrop-filter: blur(5px);
}
.attribute-draft.hidden { display: none; }
.attribute-draft-card {
  width: min(520px, 100%);
  max-height: 100%;
  padding: 16px;
  overflow: auto;
  border: 1px solid rgba(103, 232, 249, .48);
  border-radius: 12px;
  background: #0b1c2d;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .42);
}
.attribute-draft-card h2 { margin: 0 0 5px; color: #f8fafc; font-size: 1.08rem; }
.attribute-draft-card > p { margin: 0 0 12px; color: #b6d8e3; font-size: .78rem; }
.attribute-draft-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.attribute-choice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 72px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, .3);
  border-radius: 9px;
  background: #10283c;
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
}
.attribute-choice:hover,
.attribute-choice:focus-visible { border-color: #67e8f9; outline: 3px solid rgba(103, 232, 249, .24); }
.attribute-choice img { width: 42px; height: 42px; object-fit: contain; }
.attribute-choice span { display: grid; gap: 4px; min-width: 0; }
.attribute-choice strong { font-size: .82rem; }
.attribute-choice small { color: #b6d8e3; font-size: .68rem; line-height: 1.25; }
.attribute-choice b { color: #fde68a; font-size: .8rem; }
.battle-result {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  align-content: center;
  gap: 9px;
  width: 100%;
  max-width: none;
  height: 788px !important;
  margin: 0;
  padding: 58px 18px 14px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: rgba(5, 15, 28, .96);
}
.battle-result.hidden { display: none; }
.battle-result h2,
.battle-result h3,
.battle-result p { margin: 0; }
.battle-result .report-grid { display:grid; gap:3px; margin:0; }
.battle-result .report-grid > div { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.battle-result .report-grid strong { color:#fde68a; letter-spacing:.08em; }
.battle-result .result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}
.battle-result .result-actions button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.battle-result .result-actions button:focus-visible {
  outline: 4px solid #fde68a;
  outline-offset: 3px;
}
.battle-result .result-actions .secondary-btn {
  border: 1px solid rgba(103, 232, 249, .58);
  background: #15314a;
  color: #f8fafc;
}
.battle-result .result-actions .secondary-btn:hover,
.battle-result .result-actions .secondary-btn:focus-visible {
  border-color: #67e8f9;
  outline: 3px solid rgba(103, 232, 249, .2);
}
body[data-shadow-wolf-screen="battle"].wp-logical-battle-active #resultPanel.battle-result:not(.hidden) {
  height: 788px !important;
  max-height: 788px !important;
}
.battle-return { position: absolute; top: 8px; left: 8px; z-index: 4; }
.arena-hud { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.hud-meta-row { grid-column: auto; justify-content: flex-end; gap: 6px; }
.meta-badge { padding: 4px 7px; font-size: .72rem; }
.canvas-container {
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
#gameCanvas {
  width: min(100%, calc(100dvh - 178px));
  height: auto;
  max-height: 100%;
  aspect-ratio: 1 / 1;
}

@media (max-width: 1024px) {
  .relic-app > .panel { display: block !important; }
  .relic-app > .panel.hidden { display: none !important; }
  .relic-app > #mapPanel:not(.hidden),
  .relic-app > #gamePanel:not(.hidden) { display: grid !important; }
  .desktop-only-notice { display: none !important; }
}
@media (max-height: 470px) {
  .world-map-grid.stage-rail .stage-card { height: 176px; min-height: 176px; }
  .arena-viewport { padding-top: 52px; }
  .play-return { width: 38px; height: 38px; font-size: 1.2rem; }
  .hud-meta-row { display: none; }
  #gameCanvas { width: min(100%, calc(100dvh - 128px)); }
}

.sidebar-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-section-heading span {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.backpack-grid {
  display: grid;
  gap: 8px;
}

.gear-slot {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  min-height: 76px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(4, 13, 25, 0.68);
}

.gear-slot.has-item { border-color: rgba(34, 211, 238, 0.7); background: rgba(8, 42, 58, 0.5); }

.gear-icon {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.88);
}

.gear-slot.has-item .gear-icon { border-style: solid; border-color: rgba(103, 232, 249, 0.7); }
.gear-icon img { width: 52px; height: 52px; object-fit: contain; }

.gear-copy { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 2px; }
.gear-copy > span { color: var(--text-muted); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04rem; }
.gear-copy strong { overflow: hidden; font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.gear-copy small { color: var(--accent-green); font-size: 0.7rem; line-height: 1.3; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stat-card {
  display: grid;
  min-height: 76px;
  align-content: center;
  gap: 2px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(20, 47, 68, 0.82), rgba(9, 17, 32, 0.88));
}

.stat-card span, .stat-card small { color: var(--text-muted); font-size: 0.68rem; font-weight: 700; }
.stat-card strong { color: #f8fafc; font-size: 1.2rem; line-height: 1.1; }
.stat-card small { color: var(--accent-cyan); font-size: 0.6rem; }

.gear-slots {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gear-slot-card {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: var(--transition);
}

.gear-slot-card:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.02);
}

.slot-header {
  margin-bottom: 0.25rem;
}

.slot-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05rem;
}

.slot-body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slot-icon {
  font-size: 1.5rem;
}

.item-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.item-effect {
  font-size: 0.75rem;
  color: var(--accent-green);
  margin-left: auto;
}

.stats-list {
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stats-list h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.stat-row span {
  color: var(--text-muted);
}

/* Modals & Overlays styling */
.draft-overlay, .loot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 19, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.draft-card-box {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  max-width: 600px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.draft-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.draft-cards-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.draft-item-btn {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.draft-item-btn:hover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.05);
  transform: scale(1.01);
}

.draft-item-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: grid;
  place-items: center;
}

.draft-item-icon img,
.loot-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.draft-item-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.draft-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
  text-align: right;
  max-width: 50%;
}

/* Loot card chest overlay */
.loot-box {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.loot-card {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 2rem;
}

.loot-card-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 0.75rem;
}

.loot-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.loot-card p {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05rem;
  margin-bottom: 0.75rem;
}

.loot-card strong {
  font-size: 0.95rem;
  color: var(--accent-green);
}

/* Result panel cards */
.relic-app > .result-panel {
  max-width: 550px;
  margin: 2rem auto;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  padding: 3rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.result-score-box {
  background: var(--bg-input);
  padding: 1.5rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.result-score-box span {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.result-score-box strong {
  font-size: 2.5rem;
  color: var(--accent-cyan);
}

.result-flavor {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.skills-card {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: left;
}

.skills-card h3 {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.skills-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.skill-meter {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.skill-meter .stars {
  color: var(--accent-cyan);
}

.skills-report-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.result-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.menu-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-weight: 700;
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading panel simulation styles */
.loading-panel {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-content {
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.loading-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin: 1.5rem 0 0.5rem;
}

.loading-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan) 0%, var(--primary) 100%);
  border-radius: 3px;
}

.loading-percentage {
  font-size: 0.85rem;
  color: var(--text-muted);
}
