* {
  box-sizing: border-box;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  background: #0a0a12;
  color: #e8e8f0;
  font-family: "Courier New", monospace;
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

#shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Внешний корпус-«телевизор» */
#bezel {
  position: relative;
  padding: 22px 22px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #2a2a35, #17171f 60%, #101018);
  border: 2px solid #3a3a4a;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Экран канваса со скан-линиями и свечением */
canvas {
  display: block;
  width: 640px;          /* масштаб 256x224 -> ширина 640 */
  height: 560px;         /* 224 * (640/256) */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  border: 3px solid #000;
  border-radius: 4px;
  outline: 2px solid #20202c;
}

/* Скан-линии поверх канваса */
#bezel::after {
  content: "";
  position: absolute;
  inset: 22px 22px 10px;
  pointer-events: none;
  border-radius: 4px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.22) 3px
  );
  mix-blend-mode: multiply;
}

/* Лёгкое стеклянное свечение */
#bezel::before {
  content: "";
  position: absolute;
  inset: 22px 22px 10px;
  pointer-events: none;
  border-radius: 4px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.06) 0%, transparent 30%);
}

/* HUD под экраном */
#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 6px 4px 2px;
  font-size: 13px;
  letter-spacing: 1px;
  color: #c8c8d8;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.hud-item .label {
  font-size: 9px;
  color: #7a7a90;
  letter-spacing: 2px;
}

.hud-item .value {
  font-weight: bold;
  color: #ffe94d;
  text-shadow: 0 0 6px rgba(255, 233, 77, 0.5);
}

.ships {
  color: #4dd9ff !important;
  text-shadow: 0 0 6px rgba(77, 217, 255, 0.6) !important;
  letter-spacing: 3px;
}

/* Кнопка звука */
#mute-btn {
  position: absolute;
  right: 34px;
  top: 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #4a4a5a;
  background: #20202c;
  color: #ffe94d;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
  z-index: 5;
}

#mute-btn:hover {
  background: #30303e;
}

#mute-btn.muted {
  color: #666;
  text-decoration: line-through;
}

#controls-help {
  font-size: 12px;
  color: #6a6a80;
  text-align: center;
  line-height: 1.6;
}

#controls-help b {
  color: #a0a0b8;
}

/* Адаптивность */
@media (max-width: 700px) {
  canvas {
    width: 100%;
    height: auto;
  }
  #bezel {
    padding: 10px 10px 8px;
  }
  #bezel::after,
  #bezel::before {
    inset: 10px 10px 8px;
  }
  #mute-btn {
    right: 20px;
    top: 14px;
  }
  #hud {
    font-size: 11px;
    gap: 8px;
  }
}