@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Rowdies:wght@400;700&display=swap');

:root {
  color-scheme: light;
  
  /* Ordkongen Fantasy Theme Base */
  --primary: #2d5a3c;
  --primary-dark: #1e4029;
  --primary-shadow: #142e1d;
  --secondary: #8b5a2b;
  --secondary-dark: #6b421a;
  --secondary-shadow: #4a2d10;
  --background: #fdf8eb;
  --surface: #fcf7ec;
  --surface-hover: #ffffff;
  --text-main: #3b3a30;
  --text-muted: #6b695c;
  --border-light: #e8dcc4;
  --gold: #f5b041;
  --gold-dark: #d68910;
  --gold-shadow: #a04000;

  --font-heading: 'Rowdies', cursive;
  --font-body: 'Outfit', sans-serif;

  /* UI Sub-surfaces */
  --surface-soft-line: #e8dcc4;
  --surface-search: #fcf7ec;
  --surface-search-line: #e8dcc4;
  --surface-active: #f5eedc;
  --surface-success: #dff2e7;
  --surface-danger: #ffd6d2;
  --surface-disabled: #e7ebea;
  --floating-surface: rgba(253, 248, 235, 0.92);
  --floating-surface-strong: rgba(253, 248, 235, 0.98);
  --frame-surface: rgba(45, 90, 60, 0.92);
  --frame-line: rgba(255, 255, 255, 0.24);
  --popup-line: rgba(255, 255, 255, 0.18);
  
  --leaf: #2f7d55;
  --leaf-dark: #235f42;
  --coral: #d96459;
  --blue: #3975a6;
  --critical: #b73228;
  --critical-strong: #c84d4d;
  
  /* Status Colors */
  --status-neutral-text: #61706a;
  --status-neutral-bg: #f5f8f6;
  --status-neutral-line: #dae5de;
  --status-info-text: #365467;
  --status-info-bg: #eef6fb;
  --status-info-line: #cddfed;
  --status-warning-text: #7a5900;
  --status-warning-bg: #fff4d4;
  --status-warning-line: #efcf72;
  --status-success-text: #1f5d40;
  --status-success-bg: #e8f5ee;
  --status-success-line: #b8dec8;
  --status-danger-text: #5f4851;
  --status-danger-bg: #eef1f2;
  --status-danger-line: #cad4d7;
  
  /* Game Colors (Wordle, Crossword, etc.) */
  --ordjakt-text: #121213;
  --ordjakt-key: #e8dcc4;
  --ordjakt-border: #e8dcc4;
  --ordjakt-fill-border: #8b5a2b;
  --crossword-panel: #fcf7ec;
  --crossword-panel-line: #e8dcc4;
  --crossword-grid-bg: #1e4029;
  --crossword-cell: #ffffff;
  --crossword-ink: #3b3a30;
  --crossword-muted: #6b695c;
  --crossword-cell-number: rgba(255, 255, 255, 0.92);
  --crossword-active: #f5b041;
  --crossword-selected: #2d5a3c;
  --crossword-correct: #cbe8d4;
  --crossword-wrong: #f2c7c2;
  --ordjakt-correct: #2d5a3c;
  --ordjakt-correct-dark: #1e4029;
  --ordjakt-present: #f5b041;
  --ordjakt-present-dark: #d68910;
  --ordjakt-absent: #6b695c;
  --ordjakt-absent-dark: #3b3a30;
  
  /* Accents */
  --accent: #2d5a3c;
  --accent-soft: #fcf7ec;
  --accent-strong: #1e4029;
  --accent-line: #e8dcc4;
  --accent-wash: rgba(45, 90, 60, 0.12);
  --theme-toggle-track: rgba(45, 90, 60, 0.12);
  --page-glow: radial-gradient(circle at top right, rgba(245, 176, 65, 0.12), transparent 38%);
  
  /* Shadows */
  --shadow: 0 18px 44px rgba(45, 90, 60, 0.12);
  --shadow-strong: 0 24px 54px rgba(45, 90, 60, 0.18);
  --shadow-soft: 0 10px 22px rgba(45, 90, 60, 0.08);
  --shadow-soft-hover: 0 14px 28px rgba(45, 90, 60, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background-color: var(--background);
  background-image: radial-gradient(circle at 50% 0%, #ffffff 0%, var(--background) 100%);
}

body {
  min-height: 100vh;
  margin: 0;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  color: var(--text-main);
  background-color: var(--background);
  background-image: radial-gradient(circle at 50% 0%, #ffffff 0%, var(--background) 100%);
  font-family: var(--font-body, 'Outfit', sans-serif);
  line-height: 1.5;
  transition: background-color 180ms ease, color 180ms ease;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

/* ==========================================================================
   BUTTONS & UTILITIES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 1rem 2rem;
  border-radius: 9999px;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(to bottom, rgba(16, 185, 129, 0.85), rgba(5, 150, 105, 0.95)), url('../img/ui_button_wood.png') center/cover;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  box-shadow: 0 6px 0 var(--primary-shadow), 0 15px 20px rgba(45, 90, 60, 0.3), inset 0 2px 0 rgba(255,255,255,0.2);
}

.btn-primary:hover {
  transform: translateY(2px);
  box-shadow: 0 4px 0 var(--primary-shadow), 0 10px 15px rgba(45, 90, 60, 0.3);
}

.btn-primary:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--primary-shadow);
}

.btn-secondary {
  background: white;
  color: var(--text-main);
  box-shadow: 0 6px 0 var(--border-light), 0 15px 20px rgba(0,0,0,0.05);
  border: 2px solid var(--border-light);
}

.btn-secondary:hover {
  transform: translateY(2px);
  box-shadow: 0 4px 0 var(--border-light), 0 10px 15px rgba(0,0,0,0.05);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  padding: 16px max(16px, calc((100% - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--floating-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-logo-container {
  position: relative;
  display: inline-block;
  margin-top: 6px;
}

.brand-mark {
  width: 42px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: #f4d08f;
  border: 2px solid #c9a463;
  border-radius: 6px;
  font-family: Arial, sans-serif;
  box-shadow: 3px 4px 0 var(--accent);
  position: relative;
}

:root[data-color-scheme="dark"] .brand-mark {
  background: #e2be7a;
  color: #18211e;
}

.brand-mark .letter {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  margin-top: -2px;
}

.brand-mark .points {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.6rem;
  font-weight: bold;
}

.brand-crown {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%) rotate(12deg);
  font-size: 1.2rem;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.2));
  z-index: 1;
  user-select: none;
}

.brand-title,
.brand-subtitle {
  display: block;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.86rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  padding: 8px 11px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-line);
  outline: none;
}

.site-nav a.nav-info-link {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 9px;
}

.site-nav a.nav-highlight-btn {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary-dark);
  transition: all 180ms ease;
}

.site-nav a.nav-highlight-btn:hover,
.site-nav a.nav-highlight-btn:focus-visible {
  background: var(--primary-dark);
  color: #ffffff;
  border-color: var(--primary-shadow);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 90, 60, 0.15);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 180ms ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus-visible,
.nav-dropdown-toggle.active,
.nav-dropdown.open .nav-dropdown-toggle,
.nav-dropdown:hover .nav-dropdown-toggle {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-line);
  outline: none;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--floating-surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  min-width: 180px;
  z-index: 20;
  padding: 6px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-menu a {
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  margin-bottom: 2px;
}

.nav-dropdown-menu a:last-child {
  margin-bottom: 0;
}

/* Søkefelt */
.nav-search-container {
  position: relative;
  margin-left: 8px;
  display: flex;
  align-items: center;
}

.nav-search-input {
  padding: 8px 14px 8px 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-search) url('data:image/svg+xml;utf8,<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%2361706a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>') no-repeat 12px center;
  color: var(--ink);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  width: 160px;
  transition: all 0.2s ease;
}

.nav-search-input::placeholder {
  color: var(--muted);
}

.nav-search-input:focus {
  width: 220px;
  border-color: var(--accent);
  background-color: var(--white);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.nav-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--floating-surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  width: max(100%, 220px);
  display: flex;
  flex-direction: column;
  z-index: 20;
  padding: 6px;
}

.nav-search-results[hidden] {
  display: none !important;
}

.nav-search-results a,
.nav-search-no-results {
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  margin-bottom: 2px;
}

.nav-search-results a:last-child {
  margin-bottom: 0;
}

.nav-search-results a:hover,
.nav-search-results a:focus-visible {
  background: var(--surface-active);
  color: var(--accent-strong);
  border-color: var(--accent-line);
}

.nav-search-no-results {
  color: var(--muted);
  font-style: italic;
  font-weight: normal;
  text-align: center;
  padding: 14px;
}

.theme-controls {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-menu-button,
.theme-swatch {
  min-height: 42px;
  min-width: 42px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-strong);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.theme-menu-button:hover,
.theme-menu-button:focus-visible,
.theme-swatch:hover,
.theme-swatch:focus-visible {
  transform: translateY(-1px);
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-soft-hover);
  outline: none;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  width: max-content;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  background: var(--floating-surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.theme-menu[hidden] {
  display: none;
}

.theme-swatch[data-active="true"] {
  border-color: var(--accent-strong);
  box-shadow: inset 0 0 0 2px var(--accent-soft), var(--shadow-soft-hover);
}

.theme-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-preview-color {
  width: 16px;
  aspect-ratio: 1;
  display: block;
  background: var(--theme-preview-color, var(--accent));
  border: 1px solid rgba(23, 33, 33, 0.12);
  border-radius: 999px;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.intro-section {
  min-height: 280px;
  padding: 42px 0 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 32px;
  align-items: end;
}

body.theme-home .intro-section {
  min-height: auto;
  padding: 18px 0 22px;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}

.intro-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 8vw, 5.4rem);
  line-height: 0.96;
}

h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  line-height: 1.1;
}

.intro-copy p:last-child,
.page-heading p:last-child,
.coming-soon p,
.featured-panel p,
.theme-card p {
  color: var(--muted);
  font-size: 1.05rem;
}

.intro-copy p:last-child {
  max-width: 560px;
}

.intro-image {
  margin: 0;
}

.intro-image img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
  padding: 8px 0 44px;
  align-items: stretch;
}

body.theme-home .game-grid[aria-label="Spillvalg"] {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.about-section {
  padding: 44px 0;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

.about-section h2 {
  font-size: 1.6rem;
  margin: 0 0 12px;
  color: var(--accent-strong);
}

.about-section p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}

.game-card {
  min-height: 200px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-5px);
  border-color: var(--ink);
  box-shadow: var(--shadow-strong);
  outline: none;
}

.card-art {
  width: 100%;
  max-width: 180px;
  margin: 0 auto;
  align-self: start;
}

.crossword-art,
.mini-crossword,
.large-crossword {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.crossword-art span,
.mini-crossword span,
.large-crossword span {
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--surface-soft-line);
}

.crossword-art span:empty,
.mini-crossword span:empty,
.large-crossword span.empty {
  background: var(--ink);
  border-color: var(--ink);
}

.wordsearch-art,
.search-preview {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  position: relative;
}

.wordsearch-art span,
.search-preview span {
  position: relative;
  z-index: 1;
  color: var(--ink);
  background: var(--surface-search);
  border: 1px solid var(--surface-search-line);
}

.wordsearch-art::after {
  content: "";
  position: absolute;
  top: 15%;
  left: 5%;
  width: 90%;
  height: 30%;
  background: rgba(255, 210, 0, 0.45);
  border-radius: 999px;
  transform-origin: top left;
  transform: rotate(32deg);
  z-index: 2;
  pointer-events: none;
}

.anagram-art,
.anagram-preview {
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.anagram-art span,
.anagram-preview span {
  width: 46px;
  color: #333;
  background: #e8d5a6;
  border: 1px solid #c9b37c;
  border-radius: 4px;
  box-shadow: 2px 3px 5px rgba(0,0,0,0.2);
  transform: rotate(var(--tilt, 0deg));
  position: relative;
}

.anagram-art span::after,
.anagram-preview span::after {
  content: "1";
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.5rem;
  font-weight: 700;
  color: #555;
}

.anagram-art span:nth-child(1) { --tilt: -8deg; }

.anagram-art span:nth-child(2) { --tilt: 6deg; }

.anagram-art span:nth-child(3) { --tilt: -3deg; }

.anagram-art span:nth-child(4) { --tilt: 9deg; }

.anagram-art span:nth-child(5) { --tilt: -6deg; }

.anagram-art span:nth-child(6) { --tilt: 4deg; }



.ordjakt-art {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  transform: rotateX(50deg) rotateZ(-35deg) scale(0.9);
  transform-style: preserve-3d;
  margin-top: 15px;
}

.ordjakt-art span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 6px;
  font-weight: 800;
  color: var(--white);
  background: var(--ordjakt-absent);
  border: 1px solid var(--ordjakt-border);
  box-shadow: -2px 2px 0px rgba(0,0,0,0.15);
}

.ordjakt-art span:nth-child(1),
.ordjakt-art span:nth-child(4),
.ordjakt-art span:nth-child(8) {
  background: var(--leaf);
  border-color: var(--leaf);
}

.ordjakt-art span:nth-child(2),
.ordjakt-art span:nth-child(7) {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.ordfall-art {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.ordfall-art span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  color: var(--white);
  background: linear-gradient(145deg, var(--blue), var(--accent-strong));
  border: 1px solid var(--accent-strong);
  box-shadow: 3px 3px 0 rgba(23, 33, 33, 0.15);
}

.ordfall-art span:nth-child(4) {
  opacity: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.ordfall-art span:nth-child(n + 5) {
  animation: float-fall-alt 3.5s infinite ease-in-out;
}

@keyframes float-fall {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(6px) rotate(2deg); }
}

@keyframes float-fall-alt {
  0%, 100% { transform: translateY(8px) rotate(0deg); }
  50% { transform: translateY(14px) rotate(-2deg); }
}

.ordfall-art span:nth-child(1) { animation: float-fall 3s infinite ease-in-out; }
.ordfall-art span:nth-child(2) { animation: float-fall 3.2s infinite ease-in-out 1s; }
.ordfall-art span:nth-child(3) { animation: float-fall 2.8s infinite ease-in-out 0.5s; }

.andre-sprak-art {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.andre-sprak-art span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  color: var(--white);
  background: linear-gradient(145deg, var(--leaf), var(--accent-strong));
  border: 1px solid var(--leaf-dark);
  box-shadow: 3px 3px 0 rgba(23, 33, 33, 0.15);
}

.flag-art {
  width: 100%;
  max-width: 140px;
  margin: 0 auto;
  align-self: start;
  aspect-ratio: 3 / 2;
  min-height: 92px;
  flex: 0 0 auto;
  box-sizing: border-box;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.1);
  display: block;
  position: relative;
  overflow: hidden;
  background-color: #ffffff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

.flag-de {
  background: linear-gradient(to bottom, #000000 33.33%, #FF0000 33.33%, #FF0000 66.66%, #FFCC00 66.66%) !important;
}

.flag-fr {
  background: linear-gradient(to right, #0055A4 33.33%, #FFFFFF 33.33%, #FFFFFF 66.66%, #EF4135 66.66%) !important;
}

.flag-es {
  background: linear-gradient(to bottom, #AA151B 25%, #F1BF00 25%, #F1BF00 75%, #AA151B 75%) !important;
  position: relative;
}
.flag-es::after {
  content: "";
  position: absolute;
  left: 30%;
  top: 50%;
  transform: translateY(-50%);
  width: 12%;
  aspect-ratio: 3/4;
  background: #AA151B;
  border-radius: 2px;
}

.flag-en {
  background: repeating-linear-gradient(to bottom, #B22234 0, #B22234 10%, #FFFFFF 10%, #FFFFFF 20%) !important;
  position: relative;
}
.flag-en::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 55%;
  background: #3C3B6E;
  border-bottom-right-radius: 2px;
}

.flag-ru {
  background: linear-gradient(to bottom, #FFFFFF 33.33%, #0039A6 33.33%, #0039A6 66.66%, #D52B1E 66.66%) !important;
}

.flag-zh {
  background: #EE1C25 !important;
  position: relative;
}
.flag-zh::after {
  content: "★";
  position: absolute;
  top: 10%;
  left: 15%;
  color: #FFFF00;
  font-size: 2.4rem;
  line-height: 1;
}

.flag-it {
  background: linear-gradient(to right, #009246 33.33%, #FFFFFF 33.33%, #FFFFFF 66.66%, #CE2B37 66.66%) !important;
}

.flag-pl {
  background: linear-gradient(to bottom, #FFFFFF 50%, #DC143C 50%) !important;
}

.flag-hi {
  background: linear-gradient(to bottom, #FF9933 33.33%, #FFFFFF 33.33%, #FFFFFF 66.66%, #138808 66.66%) !important;
  position: relative;
}
.flag-hi::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid #000080;
}

.flag-uk {
  background: linear-gradient(to bottom, #0057B7 50%, #FFDD00 50%) !important;
}

.flag-br {
  background: #009B3A !important;
  position: relative;
  overflow: hidden;
}
.flag-br::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 10%;
  right: 10%;
  bottom: 10%;
  background: #FEDF00;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.flag-br::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2rem;
  height: 2rem;
  background: #002776;
  border-radius: 50%;
}

.flag-ja {
  background: #FFFFFF !important;
  position: relative;
  border: 1px solid var(--surface-soft-line);
}
.flag-ja::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2rem;
  height: 2rem;
  background: #BC002D;
  border-radius: 50%;
}

.tastemesteren-art,
.tastemesteren-preview {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  width: 100%;
  max-width: 160px;
}

.tastemesteren-art span,
.tastemesteren-preview span {
  display: grid;
  place-items: center;
  width: calc(20% - 4px);
  aspect-ratio: 1;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--surface-soft-line);
  box-shadow: 2px 2px 0 rgba(23, 33, 33, 0.15);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.tastemesteren-art span:empty,
.tastemesteren-preview span:empty {
  background: var(--surface-soft);
  border-color: var(--surface-soft-line);
  box-shadow: none;
}

/* Light up a few keys */
.tastemesteren-art span:nth-child(4),
.tastemesteren-art span:nth-child(9) {
  background: var(--leaf);
  color: var(--white);
  border-color: var(--leaf-dark);
  transform: translateY(2px);
  box-shadow: 0px 0px 0 rgba(23, 33, 33, 0.15);
}

/* The spacebar */
.tastemesteren-art span:nth-child(13) {
  width: calc(60% - 4px);
  aspect-ratio: auto;
  height: 28px;
  color: transparent;
  background: var(--surface-soft);
}

/* Hide the last two keys to make room for spacebar */
.tastemesteren-art span:nth-child(14),
.tastemesteren-art span:nth-child(15) {
  display: none;
}

.card-text {
  display: block;
  flex: 1 1 auto;
}

.card-title,
.card-description,
.card-action {
  display: block;
}

.card-title {
  margin-bottom: 0;
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  font-weight: 850;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.card-description {
  color: var(--muted);
  max-width: 24ch;
  font-size: 0.98rem;
}

.card-action {
  width: fit-content;
  margin-top: auto;
  padding: 8px 11px;
  color: var(--white);
  background: var(--ink);
  border-radius: 8px;
  font-weight: 800;
}

.page-heading,
.coming-soon {
  max-width: 780px;
}

.page-heading {
  padding: 34px 0 14px;
}

.theme-section {
  padding-bottom: 16px;
}

.coming-soon {
  padding: 54px 0 30px;
}

.featured-panel {
  margin: 10px 0 26px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--text-main);
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.featured-panel--center {
  justify-content: center;
  text-align: center;
}

.featured-panel--text {
  display: block;
}

.featured-panel__content {
  max-width: 62ch;
}

.featured-panel__content h2 {
  margin: 0 0 12px;
}

.featured-panel__content p {
  margin: 0 0 12px;
}

.featured-panel__content p:last-child {
  margin-bottom: 0;
}

.featured-panel .eyebrow,
.featured-panel p {
  color: var(--text-muted);
}

.overview-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.overview-actions a {
  text-decoration: none;
}

.primary-link,
.theme-card {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  color: var(--ink);
  background: var(--white);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.primary-link:hover,
.primary-link:focus-visible,
.theme-card:hover,
.theme-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.primary-link {
  color: var(--white);
  background: var(--accent-strong);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 36px;
}

.theme-card {
  min-height: 0;
  padding: 11px 12px 10px;
  display: block;
  color: inherit;
  background: var(--floating-surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.theme-card:hover,
.theme-card:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: var(--shadow-soft-hover);
}

.theme-card h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.1;
}

.theme-level {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 7px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.coming-soon {
  min-height: 540px;
}

.puzzle-shell {
  min-height: 520px;
  padding: 54px 0 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 32px;
  align-items: center;
}

.puzzle-copy {
  max-width: 700px;
}

.puzzle-copy p {
  color: var(--muted);
  font-size: 1.05rem;
}

.puzzle-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.secondary-button {
  min-height: 42px;
  padding: 9px 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-line);
  outline: none;
}

.puzzle-board {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.large-crossword {
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.large-crossword span {
  min-width: 0;
  font-size: clamp(0.8rem, 3vw, 1.4rem);
}

.clue-section {
  padding: 0 0 52px;
}

.clue-section h2 {
  margin-bottom: 16px;
}

.clue-list {
  max-width: 780px;
  margin: 0;
  padding-left: 24px;
  color: var(--muted);
  font-size: 1.05rem;
}

.clue-list li + li {
  margin-top: 10px;
}

.theme-choice {
  min-height: 560px;
  padding: 54px 0 52px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: start;
  max-width: 800px;
  margin: 0 auto;
}

.theme-choice > div:first-child {
  text-align: center;
}

.theme-choice p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.word-count-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.word-count-card {
  min-height: 220px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text-main);
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: all 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.word-count-card:hover,
.word-count-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--primary);
  background: var(--surface-hover);
  box-shadow: var(--shadow-md);
  outline: none;
}

.word-count-card.active {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 2px var(--gold), 0 15px 30px rgba(214, 137, 16, 0.15);
  transform: translateY(-4px);
}

.word-count-card span {
  width: 58px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #ffffff !important;
  background: var(--primary-dark);
  border-radius: 12px;
  font-size: 1.5rem;
  font-weight: 850;
  font-family: var(--font-heading);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.word-count-card.active span {
  background: var(--gold);
  color: var(--text-main) !important;
  box-shadow: 0 4px 12px rgba(214, 137, 16, 0.3);
}

.word-count-card strong {
  display: block;
  font-size: 1.5rem;
  margin-top: 1rem;
  font-family: var(--font-heading);
}

.word-count-card small {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.play-crossword-grid {
  --cell-size: clamp(20px, 2.4vw, 30px);
  display: grid;
  grid-template-columns: repeat(var(--crossword-width), var(--cell-size));
  width: max-content;
  margin: 0 auto;
  border: 2px solid var(--crossword-grid-bg);
  background: var(--crossword-grid-bg);
  gap: 2px;
}

.clue-group {
  min-width: 0;
}

.clue-group summary {
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 850;
  list-style-position: inside;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.stats-grid div {
  min-height: 78px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.stats-grid strong {
  font-size: 1.25rem;
  line-height: 1.1;
}

.game-shell {
  padding: 12px 0 52px;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  align-items: start;
}

.game-panel,
.sidebar-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.game-panel {
  padding: 20px;
}

.game-panel-head {
  margin-bottom: 16px;
}

.game-panel-head h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.98;
}

.game-panel-head p:last-child,
.sidebar-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.game-status {
  min-height: 28px;
  margin: 0 0 16px;
  padding: 11px 14px;
  color: var(--status-neutral-text);
  background: var(--status-neutral-bg);
  border: 1px solid var(--status-neutral-line);
  border-radius: 12px;
  font-size: 0.94rem;
  font-weight: 800;
}

.game-status[data-tone="info"] {
  color: var(--status-info-text);
  background: var(--status-info-bg);
  border-color: var(--status-info-line);
}

.game-status[data-tone="warning"] {
  color: var(--status-warning-text);
  background: var(--status-warning-bg);
  border-color: var(--status-warning-line);
}

.game-status[data-tone="success"] {
  color: var(--status-success-text);
  background: var(--status-success-bg);
  border-color: var(--status-success-line);
}

.game-status[data-tone="danger"] {
  color: var(--status-danger-text);
  background: var(--status-danger-bg);
  border-color: var(--status-danger-line);
}

.game-sidebar {
  display: grid;
  gap: 18px;
}

.sidebar-card {
  padding: 18px;
}

.sidebar-card h2 {
  margin-bottom: 12px;
  color: var(--accent-strong);
  font-size: 1.15rem;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-stats div {
  min-height: 74px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-stats span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.mini-stats strong {
  font-size: 1.25rem;
}

.sidebar-actions,
.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.size-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.size-toolbar .chip-row {
  flex: 1 1 auto;
}

.theme-chip {
  min-height: 38px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.theme-chip:hover,
.theme-chip:focus-visible,
.theme-chip.active {
  color: var(--white);
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  outline: none;
}

.word-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-pill {
  padding: 7px 10px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.word-pill.found {
  color: var(--white);
  background: var(--leaf);
  border-color: var(--leaf);
}

.seo-copy {
  margin: 0 0 52px;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.seo-copy h2 {
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.seo-copy p {
  max-width: 64ch;
  color: var(--muted);
  font-size: 0.95rem;
}

.search-preview {
  grid-template-columns: repeat(6, 1fr);
}

.search-preview span:nth-child(n+13):nth-child(-n+18) {
  background: var(--surface-danger);
  border-color: var(--coral);
}

.anagram-preview {
  justify-content: flex-start;
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 36px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  border-top: 1px solid var(--border);
}

.footer-back-nav a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.footer-back-nav a:hover {
  text-decoration: underline;
}

.footer-global-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.footer-global-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-global-nav a:hover {
  color: var(--ink);
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 980px) {
  .intro-section {
    grid-template-columns: 1fr;
  }

.puzzle-shell {
    grid-template-columns: 1fr;
  }

.theme-choice {
    grid-template-columns: 1fr;
  }

.game-layout {
    grid-template-columns: 1fr;
  }

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

.intro-image {
    max-width: 420px;
  }

.game-grid,
  .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.theme-home .game-grid[aria-label="Spillvalg"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 700px) {
  .game-shell {
    padding-top: 8px;
  }

.game-panel,
  .sidebar-card {
    padding: 14px;
  }

.site-header {
    align-items: flex-start;
    flex-direction: column;
  }

.site-nav {
    justify-content: flex-start;
  }

.theme-controls {
    width: 100%;
  }

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

.theme-menu-button {
    margin-left: 0;
  }

.intro-section {
    min-height: auto;
    padding-top: 28px;
  }

.game-grid,
  .theme-grid {
    grid-template-columns: 1fr;
  }

  body.theme-home .game-grid[aria-label="Spillvalg"] {
    grid-template-columns: 1fr;
  }

.game-card {
    min-height: 240px;
  }

.featured-panel {
    align-items: flex-start;
    flex-direction: column;
  }

.word-count-grid {
    grid-template-columns: 1fr;
  }

.word-count-card {
    min-height: 160px;
  }

.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@keyframes ordjakt-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  50% {
    transform: translateX(4px);
  }

  75% {
    transform: translateX(-3px);
  }
}
.intro-eyebrow { margin-bottom: 0.25rem; }
.intro-title { font-size: 2.5rem; font-weight: 800; margin-top: 0; line-height: 1.1; }


input, textarea, [contenteditable] {
  user-select: auto;
  -webkit-user-select: auto;
}

/* Native App Hide Rules */
.is-native-app .intro-section,
.is-native-app .intro-copy,
.is-native-app [class$='-seo-article'],
.is-native-app .featured-panel,
.is-native-app .site-footer {
  display: none !important;
}

/* Adjust top padding if intro-section is hidden on the home page */
.is-native-app.theme-home main {
  padding-top: 2rem;
}

a, button, input, textarea, [role='button'] {
  touch-action: manipulation;
}

.is-native-app .brand-title,
.is-native-app .brand-subtitle {
  display: none !important;
}

.is-native-app .brand-mark {
  width: 36px;
}

.is-native-app .site-header {
  padding: 12px max(16px, calc((100% - 1120px) / 2));
  padding-top: max(12px, env(safe-area-inset-top));
}
/* ==========================================================================
   GLOBAL HEADER (PORTED FROM HOME)
   ========================================================================== */
.home-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 3rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  border-bottom: 2px solid var(--border-light);
  box-sizing: border-box;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.home-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.home-logo .icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo-text {
  display: flex;
  flex-direction: column;
}

body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.logo-main {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: 0.5px;
}

.logo-sub {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.home-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1rem;
  margin-right: 1.5rem;
  transition: color 0.2s;
  position: relative;
}

.home-nav a:hover, .home-nav a.active {
  color: var(--text-main);
}

.home-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.header-search {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.4rem 1rem;
  gap: 0.5rem;
  width: 250px;
}

.header-search .search-input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-family: var(--font-body);
  color: var(--text-main);
}

.user-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-light);
  font-weight: 800;
  font-size: 1rem;
}

.user-stats .gem {
  color: var(--primary);
}

.user-stats .coin {
  color: var(--gold);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: white;
  padding: 0.4rem 1rem 0.4rem 0.4rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--gold);
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 4px 10px rgba(251, 191, 36, 0.2);
}

.user-profile:hover {
  transform: scale(1.05);
}

.avatar-wrapper {
  width: 42px;
  height: 42px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 2px solid white;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.username {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.user-level {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* ==========================================================================
   BOXED LAYOUT FOR SUBPAGES (DESKTOP)
   ========================================================================== */
@media (min-width: 1024px) {
  /* Constrain the main content to 70% width */
  body:not(.theme-home) main {
    width: 70%;
    max-width: 1400px; /* Sane upper limit */
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.15); /* Softer shadow since background is lighter */
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: var(--surface) !important; /* Use surface color for the game area to contrast with body's paper color */
  }

  body:not(.theme-home) main {
    min-height: calc(100vh - 160px); /* Ensure it stretches down nicely */
  }
}
