:root {
  --background: #2f2f2f;
  --snake: #00cc00;
  --treasure: #ffd700;
  --text: #ffffff;
  --overlay: rgba(0, 0, 0, 0.8);
  --header-ornament: #8b7355;
  --header-gradient: linear-gradient(180deg, #463e3f 0%, #2f2f2f 100%);
}

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

body {
  font-family: "Cinzel", serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-container {
  text-align: center;
}

header {
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px var(--treasure);
}

.score-board {
  display: flex;
  justify-content: space-around;
  font-size: 1.2rem;
}

#gameCanvas {
  border: 4px solid var(--treasure);
  background: #1a1a1a;
  box-shadow: 0 0 20px var(--treasure);
}

.overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--overlay);
  padding: 2rem;
  border-radius: 10px;
  border: 2px solid var(--treasure);
}

.hidden {
  display: none;
}

button {
  background: var(--treasure);
  color: var(--background);
  border: none;
  padding: 1rem 2rem;
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  margin-top: 1rem;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
}

button:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--treasure);
}

.game-header {
  position: relative;
  background: var(--header-gradient);
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.header-ornament {
  position: absolute;
  width: 40px;
  height: 100%;
  top: 0;
}

.header-ornament.left {
  left: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 100'%3E%3Cpath d='M0,0 C8,20 8,80 0,100 L24,100 L24,0 Z' fill='%238b7355'/%3E%3C/svg%3E")
    repeat-y;
}

.header-ornament.right {
  right: 0;
  transform: scaleX(-1);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 100'%3E%3Cpath d='M0,0 C8,20 8,80 0,100 L24,100 L24,0 Z' fill='%238b7355'/%3E%3C/svg%3E")
    repeat-y;
}

.title-container {
  text-align: center;
}

.game-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px var(--treasure), 0 0 20px var(--treasure);
  animation: glow 2s ease-in-out infinite alternate;
}

.score-board {
  display: flex;
  gap: 2rem;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--treasure);
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.score-label {
  font-size: 0.9rem;
  color: var(--treasure);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value {
  font-size: 1.4rem;
  font-weight: bold;
  text-shadow: 0 0 5px var(--treasure);
}

.mute-button {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--treasure);
  color: var(--treasure);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.4rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
}

.mute-button:hover {
  transform: translateY(-50%) scale(1.1);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 15px var(--treasure);
}

.mute-button.muted {
  opacity: 0.6;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px var(--treasure), 0 0 20px var(--treasure);
  }
  to {
    text-shadow: 0 0 15px var(--treasure), 0 0 30px var(--treasure),
      0 0 40px var(--treasure);
  }
}

@media (max-width: 600px) {
  #gameCanvas {
    width: 300px;
    height: 300px;
  }

  h1 {
    font-size: 2rem;
  }

  .score-board {
    font-size: 1rem;
  }

  .game-header {
    padding: 1rem;
  }

  .header-ornament {
    width: 20px;
  }

  .game-title {
    font-size: 1.8rem;
  }

  .score-board {
    gap: 1rem;
  }

  .score-label {
    font-size: 0.8rem;
  }

  .score-value {
    font-size: 1.2rem;
  }

  .mute-button {
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
}

.copyright {
  position: fixed;
  bottom: 1rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.7;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.copyright .credit {
  color: var(--treasure);
  text-decoration: none;
  transition: all 0.3s ease;
}

.copyright .credit:hover {
  opacity: 1;
  text-shadow: 0 0 10px var(--treasure);
}
