/* ==========================================================================
   Nordic Arena Sports Lounge — Main Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables & Theme
   -------------------------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg-dark: #0a0e17;
  --bg-card: #111827;
  --bg-gaming: #0d1220;
  --bg-card-hover: #151d2e;

  /* Accent */
  --accent: #00d4ff;
  --accent-hover: #00a8cc;
  --accent-glow: rgba(0, 212, 255, 0.25);

  /* Text */
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-heading: #ffffff;

  /* Borders & UI */
  --border: #1f2937;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Layout */
  --container: 1200px;
  --section-padding: 4rem 1.5rem;
  --header-height: 60px;

  /* Typography */
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: 0.2s ease;
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .stars__layer--1,
  .stars__layer--2,
  .stars__layer--3,
  .block-hero::before,
  .block-hero::after {
    animation: none !important;
  }
}

/* Skip link - visible on focus for keyboard users */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 1000;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--text-heading);
  outline-offset: 2px;
}

/* Focus visible - keyboard accessibility */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   2b. Starfield background
   -------------------------------------------------------------------------- */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.stars__layer {
  position: absolute;
  inset: -50% 0;
  width: 200%;
  left: -50%;
}

.stars__layer--1 {
  background-image:
    radial-gradient(1px 1px at 40px 60px, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 120px 180px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 200px 90px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 280px 220px, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 350px 45px, rgba(220, 230, 255, 0.35), transparent);
  background-size: 400px 300px;
  background-repeat: repeat;
  animation: stars-twinkle 5s ease-in-out infinite;
}

.stars__layer--2 {
  background-image:
    radial-gradient(1.5px 1.5px at 80px 120px, rgba(255, 255, 255, 0.28), transparent),
    radial-gradient(1.5px 1.5px at 250px 50px, rgba(255, 255, 255, 0.22), transparent),
    radial-gradient(1.5px 1.5px at 180px 250px, rgba(230, 238, 255, 0.3), transparent);
  background-size: 380px 320px;
  background-repeat: repeat;
  animation: stars-twinkle 6s ease-in-out infinite 1.5s;
  opacity: 0.9;
}

.stars__layer--3 {
  background-image:
    radial-gradient(2px 2px at 150px 80px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(2px 2px at 320px 200px, rgba(240, 245, 255, 0.18), transparent);
  background-size: 450px 400px;
  background-repeat: repeat;
  animation: stars-twinkle 7s ease-in-out infinite 2.5s;
  opacity: 0.8;
}

@keyframes stars-twinkle {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.85; }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

/* --------------------------------------------------------------------------
   3. Layout — Container & Sections
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.block {
  padding: var(--section-padding);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.block .container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.block--full {
  max-width: none;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.block--full .block__inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.block__inner {
  max-width: var(--container);
  margin: 0 auto;
}

.section-head {
  margin-bottom: 2rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text-heading);
}

.section-subtitle {
  color: var(--text-muted);
  margin: 0;
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   4. Header
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  min-height: var(--header-height);
}

@media (max-width: 350px) {
  .header__inner {
    gap: 0.375rem;
  }
}

.logo {
  font-size: clamp(0.875rem, 1rem + 0.4vw, 1.35rem);
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: opacity var(--transition);
}

.logo:hover {
  opacity: 0.9;
}

/* Nav */
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.nav__link {
  color: var(--text);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.nav__link:hover {
  background: var(--border);
  color: var(--accent);
}

/* Mobile menu trigger */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

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

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: 0;
  }

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

  .nav__link {
    width: 100%;
    padding: 0.75rem 1rem;
  }
}

/* --------------------------------------------------------------------------
   5. Hero Block
   -------------------------------------------------------------------------- */
.block-hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.block-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, rgba(0, 212, 255, 0.28) 0%, rgba(0, 212, 255, 0.08) 35%, transparent 55%),
    radial-gradient(ellipse 70% 35% at 80% 60%, rgba(0, 180, 255, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, rgba(10, 14, 23, 0.6) 0%, var(--bg-dark) 100%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%231f2937' fill-opacity='0.45'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 100% 100%, 100% 100%, 100% 100%, 60px 60px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  z-index: 0;
  animation: hero-pattern 22s linear infinite;
}

.block-hero::after {
  content: '';
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(
      ellipse 55% 35% at 50% 15%,
      rgba(0, 230, 255, 0.35) 0%,
      rgba(0, 212, 255, 0.15) 35%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 40% 25% at 20% 70%,
      rgba(0, 212, 255, 0.12) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 35% 20% at 85% 55%,
      rgba(0, 200, 255, 0.1) 0%,
      transparent 50%
    );
  z-index: 0;
  animation: hero-glow 5s ease-in-out infinite alternate;
}

@keyframes hero-pattern {
  0% { background-position: 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 0 0, 0 0, 0 0, 60px 60px; }
}

@keyframes hero-glow {
  0% { opacity: 0.85; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.2); }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero__title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  margin: 0 0 1rem;
  line-height: 1.2;
  color: var(--text-heading);
}

.hero__subheading {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  cursor: pointer;
  border: none;
  font-size: 1rem;
  font-family: var(--font);
}

.btn--primary {
  background: var(--accent);
  color: var(--bg-dark);
}

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-glow);
}

.btn--secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn--secondary:hover {
  background: rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   7. Live Matches Block
   -------------------------------------------------------------------------- */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: var(--container);
}

@media (max-width: 500px) {
  .matches-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .match-card {
    width: 100%;
    max-width: 260px;
  }
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.match-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.match-card__league {
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.match-card__teams {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-heading);
}

.match-card__date,
.match-card__time {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   8. Gaming Room Block (full-width dark)
   -------------------------------------------------------------------------- */
.block-gaming {
  background: var(--bg-gaming);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.block-gaming .section-title {
  color: var(--accent);
}

.block-gaming .section-subtitle,
.block-gaming .block-gaming__text {
  max-width: 640px;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.block-gaming .btn {
  margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   9. Events Block
   -------------------------------------------------------------------------- */
.events-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  max-width: var(--container);
}

.event-card {
  flex: 0 1 260px;
  max-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition), background var(--transition);
}

.event-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.event-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--text-heading);
}

.event-card__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   10. About Block
   -------------------------------------------------------------------------- */
.block-about .section-subtitle {
  max-width: 720px;
}

/* --------------------------------------------------------------------------
   11. Contact & Location Block
   -------------------------------------------------------------------------- */
.location {
  display: grid;
  gap: 1.5rem;
  width: 100%;
}

@media (min-width: 768px) {
  .location {
    grid-template-columns: 1fr 1.5fr;
    align-items: start;
  }
}

/* Booking form below map, centered */
.location .booking-form {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 2rem;
}

.location__address {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.location__address a {
  color: var(--accent);
  text-decoration: none;
}

.location__address a:hover {
  text-decoration: underline;
}

#contact .location__col {
  text-align: left;
}

.map {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 10;
  min-height: 180px;
  position: relative;
}

.map iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (min-width: 480px) {
  .map {
    min-height: 220px;
  }
}

@media (min-width: 768px) {
  .map {
    min-height: 250px;
  }
}

/* --------------------------------------------------------------------------
   12. Booking Form
   -------------------------------------------------------------------------- */
.booking-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 520px;
  width: 100%;
}

.booking-form__title {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  color: var(--text-heading);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-of-type {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-dark);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

.form-group input:valid:not(:placeholder-shown) {
  border-color: #22c55e;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.booking-form .btn {
  width: 100%;
  margin-top: 0.5rem;
}

.form-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  display: none;
}

.form-message.is-visible {
  display: block;
}

.form-message--success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid #22c55e;
  color: #86efac;
}

.form-message--error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--bg-gaming);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 2rem;
  margin-top: 2rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem 3rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.footer__col {
  min-width: 160px;
}

.footer__heading {
  font-size: 1rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer p,
.footer a {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
}

.footer a {
  text-decoration: none;
}

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

.footer__notices {
  flex-basis: 100%;
  margin-top: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer__notices .age {
  color: var(--accent);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   13b. Policy / text pages content
   -------------------------------------------------------------------------- */
.page-content {
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
  padding: 2rem 0;
}

.page-content h1 {
  font-size: 1.75rem;
  margin: 0 0 1rem;
  color: var(--text-heading);
}

.page-content h2 {
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
  color: var(--text-heading);
}

.page-content p,
.page-content ul {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.page-content ul {
  padding-left: 1.5rem;
}

.page-content a {
  color: var(--accent);
  text-decoration: none;
}

.page-content a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   14. Utilities & Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .block-hero {
    min-height: 60vh;
    padding: 2rem 1rem;
  }

  .block {
    padding: 3rem 1rem;
  }

  .block--full {
    padding: 3rem 1rem;
  }
}

/* Reveal on scroll (optional, toggled by JS) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
