:root {
  --bg-primary: #edf0ff;
  --bg-secondary: rgba(255, 255, 255, 0.78);
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-pill: rgba(14, 23, 42, 0.06);
  --text-primary: #0b1224;
  --text-secondary: rgba(11, 18, 36, 0.64);
  --accent: #5164ff;
  --accent-strong: #384dff;
  --outline: rgba(79, 90, 255, 0.16);
  --shadow: 0 24px 50px rgba(12, 19, 43, 0.1);
  --toast-bg: rgba(12, 19, 43, 0.92);
  --toast-text: #ffffff;
  --cursor-size: 22px;
}

[data-theme="dark"] {
  --bg-primary: #050712;
  --bg-secondary: rgba(10, 14, 28, 0.7);
  --bg-card: rgba(12, 16, 34, 0.85);
  --bg-pill: rgba(142, 160, 220, 0.18);
  --text-primary: #f5f7ff;
  --text-secondary: rgba(215, 224, 255, 0.72);
  --accent: #9aa6ff;
  --accent-strong: #7f8cff;
  --outline: rgba(118, 135, 255, 0.28);
  --shadow: 0 28px 60px rgba(3, 7, 22, 0.6);
  --toast-bg: rgba(245, 247, 255, 0.96);
  --toast-text: #050712;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s ease;
}

body::before {
  background: radial-gradient(800px circle at 10% 15%, rgba(81, 100, 255, 0.22), transparent),
    radial-gradient(600px circle at 80% 5%, rgba(129, 90, 255, 0.22), transparent),
    radial-gradient(640px circle at 50% 90%, rgba(79, 220, 255, 0.18), transparent);
}

body::after {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.08), transparent 45%),
    linear-gradient(320deg, rgba(81, 100, 255, 0.06), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.6;
}

body[data-theme="dark"]::before {
  background: radial-gradient(780px circle at 15% 5%, rgba(150, 164, 255, 0.18), transparent),
    radial-gradient(620px circle at 80% 15%, rgba(121, 255, 244, 0.18), transparent),
    radial-gradient(600px circle at 50% 90%, rgba(112, 133, 255, 0.12), transparent);
}

body[data-theme="dark"]::after {
  background: linear-gradient(160deg, rgba(154, 166, 255, 0.08), transparent 50%),
    linear-gradient(320deg, rgba(81, 100, 255, 0.05), transparent 55%);
  mix-blend-mode: lighten;
  opacity: 0.4;
}

body.legal-page {
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 1.5rem;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 0;
}

.nav-shell {
  width: min(1100px, 100%);
  background: var(--bg-secondary);
  border-radius: 32px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border: 1px solid var(--outline);
  position: relative;
  overflow: visible;
}

.nav-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.45), transparent);
  opacity: 0.6;
  pointer-events: none;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-pill {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--text-primary);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
}

.brand-key {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.brand-key-value {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-actions > * {
  flex-shrink: 0;
}

.language-switcher {
  position: relative;
}

.language-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 20px;
  border: 1px solid transparent;
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    linear-gradient(135deg, rgba(81, 100, 255, 0.35), rgba(255, 255, 255, 0)) border-box;
  color: var(--text-primary);
  padding: 0.5rem 1rem 0.5rem 0.85rem;
  cursor: pointer;
  min-width: 156px;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.35s ease, border-color 0.3s ease;
}

.language-trigger-text {
  display: grid;
  gap: 0.1rem;
}

.language-trigger-label {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.language-current {
  font-weight: 600;
  font-size: 0.9rem;
}

.language-caret {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.language-switcher[data-open="true"] .language-caret {
  transform: rotate(180deg);
}

.language-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(56, 77, 255, 0.18);
}

.language-trigger:focus-visible {
  outline: 3px solid rgba(79, 90, 255, 0.35);
  outline-offset: 3px;
}

.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: var(--bg-card);
  border-radius: 22px;
  border: 1px solid var(--outline);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  min-width: 190px;
  display: none;
  gap: 0.15rem;
  z-index: 20;
}

.language-switcher[data-open="true"] .language-menu {
  display: grid;
}

.language-menu li {
  list-style: none;
}

.language-option {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.language-option:hover {
  background: rgba(81, 100, 255, 0.1);
}

.language-option[aria-selected="true"] {
  background: rgba(81, 100, 255, 0.12);
  color: var(--accent-strong);
}

.language-option:focus-visible {
  outline: none;
  background: rgba(79, 90, 255, 0.12);
}

.theme-toggle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    linear-gradient(135deg, rgba(81, 100, 255, 0.35), rgba(255, 255, 255, 0)) border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: transform 0.3s ease, box-shadow 0.35s ease, border-color 0.3s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 32px rgba(56, 77, 255, 0.2);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(79, 90, 255, 0.35);
  outline-offset: 3px;
}

.theme-icon {
  width: 22px;
  height: 22px;
  stroke: var(--text-primary);
  stroke-width: 1.6px;
  fill: none;
  transition: stroke 0.4s ease;
}

.icon-sun-core {
  fill: var(--text-primary);
  transition: opacity 0.3s ease, fill 0.3s ease;
}

.icon-sun-rays {
  stroke: var(--text-primary);
  transition: opacity 0.3s ease, stroke 0.3s ease;
}

.icon-moon {
  stroke: var(--text-primary);
  opacity: 0;
  transition: opacity 0.3s ease, stroke 0.3s ease;
}

[data-theme="dark"] .theme-icon {
  stroke: var(--accent);
}

[data-theme="dark"] .icon-sun-core,
[data-theme="dark"] .icon-sun-rays {
  opacity: 0;
}

[data-theme="dark"] .icon-moon {
  opacity: 1;
  stroke: var(--accent);
}

.legal-link {
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(130deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: transform 0.3s ease, box-shadow 0.35s ease, filter 0.3s ease;
  box-shadow: 0 18px 32px rgba(56, 77, 255, 0.3);
}

.legal-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.page-content {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 5rem) clamp(1.25rem, 5vw, 1.75rem) clamp(4.5rem, 8vw, 6.5rem);
  display: grid;
  gap: 4.5rem;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  gap: 2.75rem;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
}

.hero-badge::before {
  content: "\26A1";
  display: inline-flex;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.9rem;
}

.hero h1 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: 1.08;
  margin: 0.85rem 0 1rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 500px;
}

.key-card {
  background: var(--bg-card);
  border-radius: 28px;
  padding: 2.4rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(81, 100, 255, 0.18);
  display: grid;
  gap: 1.75rem;
  backdrop-filter: blur(18px);
}

.card-header {
  display: grid;
  gap: 0.55rem;
}

.card-title {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-meta {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-body {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.stream-key {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.02rem;
  letter-spacing: 0.14em;
  background: var(--bg-pill);
  border-radius: 24px;
  padding: 1.15rem 2rem;
  border: 1px solid rgba(81, 100, 255, 0.18);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 420px;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  line-height: 1.6;
  min-height: 3.5rem;
  max-width: 100%;
}

.copy-btn {
  padding: 0.95rem 1.85rem;
  border-radius: 18px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: linear-gradient(130deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  box-shadow: 0 20px 36px rgba(56, 77, 255, 0.28);
  transition: transform 0.3s ease, box-shadow 0.35s ease, filter 0.3s ease;
}

.copy-btn:hover {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.05);
}

.copy-btn:active {
  transform: translateY(0);
}

.card-footer {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.twitch-section {
  background: var(--bg-card);
  border-radius: 28px;
  padding: 2.4rem;
  border: 1px solid rgba(81, 100, 255, 0.18);
  box-shadow: var(--shadow);
  display: grid;
  gap: 1.5rem;
  backdrop-filter: blur(18px);
}

.twitch-headline h2 {
  margin: 0 0 0.5rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.twitch-headline p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 580px;
}

.twitch-player-shell {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg-pill);
  border: 1px solid rgba(81, 100, 255, 0.2);
}

.twitch-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(11, 18, 36, 0.1);
}

.twitch-player iframe,
.twitch-player object,
.twitch-player embed {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  border-radius: inherit;
}

.feature-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.feature-grid > h2 {
  grid-column: 1 / -1;
  font-size: 2rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  margin: 0 0 0.75rem;
}

.feature-card {
  position: relative;
  background: var(--bg-card);
  padding: 1.85rem;
  border-radius: 24px;
  border: 1px solid rgba(81, 100, 255, 0.16);
  box-shadow: 0 22px 46px rgba(13, 19, 45, 0.1);
  display: grid;
  gap: 0.85rem;
  overflow: hidden;
}

.feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(81, 100, 255, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.feature-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.legal-content {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 5rem 1.75rem 5.5rem;
  display: grid;
  gap: 2.75rem;
  position: relative;
  z-index: 1;
}

.legal-hero h1 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2.3rem, 4vw, 3.5rem);
  margin-bottom: 0.75rem;
}

.legal-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
}

.legal-section {
  background: var(--bg-card);
  padding: 1.85rem;
  border-radius: 22px;
  border: 1px solid rgba(81, 100, 255, 0.16);
  box-shadow: 0 22px 42px rgba(11, 18, 40, 0.12);
  backdrop-filter: blur(14px);
}

.legal-section h2 {
  margin-top: 0;
  font-size: 1.3rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.legal-section p {
  margin-bottom: 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.legal-section a {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: underline;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast[data-visible="true"] {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

@media (pointer: fine) {
  body,
  button,
  a,
  .language-option,
  .copy-btn,
  .theme-toggle,
  .legal-link,
  .language-trigger {
    cursor: none;
  }
}

.custom-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--cursor-size);
  height: var(--cursor-size);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  mix-blend-mode: difference;
  transition: opacity 0.35s ease;
  opacity: 0;
}

.custom-cursor::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s ease, transform 0.3s ease;
  mix-blend-mode: difference;
}

.custom-cursor[data-visible="true"] {
  opacity: 1;
}

.custom-cursor[data-active="true"]::after {
  opacity: 1;
  transform: scale(1);
}

.custom-cursor[data-click="true"]::after {
  animation: cursor-bloom 0.45s ease;
}

@keyframes cursor-bloom {
  0% {
    opacity: 1;
    transform: scale(0.85);
  }
  60% {
    opacity: 1;
    transform: scale(1.45);
  }
  100% {
    opacity: 0;
    transform: scale(1.75);
  }
}

@media (pointer: coarse) {
  .custom-cursor {
    display: none;
  }

  body,
  button,
  a,
  .language-option,
  .copy-btn,
  .theme-toggle,
  .legal-link,
  .language-trigger {
    cursor: auto;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 768px) {
  .nav-shell {
    flex-direction: column;
    align-items: stretch;
    border-radius: 32px;
    gap: 1.25rem;
  }

  .nav-actions {
    justify-content: center;
    width: 100%;
    gap: 0.85rem;
  }

  .brand-block {
    width: 100%;
    justify-content: space-between;
  }

  .language-switcher {
    width: 100%;
  }

  .language-trigger {
    width: 100%;
    justify-content: space-between;
  }

  .language-menu {
    left: 0;
    right: auto;
  }

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

  .twitch-section {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .site-header {
    top: 0.75rem;
  }

  .copy-btn {
    width: 100%;
    justify-content: center;
  }

  .card-body {
    justify-content: center;
  }

  .twitch-section {
    padding: 1.6rem;
  }

  .twitch-headline h2 {
    font-size: 1.9rem;
  }
}

@media (max-width: 380px) {
  .nav-actions {
    flex-direction: column;
  }

  .theme-toggle {
    width: 42px;
    height: 42px;
  }

  .legal-link {
    width: 100%;
    text-align: center;
  }

  .twitch-player {
    aspect-ratio: 3 / 2;
  }
}
