/* ============================================================
   Layout: header → links → games region
   Desktop: featured game (big) + 2 stacked side games (right column)
            row of remaining games below
   Mobile: single column, everything stacks
   ============================================================ */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: var(--pad-page);
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: clamp(20px, 2.5vw, 36px);
  max-width: 1680px;
  margin: 0 auto;
}

/* ----- Header / Logo ----- */

.header {
  position: relative;
  text-align: center;
  padding: clamp(20px, 4vw, 56px) 0 clamp(8px, 1.5vw, 16px);
}

.header__brackets {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
}
.header__brackets svg { width: clamp(20px, 3vw, 40px); height: clamp(40px, 6vw, 80px); }

.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-logo-d);
  line-height: 0.85;
  letter-spacing: 0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--c-cyan);
  text-shadow:
    0 0 6px var(--c-cyan),
    0 0 18px rgba(0,216,255,0.7),
    0 0 40px rgba(0,216,255,0.4);
  animation: pulse-glow 4s ease-in-out infinite;
  position: relative;
  display: inline-block;
}

.logo__row {
  display: block;
  position: relative;
}

/* The .COM accent rendered as separate row */
.logo__tld {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.1vw, 14px);
  letter-spacing: 1.2em;
  color: var(--c-cyan);
  -webkit-text-stroke: 0;
  text-shadow: var(--glow-text-sm);
  margin-top: clamp(4px, 0.8vw, 12px);
  padding-left: 1.2em; /* offset for letterspacing */
  opacity: 0.85;
}

/* Horizontal scan beam — sweeps past the logo into the page below before fading */
.logo__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  /* extend below the logo so the beam travels a touch further before fading */
  bottom: -55%;
  pointer-events: none;
  background: linear-gradient(180deg,
    transparent 0,
    transparent calc(50% - 1px),
    rgba(255,255,255,0.6) calc(50% - 1px),
    rgba(255,255,255,0.6) calc(50% + 1px),
    transparent calc(50% + 1px),
    transparent 100%);
  mix-blend-mode: screen;
  animation: scan-y 9s linear infinite;
  will-change: transform, opacity;
}
@keyframes scan-y {
  0%    { transform: translateY(-40%); opacity: 0; }
  4%    { opacity: 1; }
  /* flicker pass through the upper text */
  10%   { opacity: 0.35; }
  12%   { opacity: 1; }
  18%   { opacity: 0.55; }
  20%   { opacity: 1; }
  /* steady glide */
  55%   { opacity: 1; }
  /* flicker again as it leaves the logo */
  62%   { opacity: 0.5; }
  65%   { opacity: 1; }
  72%   { opacity: 0.7; }
  75%   { opacity: 1; }
  /* long fade as it sinks past the page header area */
  100%  { transform: translateY(110%); opacity: 0; }
}

.subhead {
  margin-top: clamp(10px, 1.5vw, 18px);
  font-family: var(--font-mono);
  font-size: var(--fs-sub);
  letter-spacing: 0.6em;
  color: var(--c-cyan);
  opacity: 0.8;
  text-transform: uppercase;
}

.subhead::before, .subhead::after {
  content: "/";
  margin: 0 1em;
  opacity: 0.5;
}

/* ----- Links ----- */

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 1vw, 14px);
}

.chip {
  --chip-c: var(--c-cyan);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(10px, 0.9vw, 12px);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--chip-c);
  background: rgba(0,216,255,0.04);
  border: 1px solid rgba(0,216,255,0.4);
  clip-path: polygon(
    8px 0, 100% 0, 100% calc(100% - 8px),
    calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: all var(--t-fast) var(--ease-snap);
  cursor: pointer;
}

.chip__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--chip-c);
  box-shadow: 0 0 6px var(--chip-c), 0 0 14px var(--chip-c);
}

.chip:hover {
  background: rgba(0,216,255,0.12);
  color: var(--c-edge);
  text-shadow: var(--glow-text-sm);
  border-color: var(--c-cyan);
  box-shadow: var(--glow-sm);
  transform: translateY(-1px);
}

.chip__arrow {
  margin-left: 4px;
  opacity: 0.6;
  transition: transform var(--t-fast) var(--ease-snap);
}
.chip:hover .chip__arrow { transform: translateX(3px); opacity: 1; }

/* ----- Games region ----- */

.arcade {
  display: block;
}

.cab.arcade__featured {
  min-height: clamp(420px, 70vh, 760px);
}

@media (max-width: 900px) {
  .cab.arcade__featured {
    min-height: 70vh;
  }
  .subhead::before, .subhead::after { display: none; }
  .subhead { letter-spacing: 0.4em; }
}

/* ----- Game card (the "cabinet") ----- */

.cab {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  background: var(--c-grid-deep);
  border: 1px solid rgba(0,216,255,0.35);
  overflow: hidden;
}

.cab__hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-cyan);
  border-bottom: 1px solid rgba(0,216,255,0.25);
  background:
    linear-gradient(180deg,
      rgba(0,216,255,0.08), rgba(0,216,255,0.0));
  z-index: 2;
}
.cab__hud-l, .cab__hud-r { display: flex; gap: 12px; align-items: center; }
.cab__title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--c-edge);
  text-shadow: var(--glow-text-sm);
  white-space: nowrap;
}
.cab__hud-l, .cab__hud-r { flex-shrink: 0; }
.cab__id {
  opacity: 0.6;
  font-size: 9px;
}
.cab__score {
  color: var(--c-edge);
  font-variant-numeric: tabular-nums;
}

.cab__stage {
  position: relative;
  flex: 1;
  background: #000;
  overflow: hidden;
}

.cab__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

.cab__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 50%, rgba(0,30,40,0.4), rgba(0,0,0,0.85));
  backdrop-filter: blur(2px);
  z-index: 3;
  text-align: center;
  padding: 20px;
  transition: opacity var(--t-med) var(--ease-out);
}
.cab__overlay--hidden { opacity: 0; pointer-events: none; }

.cab__overlay-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(20px, 2.5vw, 36px);
  letter-spacing: 0.2em;
  color: var(--c-edge);
  text-shadow: var(--glow-text-md);
}
.cab__overlay-sub {
  font-family: var(--font-mono);
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: 0.4em;
  color: var(--c-cyan);
  opacity: 0.8;
  text-transform: uppercase;
  max-width: 36ch;
  line-height: 1.6;
}

.btn-insert {
  position: relative;
  margin-top: 6px;
  padding: 12px 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(11px, 1vw, 14px);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--c-edge);
  background: rgba(0,216,255,0.08);
  border: 1px solid var(--c-cyan);
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  box-shadow: var(--glow-sm);
  transition: all var(--t-fast) var(--ease-snap);
}
.btn-insert:hover {
  background: rgba(0,216,255,0.18);
  box-shadow: var(--glow-md);
  text-shadow: var(--glow-text-sm);
}
.btn-insert::before {
  content: "▸ ";
  margin-right: 6px;
  color: var(--c-cyan);
}

.cab__controls {
  position: absolute;
  bottom: 10px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--c-cyan);
  opacity: 0.6;
  z-index: 2;
  text-transform: uppercase;
  pointer-events: none;
}

/* Boost button — only visible while game is active */
.btn-boost {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 84px;
  height: 84px;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.25em;
  color: var(--c-edge);
  background: rgba(255,157,58,0.10);
  border: 1px solid var(--c-amber);
  border-radius: 50%;
  cursor: pointer;
  z-index: 4;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: 0 0 12px rgba(255,157,58,0.35), inset 0 0 12px rgba(255,157,58,0.15);
  text-shadow: 0 0 6px rgba(255,157,58,0.7);
  transition: transform var(--t-fast) var(--ease-snap), background var(--t-fast) var(--ease-snap);
}
.cab--active .btn-boost { display: flex; }
.btn-boost:active,
.btn-boost.is-on {
  background: rgba(255,157,58,0.35);
  transform: scale(0.94);
  box-shadow: 0 0 22px rgba(255,157,58,0.7), inset 0 0 18px rgba(255,157,58,0.4);
}
.dpad__d { grid-column: 2; grid-row: 3; }

.action-btns { display: flex; gap: 8px; align-self: end; }
.action-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid var(--c-cyan);
  background: rgba(0,30,40,0.7);
  color: var(--c-edge);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: var(--glow-sm);
}
.action-btn:active { background: rgba(0,216,255,0.3); }

/* footer */
.footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid rgba(0,216,255,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(0,216,255,0.6);
  text-transform: uppercase;
}
@media (max-width: 600px) {
  .footer { flex-direction: column; gap: 8px; text-align: center; }
}
