/* TCA Arcade. Pixel portal, CCC night-club lane: magenta + ultramarine, with kave-fungus brights. */
:root {
  color-scheme: dark;
  --night: #1b0b3a; --night2: #120628; --ink: #0d0618;
  --magenta: #d800a9; --blue: #3200eb; --cyan: #7fd6e8; --yellow: #e8e24a;
  --mint: #8fe3b0; --orange: #f29a2e; --coral: #e8705e; --pink: #f2a6b0; --paper: #fbfaf6;
  --px: "Press Start 2P", "Courier New", monospace;
  --body: Verdana, Tahoma, Geneva, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--paper); font: 15px/1.5 var(--body); overflow-x: hidden;
  background-color: var(--night);
  /* chunky pixel checkerboard */
  background-image:
    linear-gradient(45deg, var(--night2) 25%, transparent 25%, transparent 75%, var(--night2) 75%),
    linear-gradient(45deg, var(--night2) 25%, transparent 25%, transparent 75%, var(--night2) 75%);
  background-size: 32px 32px; background-position: 0 0, 16px 16px;
}
a { color: var(--cyan); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 24px; }

/* top bar: the way home is always first */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--ink); border-bottom: 4px solid var(--magenta);
}
.homebtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  font: 11px/1 var(--px); text-transform: uppercase; text-decoration: none; color: var(--ink);
  background: var(--yellow); border: 3px solid #000; box-shadow: 4px 4px 0 #000;
}
.homebtn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
.credits { margin: 0; font: 10px/1 var(--px); color: var(--cyan); letter-spacing: .05em; }
.credits b { color: var(--yellow); font-weight: 400; }

/* marquee */
.marquee { text-align: center; padding: 22px 0 14px; }
.dept { margin: 0 0 12px; font: 9px/1.6 var(--px); color: var(--pink); text-transform: uppercase; letter-spacing: .08em; }
.logo { margin: 0; font: 400 clamp(34px, 11vw, 78px)/1.05 var(--px); letter-spacing: -.02em; }
.logo span { display: inline-block; }
.logo .l1 {
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--magenta), 6px 6px 0 #000;
}
.logo .l2 {
  color: var(--cyan);
  text-shadow: 3px 3px 0 var(--blue), 6px 6px 0 #000;
}
.sub { margin: 12px 0 0; font: 10px/1.7 var(--px); color: var(--mint); }

/* featured banner: parallax canvas + card */
.feature {
  position: relative; border: 4px solid #000; background: var(--blue);
  box-shadow: 0 0 0 4px var(--magenta), 8px 8px 0 4px #000; margin: 6px 4px 22px;
}
#scene { width: 100%; height: auto; aspect-ratio: 192 / 112; }
.feature-card {
  position: relative; margin: -34px 12px 14px; padding: 14px 14px 16px;
  background: var(--ink); border: 4px solid #000; box-shadow: 0 0 0 3px var(--yellow);
}
.flag { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.feature-card h2 { margin: 0; font: 400 clamp(17px, 5.4vw, 28px)/1.3 var(--px); color: var(--yellow); text-shadow: 3px 3px 0 var(--magenta); }
.ftag { margin: 10px 0 14px; font-size: 15px; color: var(--paper); }
.koinslot {
  position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 7px; background: #1a1a1a; border: 3px solid #000; box-shadow: inset 0 0 0 2px #555; color: var(--orange);
  font: 7px/1.3 var(--px); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.koinslot .slot { width: 6px; height: 18px; background: #000; box-shadow: 0 0 0 2px var(--orange); }
.koinslot.ping .slot { background: var(--yellow); }

/* badges */
.badge {
  display: inline-block; padding: 5px 6px 4px; font: 8px/1 var(--px); letter-spacing: .04em; color: #000;
  background: var(--yellow); border: 2px solid #000; box-shadow: 2px 2px 0 #000; text-transform: uppercase;
}
.badge.new { background: var(--yellow); animation: pop 1s steps(2) infinite; }
.badge.hot { background: var(--orange); }
.badge.beta { background: var(--mint); }
.badge.info { background: var(--cyan); }
@keyframes pop { 50% { transform: translateY(-2px) rotate(-3deg); } }

/* PLAY buttons */
.play {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 16px;
  font: 14px/1 var(--px); color: #000; text-decoration: none; text-transform: uppercase;
  background: var(--mint); border: 4px solid #000; box-shadow: 0 5px 0 #0a6b4a, 0 5px 0 4px #000;
  -webkit-tap-highlight-color: transparent;
}
.play:active { transform: translateY(5px); box-shadow: 0 0 0 #000; }
.play.big { font-size: 16px; min-height: 58px; background: var(--yellow); box-shadow: 0 5px 0 #a8801a, 0 5px 0 4px #000; }

/* ticker */
.ticker { overflow: hidden; white-space: nowrap; margin: 0 -16px 20px; padding: 8px 0; background: var(--magenta); border-block: 4px solid #000; font: 10px/1 var(--px); color: #fff; }
.ticker span { display: inline-block; padding-left: 100%; animation: tick 26s linear -9s infinite; }
@keyframes tick { to { transform: translateX(-100%); } }

/* shelves */
.shelf { margin: 0 0 16px; font: 400 14px/1 var(--px); text-align: center; }
.shelf span { display: inline-block; padding: 9px 12px 8px; background: var(--blue); border: 3px solid #000; box-shadow: 4px 4px 0 #000; color: var(--cyan); }

/* game tiles */
.grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .grid[data-cols="4"] .tile h3 { font-size: 13px; }
}
.tile {
  --c: var(--magenta); --c2: #7a005f;
  position: relative; display: flex; flex-direction: column; background: var(--c);
  border: 4px solid #000; box-shadow: 6px 6px 0 #000; padding: 10px 10px 14px;
}
.tile.c1 { --c: var(--magenta); --c2: #7a005f; }
.tile.c2 { --c: var(--orange); --c2: #8f4d06; }
.tile.c3 { --c: #2f6bff; --c2: #1a1a8a; }
.tile.c4 { --c: var(--mint); --c2: #1f6b4f; }
.tile.c5 { --c: var(--coral); --c2: #7a2a20; }
.tile.c6 { --c: var(--cyan); --c2: #1f5b6b; }
.thumb { position: relative; display: block; border: 4px solid #000; background: #000; box-shadow: inset 0 0 0 2px var(--c2); }
.thumb canvas { width: 100%; height: auto; aspect-ratio: 96 / 54; }
.thumb .badges { position: absolute; top: 6px; left: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.tile h3 { margin: 12px 2px 0; font: 400 15px/1.35 var(--px); color: #000; }
.tile .tag { margin: 8px 2px 0; font: 700 14px/1.35 var(--body); color: #000; }
.tile .line { margin: 6px 2px 14px; font-size: 14px; line-height: 1.45; color: #000; flex: 1; }
.tile .play { background: var(--paper); box-shadow: 0 5px 0 var(--c2), 0 5px 0 4px #000; }
.tile.c3 h3, .tile.c3 .tag, .tile.c3 .line, .tile.c1 h3, .tile.c1 .tag, .tile.c1 .line { color: #fff; }
.play[hidden], .spin[hidden] { display: none; }
.loading, .empty { grid-column: 1 / -1; margin: 0; padding: 22px 14px; text-align: center; background: var(--ink); border: 4px solid #000; box-shadow: 6px 6px 0 #000; }
.loading { font: 12px/1.6 var(--px); color: var(--yellow); }
.dots3 { animation: blink 1s steps(1) infinite; }
.empty p { margin: 0 0 8px; font-size: 15px; }
.empty p:first-child { font: 11px/1.8 var(--px); color: var(--yellow); }
.nojs { font-size: 16px; background: var(--ink); border: 3px solid #000; padding: 12px 12px 12px 32px; }
.nojs li { margin: 6px 0; }

/* market-stall awning + blinking bulbs over each cabinet */
.awning {
  position: relative; display: flex; justify-content: center; align-items: flex-start;
  margin: -10px -10px 0; height: 34px; border-bottom: 4px solid #000;
  background: repeating-linear-gradient(90deg, var(--c2) 0 18px, var(--paper) 18px 36px);
}
.awning::after { /* scalloped pixel fringe */
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 8px; margin-top: 4px;
  background:
    linear-gradient(90deg, var(--c2) 0 18px, var(--paper) 18px 36px) 0 0 / 36px 4px repeat-x,
    linear-gradient(90deg, transparent 0 3px, var(--c2) 3px 15px, transparent 15px 21px, var(--paper) 21px 33px, transparent 33px 36px) 0 4px / 36px 4px repeat-x;
}
.awning span {
  margin-top: 7px; padding: 5px 7px 4px; font: 9px/1 var(--px); letter-spacing: .06em; text-transform: uppercase;
  color: #000; background: var(--yellow); border: 2px solid #000; box-shadow: 2px 2px 0 #000;
}
.bulbs { display: flex; justify-content: space-around; padding: 16px 6px 10px; }
.bulbs i { width: 7px; height: 7px; background: var(--paper); box-shadow: 0 0 6px 1px var(--paper); animation: glow 1.6s steps(2) infinite; }
.bulbs i:nth-child(even) { background: var(--yellow); box-shadow: 0 0 6px 1px var(--yellow); animation-delay: -.8s; }
@keyframes glow { 50% { opacity: .35; box-shadow: none; } }
.tile .meta { margin: 8px 2px 0; font: 9px/1.5 var(--px); color: #000; text-transform: lowercase; opacity: .8; }
.tile.c3 .meta, .tile.c1 .meta { color: #fff; }
.tile .play.soon { background: #bdb6c9; color: #3a3346; box-shadow: 0 5px 0 var(--c2), 0 5px 0 4px #000; cursor: default; }
.tile.soon .thumb { filter: grayscale(.6) brightness(.8); }

/* spin the koin: a random pick for the undecided */
.spinrow { margin: -4px 0 18px; text-align: center; }
.spin {
  min-height: 44px; padding: 8px 14px; font: 12px/1.3 var(--body); color: var(--paper); cursor: pointer;
  background: transparent; border: 3px dashed var(--magenta); -webkit-tap-highlight-color: transparent;
}
.spin b { font: 400 11px/1 var(--px); color: var(--yellow); margin-left: 4px; }
.spin:disabled { opacity: .6; }
.tile.lit { filter: brightness(1.3) saturate(1.3); box-shadow: 0 0 0 4px var(--yellow), 6px 6px 0 4px #000; }
.tile.won { box-shadow: 0 0 0 4px var(--yellow), 0 0 28px 6px var(--yellow), 6px 6px 0 4px #000; animation: won .5s steps(2) 4; }
@keyframes won { 50% { box-shadow: 0 0 0 4px var(--magenta), 0 0 28px 6px var(--magenta), 6px 6px 0 4px #000; } }
.tile { scroll-margin: 90px; }

/* hi-scores */
.breakroom { margin: 38px 0 10px; }
.hiscore { margin: 0; }
.hiscore .tca-gift { color: inherit; }
/* the gift is a single full stop: pad it out to a thumb-sized target without moving the text */
.hiscore button.tca-gift { display: inline-block; padding: 13px 20px; margin: -13px -20px; line-height: 18px; -webkit-tap-highlight-color: transparent; }
/* break room props: only where there's room for them */
.notice, .kettle { display: none; }
@media (min-width: 900px) {
  .breakroom { display: grid; grid-template-columns: 220px minmax(0, 1fr) 160px; gap: 28px; align-items: center; }
  .notice {
    display: block; position: relative; padding: 22px 16px 14px; color: #1a1030; background: #fbf3a0;
    border: 3px solid #000; box-shadow: 6px 6px 0 rgba(0, 0, 0, .45); transform: rotate(-3deg);
  }
  .notice .pin { position: absolute; top: -9px; left: 50%; width: 16px; height: 16px; margin-left: -8px; background: var(--magenta); border: 3px solid #000; }
  .notice h2 { margin: 0 0 8px; font: 9px/1.5 var(--px); }
  .notice ul { margin: 0; padding-left: 16px; font: 13px/1.3 var(--body); }
  .notice li { margin-bottom: 7px; }
  .kettle { display: block; text-align: center; }
  .kettle canvas { width: 112px; height: auto; aspect-ratio: 14 / 10; margin: 0 auto; }
  .kettle::after { content: ""; display: block; height: 12px; margin: 0 4px; background: #6b4a2a; border: 3px solid #000; }
  .kettle p { margin: 0 0 6px; font: 8px/1.4 var(--px); color: #c9b8e8; }
}
.board { list-style: none; margin: 0 auto; padding: 16px 14px; max-width: 460px; background: #000; border: 4px solid var(--blue); box-shadow: 6px 6px 0 var(--magenta); font: 11px/1 var(--px); }
.board li { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; color: var(--cyan); }
.board li:nth-child(1) { color: var(--yellow); }
.board li:nth-child(2) { color: var(--orange); }
.board li:nth-child(3) { color: var(--pink); }
.board li.you { color: var(--mint); }
.board b { font-weight: 400; width: 3.4em; flex: none; }
.board .dots { flex: 1; border-bottom: 3px dotted currentColor; opacity: .5; transform: translateY(-3px); }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.fine { font-size: 12px; color: #c9b8e8; text-align: center; margin: 12px 0 0; }

.parade { position: relative; margin: 26px 0 0; }
#parade { width: 100%; height: auto; aspect-ratio: 192 / 24; border-bottom: 4px solid #000; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#scene { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.say {
  position: absolute; z-index: 3; margin: 0; padding: 6px 8px; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font: 13px/1 var(--body); color: #000; background: var(--paper); border: 3px solid #000; box-shadow: 3px 3px 0 #000;
  opacity: 0; visibility: hidden;
}
.say::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -4px; border: 5px solid transparent; border-top-color: #000; }
.say.on { opacity: 1; visibility: visible; }

/* footer */
.foot { text-align: center; padding: 20px 0 8px; font-size: 14px; }
.foot p { margin: 12px 0 0; }
/* wide enough to wrap at 320px: give the two lines room so they never touch */
.homebtn.wide { justify-content: center; min-height: 52px; font-size: 12px; line-height: 1.7; padding-block: 8px; text-align: center; }
.doors-h { font-size: 13px; }
.doors { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; }
.doors a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  font: 9px/1.3 var(--px); text-transform: uppercase; text-decoration: none; color: var(--paper);
  background: var(--blue); border: 3px solid #000; box-shadow: 3px 3px 0 var(--magenta);
}
.doors a:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--magenta); }

@media (min-width: 760px) {
  .feature { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
  #scene { height: 100%; aspect-ratio: auto; min-height: 320px; object-fit: cover; }
  .feature-card { margin: 0; border-width: 0 0 0 4px; box-shadow: none; display: flex; flex-direction: column; justify-content: center; padding: 22px; }
  .koinslot { left: 10px; right: auto; }
}

/* a phone on its side: the marquee alone was taller than the screen and pushed the featured
   cabinet's PLAY off the bottom. Drop the small print, shrink the logo, go side by side. */
@media (orientation: landscape) and (max-height: 500px) {
  .topbar { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .marquee { padding: 8px 0 6px; }
  .dept, .sub { display: none; }
  .logo { font-size: 30px; }
  .feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: stretch; margin-bottom: 18px; }
  #scene { height: 100%; aspect-ratio: auto; min-height: 0; object-fit: cover; }
  .feature-card { margin: 0; border-width: 0 0 0 4px; box-shadow: none; display: flex; flex-direction: column; justify-content: center; padding: 10px 12px; }
  .feature-card h2 { font-size: 18px; }
  .flag { margin-bottom: 6px; }
  .ftag { margin: 6px 0 10px; font-size: 13px; }
  .play.big { min-height: 48px; }
  .koinslot { left: 10px; right: auto; }
}

@media (hover: hover) {
  .play:hover, .homebtn:hover { filter: brightness(1.12); }
  .tile:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 #000; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker span, .badge.new, .blink, .bulbs i, .tile.won, .dots3 { animation: none; }
  /* no scrolling: the ticker becomes a still, centred banner with room between the lines */
  .ticker { white-space: normal; padding: 10px 16px; line-height: 2; text-align: center; }
  .ticker span { display: block; padding-left: 0; }
}
