html,
body {
  font-family: "Nunito", "Outfit", system-ui, sans-serif;
  margin: 0;
  position: relative;
  z-index: 1;
  scroll-behavior: smooth;
  color: rgb(var(--text-body));
  background: rgb(var(--bg-body));
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

footer {
  margin-top: auto !important;
  position: static;
}

.back-to-top {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.back-to-top.back-to-top-active {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-5px);
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .back-to-top:hover {
    transition: none;
    transform: none;
  }
}

body::-webkit-scrollbar {
  display: none;
}

#copy-message {
  position: fixed;
  z-index: 999;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: none;
  width: auto;
  min-width: 96px;
  height: auto;
  padding: 9px 18px;
  background: rgb(var(--bg-elevated) / 0.95);
  border: 1px solid rgb(var(--border-strong) / 0.8);
  color: rgb(var(--text-title));
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgb(var(--bg-overlay) / 0.45);
  backdrop-filter: blur(8px);
  pointer-events: none;
  animation: copy-toast-in 0.25s ease-out;
}

#copy-message::before {
  content: "✓";
  color: rgb(var(--success));
  font-weight: 700;
  margin-right: 6px;
}

@keyframes copy-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #copy-message {
    animation: none;
  }
}

::-webkit-scrollbar {
  background: var(--bg-scroll);
  border-radius: 9999px;
  height: 6px;
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgb(var(--theme-primary));
  border-radius: 9999px;
}

#play-game:not(.is-playing) .play-cover {
  z-index: 10;
}

#play-game:not(.is-playing) #gameIframe {
  z-index: 0;
  visibility: hidden;
  pointer-events: none;
}

#play-game.is-playing .top__shading,
#play-game.is-playing .play-cover {
  display: none;
}

#play-game.is-playing #gameIframe {
  z-index: 1;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  touch-action: manipulation;
}

#play-player:fullscreen,
#play-player:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  background: rgb(var(--bg-body));
}

#play-player:fullscreen #play-game,
#play-player:-webkit-full-screen #play-game {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
}

#play-player:fullscreen .play-bar,
#play-player:-webkit-full-screen .play-bar {
  flex-shrink: 0;
  width: 100%;
}

.pt {
  padding: 20px;
}

.pt h1 {
  line-height: 1.5 !important;
  font-size: 22px !important;
  padding: 0 0 10px 0;
  margin: 0 0 10px 0;
  font-weight: 800;
}

.pt h2 {
  position: relative;
  padding-left: 16px;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
}

.pt h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 10px;
  width: 4px;
  background: rgb(var(--theme-primary));
  border-radius: 2px;
}

.pt h3,
.pt h4 {
  line-height: 1.5 !important;
  font-size: 16px !important;
  padding: 0 0 10px 0;
  margin: 0 0 10px 0;
}

.pt p,
.pt li {
  line-height: 1.5 !important;
  font-size: 14px !important;
  padding: 0 0 10px 0;
}

.pt p {
  margin: 0 0 15px;
}

.pt img {
  width: 100%;
}

.pt a {
  word-break: break-all;
  color: rgb(var(--theme-accent));
}

.pt ul {
  padding-left: 20px
}

table {
  margin-bottom: 10px
}

table,
th,
td {
  border: 1px solid;
  border-collapse: collapse;
}

th,
td {
  padding: 8px;
  text-align: center;
}

/* ===== Arcade scoreboard header — light coral tint ===== */
.arc-header {
  /* position: sticky; */
  top: 0;
  z-index: 50;
  width: 100%;
  background: linear-gradient(180deg, rgb(var(--theme-primary-shade)) 0%, rgb(255 255 255) 100%);
  border-bottom: 2px solid rgb(var(--theme-primary) / 0.2);
  box-shadow: 0 8px 24px rgb(var(--bg-overlay) / 0.06), inset 0 1px 0 rgb(255 255 255 / 0.6);
  animation: arc-header-in 0.4s ease-out both;
}

/* ===== Arcade scoreboard footer — mirrors header palette ===== */
.arc-footer {
  background: linear-gradient(180deg, rgb(255 255 255) 0%, rgb(var(--theme-primary-shade)) 100%);
  border-top: 2px solid rgb(var(--theme-primary) / 0.2);
  box-shadow: 0 -8px 24px rgb(var(--bg-overlay) / 0.05), inset 0 1px 0 rgb(255 255 255 / 0.6);
}

@keyframes arc-header-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.arc-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 72rem;
  min-height: 4.5rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Brand lockup: tilted amber tile + wordmark */
.arc-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
  color: rgb(var(--text-title));
  text-decoration: none;
}

.arc-mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
  background: linear-gradient(145deg, rgb(var(--theme-cta)), rgb(var(--theme-cta-hover)));
  color: rgb(var(--theme-primary-shade));
  box-shadow: 0 0 0 3px rgb(var(--theme-primary) / 0.12);
  transform: rotate(-8deg);
  transition: transform 0.25s cubic-bezier(0.22, 0.68, 0.32, 1);
}

.arc-brand:hover .arc-mark {
  transform: rotate(0deg) scale(1.06);
}

.arc-brand:focus-visible {
  outline: 2px solid rgb(var(--theme-cta));
  outline-offset: 4px;
}

.arc-mark-svg {
  width: 1.15rem;
  height: 1.15rem;
}

.arc-brand-name {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
}

/* Numbered category rail */
.arc-nav {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.arc-nav::-webkit-scrollbar {
  display: none;
}

.arc-nav-track {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  width: max-content;
  margin: 0 auto;
  padding: 0.25rem 0;
}

.arc-nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: rgb(var(--text-title) / 0.68);
  font-size: 0.8125rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.arc-nav-item:hover {
  color: rgb(var(--text-title));
  background-color: rgb(var(--theme-primary) / 0.08);
}

.arc-nav-item:focus-visible {
  outline: 2px solid rgb(var(--theme-cta));
  outline-offset: 2px;
}

.arc-nav-item.is-current {
  color: rgb(var(--text-title));
  background-color: rgb(255 255 255 / 0.85);
}

.arc-nav-num {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--theme-cta));
  opacity: 0.85;
}

.arc-nav-item::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.2rem;
  height: 2px;
  border-radius: 2px;
  background-color: rgb(var(--theme-cta));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s ease;
}

.arc-nav-item:hover::after,
.arc-nav-item.is-current::after {
  transform: scaleX(1);
}

/* Search: white inset pill with coral focus */
.arc-search {
  position: relative;
  flex: 0 1 14rem;
  min-width: 0;
}

.arc-search input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid rgb(var(--theme-primary) / 0.25);
  border-radius: 9999px;
  background-color: rgb(255 255 255 / 0.92);
  color: rgb(var(--text-title));
  padding: 0.5rem 0.9rem 0.5rem 2.15rem;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.arc-search input::placeholder {
  color: rgb(var(--text-muted) / 0.8);
}

.arc-search input:focus,
.arc-search input:focus-visible {
  border-color: rgb(var(--theme-primary));
  background-color: rgb(255 255 255);
  outline: none;
  box-shadow: 0 0 0 3px rgb(var(--theme-primary) / 0.15);
}

.arc-search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  color: rgb(var(--text-muted));
  transform: translateY(-50%);
  pointer-events: none;
}

/* Mobile: brand + search on top, numbered rail underneath */
@media (max-width: 900px) {
  .arc-header-inner {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    min-height: 0;
    padding: 0.6rem 1rem 0.35rem;
  }

  .arc-brand {
    order: 1;
    margin-right: auto;
  }

  .arc-brand-name {
    font-size: 1.05rem;
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .arc-mark {
    width: 2.1rem;
    height: 2.1rem;
  }

  .arc-search {
    order: 2;
    flex: 0 1 9.5rem;
  }

  .arc-search input {
    padding: 0.4rem 0.7rem 0.4rem 1.9rem;
    font-size: 0.75rem;
  }

  .arc-search-icon {
    left: 0.65rem;
    width: 0.9rem;
    height: 0.9rem;
  }

  .arc-nav {
    order: 3;
    flex: 1 0 100%;
  }

  .arc-nav-track {
    margin: 0;
    padding-bottom: 0.1rem;
  }

  .arc-nav-item {
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arc-header {
    animation: none;
  }

  .arc-mark,
  .arc-nav-item::after,
  .arc-fresh-dot {
    transition: none;
    animation: none;
  }
}

.arc-fresh-card {
  display: block;
  text-decoration: none;
  transition: transform 0.18s ease;
}

.arc-fresh-card:hover {
  transform: translateY(-3px);
}

.arc-fresh-card:focus-visible {
  outline: 2px solid rgb(var(--theme-cta));
  outline-offset: 4px;
  border-radius: 0.75rem;
}

.arc-fresh-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.5rem;
  background: rgb(var(--bg-overlay) / 0.72);
  color: rgb(var(--text-inverse));
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-family: "Outfit", system-ui, sans-serif;
  backdrop-filter: blur(4px);
}

.arc-fresh-dot {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background-color: rgb(var(--theme-cta));
  box-shadow: 0 0 0 0 rgb(var(--theme-cta) / 0.55);
  animation: arc-fresh-pulse 1.5s ease-out infinite;
}

@keyframes arc-fresh-pulse {
  0% {
    transform: scale(0.8);
    box-shadow: 0 0 0 0 rgb(var(--theme-cta) / 0.55);
    opacity: 0.9;
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgb(var(--theme-cta) / 0);
    opacity: 1;
  }

  100% {
    transform: scale(0.8);
    box-shadow: 0 0 0 0 rgb(var(--theme-cta) / 0);
    opacity: 0.85;
  }
}

/* Thin visible scrollbar for the fresh strip */
.arc-fresh-strip [style*="overflow-x"],
.arc-fresh-strip > div::-webkit-scrollbar {
  height: 6px;
}

.arc-fresh-strip > div::-webkit-scrollbar-track {
  background: rgb(255 255 255 / 0.05);
  border-radius: 9999px;
}

.arc-fresh-strip > div::-webkit-scrollbar-thumb {
  background: rgb(var(--theme-cta) / 0.55);
  border-radius: 9999px;
}

.arc-fresh-strip > div::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--theme-cta));
}

/* ===== Staff Picks arrow carousel ===== */
.staff-track {
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.staff-track::-webkit-scrollbar {
  display: none;
}

.staff-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  border: 2px solid rgb(var(--theme-primary));
  background-color: rgb(var(--bg-card));
  color: rgb(var(--theme-primary));
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 2px 8px rgb(var(--theme-primary) / 0.18);
}

.staff-arrow:hover {
  background-color: rgb(var(--theme-primary));
  color: rgb(var(--text-on-primary));
  border-color: rgb(var(--theme-primary));
  box-shadow: 0 4px 14px rgb(var(--theme-primary) / 0.32);
}

.staff-arrow:active {
  transform: scale(0.94);
}

.staff-arrow svg {
  width: 1rem;
  height: 1rem;
}

.staff-arrow:disabled,
.staff-arrow.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

@media (max-width: 639px) {
  .staff-arrow {
    width: 2rem;
    height: 2rem;
  }

  .staff-arrow svg {
    width: 0.875rem;
    height: 0.875rem;
  }
}
