/* Glass TTY VT220 — authentic DEC terminal font, via jsDelivr.
   Falls back to VT323 (Google Fonts, same era/style) if CDN fails. */
@font-face {
  font-family: 'Glass TTY VT220';
  src: url('https://cdn.jsdelivr.net/gh/svofski/glasstty/Glass_TTY_VT220.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000000;
  --fg: #33ff66;
  --glow: 0 0 5px rgba(51, 255, 102, 0.6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Glass TTY VT220', 'VT323', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  text-shadow: var(--glow);
  position: relative;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CRT scanlines */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.28) 3px,
    rgba(0, 0, 0, 0.28) 4px
  );
  opacity: 0.55;
}

.wrap {
  padding: 40px 20px 40px 48px;   /* extra left room for hover cursor */
  position: relative;
  z-index: 1;
  width: min(100% - 24px, 42ch);  /* locked width so flicker / status changes don't reflow the page */
}

.brand {
  color: var(--fg);
  margin-bottom: 16px;
}

/* ===== Menu ===== */
.menu {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.menu-item {
  position: relative;
  display: block;
  padding: 3px 0;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  transition: filter 0.1s;
}

/* Blinking tall rectangle cursor — appears on hover */
.menu-item::before {
  content: '';
  position: absolute;
  left: -1.4ch;
  top: 50%;
  transform: translateY(-50%);
  width: 0.55ch;
  height: 1em;
  background: var(--fg);
  box-shadow: 0 0 8px rgba(51, 255, 102, 0.95);
  opacity: 0;
}

.menu-item:hover::before,
.menu-item:focus-visible::before {
  opacity: 1;
  animation: blink 0.9s step-end infinite;
}

.menu-item:hover { filter: brightness(1.25); }

/* ===== Prompt ===== */
.prompt {
  color: var(--fg);
}

.cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===== Game ===== */
.hidden { display: none !important; }

.brand-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 1.4ch;
  margin-bottom: 16px;
}
.brand-row .brand { margin-bottom: 0; }

.difficulty {
  font-size: 0.8em;
  opacity: 0.9;
}
.diff-btn {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--fg);
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-shadow: var(--glow);
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.1s, filter 0.1s;
}
.diff-btn.active {
  opacity: 1;
  filter: brightness(1.25);
}
.diff-btn:hover { opacity: 0.8; }
.diff-btn.active:hover { opacity: 1; }

.game-status {
  margin-bottom: 18px;
  min-height: 1.4em;
}

.cards {
  --slot-w: 6ch;
  position: relative;
  width: calc(var(--slot-w) * 3);
  height: 4.2em;
  margin: 4px 0 20px;
}

.card {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  background: transparent;
  color: var(--fg);
  border: 0;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-shadow: var(--glow);
  cursor: default;
  transform: translateX(calc(var(--slot, 0) * var(--slot-w)));
  transition: transform 0.32s cubic-bezier(.45, .8, .35, 1);
}

.card.can-pick { cursor: pointer; }
.card.can-pick:hover { filter: brightness(1.35); }

.card-art {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.1;
  letter-spacing: inherit;
  user-select: none;
}

.card.reveal-queen { filter: brightness(1.4); }
.card.reveal-x { opacity: 0.55; }

.game-menu { margin-top: 6px; }

@media (max-width: 540px) {
  html, body { font-size: 18px; }
  .wrap { padding: 32px 16px 32px 36px; }
  .cards { --slot-w: 5.5ch; }
}
