* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #10141a;
  overflow: hidden;
  font-family: "Segoe UI", Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

#game-container {
  position: relative;
  margin: 0 auto;
  /* Fills the whole browser window edge-to-edge (matching the reference's
     screenshot, which shows the 3D scene bleeding to all four sides with no
     letterboxing) instead of being locked to a strict 9:16 phone rectangle,
     which on a wide desktop window left big black bars on both sides. The
     Three.js camera's aspect ratio is already recomputed on resize (see
     main.js), so this doesn't require any gameplay/world-space changes. */
  width: 100vw;
  height: 100vh;
  background: #000;
  touch-action: none;
  overflow: hidden;
}

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

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 16px;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

#hud-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

#hud-level {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

#progress-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  overflow: hidden;
}

#progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff8a3c, #ff3b30);
  transition: width 0.15s linear;
}

#hud-coins {
  font-weight: 700;
  font-size: 14px;
  min-width: 28px;
  text-align: right;
}

#hud-count-wrap {
  margin-top: 8px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

#hud-count {
  font-size: 28px;
}

#hud-classes {
  margin-top: 2px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.85);
}

#hint {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  animation: overlayFade 0.3s ease-out both;
}

.hidden {
  display: none;
}

.panel {
  background: #1b2027;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 28px 32px;
  text-align: center;
  color: #fff;
  min-width: 220px;
  background: linear-gradient(180deg, #262d38 0%, #171b22 100%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: panelPop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.panel h1 {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: 0.04em;
}

.panel p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.8);
}

.panel button {
  pointer-events: auto;
  border: none;
  border-radius: 8px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(180deg, #ffe272 0%, #ffc21f 100%);
  color: #2a2000;
  cursor: pointer;
  box-shadow: 0 4px 0 #b88500, 0 8px 18px rgba(255, 194, 31, 0.35);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}

.panel button:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.panel button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #b88500;
}

.panel button:disabled {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.4);
  cursor: default;
}

.panel-menu {
  min-width: 260px;
  max-width: 320px;
}

.coin-row {
  font-weight: 700;
  color: #ffd23f;
  margin-bottom: 14px;
}

.win-coins {
  color: #ffd23f;
  font-weight: 700;
  margin-top: -8px;
}

#shop-list {
  text-align: left;
}

.shop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.shop-row:first-child {
  border-top: none;
}

.shop-row-info {
  flex: 1;
}

.shop-row-label {
  font-weight: 700;
  font-size: 13px;
}

.shop-row-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

.shop-row button {
  pointer-events: auto;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  background: #ffd23f;
  color: #2a2000;
  cursor: pointer;
  white-space: nowrap;
}

#btn-play {
  margin-top: 18px;
  width: 100%;
}


#hud-count.bump {
  display: inline-block;
  animation: countBump 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}

#game-container::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(8, 12, 24, 0.35) 100%);
}

@keyframes panelPop {
  from { opacity: 0; transform: scale(0.7) translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes overlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes countBump {
  0% { transform: scale(1); color: #fff; }
  40% { transform: scale(1.45); color: #ffe066; }
  100% { transform: scale(1); color: #fff; }
}
