/* ==========================================================================
 * GHZYLAB ARCADE — shared chrome (switcher overlay + hub page).
 *
 * Deliberately SELF-CONTAINED: Buggy Run and Potion Sort have different design
 * languages and different CSS variable names (--accent/--text vs --gold/--ink),
 * so this file defines its own --arc-* tokens instead of borrowing either. That
 * way the switcher looks identical in both games and cannot break when one
 * game's palette changes.
 *
 * Every colour has one definition per theme block; nothing is defined only
 * inside a media query.
 * ====================================================================== */

:root {
  --arc-bg: #0a0f1c;
  --arc-panel: #141b2d;
  --arc-line: rgba(255, 255, 255, 0.14);
  --arc-ink: #eef4ff;
  --arc-dim: #8e9bbd;
  --arc-gold: #ffc244;
  --arc-scrim: rgba(6, 9, 18, 0.78);
  --arc-cell: rgba(255, 255, 255, 0.06);
  --arc-cell-hi: rgba(255, 255, 255, 0.13);
  --arc-sat: env(safe-area-inset-top, 0px);
  --arc-sab: env(safe-area-inset-bottom, 0px);
}

html[data-theme="light"] {
  --arc-bg: #eef1f9;
  --arc-panel: #ffffff;
  --arc-line: rgba(28, 34, 64, 0.14);
  --arc-ink: #1b2140;
  --arc-dim: #5a6285;
  --arc-gold: #b8730a;
  --arc-scrim: rgba(190, 199, 224, 0.76);
  --arc-cell: rgba(28, 34, 64, 0.05);
  --arc-cell-hi: rgba(28, 34, 64, 0.11);
}

/* -------------------------------------------------------- switcher overlay */

.arc-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: var(--arc-scrim);
  backdrop-filter: blur(10px);
  z-index: 900;          /* above every in-game overlay */
  pointer-events: auto;
}
.arc-overlay.visible { display: flex; animation: arcFade .2s ease; }
@keyframes arcFade { from { opacity: 0 } to { opacity: 1 } }

.arc-panel {
  width: min(420px, 100%);
  padding: 18px 18px 14px;
  border: 1px solid var(--arc-line);
  border-radius: 20px;
  background: var(--arc-panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .38);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  animation: arcRise .26s cubic-bezier(.34, 1.4, .64, 1);
}
@keyframes arcRise {
  from { transform: translateY(12px) scale(.97); opacity: 0 }
  to { transform: none; opacity: 1 }
}

.arc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.arc-eyebrow {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .26em;
  color: var(--arc-dim);
}
.arc-close {
  width: 28px; height: 28px;
  border: 1px solid var(--arc-line);
  border-radius: 9px;
  background: var(--arc-cell);
  color: var(--arc-ink);
  font-family: inherit;
  font-size: .74rem;
  cursor: pointer;
  transition: background .14s, transform .14s;
}
.arc-close:hover { background: var(--arc-cell-hi); }
.arc-close:active { transform: scale(.92); }

.arc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 9px;
}

.arc-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 13px 13px 11px;
  border: 1px solid var(--arc-line);
  border-radius: 15px;
  background: var(--arc-cell);
  color: var(--arc-ink);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .15s, border-color .15s;
}
a.arc-cell:hover {
  background: var(--arc-cell-hi);
  border-color: var(--arc-gold);
  transform: translateY(-2px);
}
a.arc-cell:active { transform: translateY(0) scale(.99); }

/* The game you are already in: shown as context, never as a link. */
.arc-cell.current {
  cursor: default;
  border-color: var(--arc-gold);
  background: var(--arc-cell-hi);
}
.arc-cell.current .arc-stat { color: var(--arc-gold); }

.arc-emoji { font-size: 1.5rem; line-height: 1; }
.arc-name { font-size: .88rem; font-weight: 700; letter-spacing: .01em; }
.arc-stat {
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--arc-dim);
  font-variant-numeric: tabular-nums;
}

.arc-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--arc-line);
}
.arc-link {
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--arc-dim);
  font-family: inherit;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  transition: color .14s, background .14s;
}
.arc-link:hover { color: var(--arc-ink); background: var(--arc-cell); }

@media (max-width: 380px) {
  .arc-grid { grid-template-columns: 1fr; }
  .arc-cell { flex-direction: row; align-items: center; gap: 10px; padding: 11px 12px; }
  .arc-cell .arc-name { flex: 1; }
  .arc-emoji { font-size: 1.2rem; }
}

/* Landscape phones: the switcher must not exceed the viewport. */
@media (max-height: 420px) {
  .arc-panel { padding: 12px 14px 10px; }
  .arc-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .arc-cell { padding: 9px 11px; }
  .arc-emoji { font-size: 1.1rem; }
  .arc-foot { margin-top: 9px; padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .arc-overlay.visible, .arc-panel { animation: none; }
  a.arc-cell:hover { transform: none; }
}
