/* ─── GAME SECTION LAYOUT ─────────────────────────────────────────────────────── */
.game-section {
  gap: 14px;
}

.game-wrap {
  position: relative;
  border: 3px solid var(--border);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
  background: #000;
  touch-action: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

.game-caption {
  font-family: var(--mono);
  font-size: clamp(0.72rem, 0.9vw, 1rem);
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
}
.tag-about   { color: var(--accent);   font-weight: 600; }
.tag-contact { color: var(--accent-2); font-weight: 600; }

/* ─── TITLE SCREEN ─────────────────────────────────────────────────────────────── */
.title-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4,7,15,0.82);
  cursor: pointer;
  transition: opacity 0.35s ease;
}
.title-screen.hidden { opacity: 0; pointer-events: none; }

.title-panel {
  text-align: center;
  max-width: 88%;
}
.title-eyebrow {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.title-heading {
  font-family: var(--pixel);
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  color: var(--accent);
  margin-bottom: 14px;
}
.blink-cursor { animation: blink 1s step-start infinite; }
.title-sub {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 22px;
}
.press-start {
  font-family: var(--pixel);
  font-size: 0.6rem;
  color: var(--text);
  animation: blink 1.1s ease-in-out infinite;
}

/* ─── PORTAL LABELS ────────────────────────────────────────────────────────────── */
.portal-label {
  position: absolute;
  z-index: 15;
  transform: translate(-50%, -100%);
  font-family: var(--pixel);
  font-size: clamp(0.5rem, 1.1vw, 1rem);
  padding: clamp(5px, 0.9vw, 10px) clamp(8px, 1.3vw, 16px);
  border: 2px solid var(--border);
  white-space: nowrap;
  pointer-events: none;
  animation: floatLabel 2.2s ease-in-out infinite;
}
.label-about   { color: var(--sky); background: var(--accent); }
.label-contact { color: var(--sky); background: var(--accent-2); }

@keyframes floatLabel {
  0%, 100% { margin-top: 0px; }
  50%       { margin-top: -8px; }
}

@media (max-width: 480px) {
  .portal-label { font-size: 0.4rem; padding: 4px 6px; }
}

/* ─── TOUCH D-PAD ──────────────────────────────────────────────────────────────── */
.touch-controls {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 25;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.touch-controls.active { opacity: 1; pointer-events: auto; }
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 40px);
  grid-template-rows: repeat(3, 40px);
  gap: 2px;
}
.dpad-btn {
  font-family: var(--pixel);
  font-size: 0.7rem;
  background: rgba(10,14,26,0.75);
  border: 2px solid var(--text);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}
.dpad-btn:active { background: var(--accent-dim); color: var(--accent); }
.dpad-up    { grid-column: 2; grid-row: 1; }
.dpad-left  { grid-column: 1; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down  { grid-column: 2; grid-row: 3; }

@media (hover: none), (max-width: 900px) {
  .touch-controls { display: block; }
}

@media (max-width: 768px) {
  .game-caption { font-size: 0.62rem; }
  .title-heading { font-size: clamp(1.2rem, 7vw, 1.8rem); }
}
