/* Main Styles - Core Layout & UI */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(var(--vh, 1vh) * 100);
  margin: 0;
  overflow-y: hidden;
  background: url("./img/bg.jpg") center/cover;
}

@font-face {
  font-family: "Fredericka";
  src: url("./fonts/Fredericka_the_Great/FrederickatheGreat-Regular.ttf") format("truetype");
}

canvas {
  background: black;
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
}

.canvas-container {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

button {
  font-family: "Fredericka";
  font-size: 24px;
  background: linear-gradient(to bottom, #af5f26, #885028);
  color: #fff5e1;
  border: 4px solid #5c4033;
  border-radius: 12px;
  padding: 12px 32px;
  text-shadow: 1px 1px 2px #000;
  box-shadow: 0 4px 0 #5c4033, 0 6px 12px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  letter-spacing: 1px;
}

button:hover {
  background: linear-gradient(to bottom, #ffa07a, #cd5c5c);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #5c4033, 0 10px 15px rgba(0, 0, 0, 0.6);
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #5c4033;
}

#start-screen,
#game-over,
#game-won {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
}

#game-over,
#game-won {
  display: none;
  background: rgba(0, 0, 0, 0.4);
}

#game-over-screen,
#game-won-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 20px;
  border-radius: 16px;
  text-align: center;
}

#start-screen {
  height: calc(var(--vh, 1vh) * 100);
}

#start-screen-img {
  max-width: 720px;
  width: 100%;
  object-fit: cover;
}

.endgame-buttns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.game-over-img img,
#game-won-img img {
  height: auto;
  max-height: 40vh;
  width: 80%;
  object-fit: contain;
  margin-bottom: 12px;
}

.start-bttn {
  margin: 30px auto 20px auto;
  z-index: 1002;
  display: flex;
  justify-content: center;
}

#rotate-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
  background: black;
  color: white;
  display: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 9999;
}

#mute-button,
#copyright-button,
#touch-toggle {
  position: fixed;
  top: 20px;
  z-index: 1001;
  width: 42px;
  height: 42px;
  cursor: pointer;
  background: linear-gradient(145deg, rgba(175, 95, 38, 0.95), rgba(136, 80, 40, 0.95));
  border: 3px solid #5c4033;
  border-radius: 10px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), 0 2px 0 #3a2817;
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  font-family: "Fredericka";
  color: #fff5e1;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

#mute-button {
  right: 20px;
}
#copyright-button {
  right: 70px;
  font-size: 24px;
}
#touch-toggle {
  left: 20px;
  display: none;
  font-size: 18px;
}

#mute-button:hover,
#copyright-button:hover,
#touch-toggle:hover {
  background: linear-gradient(145deg, rgba(255, 160, 122, 0.95), rgba(175, 95, 38, 0.95));
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5), 0 4px 0 #3a2817;
}

#mute-button:active,
#copyright-button:active,
#touch-toggle:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 1px 0 #3a2817;
}

#mute-button img {
  width: 60%;
  height: 60%;
  object-fit: contain;
  filter: drop-shadow(1px 1px 2px rgba(255, 255, 255, 0.7)) brightness(1.3) contrast(1.2);
  transition: all 0.2s ease;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
