* {
  box-sizing: border-box;
}

:root {
  --bg: #12131c;
  --panel: #1c1f2e;
  --panel-2: #252a3d;
  --text: #eef0f8;
  --muted: #a9afc7;
  --accent: #ffb454;
  --accent-2: #7ee08a;
  --danger: #ff6b6b;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, #1b2036 0%, var(--bg) 60%);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.topbar {
  width: min(960px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar__brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.topbar__paw {
  font-size: 20px;
}

.hud {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hud__item {
  background: var(--panel);
  border: 1px solid #2d3348;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.hud__item--alert {
  color: var(--accent-2);
}

.hud__item--alert.is-warn {
  color: var(--accent);
}

.hud__item--alert.is-danger {
  color: var(--danger);
  animation: pulse 0.7s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.stage {
  position: relative;
  width: min(960px, 100%);
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  background: #0b0d15;
  border: 1px solid #2d3348;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 9, 15, 0.78);
  backdrop-filter: blur(3px);
  padding: 16px;
}

.overlay--hidden {
  display: none;
}

.panel {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid #343c57;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

.panel__cat {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 6px;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.panel p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.hints {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hints li {
  background: var(--panel-2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #ffc978, var(--accent));
  color: #2a1c07;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 18px;
  border-radius: 12px;
  margin: 4px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(0);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid #3a4260;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.panel__best {
  margin-top: 10px;
  font-size: 13px;
}

.shop {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.catCard {
  background: var(--panel-2);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.catCard:hover {
  transform: translateY(-2px);
}

.catCard.is-selected {
  border-color: var(--accent);
}

.catCard.is-locked {
  opacity: 0.6;
}

.catCard__face {
  font-size: 34px;
  line-height: 1;
}

.catCard__name {
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.catCard__price {
  font-size: 12px;
  color: var(--accent);
}

.footbar {
  width: min(960px, 100%);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 640px) {
  .topbar__brand h1 {
    font-size: 15px;
  }
  .panel {
    padding: 14px;
  }
}
