/* The Voxel Shooter player page: the game fills its frame; a cover sits on top until the game starts. */
:root {
  --bg: #07070d;
  --panel: #12121f;
  --text: #f1f1f7;
  --muted: #a3a3b8;
  --accent: #3fe0ff;
  --bad: #ff6b6b;
  color-scheme: dark;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, "Segoe UI", sans-serif;
}

#stage {
  position: fixed;
  inset: 0;
}

/* The engine sets the canvas size inline; these win so it always fills the frame (it follows the size it is shown at). */
#stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

/* Top-right strip over the game: the Esc hint while the game holds the mouse, a full-screen button while it doesn't. */
.bar-top {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.bar-top[hidden], .bar-top [hidden] { display: none; }
.esc {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(7, 7, 13, 0.7);
  color: var(--muted);
  font-size: 13px;
  animation: fade 4s forwards;
}
@keyframes fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.full {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: rgba(7, 7, 13, 0.7);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.full:hover { background: rgba(63, 224, 255, 0.3); }

.cover {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, #1a1a30 0%, var(--bg) 70%);
}
.cover[hidden] { display: none; }

.box {
  width: min(440px, 100%);
  text-align: center;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 6vw, 44px);
  letter-spacing: 0.04em;
}

.msg { margin: 0 0 14px; font-size: 18px; }
.msg.bad { color: var(--bad); }
.detail { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

.bar {
  height: 14px;
  border-radius: 7px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px #2a2a44;
}
.bar[hidden] { display: none; }
.bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.15s linear;
}

.start {
  margin-top: 8px;
  padding: 14px 34px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #04131a;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 0 #1a8aa3;
}
.start:hover { filter: brightness(1.08); }
.start:active { transform: translateY(3px); box-shadow: 0 2px 0 #1a8aa3; }
.start[hidden] { display: none; }

/* When the game can't run here: numbered steps for that case, then "Copy details" so the person can send them. */
.box.wide { width: min(600px, 100%); }
.steps {
  margin: 16px 0 0;
  padding: 14px 16px 14px 36px;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px #2a2a44;
  text-align: left;
  font-size: 15px;
}
.steps[hidden], .help[hidden] { display: none; }
.steps li + li { margin-top: 8px; }
.steps code, .more pre {
  font: 13px/1.4 ui-monospace, Consolas, monospace;
  color: var(--accent);
  word-break: break-all;
}
.help { margin-top: 14px; }
.copy {
  padding: 10px 22px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #04131a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.copy:hover { filter: brightness(1.08); }
.copied { margin-left: 10px; color: var(--muted); font-size: 14px; }
.more { margin-top: 12px; text-align: left; color: var(--muted); font-size: 14px; }
.more summary { cursor: pointer; text-align: center; }
.more pre {
  max-height: 40vh;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  white-space: pre-wrap;
  user-select: all;
}
/* A long help page scrolls instead of losing its top off a short screen. */
.cover.helping { overflow: auto; align-items: safe center; }
