/* ============================================================================
   MINECRAFT DOMINION — AAA MOJANG DUNGEONS × DARK ORE UI DESIGN SYSTEM
   Live 3D Orbiting Arena · Sculpted Hierarchy · Warm Obsidian & Bronze · Emerald CTA
   ============================================================================ */

/* 1. OFFICIAL BUNDLED MOJANG FONTS (Spicewood / Minecraft Ten, Five & Sixteen) */
@font-face {
  font-family: 'Spicewood Ten';
  src: url('../Assets/Fonts/Spicewood_Ten.otf') format('opentype');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Spicewood Five';
  src: url('../Assets/Fonts/Spicewood_Five_Bold.otf') format('opentype');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Spicewood Sixteen';
  src: url('../Assets/Fonts/Spicewood_Sixteen_Regular_Fast.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Spicewood Sixteen';
  src: url('../Assets/Fonts/Spicewood_Sixteen_SemiBold_Fast.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Spicewood Sixteen';
  src: url('../Assets/Fonts/Spicewood_Sixteen_Bold_Fast.otf') format('opentype');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

/* 2. MOJANG DUNGEONS × DARK ORE UI DESIGN TOKENS */
:root {
  /* Obsidian, Warm Charcoal & Aged Bronze Surfaces (matched to T_UI_Slot_Background.png) */
  --md-black: #0E0F12;
  --md-well: #14161A;
  --md-surface: #1E2026;
  --md-surface-raised: #282B33;
  --md-btn: #343842;
  --md-btn-hover: #424754;
  --md-btn-hi: #5B606E;
  --md-btn-lip: #1B1D24;
  --md-bronze: #8E7550;
  --md-bronze-hi: #C8A972;
  --md-bronze-lo: #473A27;

  /* Official Mojang Emerald Primary Action */
  --ore-green: #3C8527;
  --ore-green-top: #54BC36;
  --ore-green-bot: #2D6F1B;
  --ore-green-hi: #8BE868;
  --ore-green-lip: #1D4E11;
  --ore-green-deep: #13330A;

  /* Minecraft Mineral Semantic Accents */
  --mc-gold: #FFD84A;
  --mc-gold-mid: #E09E1B;
  --mc-gold-dark: #7A4B06;
  --mc-diamond: #4CC9FF;
  --mc-diamond-dark: #156A9B;
  --mc-redstone: #E54545;
  --mc-redstone-dark: #8C1919;
  --mc-emerald-txt: #64FF64;
  --mc-xp-green: #80FF20;
  --mc-amethyst: #C078FF;
  --mc-amethyst-dark: #6D28B8;

  /* Typography */
  --font-display: 'Spicewood Ten', 'Spicewood Sixteen', monospace;
  --font-micro: 'Spicewood Five', 'Spicewood Sixteen', monospace;
  --font-body: 'Spicewood Sixteen', monospace;
}

/* 3. GLOBAL RESET — CRISP MINECRAFT BLOCK GEOMETRY */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0E0F12;
  color: #F4F6FA;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.25;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

button, input {
  font-family: inherit;
  color: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:focus-visible {
  outline: 2px solid var(--mc-gold);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pixel-ui-icon {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: inline-block;
  flex-shrink: 0;
  pointer-events: none;
}

.px-btn-icon {
  width: 14px;
  height: 14px;
}

.opt-vol-px {
  width: 15px;
  height: 15px;
}

/* Crisp Mojang Dark Ore UI Custom Scrollbars */
#view-inventory::-webkit-scrollbar,
.options-modal-body::-webkit-scrollbar,
.md-equipped-body::-webkit-scrollbar {
  width: 8px;
}

#view-inventory::-webkit-scrollbar-track,
.options-modal-body::-webkit-scrollbar-track,
.md-equipped-body::-webkit-scrollbar-track {
  background: var(--md-well);
}

#view-inventory::-webkit-scrollbar-thumb,
.options-modal-body::-webkit-scrollbar-thumb,
.md-equipped-body::-webkit-scrollbar-thumb {
  background: #4B4F5C;
  border: 1px solid var(--md-black);
  box-shadow: inset 0 2px 0 #6C7182;
}

#view-inventory::-webkit-scrollbar-thumb:hover,
.options-modal-body::-webkit-scrollbar-thumb:hover,
.md-equipped-body::-webkit-scrollbar-thumb:hover {
  background: #616778;
}

/* 4. RESPONSIVE 9:16 VIEWPORT SHELL */
#app-shell {
  width: 100vw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 45%, #1E222B 0%, #0D0E12 75%);
  overflow: hidden;
}

#game-container {
  position: relative;
  width: min(100vw, calc(100dvh * 9 / 16));
  height: min(100dvh, calc(100vw * 16 / 9));
  background: #121418;
  overflow: hidden;
  border: 2px solid #2A2D36;
  box-shadow:
    0 0 0 1px var(--md-black),
    0 24px 64px rgba(0, 0, 0, 0.82);
}

@media (max-width: 520px) {
  #game-container {
    width: 100vw;
    height: 100dvh;
    border: none;
    box-shadow: none;
  }
}

#game-container > canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  z-index: 1;
  transition: filter 0.35s ease;
}

/* Subtle Mojang depth-of-field cinematic grade on the live orbiting 3D Arena while on Home Screen! */
#game-container.home-active > canvas {
  filter: brightness(0.56) contrast(1.08) saturate(1.12) blur(1.4px);
  transform: scale(1.03);
}

#game-container.home-active #world-labels,
#game-container.home-active #hud {
  visibility: hidden !important;
  pointer-events: none !important;
}

#world-labels {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
}

/* ============================================================================
   5. FULL-BLEED MOJANG LOADING SPLASH SCREEN (CLEAN UNOBSTRUCTED KEY ART!)
   ============================================================================ */
#loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 18px;
  background-color: #0b3d8c;
  background-image: url('../Assets/UI/loading_splash_v2.png?v=261');
  background-size: cover;
  background-position: center;
  overflow: hidden;
  transition: opacity 0.35s ease;
}

/* Clash-Royale Living Blender Cycles Video Stage (subtle cinematic motion, ZERO static poster feel!) */
.loading-parallax-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.loading-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.loading-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
}

.loading-vignette-scrim {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(6, 22, 58, 0.34) 0%,
    rgba(6, 22, 58, 0.0) 16%,
    rgba(6, 22, 58, 0.0) 74%,
    rgba(12, 10, 18, 0.66) 90%,
    rgba(8, 8, 14, 0.90) 100%
  );
}

#loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Iconic Clash Royale Logo Placement: boldly overlapping lower-center over the King's waist, leaving top sky & Skeleton 100% unobstructed! */
.loading-top-logo {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-bottom: 4px;
  text-align: center;
}

.loading-logo-art {
  width: min(358px, 92%);
  height: auto;
  display: block;
  filter:
    drop-shadow(0 8px 16px rgba(0, 0, 0, 0.82))
    drop-shadow(0 2px 0 rgba(0, 0, 0, 0.92));
}

.loading-game-sub {
  display: none;
}

/* Open floating splash footer — Iconic Clash Royale Style Tip + Full-Width Bar with Centered % */
.loading-bottom-dock {
  position: relative;
  z-index: 6;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 2px;
}

.loading-tip-text {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow:
    -1px -1px 0 #0B0C10,
     1px -1px 0 #0B0C10,
    -1px  1px 0 #0B0C10,
     1px  1px 0 #0B0C10,
     0    2px 4px rgba(0, 0, 0, 0.92);
  text-align: center;
  letter-spacing: 0.02em;
}

.loading-progress-wrap {
  width: min(370px, 94%);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.loading-progress-bar {
  position: relative;
  width: 100%;
  height: 24px;
  background: rgba(14, 16, 20, 0.92);
  border: 2px solid var(--md-black);
  box-shadow:
    0 0 0 1px rgba(200, 169, 114, 0.45),
    inset 0 2px 0 #090A0C,
    0 4px 12px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(180deg, var(--ore-green-top) 0%, var(--ore-green) 65%, var(--ore-green-bot) 100%);
  box-shadow: inset 0 2px 0 var(--ore-green-hi);
  transition: width 0.14s linear;
}

.loading-bar-pct-center {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 15px;
  color: #FFFFFF;
  text-shadow:
    -1px -1px 0 #0B0C10,
     1px -1px 0 #0B0C10,
    -1px  1px 0 #0B0C10,
     1px  1px 0 #0B0C10,
     0    2px 0 #0B0C10;
  font-variant-numeric: tabular-nums;
}

.loading-status-row {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: #D8DCE6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.92);
}

/* Sculpted Mojang Emerald Hero Enter Button (proportioned, NOT 100%-wide flat bar!) */
.loading-enter-btn {
  width: min(260px, 76%);
  min-height: 50px;
  padding: 10px 18px 15px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFFFFF;
  text-shadow: 0 2px 0 var(--ore-green-deep);
  background: linear-gradient(180deg, var(--ore-green-top) 0%, var(--ore-green) 58%, var(--ore-green-bot) 100%);
  border: 2px solid var(--md-black);
  box-shadow:
    inset 0 2px 0 var(--ore-green-hi),
    inset 2px 0 0 rgba(139, 232, 104, 0.45),
    inset -2px 0 0 rgba(29, 78, 17, 0.6),
    inset 0 -6px 0 var(--ore-green-lip),
    0 8px 22px rgba(40, 150, 30, 0.42),
    0 4px 0 rgba(0, 0, 0, 0.55);
  transition: transform 0.06s ease, filter 0.1s ease;
}

.loading-enter-btn:not(:disabled):hover {
  filter: brightness(1.08);
}

.loading-enter-btn:not(:disabled):active {
  transform: translateY(3px);
  padding-top: 12px;
  padding-bottom: 13px;
  box-shadow:
    inset 0 2px 0 var(--ore-green-lip),
    inset 0 -3px 0 var(--ore-green-deep),
    0 2px 0 rgba(0, 0, 0, 0.55);
}

.loading-enter-btn:disabled {
  background: linear-gradient(180deg, #3A3D46 0%, #2B2E36 100%);
  color: #9A9FA9;
  text-shadow: 0 2px 0 #14161A;
  cursor: wait;
  box-shadow:
    inset 0 2px 0 #555966,
    inset 0 -5px 0 #1A1C22,
    0 4px 0 rgba(0, 0, 0, 0.45);
}

.loading-legal-caption {
  font-size: 9.5px;
  color: rgba(210, 214, 224, 0.72);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  text-align: center;
}

/* ============================================================================
   6. HOME SCREEN — LIVING 3D MINECRAFT WORLD + SCULPTED FLOATING MOJANG HUD
   ============================================================================ */
#home-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #0a2d57 url('../Assets/UI/home_sky_bg.png?v=270') center / cover no-repeat;
  overflow: hidden;
}

#home-screen.tab-inventory {
  background: #14161B;
}

/* 6A. BOLD FLOATING TOP HUD RAIL (GENEROUS TOUCH TARGETS, CRISP READABILITY, ZERO CLIPPING!) */
.md-profile-row {
  position: relative;
  z-index: 12;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, rgba(6, 20, 44, 0.72) 0%, rgba(6, 20, 44, 0.36) 72%, rgba(6, 20, 44, 0) 100%);
}

#home-screen.tab-inventory .md-profile-row {
  background: #14161B;
  border-bottom: 1px solid #2A2E38;
  padding-bottom: 10px;
}

.md-player-id {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1 1 auto;
}

.md-avatar-frame {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--md-well);
  background-image: url('../Assets/UI/T_UI_Slot_Background.png?v=230');
  background-size: cover;
  border: 2px solid var(--md-black);
  box-shadow:
    0 0 0 1px var(--md-bronze),
    0 4px 10px rgba(0, 0, 0, 0.55);
  padding: 4px;
}

.md-player-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.md-player-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.md-player-name {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-player-clan {
  font-size: 13px;
  font-weight: 600;
  color: #D8CBB2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-trophy-settings {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Jewel-like Mojang Dungeons Dark-Obsidian & Bronze Currency Counters */
.md-emerald-box,
.md-trophy-box {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px;
  background: rgba(14, 18, 24, 0.90);
  border: 1.5px solid rgba(154, 128, 88, 0.68);
  box-shadow:
    inset 0 2px 0 rgba(0, 0, 0, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.5);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.md-emerald-box {
  color: var(--mc-emerald-txt);
  text-shadow: 0 1px 0 #0B240B;
}

.md-trophy-box {
  color: var(--mc-gold);
  text-shadow: 0 1px 0 #332000;
}

.emerald-img,
.trophy-img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

/* Refined Dark-Stone & Bronze Settings Button (NOT blinding white!) */
.md-settings-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
  background: linear-gradient(180deg, #3A3E48 0%, #262932 100%);
  border: 2px solid var(--md-black);
  box-shadow:
    inset 0 2px 0 #5F6575,
    inset 0 -3px 0 #181A20,
    0 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.06s ease, filter 0.08s ease;
}

.md-settings-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(1.15) drop-shadow(0 1px 0 #000000);
}

.md-settings-btn:hover {
  filter: brightness(1.15);
}

.md-settings-btn:active {
  transform: translateY(2px);
}

/* 6B. INNER FRAME & TAB VIEWS */
.md-inner-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.home-tab-view {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
}

.home-tab-view.active {
  display: flex;
}

/* 6C. BATTLE TAB — SUPERCELL ROYAL-BLUE STAGE SHOWCASING THE 3D MINECRAFT ARENA TROPHY! */
#view-battle {
  position: relative;
  justify-content: space-between;
  align-items: center;
  padding: 2px 14px 12px;
  gap: 4px;
  background: linear-gradient(
    180deg,
    rgba(6, 18, 44, 0.08) 0%,
    rgba(6, 18, 44, 0.0) 35%,
    rgba(6, 18, 44, 0.0) 68%,
    rgba(5, 14, 34, 0.56) 90%,
    rgba(5, 14, 34, 0.78) 100%
  );
}

/* Hero Blockbench 3D Logo floating cleanly at top */
.home-mc-crest {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-top: 4px;
}

.home-mc-logo-img {
  width: min(276px, 74%);
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.72));
}

/* Cleanly hidden per user request — zero clutter above diorama (DOM IDs stay intact for game.js) */
.cr-top-chests,
.pedestal-top-ribbon,
.pedestal-lore-rivalry {
  display: none !important;
}

.cr-chest-card {
  width: min(296px, 88%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 7px 6px;
  background: rgba(20, 18, 17, 0.86);
  border: 2px solid var(--md-black);
  box-shadow:
    inset 0 2px 0 var(--md-bronze),
    inset 0 -3px 0 #100E0D,
    0 6px 16px rgba(0, 0, 0, 0.48);
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.1s ease;
}

.cr-chest-card:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.cr-chest-card:active {
  transform: translateY(1px);
}

.cr-chest-card.chest-ready {
  box-shadow:
    inset 0 2px 0 #FFF3A1,
    inset 0 -3px 0 var(--mc-gold-dark),
    0 0 18px rgba(255, 216, 74, 0.42);
}

.crown-chest-art {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--md-well);
  background-image: url('../Assets/UI/T_UI_Slot_Background.png?v=230');
  background-size: cover;
  border: 1px solid var(--md-bronze);
  padding: 3px;
}

.crown-chest-art img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.chest-card-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chest-title-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.chest-card-title {
  font-family: var(--font-micro);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--mc-gold);
  text-shadow: 0 2px 0 #1E1202;
}

.chest-card-sub {
  font-family: var(--font-micro);
  font-size: 7px;
  color: #BFB39D;
  white-space: nowrap;
}

.crown-progress-track {
  position: relative;
  width: 100%;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0F1013;
  border: 1px solid #3D3832;
  box-shadow: inset 0 2px 0 #07080A;
  overflow: hidden;
}

.crown-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(180deg, var(--ore-green-top) 0%, var(--ore-green) 100%);
  box-shadow: inset 0 2px 0 var(--ore-green-hi);
  transition: width 0.25s ease;
}

.crown-progress-img {
  position: relative;
  z-index: 2;
  width: 11px;
  height: 11px;
  margin-right: 4px;
}

.crown-progress-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-micro);
  font-size: 8px;
  color: #FFFFFF;
  text-shadow: 0 1px 2px #000000;
  font-variant-numeric: tabular-nums;
}

/* 6D. HERO 3D ARENA DIORAMA STAGE (ZERO BOX AROUND TITLE — FLOATING TYPOGRAPHY!) */
.cr-arena-showcase {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cr-arena-pedestal {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  cursor: pointer;
}

.pedestal-top-ribbon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(14, 16, 20, 0.76);
  border: 1px solid rgba(200, 169, 114, 0.42);
  font-family: var(--font-micro);
  font-size: 7.5px;
  color: var(--mc-gold);
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px #000000;
}

.ribbon-trophy-icon {
  width: 12px;
  height: 12px;
}

.pedestal-diorama-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Subtle enchanted dual-faction aura floating beneath the 3D Voxel Diorama */
.pedestal-diorama-wrap::before {
  content: '';
  position: absolute;
  width: 72%;
  height: 36%;
  bottom: 6%;
  background: radial-gradient(ellipse at 35% 50%, rgba(76, 201, 255, 0.22) 0%, transparent 60%),
              radial-gradient(ellipse at 65% 50%, rgba(255, 130, 40, 0.22) 0%, transparent 60%);
  pointer-events: none;
}

.pedestal-diorama-canvas,
.pedestal-diorama-img {
  position: relative;
  z-index: 2;
  max-width: 96%;
  max-height: 100%;
  width: auto;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 16px 24px rgba(3, 10, 26, 0.62));
  transition: transform 0.16s ease;
}

.cr-arena-pedestal:hover .pedestal-diorama-canvas {
  transform: translateY(-3px) scale(1.015);
}

/* FLOATING ARENA TITLE — ZERO BOX, ZERO GRAY SLAB, PURE AAA GAME TYPOGRAPHY! */
.pedestal-base {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 2px 6px 4px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.pedestal-arena-num {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-gold);
  letter-spacing: 0.14em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
}

.pedestal-arena-name {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.06em;
  color: #FFFFFF;
  text-shadow:
    0 2px 0 #14161A,
    0 5px 14px rgba(0, 0, 0, 0.95);
  line-height: 1.06;
}

.pedestal-lore-rivalry {
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
}

.lore-king-blue {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7AD9FF;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
}

.lore-king-red {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #FF947A;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
}

.lore-vs-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-micro);
  font-size: 7.5px;
  color: var(--mc-gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
}

.lore-bolt-icon,
.lore-swords-icon {
  width: 13px;
  height: 13px;
}

/* 6E. SCULPTED HERO MOJANG EMERALD BATTLE BUTTON + SUBTLE MODE CHIP */
.cr-battle-cta-row {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.cr-battle-btn {
  position: relative;
  width: min(248px, 72%);
  min-height: 54px;
  padding: 9px 20px 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, var(--ore-green-top) 0%, var(--ore-green) 58%, var(--ore-green-bot) 100%);
  border: 2px solid var(--md-black);
  box-shadow:
    inset 0 2px 0 var(--ore-green-hi),
    inset 2px 0 0 rgba(139, 232, 104, 0.5),
    inset -2px 0 0 rgba(29, 78, 17, 0.6),
    inset 0 -6px 0 var(--ore-green-lip),
    0 10px 24px rgba(50, 165, 36, 0.36),
    0 4px 0 rgba(0, 0, 0, 0.6);
  transition: transform 0.06s ease, filter 0.1s ease;
}

.battle-btn-shine {
  display: none;
}

.battle-cta-swords {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 2px 0 var(--ore-green-deep));
}

.battle-btn-text {
  font-family: var(--font-display);
  font-size: 23px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #FFFFFF;
  text-shadow: 0 3px 0 var(--ore-green-deep);
}

.cr-battle-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.cr-battle-btn:active {
  transform: translateY(3px);
  padding-top: 12px;
  padding-bottom: 12px;
  box-shadow:
    inset 0 2px 0 var(--ore-green-lip),
    inset 0 -3px 0 var(--ore-green-deep),
    0 2px 0 rgba(0, 0, 0, 0.6);
}

/* Subtle Understated Dark-Obsidian Mode Chip (ZERO blinding white strip!) */
.cr-mode-pill {
  width: auto;
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(18, 20, 26, 0.86);
  border: 1px solid rgba(142, 117, 80, 0.55);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  color: #E8ECF4;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}

.cr-mode-pill .mode-dot {
  width: 7px;
  height: 7px;
  background: var(--mc-xp-green);
  box-shadow: 0 0 6px var(--mc-xp-green);
  flex-shrink: 0;
}

.cr-mode-pill strong {
  color: #F4F6FA;
  font-weight: 700;
}

.cr-mode-pill:hover {
  background: rgba(34, 38, 48, 0.92);
  border-color: var(--md-bronze-hi);
}

/* 6F. SCULPTED MINECRAFT DUNGEONS DARK OBSIDIAN & BRONZE BOTTOM NAVIGATION DOCK */
.cr-bottom-nav {
  flex-shrink: 0;
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: linear-gradient(180deg, #1E2027 0%, #121418 100%);
  border-top: 2px solid var(--md-bronze);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.65);
}

.cr-nav-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 54px;
  padding: 4px 10px;
  background: transparent;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #9FA6B6;
  text-shadow: 0 2px 0 #0A0B0E;
  transition: background-color 0.12s ease, color 0.12s ease, transform 0.1s ease;
}

.cr-nav-tab:last-child {
  border-right: none;
}

.cr-nav-tab:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.04);
}

/* Elevated Mojang Active Tab with Emerald Top Indicator Beam */
.cr-nav-tab.active {
  color: #FFFFFF;
  background: linear-gradient(180deg, rgba(84, 188, 54, 0.26) 0%, rgba(28, 34, 30, 0.92) 100%);
  box-shadow: inset 0 3px 0 var(--ore-green-hi);
}

.cr-nav-tab:not(.active) img {
  opacity: 0.7;
  filter: saturate(0.7);
}

.cr-nav-tab.active img {
  opacity: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65));
}

.nav-icon-wrap,
.nav-swords-badge {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon-wrap img,
.nav-swords-badge img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.notif-pill {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mc-redstone);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 1px 0 #FF8C8C;
  font-family: var(--font-micro);
  font-size: 7.5px;
  color: #FFFFFF;
}

/* ============================================================================
   7. COLLECTION / BATTLE DECK — MOJANG DUNGEONS INVENTORY SCREEN
   ============================================================================ */
#view-inventory {
  background: linear-gradient(180deg, #17191F 0%, #111317 100%);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #4B4F5C #14161A;
}

.cr-cards-page {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 8px 10px 18px;
}

.cr-deck-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  background: var(--md-surface);
  border: 2px solid var(--md-black);
  box-shadow:
    inset 0 2px 0 rgba(200, 169, 114, 0.35),
    inset 0 -3px 0 #121418;
}

.deck-top-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.deck-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 14px;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #0E0F12;
}

.badge-swords-icon {
  width: 17px;
  height: 17px;
}

.cr-avg-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 25px;
  padding: 0 7px;
  background: var(--md-well);
  border: 1px solid var(--md-bronze-lo);
  box-shadow: inset 0 2px 0 #090A0C;
}

.avg-xp-img {
  width: 14px;
  height: 14px;
}

.avg-xp-val {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--mc-xp-green);
  font-variant-numeric: tabular-nums;
}

.cr-deck-nums-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Sleek Dark-Stone Deck Slot Buttons (Zero blinding white blocks!) */
.deck-num-btn,
.deck-icon-btn {
  width: 29px;
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
  background: var(--md-btn);
  border: 2px solid var(--md-black);
  box-shadow:
    inset 0 2px 0 var(--md-btn-hi),
    inset 0 -3px 0 var(--md-btn-lip);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: #E8ECF4;
  transition: transform 0.05s ease, background-color 0.08s ease;
}

.deck-num-btn:hover,
.deck-icon-btn:hover {
  background: var(--md-btn-hover);
  color: #FFFFFF;
}

.deck-num-btn.active {
  background: linear-gradient(180deg, var(--ore-green-top) 0%, var(--ore-green) 100%);
  color: #FFFFFF;
  text-shadow: 0 1px 0 var(--ore-green-deep);
  box-shadow:
    inset 0 2px 0 var(--ore-green-hi),
    inset 0 -3px 0 var(--ore-green-lip);
}

.deck-num-btn:active,
.deck-icon-btn:active {
  transform: translateY(2px);
}

.deck-swap-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  background: #3A2A10;
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--mc-gold);
  font-size: 11px;
  font-weight: 700;
  color: #FFF4C2;
}

.cancel-swap-btn {
  flex-shrink: 0;
  padding: 4px 8px 6px;
  background: var(--md-btn);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--md-btn-hi), inset 0 -3px 0 var(--md-btn-lip);
  font-family: var(--font-micro);
  font-size: 8px;
  color: #FFFFFF;
}

/* Equipped Battle Deck Altar Well */
.cr-equipped-deck-tray {
  padding: 8px;
  background: var(--md-surface);
  border: 2px solid var(--md-black);
  box-shadow:
    inset 0 2px 0 rgba(200, 169, 114, 0.42),
    inset 0 -4px 0 #121418;
}

.cr-deck-grid-8 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

/* Official Mojang Dungeons II Card Slot (using T_UI_Slot_Background.png!) */
.cr-deck-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 3px;
  background: var(--md-well);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 1px 0 #3C404D;
  cursor: grab;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  touch-action: none;
}

.cr-deck-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--md-bronze-hi), 0 6px 12px rgba(0, 0, 0, 0.5);
}

.cr-deck-card.rarity-common .deck-portrait-box { border-color: #858B98; }
.cr-deck-card.rarity-rare .deck-portrait-box { border-color: var(--mc-diamond); }
.cr-deck-card.rarity-epic .deck-portrait-box,
.cr-deck-card.rarity-spell .deck-portrait-box { border-color: var(--mc-amethyst); }
.cr-deck-card.rarity-legendary .deck-portrait-box { border-color: var(--mc-gold); }
.cr-deck-card.rarity-building .deck-portrait-box { border-color: var(--mc-gold-mid); }

.deck-cost-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  min-width: 22px;
  height: 22px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #17330C;
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #5CD638;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-xp-green);
}

.deck-portrait-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #16181D;
  background-image: url('../Assets/UI/T_UI_Slot_Background.png?v=230');
  background-size: cover;
  border: 2px solid #6E7380;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deck-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deck-card-lvl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 3px;
  text-align: center;
  background: rgba(12, 14, 18, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
}

.deck-card-lvl.gold-lvl {
  color: var(--mc-gold);
}

.deck-card-upg {
  position: relative;
  width: 100%;
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #101216;
  border: 1px solid #30343F;
  overflow: hidden;
}

.deck-card-upg .upg-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(180deg, var(--ore-green-top) 0%, var(--ore-green) 100%);
}

.deck-card-upg .upg-arrow-box {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #225415;
  border-right: 1px solid var(--md-black);
  z-index: 2;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
}

.deck-card-upg .upg-text {
  position: relative;
  z-index: 3;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 2px #000000;
  padding-left: 11px;
}

.deck-card-upg.max-bar {
  background: linear-gradient(180deg, #9C6910 0%, #664207 100%);
  border-color: var(--mc-gold-mid);
}

.deck-card-upg.max-bar .upg-text,
.deck-card-upg.swap-ready-bar .upg-text {
  padding-left: 0;
}

.deck-card-upg.swap-ready-bar {
  background: var(--ore-green);
}

.cr-deck-card.dragging-origin { opacity: 0.32; }
.cr-deck-card.drag-valid-target { box-shadow: 0 0 0 2px var(--ore-green-hi); }
.cr-deck-card.drag-hover-target { transform: scale(1.04); box-shadow: 0 0 0 2px var(--mc-gold); }
.cr-deck-card.swap-source { box-shadow: 0 0 0 2px var(--mc-gold); }
.cr-deck-card.swap-target-pulse { animation: oreSwapPulse 0.8s steps(2, end) infinite; }

@keyframes oreSwapPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--ore-green-hi); }
  50% { box-shadow: 0 0 0 2px var(--mc-gold); }
}

.cr-deck-card.just-swapped-pop { animation: orePopIn 0.24s ease-out; }

@keyframes orePopIn {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

#card-drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.78), 0 0 0 2px var(--mc-gold);
}

.cr-drag-divider-bar {
  display: flex;
  justify-content: center;
}

.drag-divider-pill {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: #A7AEBF;
  letter-spacing: 0.04em;
  padding: 2px 0;
}

.cr-reserve-pool {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: var(--md-surface);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #383C47;
}

.reserve-pool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #2D303A;
}

.reserve-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-gold);
}

.reserve-chest-icon {
  width: 17px;
  height: 17px;
}

.reserve-sub-hint {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: #A7AEBF;
}

/* ============================================================================
   8. UNIFIED MOJANG DUNGEONS DARK ORE UI DIALOGS (INSPECTOR, OPTIONS, CHEST, END)
   ============================================================================ */
.md-card-modal,
.options-modal-overlay,
.chest-modal-overlay,
#modal-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(8, 10, 14, 0.8);
}

.md-card-modal { z-index: 55; }
#modal-overlay { z-index: 65; }
.chest-modal-overlay { z-index: 75; }
.options-modal-overlay { z-index: 80; }

.md-equipped-panel,
.options-modal-card,
.chest-modal-card,
#modal-card {
  width: 100%;
  max-width: 392px;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  background: var(--md-surface);
  border: 2px solid var(--md-black);
  box-shadow:
    0 0 0 1px rgba(142, 117, 80, 0.55),
    inset 0 2px 0 #454957,
    inset 0 -4px 0 #121418,
    0 18px 42px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}

.md-equipped-ribbon,
.options-modal-header,
.chest-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px 10px;
  background: linear-gradient(180deg, #2D313B 0%, #21242C 100%);
  border-bottom: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 rgba(200, 169, 114, 0.35);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.05em;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #0E0F12;
}

.chest-modal-header {
  justify-content: center;
  color: var(--mc-gold);
}

.opt-hdr-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.opt-hdr-icon,
.chest-modal-hdr-icon {
  width: 19px;
  height: 19px;
}

.close-insp-btn,
.options-close-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
  background: var(--md-btn);
  border: 2px solid var(--md-black);
  box-shadow:
    inset 0 2px 0 var(--md-btn-hi),
    inset 0 -3px 0 var(--md-btn-lip);
}

.close-insp-btn:hover,
.options-close-btn:hover {
  background: var(--mc-redstone);
  box-shadow: inset 0 2px 0 #FF8C8C, inset 0 -3px 0 var(--mc-redstone-dark);
}

.close-insp-btn:active,
.options-close-btn:active {
  transform: translateY(2px);
}

/* 8A. CARD INSPECTOR */
.md-equipped-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cr-info-top-section {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cr-info-portrait-wrap {
  flex-shrink: 0;
  width: 90px;
}

.cr-info-portrait-card {
  position: relative;
  width: 90px;
  height: 90px;
  background-color: var(--md-well);
  background-image: url('../Assets/UI/T_UI_Slot_Background.png?v=230');
  background-size: cover;
  border: 2px solid var(--md-black);
  box-shadow: inset 0 0 0 2px #858B98, 0 4px 10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.cr-info-portrait-card.rarity-rare { box-shadow: inset 0 0 0 2px var(--mc-diamond), 0 4px 10px rgba(0, 0, 0, 0.5); }
.cr-info-portrait-card.rarity-epic,
.cr-info-portrait-card.rarity-spell { box-shadow: inset 0 0 0 2px var(--mc-amethyst), 0 4px 10px rgba(0, 0, 0, 0.5); }
.cr-info-portrait-card.rarity-legendary { box-shadow: inset 0 0 0 2px var(--mc-gold), 0 4px 10px rgba(0, 0, 0, 0.5); }

.cr-info-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cr-info-cost-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  background: #17330C;
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #5CD638;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-xp-green);
}

.cr-cost-orb {
  width: 13px;
  height: 13px;
}

.cr-info-bio-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cr-info-type-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px 8px;
  background: var(--md-well);
  border: 1px solid #343844;
}

.cr-banner-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cr-banner-lbl {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  color: #9AA2B4;
}

.cr-banner-val {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.rarity-txt-common { color: #D4D8E2; }
.rarity-txt-rare { color: var(--mc-diamond); }
.rarity-txt-epic { color: var(--mc-amethyst); }
.rarity-txt-legendary { color: var(--mc-gold); }

.cr-info-desc {
  font-size: 12px;
  color: #D4D8E2;
  line-height: 1.38;
}

.cr-info-stats-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: var(--md-well);
  border: 1px solid #303440;
}

.cr-info-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.cr-stat-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  background: #1C1F26;
  border: 1px solid #2A2E38;
}

.cr-stat-cell.row-odd {
  background: #232630;
}

.cr-stat-icon-box {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--md-well);
  border: 1px solid #3C404E;
}

.cr-stat-img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.cr-stat-text-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.cr-stat-label {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  color: #A2A9BA;
}

.cr-stat-value {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}

.cr-tourney-toggle-btn {
  width: 100%;
  padding: 7px 10px 9px;
  background: var(--md-btn);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--md-btn-hi), inset 0 -3px 0 var(--md-btn-lip);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: #E8ECF4;
}

.cr-tourney-toggle-btn:hover {
  background: var(--md-btn-hover);
}

.md-equipped-footer {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.9fr;
  gap: 6px;
  padding: 9px 10px 11px;
  background: #17191F;
  border-top: 2px solid var(--md-black);
}

.md-footer-action-btn {
  min-height: 42px;
  padding: 6px 6px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 2px solid var(--md-black);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  transition: transform 0.06s ease, filter 0.08s ease;
}

.md-footer-action-btn.upgrade-action,
.md-footer-action-btn.primary {
  background: linear-gradient(180deg, var(--ore-green-top) 0%, var(--ore-green) 100%);
  color: #FFFFFF;
  text-shadow: 0 2px 0 var(--ore-green-deep);
  box-shadow: inset 0 2px 0 var(--ore-green-hi), inset 0 -4px 0 var(--ore-green-lip);
}

.md-footer-action-btn.upgrade-action:disabled {
  background: #2C2F38;
  color: #7D8392;
  text-shadow: none;
  cursor: not-allowed;
  box-shadow: inset 0 2px 0 #424654, inset 0 -4px 0 #181A20;
}

.md-footer-action-btn.swap-action {
  background: var(--md-btn);
  color: #E8ECF4;
  box-shadow: inset 0 2px 0 var(--md-btn-hi), inset 0 -4px 0 var(--md-btn-lip);
}

.md-footer-action-btn:hover:not(:disabled) { filter: brightness(1.1); }
.md-footer-action-btn:active:not(:disabled) { transform: translateY(2px); }

.btn-emerald-icon,
.btn-swords-icon {
  width: 15px;
  height: 15px;
}

/* 8B. OPTIONS MODAL — CALM DARK MOJANG ORE UI (ZERO BLINDING WHITE BUTTON WALLS!) */
.options-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.opt-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px;
  background: var(--md-well);
  border: 1px solid #323642;
}

.opt-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.opt-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-gold);
  letter-spacing: 0.04em;
}

.opt-title-icon {
  width: 16px;
  height: 16px;
}

.opt-row-actions,
.opt-now-playing-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.opt-val-badge {
  padding: 3px 7px;
  background: #1F222A;
  border: 1px solid #3C4150;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-xp-green);
  font-variant-numeric: tabular-nums;
}

.opt-mini-action {
  padding: 4px 8px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--md-btn);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--md-btn-hi), inset 0 -3px 0 var(--md-btn-lip);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: #ECEFF6;
}

.opt-mini-action:hover { background: var(--md-btn-hover); }

.opt-mini-action.muted,
.opt-mini-action.off {
  background: var(--mc-redstone);
  color: #FFFFFF;
  box-shadow: inset 0 2px 0 #FF8A8A, inset 0 -3px 0 var(--mc-redstone-dark);
}

.opt-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.music-vol-slider,
.opt-range-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  height: 12px;
  background: #22252D;
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #101216;
  cursor: pointer;
}

.music-vol-slider::-webkit-slider-thumb,
.opt-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 22px;
  background: linear-gradient(180deg, #D8DCE6 0%, #A9AFBD 100%);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #FFFFFF, inset 0 -3px 0 #5E6370;
  cursor: pointer;
}

.music-vol-slider::-moz-range-thumb,
.opt-range-slider::-moz-range-thumb {
  width: 18px;
  height: 22px;
  background: #C4C9D4;
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #FFFFFF, inset 0 -3px 0 #5E6370;
  cursor: pointer;
}

.opt-vol-presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.opt-preset-btn,
.opt-track-btn,
.cam-btn {
  padding: 5px 4px 7px;
  background: var(--md-btn);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--md-btn-hi), inset 0 -3px 0 var(--md-btn-lip);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: #E2E6F0;
  text-align: center;
  transition: transform 0.05s ease, background-color 0.08s ease;
}

.opt-preset-btn:hover,
.opt-track-btn:hover,
.cam-btn:hover {
  background: var(--md-btn-hover);
  color: #FFFFFF;
}

.opt-preset-btn.active,
.opt-track-btn.active,
.cam-btn.active {
  background: linear-gradient(180deg, var(--ore-green-top) 0%, var(--ore-green) 100%);
  color: #FFFFFF;
  text-shadow: 0 1px 0 var(--ore-green-deep);
  box-shadow: inset 0 2px 0 var(--ore-green-hi), inset 0 -3px 0 var(--ore-green-lip);
}

.opt-subdivider {
  height: 1px;
  background: #2C303B;
  margin: 2px 0;
}

.opt-tracks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.opt-camera-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.opt-match-row {
  display: flex;
  gap: 6px;
}

.opt-toggle-pill {
  flex: 1 1 auto;
  padding: 7px 8px 9px;
  background: var(--md-btn);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--md-btn-hi), inset 0 -3px 0 var(--md-btn-lip);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  color: #E8ECF4;
}

.opt-toggle-pill:hover { background: var(--md-btn-hover); }

.opt-home-btn {
  flex-shrink: 0;
  padding: 7px 11px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, #8B6032 0%, #63411E 100%);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #C28F54, inset 0 -3px 0 #38230D;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.home-inline {
  width: 14px;
  height: 14px;
}

.opt-about-text {
  font-size: 11px;
  color: #9FA5B5;
  line-height: 1.4;
}

.options-modal-footer,
.chest-modal-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 9px 12px 11px;
  background: #17191F;
  border-top: 2px solid var(--md-black);
}

.opt-done-btn,
.chest-modal-claim-btn {
  width: min(240px, 80%);
  min-height: 44px;
  padding: 8px 14px 12px;
  background: linear-gradient(180deg, var(--ore-green-top) 0%, var(--ore-green) 100%);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--ore-green-hi), inset 0 -5px 0 var(--ore-green-lip);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  text-shadow: 0 2px 0 var(--ore-green-deep);
}

.opt-done-btn:hover,
.chest-modal-claim-btn:hover { filter: brightness(1.08); }
.opt-done-btn:active,
.chest-modal-claim-btn:active { transform: translateY(3px); }

/* 8C. CROWN CHEST MODAL */
.chest-modal-body {
  padding: 16px 14px;
  text-align: center;
}

.chest-modal-msg {
  font-size: 13px;
  color: #E2E5EC;
  line-height: 1.45;
}

.chest-modal-msg strong {
  color: var(--mc-gold);
}

/* 8D. VICTORY / DEFEAT END MATCH MODAL */
#modal-card {
  padding: 18px 16px 16px;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.modal-crown-crest {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--md-well);
  background-image: url('../Assets/UI/T_UI_Slot_Background.png?v=230');
  background-size: cover;
  border: 2px solid var(--md-black);
  box-shadow: 0 0 0 1px var(--md-bronze-hi);
}

.modal-crown-img {
  width: 36px;
  height: 36px;
}

#modal-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.06em;
  color: var(--mc-gold);
  text-shadow: 0 3px 0 #261602;
}

#modal-subtitle {
  font-family: var(--font-micro);
  font-size: 8.5px;
  color: #B4BAC8;
  letter-spacing: 0.08em;
}

#modal-score {
  padding: 8px 24px;
  background: var(--md-well);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #090A0C, 0 0 0 1px var(--md-bronze-lo);
  font-family: var(--font-display);
  font-size: 26px;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}

.modal-btn-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.sc-btn-green {
  min-height: 46px;
  padding: 8px 12px 12px;
  background: linear-gradient(180deg, var(--ore-green-top) 0%, var(--ore-green) 100%);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--ore-green-hi), inset 0 -5px 0 var(--ore-green-lip);
  font-family: var(--font-display);
  font-size: 16px;
  color: #FFFFFF;
  text-shadow: 0 2px 0 var(--ore-green-deep);
}

.secondary-modal-btn {
  min-height: 46px;
  padding: 8px 12px 12px;
  background: var(--md-btn);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--md-btn-hi), inset 0 -5px 0 var(--md-btn-lip);
  font-family: var(--font-display);
  font-size: 16px;
  color: #FFFFFF;
}

.sc-btn-green:hover,
.secondary-modal-btn:hover { filter: brightness(1.1); }
.sc-btn-green:active,
.secondary-modal-btn:active { transform: translateY(3px); }

/* ============================================================================
   9. IN-GAME BATTLE HUD — CLEAN MOJANG STONE TOP PLATES & MINECRAFT HOTBAR
   ============================================================================ */
#hud {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 8px 0;
  gap: 6px;
}

.opponent-top-badge {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 9px 6px;
  background: rgba(18, 20, 26, 0.9);
  border: 2px solid var(--md-black);
  border-left: 4px solid var(--mc-redstone);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 3px 8px rgba(0, 0, 0, 0.45);
}

.opponent-name {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 2px #000000;
  letter-spacing: 0.03em;
}

.opponent-trophies-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.opponent-trophy-img {
  width: 13px;
  height: 13px;
}

.opponent-trophy-val {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-gold);
  font-variant-numeric: tabular-nums;
}

#timer-box {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.timer-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 5px 9px;
  background: rgba(18, 20, 26, 0.92);
  border: 2px solid var(--md-black);
  box-shadow:
    inset 0 1px 0 rgba(200, 169, 114, 0.35),
    0 3px 8px rgba(0, 0, 0, 0.45);
}

.timer-clock-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.timer-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  color: #C4CAD8;
  letter-spacing: 0.05em;
}

#match-timer {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1;
  color: #FFFFFF;
  text-shadow: 0 2px 0 #0A0B0E;
  font-variant-numeric: tabular-nums;
}

#match-timer.double-xp { color: var(--mc-xp-green); }
#match-timer.overtime { color: var(--mc-gold); }
#match-timer.urgent { color: #FF5C5C; }

.xp-mult-badge {
  padding: 3px 5px;
  background: #4C1D95;
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--mc-amethyst);
  font-family: var(--font-micro);
  font-size: 7.5px;
  color: #FFFFFF;
}

.xp-mult-badge.triple-xp {
  background: #9E1919;
  box-shadow: inset 0 2px 0 #FF8080;
}

.hud-gear-btn {
  width: 27px;
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
  background: linear-gradient(180deg, #3A3E48 0%, #262932 100%);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #5F6575, inset 0 -3px 0 #181A20;
}

.hud-gear-btn:hover { filter: brightness(1.15); }
.hud-gear-btn:active { transform: translateY(2px); }

.hud-gear-img {
  width: 16px;
  height: 16px;
  filter: brightness(1.15);
}

/* Clash Royale Right-Side River Crown Counter (Red Enemy above river | Blue Player below river) */
.crown-score-rail {
  position: absolute;
  right: 5px;
  top: var(--river-y, 42.6%);
  transform: translateY(-50%);
  z-index: 22;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
}

.crown-side-badge {
  min-width: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 5px 3px;
  background: rgba(14, 16, 22, 0.88);
  border: 2px solid var(--md-black);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.16),
    inset 0 -3px 0 rgba(0, 0, 0, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.55);
}

.crown-side-badge.enemy {
  border-top: 2px solid #FF5A6E;
  box-shadow:
    inset 0 2px 0 rgba(255, 110, 128, 0.35),
    inset 0 -3px 0 #6E101D,
    0 3px 8px rgba(0, 0, 0, 0.55);
}

.crown-side-badge.player {
  border-top: 2px solid #4CC9FF;
  box-shadow:
    inset 0 2px 0 rgba(96, 208, 255, 0.35),
    inset 0 -3px 0 #104178,
    0 3px 8px rgba(0, 0, 0, 0.55);
}

.crown-rail-icon {
  width: 22px;
  height: 22px;
  display: block;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.9));
}

.crown-rail-num {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #FFFFFF;
  text-shadow:
    0 2px 0 #090A0D,
    1px 0 0 #090A0D,
    -1px 0 0 #090A0D,
    0 -1px 0 #090A0D;
}

.crown-side-badge.enemy .crown-rail-num { color: #FFD6DA; }
.crown-side-badge.player .crown-rail-num { color: #D4F3FF; }

.crown-side-badge.crown-pop {
  animation: crownScorePop 380ms cubic-bezier(0.22, 1.35, 0.36, 1);
}

@keyframes crownScorePop {
  0%   { transform: scale(1); }
  38%  { transform: scale(1.32); filter: brightness(1.35); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* 9B. LORE DUEL BANNER, CENTER BANNER & DEPLOY HINT */
#lore-duel-banner {
  position: absolute;
  top: 72px;
  left: 10px;
  right: 10px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  background: rgba(18, 20, 26, 0.94);
  border: 2px solid var(--md-black);
  box-shadow:
    inset 0 2px 0 var(--mc-gold),
    0 8px 20px rgba(0, 0, 0, 0.55);
}

.lore-duel-side {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.lore-duel-side.red { text-align: right; }
.duel-spell-img { width: 24px; height: 24px; }

.duel-king-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.duel-king-text strong {
  font-family: var(--font-micro);
  font-size: 8.5px;
}

.lore-duel-side.blue .duel-king-text strong { color: #7AD9FF; }
.lore-duel-side.red .duel-king-text strong { color: #FF947A; }
.duel-king-text span { font-size: 10px; color: #B4BAC8; }

.lore-duel-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  font-family: var(--font-micro);
  font-size: 7px;
  color: var(--mc-gold);
}

.duel-crown-img { width: 18px; height: 18px; }

#center-banner {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 26;
  padding: 8px 16px 10px;
  background: rgba(18, 20, 26, 0.94);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--mc-gold), 0 8px 20px rgba(0, 0, 0, 0.55);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--mc-gold);
  text-shadow: 0 2px 0 #0E0F12;
  white-space: nowrap;
}

#deploy-hint {
  align-self: center;
  margin-bottom: 6px;
  padding: 4px 10px;
  background: rgba(14, 16, 20, 0.88);
  border: 1px solid rgba(139, 232, 104, 0.55);
  font-family: var(--font-micro);
  font-size: 7.5px;
  color: #FFFFFF;
  letter-spacing: 0.05em;
}

#arena-drag-card-ghost {
  position: fixed;
  z-index: 95;
  pointer-events: none;
  width: 68px;
  height: 68px;
  transform: translate(-50%, -58%);
  background: var(--md-well);
  border: 3px solid #FFFFFF;
  box-shadow: 0 0 0 2px var(--md-black), 0 10px 20px rgba(0, 0, 0, 0.55);
}

#arena-drag-card-ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ghost-cost-pill {
  position: absolute;
  top: -8px;
  left: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #17330C;
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #5CD638;
  font-family: var(--font-micro);
  font-size: 10px;
  color: var(--mc-xp-green);
}

/* 9C. BOTTOM MINECRAFT HOTBAR DOCK & VANILLA SEGMENTED XP BAR */
#bottom-hud {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 8px 8px;
  background-color: #202227;
  background-image:
    linear-gradient(180deg, rgba(32, 34, 40, 0.35) 0%, rgba(16, 17, 20, 0.65) 100%),
    url('../Assets/UI/OreUI/mc_hotbar_dock.png?v=230');
  background-size: 100% 100%;
  image-rendering: pixelated;
  border-top: 2px solid var(--md-bronze);
  box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.52);
}

#deck-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  width: 100%;
}

#next-card-box {
  flex-shrink: 0;
  width: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.next-label {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  color: #DCE0EC;
  text-shadow: 0 1px 0 #0A0B0E;
  letter-spacing: 0.05em;
}

#next-card-slot {
  width: 46px;
  height: 46px;
  background: var(--md-well);
  border: 2px solid var(--md-black);
  box-shadow: inset 2px 2px 0 #090A0C, inset -2px -2px 0 #4B4F5C;
  padding: 3px;
  overflow: hidden;
  opacity: 0.88;
}

#next-card-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#hand-cards {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.card-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--md-well);
  border: 2px solid var(--md-black);
  box-shadow: inset 2px 2px 0 #090A0C, inset -2px -2px 0 #535764;
  padding: 3px;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.1s ease;
  touch-action: none;
}

.card-slot:hover:not(.disabled) { transform: translateY(-3px); }
.card-slot.rarity-rare { box-shadow: inset 2px 2px 0 #123E5C, inset -2px -2px 0 var(--mc-diamond); }
.card-slot.rarity-epic,
.card-slot.rarity-spell { box-shadow: inset 2px 2px 0 #3E1266, inset -2px -2px 0 var(--mc-amethyst); }
.card-slot.rarity-legendary { box-shadow: inset 2px 2px 0 #5C3A06, inset -2px -2px 0 var(--mc-gold); }

/* Vanilla Minecraft Thick White Hotbar Cursor on Active Card */
.card-slot.selected {
  transform: translateY(-7px);
  z-index: 5;
}

.card-slot.selected::after {
  content: '';
  position: absolute;
  inset: -4px;
  pointer-events: none;
  border: 6px solid transparent;
  border-image-source: url('../Assets/UI/OreUI/mc_hotbar_select.png?v=230');
  border-image-slice: 6;
  border-image-repeat: stretch;
  image-rendering: pixelated;
  z-index: 6;
}

.card-slot.disabled {
  filter: grayscale(0.75) brightness(0.58);
  cursor: not-allowed;
}

.hand-art-1to1 {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1B1D24;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-cost {
  position: absolute;
  top: -5px;
  left: -4px;
  z-index: 4;
  min-width: 22px;
  height: 22px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #17330C;
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #5CD638;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mc-xp-green);
}

.card-key {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 4;
  padding: 1px 5px;
  background: rgba(14, 16, 20, 0.88);
  border: 1px solid #484C58;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  color: #E2E6F0;
}

#xp-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#xp-badge {
  flex-shrink: 0;
  min-width: 50px;
  height: 23px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--md-well);
  border: 2px solid var(--md-black);
  box-shadow: inset 2px 2px 0 #090A0C, inset -2px -2px 0 #424652;
}

.xp-orb-img { width: 14px; height: 14px; }

#xp-text {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1;
  color: var(--mc-xp-green);
  text-shadow:
    -1px -1px 0 #142B04,
     1px -1px 0 #142B04,
    -1px  1px 0 #142B04,
     1px  1px 0 #142B04,
     0    2px 0 #0C1A02;
  font-variant-numeric: tabular-nums;
}

#xp-bar-track {
  position: relative;
  flex: 1 1 auto;
  height: 17px;
  background: var(--md-well);
  border: 2px solid var(--md-black);
  overflow: hidden;
}

.xp-bar-pixel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  image-rendering: pixelated;
  display: block;
}

#xp-bar-ghost,
#xp-bar-fill {
  position: absolute;
  inset: 0;
}

#xp-bar-ghost {
  opacity: 0.4;
  clip-path: inset(0 calc(100% - var(--xp-ghost-pct, 0%)) 0 0);
}

#xp-bar-fill {
  clip-path: inset(0 calc(100% - var(--xp-pct, 0%)) 0 0);
}

/* ============================================================================
   10. WORLD FLOATING HP BARS, SQUARE PIXEL DEPLOY CLOCK & AGGRO ALERTS
   ============================================================================ */
.world-hp {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.cr-hp-row,
.cr-unit-hp-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.cr-crown-badge {
  position: relative;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shield-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.hp-lvl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 14px;
  padding: 0 3px;
  border: 2px solid var(--md-black);
  font-family: var(--font-micro);
  font-size: 7px;
  color: #FFFFFF;
  text-shadow: 0 1px 0 #000000;
  line-height: 1;
}

.hp-lvl-badge.player { background: #1B7EC2; box-shadow: inset 0 1px 0 #7AD9FF; }
.hp-lvl-badge.enemy { background: #C42B2B; box-shadow: inset 0 1px 0 #FF8080; }

.hp-lvl-badge.tower-lvl {
  position: absolute;
  left: -4px;
  bottom: -4px;
  min-width: 15px;
  height: 13px;
  font-size: 6.5px;
}

.hp-bars-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hp-track {
  position: relative;
  width: 44px;
  height: 8px;
  background: #14161A;
  border: 2px solid var(--md-black);
  overflow: hidden;
}

.world-hp.tower .hp-track { width: 70px; height: 13px; }
.world-hp.king-tower .hp-track { width: 82px; height: 14px; }

.hp-trail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #FFFFFF;
  z-index: 1;
}

.hp-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
}

.world-hp.player .hp-fill {
  background: #2DA8F0;
  box-shadow: inset 0 2px 0 #82DCFF, inset 0 -2px 0 #126196;
}

.world-hp.enemy .hp-fill {
  background: #E03C3C;
  box-shadow: inset 0 2px 0 #FF8C8C, inset 0 -2px 0 #8C1919;
}

.hp-num {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-micro);
  font-size: 7.5px;
  color: #FFFFFF;
  text-shadow: 0 1px 0 #000000;
  font-variant-numeric: tabular-nums;
}

.hp-shield-track {
  position: relative;
  width: 44px;
  height: 5px;
  background: #14161A;
  border: 1px solid var(--md-black);
}

.hp-shield-fill {
  height: 100%;
  background: #B8F4FF;
  box-shadow: inset 0 1px 0 #FFFFFF;
}

/* Square Minecraft Pixel Deploy Clock (Zero Smooth Circles) */
.world-deploy-clock {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 14;
}

.deploy-clock-ring {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--md-well);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #5C606D, 0 2px 0 rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.deploy-clock-pie {
  position: absolute;
  inset: 0;
  background: conic-gradient(var(--mc-xp-green) var(--deploy-deg, 0deg), rgba(20, 22, 26, 0.2) 0deg);
  opacity: 0.72;
}

.world-deploy-clock.enemy .deploy-clock-pie {
  background: conic-gradient(#FF6B6B var(--deploy-deg, 0deg), rgba(20, 22, 26, 0.2) 0deg);
}

.deploy-clock-icon {
  position: relative;
  z-index: 2;
  width: 14px;
  height: 14px;
}

.world-aggro-ping {
  position: absolute;
  transform: translate(-50%, -100%);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mc-gold);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 #FFF6B0, 0 2px 0 rgba(0, 0, 0, 0.5);
  font-family: var(--font-micro);
  font-size: 10px;
  color: var(--md-black);
  z-index: 15;
}

.world-aggro-ping.enemy {
  background: var(--mc-redstone);
  box-shadow: inset 0 2px 0 #FF8A8A, 0 2px 0 rgba(0, 0, 0, 0.5);
  color: #FFFFFF;
}

.world-aggro-ping.pop { animation: oreAggroPop 0.22s steps(3, end); }

@keyframes oreAggroPop {
  0% { transform: translate(-50%, -60%) scale(0.6); }
  100% { transform: translate(-50%, -100%) scale(1); }
}

.king-awake-alert {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: rgba(18, 20, 26, 0.94);
  border: 2px solid var(--md-black);
  box-shadow: inset 0 2px 0 var(--mc-gold), 0 3px 0 rgba(0, 0, 0, 0.5);
  font-family: var(--font-micro);
  font-size: 8px;
  color: var(--mc-gold);
  white-space: nowrap;
  z-index: 16;
}

.king-awake-bang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: var(--mc-redstone);
  border: 1px solid var(--md-black);
  color: #FFFFFF;
}

/* ============================================================================
   11. RESPONSIVE COMPACT POLISH (360x640 & 390x844)
   ============================================================================ */
@media (max-width: 390px) {
  .md-profile-row { padding: 6px 8px 8px; }
  .md-emerald-box, .md-trophy-box { padding: 0 5px; font-size: 10.5px; }
  .md-player-name { font-size: 8.5px; }
}

@media (max-height: 700px) {
  .home-mc-logo-img { width: 196px; }
  .pedestal-arena-name { font-size: 18px; }
  .cr-battle-btn { min-height: 48px; }
  .battle-btn-text { font-size: 20px; }
  .cr-nav-tab { height: 48px; }
}
