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

:root {
  --bg:         #0c0a08;
  --stone:      #1a1612;
  --stone-mid:  #242018;
  --stone-light:#2e2820;
  --gold:       #c9a84c;
  --gold-light: #e8c96a;
  --gold-dim:   #7a6530;
  --amber:      #d4813a;
  --crimson:    #8b1a1a;
  --parchment:  #f0deb4;
  --text:       #e8dfc8;
  --text-dim:   #8a7d68;
  --border:     #3a3020;
  --border-gold:#5a4820;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Georgia', serif;
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#game-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(100,70,20,0.12) 0%, transparent 60%),
    #0c0a08;
}

#gameCanvas {
  display: block;
  image-rendering: pixelated;
  cursor: crosshair;
  border: 2px solid #5a4820;
  box-shadow:
    0 0 0 1px #3a3020,
    0 0 50px rgba(180,130,40,0.10),
    0 0 120px rgba(0,0,0,0.95);
  transform-origin: center center;
}

#loading {
  position: fixed;
  inset: 0;
  background: #0c0a08;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  gap: 20px;
  transition: opacity 0.5s ease;
}

#loading h1 {
  font-size: 20px;
  font-weight: bold;
  color: #c9a84c;
  letter-spacing: 7px;
  text-transform: uppercase;
}

#loading p {
  font-size: 13px;
  color: #8a7d68;
  letter-spacing: 3px;
  font-style: italic;
  animation: blink 1.2s step-end infinite;
}

.loading-bar {
  width: 240px;
  height: 3px;
  background: #3a3020;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7a6530, #e8c96a);
  width: 0%;
  animation: load 1.4s ease-out forwards;
}

@keyframes load { to { width: 100%; } }
@keyframes blink { 50% { opacity: 0; } }

#loading.hidden {
  opacity: 0;
  pointer-events: none;
}
