.tag-game {
  --ink: #16181d;
  --muted: #657083;
  --panel: #ffffff;
  --line: #d9d2c7;
  --mint: #0f9f8f;
  --red: #e94f37;
  --gold: #ffc857;
  --blue: #2f6fed;
  width: min(100%, 620px);
  margin: 0;
  border: 3px solid var(--ink);
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

.tag-game *,
.tag-game *::before,
.tag-game *::after {
  box-sizing: border-box;
}

.tag-game button {
  border: 2px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.tag-game__topbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 3px solid var(--ink);
  background: #fff8dc;
}

.tag-game__stat {
  padding: 10px 12px;
  border-right: 2px solid var(--ink);
  min-width: 0;
}

.tag-game__stat:last-child {
  border-right: 0;
}

.tag-game__label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tag-game__value {
  display: block;
  font-size: 1.35rem;
  font-weight: 950;
}

.tag-game__stage-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.tag-game canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #e7f7f1;
  touch-action: none;
}

.tag-game__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(247, 244, 239, 0.88);
  text-align: center;
}

.tag-game__overlay[hidden] {
  display: none;
}

.tag-game__overlay-panel {
  width: min(360px, 100%);
  border: 3px solid var(--ink);
  background: var(--panel);
  padding: 18px;
  box-shadow: 6px 6px 0 var(--ink);
}

.tag-game__overlay h3 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.tag-game__version {
  margin: 0 0 6px;
  color: var(--mint);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.tag-game__overlay p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.4;
}

.tag-game__start {
  width: 100%;
  min-height: 44px;
}

.tag-game__footer {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-top: 3px solid var(--ink);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 860px) {
  .tag-game {
    margin: 0;
  }
}

@media (max-width: 520px) {
  .tag-game__topbar {
    grid-template-columns: 1fr 1fr;
  }

  .tag-game__stat {
    padding: 8px;
  }

  .tag-game__value {
    font-size: 1rem;
  }

  .tag-game__footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
