/* Arcade mode page. Everything dark; the maze canvas is the star. */
.skip-link { position: absolute; left: 8px; top: -80px; z-index: 100; padding: 10px 12px; background: #ffd400; color: #000; border-radius: 6px; font-size: .7rem; }
.skip-link:focus { top: 8px; outline: 2px solid #fff; }
html, body { height: 100%; }
body.arcade { background: #000; color: #fff; font-family: "Press Start 2P", var(--mono); display: flex; flex-direction: column; overflow-x: hidden; }
.arcade-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 14px; border-bottom: 2px solid #2121de; font-size: .7rem; line-height: 1.6;
}
.arcade-bar a { color: #ffd400; display: inline-block; padding: 8px 6px; margin: -8px -6px; }
.arcade-bar .hud { display: flex; gap: 18px; flex-wrap: wrap; }
.arcade-bar .hud span { color: #ffb8ae; }
.arcade-bar .hud b { color: #fff; font-weight: normal; }
.arcade-bar .right { display: flex; gap: 8px; align-items: center; }
.arcade-bar .short { display: none; }
.arcade-bar .hud-lives { display: none; gap: 4px; align-items: center; }
.arcade-bar .hud-lives .life { width: 12px; height: 12px; }
.abtn {
  font-family: inherit; font-size: .7rem; padding: 9px 12px; min-height: 32px; background: #000; color: #ffd400;
  border: 2px solid #ffd400; border-radius: 4px; cursor: pointer; letter-spacing: .04em;
}
.abtn:hover, .abtn:focus-visible { background: #ffd400; color: #000; outline: none; }
.abtn.big { font-size: .8rem; padding: 14px 22px; }

.stage-wrap { flex: 1; display: grid; grid-template-columns: 1fr 290px; gap: 16px; padding: 12px 14px 16px; align-items: start; }
@media (max-width: 900px) { .stage-wrap { grid-template-columns: 1fr; } }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dpad-wrap { display: none; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.dpad-wrap .swap { display: none; font-size: .55rem; padding: 6px 8px; min-height: 0; }
.stage canvas { display: block; background: #000; image-rendering: auto; box-shadow: 0 0 0 4px #000, 0 0 40px rgba(33,33,222,.35); touch-action: none; }

.panel { font-size: .7rem; line-height: 1.8; color: #cfd3ff; }
.panel h2 { color: #ffd400; font-size: .7rem; margin: 14px 0 6px; font-weight: normal; }
.panel h2:first-child { margin-top: 0; }
.lives { display: flex; gap: 6px; min-height: 18px; align-items: center; }
.life { width: 14px; height: 14px; border-radius: 50%; background: #ffd400; clip-path: polygon(50% 50%, 100% 25%, 100% 0, 0 0, 0 100%, 100% 100%, 100% 75%); }
.sections { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sec {
  display: flex; align-items: center; gap: 8px; font-family: inherit; font-size: .7rem; text-align: left; min-height: 40px;
  background: #0a0a1a; color: #667; border: 1px solid #1a1a3a; border-radius: 4px; padding: 6px; cursor: default;
}
.sec i { width: 22px; height: 22px; flex: none; display: grid; place-items: center; font-style: normal; font-size: .56rem; border-radius: 3px; background: #222; color: #555; }
.sec.got { color: #fff; border-color: var(--c); cursor: pointer; }
.sec.got i { background: var(--c); color: #000; box-shadow: 0 0 8px var(--c); }
.sec.got:hover { background: #12122a; }
.ghost-legend { list-style: none; margin: 0; padding: 0; }
.ghost-legend li { display: grid; grid-template-columns: 14px auto; gap: 2px 8px; margin-bottom: 6px; align-items: center; }
.ghost-legend i { width: 14px; height: 14px; border-radius: 7px 7px 2px 2px; grid-row: span 2; }
.ghost-legend b { font-weight: normal; color: #fff; }
.ghost-legend span { color: #8890b8; font-size: .7rem; }
.controls kbd { display: inline-block; border: 1px solid #334; border-radius: 3px; padding: 1px 5px; color: #ffd400; font-family: inherit; font-size: .7rem; }

.dpad { position: relative; width: 140px; height: 140px; flex: none; }
.dpad button {
  position: absolute; width: 46px; height: 46px; background: rgba(33,33,222,.35); color: #ffd400; border: 2px solid #2121de;
  border-radius: 8px; font-size: 1.1rem; touch-action: none; user-select: none; -webkit-user-select: none;
}
.dpad button:active { background: #ffd400; color: #000; }
.dpad [data-dir="up"] { left: 47px; top: 0; } .dpad [data-dir="down"] { left: 47px; bottom: 0; }
.dpad [data-dir="left"] { left: 0; top: 47px; } .dpad [data-dir="right"] { right: 0; top: 47px; }
@media (pointer: coarse) { .dpad-wrap { display: flex; } .title-card .keys .kb { display: none; } }

/* Narrow screens (portrait phones): two-row header with short labels, single column */
@media (max-width: 600px) {
  .arcade-bar { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; padding: 6px 12px; }
  .arcade-bar .hud { gap: 10px; font-size: .6rem; }
  .arcade-bar .long { display: none; } .arcade-bar .short { display: inline; }
  .arcade-bar .right { grid-column: 1 / -1; }
}

/* Landscape phones: vertical HUD column, D-pad beside the maze (left by default, swappable) */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  body.arcade { flex-direction: row; align-items: stretch; }
  .arcade-bar {
    order: 2; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 8px;
    width: 104px; flex: none; padding: 8px 6px; border-bottom: 0; border-left: 2px solid #2121de; font-size: .55rem; line-height: 1.5;
  }
  .arcade-bar .hud { flex-direction: column; gap: 4px; }
  .arcade-bar .hud > div { display: flex; flex-direction: column; }
  .arcade-bar .hud span { font-size: .5rem; }
  .arcade-bar .hud-lives { display: flex; margin-top: 2px; }
  .arcade-bar .right { flex-direction: column; align-items: stretch; gap: 6px; }
  .arcade-bar .abtn { padding: 6px 4px; min-height: 28px; font-size: .5rem; }
  .arcade-bar a { margin: 0; padding: 6px 4px; }
  .arcade-bar .classic { display: none; }
  main.stage-wrap { order: 1; flex: 1; min-width: 0; grid-template-columns: 1fr; padding: 8px 8px 12px; overflow-y: auto; }
  .stage { flex-direction: row; justify-content: center; align-items: center; gap: 14px; }
  .dpad-wrap { order: -1; }                      /* D-pad on the left of the maze by default */
  .dpad-wrap .swap { display: inline-block; }
  body.dpad-right .dpad-wrap { order: 2; }       /* swapped: D-pad on the right */
  body.dpad-right .arcade-bar { order: 0; border-left: 0; border-right: 2px solid #2121de; }
  .dpad { width: 132px; height: 132px; }
  .dpad button { width: 44px; height: 44px; }
  .dpad [data-dir="up"] { left: 44px; } .dpad [data-dir="down"] { left: 44px; } .dpad [data-dir="left"] { top: 44px; } .dpad [data-dir="right"] { top: 44px; }
  .overlay { position: fixed; }
}

/* overlays sit on top of the canvas */
.overlay {
  position: absolute; inset: 0; z-index: 4; overflow: auto; padding: 14px;
  background: rgba(0,0,0,.82); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
}
.overlay.hidden { display: none; }
.overlay-body { width: 100%; max-width: 520px; margin: auto 0; }
.title-card { text-align: center; padding: 18px 8px; }
.title-card .logo { color: #ffd400; font-size: clamp(.9rem, 3.6vw, 1.5rem); line-height: 1.5; text-shadow: 0 0 12px rgba(255,212,0,.5); word-break: break-word; }
.title-card .logo.red { color: #ff2a2a; text-shadow: 0 0 12px rgba(255,42,42,.5); }
.title-card .sub { color: #00f0ff; font-size: .7rem; margin: 8px 0 18px; line-height: 1.8; }
.title-card .scores { color: #ffb8ae; font-size: .7rem; margin: 10px 0 14px; }
.title-card .how { font-size: .7rem; line-height: 1.9; color: #cfd3ff; margin: 0 auto 14px; max-width: 42ch; }
.title-card .how b { color: #ffd400; font-weight: normal; }
.title-card .keys { list-style: none; margin: 0 0 18px; padding: 0; font-size: .7rem; line-height: 2.2; color: #8890b8; }
.title-card kbd { border: 1px solid #334; border-radius: 3px; padding: 1px 5px; color: #ffd400; font-family: inherit; }
.title-card .skip { margin-top: 14px; font-size: .7rem; }
.title-card .initials { margin: 0 0 16px; font-size: .7rem; }
.title-card .initials input { width: 4.2em; font-family: inherit; font-size: .9rem; text-align: center; text-transform: uppercase; background: #000; color: #ffd400; border: 2px solid #ffd400; border-radius: 4px; padding: 6px; margin-left: 8px; }
.title-card .initials input:focus { outline: 2px solid #fff; outline-offset: 2px; }
.title-card .skip a { color: #8890b8; display: inline-block; padding: 10px 8px; }
.title-card .skip a:hover { color: #fff; }
.summary { list-style: none; margin: 0 auto 18px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: .7rem; text-align: left; max-width: 380px; }
@media (max-width: 420px) { .summary { grid-template-columns: 1fr; } }
.summary li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--c); border-radius: 4px; color: #fff; }
.summary li i { width: 20px; height: 20px; display: grid; place-items: center; font-style: normal; font-size: .5rem; border-radius: 3px; background: var(--c); color: #000; }
.summary li a { margin-left: auto; color: #ffd400; padding: 8px 6px; margin-top: -8px; margin-bottom: -8px; }

/* section cards use the classic page's markup with an arcade skin */
.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.sec-head .chip { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: .7rem; border-radius: 6px; background: var(--c); color: #000; box-shadow: 0 0 16px var(--c); }
.sec-head .eyebrow { color: var(--c); font-size: .7rem; letter-spacing: .05em; }
.sec-head h2 { color: #fff; font-size: 1rem; margin: 6px 0 0; font-weight: normal; }
.sec-body {
  font-family: var(--font); font-size: .95rem; line-height: 1.55; color: #e8ebf3;
  background: #10101f; border: 1px solid #2121de; border-radius: 8px; padding: 16px 18px;
  --text: #e8ebf3; --muted: #9aa3b5; --line: #2a3050; --tag-bg: #1e1e40; --tag-ink: #cfd3ff; --accent: #ffd400;
}
.sec-body h3 { font-family: var(--font); font-size: 1.05rem; color: #fff; }
.sec-body a { color: #ffd400; }
.sec-body .capabilities { grid-template-columns: 1fr; }
.sec-body .media-item { border-left-color: #2121de; }
.sec-body .contact-form input, .sec-body .contact-form textarea { background: #0a0a1a; border-color: #2a3050; color: #fff; }
.sec-body .contact-form .btn { background: #ffd400; color: #000 !important; }
.sec-foot { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.sec-foot .hint { font-size: .7rem; color: #8890b8; }
