/* Import premium typography */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  /* Color Palette - Electric Blue Theme */
  --bg-color: #060814;
  --bg-card: #0d1124;
  --bg-card-hover: #121834;
  --text-primary: #f5f6f8;
  --text-secondary: #8f9fc2;
  --primary-color: #005eff; /* Electric blue */
  --primary-rgb: 0, 94, 255;
  --accent-color: #3b82f6;
  --border-color: #1a2245;
  --border-hover: #26336a;
  
  /* Fonts */
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  
  /* Layout */
  --container-width: 1200px;
  --border-radius: 12px;
  --transition-speed: 0.25s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(var(--primary-rgb), 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(var(--primary-rgb), 0.05) 0%, transparent 40%);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Container */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  background-color: rgba(6, 8, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  transition: all var(--transition-speed) ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
}

.logo svg {
  color: var(--primary-color);
  filter: drop-shadow(0 0 8px rgba(var(--primary-rgb), 0.5));
}

.logo span {
  background: linear-gradient(135deg, var(--text-primary) 60%, var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all var(--transition-speed) ease;
}

.nav-links a:hover,
.nav-links li.active a {
  color: var(--primary-color);
  background-color: rgba(var(--primary-rgb), 0.08);
}

/* Mobile Menu Button */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Pages Layout */
.page {
  display: none;
  padding: 60px 0 100px 0;
  animation: fadeIn 0.4s ease forwards;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero Section (Etusivu) */
.hero {
  text-align: center;
  padding: 80px 0;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.hero h1 span {
  color: var(--primary-color);
  position: relative;
  display: inline-block;
  text-shadow: 0 0 15px rgba(var(--primary-rgb), 0.3);
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 40px;
}

/* Connection Bar with Inline Buttons */
.connection-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
  justify-content: center;
}

.connection-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 6px 6px 6px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: border-color var(--transition-speed);
}

.connection-bar:hover {
  border-color: var(--border-hover);
}

.ip-text {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  margin-right: 20px;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.btn-copy {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, background-color var(--transition-speed), box-shadow var(--transition-speed);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.btn-copy:hover {
  background-color: #1a72ff;
  box-shadow: 0 4px 18px rgba(var(--primary-rgb), 0.5);
}

.btn-copy:active {
  transform: scale(0.96);
}

.btn-discord-inline {
  background-color: #5865F2;
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  padding: 16px 24px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
  transition: transform 0.15s ease, background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.btn-discord-inline:hover {
  background-color: #4752C4;
  box-shadow: 0 4px 18px rgba(88, 101, 242, 0.5);
}

.btn-discord-inline:active {
  transform: scale(0.96);
}

/* Server Stats Widget */
.server-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 20px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(var(--primary-rgb), 0.05);
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  padding: 12px 24px;
  border-radius: 50px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ff3d00;
}

.status-dot.online {
  background-color: #00e676;
  box-shadow: 0 0 8px #00e676;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 60px;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 32px;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--primary-color);
  opacity: 0;
  transition: opacity var(--transition-speed);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  color: var(--primary-color);
  margin-bottom: 20px;
  display: inline-block;
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-secondary);
}

/* Pelimuodot Page */
.section-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.section-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.gamemodes-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.gamemode-row {
  display: flex;
  align-items: center;
  gap: 48px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 40px;
  transition: all var(--transition-speed);
}

.gamemode-row:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
}

.gamemode-row:nth-child(even) {
  flex-direction: row-reverse;
}

.gamemode-media {
  flex: 1;
  min-width: 260px;
  border-radius: 8px;
  overflow: hidden;
  height: 200px;
  background-color: rgba(var(--primary-rgb), 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--primary-color);
  position: relative;
}

.gamemode-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gamemode-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--primary-color);
  opacity: 0.5;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}


.gamemode-info {
  flex: 1.5;
}

.gamemode-badge {
  background-color: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 50px;
  display: inline-block;
  margin-bottom: 16px;
}

.gamemode-info h3 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 16px;
}

.gamemode-info p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.gamemode-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.gamemode-tags span {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.btn-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 16px;
  transition: color var(--transition-speed);
}

.btn-inline-link:hover {
  color: var(--text-primary);
}

/* Rules Section Layout styling (Accordion-style) */
.rules-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.rules-category {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.rules-header {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  border-bottom: 1px solid transparent;
  transition: background-color var(--transition-speed);
}

.rules-header:hover {
  background-color: var(--bg-card-hover);
}

.rules-header.active {
  border-bottom-color: var(--border-color);
}

.rules-header-icon {
  transition: transform var(--transition-speed);
}

.rules-header.active .rules-header-icon {
  transform: rotate(180deg);
}

.rules-content {
  display: none;
  padding: 24px;
}

.rules-content.active {
  display: block;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.rule-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.rule-box h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.rule-box p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Ylläpito Page */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 40px;
}

.staff-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 32px 24px;
  text-align: center;
  transition: all var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.staff-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
}

.skin-container {
  height: 200px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}

.skin-render {
  height: 180px;
  image-rendering: pixelated;
  transition: transform 0.3s ease;
}

.staff-card:hover .skin-render {
  transform: scale(1.08) translateY(-4px);
}

.staff-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.staff-role {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 16px;
  border-radius: 50px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.staff-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: auto;
}

/* Tietoa Page */
.about-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  margin-top: 40px;
}

.about-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 40px;
}

.about-content h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  margin-top: 28px;
  margin-bottom: 12px;
}

.about-content h3:first-child {
  margin-top: 0;
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.about-content ul {
  list-style-position: inside;
  color: var(--text-secondary);
  margin-bottom: 24px;
  padding-left: 8px;
}

.about-content li {
  margin-bottom: 8px;
}

.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 30px;
}

.sidebar-card h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: var(--primary-color);
}

/* Palvelin Page */
.server-container {
  max-width: 800px;
  margin: 0 auto;
}

.guide-step {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 32px;
  border-radius: var(--border-radius);
}

.step-number {
  background-color: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.step-details h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.step-details p {
  color: var(--text-secondary);
}

/* Ota Yhteyttä Page */
.contact-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.contact-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 40px;
  text-align: center;
  transition: all var(--transition-speed) ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
}

.contact-icon {
  margin-bottom: 24px;
  color: var(--primary-color);
}

.contact-card h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.contact-card p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 8px;
  transition: all var(--transition-speed) ease;
  cursor: pointer;
  font-size: 1rem;
}

.btn-discord {
  background-color: #5865F2;
  color: #fff;
}

.btn-discord:hover {
  background-color: #4752C4;
}

.btn-email {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-email:hover {
  background-color: rgba(255,255,255,0.05);
  border-color: var(--text-secondary);
}

/* Toast Notification for IP copy */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #00e676;
  color: #000;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0,230,118,0.3);
  z-index: 1000;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
  margin-top: auto;
  background-color: rgba(6, 8, 20, 0.5);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-speed);
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* =====================
   RESPONSIVE / MOBILE
   ===================== */

@media (max-width: 768px) {
  /* Nav */
  .nav-links {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 16px 20px;
    gap: 10px;
    z-index: 99;
  }

  .nav-links.active {
    display: flex;
  }

  .mobile-toggle {
    display: block;
  }

  /* Pages */
  .page {
    padding: 36px 0 56px;
  }

  /* Hero */
  .hero {
    padding: 48px 0 32px;
  }

  .hero h1 {
    font-size: 2rem;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 28px;
  }

  /* Connection bar */
  .connection-group {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
    gap: 10px;
  }

  .connection-bar {
    width: 100%;
    justify-content: space-between;
  }

  .btn-discord-inline {
    justify-content: center;
    padding: 14px 20px;
  }

  /* Server stats */
  .server-stats {
    flex-direction: column;
    gap: 12px;
  }

  /* Features */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 32px;
  }

  .feature-card {
    padding: 22px;
  }

  /* Section titles */
  .section-title {
    font-size: 1.9rem;
  }

  /* Gamemodes */
  .gamemodes-container {
    gap: 20px;
  }

  .gamemode-row {
    flex-direction: column !important;
    padding: 20px;
    gap: 18px;
  }

  .gamemode-media {
    min-width: unset;
    width: 100%;
    height: 160px;
  }

  .gamemode-info h3 {
    font-size: 1.5rem;
  }

  .gamemode-info p {
    font-size: 0.9rem;
  }

  /* About */
  .about-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 20px;
  }

  .about-content {
    padding: 22px;
  }

  /* Rules */
  .rules-grid {
    grid-template-columns: 1fr;
  }

  /* Staff */
  .staff-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 24px;
  }

  .staff-card {
    padding: 20px 14px;
  }

  .skin-container {
    height: 160px;
  }

  .skin-render {
    height: 150px;
  }

  /* Contact */
  .contact-container {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 24px;
  }

  .contact-card {
    padding: 28px 22px;
  }

  /* Guide steps */
  .guide-step {
    padding: 22px;
    gap: 16px;
  }

  /* Footer — compact */
  footer {
    padding: 20px 0;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .footer-text {
    font-size: 0.78rem;
    line-height: 1.6;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
  }

  .footer-links a {
    font-size: 0.8rem;
  }
}

/* Extra small phones (≤420px) */
@media (max-width: 420px) {
  .nav-container {
    height: 64px;
  }

  .nav-links {
    top: 64px;
  }

  .hero h1 {
    font-size: 1.65rem;
  }

  .hero-logo-text {
    max-width: 280px !important;
  }

  .ip-text {
    font-size: 0.9rem;
  }

  .btn-copy {
    padding: 9px 14px;
    font-size: 0.85rem;
  }

  .section-title {
    font-size: 1.55rem;
  }

  .staff-grid {
    grid-template-columns: 1fr;
  }

  .gamemode-tags span {
    font-size: 0.78rem;
    padding: 4px 10px;
  }

  .rules-header {
    font-size: 1.05rem;
    padding: 16px 18px;
  }

  .guide-step {
    flex-direction: column;
    align-items: flex-start;
  }
}
