/* ========================================================================== */
/* 1. DESIGN TOKENS & ROOT VARIABLES                                         */
/* ========================================================================== */

:root {
  /* Base Backgrounds - Dark base palette and wood/parchment surfaces */
  --bg-dark-base: #080503;
  --bg-dark-accent: #0d0804;
  --bg-wood-dark: #1a0f0a;
  --bg-wood-mid: #2c1a12;
  --bg-parchment: #2d2219;

  /* Accents & Borders - Golden border highlights and accents */
  --border-gold: #c89d38;
  --border-gold-light: #f3d078;

  /* Text & Highlights - Primary golden text color */
  --text-gold: #e2b755;

  /* Game Bar Gauges - Status indicators for HP and Mana */
  --hp-green: #2ecc71;
  --hp-red: #e74c3c;
  --mana-blue: #3498db;

  /* Layout Dimensions - Fixed game container bounds */
  --game-width: 450px;
  --game-height: 800px;
}

/* ========================================================================== */
/* 2. GLOBAL RESET & BASE STYLES                                            */
/* ========================================================================== */

/* Disables text selection across elements for smooth mobile touch interactions */
* {
  /* Box Model */
  box-sizing: border-box;
  margin: 0;
  padding: 0;

  /* Miscellaneous */
  user-select: none;
  -webkit-user-select: none;
}

/* Base HTML and Body styling with layered vignette and background graphics */
html, body {
  /* Layout / Positioning */
  display: flex;
  justify-content: center;
  align-items: center;

  /* Box Model */
  width: 100%;
  height: 100%;

  /* Typography */
  font-family: 'Inter', sans-serif;

  /* Visuals / Backgrounds */
  /* 
   * Layer 1: Radial vignette gradient with central warm glow fading to #080503 / #0d0804 edges
   * Layer 2: Seamless repeating SVG diamond lattice pattern with padded gradients & intersecting gold sparks
   */
  background-color: var(--bg-dark-base);
  background-image: 
    radial-gradient(ellipse at center, rgba(180, 120, 40, 0.22) 0%, rgba(35, 20, 10, 0.70) 50%, var(--bg-dark-accent) 85%, var(--bg-dark-base) 100%),
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='90' viewBox='0 0 60 90'%3E%3Cdefs%3E%3CradialGradient id='diamondGrad' cx='50%' cy='50%' r='70%'%3E%3Cstop offset='0%' stop-color='%23634323'/%3E%3Cstop offset='55%' stop-color='%2326180c'/%3E%3Cstop offset='100%' stop-color='%230d0804'/%3E%3C/radialGradient%3E%3CradialGradient id='sparkGrad' cx='50%' cy='50%' r='50%'%3E%3Cstop offset='0%' stop-color='%23ffffff'/%3E%3Cstop offset='25%' stop-color='%23f3d078'/%3E%3Cstop offset='60%' stop-color='%23c89d38'/%3E%3Cstop offset='100%' stop-color='rgba(200,157,56,0)'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M30 0 L60 45 L30 90 L0 45 Z' fill='url(%23diamondGrad)' stroke='%23120a06' stroke-width='1.2'/%3E%3Ccircle cx='30' cy='0' r='3' fill='url(%23sparkGrad)'/%3E%3Ccircle cx='60' cy='45' r='3' fill='url(%23sparkGrad)'/%3E%3Ccircle cx='30' cy='90' r='3' fill='url(%23sparkGrad)'/%3E%3Ccircle cx='0' cy='45' r='3' fill='url(%23sparkGrad)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-position: center;

  /* Miscellaneous */
  overflow: hidden;
}

/* ========================================================================== */
/* 3. AMBIENT BACKGROUND CANVAS                                               */
/* ========================================================================== */

/* Ambient embers/dust canvas overlay layer with pointer events disabled */
#bg-particle-canvas {
  /* Layout / Positioning */
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;

  /* Box Model */
  width: 100vw;
  height: 100vh;

  /* Miscellaneous */
  pointer-events: none;
}

/* ========================================================================== */
/* 4. GAME CONTAINER & LAYOUT WRAPPER                                         */
/* ========================================================================== */

/* Core game container enforcing 9:16 aspect ratio and establishing container query root */
.game-wrapper {
  /* Layout / Positioning */
  position: relative;
  z-index: 10;

  /* Box Model */
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 9 / 16;
  margin: auto;

  /* Visuals / Backgrounds */
  overflow: hidden;

  /* Container Query Setup */
  container-type: size;
  container-name: game;
}