:root {
  --blue: #001f70;
  --blue-2: #0039b5;
  --navy: #050a24;
  --navy-2: #090f34;
  --gold: #f6c453;
  --gold-dark: #b77a18;
  --cream: #fff7d6;
  --white: #ffffff;
  --cyan: #4ee7ff;
  --pink: #ff4fd8;
  --green: #76ff7a;
  --red: #ff5a5a;
  --shadow: rgba(0, 0, 0, 0.42);
  --pixel-border: 4px solid var(--gold);
  --font-pixel: "Press Start 2P", system-ui, sans-serif;
  --font-body: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 20% 20%, rgba(78, 231, 255, 0.15), transparent 24rem),
    radial-gradient(circle at 80% 0%, rgba(255, 79, 216, 0.12), transparent 20rem),
    linear-gradient(135deg, var(--navy) 0%, var(--blue) 48%, #020514 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, transparent, black 16%, black 78%, transparent);
  z-index: -2;
}

.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 5px
  );
  opacity: 0.28;
  z-index: 20;
  mix-blend-mode: overlay;
}

.pixel-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(246,196,83,0.15) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.14;
  z-index: -1;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(5, 10, 36, 0.84);
  backdrop-filter: blur(12px);
  border-bottom: 3px solid rgba(246, 196, 83, 0.8);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  flex: 0 1 auto;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: clamp(180px, 26vw, 360px);
  height: auto;
  max-height: 68px;
  object-fit: contain;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--navy);
  font-family: var(--font-pixel);
  font-size: 1rem;
  background: var(--gold);
  border: 3px solid var(--cream);
  box-shadow: 5px 5px 0 var(--shadow);
}

.brand-text, .main-nav, .pixel-button, .eyebrow, .press-start, .small-label {
  font-family: var(--font-pixel);
}

.brand-text {
  font-size: clamp(0.8rem, 2vw, 1rem);
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.65rem;
}

.main-nav a {
  color: var(--cream);
  transition: color 150ms ease, transform 150ms ease;
}

.main-nav a:hover, .main-nav a:focus-visible {
  color: var(--gold);
  transform: translateY(-2px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 0;
}

.nav-toggle span {
  width: 30px;
  height: 4px;
  background: var(--gold);
}

.section-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.hero {
  min-height: 78vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 {
  text-wrap: balance;
}

h1 {
  margin-bottom: 1.25rem;
  font-family: var(--font-pixel);
  font-size: clamp(2rem, 7vw, 4.8rem);
  line-height: 1.16;
  text-transform: uppercase;
  text-shadow: 6px 6px 0 rgba(0, 0, 0, 0.32);
}

h2 {
  margin-bottom: 0.75rem;
  font-family: var(--font-pixel);
  font-size: clamp(1.35rem, 4vw, 2.5rem);
  line-height: 1.25;
}

h3 {
  font-family: var(--font-pixel);
  font-size: 1rem;
  line-height: 1.5;
}

.hero-subtitle, .helper-text, .about-card p {
  color: rgba(255, 247, 214, 0.88);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.pixel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.9rem 1rem;
  border: 4px solid var(--cream);
  box-shadow: 6px 6px 0 var(--shadow);
  font-size: 0.68rem;
  line-height: 1.3;
  text-transform: uppercase;
  cursor: pointer;
  transform: translate(0, 0);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.pixel-button:hover, .pixel-button:focus-visible {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--shadow);
  filter: brightness(1.08);
}

.pixel-button.primary {
  color: var(--navy);
  background: var(--gold);
}

.pixel-button.secondary {
  color: var(--cream);
  background: var(--blue-2);
}

.arcade-screen {
  border: var(--pixel-border);
  background: #070d28;
  box-shadow: 14px 14px 0 rgba(0,0,0,0.35), inset 0 0 60px rgba(78, 231, 255, 0.08);
}

.screen-topbar {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem;
  background: var(--gold);
  border-bottom: 4px solid var(--cream);
}

.screen-topbar span {
  width: 16px;
  height: 16px;
  background: var(--navy);
  border: 2px solid var(--cream);
}

.screen-content {
  padding: clamp(1.25rem, 4vw, 2.2rem);
}

.small-label {
  margin-bottom: 1rem;
  color: var(--green);
  font-size: 0.62rem;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 2px dashed rgba(255, 247, 214, 0.2);
  font-weight: 800;
}

.status-row span { color: rgba(255, 247, 214, 0.78); }
.status-row strong { color: var(--gold); }

.press-start {
  margin: 2rem 0 0;
  color: var(--cyan);
  font-size: 0.8rem;
  text-align: center;
  animation: blink 1.1s steps(2, start) infinite;
}

.blink { animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.section-heading {
  margin-bottom: 1.6rem;
}

.split-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}

.split-heading .helper-text {
  max-width: 420px;
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.featured-game {
  border: var(--pixel-border);
  background:
    linear-gradient(135deg, rgba(246,196,83,0.18), rgba(78,231,255,0.08)),
    rgba(5, 10, 36, 0.9);
  box-shadow: 10px 10px 0 var(--shadow);
  overflow: hidden;
}

.featured-inner {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 0;
}

.featured-art {
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.06) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.06) 75%, transparent 75%, transparent);
  background-size: 34px 34px;
  border-right: 4px solid var(--gold);
}

.featured-image {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 4px solid var(--cream);
  box-shadow: 10px 10px 0 rgba(0,0,0,0.3);
  border-radius: 12px;
}

.pixel-illustration {
  display: grid;
  place-items: center;
  width: min(260px, 70vw);
  aspect-ratio: 1;
  color: var(--navy);
  background: var(--gold);
  border: 6px solid var(--cream);
  box-shadow: 10px 10px 0 rgba(0,0,0,0.3);
  font-family: var(--font-pixel);
  font-size: clamp(4rem, 14vw, 7rem);
}

.featured-copy {
  padding: clamp(1.5rem, 5vw, 3rem);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pixel-badge {
  display: inline-flex;
  padding: 0.45rem 0.55rem;
  color: var(--navy);
  background: var(--gold);
  border: 3px solid var(--cream);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  text-transform: uppercase;
}

.pixel-badge.alt { background: var(--cyan); }
.pixel-badge.hot { background: var(--pink); color: var(--white); }
.pixel-badge.green { background: var(--green); color: var(--navy); }
.pixel-badge.soon { background: rgba(255,255,255,0.16); color: var(--cream); }

.featured-copy p, .game-card p, .soon-card p {
  color: rgba(255, 247, 214, 0.87);
  line-height: 1.65;
}

.game-grid, .coming-soon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.game-card, .soon-card, .leaderboard-card, .achievement-panel, .about-card {
  border: var(--pixel-border);
  background: rgba(5, 10, 36, 0.9);
  box-shadow: 8px 8px 0 var(--shadow);
}

.game-card {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.game-card:hover, .game-card:focus-within, .game-card.is-open {
  transform: translateY(-6px);
  box-shadow: 8px 14px 0 rgba(0,0,0,0.34);
  border-color: var(--cyan);
}

.card-art {
  min-height: 185px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.05) 50%, transparent 50%),
    linear-gradient(rgba(255,255,255,0.05) 50%, transparent 50%),
    var(--blue-2);
  background-size: 24px 24px;
  border-bottom: 4px solid var(--gold);
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  min-height: 185px;
  object-fit: cover;
  display: block;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 94px;
  height: 94px;
  color: var(--navy);
  background: var(--gold);
  border: 5px solid var(--cream);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.28);
  font-family: var(--font-pixel);
  font-size: 2.5rem;
}

.card-body {
  padding: 1.25rem;
}

.game-card h3, .soon-card h3 {
  margin-bottom: 0.9rem;
}

.meta-list {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0 1.2rem;
  padding: 0;
  list-style: none;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed rgba(255,255,255,0.18);
}

.meta-list span:first-child {
  color: rgba(255, 247, 214, 0.7);
}

.card-overlay {
  position: absolute;
  inset: auto 0 0;
  min-height: 62%;
  padding: 1.25rem;
  background: rgba(0, 31, 112, 0.98);
  border-top: 4px solid var(--cyan);
  transform: translateY(101%);
  transition: transform 180ms ease;
}

.game-card:hover .card-overlay,
.game-card:focus-within .card-overlay,
.game-card.is-open .card-overlay {
  transform: translateY(0);
}

.card-overlay h4 {
  margin: 0 0 0.9rem;
  font-family: var(--font-pixel);
  color: var(--gold);
  font-size: 0.78rem;
  line-height: 1.5;
}

.card-overlay ul {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 1.2rem;
  padding-left: 1.1rem;
  color: rgba(255,247,214,0.88);
}

.play-link {
  width: 100%;
}

.hall-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
}

.leaderboard-card, .achievement-panel, .about-card {
  padding: clamp(1.25rem, 4vw, 2rem);
}

.leaderboard-header {
  display: grid;
  grid-template-columns: 0.5fr 1.3fr 1fr;
  padding: 0.8rem;
  color: var(--navy);
  background: var(--gold);
  border: 3px solid var(--cream);
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.leaderboard-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: ranking;
}

.leaderboard-list li {
  counter-increment: ranking;
  display: grid;
  grid-template-columns: 0.5fr 1.3fr 1fr;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(246,196,83,0.35);
}

.leaderboard-list li::before {
  content: counter(ranking);
  color: var(--gold);
  font-family: var(--font-pixel);
}

.player-name {
  font-weight: 900;
}

.player-score {
  color: var(--cyan);
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  text-align: right;
}

.achievement-list {
  display: grid;
  gap: 0.9rem;
}

.achievement-item {
  padding: 1rem;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(78,231,255,0.38);
}

.achievement-item strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--gold);
}

.soon-card {
  padding: 1.4rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)), rgba(5, 10, 36, 0.88);
}

.soon-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.about-card {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.tiny-note {
  margin-top: 1.5rem;
  color: rgba(255,247,214,0.65) !important;
  font-size: 0.95rem !important;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  border-top: 3px solid rgba(246,196,83,0.8);
  background: rgba(5, 10, 36, 0.86);
  color: rgba(255,247,214,0.76);
}

.site-footer p { margin: 0; }
.site-footer a { color: var(--gold); font-weight: 900; }

@media (max-width: 900px) {
  .hero, .featured-inner, .hall-layout {
    grid-template-columns: 1fr;
  }

  .featured-art {
    border-right: 0;
    border-bottom: 4px solid var(--gold);
  }

  .game-grid, .coming-soon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-heading {
    align-items: start;
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }

  .main-nav {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: rgba(5, 10, 36, 0.98);
    border-bottom: 3px solid var(--gold);
  }

  .main-nav.is-open { display: flex; }

  .main-nav a {
    padding: 1rem;
    border: 2px solid rgba(246,196,83,0.35);
  }

  .game-grid, .coming-soon-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 4rem;
  }

  .hero-actions, .site-footer {
    flex-direction: column;
  }

  .leaderboard-header, .leaderboard-list li {
    grid-template-columns: 0.35fr 1fr 0.85fr;
    font-size: 0.52rem;
  }

  .brand-text { display: none; }

  .brand-logo {
    width: min(62vw, 240px);
    max-height: 52px;
  }
}


/* Tweaks for arcade launcher v2 */
.first-section {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
}

.compact-hero {
  min-height: auto;
  padding-top: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
}

.compact-hero h1,
.hall-hero h1 {
  font-size: clamp(1.65rem, 4.2vw, 3rem);
  line-height: 1.25;
}

.hall-hero {
  padding-top: clamp(3rem, 7vw, 5rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
  text-align: center;
}

.hall-hero .hero-actions {
  justify-content: center;
}

.screen-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.cabinet-controls {
  display: inline-flex;
  gap: 0.4rem;
}

.cabinet-controls button,
.cabinet-dots button {
  color: var(--navy);
  background: var(--gold);
  border: 3px solid var(--cream);
  font-family: var(--font-pixel);
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
}

.cabinet-controls button {
  width: 36px;
  height: 34px;
  line-height: 1;
  font-size: 1.1rem;
}

.cabinet-controls button:hover,
.cabinet-controls button:focus-visible,
.cabinet-dots button:hover,
.cabinet-dots button:focus-visible,
.cabinet-dots button.is-active {
  background: var(--cyan);
}

.cabinet-tagline {
  margin-bottom: 1rem;
  color: rgba(255, 247, 214, 0.82);
  line-height: 1.5;
}

.cabinet-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.cabinet-dots button {
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 0;
}

.heading-actions {
  display: grid;
  justify-items: end;
  gap: 0.75rem;
}

.small-button {
  min-height: 42px;
  padding: 0.65rem 0.75rem;
  font-size: 0.55rem;
}

.home-hall-grid,
.hall-overview-grid,
.game-hall-grid,
.full-achievement-grid {
  display: grid;
  gap: 1.25rem;
}

.home-hall-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-hall-card,
.record-card,
.game-hall-card,
.full-achievement-card {
  border: var(--pixel-border);
  background: rgba(5, 10, 36, 0.9);
  box-shadow: 8px 8px 0 var(--shadow);
}

.home-hall-card,
.record-card,
.game-hall-card {
  padding: clamp(1.2rem, 3vw, 1.75rem);
}

.home-hall-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.home-hall-title .eyebrow {
  margin-bottom: 0.45rem;
}

.card-icon.mini {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  font-size: 1.25rem;
  border-width: 4px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.28);
}

.compact-list li {
  grid-template-columns: 0.35fr 1.15fr 0.9fr;
}

.player-name small {
  display: block;
  margin-top: 0.25rem;
  color: rgba(255, 247, 214, 0.62);
  font-size: 0.75rem;
  font-weight: 700;
}

.hall-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.record-card p:last-child,
.game-hall-card p,
.full-achievement-card span {
  color: rgba(255, 247, 214, 0.82);
  line-height: 1.55;
}

.record-card h3 {
  color: var(--cyan);
}

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

.stat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 1.25rem;
}

.stat-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(78,231,255,0.38);
}

.stat-item span {
  color: rgba(255, 247, 214, 0.72);
  font-weight: 800;
}

.stat-item strong {
  color: var(--gold);
}

.nested-board {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.full-achievement-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-achievement-card em {
  display: block;
  margin-top: 0.8rem;
  color: var(--cyan);
  font-style: normal;
  font-weight: 900;
}

@media (max-width: 900px) {
  .home-hall-grid,
  .hall-overview-grid,
  .full-achievement-grid,
  .stat-list {
    grid-template-columns: 1fr;
  }

  .heading-actions {
    justify-items: start;
  }
}

@media (max-width: 700px) {
  .compact-hero h1,
  .hall-hero h1 {
    font-size: clamp(1.35rem, 8vw, 2.15rem);
  }

  .home-hall-title {
    align-items: start;
  }
}

/* Student Created Games */
.student-games-block {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: clamp(2rem, 5vw, 3rem);
  border-top: 4px dashed rgba(246, 196, 83, 0.55);
}

.student-heading {
  margin-bottom: 1.25rem;
}

.student-game-grid {
  grid-template-columns: minmax(0, 1fr);
}

.student-game-grid .game-card {
  max-width: 760px;
}

.student-game-grid .card-art {
  min-height: 260px;
}

.student-game-grid .card-image {
  min-height: 260px;
}

@media (max-width: 900px) {
  .student-game-grid .game-card {
    max-width: none;
  }
}

@media (max-width: 700px) {
  .student-game-grid .card-art,
  .student-game-grid .card-image {
    min-height: 200px;
  }
}
