:root {
  --bg: #f8fafc;
  --bg-end: #eef4ff;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.78);
  --surface-input: rgba(255, 255, 255, 0.92);
  --surface-muted: rgba(241, 245, 249, 0.86);
  --text: #0f172a;
  --muted: #475569;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.14);
  --accent-contrast: #eff6ff;
  --border: #e2e8f0;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  --header-bg: rgba(248, 250, 252, 0.84);
  --card-top: rgba(255, 255, 255, 0.98);
  --card-bottom: rgba(241, 245, 249, 0.98);
  --code-bg: rgba(226, 232, 240, 0.92);
  --bg-glow: rgba(37, 99, 235, 0.12);
  --focus-ring: rgba(37, 99, 235, 0.28);
  --success: #15803d;
  --error: #b91c1c;
  --primary-text: #eff6ff;
  --primary-hover: #1d4ed8;
  --pattern-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1200' fill='none'%3E%3Crect width='1600' height='1200' fill='transparent'/%3E%3Cg fill='%2364748B' fill-opacity='.05' font-family='Manrope,Segoe UI,sans-serif' font-weight='800' letter-spacing='2'%3E%3Ctext x='-52' y='132' font-size='110'%3E%D0%9C%D0%9E%D0%A1%D0%9A%D0%92%D0%90%3C/text%3E%3Ctext x='1092' y='222' font-size='82'%3E%D0%A1%D0%9E%D0%A7%D0%98%3C/text%3E%3Ctext x='140' y='332' font-size='94' transform='rotate(-8 140 332)'%3E%D0%9A%D0%90%D0%97%D0%90%D0%9D%D0%AC%3C/text%3E%3Ctext x='1168' y='356' font-size='90' transform='rotate(5 1168 356)'%3E%D0%9F%D0%90%D0%A0%D0%98%D0%96%3C/text%3E%3Ctext x='690' y='540' font-size='78'%3E%D0%9E%D0%9C%D0%A1%D0%9A%3C/text%3E%3Ctext x='-18' y='676' font-size='88'%3E%D0%A1%D0%90%D0%9C%D0%90%D0%A0%D0%90%3C/text%3E%3Ctext x='470' y='492' font-size='116' transform='rotate(3 470 492)'%3E%D0%A2%D0%9E%D0%9C%D0%A1%D0%9A%3C/text%3E%3Ctext x='1146' y='782' font-size='102'%3E%D0%9C%D0%98%D0%9D%D0%A1%D0%9A%3C/text%3E%3Ctext x='222' y='934' font-size='104'%3E%D0%9F%D0%95%D0%A0%D0%9C%D0%AC%3C/text%3E%3Ctext x='918' y='1096' font-size='118' transform='rotate(-4 918 1096)'%3E%D0%90%D0%9B%D0%9C%D0%90%D0%A2%D0%AB%3C/text%3E%3Ctext x='710' y='710' font-size='78'%3E%D0%A0%D0%98%D0%9C%3C/text%3E%3Ctext x='1288' y='1166' font-size='92'%3E%D0%A2%D0%A3%D0%9B%D0%90%3C/text%3E%3C/g%3E%3Cg fill='%2364748B' fill-opacity='.034' font-family='Manrope,Segoe UI,sans-serif' font-weight='700' letter-spacing='1.5'%3E%3Ctext x='812' y='110' font-size='34'%3E%D0%9C%D0%9E%D0%A1%D0%9A%D0%92%D0%90%20%E2%86%92%20%D0%90%D0%9D%D0%90%D0%9F%D0%90%20%E2%86%92%20%D0%90%D0%A1%D0%A2%D0%90%D0%9D%D0%90%3C/text%3E%3Ctext x='110' y='1146' font-size='30'%3E%D0%A0%D0%98%D0%9C%20%E2%86%92%20%D0%9C%D0%98%D0%9D%D0%A1%D0%9A%20%E2%86%92%20%D0%9A%D0%90%D0%97%D0%90%D0%9D%D0%AC%3C/text%3E%3C/g%3E%3C/svg%3E");
  --pattern-image-mobile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 1200' fill='none'%3E%3Crect width='900' height='1200' fill='transparent'/%3E%3Cg fill='%2364748B' fill-opacity='.042' font-family='Manrope,Segoe UI,sans-serif' font-weight='800' letter-spacing='2'%3E%3Ctext x='-28' y='118' font-size='88'%3E%D0%9C%D0%9E%D0%A1%D0%9A%D0%92%D0%90%3C/text%3E%3Ctext x='448' y='242' font-size='72'%3E%D0%9A%D0%90%D0%97%D0%90%D0%9D%D0%AC%3C/text%3E%3Ctext x='76' y='402' font-size='70'%3E%D0%A1%D0%9E%D0%A7%D0%98%3C/text%3E%3Ctext x='466' y='560' font-size='82'%3E%D0%A2%D0%9E%D0%9C%D0%A1%D0%9A%3C/text%3E%3Ctext x='180' y='784' font-size='92'%3E%D0%9F%D0%95%D0%A0%D0%9C%D0%AC%3C/text%3E%3Ctext x='610' y='1008' font-size='66'%3E%D0%A0%D0%98%D0%9C%3C/text%3E%3C/g%3E%3Cg fill='%2364748B' fill-opacity='.026' font-family='Manrope,Segoe UI,sans-serif' font-weight='700'%3E%3Ctext x='46' y='1140' font-size='24'%3E%D0%9C%D0%9E%D0%A1%D0%9A%D0%92%D0%90%20%E2%86%92%20%D0%90%D0%9D%D0%90%D0%9F%D0%90%20%E2%86%92%20%D0%90%D0%A1%D0%A2%D0%90%D0%9D%D0%90%3C/text%3E%3C/g%3E%3C/svg%3E");
  --radius: 20px;
  --container: 1120px;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-end: #111827;
  --surface: #1e293b;
  --surface-soft: rgba(15, 23, 42, 0.7);
  --surface-input: rgba(15, 23, 42, 0.66);
  --surface-muted: rgba(15, 23, 42, 0.34);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --accent: #22c55e;
  --accent-strong: #16a34a;
  --accent-soft: rgba(34, 197, 94, 0.18);
  --accent-contrast: #052e16;
  --border: #334155;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
  --header-bg: rgba(15, 23, 42, 0.86);
  --card-top: rgba(30, 41, 59, 0.98);
  --card-bottom: rgba(22, 32, 51, 0.98);
  --code-bg: rgba(15, 23, 42, 0.45);
  --bg-glow: rgba(34, 197, 94, 0.14);
  --focus-ring: rgba(34, 197, 94, 0.3);
  --success: #86efac;
  --error: #fca5a5;
  --primary-text: #052e16;
  --primary-hover: #4ade80;
  --pattern-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1200' fill='none'%3E%3Crect width='1600' height='1200' fill='transparent'/%3E%3Cg fill='%23F8FAFC' fill-opacity='.04' font-family='Manrope,Segoe UI,sans-serif' font-weight='800' letter-spacing='2'%3E%3Ctext x='-52' y='132' font-size='110'%3E%D0%9C%D0%9E%D0%A1%D0%9A%D0%92%D0%90%3C/text%3E%3Ctext x='1092' y='222' font-size='82'%3E%D0%A1%D0%9E%D0%A7%D0%98%3C/text%3E%3Ctext x='140' y='332' font-size='94' transform='rotate(-8 140 332)'%3E%D0%9A%D0%90%D0%97%D0%90%D0%9D%D0%AC%3C/text%3E%3Ctext x='1168' y='356' font-size='90' transform='rotate(5 1168 356)'%3E%D0%9F%D0%90%D0%A0%D0%98%D0%96%3C/text%3E%3Ctext x='690' y='540' font-size='78'%3E%D0%9E%D0%9C%D0%A1%D0%9A%3C/text%3E%3Ctext x='-18' y='676' font-size='88'%3E%D0%A1%D0%90%D0%9C%D0%90%D0%A0%D0%90%3C/text%3E%3Ctext x='470' y='492' font-size='116' transform='rotate(3 470 492)'%3E%D0%A2%D0%9E%D0%9C%D0%A1%D0%9A%3C/text%3E%3Ctext x='1146' y='782' font-size='102'%3E%D0%9C%D0%98%D0%9D%D0%A1%D0%9A%3C/text%3E%3Ctext x='222' y='934' font-size='104'%3E%D0%9F%D0%95%D0%A0%D0%9C%D0%AC%3C/text%3E%3Ctext x='918' y='1096' font-size='118' transform='rotate(-4 918 1096)'%3E%D0%90%D0%9B%D0%9C%D0%90%D0%A2%D0%AB%3C/text%3E%3Ctext x='710' y='710' font-size='78'%3E%D0%A0%D0%98%D0%9C%3C/text%3E%3Ctext x='1288' y='1166' font-size='92'%3E%D0%A2%D0%A3%D0%9B%D0%90%3C/text%3E%3C/g%3E%3Cg fill='%23F8FAFC' fill-opacity='.028' font-family='Manrope,Segoe UI,sans-serif' font-weight='700' letter-spacing='1.5'%3E%3Ctext x='812' y='110' font-size='34'%3E%D0%9C%D0%9E%D0%A1%D0%9A%D0%92%D0%90%20%E2%86%92%20%D0%90%D0%9D%D0%90%D0%9F%D0%90%20%E2%86%92%20%D0%90%D0%A1%D0%A2%D0%90%D0%9D%D0%90%3C/text%3E%3Ctext x='110' y='1146' font-size='30'%3E%D0%A0%D0%98%D0%9C%20%E2%86%92%20%D0%9C%D0%98%D0%9D%D0%A1%D0%9A%20%E2%86%92%20%D0%9A%D0%90%D0%97%D0%90%D0%9D%D0%AC%3C/text%3E%3C/g%3E%3C/svg%3E");
  --pattern-image-mobile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 1200' fill='none'%3E%3Crect width='900' height='1200' fill='transparent'/%3E%3Cg fill='%23F8FAFC' fill-opacity='.036' font-family='Manrope,Segoe UI,sans-serif' font-weight='800' letter-spacing='2'%3E%3Ctext x='-28' y='118' font-size='88'%3E%D0%9C%D0%9E%D0%A1%D0%9A%D0%92%D0%90%3C/text%3E%3Ctext x='448' y='242' font-size='72'%3E%D0%9A%D0%90%D0%97%D0%90%D0%9D%D0%AC%3C/text%3E%3Ctext x='76' y='402' font-size='70'%3E%D0%A1%D0%9E%D0%A7%D0%98%3C/text%3E%3Ctext x='466' y='560' font-size='82'%3E%D0%A2%D0%9E%D0%9C%D0%A1%D0%9A%3C/text%3E%3Ctext x='180' y='784' font-size='92'%3E%D0%9F%D0%95%D0%A0%D0%9C%D0%AC%3C/text%3E%3Ctext x='610' y='1008' font-size='66'%3E%D0%A0%D0%98%D0%9C%3C/text%3E%3C/g%3E%3Cg fill='%23F8FAFC' fill-opacity='.024' font-family='Manrope,Segoe UI,sans-serif' font-weight='700'%3E%3Ctext x='46' y='1140' font-size='24'%3E%D0%9C%D0%9E%D0%A1%D0%9A%D0%92%D0%90%20%E2%86%92%20%D0%90%D0%9D%D0%90%D0%9F%D0%90%20%E2%86%92%20%D0%90%D0%A1%D0%A2%D0%90%D0%9D%D0%90%3C/text%3E%3C/g%3E%3C/svg%3E");
}

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

body {
  margin: 0;
  min-width: 320px;
  position: relative;
  isolation: isolate;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, var(--bg-glow), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-end) 100%);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open main {
  z-index: 30;
}

body.modal-open .site-header,
body.modal-open .site-footer {
  z-index: 0;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--pattern-image);
  background-size: cover;
  background-position: center top;
}

a {
  color: inherit;
  text-decoration: none;
}

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

code {
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--code-bg);
  font-size: 0.95em;
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}

th,
td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  background: var(--surface-muted);
}

tr:last-child td {
  border-bottom: 0;
}

::selection {
  background: var(--accent-soft);
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1rem 0;
}

.header-inner {
  flex-wrap: wrap;
}

.footer-inner {
  flex-wrap: wrap;
  align-items: flex-start;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
}

.brand-logo {
  display: block;
  width: min(13rem, 48vw);
  height: auto;
  overflow: visible;
}

.brand-word {
  fill: var(--text);
  font: 800 108px/1 "Manrope", "Segoe UI", sans-serif;
  letter-spacing: 1px;
}

.brand-pattern {
  fill: color-mix(in srgb, var(--muted) 14%, transparent);
  font: 700 20px/1 "Manrope", "Segoe UI", sans-serif;
  letter-spacing: 2px;
}

.brand-route {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-point {
  fill: var(--accent);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.theme-toggle:focus-visible,
.button:focus-visible,
.alphabet-grid a:focus-visible,
.city-link-grid a:focus-visible,
.resident-chip:focus-visible,
.site-nav a:focus-visible,
.breadcrumbs a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-toggle__icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  flex-shrink: 0;
}

.theme-toggle__icon::before {
  content: "☀";
  font-size: 0.95rem;
  line-height: 1;
}

html[data-theme="dark"] .theme-toggle__icon::before {
  content: "☾";
}

.theme-toggle__text {
  white-space: nowrap;
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
  order: 3;
}

.site-nav a {
  color: var(--muted);
}

.site-nav a[aria-current="page"],
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.page-shell {
  padding: 1.5rem 0 3rem;
  display: grid;
  gap: 1rem;
}

.page-shell--narrow {
  max-width: 900px;
}

.card {
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.hero {
  padding: 1.85rem;
}

.eyebrow,
.tag {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
dl,
dd,
dt,
ul,
ol {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.15;
}

h3 {
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.lead,
.section-heading p,
.muted {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-actions {
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 3.25rem;
  padding: 0.85rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

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

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--primary-hover);
}

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

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--accent);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
}

.stats-grid,
.feature-grid {
  display: grid;
  gap: 1rem;
}

.hero .stats-grid {
  margin-top: 1rem;
}

.stat-card,
.feature-card {
  background: var(--surface-muted);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 1rem;
}

.game-rating-card {
  display: grid;
  gap: 1rem;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 38%),
    linear-gradient(135deg, var(--card-top), var(--card-bottom));
}

.game-rating-card::before {
  content: "";
  position: absolute;
  inset: auto -3rem -5rem auto;
  width: 12rem;
  height: 12rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  pointer-events: none;
}

.game-rating__content,
.game-rating__panel {
  position: relative;
  z-index: 1;
}

.game-rating__summary {
  margin-bottom: 0.45rem;
  font-weight: 800;
}

.game-rating__note,
.game-rating__status {
  margin-bottom: 0;
}

.game-rating__panel {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, #f59e0b 34%, var(--border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 84%, #fef3c7);
}

.game-rating__score {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.game-rating__stars {
  display: inline-block;
  position: relative;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: 0.08em;
}

.game-rating__stars-base {
  color: color-mix(in srgb, var(--muted) 28%, transparent);
}

.game-rating__stars-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #f59e0b;
  white-space: nowrap;
  transition: width 0.25s ease;
}

.game-rating__value {
  font-weight: 800;
}

.game-rating__vote {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.game-rating__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: color-mix(in srgb, var(--muted) 44%, transparent);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.game-rating__button:hover,
.game-rating__button:focus-visible,
.game-rating__button.is-previewed,
.game-rating__button.is-selected {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #f59e0b;
  transform: translateY(-1px);
}

.game-rating__button:disabled {
  cursor: default;
  opacity: 0.78;
  transform: none;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-value {
  display: block;
  font-size: 1.8rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.alphabet-grid a {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 3.25rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-weight: 800;
}

.alphabet-grid a:hover,
.alphabet-grid a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.city-list,
.plain-list {
  padding-left: 1.15rem;
}

.city-list li {
  margin-bottom: 0.65rem;
}

.city-list {
  columns: 1;
}

.city-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.city-link-grid a {
  padding: 0.72rem 1rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.city-link-grid a[aria-current="page"],
.city-link-grid a:hover,
.city-link-grid a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.resident-answer {
  margin-bottom: 1rem;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  line-height: 1.25;
  font-weight: 800;
}

.resident-search {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.resident-directory {
  display: grid;
  gap: 1rem;
}

.resident-directory__group {
  display: grid;
  gap: 0.75rem;
}

.resident-directory__group h3 {
  margin-bottom: 0;
}

.resident-chip-grid {
  display: grid;
  gap: 0.75rem;
}

.resident-chip {
  display: block;
  padding: 1rem;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.resident-chip:hover,
.resident-chip:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.resident-chip__city {
  display: block;
  font-size: 1rem;
}

.resident-chip__forms {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.resident-form-list {
  display: grid;
  gap: 0.75rem;
}

.resident-form-list div {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-muted);
}

.resident-form-list__label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.resident-form-list__value {
  display: block;
  font-size: 1.12rem;
  line-height: 1.2;
}

.resident-form-list + .city-link-grid {
  margin-top: 1rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-input);
  color: var(--text);
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.breadcrumbs {
  margin-bottom: -0.25rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible {
  color: var(--text);
}

.status {
  margin-bottom: 0;
  min-height: 1.5rem;
  color: var(--muted);
}

.status.success {
  color: var(--success);
}

.status.error {
  color: var(--error);
}

.game-chat-card {
  display: grid;
  gap: 1rem;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.game-widget {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 35;
  display: grid;
  justify-items: end;
  gap: 0.85rem;
  pointer-events: none;
}

.game-widget > * {
  pointer-events: auto;
}

.game-widget[hidden] {
  display: none;
}

.game-widget__teaser {
  position: relative;
  width: min(24rem, calc(100vw - 2rem));
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--accent-soft) 52%, var(--surface))),
    var(--surface);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.18);
  animation: game-widget-rise 0.45s ease;
}

html[data-theme="dark"] .game-widget__teaser {
  box-shadow: 0 28px 72px rgba(2, 6, 23, 0.45);
}

.game-widget__dismiss {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.game-widget__dismiss:hover,
.game-widget__dismiss:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.game-widget__teaser-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.game-widget__teaser-status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0.3rem color-mix(in srgb, var(--accent) 18%, transparent);
  animation: online-dot-pulse 1.4s ease-in-out infinite;
}

.game-widget__teaser-title {
  display: block;
  padding-right: 2.25rem;
  font-size: 1.1rem;
  line-height: 1.35;
}

.game-widget__teaser-message {
  display: grid;
  gap: 0.3rem;
}

.game-widget__teaser-message .chat-bubble {
  padding-right: 1.1rem;
}

.game-widget__teaser-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.game-widget__teaser-actions .button {
  width: auto;
}

.game-widget__launcher {
  width: min(24rem, calc(100vw - 2rem));
  display: grid;
  gap: 0.18rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--accent-soft) 55%, var(--surface))),
    var(--surface);
  color: var(--text);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.18);
  text-align: left;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: game-widget-rise 0.45s ease;
}

html[data-theme="dark"] .game-widget__launcher {
  box-shadow: 0 28px 72px rgba(2, 6, 23, 0.45);
}

.game-widget__launcher:hover,
.game-widget__launcher:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.game-widget__launcher-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.game-widget__launcher-status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0.3rem color-mix(in srgb, var(--accent) 18%, transparent);
  animation: online-dot-pulse 1.4s ease-in-out infinite;
}

.game-widget__launcher-title {
  font-size: 1.05rem;
}

.game-widget__launcher-text {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.game-widget__panel[hidden] {
  display: none;
}

.game-widget[data-state="open"] .game-widget__launcher {
  opacity: 0;
  transform: translateY(0.85rem) scale(0.96);
  pointer-events: none;
}

.game-widget__panel {
  width: min(25rem, calc(100vw - 2rem));
  height: min(42rem, calc(100dvh - 2rem));
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  border-radius: 28px;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.22);
}

html[data-theme="dark"] .game-widget__panel {
  box-shadow: 0 36px 96px rgba(2, 6, 23, 0.5);
}

.game-widget__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.game-widget__header h2 {
  margin-bottom: 0.2rem;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
}

.game-widget__header .muted {
  margin-bottom: 0;
}

.game-widget__eyebrow {
  margin-bottom: 0.3rem;
}

.game-widget__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.game-widget__close:hover,
.game-widget__close:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.game-widget__meta {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.game-widget__meta .chat-letter-box {
  flex: 1 1 auto;
}

.game-widget__meta .button {
  flex-shrink: 0;
}

.game-widget__feed {
  padding-right: 0.15rem;
}

.game-widget__helper {
  gap: 0.55rem;
}

.game-widget__helper .muted {
  margin-bottom: 0;
}

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

@keyframes game-widget-rise {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes online-dot-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0.3rem color-mix(in srgb, var(--accent) 18%, transparent);
  }

  50% {
    opacity: 0.45;
    transform: scale(0.72);
    box-shadow: 0 0 0 0.55rem color-mix(in srgb, var(--accent) 8%, transparent);
  }
}

.game-launch-card {
  display: grid;
  gap: 1rem;
}

.game-modal[hidden] {
  display: none;
}

.game-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: stretch;
  padding: 0;
}

.game-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(10px);
}

.game-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.game-modal__header .eyebrow {
  margin-bottom: 0;
}

.game-modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.game-modal__close:hover,
.game-modal__close:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.game-chat-card--modal {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  scroll-margin-top: 0;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  padding:
    max(1rem, env(safe-area-inset-top))
    1.25rem
    max(0.75rem, env(safe-area-inset-bottom))
    1.25rem;
  gap: 0.8rem;
}

.game-chat-card--modal .chat-topbar {
  gap: 0.65rem;
}

.game-chat-card--modal .chat-topbar > div:first-child .muted,
.game-chat-card--modal .chat-helper {
  display: none;
}

.game-chat-card--modal .chat-topbar h2 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.game-chat-card--modal .chat-composer-wrap {
  gap: 0.35rem;
  padding-top: 0.7rem;
}

.game-chat-card--modal .chat-composer {
  padding: 0.5rem;
  gap: 0.5rem;
}

.game-chat-card--modal .chat-composer input,
.game-chat-card--modal .chat-composer .button {
  min-height: 3rem;
}

.chat-topbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-topbar__controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-letter-box {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-muted);
}

.chat-letter-box__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-letter-box__value {
  font-size: 1.3rem;
  line-height: 1;
}

.chat-feed {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: min(80%, 32rem);
}

.chat-message--player {
  margin-left: auto;
  align-items: flex-end;
}

.chat-message--bot {
  margin-right: auto;
  align-items: flex-start;
}

.chat-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.chat-bubble {
  padding: 0.85rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  overflow-wrap: anywhere;
}

html[data-theme="dark"] .chat-bubble {
  box-shadow: 0 18px 32px rgba(2, 6, 23, 0.24);
}

.chat-message--player .chat-bubble {
  background: var(--accent);
  border-color: transparent;
  color: var(--primary-text);
}

.chat-message--typing .chat-bubble {
  color: var(--muted);
}

.chat-message--error .chat-bubble {
  border-color: color-mix(in srgb, var(--error) 28%, var(--border));
  background: color-mix(in srgb, var(--error) 8%, var(--surface));
}

.chat-helper {
  display: grid;
  gap: 0.75rem;
}

.chat-composer-wrap {
  display: grid;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.chat-composer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chat-composer input {
  min-height: 3.6rem;
}

.chat-composer .button {
  width: 100%;
}

.chat-composer-wrap .status {
  margin: 0;
  padding: 0 0.25rem;
}

.faq-list {
  display: grid;
  gap: 1rem;
}

.faq-list div {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.faq-list div:first-child {
  padding-top: 0;
  border-top: 0;
}

.faq-list dt {
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.site-footer p {
  margin-bottom: 0;
  flex: 1 1 20rem;
}

.site-footer__credit {
  font-size: 0.875rem;
  opacity: 0.8;
  white-space: nowrap;
}

.site-footer__credit a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.site-footer__credit a:hover,
.site-footer__credit a:focus-visible {
  opacity: 1;
  border-bottom-color: currentColor;
}

.metrika-noscript {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

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

@media (min-width: 640px) {
  .header-inner {
    flex-wrap: nowrap;
  }

  .header-tools {
    margin-left: 0;
  }

  .site-nav {
    width: auto;
    order: 0;
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .hero-actions,
  .chat-composer,
  .chat-topbar__controls {
    flex-direction: row;
  }

  .hero-actions .button {
    width: auto;
  }

  .chat-composer {
    align-items: center;
  }

  .game-rating-card {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.82fr);
    align-items: center;
  }

  .chat-composer .button {
    width: auto;
    flex-shrink: 0;
  }

  .chat-composer input {
    flex: 1 1 auto;
  }

  .chat-topbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .chat-topbar__controls {
    align-items: center;
    justify-content: flex-end;
  }

  .chat-letter-box {
    min-width: 10rem;
  }

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

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

  .resident-form-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .resident-form-list--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .city-list {
    columns: 2;
    column-gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .game-modal {
    place-items: center;
    padding: 2rem;
  }

  .game-modal__backdrop {
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(12px);
  }

  .game-chat-card--modal {
    width: min(50vw, 60rem);
    max-width: calc(100vw - 4rem);
    height: min(84dvh, 56rem);
    max-height: min(84dvh, 56rem);
    border-radius: 32px;
    border: 1px solid var(--border);
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.22);
    padding: 1.25rem;
  }

  html[data-theme="dark"] .game-chat-card--modal {
    box-shadow: 0 36px 96px rgba(2, 6, 23, 0.52);
  }
}

@media (max-width: 639px) {
  body::before {
    background-image: var(--pattern-image-mobile);
    background-position: 56% top;
  }

  .brand-logo {
    width: min(10.5rem, 52vw);
  }

  .theme-toggle__text {
    display: none;
  }

  .chat-feed {
    padding-right: 0;
  }

  .chat-message {
    max-width: 88%;
  }

  .game-chat-card {
    gap: 0.85rem;
  }

  .game-widget {
    right: 0.5rem;
    bottom: 0.5rem;
    left: 0.5rem;
    justify-items: stretch;
  }

  .game-widget__launcher,
  .game-widget__panel,
  .game-widget__teaser {
    width: 100%;
  }

  .game-widget__panel {
    height: min(78dvh, 37rem);
    padding: 0.9rem;
  }

  .game-widget__meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .game-widget__meta .button {
    min-height: auto;
    padding: 0.7rem 0.95rem;
    white-space: nowrap;
  }

  .game-modal {
    padding: 0;
  }

  .game-chat-card--modal {
    padding:
      max(1rem, env(safe-area-inset-top))
      0.9rem
      max(0.75rem, env(safe-area-inset-bottom))
      0.9rem;
    gap: 0.7rem;
  }

  .game-modal__close {
    top: 0.35rem;
    right: 0.35rem;
    width: 2.35rem;
    height: 2.35rem;
  }

  .chat-topbar__controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }

  .chat-letter-box {
    min-width: 0;
    padding: 0.7rem 0.85rem;
  }

  .chat-letter-box__value {
    font-size: 1.15rem;
  }

  .chat-topbar__controls #resetGame {
    min-height: auto;
    padding: 0.7rem 0.95rem;
    white-space: nowrap;
  }

  .chat-list {
    gap: 0.7rem;
  }

  .chat-bubble {
    padding: 0.75rem 0.9rem;
  }

  .chat-composer-wrap .status {
    font-size: 0.95rem;
  }
}

@media (min-width: 900px) {
  .page-shell {
    padding: 2rem 0 4rem;
    gap: 1.25rem;
  }

  .hero,
  .card {
    padding: 1.5rem;
  }

  .hero {
    padding: 2rem;
  }

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

  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .alphabet-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .resident-chip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
