/* ==========================================================================
   LOGANBYTE — the cabinet. Shared chrome every arcade game sits inside, so a
   game only ever has to draw into one canvas and report a score.
   ========================================================================== */

.cabinet {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 90% at 50% 0%, #131826 0%, var(--ink) 62%);
}

.cabinet__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem clamp(.9rem, 3vw, 1.6rem);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 12, .75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cabinet__back {
  font-family: var(--font-display);
  font-size: .58rem;
  letter-spacing: .1em;
  color: var(--text-dim);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.cabinet__back:hover { color: var(--text); text-decoration: none; }

.cabinet__title {
  font-family: var(--font-display);
  font-size: clamp(.56rem, 2.2vw, .76rem);
  margin: 0;
  text-align: center;
  color: var(--text);
  text-shadow: 0 0 14px rgba(255, 47, 69, .4);
}

.hud {
  display: flex;
  gap: clamp(.7rem, 3vw, 1.6rem);
  font-family: var(--font-display);
  font-size: .56rem;
  letter-spacing: .06em;
  color: var(--text-dim);
  white-space: nowrap;
}
.hud b { color: var(--amber); font-weight: normal; }

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(.8rem, 3vw, 1.6rem);
  position: relative;
}

.screen {
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #05060a;
  box-shadow: var(--shadow), 0 0 0 6px rgba(255, 255, 255, .015);
  overflow: hidden;
}

.screen canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  touch-action: none;
}

/* The overlay carries every non-play state: title, paused, game over. */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  background: rgba(5, 6, 10, .84);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 3;
}
.overlay[hidden] { display: none; }

.overlay h2 {
  font-family: var(--font-display);
  font-size: clamp(.85rem, 3.6vw, 1.35rem);
  margin: 0 0 .9rem;
  color: var(--neon);
  text-shadow: var(--glow-neon);
}
.overlay p { color: var(--text-dim); margin: 0 auto 1.6rem; max-width: 38ch; font-size: .95rem; }
.overlay .score-line { color: var(--amber); font-family: var(--font-display); font-size: .72rem; margin-bottom: 1.4rem; }
.overlay .keys {
  color: var(--text-faint);
  font-size: .8rem;
  margin-top: 1.5rem;
  line-height: 2;
}
.overlay kbd {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: .18em .5em;
  font-family: var(--font-body);
  font-size: .78rem;
  color: var(--text);
}

/* Touch controls — shown only where there is no fine pointer. */
.touchpad {
  display: none;
  gap: .7rem;
  padding: 0 clamp(.9rem, 3vw, 1.6rem) 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
}
.touchpad button {
  flex: 1 1 0;
  min-width: 72px;
  max-width: 150px;
  min-height: 64px;
  font-family: var(--font-display);
  font-size: .78rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.touchpad button:active { background: var(--panel-2); border-color: var(--neon); transform: translateY(1px); }

@media (hover: none) and (pointer: coarse) {
  .touchpad { display: flex; }
  .overlay .keys { display: none; }
}

.cabinet__foot {
  padding: 0 clamp(.9rem, 3vw, 1.6rem) 1.4rem;
  text-align: center;
  color: var(--text-faint);
  font-size: .78rem;
}
