/* 3D Arcade extends the landing page's shared C64-inspired visual system. */

body {
  align-items: flex-start;
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
}

.arcade-frame {
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  width: min(1120px, 100%) !important;
  max-width: 1120px !important;
  min-height: 100vh;
  height: auto !important;
}

.site-title-link,
.arcade-nav-link {
  color: inherit;
  text-decoration: none;
}

.site-title-link {
  display: inline-block;
}

.arcade-tabs-shell {
  margin-bottom: 0;
}

.arcade-title-tab {
  cursor: default;
}

.arcade-subtitle {
  margin: 0.65rem 0 0;
  color: #000;
  font-family: agsfnt0, monospace;
  font-size: 0.9rem;
  font-weight: bold;
}

.arcade-content {
  min-height: 0;
  overflow: visible !important;
  padding: 0 0.4rem 0.8rem 0;
}

.arcade-card {
  background: #fff;
  border: 2px solid #f00;
  border-radius: 4px;
  box-shadow: 2px 12px 0 #000;
  padding: 0.8rem;
}

.arcade-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.arcade-section-label {
  display: block;
  color: #a00;
  font-size: 0.72rem;
  line-height: 1.15;
  letter-spacing: 0.16em;
}

.arcade-card h1 {
  margin: 0.35rem 0 0;
  color: #000;
  font-size: clamp(1.1rem, 3vw, 1.65rem);
  line-height: 1.2;
  text-shadow: 2px 2px 0 #55ffff;
}

.system-status {
  flex: 0 0 auto;
  border: 1px solid #000;
  background: #55ffff;
  box-shadow: 2px 2px 0 #000;
  color: #000;
  padding: 0.4rem 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.system-status i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  background: #00aa00;
  box-shadow: 0 0 0 1px #000;
}

.screen-frame {
  border: 2px solid #000;
  background: #0000aa;
  box-shadow: 3px 3px 0 #00aaaa;
  padding: 0.5rem;
}

.screen-readout {
  display: flex;
  justify-content: flex-end;
  gap: 1.2rem;
  min-height: 1.35rem;
  color: #fff;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.screen-bezel {
  position: relative;
  overflow: hidden;
  border: 3px solid #000;
  background: #000;
  box-shadow: inset 0 0 0 2px #555;
}

#viewport {
  display: block;
  width: 100%;
  aspect-ratio: 8 / 5;
  background: #000;
  cursor: url(../img/cursor2.png), crosshair;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: 0;
}

#viewport:focus-visible {
  box-shadow: inset 0 0 0 3px #55ffff;
}

.canvas-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0 2px, transparent 2px 4px);
}

.boot-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  color: #55ffff;
  font-size: 0.8rem;
}

.boot-message.is-hidden {
  display: none;
}

.control-deck {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.9rem;
}

.controls-help,
.mode-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.controls-help p {
  margin: 0;
  color: #000;
  font-size: 0.63rem;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.55rem;
  min-height: 1.55rem;
  margin-right: 0.2rem;
  border: 1px solid #000;
  background: #d8d8d8;
  box-shadow: 2px 2px 0 #000;
  color: #000;
  font: inherit;
}

.arcade-button {
  border: 2px solid #000;
  outline: 1px solid #000;
  background: #fff;
  box-shadow: 3px 3px 0 #000;
  color: #000;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-family: FFFORWA, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.import-button {
  display: inline-grid;
  place-items: center;
  background: #55ff55;
}

.light-button {
  background: #ffff55;
}

.light-button.is-active {
  background: #ffff55;
  color: #000;
  box-shadow: inset 0 0 0 2px #aaaa00, 3px 3px 0 #000;
}

#viewport.is-placing-light {
  cursor: crosshair;
  box-shadow: inset 0 0 0 3px #ffff55;
}

.obj-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.import-button:has(+ .obj-input:focus-visible),
.import-button:focus-visible {
  outline: 3px solid #000;
}

.arcade-button:hover,
.arcade-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 4px 4px 0 #000;
}

.arcade-button.is-active {
  background: #ff5555;
  box-shadow: inset 0 0 0 2px #aa0000, 3px 3px 0 #000;
  color: #fff;
}

.reset-button {
  background: #55ffff;
}

.arcade-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #000;
  font-family: agsfnt0, monospace;
  font-size: 0.72rem;
  font-weight: bold;
  line-height: 1.3;
}

@media (max-width: 760px) {
  .arcade-frame {
    padding: 0.7rem !important;
  }

  .arcade-card-head,
  .control-deck,
  .arcade-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .system-status {
    align-self: flex-start;
  }

  .controls-help {
    justify-content: center;
  }

  .mode-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .arcade-button {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .arcade-frame {
    gap: 0.6rem !important;
    padding: 0.55rem !important;
  }

  .arcade-subtitle {
    font-size: 0.7rem;
    line-height: 1.3;
  }

  .arcade-card {
    padding: 0.55rem;
  }

  .arcade-section-label,
  .system-status {
    font-size: 0.58rem;
  }

  .screen-frame {
    padding: 0.35rem;
  }

  .screen-readout {
    justify-content: space-between;
    gap: 0.4rem;
    font-size: 0.55rem;
  }

  .controls-help {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .arcade-button {
    padding: 0.4rem;
    font-size: 0.6rem;
  }

  .arcade-footer {
    font-size: 0.62rem;
  }
}
