/* Wood Theme Variables & Global Styles */
:root {
  --bg-color: #fdf8f3;
  --board-bg: #e8dcc4;
  --block-light: #d2b48c;
  --block-dark: #c19a6b;
  --sandal-red: #96281b;
  --ui-brown: #5d4037;
  --text-muted: #8d7b6d;

  --wood-dark: var(--ui-brown);
  --wood-medium: var(--text-muted);
  --wood-light: var(--block-dark);
  --wood-pale: var(--bg-color);
  --red-sandalwood: var(--sandal-red);
  --red-sandalwood-light: #b33927;
  --gold-accent: var(--block-dark);
  --shadow-color: rgba(93, 64, 55, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  background-attachment: fixed;
  color: var(--ui-brown);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Background Wood Pattern Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.02;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    45deg,
    #5d4037,
    #5d4037 2px,
    transparent 2px,
    transparent 10px
  );
}

#app-container {
  width: 100%;
  max-width: 500px;
  height: 100vh;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  position: relative;
}

@media (min-height: 800px) {
  #app-container {
    padding: 24px 16px;
  }
}

/* Typography styles */
h1.game-title {
  font-family: 'Georgia', serif;
  font-style: italic;
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1px;
  color: var(--ui-brown);
  text-shadow: none;
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
}

h2.sub-title {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-top: -2px;
  margin-bottom: 12px;
}

/* Canvas & Board Container */
.board-outer-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #3d2b1f;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 20px 50px rgba(93, 64, 55, 0.15);
  border: 8px solid var(--ui-brown);
  position: relative;
}

/* The exit indicator arrow */
.board-exit-gate {
  position: absolute;
  right: -8px;
  top: calc(12px + (100% - 24px) * 2 / 6);
  height: calc((100% - 24px) / 6);
  width: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
}

.exit-arrow-glow {
  width: 12px;
  height: 60%;
  background: var(--sandal-red);
  border-radius: 4px;
  box-shadow: 0 0 12px var(--sandal-red);
  animation: pulse-glow 1.5s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.4;
    transform: scaleX(0.9);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.1);
  }
}

canvas#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
  background: var(--board-bg);
  box-shadow: inset 0 2px 8px rgba(93, 64, 55, 0.15);
}
