@font-face {
  font-family: "Arcade Classic";
  src: url("arcadeclassic.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Arcade Classic", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
}

button,
summary {
  font: inherit;
}

.game-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.game-topbar {
  position: absolute;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.5rem 0.7rem 0.5rem 0.85rem;
  border-bottom: 2px solid #2e7ed6;
  background: #071226;
}

.game-heading {
  min-width: 0;
}

.game-kicker {
  margin: 0 0 0.16rem;
  color: #4dd7e5;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-title-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.65rem;
}

.game-title {
  overflow: hidden;
  margin: 0;
  color: #f2f2e8;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 400;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-subtitle {
  overflow: hidden;
  margin: 0;
  color: #91a8bd;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.42rem;
}

.game-status,
.game-action,
.game-help summary {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #2e7ed6;
  border-radius: 0;
  background: #030a14;
  color: #f2f2e8;
}

.game-status {
  gap: 0.42rem;
  padding: 0 0.65rem;
  font-size: 0.82rem;
}

.game-status-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 0;
  background: #f4c542;
}

.game-status.is-ready .game-status-dot {
  background: #4dd7e5;
}

.game-action,
.game-help summary {
  width: 2rem;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.game-action:hover,
.game-help summary:hover {
  border-color: #4dd7e5;
  background: #10253a;
}

.game-action:focus-visible,
.game-help summary:focus-visible {
  outline: 2px solid #f4c542;
  outline-offset: 2px;
}

.game-stage {
  position: absolute;
  top: 56px;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
}

.game-stage canvas {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  background: #000;
}

.game-loading {
  display: grid;
  max-width: 22rem;
  justify-items: center;
  gap: 0.9rem;
  padding: 1rem;
  color: #91a8bd;
  text-align: center;
}

.game-loading-spinner {
  width: 2.1rem;
  height: 2.1rem;
  border: 2px solid #183b5c;
  border-top-color: #4dd7e5;
  border-radius: 0;
  animation: game-spin 850ms linear infinite;
}

@keyframes game-spin {
  to {
    transform: rotate(360deg);
  }
}

.game-help {
  position: relative;
}

.game-help summary {
  list-style: none;
}

.game-help summary::-webkit-details-marker {
  display: none;
}

.game-help-panel {
  position: absolute;
  z-index: 30;
  top: 2.75rem;
  right: 0;
  width: min(21rem, calc(100vw - 1rem));
  padding: 0.9rem 1rem;
  border: 1px solid #2e7ed6;
  border-radius: 0;
  background: #071226;
  box-shadow: 0.45rem 0.45rem 0 #000;
  color: #f2f2e8;
}

.game-help-panel strong {
  display: block;
  margin-bottom: 0.55rem;
  color: #4dd7e5;
  font-size: 0.85rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.game-help-panel ul {
  display: grid;
  gap: 0.38rem;
  margin: 0;
  padding-left: 0;
  color: #b7c6d3;
  font-size: 0.9rem;
  line-height: 1.4;
  list-style: none;
}

.game-error {
  color: #f04c4c;
}

@media (max-width: 620px) {
  .game-topbar {
    gap: 0.45rem;
    padding-left: 0.72rem;
  }

  .game-subtitle,
  .game-status-text {
    display: none;
  }

  .game-status {
    width: 2rem;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-loading-spinner {
    animation: none;
  }

  .game-action,
  .game-help summary {
    transition: none;
  }
}
