/* ==========================================================================
   MEADOW FEVER - cabinet

   The canvas is 448x336 game pixels, doubled to 896x672.

   Where Lisbon Fury's cabinet was a neon club machine and Sanctuary's was
   field kit, this one is a 1992 football annual: blue and amber, the club's
   colours, on a grass-dark ground.
   ========================================================================== */

@font-face {
  font-family: 'Press Start 2P';
  src: url('press-start-2p.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #2f5bd8;
  --blue-dk: #16266a;
  --amber: #ffb31e;
  --grass: #1d3a1f;
  --steel: #3a4450;
  --deep: #070b07;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  font-family: 'Press Start 2P', ui-monospace, monospace;
  color: #f2f6f0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  /* Floodlights over a dark ground. */
  background:
    radial-gradient(ellipse 85% 55% at 50% 30%, #1f3a5e 0%, #101d2e 45%, var(--deep) 100%),
    var(--deep);
}

#cab {
  width: min(100%, calc((100vh - 305px) * 4 / 3 + 48px), 940px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Marquee ------------------------------------------------------------ */
#marquee {
  text-align: center;
  padding: 11px 10px 9px;
  border-radius: 7px 7px 3px 3px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 3px, rgba(0,0,0,0) 3px 7px),
    linear-gradient(180deg, var(--blue) 0%, var(--blue-dk) 100%);
  border: 2px solid var(--steel);
  border-bottom: 3px solid #000;
}
.title {
  display: block;
  font-size: clamp(14px, 2.9vw, 28px);
  letter-spacing: 0.14em;
  color: var(--amber);
  text-shadow: 0 2px 0 #000, 0 0 16px rgba(255, 179, 30, 0.45);
}
.sub {
  display: block;
  margin-top: 8px;
  font-size: clamp(5px, 0.95vw, 9px);
  letter-spacing: 0.16em;
  color: #cfe0ff;
}

/* --- Bezel and screen --------------------------------------------------- */
#bezel {
  padding: clamp(8px, 2vw, 18px);
  border-radius: 10px;
  background: linear-gradient(160deg, #2b3340 0%, #1a2028 40%, #0e1218 100%);
  border: 2px solid #000;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.08),
    inset 0 -3px 0 rgba(0, 0, 0, 0.6),
    0 14px 44px rgba(0, 0, 0, 0.85);
}

#screen {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  border: 2px solid #000;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.95), 0 0 24px rgba(47, 91, 216, 0.14);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  background: #000;
}

#scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.20) 0px, rgba(0, 0, 0, 0.20) 1px,
    rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 3px
  );
  mix-blend-mode: multiply;
}
#glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 120% 90% at 50% 50%, rgba(0, 0, 0, 0) 54%, rgba(0, 0, 0, 0.48) 100%);
}
@media (prefers-reduced-motion: reduce) { #scanlines { opacity: 0.3; } }

/* --- Control panel ------------------------------------------------------ */
#panel {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 4px 4px 9px 9px;
  background: linear-gradient(180deg, #24406e 0%, #12203a 100%);
  border: 2px solid var(--steel);
  border-top: 3px solid #000;
}
.stick { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stick .row { display: flex; gap: 4px; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

#panel button {
  font-family: inherit;
  font-size: 10px;
  color: #10161d;
  border: 0;
  border-radius: 8px;
  padding: 12px 13px;
  cursor: pointer;
  touch-action: none;
  background: linear-gradient(180deg, #e2e8ee, #9aa4b0);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.5);
}
#panel button small { display: block; font-size: 7px; opacity: 0.65; margin-top: 3px; }
#panel button:active, #panel button.down {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
#panel .p { background: linear-gradient(180deg, #8fd8ff, #2f9bd8); }
#panel .s { background: linear-gradient(180deg, #ffd97a, var(--amber)); }

#panel .go { background: linear-gradient(180deg, #b8f0a8, #3aa83a); }

#hint {
  margin: 0;
  text-align: center;
  font-size: 7px;
  line-height: 1.9;
  color: #6f7f92;
}
#hint b { color: var(--amber); }

#music {
  position: fixed;
  top: 10px;
  left: 10px;
  font-family: inherit;
  font-size: 9px;
  color: #f2f6f0;
  background: #1b2c4a;
  border: 1px solid var(--steel);
  border-radius: 5px;
  padding: 8px 10px;
  cursor: pointer;
}
