:root {
  --header-yellow: #FFB600;
  --header-green: #00FF66;
}

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&display=swap');

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Orbitron', sans-serif;
  background: url('../assets/banana_wrapping_bg.png') repeat;
  background-color: #ffff66;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  overflow-x: hidden;
}

.widgetwheel-header {
  width: 100%;
  padding: 0.8rem 0.5rem;
  background-color: rgba(17, 17, 17, 0.85);
  border: 2px double var(--header-yellow);
  text-align: center;
  box-shadow: 0 0 20px var(--header-yellow);
  position: relative;
  z-index: 2;
  animation: strobeHeader 2s infinite;
}

.widgetwheel-title {
  font-size: 2rem;
  font-family: 'Orbitron', sans-serif;
  color: var(--header-yellow);
  text-shadow: 0 0 10px var(--header-yellow);
}

.banana-subtitle {
  font-size: 1rem;
  color: var(--header-green);
  text-shadow: 0 0 10px var(--header-green), 0 0 20px var(--header-green);
  position: absolute;
  left: -100%;
  top: 75%;
  transform: translateY(-50%);
  white-space: nowrap;
  animation: swipeIn 2s forwards 1.5s;
}

@keyframes strobeHeader {
  0%, 17%, 19%, 21%, 23%, 25%, 100% { opacity: 1; }
  18%, 20%, 22%, 24% { opacity: 0.2; }
}

@keyframes swipeIn {
  0% { left: -100%; }
  100% { left: 50%; transform: translateX(-50%) translateY(-50%); }
}

.top-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.money-counter {
  background: #004400;
  animation: flashGreenWhite 1s infinite alternate;
  font-size: 1.2rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  color: #fff;
  padding: 12px 20px;
  border: 3px solid #000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  background: #222;
  min-width: 220px;
  justify-content: center;
  text-align: center;
}

.counter-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  justify-content: center;
  width: 100%;
}

.counter-box {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  padding: 10px 16px;
  border: 3px solid #000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  background: #222;
  min-width: 140px;
  justify-content: center;
}

#tapedBox {
  background: #999900;
  animation: flashYellowGrey 1s infinite alternate;
}

#fallenBox {
  background: #990000;
  animation: flashRed 1s infinite alternate;
}

.counter-box img {
  width: 24px;
  height: 24px;
  margin-right: 6px;
}

@keyframes flashGreenWhite {
  0% { background-color: #00ff00; color: #000; }
  100% { background-color: #ffffff; color: #000; }
}

@keyframes flashYellowGrey {
  0% { background-color: #ffff00; color: #000; }
  100% { background-color: #cccccc; color: #000; }
}

@keyframes flashRed {
  0% { background-color: #ff0000; }
  100% { background-color: #aa0000; }
}

.game-container {
  position: relative;
  width: 95vw;
  max-width: 1000px;
  aspect-ratio: 2 / 1;
  background: linear-gradient(to bottom, #222, #333);
  border: 5px solid #00ffcc;
  box-shadow: 0 0 30px #00ffcc;
  border-radius: 16px;
  margin: 10px auto;
  overflow: hidden;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.final-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: yellow;
  color: green;
  font-size: 2.5rem;
  font-weight: bold;
  text-shadow: 3px 3px #000;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: flashBG 0.5s infinite alternate;
  z-index: 20;
}

@keyframes flashBG {
  0% { background-color: #ffff00; color: #004400; }
  100% { background-color: #004400; color: #ffff00; }
}

.controls {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px auto;
}

.game-button {
  width: 120px;
  height: 120px;
  background: #000;
  border: 3px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 0 20px #0ff;
  cursor: pointer;
  overflow: hidden;
}

.game-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.description-container {
  width: 92%;
  max-width: 900px;
  margin: 2rem auto;
  padding: 1.5rem;
  background-color: rgba(17, 17, 17, 0.85);
  border: 3px double var(--header-yellow);
  color: var(--header-green);
  box-shadow: 0 0 20px var(--header-yellow);
  animation: slideInLeft 1.5s ease-out forwards;
  transform: translateX(-50px);
  opacity: 0;
}

.description-container h2 {
  color: var(--header-yellow);
  text-shadow: 0 0 10px var(--header-yellow);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.description-container p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .top-stats {
    margin-top: 10px;
  }
  .counter-row {
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }
  .money-counter {
    margin-bottom: 6px;
  }
}
