@font-face {
  font-family: "Jersey";
  src: url("assets/Jersey25-Regular.ttf");
  font-weight: normal;
  font-style: normal;
}

:root {
  --acid: #e9ff48;
  --deep: #002626;
  --teal: #0e4749;
  --orange: #e55812;
  --soft: #e3d8f1;

  --bg: #000000;
  --panel: rgba(0, 38, 38, 0.78);
  --panel-light: rgba(227, 216, 241, 0.08);
  --border-acid: rgba(233, 255, 72, 0.16);
  --text: #f7f2ff;
  --text-muted: rgba(247, 242, 255, 0.72);

  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 32px;

  --topbar-height: 48px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 0%, rgba(233, 255, 72, 0.12), transparent 32%),
    radial-gradient(circle at 90% 20%, rgba(229, 88, 18, 0.16), transparent 34%),
    linear-gradient(135deg, var(--bg), var(--bg));
    /* background-color: var(--bg); */
  color: var(--text);
  font-family: "Jersey", Arial, sans-serif;
}

body.game-page {
  height: 100%;
  overflow: hidden;
}

/* Loading */

#p5_loading {
  position: fixed;
  inset: 0;
  z-index: -1;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--acid);
  font-size: 48px;
  text-align: center;
}

/* Topbar */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-height);
  z-index: 1000;

  background: rgba(0, 20, 20, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-acid);
}

.menu {
  width: min(1400px, calc(100% - 24px));
  height: 100%;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo,
.topbar p {
  margin: 0;
  font-size: 30px;
  color: var(--acid);
  text-decoration: none;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar a {
  color: var(--acid);
  font-size: 20px;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.topbar a:hover {
  opacity: 1;
  color: var(--soft);
}

/* Game Area */

#game-area {
  position: fixed;
  inset: var(--topbar-height) 20px 48px 20px;

  width: min(69%, calc(100% - 40px));
  height: calc(100% - 96px);
  aspect-ratio: 4 / 3;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-acid);
  background: rgba(0, 0, 0, 0.45);
}

/* #game-container {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #000;
  color: #777;
} 
#game-container canvas {
  display: block;
}
  */
  /* #game-container::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 8;

  background:
    radial-gradient(
      ellipse at center,
      rgba(255,255,255,0.5),
      transparent 100%
    );

  mix-blend-mode:color-dodge;
} */

#game-container {
   width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #000;
  color: #777;
}
#game-container canvas {
  display: block;
  width: 100%;
  height: 100%;

  /* Lite extra retro-look */
  filter:
    contrast(1.15)
    saturate(1.2)
    blur(0.1px);
}
.vhs-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 10;

  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.04) 0px,
      rgba(255, 255, 255, 0.04) 1px,
      rgba(0, 0, 0, 0.08) 2px,
      rgba(0, 0, 0, 0.08) 4px
    );

  mix-blend-mode: overlay;
  opacity: 0.2;

}

/* Mörkare hörn / CRT vignette */
#game-container::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 11;

  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

.grain-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 9;

  opacity: 0.1;
  mix-blend-mode: soft-light;

  background-image:
    radial-gradient(circle, rgba(0, 0, 0, 0.15) 1px, transparent 1px);

  background-size: 4px 4px;

  
}




/* Bottom Bar */

.bottombar {
  position: fixed;
  inset: auto 0 0 0;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.bottombar-content {
  width: min(1400px, calc(100% - 32px));

  display: flex;
  align-items: center;
  justify-content: space-between;

  color: var(--soft);
}

.bottombar-content img {
  height: 30px;
}

/* Generic Info Section */

.info-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 96px 32px;
}

.info-section h2 {
  font-size: 2rem;
  color: var(--acid);
}

/* Landing */

.trippy-landing {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0;
}

/* Hero */

.trippy-hero {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-radius: var(--radius-lg);

  background:
    linear-gradient(
      90deg,
      rgba(0, 38, 38, 0.96) 0%,
      rgba(0, 38, 38, 0.78) 38%,
      rgba(14, 71, 73, 0.25) 72%,
      rgba(229, 88, 18, 0.18) 100%
    ),
    url("TrippyRoadMixTapeArtWork2.webp");

  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-acid);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(233, 255, 72, 0.08);
}

.trippy-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background:
    radial-gradient(circle at 20% 20%, rgba(233, 255, 72, 0.18), transparent 28%),
    radial-gradient(circle at 85% 80%, rgba(229, 88, 18, 0.2), transparent 30%);
}

.trippy-hero-content {
  position: relative;
  z-index: 2;
  max-width: 660px;
  padding: 72px;
}

.trippy-kicker {
  margin: 0 0 16px;
  color: var(--soft);
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.trippy-hero h1 {
  margin: 0;
  color: var(--acid);
  font-size: clamp(3.5rem, 9vw, 8rem);
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(233, 255, 72, 0.22);
}

.trippy-text {
  max-width: 460px;
  margin: 28px 0 36px;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.55;
}

/* Buttons */

.trippy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.trippy-btn {
  min-width: 140px;
  padding: 15px 24px;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;

  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    background 0.2s ease;
}

.trippy-btn:hover {
  transform: translateY(-2px);
}

.trippy-btn.primary {
  color: var(--deep);
  background: var(--acid);
  box-shadow: 0 0 28px rgba(233, 255, 72, 0.22);
}

.trippy-btn.secondary {
  color: var(--soft);
  border: 1px solid rgba(227, 216, 241, 0.28);
  background: rgba(227, 216, 241, 0.08);
  backdrop-filter: blur(14px);
}

.trippy-btn.secondary:hover {
  background: rgba(227, 216, 241, 0.14);
}

/* Cards */

.trippy-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.trippy-card {
  padding: 24px;
  border-radius: var(--radius-md);

  color: var(--text);
  text-decoration: none;

  background: var(--panel-light);
  border: 1px solid rgba(227, 216, 241, 0.12);
  backdrop-filter: blur(16px);

  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.trippy-card:hover {
  transform: translateY(-4px);
  background: rgba(233, 255, 72, 0.08);
  border-color: var(--border-acid);
}

.trippy-card span {
  display: block;
  margin-bottom: 8px;

  color: var(--acid);
  font-size: 1.15rem;
  font-weight: 800;
}

.trippy-card small {
  color: var(--text-muted);
  line-height: 1.5;
}

/* Leaderboard */

.leaderboard-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 96px 32px;
}

.leaderboard-header h2 {
  margin: 0;
  color: var(--acid);
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.leaderboard-text {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.5;
}

.leaderboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 20px;
}

.leaderboard-tab {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-acid);

  color: var(--acid);
  background: rgba(0, 38, 38, 0.8);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.leaderboard-tab.active,
.leaderboard-tab:hover {
  color: var(--deep);
  background: var(--acid);
}

.leaderboard-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-acid);
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 60px 1fr 130px 130px 130px;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(233, 255, 72, 0.08);
}

.leaderboard-row-head {
  color: var(--acid);
  background: rgba(233, 255, 72, 0.06);
}

.leaderboard-loading {
  padding: 24px 20px;
  color: var(--text-muted);
}

/* Mobile */

@media (max-width: 800px) {
  .topbar nav {
    gap: 14px;
  }

  .topbar a {
    font-size: 17px;
  }

  .logo,
  .topbar p {
    font-size: 25px;
  }

  #game-area {
    display: none;
  }

  .trippy-landing {
    width: min(100% - 24px, 1200px);
    padding: 72px 0;
  }

  .trippy-hero {
    min-height: 560px;
    background-position: center;
  }

  .trippy-hero-content {
    padding: 42px 28px;
  }

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

  .leaderboard-row {
    grid-template-columns: 44px 1fr 90px;
  }

  .leaderboard-row span:nth-child(4),
  .leaderboard-row span:nth-child(5) {
    display: none;
  }
}