:root {
  --slate-color: #223026;
  --wood-border: #6d421e;
  --wood-shadow: #41220c;
  --chalk-font: 'Patrick Hand', cursive;
  --display-font: 'Cabin Sketch', cursive;
}

body {
  margin: 0;
  padding: 0;
  background-color: #f7e1c8;
  background-image: radial-gradient(#ecc49f 1px, transparent 1px);
  background-size: 20px 20px;
  color: #fff;
  font-family: var(--chalk-font);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chalkboard-container {
  width: 95%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.chalkboard-header {
  text-align: center;
  margin-bottom: 20px;
  color: #4e3524;
  position: relative;
  width: 100%;
}

.nav-back {
  position: absolute;
  left: 0;
  top: 15px;
  color: #4e3524;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  border-bottom: 2px dashed #4e3524;
}

.chalk-title {
  font-family: var(--display-font);
  font-size: 3rem;
  margin: 0;
  color: #4e3524;
  text-shadow: 1px 1px 0px rgba(255,255,255,0.7);
}

.chalk-subtitle {
  margin: 5px 0 0 0;
  font-size: 1.2rem;
}

/* Wood Bezel & Blackboard */
.wood-frame {
  background: var(--wood-border);
  border: 12px solid var(--wood-border);
  border-radius: 12px;
  box-shadow: 0 15px 30px rgba(78, 53, 36, 0.4),
              inset 0 4px 10px rgba(0,0,0,0.6),
              0 4px 0 var(--wood-shadow);
  width: 100%;
  box-sizing: border-box;
}

.slate-board {
  background-color: var(--slate-color);
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 0),
                    radial-gradient(rgba(255,255,255,0.02) 1px, transparent 0);
  background-size: 80px 80px;
  background-position: 0 0, 40px 40px;
  border-radius: 4px;
  position: relative;
  min-height: 400px;
  cursor: crosshair;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
}

#chalk-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Welcome Overlay */
.chalk-note {
  position: absolute;
  top: 15px;
  right: 20px;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--display-font);
  font-size: 1.5rem;
  user-select: none;
}

/* Tray below board */
.tray {
  margin-top: 15px;
  width: 90%;
  background: linear-gradient(to bottom, #d2a479, #9c6c43);
  border-radius: 0 0 10px 10px;
  height: 35px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15), inset 0 2px 4px rgba(255,255,255,0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 25px;
  border-top: 4px solid var(--wood-shadow);
}

.chalks {
  display: flex;
  gap: 12px;
}

.chalk-tool {
  width: 14px;
  height: 38px;
  border: none;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.2), inset 0 2px 4px rgba(0,0,0,0.15);
  transition: transform 0.2s;
  transform: translateY(4px);
}

.chalk-tool.active {
  transform: translateY(-8px);
  box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

.eraser-btn {
  background: #ecc49f;
  border: 2px solid #9c6c43;
  color: #4e3524;
  font-family: var(--display-font);
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.eraser-btn:hover {
  background: #f7e1c8;
}
