/* ==========================================================================
   GP.OS arcade — games grid, CRT cabinet overlay, touch controls.
   Per-game neon comes from --game-accent / --game-accent-rgb (set by arcade.js).
   ========================================================================== */

.ac-root [hidden],
.ac [hidden] {
  display: none !important;
}

/* ============================================================ GRID HEADER */
.ac-root,
#games-grid.ac-root {
  position: relative;
  display: block;
  min-width: 0;
}

.ac-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: clamp(18px, 3vw, 28px);
}

.ac-progress {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1 1 260px;
  min-width: 0;
}

.ac-progress__txt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.45em;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.ac-progress__txt b {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.65);
}

.ac-progress__dot {
  width: 7px;
  height: 7px;
  margin-right: 0.35em;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: ac-blink 1.6s linear infinite;
}

.ac-progress__bar {
  position: relative;
  display: block;
  height: 4px;
  max-width: 380px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.12);
  overflow: hidden;
}

.ac-progress__bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.8);
  transition: width 1.1s var(--ease-out);
}

.ac-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

/* ------------------------------------------------------------ filter tabs */
.ac-tabs {
  position: relative;
  display: flex;
  gap: 2px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ac-tabs::-webkit-scrollbar {
  display: none;
}

.ac-tabs__pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  z-index: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-2-rgb), 0.18));
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.6), 0 0 18px rgba(var(--accent-rgb), 0.35);
  pointer-events: none;
  opacity: 0;
}

.ac-tabs__pill.is-ready {
  opacity: 1;
  transition: transform 0.5s var(--ease-out), width 0.5s var(--ease-out), opacity 0.3s ease;
}

.ac-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  white-space: nowrap;
  color: var(--text-dim);
  transition: color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.ac-tab:hover {
  color: var(--text);
}

.ac-tab.is-active {
  color: #fff;
  text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.85);
}

.ac-tab__n {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: 0;
  text-align: center;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  text-shadow: none;
}

.ac-tab--secret .ac-tab__n {
  color: var(--gold);
  background: rgba(255, 194, 61, 0.12);
}

.ac-tab:focus-visible {
  outline-offset: -2px;
}

.ac-random {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 9px 16px;
  border: 1px solid rgba(var(--accent-2-rgb), 0.45);
  border-radius: 999px;
  background: rgba(var(--accent-2-rgb), 0.08);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text);
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s var(--ease-back);
  -webkit-tap-highlight-color: transparent;
}

.ac-random__die {
  font-size: 17px;
  line-height: 1;
  color: var(--accent-2);
  text-shadow: 0 0 10px rgba(var(--accent-2-rgb), 0.8);
  transition: transform 0.5s var(--ease-back);
}

.ac-random:hover {
  border-color: var(--accent-2);
  background: rgba(var(--accent-2-rgb), 0.18);
  box-shadow: 0 0 20px rgba(var(--accent-2-rgb), 0.4);
}

.ac-random:hover .ac-random__die {
  transform: rotate(200deg) scale(1.15);
}

.ac-random:active {
  transform: scale(0.95);
}

/* ================================================================= GRID */
.ac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: clamp(14px, 2vw, 22px);
}

.ac-cell {
  position: relative;
  display: flex;
  min-width: 0;
}

.ac-grid.is-anim .ac-cell {
  animation: ac-cell-in 0.7s var(--ease-out) both;
  animation-delay: calc(min(var(--i, 0), 14) * 55ms);
}

.ac-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-align: center;
  color: var(--text-faint);
}

.ac-empty__glyph {
  font-size: 28px;
  color: var(--accent);
  text-shadow: var(--glow);
}

/* ================================================================= CARD */
.ac-card {
  --game-accent: var(--accent);
  --game-accent-rgb: var(--accent-rgb);
  position: relative;
  display: flex;
  flex: 1;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 1px;
  border: 0;
  border-radius: var(--radius-lg);
  background: rgba(var(--game-accent-rgb), 0.24);
  color: var(--text);
  font: inherit;
  text-align: left;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: translate 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

/* animated conic border: a big spinning gradient behind the inner panel */
.ac-card__ring {
  position: absolute;
  inset: -60%;
  z-index: -1;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 190deg,
    rgba(var(--game-accent-rgb), 0.95) 250deg,
    #fff 270deg,
    rgba(var(--game-accent-rgb), 0.95) 290deg,
    transparent 340deg 360deg
  );
  opacity: 0.35;
  animation: ac-spin 3.4s linear infinite;
  animation-play-state: paused;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.ac-card:hover .ac-card__ring,
.ac-card:focus-visible .ac-card__ring {
  opacity: 1;
  animation-play-state: running;
}

.ac-card:hover {
  translate: 0 -6px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5), 0 0 36px rgba(var(--game-accent-rgb), 0.3);
}

.ac-card:active {
  translate: 0 -2px;
}

.ac-card__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 18px 18px 16px;
  border-radius: calc(var(--radius-lg) - 1px);
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(var(--game-accent-rgb), 0.15), transparent 62%),
    linear-gradient(180deg, rgba(14, 20, 46, 0.97), rgba(6, 9, 22, 0.98));
}

/* faint scanline texture */
.ac-card__inner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

.ac-card__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.ac-card__idx {
  margin-right: auto;
  color: var(--text-faint);
}

.ac-card__chip {
  padding: 3px 8px;
  border: 1px solid rgba(var(--game-accent-rgb), 0.45);
  border-radius: 999px;
  background: rgba(var(--game-accent-rgb), 0.08);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--game-accent);
}

.ac-card__chip--secret {
  border-color: rgba(255, 194, 61, 0.55);
  background: rgba(255, 194, 61, 0.1);
  color: var(--gold);
}

.ac-card__chip--new {
  border-color: transparent;
  background: var(--gold);
  color: #1a1000;
  box-shadow: 0 0 14px rgba(255, 194, 61, 0.7);
  animation: ac-new-pulse 1.4s ease-in-out infinite;
}

.ac-card__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 8px 0 4px 6px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 38%, rgba(var(--game-accent-rgb), 0.32), rgba(var(--game-accent-rgb), 0.04) 72%);
  box-shadow:
    inset 0 0 0 1px rgba(var(--game-accent-rgb), 0.6),
    inset 0 0 26px rgba(var(--game-accent-rgb), 0.25),
    0 0 26px rgba(var(--game-accent-rgb), 0.22);
  transition: box-shadow 0.4s ease, transform 0.5s var(--ease-back);
}

.ac-card__icon::after {
  content: '';
  position: absolute;
  inset: -7px;
  border: 1px dashed rgba(var(--game-accent-rgb), 0.35);
  border-radius: 25px;
  pointer-events: none;
}

.ac-card__emoji {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(var(--game-accent-rgb), 0.85));
  transition: transform 0.5s var(--ease-back);
}

.ac-card:hover .ac-card__icon {
  box-shadow:
    inset 0 0 0 1px var(--game-accent),
    inset 0 0 32px rgba(var(--game-accent-rgb), 0.4),
    0 0 40px rgba(var(--game-accent-rgb), 0.45);
}

.ac-card:hover .ac-card__emoji {
  transform: scale(1.15) rotate(-7deg);
}

.ac-card__title {
  display: block;
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(16px, 1.55vw, 19px);
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  color: #fff;
  text-shadow:
    0 0 14px rgba(var(--game-accent-rgb), 0.6),
    -1px 0 rgba(255, 43, 214, 0.35),
    1px 0 rgba(0, 240, 255, 0.35);
}

.ac-card__tag {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-dim);
}

.ac-card__ctrl {
  position: relative;
  padding-left: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.ac-card__ctrl::before {
  content: '\203A';
  position: absolute;
  left: 2px;
  top: -1px;
  color: var(--game-accent);
}

.ac-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--game-accent-rgb), 0.16);
}

.ac-card__best {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
}

.ac-card__best-val {
  font-size: 13px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--game-accent);
  text-shadow: 0 0 10px rgba(var(--game-accent-rgb), 0.55);
}

.ac-card__play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #04050d;
  background: var(--game-accent);
  box-shadow: 0 0 16px rgba(var(--game-accent-rgb), 0.55);
  transition: transform 0.3s var(--ease-back), box-shadow 0.3s ease;
}

.ac-card__play i {
  font-style: normal;
  font-size: 9px;
}

.ac-card:hover .ac-card__play,
.ac-card:focus-visible .ac-card__play {
  transform: scale(1.07);
  box-shadow: 0 0 28px rgba(var(--game-accent-rgb), 0.9);
}

/* ---------------------------------------------------------- locked card */
.ac-card.is-locked {
  background: rgba(255, 56, 96, 0.26);
  cursor: not-allowed;
}

.ac-card.is-locked:hover {
  translate: 0 -3px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 26px rgba(255, 56, 96, 0.22);
}

.ac-card.is-locked .ac-card__inner {
  background:
    repeating-linear-gradient(-45deg, rgba(255, 56, 96, 0.045) 0 10px, transparent 10px 20px),
    radial-gradient(120% 70% at 50% 0%, rgba(255, 56, 96, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(22, 10, 24, 0.97), rgba(9, 6, 15, 0.98));
}

.ac-card.is-locked .ac-card__chip {
  color: var(--red);
  border-color: rgba(255, 56, 96, 0.5);
  background: rgba(255, 56, 96, 0.08);
}

.ac-card__icon--lock {
  color: var(--red);
  background: radial-gradient(circle at 50% 38%, rgba(255, 56, 96, 0.22), rgba(255, 56, 96, 0.03) 72%);
  animation: ac-lock-flicker 4.2s linear infinite;
}

.ac-card__icon--lock svg {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 8px rgba(255, 56, 96, 0.8));
}

.ac-card.is-locked .ac-card__title {
  position: relative;
  color: #ffd0da;
  letter-spacing: 0.3em;
  text-shadow: 0 0 14px rgba(255, 56, 96, 0.7);
}

.ac-card.is-locked .ac-card__title::before,
.ac-card.is-locked .ac-card__title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}

.ac-card.is-locked .ac-card__title::before {
  color: var(--cyan);
  opacity: 0.75;
  clip-path: inset(0 0 55% 0);
  animation: ac-glitch-a 2.7s steps(1) infinite;
}

.ac-card.is-locked .ac-card__title::after {
  color: var(--magenta);
  opacity: 0.75;
  clip-path: inset(55% 0 0 0);
  animation: ac-glitch-b 3.3s steps(1) infinite;
}

.ac-card.is-locked .ac-card__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: rgba(255, 56, 96, 0.8);
}

.ac-card__hint {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 56, 96, 0.38);
  border-radius: 10px;
  background: rgba(255, 56, 96, 0.05);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: #ffb8c6;
}

.ac-card__lbl {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
}

.ac-card__hint .ac-card__lbl {
  color: var(--red);
}

.ac-card.is-locked .ac-card__best-val {
  color: rgba(255, 56, 96, 0.6);
  text-shadow: none;
}

.ac-card.is-locked .ac-card__play {
  color: var(--red);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 56, 96, 0.55);
}

.ac-card.is-locked:hover .ac-card__play {
  transform: none;
  box-shadow: inset 0 0 0 1px var(--red), 0 0 16px rgba(255, 56, 96, 0.4);
}

.ac-card__stamp {
  position: absolute;
  top: 74px;
  right: 14px;
  z-index: 2;
  padding: 5px 10px;
  border: 2px solid rgba(255, 56, 96, 0.75);
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.26em;
  color: rgba(255, 56, 96, 0.9);
  text-shadow: 0 0 10px rgba(255, 56, 96, 0.6);
  box-shadow: inset 0 0 10px rgba(255, 56, 96, 0.25), 0 0 12px rgba(255, 56, 96, 0.2);
  transform: rotate(-11deg);
  pointer-events: none;
  opacity: 0.85;
}

.ac-card.is-denied {
  animation: ac-deny 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.ac-card.is-denied .ac-card__stamp {
  animation: ac-stamp-flash 0.5s ease both;
}

/* -------------------------------------------------------- unlock reveal */
.ac-card.is-unlocking {
  animation: ac-unlock 1.3s var(--ease-out) both;
}

.ac-card.is-unlocking::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent, rgba(var(--game-accent-rgb), 0.75), rgba(255, 255, 255, 0.6), transparent);
  pointer-events: none;
  animation: ac-sweep 1.1s var(--ease-out) both;
}

.ac-card.is-unlocking .ac-card__ring {
  opacity: 1;
  animation-play-state: running;
}

/* ============================================================== OVERLAY */
html.ac-lock,
html.ac-lock body {
  overflow: hidden !important;
}

.ac {
  --game-accent: var(--accent);
  --game-accent-rgb: var(--accent-rgb);
  position: fixed;
  inset: 0;
  z-index: var(--z-arcade);
  display: none;
  color: var(--text);
  font-family: var(--font-body);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: contain;
}

.ac.is-open {
  display: block;
}

/* While the CRT powers off the (fixed, full-screen) root keeps catching clicks so the 2nd click of a
   double-click on CLOSE / BACK TO ARCADE cannot fall through to the nav or a card underneath. */
.ac.is-closing * {
  pointer-events: none;
}

.ac__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(110% 80% at 50% 42%, rgba(var(--game-accent-rgb), 0.14), transparent 58%),
    radial-gradient(70% 50% at 50% 115%, rgba(var(--accent-2-rgb), 0.12), transparent 60%),
    rgba(2, 3, 9, 0.95);
  animation: ac-fade-in 0.35s ease both;
}

.ac.is-closing .ac__backdrop {
  animation: ac-fade-out 0.45s ease 0.08s both;
}

/* ------------------------------------------------------------- cabinet */
.ac__cabinet {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: 'bar' 'stage' 'foot';
  gap: 12px;
  padding: 14px 16px 12px;
  border: 1px solid rgba(var(--game-accent-rgb), 0.45);
  border-radius: 24px;
  background:
    radial-gradient(100% 60% at 50% 0%, rgba(var(--game-accent-rgb), 0.08), transparent 60%),
    linear-gradient(180deg, rgba(12, 17, 40, 0.94), rgba(5, 7, 18, 0.97));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 44px rgba(var(--game-accent-rgb), 0.2),
    inset 0 0 70px rgba(var(--game-accent-rgb), 0.06),
    0 30px 90px rgba(0, 0, 0, 0.65);
}

.ac.has-pad .ac__cabinet {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: 'bar bar' 'stage stage' 'pad abtn' 'foot foot';
}

.ac__corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid var(--game-accent);
  filter: drop-shadow(0 0 6px var(--game-accent));
  pointer-events: none;
}

.ac__corner--tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 24px; }
.ac__corner--tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-top-right-radius: 24px; }
.ac__corner--bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-bottom-left-radius: 24px; }
.ac__corner--br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 24px; }

/* -------------------------------------------------------------- top bar */
.ac__bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.ac__id {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.ac__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  background: rgba(var(--game-accent-rgb), 0.12);
  box-shadow: inset 0 0 0 1px rgba(var(--game-accent-rgb), 0.55), 0 0 18px rgba(var(--game-accent-rgb), 0.3);
}

.ac__id-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ac__kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.28em;
  white-space: nowrap;
  color: var(--text-faint);
}

.ac__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(14px, 1.7vw, 20px);
  line-height: 1.25;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  text-shadow: 0 0 14px rgba(var(--game-accent-rgb), 0.65);
}

.ac__stats {
  display: flex;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}

.ac__stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 78px;
  padding: 5px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.38);
  box-shadow: inset 0 0 0 1px rgba(var(--game-accent-rgb), 0.24);
  overflow: hidden;
  transition: transform 0.14s var(--ease-out), box-shadow 0.3s ease;
}

.ac__stat-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.26em;
  white-space: nowrap;
  color: var(--text-faint);
}

.ac__stat-val {
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  color: var(--game-accent);
  text-shadow: 0 0 12px rgba(var(--game-accent-rgb), 0.75);
}

.ac__stat--best .ac__stat-val {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 194, 61, 0.6);
}

.ac__stat--score.is-bump {
  transform: scale(1.08);
}

.ac__stat--score.is-record {
  box-shadow: inset 0 0 0 1px rgba(255, 194, 61, 0.75), 0 0 18px rgba(255, 194, 61, 0.35);
}

.ac__stat--score.is-record .ac__stat-lbl::after {
  content: ' \2605';
  color: var(--gold);
}

.ac__btns {
  display: flex;
  gap: 6px;
  flex: none;
}

.ac__btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(var(--game-accent-rgb), 0.3);
  border-radius: 12px;
  background: rgba(var(--game-accent-rgb), 0.06);
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.ac__btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.ac__btn:hover {
  border-color: rgba(var(--game-accent-rgb), 0.75);
  background: rgba(var(--game-accent-rgb), 0.18);
  box-shadow: 0 0 16px rgba(var(--game-accent-rgb), 0.38);
  color: #fff;
}

.ac__btn:active {
  transform: scale(0.9);
}

.ac__btn--close:hover {
  border-color: rgba(255, 56, 96, 0.85);
  background: rgba(255, 56, 96, 0.16);
  box-shadow: 0 0 16px rgba(255, 56, 96, 0.45);
}

.ac__btn.is-muted {
  color: var(--text-faint);
}

.ac[data-state='over'] .ac__btn--pause,
.ac[data-state='fault'] .ac__btn--pause {
  opacity: 0.3;
  pointer-events: none;
}

/* ------------------------------------------------------- stage & screen */
.ac__stage {
  grid-area: stage;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  touch-action: none;
}

.ac__screen {
  position: relative;
  flex: none;
  width: 320px;
  height: 240px;
  border-radius: 14px;
  overflow: hidden;
  background: #05060f;
  container-type: size;
  outline: none;
  box-shadow:
    0 0 0 2px #090d1d,
    0 0 0 3px rgba(var(--game-accent-rgb), 0.6),
    0 0 30px rgba(var(--game-accent-rgb), 0.35),
    0 0 90px rgba(var(--game-accent-rgb), 0.14);
}

.ac__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  touch-action: none;
}

/* CRT glass: scanlines + rolling bar + vignette + reflection (never blocks input) */
.ac__crt {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
}

.ac__crt i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.ac__scan {
  overflow: hidden;
  background: repeating-linear-gradient(180deg, transparent 0 2px, rgba(0, 0, 0, 0.2) 2px 3px);
}

.ac__scan::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 22%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.035), transparent);
  animation: ac-roll 7s linear infinite;
}

.ac__vignette {
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.5) 100%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55), inset 0 0 14px rgba(var(--game-accent-rgb), 0.22);
}

.ac__glass {
  background:
    radial-gradient(120% 55% at 28% -8%, rgba(255, 255, 255, 0.08), transparent 60%),
    linear-gradient(118deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 30%, transparent 31%, transparent 72%, rgba(255, 255, 255, 0.02) 100%);
}

.ac__taphint {
  position: absolute;
  left: 50%;
  bottom: 9%;
  z-index: 3;
  padding: 7px 20px;
  border: 1px solid rgba(var(--game-accent-rgb), 0.65);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.32em;
  color: #fff;
  text-shadow: 0 0 10px rgba(var(--game-accent-rgb), 0.9);
  box-shadow: 0 0 18px rgba(var(--game-accent-rgb), 0.45);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.ac.show-tap .ac__taphint {
  opacity: 1;
  animation: ac-tap-pulse 1s ease-in-out infinite;
}

/* ------------------------------------------------------- screen panels */
.ac__panel {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center; /* centered, but still scrollable from the top when it overflows */
  gap: 10px;
  gap: clamp(5px, 2.3cqmin, 16px);
  padding: 16px;
  padding: clamp(10px, 5cqmin, 34px);
  text-align: center;
  background: radial-gradient(circle at 50% 45%, rgba(5, 7, 18, 0.55), rgba(3, 4, 12, 0.88));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
}

.ac__panel::-webkit-scrollbar {
  display: none;
}

.ac__panel.is-in {
  animation: ac-panel-in 0.45s var(--ease-out) both;
}

.ac__panel--ready,
.ac__panel--paused {
  cursor: pointer;
}

.ac-pn__icon {
  font-size: 40px;
  font-size: clamp(24px, 11cqmin, 66px);
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(var(--game-accent-rgb), 0.85));
  animation: ac-float 3s ease-in-out infinite;
}

.ac-pn__icon--fault {
  color: var(--red);
  filter: drop-shadow(0 0 16px rgba(255, 56, 96, 0.9));
  animation: ac-lock-flicker 2s linear infinite;
}

.ac-pn__kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-size: clamp(8.5px, 2.4cqmin, 12px);
  letter-spacing: 0.3em;
  color: var(--game-accent);
  opacity: 0.9;
}

.ac-pn__title {
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  font-size: clamp(19px, 9cqmin, 62px);
  line-height: 1.05;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  color: #fff;
  text-shadow:
    0 0 18px rgba(var(--game-accent-rgb), 0.85),
    -2px 0 rgba(255, 43, 214, 0.55),
    2px 0 rgba(0, 240, 255, 0.55);
}

.ac-pn__title--over {
  color: #ffd9e0;
  text-shadow:
    0 0 20px rgba(255, 56, 96, 0.9),
    -2px 0 rgba(255, 43, 214, 0.6),
    2px 0 rgba(0, 240, 255, 0.5);
  animation: ac-title-glitch 2.6s steps(1) infinite;
}

.ac-pn__title--win {
  color: #ecffe4;
  text-shadow:
    0 0 22px rgba(57, 255, 20, 0.85),
    -2px 0 rgba(255, 43, 214, 0.5),
    2px 0 rgba(0, 240, 255, 0.55);
  animation: ac-record-pop 0.7s var(--ease-back) both;
}

.ac-pn__title--fault {
  color: var(--red);
  text-shadow: 0 0 20px rgba(255, 56, 96, 0.9), -2px 0 rgba(0, 240, 255, 0.5), 2px 0 rgba(255, 230, 0, 0.4);
  animation: ac-title-glitch 1.8s steps(1) infinite;
}

.ac-pn__title--blink {
  animation: ac-blink-soft 1.4s ease-in-out infinite;
}

.ac-pn__sub {
  max-width: 34em;
  font-size: 14px;
  font-size: clamp(10.5px, 3.2cqmin, 17px);
  line-height: 1.45;
  color: var(--text-dim);
}

.ac-pn__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid rgba(var(--game-accent-rgb), 0.28);
  border-radius: 10px;
  background: rgba(var(--game-accent-rgb), 0.07);
  font-family: var(--font-mono);
  font-size: 11px;
  font-size: clamp(9px, 2.7cqmin, 13px);
  color: var(--text);
}

.ac-pn__lbl {
  font-family: var(--font-mono);
  font-size: 0.8em;
  letter-spacing: 0.26em;
  color: var(--text-faint);
}

.ac-pn__best {
  font-family: var(--font-mono);
  font-size: 12px;
  font-size: clamp(9.5px, 2.8cqmin, 14px);
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

.ac-pn__best b {
  letter-spacing: 0.06em;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 194, 61, 0.6);
}

.ac-pn__prev {
  color: var(--text-faint);
}

.ac-pn__start {
  margin-top: 4px;
  padding: 10px 22px;
  border: 1px solid rgba(var(--game-accent-rgb), 0.75);
  border-radius: 999px;
  background: rgba(var(--game-accent-rgb), 0.12);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  font-size: clamp(9.5px, 3cqmin, 16px);
  letter-spacing: 0.22em;
  color: #fff;
  text-shadow: 0 0 10px rgba(var(--game-accent-rgb), 0.9);
  box-shadow: 0 0 22px rgba(var(--game-accent-rgb), 0.4), inset 0 0 14px rgba(var(--game-accent-rgb), 0.25);
  animation: ac-blink 1.1s linear infinite;
}

.ac-pn__start:hover {
  animation-play-state: paused;
  background: rgba(var(--game-accent-rgb), 0.25);
}

.ac-pn__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ac-pn__score b {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  font-size: clamp(24px, 12cqmin, 84px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--game-accent);
  text-shadow: 0 0 24px rgba(var(--game-accent-rgb), 0.85);
}

.ac-pn__record {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  font-size: clamp(13px, 5.5cqmin, 32px);
  letter-spacing: 0.14em;
  color: var(--gold);
  background: linear-gradient(90deg, var(--gold), var(--magenta), var(--cyan), var(--lime), var(--gold));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 194, 61, 0.65));
  animation: gp-shimmer 1.6s linear infinite, ac-record-pop 0.7s var(--ease-back) both;
}

.ac-pn__msg {
  max-width: 32em;
  font-family: var(--font-mono);
  font-size: 12px;
  font-size: clamp(9.5px, 3cqmin, 15px);
  line-height: 1.5;
  color: var(--text);
}

.ac-pn__err {
  display: block;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 56, 96, 0.4);
  border-radius: 8px;
  background: rgba(255, 56, 96, 0.08);
  font-family: var(--font-mono);
  font-size: 11px;
  font-size: clamp(9px, 2.6cqmin, 12px);
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
  color: #ffb8c6;
  -webkit-user-select: text;
  user-select: text;
}

.ac-pn__btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.ac-pn__btn {
  min-height: 40px;
  padding: 9px 18px;
  border: 1px solid rgba(var(--game-accent-rgb), 0.45);
  border-radius: 999px;
  background: rgba(5, 8, 20, 0.72);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  font-size: clamp(9.5px, 2.8cqmin, 14px);
  letter-spacing: 0.15em;
  color: var(--text);
  transition: transform 0.2s var(--ease-back), box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.ac-pn__btn:hover {
  border-color: var(--game-accent);
  color: #fff;
  box-shadow: 0 0 18px rgba(var(--game-accent-rgb), 0.45);
  transform: translateY(-1px);
}

.ac-pn__btn:active {
  transform: scale(0.95);
}

.ac-pn__btn.is-primary {
  border-color: transparent;
  background: var(--game-accent);
  color: #04050d;
  box-shadow: 0 0 22px rgba(var(--game-accent-rgb), 0.55);
}

.ac-pn__btn.is-primary:hover {
  color: #04050d;
  box-shadow: 0 0 34px rgba(var(--game-accent-rgb), 0.9);
}

.ac__panel.is-locked .ac-pn__btn {
  opacity: 0.45;
  pointer-events: none;
}

.ac-pn__hint {
  font-family: var(--font-mono);
  font-size: 10px;
  font-size: clamp(8px, 2.3cqmin, 11.5px);
  letter-spacing: 0.2em;
  color: var(--text-faint);
}

/* ------------------------------------------------------- touch controls */
.ac__touch {
  display: none;
}

.ac.has-pad .ac__touch {
  display: contents;
}

.ac__pad {
  grid-area: pad;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.ac__abtn-wrap {
  grid-area: abtn;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.ac-dpad {
  position: relative;
  width: clamp(132px, 40vw, 176px);
  height: clamp(132px, 40vw, 176px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--game-accent-rgb), 0.1), rgba(0, 0, 0, 0.38) 70%);
  box-shadow: inset 0 0 0 1px rgba(var(--game-accent-rgb), 0.3), 0 0 24px rgba(var(--game-accent-rgb), 0.12);
  touch-action: none;
}

.ac-dpad__btn,
.ac-lr__btn {
  display: grid;
  place-items: center;
  background: rgba(10, 14, 32, 0.88);
  box-shadow: inset 0 0 0 1px rgba(var(--game-accent-rgb), 0.45);
  color: var(--game-accent);
  pointer-events: none;
  transition: background 0.08s ease, box-shadow 0.08s ease, transform 0.08s ease, color 0.08s ease;
}

.ac-dpad__btn {
  position: absolute;
  width: 36%;
  height: 36%;
  border-radius: 14px;
}

.ac-dpad__btn svg,
.ac-lr__btn svg {
  width: 44%;
  height: 44%;
  filter: drop-shadow(0 0 6px rgba(var(--game-accent-rgb), 0.7));
}

.ac-dpad__btn--up { top: 3%; left: 32%; }
.ac-dpad__btn--down { bottom: 3%; left: 32%; }
.ac-dpad__btn--left { left: 3%; top: 32%; }
.ac-dpad__btn--right { right: 3%; top: 32%; }
.ac-dpad__btn--down svg { transform: rotate(180deg); }
.ac-dpad__btn--left svg,
.ac-lr__btn--left svg { transform: rotate(-90deg); }
.ac-dpad__btn--right svg,
.ac-lr__btn--right svg { transform: rotate(90deg); }

.ac-dpad__hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(var(--game-accent-rgb), 0.28);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ac-dpad__btn.is-on,
.ac-lr__btn.is-on {
  background: rgba(var(--game-accent-rgb), 0.38);
  box-shadow: inset 0 0 0 1px var(--game-accent), 0 0 20px rgba(var(--game-accent-rgb), 0.75);
  color: #fff;
  transform: scale(0.93);
}

.ac-lr {
  display: flex;
  gap: 14px;
  touch-action: none;
}

.ac-lr__btn {
  width: clamp(70px, 22vw, 96px);
  height: clamp(70px, 22vw, 96px);
  border-radius: 22px;
}

.ac-abtn {
  display: grid;
  place-items: center;
  width: clamp(78px, 24vw, 104px);
  height: clamp(78px, 24vw, 104px);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.38), rgba(var(--accent-2-rgb), 0.6) 45%, rgba(var(--accent-2-rgb), 0.25) 100%);
  box-shadow:
    inset 0 -6px 14px rgba(0, 0, 0, 0.35),
    0 0 0 2px rgba(var(--accent-2-rgb), 0.65),
    0 0 26px rgba(var(--accent-2-rgb), 0.45);
  touch-action: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.ac-abtn span {
  pointer-events: none;
}

.ac-abtn.is-on {
  transform: scale(0.9);
  box-shadow:
    inset 0 5px 14px rgba(0, 0, 0, 0.45),
    0 0 0 2px var(--accent-2),
    0 0 42px rgba(var(--accent-2-rgb), 0.9);
}

/* --------------------------------------------------------------- footer */
.ac__foot {
  grid-area: foot;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.ac__hint {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac__hint::before {
  content: '\25C6\00a0\00a0';
  color: var(--game-accent);
}

.ac__keys {
  flex: none;
}

.ac.is-touch .ac__keys {
  display: none;
}

/* --------------------------------------------------- CRT power on / off */
.ac__beam {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 5;
  height: 3px;
  margin-top: -1.5px;
  background: #fff;
  box-shadow: 0 0 12px #fff, 0 0 32px var(--game-accent), 0 0 90px var(--game-accent);
  opacity: 0;
  transform: scaleX(0);
  pointer-events: none;
}

.ac.is-powering .ac__cabinet {
  animation: ac-cab-on 0.72s var(--ease-out) both;
}

.ac.is-powering .ac__beam {
  animation: ac-beam-on 0.72s var(--ease-out) both;
}

.ac.is-closing .ac__cabinet {
  animation: ac-cab-off 0.52s cubic-bezier(0.7, 0, 0.84, 0) both;
}

.ac.is-closing .ac__beam {
  animation: ac-beam-off 0.52s ease-in both;
}

/* ================================================================ LAYOUT */
@media (max-width: 640px) {
  .ac__cabinet {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    gap: 10px;
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
  }

  .ac__corner { display: none; }
  .ac__kicker { display: none; }
  .ac__bar { gap: 8px; }
  .ac__id { gap: 8px; }

  .ac__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 18px;
  }

  .ac__title { font-size: 13px; }
  .ac__stats { gap: 5px; }

  .ac__stat {
    min-width: 0;
    padding: 3px 8px;
    border-radius: 8px;
  }

  .ac__stat-lbl { font-size: 8px; letter-spacing: 0.2em; }
  .ac__stat-val { font-size: 14px; }
  .ac__btns { gap: 4px; }

  .ac__btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .ac__btn svg { width: 16px; height: 16px; }
  .ac__foot { justify-content: center; font-size: 9.5px; letter-spacing: 0.1em; }
  .ac__screen { border-radius: 10px; }
}

@media (max-width: 430px) {
  .ac__id-txt { display: none; }
  .ac__id { flex: 0 0 auto; margin-right: auto; }
}

/* phones held sideways: pad left, screen centre, A right */
@media (orientation: landscape) and (max-height: 560px) {
  .ac__cabinet {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    gap: 8px 12px;
    padding:
      max(6px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(6px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
  }

  .ac.has-pad .ac__cabinet {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: 'bar bar bar' 'pad stage abtn';
  }

  .ac.has-pad .ac__foot { display: none; }
  .ac__corner { display: none; }
  .ac__kicker { display: none; }
  .ac__icon { width: 32px; height: 32px; font-size: 17px; border-radius: 9px; }
  .ac__stat { min-width: 0; padding: 2px 8px; }
  .ac__stat-val { font-size: 14px; }
  .ac__btn { width: 32px; height: 32px; border-radius: 9px; }
  .ac__btn svg { width: 15px; height: 15px; }

  .ac-dpad {
    width: min(150px, 46vh);
    height: min(150px, 46vh);
  }

  .ac-lr {
    flex-direction: column;
    gap: 10px;
  }

  .ac-lr__btn {
    width: min(76px, 24vh);
    height: min(76px, 24vh);
  }

  .ac-abtn {
    width: min(92px, 30vh);
    height: min(92px, 30vh);
  }
}

/* -------------------------------------------------- grid on small screens */
@media (max-width: 560px) {
  .ac-head { gap: 14px; }
  .ac-controls { width: 100%; }
  .ac-tabs { flex: 1 1 auto; }
  .ac-tab { padding: 8px 11px; letter-spacing: 0.14em; }
  .ac-random { padding: 9px 12px; letter-spacing: 0.12em; }

  .ac-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .ac-card { border-radius: 18px; }
  .ac-card__inner { gap: 8px; padding: 14px 12px 12px; border-radius: 17px; }
  .ac-card__top { font-size: 9px; letter-spacing: 0.14em; }
  .ac-card__idx { display: none; }
  .ac-card__chip { padding: 2px 6px; }

  .ac-card__icon {
    width: 60px;
    height: 60px;
    margin: 4px 0 2px 4px;
    border-radius: 15px;
  }

  .ac-card__icon::after { inset: -5px; border-radius: 19px; }
  .ac-card__emoji { font-size: 32px; }
  .ac-card__icon--lock svg { width: 32px; height: 32px; }
  .ac-card__title { font-size: 13.5px; letter-spacing: 0.04em; }

  .ac-card__tag {
    display: -webkit-box;
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .ac-card__ctrl { display: none; }
  .ac-card__hint { padding: 8px; font-size: 10.5px; }

  .ac-card__foot {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px;
  }

  .ac-card__play { justify-content: center; padding: 8px 10px; }

  .ac-card__stamp {
    top: 52px;
    right: 8px;
    padding: 3px 6px;
    font-size: 9.5px;
    letter-spacing: 0.18em;
  }
}

@media (max-width: 339px) {
  .ac-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (hover: none) {
  .ac-card:hover { translate: none; }
  .ac-card:active { translate: 0 2px; }
}

/* ============================================================ KEYFRAMES */
@keyframes ac-cell-in {
  from { opacity: 0; transform: translateY(26px) scale(0.96); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes ac-spin {
  to { transform: rotate(360deg); }
}

@keyframes ac-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.28; }
}

@keyframes ac-blink-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes ac-new-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 194, 61, 0.5); }
  50% { box-shadow: 0 0 18px rgba(255, 194, 61, 0.95); }
}

@keyframes ac-lock-flicker {
  0%, 18%, 22%, 62%, 64%, 100% { opacity: 1; }
  20%, 63% { opacity: 0.35; }
}

@keyframes ac-glitch-a {
  0%, 100% { transform: translate(0, 0); clip-path: inset(0 0 55% 0); }
  8% { transform: translate(-3px, -1px); clip-path: inset(10% 0 60% 0); }
  9% { transform: translate(2px, 0); clip-path: inset(40% 0 30% 0); }
  10% { transform: translate(0, 0); clip-path: inset(0 0 55% 0); }
  57% { transform: translate(3px, 1px); clip-path: inset(65% 0 5% 0); }
  58% { transform: translate(0, 0); clip-path: inset(0 0 55% 0); }
}

@keyframes ac-glitch-b {
  0%, 100% { transform: translate(0, 0); clip-path: inset(55% 0 0 0); }
  31% { transform: translate(3px, 1px); clip-path: inset(20% 0 50% 0); }
  32% { transform: translate(-2px, 0); clip-path: inset(70% 0 0 0); }
  33% { transform: translate(0, 0); clip-path: inset(55% 0 0 0); }
  81% { transform: translate(-3px, 0); clip-path: inset(5% 0 75% 0); }
  82% { transform: translate(0, 0); clip-path: inset(55% 0 0 0); }
}

@keyframes ac-deny {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

@keyframes ac-stamp-flash {
  0% { transform: rotate(-11deg) scale(1); opacity: 0.85; }
  30% { transform: rotate(-8deg) scale(1.25); opacity: 1; box-shadow: inset 0 0 14px rgba(255, 56, 96, 0.5), 0 0 26px rgba(255, 56, 96, 0.7); }
  100% { transform: rotate(-11deg) scale(1); opacity: 0.85; }
}

@keyframes ac-unlock {
  0% { clip-path: inset(48% 0 48% 0); transform: scale(1.04); filter: brightness(3) saturate(0); }
  12% { clip-path: inset(8% 0 62% 0); transform: translateX(-8px) skewX(10deg); filter: brightness(2.3) hue-rotate(90deg); }
  22% { clip-path: inset(42% 0 18% 0); transform: translateX(6px) skewX(-8deg); filter: brightness(2) hue-rotate(-70deg); }
  32% { clip-path: inset(0 0 70% 0); transform: translateX(-4px); }
  44% { clip-path: inset(0); transform: none; filter: brightness(1.8); }
  62% { filter: brightness(1.35); }
  100% { clip-path: inset(0); transform: none; filter: none; }
}

@keyframes ac-sweep {
  from { transform: translateY(-100%); opacity: 1; }
  to { transform: translateY(100%); opacity: 0; }
}

@keyframes ac-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ac-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes ac-panel-in {
  from { opacity: 0; transform: scale(1.06); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes ac-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes ac-record-pop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes ac-title-glitch {
  0%, 100% { transform: none; }
  6% { transform: translate(-3px, 1px) skewX(-6deg); }
  7% { transform: translate(2px, -1px) skewX(4deg); }
  8% { transform: none; }
  61% { transform: translate(3px, 0); }
  62% { transform: none; }
}

@keyframes ac-tap-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.08); }
}

@keyframes ac-roll {
  from { transform: translateY(-110%); }
  to { transform: translateY(560%); }
}

@keyframes ac-beam-on {
  0% { opacity: 1; transform: scaleX(0); }
  35% { opacity: 1; transform: scaleX(1); }
  60% { opacity: 0.7; transform: scaleX(1) scaleY(0.7); }
  100% { opacity: 0; transform: scaleX(1) scaleY(0.2); }
}

@keyframes ac-cab-on {
  0%, 32% { clip-path: inset(50% 0 50% 0); filter: brightness(2.6); }
  76% { clip-path: inset(0); filter: brightness(1.5); }
  100% { clip-path: inset(0); filter: none; }
}

@keyframes ac-cab-off {
  0% { clip-path: inset(0); filter: none; }
  45%, 100% { clip-path: inset(50% 0 50% 0); filter: brightness(3); }
}

@keyframes ac-beam-off {
  0%, 38% { opacity: 0; transform: scaleX(1); }
  46% { opacity: 1; transform: scaleX(1); }
  82% { opacity: 1; transform: scaleX(0.004) scaleY(1.8); }
  100% { opacity: 0; transform: scaleX(0.004) scaleY(1.8); }
}

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ac-card__ring,
  .ac__scan::after,
  .ac-pn__icon,
  .ac-card__icon--lock {
    animation: none !important;
  }

  .ac-card:hover { translate: none; }
}

/* --------------------------------------- tiny CRT screens (container queries) */
@container (max-height: 260px) {
  .ac-pn__icon,
  .ac-pn__kicker {
    display: none;
  }
}

@container (max-height: 190px) {
  .ac-pn__sub,
  .ac-pn__hint,
  .ac-pn__controls {
    display: none;
  }
}
