:root {
  --wood-bg: #f5e6cc; /* Lighter beige for the board */
  --wood-line: rgba(101, 67, 33, 0.08);
  --btn-red: #8d6e63; /* Brownish button */
  --btn-accent: #ffea00; /* Yellow accent */
  --btn-border: #3e2723;
  --font-main: 'Fredoka', sans-serif;
  --mold-fill: rgba(62, 39, 35, 0.2);
  --mold-border: #4e342e;
}

body {
  margin: 0;
  padding: 0;
  background-color: #d7ccc8;
  font-family: var(--font-main);
  color: #3e2723;
  overflow: hidden;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.game-container {
  width: 100vw;
  height: 100dvh;
  max-width: 900px;
  background: var(--wood-bg);
  position: relative;
  border: 10px solid #5d4037;
  box-shadow: inset 0 0 100px rgba(0,0,0,0.1);
  background-image: 
    linear-gradient(var(--wood-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--wood-line) 1px, transparent 1px);
  background-size: 50px 50px;
  display: flex;
  flex-direction: column;
}

.game-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
}

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 3px solid var(--btn-border);
  background: #fff8e1;
  color: var(--btn-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 var(--btn-border);
  transition: all 0.1s;
}

.icon-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--btn-border);
}

.stars-display {
  font-size: 2rem;
  color: #ffb300;
  text-shadow: 2px 2px 0 #3e2723;
  letter-spacing: 4px;
}

.star-gold { color: #ffb300; }
.star-outline { color: #d7ccc8; opacity: 0.5; }

.main-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.game-footer {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 20;
  background: rgba(255, 248, 225, 0.4);
  border-top: 2px solid var(--wood-line);
}

.drop-trigger {
  background: #ffea00;
  color: #3e2723;
  border: 4px solid var(--btn-border);
  padding: 14px 50px;
  border-radius: 15px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--btn-border);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.drop-trigger:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--btn-border);
}

#accuracy-display {
  font-weight: 700;
  font-size: 1rem;
  color: #3e2723;
  background: rgba(255,255,255,0.8);
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid var(--btn-border);
}

#toast-container {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1000;
}

.toast {
  background: #fff9c4;
  padding: 20px 40px;
  border-radius: 20px;
  border: 5px solid var(--btn-border);
  box-shadow: 8px 8px 0 var(--btn-border);
  font-size: 1.5rem;
  font-weight: 700;
  color: #3e2723;
  animation: pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
  .game-container { border-width: 6px; }
  .drop-trigger { padding: 12px 30px; font-size: 1.1rem; }
  .stars-display { font-size: 1.6rem; }
  .icon-btn { width: 42px; height: 42px; }
}