/* ZX Spectrum — чёрный фон, контрастные цвета */
.bruce-lee-game-root {
  --zx-cyan: #00ffff;
  --zx-yellow: #ffff00;
  --zx-magenta: #ff00ff;
  --zx-green: #00ff00;
  --zx-red: #ff0000;
  --zx-white: #ffffff;
  --zx-bg: #000000;
  font-family: "Courier New", Courier, monospace;
  color: var(--zx-cyan);
  background: var(--zx-bg);
  padding: 1rem;
  border: 2px solid var(--zx-cyan);
  max-width: 1120px;
  margin: 1rem auto;
  box-sizing: border-box;
}

.bruce-lee-game-root *,
.bruce-lee-game-root *::before,
.bruce-lee-game-root *::after {
  box-sizing: border-box;
}

.bruce-lee-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.bruce-lee-canvas-wrap {
  position: relative;
  flex: 0 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#bruce-lee-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  /* Внутреннее разрешение 256×192; на экране не меньше 800px по ширине, если хватает места */
  width: 800px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 256 / 192;
  background: var(--zx-bg);
  border: 2px solid var(--zx-yellow);
}

.bruce-lee-hud {
  margin-top: 0.5rem;
  font-size: 14px;
  line-height: 1.4;
  color: var(--zx-yellow);
}

.bruce-lee-side {
  flex: 1 1 200px;
  min-width: 180px;
}

.bruce-lee-side__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--zx-magenta);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bruce-lee-leaderboard {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--zx-green);
  font-size: 13px;
  line-height: 1.5;
}

.bruce-lee-leaderboard li {
  margin-bottom: 0.25rem;
}

.bruce-lee-help {
  margin-top: 1rem;
  font-size: 12px;
  color: var(--zx-cyan);
  opacity: 0.9;
}

/* Модальное окно ника */
.bruce-lee-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.85);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.bruce-lee-modal--visible {
  visibility: visible;
  opacity: 1;
}

.bruce-lee-modal__panel {
  background: var(--zx-bg);
  border: 3px solid var(--zx-magenta);
  padding: 1.25rem 1.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 0 0 2px var(--zx-yellow), 0 8px 24px rgba(0, 255, 255, 0.15);
}

.bruce-lee-modal__title {
  margin: 0 0 0.5rem;
  color: var(--zx-yellow);
  font-size: 1.35rem;
  text-transform: uppercase;
}

.bruce-lee-modal__hint {
  margin: 0 0 1rem;
  font-size: 13px;
  color: var(--zx-cyan);
}

.bruce-lee-modal__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 13px;
  color: var(--zx-green);
}

.bruce-lee-modal__input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  font-size: 16px;
  background: #0a0a0a;
  border: 2px solid var(--zx-cyan);
  color: var(--zx-white);
  margin-bottom: 1rem;
}

.bruce-lee-modal__input:focus {
  outline: none;
  border-color: var(--zx-yellow);
}

.bruce-lee-modal__actions {
  display: flex;
  justify-content: flex-end;
}

.bruce-lee-btn {
  font-family: inherit;
  font-size: 14px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border: 2px solid;
  text-transform: uppercase;
}

.bruce-lee-btn--primary {
  background: var(--zx-magenta);
  border-color: var(--zx-yellow);
  color: var(--zx-bg);
  font-weight: bold;
}

.bruce-lee-btn--primary:hover {
  background: var(--zx-yellow);
  border-color: var(--zx-magenta);
  color: var(--zx-bg);
}

.bruce-lee-btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (min-width: 821px) {
  .bruce-lee-canvas-wrap {
    min-width: 800px;
  }

  #bruce-lee-canvas {
    width: 800px;
    max-width: none;
  }
}

@media (max-width: 820px) {
  #bruce-lee-canvas {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}
