* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Bungee", system-ui;
  background: linear-gradient(135deg, #1a0f00 0%, #2d1810 50%, #1a0f00 100%);
  color: #f0e6d2;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden;
}
h1 {
  font-family: "Bitcount Grid Double", system-ui;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  color: #ff9800;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 4px;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.title-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: invert(47%) sepia(88%) saturate(2028%) hue-rotate(9deg)
    brightness(100%) contrast(101%);
}
.subtitle {
  color: #b8860b;
  /* font-style: italic; */
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  margin-bottom: 16px;
  letter-spacing: 1px;
  text-align: center;
}
.game-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.player-sidebar {
  position: absolute;
  right: calc(100% + 24px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.1);
  min-width: 220px;
  transition:
    box-shadow 0.4s,
    border-color 0.4s,
    background 0.4s;
}
.player-card.active {
  border-color: #ffeb3b;
  background: rgba(255, 235, 59, 0.12);
  box-shadow:
    0 0 20px rgba(255, 235, 59, 0.4),
    0 0 40px rgba(255, 235, 59, 0.15);
}
.player-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.player-card.active .player-img {
  filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 235, 59, 0.7));
}
.player-label {
  font-family: "Bitcount Grid Double", system-ui;
  font-size: 1.15rem;
  color: #ffe0b2;
  font-weight: bold;
}
.player-sub {
  font-size: 0.85rem;
  color: #b8860b;
}
.player-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.player-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: #b8860b;
  width: 100%;
  gap: 12px;
}
.stat-label {
  color: #b8860b;
  white-space: nowrap;
}
.stat-val {
  font-family: "Bitcount Grid Double", system-ui;
  color: #ffe0b2;
  font-weight: bold;
  text-align: right;
  min-width: 40px;
}
#gameCanvas {
  cursor: grab;
  border-radius: 8px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(255, 152, 0, 0.1);
  max-width: 100%;
  height: auto;
}
#gameCanvas:active {
  cursor: grabbing;
}
@media (min-width: 881px) {
  #gameCanvas {
    width: 560px;
    height: auto;
  }
}
@media (max-width: 880px) {
  .game-area {
    width: 100%;
  }
  #gameCanvas {
    width: 100%;
    max-width: 560px;
  }
  .player-sidebar {
    position: static;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    width: 100%;
    max-width: 560px;
  }
  .player-card {
    min-width: 0;
    flex: 1 1 200px;
    padding: 10px 14px;
  }
}
@media (max-width: 560px) {
  body {
    padding: 12px;
  }
  .title-icon {
    width: 34px;
    height: 34px;
  }
  .player-card {
    gap: 4px;
    padding: 8px 10px;
  }
  .player-label {
    font-size: 1rem;
  }
  .player-stat {
    font-size: 0.78rem;
  }
  button {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  .btn-icon {
    width: 28px;
    height: 28px;
  }
  .controls {
    gap: 8px;
  }
  footer {
    font-size: 0.7rem;
  }
  .momo-wrap {
    left: 12px;
    bottom: 12px;
  }
  .momo-img {
    width: 52px;
    height: 52px;
  }
}
@media (max-width: 400px) {
  h1 {
    font-size: 1.15rem;
    letter-spacing: 1px;
  }
  .title-icon {
    width: 28px;
    height: 28px;
  }
  .controls {
    flex-direction: column;
    align-items: stretch;
    padding: 0 4px;
  }
  .controls button {
    width: 100%;
    justify-content: center;
  }
}
#msg {
  margin-top: 14px;
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  min-height: 1.4em;
  color: #ffe0b2;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}
.controls {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
button {
  padding: 10px 28px;
  font-size: 1rem;
  font-family: "Bungee", system-ui;
  border: 2px solid #b8860b;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: bold;
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.btn-goat {
  background: #f5f5f5;
  color: #333;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-goat:hover {
  background: #e0e0e0;
  border-color: #fff;
}
.btn-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.btn-tiger {
  background: #ff8f00;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-tiger:hover {
  background: #ff6f00;
  border-color: #ffb300;
}
.btn-restart {
  background: #4e342e;
  color: #ffe0b2;
}
.btn-restart:hover {
  background: #5d4037;
  border-color: #b8860b;
}
.btn-mode {
  background: #4e342e;
  color: #ffe0b2;
}
.btn-mode:hover {
  background: #5d4037;
  border-color: #b8860b;
}
.btn-mode.active {
  background: #ff8f00;
  color: #fff;
  border-color: #ffb300;
}
.diff-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
.diff-label {
  font-size: 0.85rem;
  color: #ffe0b2;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-diff {
  padding: 6px 18px;
  font-size: 0.85rem;
  background: #3e2723;
  color: #ffe0b2;
}
.btn-diff:hover {
  background: #4e342e;
  border-color: #b8860b;
}
.btn-diff.active {
  background: #ff8f00;
  color: #fff;
  border-color: #ffb300;
}
.btn-sound {
  background: #3e2723;
  color: #ffe0b2;
}
.btn-sound:hover {
  background: #4e342e;
  border-color: #b8860b;
}
footer {
  margin-top: 16px;
  padding: 8px 16px;
  font-size: 0.8rem;
  color: #b8860b;
  text-align: center;
  letter-spacing: 1px;
}
.copyright-text {
  font-family: "Bitcount Grid Double", system-ui;
}
.momo-wrap {
  position: fixed;
  bottom: 20px;
  left: 40px;
  z-index: 1000;
  cursor: pointer;
}
.momo-img {
  width: 70px;
  height: 70px;
  animation: momoBump 1.2s ease-in-out infinite;
  filter: brightness(0) invert(43%) sepia(89%) saturate(1174%) hue-rotate(8deg)
    drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s;
}
.momo-wrap:hover .momo-img {
  transform: scale(1.15);
}
@keyframes momoBump {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
.momo-tooltip {
  position: absolute;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #fff3e0;
  color: #4e342e;
  font-family: "Bungee", system-ui;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.25s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.momo-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff3e0;
}
.momo-wrap:hover .momo-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#smokeCanvas {
  position: absolute;
  bottom: 40px;
  left: -30px;
  width: 140px;
  height: 160px;
  pointer-events: none;
}
