/* ==========================================================================
   Fake Arcade — portal styles
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --surface: #f7f7f5;
  --surface-hover: #f0f0ed;
  --border: #e3e3df;
  --border-strong: #d2d2cc;
  --text: #121212;
  --text-muted: #6b6b66;
  --text-faint: #9a9a94;
  --accent: #121212;

  --radius-card: 16px;
  --radius-icon: 14px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(18, 18, 18, 0.04);
  --shadow-card-hover: 0 6px 20px rgba(18, 18, 18, 0.10);

  --maxw: 1080px;
  --font: "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Arial, sans-serif;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --bg-elevated: #1a1a1a;
    --surface: #1c1c1c;
    --surface-hover: #242424;
    --border: #2e2e2e;
    --border-strong: #3d3d3d;
    --text: #f2f2f0;
    --text-muted: #a0a09a;
    --text-faint: #6f6f6a;
    --accent: #f2f2f0;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 6px 24px rgba(0, 0, 0, 0.55);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo .logo-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 800;
  align-self: center;
  transform: translateY(-1px);
}

.logo .logo-fake {
  font-weight: 400;
  color: var(--text-muted);
}

.header-link {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s var(--ease);
}

.header-link:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 56px 0 8px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.hero p {
  margin: 0 auto;
  max-width: 46ch;
  color: var(--text-muted);
  font-size: 16px;
}

/* --------------------------------------------------------------------------
   Game grid
   -------------------------------------------------------------------------- */

.games {
  padding: 40px 0 72px;
}

.section-label {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.card:active {
  transform: translateY(0);
}

.card-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-icon);
  background: var(--accent-color, var(--border));
  overflow: hidden;
  color: #121212;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.card-icon img,
.card-icon svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  min-width: 0;
}

.card-name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.card-subtitle {
  margin: 3px 0 0;
  font-size: 14px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Whole card is clickable, but the name stays the accessible link target. */
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* Badges ------------------------------------------------------------------ */

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 2px;
  background: var(--border);
  color: var(--text-muted);
}

.badge--new {
  background: var(--text);
  color: var(--bg);
}

/* Coming-soon cards are inert --------------------------------------------- */

.card--soon {
  opacity: 0.62;
  cursor: default;
}

.card--soon:hover {
  transform: none;
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

/* Empty / error states ---------------------------------------------------- */

.state {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-card);
}

.state code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 5px;
}

/* Skeletons --------------------------------------------------------------- */

.card--skeleton {
  pointer-events: none;
}

.skeleton-box {
  background: var(--border);
  border-radius: 6px;
  animation: pulse 1.4s ease-in-out infinite;
}

.card--skeleton .card-icon {
  background: var(--border);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-faint);
}

.site-footer a:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Play page
   -------------------------------------------------------------------------- */

body.play {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-elevated);
}

.play-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 54px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}

.play-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 9px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.play-back:hover {
  background: var(--surface);
  color: var(--text);
}

.play-title {
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-title span {
  font-weight: 400;
  color: var(--text-faint);
}

.play-actions {
  margin-left: auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.icon-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.play-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: #000;
}

.play-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* --------------------------------------------------------------------------
   Motion / responsive
   -------------------------------------------------------------------------- */

@media (max-width: 560px) {
  .hero {
    padding: 36px 0 4px;
  }

  .games {
    padding: 28px 0 48px;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
