@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700&display=swap");

:root {
  color-scheme: light;

  /* Colors */
  --color-primary-blue-light: #163f75;
  --color-primary-blue: #003d7a;
  --color-primary-blue-dark: #061f40;
  --color-secondary-blue-light: #85c8ed;
  --color-secondary-blue: #5eb3e4;
  --color-secondary-blue-dark: #3e97c9;
  --color-yellow-light: #ffe04d;
  --color-yellow: #ffcd00;
  --color-yellow-dark: #e0b000;
  --color-black-light: #333333;
  --color-black: #1a1a1a;
  --color-black-dark: #000000;
  --color-white-light: #ffffff;
  --color-white: #ffffff;
  --color-white-dark: #f2f6fb;

  /* Usage colors */
  --color-background: var(--color-white-dark);
  --color-surface: var(--color-white);
  --color-surface-muted: #f8fbff;
  --color-border: #d9dee7;
  --color-border-strong: #c3c9d4;
  --color-text: var(--color-black);
  --color-text-soft: var(--color-black-light);
  --color-text-muted: #5d6878;
  --color-link: var(--color-primary-blue);
  --color-link-hover: var(--color-primary-blue-light);
  --color-accent: var(--color-yellow);
  --color-focus: rgba(94, 179, 228, 0.35);
  --shadow-surface: 0 12px 30px rgba(6, 31, 64, 0.14);

  /* Typography */
  --font-heading: "Poppins";
  --font-body: "Inter";
  --font-size-h1: 40px;
  --font-size-h2: 32px;
  --font-size-h3: 24px;
  --font-size-body-large: 16px;
  --font-size-body-small: 14px;
  --font-size-caption: 12px;
  --line-height-h1: 1.2;
  --line-height-h2: 1.3;
  --line-height-h3: 1.5;
  --line-height-body: 1.5;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Layout */
  --header-height: 80px;
  --container-width: 1160px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius and borders */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --border-width: 1px;

  /* Header and navigation */
  --site-header-background: var(--color-white);
  --site-header-background-dark: var(--color-black);
  --nav-link-color: var(--color-black);
  --nav-link-hover-color: var(--color-primary-blue);
  --nav-link-active-underline: var(--color-yellow);

  /* Buttons */
  --button-primary-background: var(--color-primary-blue);
  --button-primary-background-hover: var(--color-primary-blue-light);
  --button-primary-background-active: var(--color-primary-blue-dark);
  --button-primary-text: var(--color-white);
  --button-secondary-background: var(--color-white);
  --button-secondary-background-hover: var(--color-secondary-blue-light);
  --button-secondary-background-active: var(--color-secondary-blue);
  --button-secondary-border: var(--color-secondary-blue);
  --button-secondary-text: var(--color-secondary-blue-dark);

  /* Forms */
  --input-height: 44px;
  --input-background: var(--color-white);
  --input-background-hover: var(--color-white);
  --input-border: var(--color-border);
  --input-border-hover: var(--color-secondary-blue);
  --input-border-focus: var(--color-primary-blue);

  /* Motion */
  --transition-fast: 120ms ease;
  --transition-normal: 180ms ease;
}

body.home-page::before,
body.nav-page::before,
body.profile-page::before,
body.page-preload::before {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-surface);
  visibility: visible;
  opacity: 1;
  content: "";
  transition: opacity 0.35s ease, visibility 0s;
}

body.home-page.loader-finished::before,
body.nav-page.loader-finished::before,
body.profile-page.loader-finished::before,
body.page-preload.loader-finished::before {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

body.home-page::after,
body.nav-page::after,
body.profile-page::after,
body.page-preload::after {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10000;
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  visibility: visible;
  opacity: 1;
  content: "";
  transform: translate(-50%, -50%);
  animation: loader-spin 0.8s linear infinite;
  transition: opacity 0.2s ease, visibility 0s;
}

body.home-page.loader-finished::after,
body.nav-page.loader-finished::after,
body.profile-page.loader-finished::after,
body.page-preload.loader-finished::after {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

body.login-page::before,
body.login-page::after {
  display: none !important;
}

body.hologram-body::before,
body.hologram-body::after {
  display: none !important;
}

body.friends-page:not(.friends-ready)::before {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.35s ease, visibility 0s;
}

body.friends-page:not(.friends-ready)::after {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s ease, visibility 0s;
}

@keyframes loader-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-readable-blue: #9de4ff;
  --color-background: #0b0f16;
  --color-surface: #141a24;
  --color-surface-muted: #202938;
  --color-border: #465568;
  --color-border-strong: #7dd3fc;
  --color-text: #f8fbff;
  --color-text-soft: var(--color-white-dark);
  --color-text-muted: #cbd7e5;
  --color-link: #9de4ff;
  --color-link-hover: var(--color-yellow-light);
  --color-focus: rgba(255, 224, 77, 0.48);
  --shadow-surface: 0 12px 30px rgba(0, 0, 0, 0.35);
  --lab-grid-size: 42px;
  --lab-page-background:
    linear-gradient(rgba(125, 211, 252, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, #0b0f16 0%, #101620 100%);
  --site-header-background: #0b0f16;
  --nav-link-color: var(--color-white);
  --nav-link-hover-color: #8dddff;
  --button-primary-background: #2563eb;
  --button-primary-background-hover: #3b82f6;
  --button-primary-background-active: #1d4ed8;
  --button-primary-text: var(--color-white);
  --button-secondary-background: #141a24;
  --button-secondary-background-hover: #223049;
  --button-secondary-background-active: #2d4263;
  --button-secondary-border: #6ecff6;
  --button-secondary-text: #bae6fd;
  --input-background: #0e141d;
  --input-background-hover: #151e2b;
  --input-border: #53647a;
  --input-border-hover: #9de4ff;
  --input-border-focus: #ffe04d;
}

:root[data-theme="dark"] .home-link-label,
:root[data-theme="dark"] .home-work-meta,
:root[data-theme="dark"] .home-support-step,
:root[data-theme="dark"] .leaderboard-header .caption,
:root[data-theme="dark"] .leaderboard-rank,
:root[data-theme="dark"] .level-overview-eyebrow,
:root[data-theme="dark"] .level-overview-kicker,
:root[data-theme="dark"] .level-leaderboard-rank,
:root[data-theme="dark"] .level-leaderboard-score,
:root[data-theme="dark"] .about-eyebrow,
:root[data-theme="dark"] .about-contribution,
:root[data-theme="dark"] .tutorial-step-number,
:root[data-theme$="-dark"] .home-link-label,
:root[data-theme$="-dark"] .home-work-meta,
:root[data-theme$="-dark"] .home-support-step,
:root[data-theme$="-dark"] .leaderboard-header .caption,
:root[data-theme$="-dark"] .leaderboard-rank,
:root[data-theme$="-dark"] .level-overview-eyebrow,
:root[data-theme$="-dark"] .level-overview-kicker,
:root[data-theme$="-dark"] .level-leaderboard-rank,
:root[data-theme$="-dark"] .level-leaderboard-score,
:root[data-theme$="-dark"] .about-eyebrow,
:root[data-theme$="-dark"] .about-contribution,
:root[data-theme$="-dark"] .tutorial-step-number {
  color: var(--color-readable-blue);
}

:root[data-theme="dark"] .leaderboard-row.is-top-three,
:root[data-theme="dark"] .level-leaderboard-row.is-top-three,
:root[data-theme$="-dark"] .leaderboard-row.is-top-three,
:root[data-theme$="-dark"] .level-leaderboard-row.is-top-three {
  border-left-color: var(--color-readable-blue);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-body-large);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

:root[data-theme="dark"] body:not(.hologram-body) {
  background: var(--lab-page-background) !important;
  background-size: var(--lab-grid-size) var(--lab-grid-size), var(--lab-grid-size) var(--lab-grid-size), auto !important;
}

body:not([class]) {
  display: grid;
  place-items: center;
  padding: var(--space-lg);
}

img,
picture,
svg,
canvas,
video {
  display: block;
  max-width: 100%;
}

main,
section,
article,
aside,
header,
footer,
nav,
div,
form {
  min-width: 0;
}

input,
select,
textarea {
  font-family: var(--font-body);
  font-size: inherit;
  font-weight: var(--font-weight-regular);
}

h1,
h2,
h3,
p {
  margin: 0;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  color: var(--color-text);
  font-family: var(--font-heading);
  letter-spacing: 0;
}

h1,
.heading-1 {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-h1);
}

h2,
.heading-2 {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-h2);
}

h3,
.heading-3 {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-h3);
}

p,
.body-large {
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--font-size-body-large);
  line-height: var(--line-height-body);
}

.body-small {
  font-family: var(--font-body);
  font-size: var(--font-size-body-small);
  line-height: var(--line-height-body);
}

.caption {
  font-family: var(--font-body);
  font-size: var(--font-size-caption);
  line-height: var(--line-height-body);
}

a {
  color: var(--color-link);
  font-family: var(--font-body);
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
  color: var(--color-link-hover);
  text-decoration-color: currentColor;
}

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

.container {
  width: min(100% - (var(--space-lg) * 2), var(--container-width));
  max-width: 100%;
  margin-inline: auto;
}

.site-footer {
  width: 100%;
  margin-top: auto;
  border-top: var(--border-width) solid var(--color-border);
  background: var(--color-background);
  color: var(--color-text-muted);
  font-size: var(--font-size-body-small);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding-block: var(--space-md);
  text-align: center;
}

.site-footer p {
  color: inherit;
  font-size: inherit;
}

.site-header {
  min-height: var(--header-height);
  background: var(--site-header-background);
  color: var(--color-text);
  border-bottom: var(--border-width) solid var(--color-border);
}

.home-page,
.nav-page {
  display: block;
  padding: 0;
}

.header-label {
  padding-top: var(--space-2xs);
  color: var(--color-text);
  font-size: var(--font-size-body-small);
  line-height: 1;
}

.compact-header {
  width: min(100% - (var(--space-lg) * 2), var(--container-width));
  min-height: 44px;
  margin-inline: auto;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding-inline: var(--space-sm);
  gap: var(--space-md);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo:hover {
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: block;
  width: 30px;
  height: 22px;
  overflow: hidden;
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-black-dark);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
}

.brand-mark::before {
  inset: 5px 6px;
  border: var(--border-width) solid var(--color-secondary-blue);
  border-radius: 999px;
  transform: rotate(-18deg);
}

.brand-mark::after {
  top: 8px;
  left: 12px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--color-yellow);
  box-shadow: 6px 2px 0 var(--color-secondary-blue-light);
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
}

.compact-header .header-cta {
  min-width: 118px;
  min-height: 30px;
  padding: 0 var(--space-md);
}

.home-page .app-shell {
  margin: 0 auto var(--space-xl);
}

.nav-page .panel {
  margin: var(--space-xl) auto;
}

.site-header strong {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
}

.site-header[data-theme="dark"] {
  background: var(--site-header-background-dark);
  color: var(--color-white);
}

.nav-link {
  position: relative;
  color: var(--nav-link-color);
  font-family: var(--font-body);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

.nav-link:hover {
  color: var(--nav-link-hover-color);
  text-decoration: none;
}

.nav-link[aria-current="page"]::after,
.nav-link.is-active::after {
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 2px;
  background: var(--nav-link-active-underline);
  content: "";
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 44px;
  padding: 0 1rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--button-primary-background);
  color: var(--button-primary-text);
  font-family: var(--font-body);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--transition-fast), opacity var(--transition-fast);
}

button:hover {
  background: var(--button-primary-background-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 56px;
  height: 42px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  color: var(--color-text);
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.dialog-close:hover,
.dialog-close:focus-visible {
  border-color: var(--color-primary-blue);
  background: var(--color-ghost-hover);
  color: var(--color-text);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  font-family: var(--font-body);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), opacity var(--transition-fast);
}

.button:hover {
  text-decoration: none;
}

.button-small {
  min-width: 96px;
  min-height: 36px;
  padding: 0 14px;
  font-size: var(--font-size-caption);
}

.button-medium {
  min-width: 112px;
  min-height: 44px;
  padding: 0 20px;
  font-size: var(--font-size-body-small);
}

.button-large {
  min-width: 136px;
  min-height: 52px;
  padding: 0 24px;
  font-size: var(--font-size-body-large);
}

.button-primary {
  background: var(--button-primary-background);
  color: var(--button-primary-text);
}

.button-primary:hover {
  background: var(--button-primary-background-hover);
  color: var(--button-primary-text);
}

.button-primary:active {
  background: var(--button-primary-background-active);
}

.button-secondary {
  background: var(--button-secondary-background);
  border-color: var(--button-secondary-border);
  color: var(--button-secondary-text);
}

.button-secondary:hover {
  background: var(--button-secondary-background-hover);
  border-color: var(--button-secondary-border);
  color: var(--color-primary-blue-dark);
}

.button-secondary:active {
  background: var(--button-secondary-background-active);
  border-color: var(--color-secondary-blue-dark);
  color: var(--color-white);
}

.button-block {
  border-color: #b71c1c;
  background: #d32f2f;
  color: var(--color-white);
}

.button-block:hover,
.button-block:focus-visible {
  border-color: #8e0000;
  background: #b71c1c;
  color: var(--color-white);
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
}

button,
.button,
.btn {
  overflow-wrap: normal;
  text-align: center;
  text-wrap: balance;
  white-space: normal;
  word-break: normal;
  hyphens: manual;
}

button,
.button,
.btn {
  line-height: 1.18;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  min-width: 76px;
  min-height: 34px;
  padding: 0 10px;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  background: rgba(17, 24, 39, 0.54);
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  white-space: nowrap;
}

.language-switcher-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.language-switcher-option:hover,
.language-switcher-option:focus-visible {
  background: transparent;
  color: var(--color-white);
}

.language-switcher-option.is-active {
  color: var(--color-white);
  font-weight: var(--font-weight-bold);
}

.language-switcher-divider {
  margin: 0 5px;
  color: currentColor;
  opacity: 0.72;
}

.site-header .language-switcher {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.site-header .language-switcher-option:hover,
.site-header .language-switcher-option:focus-visible,
.site-header .language-switcher-option.is-active {
  color: var(--color-text);
}

:root[data-theme="dark"] .site-header .language-switcher,
:root[data-theme$="-dark"] .site-header .language-switcher {
  border-color: rgba(157, 228, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 251, 255, 0.74);
}

:root[data-theme="dark"] .site-header .language-switcher-option:hover,
:root[data-theme="dark"] .site-header .language-switcher-option:focus-visible,
:root[data-theme="dark"] .site-header .language-switcher-option.is-active,
:root[data-theme$="-dark"] .site-header .language-switcher-option:hover,
:root[data-theme$="-dark"] .site-header .language-switcher-option:focus-visible,
:root[data-theme$="-dark"] .site-header .language-switcher-option.is-active {
  color: var(--color-white);
}

input,
select,
textarea {
  width: 100%;
  border: var(--border-width) solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input-background);
  color: var(--color-text);
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

input,
select {
  min-height: var(--input-height);
  padding: 0 var(--space-md);
}

textarea {
  min-height: 140px;
  padding: var(--space-md);
  resize: vertical;
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover {
  border-color: var(--input-border-hover);
  background: var(--input-background-hover);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--input-border-focus);
  outline: 3px solid var(--color-focus);
}

::placeholder {
  color: var(--color-text-muted);
  opacity: 0.72;
}

a {
  color: var(--color-link);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.auth-layout {
  width: min(94vw, 980px);
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1.05fr);
  min-height: 560px;
  overflow: hidden;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-surface);
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: var(--space-md);
  padding: var(--space-xl);
  background:
    linear-gradient(135deg, rgba(6, 31, 64, 0.96), rgba(0, 61, 122, 0.9)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 38px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 38px);
  color: var(--color-white);
}

.brand-panel img {
  width: min(220px, 72%);
  height: auto;
  margin-bottom: auto;
}

.brand-panel h1,
.home-panel h1 {
  margin: 0;
  font-size: 2.35rem;
  line-height: 1.05;
}

.brand-panel h1 {
  color: var(--color-white);
}

.brand-panel .supporting,
.home-panel .supporting {
  max-width: 32rem;
  color: #dbeafe;
}

.eyebrow {
  margin: 0;
  color: var(--color-yellow);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-xl);
}

.auth-panel form {
  display: grid;
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-field > span {
  color: var(--color-text-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.form-field small {
  min-height: 1rem;
  color: #b42318;
  font-size: 0.82rem;
  font-weight: 650;
}

.password-control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.45rem;
}

.inline-button {
  min-width: 70px;
  height: 44px;
  padding: 0 0.75rem;
  border: var(--border-width) solid var(--button-secondary-border);
  background: var(--button-secondary-background);
  color: var(--button-secondary-text);
}

.inline-button:hover {
  background: var(--button-secondary-background-hover);
}

.primary-button,
.secondary-button {
  width: 100%;
}

.secondary-button {
  border: var(--border-width) solid var(--button-secondary-border);
  background: var(--button-secondary-background);
  color: var(--button-secondary-text);
}

.secondary-button:hover {
  background: var(--button-secondary-background-hover);
}

.form-message {
  min-height: 1.2rem;
  color: #b42318;
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-link {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.app-shell {
  width: min(94vw, 900px);
}

.home-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-surface);
}

.home-panel .supporting {
  color: var(--color-text-muted);
  word-break: break-word;
}

.home-page .home-shell {
  gap: var(--space-xl);
  min-height: auto;
  width: 100%;
}

.home-hero {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: min(560px, calc(100vh - 176px));
  overflow: hidden;
  isolation: isolate;
  background: var(--color-primary-blue-dark);
}

.home-hero::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("../assets/images/home-hero-bloch.png");
  background-position: center;
  background-size: cover;
  content: "";
}

.home-hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 31, 64, 0.92) 0%, rgba(6, 31, 64, 0.72) 38%, rgba(6, 31, 64, 0.18) 72%),
    linear-gradient(0deg, rgba(6, 31, 64, 0.2), rgba(6, 31, 64, 0.08));
  content: "";
}

.home-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-md);
  width: min(100% - (var(--space-lg) * 2), var(--container-width));
  min-height: inherit;
  margin-inline: auto;
  min-width: 0;
  padding-block: var(--space-xl);
}

.home-kicker {
  margin: 0;
  color: #e8f6ff;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.32);
}

.home-hero h1 {
  max-width: 11ch;
  color: var(--color-white);
  font-size: 4rem;
  line-height: 1;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.32);
}

html:lang(nl) .home-hero h1 {
  max-width: 13ch;
  line-height: 1.04;
}

.home-hero-text {
  max-width: 37rem;
  color: #e8f6ff;
  font-size: 1.08rem;
  line-height: 1.6;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.32);
}

.home-qubit-guide {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: var(--space-lg);
  align-items: stretch;
  width: min(100% - (var(--space-lg) * 2), var(--container-width));
  margin-inline: auto;
  padding: var(--space-lg);
  border: var(--border-width) solid rgba(23, 100, 166, 0.22);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(6, 31, 64, 0.96), rgba(23, 100, 166, 0.9)),
    var(--color-primary-blue-dark);
  color: var(--color-white);
  box-shadow: 0 14px 32px rgba(6, 31, 64, 0.14);
}

.home-section-eyebrow {
  color: var(--color-yellow);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-qubit-copy {
  display: grid;
  align-content: center;
  gap: var(--space-sm);
}

.home-qubit-copy h2 {
  max-width: 14ch;
  color: var(--color-white);
  font-size: 2.35rem;
  line-height: 1.02;
}

html:lang(nl) .home-qubit-copy h2 {
  max-width: 17ch;
}

.home-qubit-copy p {
  max-width: 43rem;
  color: #dff3ff;
  font-size: 1rem;
  line-height: 1.65;
}

.home-qubit-facts {
  display: grid;
  gap: var(--space-sm);
  margin: 0;
}

.home-qubit-facts div {
  display: grid;
  gap: 0.35rem;
  padding: var(--space-md);
  border: var(--border-width) solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.09);
}

.home-qubit-facts dt {
  color: var(--color-yellow);
  font-family: var(--font-heading);
  font-size: 1rem;
  line-height: 1.1;
}

.home-qubit-facts dd {
  margin: 0;
  color: #eef9ff;
  line-height: 1.5;
}

.home-card-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  width: min(100% - (var(--space-lg) * 2), var(--container-width));
  margin-inline: auto;
}

.home-image-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--space-xs);
  min-height: 300px;
  overflow: hidden;
  padding: var(--space-lg);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-muted);
  color: var(--color-text);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(6, 31, 64, 0.08);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.home-image-card::before {
  position: absolute;
  inset: 88px 0 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  content: "";
  transition: transform var(--transition-normal);
}

.home-image-card::after {
  position: absolute;
  inset: 88px 0 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(6, 31, 64, 0.28), rgba(6, 31, 64, 0.04));
  content: "";
}

.home-image-card:hover,
.home-image-card:focus-visible {
  border-color: var(--color-secondary-blue);
  color: var(--color-text);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-surface);
}

.home-image-card:hover::before,
.home-image-card:focus-visible::before {
  transform: scale(1.04);
}

.home-image-card span,
.home-image-card strong {
  position: relative;
  z-index: 2;
}

.home-image-card span {
  color: var(--color-text);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-image-card strong {
  max-width: 14rem;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 1.4rem;
  line-height: 1.1;
}

.home-image-card-game::before {
  background-image: url("../assets/images/home-card-game.png");
  background-position: 54% center;
}

.home-image-card-friends::before {
  background-image: url("../assets/images/home-card-friends.png");
  background-position: 56% center;
}

.home-image-card-social::before {
  background-image: url("../assets/images/home-card-leaderboard.png");
  background-position: 58% center;
}

.home-image-card-community::before {
  background-image: url("../assets/images/home-card-community.png");
  background-position: 52% center;
}

.home-quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
  width: min(100% - (var(--space-lg) * 2), var(--container-width));
  margin-inline: auto;
}

.home-link-card {
  display: grid;
  align-content: center;
  gap: var(--space-xs);
  min-height: 96px;
  padding: var(--space-lg);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 8px 20px rgba(6, 31, 64, 0.08);
  text-decoration: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.home-link-card:hover,
.home-link-card:focus-visible {
  border-color: var(--color-secondary-blue);
  color: var(--color-text);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-surface);
}

.home-link-label {
  color: var(--color-primary-blue);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
}

.home-link-card strong {
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  line-height: 1.2;
}

.home-section {
  display: grid;
  gap: var(--space-lg);
  width: min(100% - (var(--space-lg) * 2), var(--container-width));
  margin-inline: auto;
}

.home-section-header {
  display: grid;
  gap: var(--space-xs);
  max-width: 42rem;
}

.home-section-header h2 {
  font-size: var(--font-size-h2);
}

.home-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 0.9fr));
  gap: var(--space-md);
}

.home-work-card {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 8px 20px rgba(6, 31, 64, 0.08);
}

.home-work-card {
  display: grid;
  align-content: end;
  gap: var(--space-sm);
  min-height: 176px;
  padding: var(--space-lg);
  text-decoration: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.home-work-card:hover,
.home-work-card:focus-visible {
  border-color: var(--color-secondary-blue);
  color: var(--color-text);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-surface);
}

.home-work-card-primary {
  min-height: 220px;
  background:
    linear-gradient(135deg, rgba(0, 61, 122, 0.95), rgba(22, 63, 117, 0.86)),
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px;
  color: var(--color-white);
}

.home-work-card-primary:hover,
.home-work-card-primary:focus-visible {
  color: var(--color-white);
}

.home-work-meta {
  color: var(--color-primary-blue);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
}

.home-work-card-primary .home-work-meta {
  color: var(--color-yellow);
}

.home-work-card strong {
  color: inherit;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  line-height: 1.2;
}

.home-work-card span:last-child {
  max-width: 24rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-body-small);
  line-height: var(--line-height-body);
}

.home-work-card-primary span:last-child {
  color: #dbeafe;
}

.home-support {
  padding-top: var(--space-sm);
}

.home-support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.home-support-item {
  display: grid;
  align-content: start;
  gap: var(--space-sm);
  min-height: 188px;
  padding: var(--space-lg);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: 0 8px 20px rgba(6, 31, 64, 0.08);
}

.home-support-step {
  color: var(--color-primary-blue);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-bold);
}

.home-support-item h3 {
  font-size: 1.1rem;
  line-height: 1.25;
}

.home-support-item p {
  color: var(--color-text-muted);
  font-size: var(--font-size-body-small);
}

.home-proof {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  padding: var(--space-xl);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-surface);
}

.home-proof-copy {
  display: grid;
  gap: var(--space-xs);
}

.home-proof-copy h2 {
  font-size: var(--font-size-h2);
}

.home-proof-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}

.home-proof-list span {
  min-height: 52px;
  padding: var(--space-sm) var(--space-md);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
}

.panel {
  width: min(96vw, var(--container-width));
  min-height: 560px;
  padding: var(--space-xl);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-surface);
}

.header {
  margin-bottom: var(--space-lg);
}

.header h1 {
  margin-bottom: var(--space-2xs);
}

.control-section {
  padding: var(--space-md) 0 var(--space-lg);
  border-top: var(--border-width) solid var(--color-border);
}

.control-section h2 {
  margin-bottom: var(--space-sm);
  color: var(--color-text-soft);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-body);
}

.toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.toolbar:last-child {
  margin-bottom: 0;
}

.field {
  display: grid;
  gap: var(--space-xs);
  width: 170px;
}

.field-small {
  width: 110px;
}

.field-wide {
  width: 220px;
}

.field span {
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

#output {
  min-height: 240px;
  margin-top: var(--space-md);
}

.level-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.level-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-height: 110px;
  height: auto;
  padding: 1.5rem;
  border-radius: 8px;
  background: var(--color-surface-muted);
  border: 2px solid var(--color-border);
  color: var(--color-text);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.level-card:hover {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.level-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
}

.level-card-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.concept-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.concept-loading {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.concept-item {
  display: flex;
  align-items: stretch;
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.concept-item-open {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 6px 0 0 6px;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.concept-item-open:hover {
  background: #f1f5f9;
}

.concept-item-delete {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  background: transparent;
  border: none;
  border-left: 1px solid #e2e8f0;
  border-radius: 0 6px 6px 0;
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.concept-item-delete:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

.concept-item-delete:disabled {
  opacity: 0.4;
  cursor: default;
}

.concept-meta {
  font-size: 0.8rem;
  font-weight: 400;
  color: #94a3b8;
  white-space: nowrap;
  margin-left: 1rem;
}

@media (max-width: 720px) {
  :root {
    --font-size-h1: 32px;
    --font-size-h2: 26px;
    --font-size-h3: 22px;
    --space-2xl: 36px;
  }

  body:not([class]) {
    padding: var(--space-md);
  }

  .container {
    width: min(100% - (var(--space-md) * 2), var(--container-width));
    max-width: 100%;
  }

  .panel {
    padding: var(--space-lg);
  }

  .header-inner {
    grid-template-columns: auto auto;
    justify-content: space-between;
    padding-block: var(--space-xs);
  }

  .primary-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: var(--space-lg);
    overflow-x: auto;
    padding-bottom: var(--space-2xs);
  }

  .header-cta {
    justify-self: end;
  }

  .field,
  .field-small,
  .field-wide,
  .button {
    width: 100%;
  }

  .level-select-grid {
    grid-template-columns: 1fr;
  }

  .app-shell,
  .panel,
  .content {
    width: min(100% - (var(--space-md) * 2), var(--container-width));
    max-width: 100%;
  }

  .card,
  .panel {
    padding: var(--space-lg);
  }

  .home-qubit-guide {
    grid-template-columns: 1fr;
    width: min(100% - (var(--space-md) * 2), var(--container-width));
  }

  .home-qubit-copy h2 {
    max-width: none;
    font-size: var(--font-size-h3);
  }
}

:root {
  --color-bg: var(--color-background);
  --color-primary: var(--color-primary-blue);
  --color-ghost-hover: var(--color-surface-muted);
  --shadow-md: var(--shadow-surface);
}

[data-theme="dark"],
[data-theme$="-dark"] {
  --color-bg: var(--color-background);
  --color-primary: var(--color-secondary-blue);
  --color-ghost-hover: var(--color-surface-muted);
}

.game-page-body {
  display: block;
}

.app-shell {
  width: min(100% - 2rem, var(--container-width));
  min-height: 100vh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}

.site-header,
.site-footer {
  width: 100%;
}

.button-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.content {
  width: 100%;
  flex: 1;
  padding-block: var(--space-lg);
}

.card {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-surface);
  padding: var(--space-lg);
}

.btn {
  cursor: pointer;
}

.btn {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--button-secondary-background);
  color: var(--color-text);
  font: inherit;
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.btn {
  min-height: 38px;
  padding: 0 var(--space-md);
}

.button-row .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  border-color: var(--button-primary-background);
  background: var(--button-primary-background);
  color: var(--button-primary-text);
}

.btn-secondary {
  border-color: var(--button-secondary-border);
  background: var(--button-secondary-background);
  color: var(--button-secondary-text);
}

.site-footer {
  padding-block: var(--space-md);
}

@media (max-width: 920px) {
  .home-hero {
    min-height: min(520px, calc(100vh - 150px));
  }

  .home-hero h1 {
    font-size: 3rem;
  }

  .home-hero::before {
    background-position: 58% center;
  }

  .home-hero::after {
    background:
      linear-gradient(90deg, rgba(6, 31, 64, 0.92) 0%, rgba(6, 31, 64, 0.72) 52%, rgba(6, 31, 64, 0.28) 100%),
      linear-gradient(0deg, rgba(6, 31, 64, 0.22), rgba(6, 31, 64, 0.08));
  }

  .home-quick-links {
    grid-template-columns: 1fr;
  }

  .home-card-strip,
  .home-workspace-grid,
  .home-support-grid,
  .home-proof {
    grid-template-columns: 1fr 1fr;
  }

  .home-work-card-primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  :root {
    --font-size-h1: 30px;
    --font-size-h2: 24px;
    --font-size-h3: 20px;
    --space-xl: 24px;
  }

  .home-page .home-shell {
    gap: var(--space-md);
  }

  .home-hero {
    min-height: min(460px, calc(100vh - 138px));
  }

  .home-hero-copy {
    padding-block: var(--space-lg);
  }

  .home-hero h1 {
    font-size: 2.35rem;
  }

  .home-hero-text {
    font-size: 1rem;
  }

  .home-hero::before {
    background-position: 64% center;
  }

  .home-hero::after {
    background: rgba(6, 31, 64, 0.72);
  }

  .home-link-card {
    min-height: 104px;
  }

  .home-section {
    gap: var(--space-md);
  }

  .home-section-header h2 {
    font-size: var(--font-size-h3);
  }

  .home-card-strip,
  .home-workspace-grid,
  .home-support-grid,
  .home-proof,
  .home-proof-list {
    grid-template-columns: 1fr;
  }

  .home-image-card {
    min-height: 240px;
  }

  .home-work-card,
  .home-work-card-primary,
  .home-support-item {
    min-height: 120px;
  }

  .home-proof {
    padding: var(--space-lg);
  }

  .home-qubit-guide {
    padding: var(--space-md);
  }

  .home-qubit-facts div,
  .home-image-card,
  .home-work-card,
  .home-work-card-primary,
  .home-support-item,
  .card,
  .panel {
    padding: var(--space-md);
  }

  .home-image-card strong,
  .home-work-card strong {
    font-size: 1.15rem;
  }

  .toolbar,
  .button-row {
    justify-content: center;
  }

  .button,
  .btn,
  button {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .language-switcher {
    width: 76px;
    min-width: 76px;
  }

  .language-switcher-option {
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
  }

  .language-switcher-option:hover,
  .language-switcher-option:focus-visible,
  .language-switcher-option.is-active {
    background: transparent;
  }

  .button-row {
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
  }

  .button-row .btn,
  .toolbar .button,
  .toolbar button {
    flex: 0 1 auto;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .button-row .btn,
  .toolbar .button,
  .toolbar button {
    flex: 0 1 auto;
    width: auto;
    min-width: 118px;
    min-height: 40px;
    max-width: 100%;
  }

  .button-row,
  .toolbar {
    align-items: center;
    justify-content: center;
  }
}
