*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background-color: #000;
  color: #aaa;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  align-items: center;
  justify-content: center;
}

body {
  overflow: hidden;
}

.terminal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  user-select: none;
}

/* ── Error heading ── */
.error-line {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.error-text {
  color: #ccc;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: flicker 3.5s infinite;
}

.cursor {
  color: #ccc;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  animation: blink 1s step-end infinite;
}

/* ── Grid label ── */
.grid-label {
  color: #555;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

/* ── Grid ── */
.grid-container {
  display: flex;
  justify-content: center;
}

#grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.cell {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #777;
  border: 1px solid #222;
  background-color: #080808;
  cursor: pointer;
  transition: color 0.1s, background-color 0.1s, border-color 0.1s;
  font-family: 'Courier New', Courier, monospace;
}

.cell:hover {
  background-color: #111;
  border-color: #444;
  color: #aaa;
}

.cell.active {
  color: #ccc;
  background-color: #0d0d0d;
  border-color: #555;
}

/* ── Access message ── */
.access-msg {
  color: #bbb;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  animation: flicker 4s infinite;
}

/* ── Gatekeeper div ── */
.gatekeeper {
  color: #888;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  border-top: 1px solid #222;
  padding-top: 1rem;
}

/* ── Download link ── */
.download-link {
  display: inline-block;
  color: #888;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  border: 1px solid #333;
  padding: 0.5rem 1rem;
  transition: color 0.15s, border-color 0.15s;
}

.download-link:hover {
  color: #ccc;
  border-color: #666;
}

/* ── Utility ── */
.hidden {
  display: none;
}

/* ── Animations ── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes flicker {
  0%   { opacity: 1; }
  2%   { opacity: 0.85; }
  4%   { opacity: 1; }
  19%  { opacity: 1; }
  21%  { opacity: 0.7; }
  23%  { opacity: 1; }
  47%  { opacity: 1; }
  49%  { opacity: 0.9; }
  51%  { opacity: 1; }
  72%  { opacity: 1; }
  74%  { opacity: 0.75; }
  76%  { opacity: 1; }
  100% { opacity: 1; }
}
