@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap");

@font-face {
  font-display: swap;
  font-family: "Kanit";
  font-style: normal;
  font-weight: 400;
  src: url("https://dare-learn.com/wp-content/themes/dtl/fonts/Kanit-Regular.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Kanit";
  font-style: normal;
  font-weight: 500;
  src: url("https://dare-learn.com/wp-content/themes/dtl/fonts/Kanit-Medium.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Kanit";
  font-style: normal;
  font-weight: 600;
  src: url("https://dare-learn.com/wp-content/themes/dtl/fonts/Kanit-SemiBold.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Kanit";
  font-style: normal;
  font-weight: 700;
  src: url("https://dare-learn.com/wp-content/themes/dtl/fonts/Kanit-Bold.woff2") format("woff2");
}

:root {
  --layout-width: 1280px;
  --accent: #4838f7;
  --accent-dark: #3628d8;
  --accent-soft: #ece9ff;
  --accent-foreground: #ffffff;
  --accent-dark-foreground: #ffffff;
  --success: #10b981;
  --challenge: #ff6b5a;
  --score: #f5b83b;
  --text: #111827;
  --muted: #6b7280;
  --border: rgba(17, 24, 39, 0.1);
  --surface: #ffffff;
  --surface-strong: rgba(255, 255, 255, 0.72);
  --background: #ffffff;
  --font-display: "Manrope", "Inter", sans-serif;
  --font-ui: "Inter", "Noto Sans Thai", Arial, sans-serif;
  --font-thai: "Noto Sans Thai", "Kanit", Arial, sans-serif;
  --font-brand-thai: "Kanit", "Noto Sans Thai", sans-serif;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --focus-ring: 4px solid rgba(72, 56, 247, 0.2);
}

html[data-theme="dark"] {
  --accent: #d8ff6e;
  --accent-dark: #c4f050;
  --accent-soft: rgba(216, 255, 110, 0.15);
  --accent-foreground: #111827;
  --accent-dark-foreground: #111827;
  --success: #34d399;
  --challenge: #ff8a7d;
  --score: #f8c85a;
  --text: #f7f7fb;
  --muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.12);
  --surface: #050506;
  --surface-strong: rgba(5, 5, 6, 0.88);
  --background: #050506;
  --focus-ring: 4px solid rgba(216, 255, 110, 0.25);
}

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .header-actions,
html[data-theme="dark"] .tabs,
html[data-theme="dark"] .language-switcher,
html[data-theme="dark"] .company-link,
html[data-theme="dark"] .profile-link,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .avatar-picker,
html[data-theme="dark"] .modal-actions,
html[data-theme="dark"] .profile-input,
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .back-circle-button {
  background: var(--background);
}

html[data-theme="dark"] .game-subject,
html[data-theme="dark"] .game-rating,
html[data-theme="dark"] .table-icon,
html[data-theme="dark"] .game-top-player-avatar,
html[data-theme="dark"] .avatar-option,
html[data-theme="dark"] .avatar-option::before {
  background: var(--background);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

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

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  overflow-x: hidden;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
}

:lang(th) body,
:lang(th) button,
:lang(th) input,
:lang(th) textarea,
:lang(th) select {
  font-family: var(--font-thai);
}

h1,
h2,
h3,
.brand,
.button,
.tab-button,
.game-title,
.profile-label,
.games-table th {
  font-family: var(--font-display);
}

:lang(th) h1,
:lang(th) h2,
:lang(th) h3,
:lang(th) .brand,
:lang(th) .button,
:lang(th) .tab-button,
:lang(th) .game-title,
:lang(th) .profile-label,
:lang(th) .games-table th {
  font-family: var(--font-thai);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(22px);
}

.page-home .site-header-home {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  width: 100vw;
  min-width: 100vw;
  max-width: none;
  margin: 0;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  transition: background 0.2s ease, border-color 0.2s ease, backdrop-filter 0.2s ease;
}

html[data-theme="dark"] .page-home .site-header-home .header-actions,
html[data-theme="dark"] .page-home .site-header-home:not(.is-scrolled) .header-actions {
  background: transparent;
  border: 0;
  box-shadow: none;
}

html[data-theme="dark"] .page-home .site-header-home:not(.is-scrolled) {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

.page-home .site-header-home:not(.is-scrolled) .brand,
.page-home .site-header-home:not(.is-scrolled) .company-link,
.page-home .site-header-home:not(.is-scrolled) .header-nav-link,
.page-home .site-header-home:not(.is-scrolled) .language-button,
.page-home .site-header-home:not(.is-scrolled) .theme-toggle,
.page-home .site-header-home:not(.is-scrolled) .profile-link,
.page-home .site-header-home:not(.is-scrolled) #login-link {
  color: #ffffff;
}

.page-home .site-header-home:not(.is-scrolled) .brand-logo img {
  filter: brightness(0) invert(1);
}

.page-home .site-header-home:not(.is-scrolled) .company-link,
.page-home .site-header-home:not(.is-scrolled) .theme-toggle,
.page-home .site-header-home:not(.is-scrolled) .profile-link,
.page-home .site-header-home:not(.is-scrolled) #login-link {
  position: relative;
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 10px 30px rgba(6, 10, 28, 0.16);
  backdrop-filter: blur(18px) saturate(180%);
}

.page-home .site-header-home:not(.is-scrolled) .language-switcher {
  position: relative;
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 10px 30px rgba(6, 10, 28, 0.14);
  backdrop-filter: blur(18px) saturate(180%);
}

.page-home .site-header-home:not(.is-scrolled) .company-link::before,
.page-home .site-header-home:not(.is-scrolled) .theme-toggle::before,
.page-home .site-header-home:not(.is-scrolled) .profile-link::before,
.page-home .site-header-home:not(.is-scrolled) #login-link::before,
.page-home .site-header-home:not(.is-scrolled) .language-switcher::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.02) 55%);
  opacity: 0.9;
  pointer-events: none;
}

.page-home .site-header-home:not(.is-scrolled) .language-button:hover,
.page-home .site-header-home:not(.is-scrolled) .header-nav-link:hover {
  color: #ffffff;
  background: transparent;
  box-shadow: none;
}

.page-home .site-header-home:not(.is-scrolled) .company-link:hover,
.page-home .site-header-home:not(.is-scrolled) .theme-toggle:hover,
.page-home .site-header-home:not(.is-scrolled) .theme-toggle:focus-visible,
.page-home .site-header-home:not(.is-scrolled) .profile-link:hover,
.page-home .site-header-home:not(.is-scrolled) #login-link:hover {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 10px 30px rgba(6, 10, 28, 0.16);
  transform: none;
}

.page-home .site-header-home:not(.is-scrolled) .language-button.is-active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.page-home .site-header-home:not(.is-scrolled) .company-link-icon,
.page-home .site-header-home:not(.is-scrolled) .theme-toggle-icon {
  color: currentColor;
}

.page-home .site-header-home.is-scrolled {
  background: rgba(255, 255, 255, 0.72);
  border-bottom-color: rgba(17, 24, 39, 0.08);
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.08);
  backdrop-filter: saturate(180%) blur(20px);
}

html[data-theme="dark"] .page-home .site-header-home.is-scrolled {
  background: rgba(5, 5, 6, 0.7);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: saturate(180%) blur(20px);
}

.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  width: auto;
}

.brand-logo img,
.brand-logo svg {
  display: block;
  width: auto;
  height: clamp(18px, 2.2vw, 22px);
}

html[data-theme="dark"] .site-header .brand-logo img {
  filter: brightness(0) saturate(100%) invert(84%) sepia(61%) saturate(721%) hue-rotate(30deg) brightness(108%) contrast(103%);
}

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

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 20px;
  min-width: 0;
  justify-content: center;
  margin-right: auto;
  margin-left: auto;
}

.header-nav-link {
  display: inline-flex;
  align-items: center;
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

/* Temporarily hidden navigation and lobby items. Keep their markup for an easy restore. */
.header-nav-link[href^="leaderboard.html"],
.mobile-island-tab[href^="leaderboard.html"],
.game-card--hidden {
  display: none !important;
}

.header-nav-link:hover,
.header-nav-link.is-active {
  color: var(--text);
}

.header-nav-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.header-nav-link.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.company-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.company-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.company-link-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  flex: 0 0 auto;
}

.header-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  min-width: 0;
  justify-content: flex-end;
  margin-left: auto;
}

.mobile-island {
  display: none;
}

.mobile-island-main,
.mobile-island-tab,
.mobile-account-link,
.mobile-settings-popover,
.mobile-theme-button {
  font-family: var(--font-display);
}

.language-switcher {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.14);
}

.language-button {
  min-height: 30px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-family: var(--font-display);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.language-button:hover {
  color: var(--accent);
}

.language-button.is-active {
  background: var(--surface);
  color: var(--text);
}

.theme-toggle {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

html[data-theme="dark"] .theme-icon-light { display: none; }
html:not([data-theme="dark"]) .theme-icon-dark { display: none; }

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  background-size: cover;
  background-position: center;
  border: 0;
}

.profile-name {
  max-width: 120px;
  overflow: hidden;
  white-space: nowrap;
}

.page {
  width: min(var(--layout-width), 100%);
  margin-right: auto;
  margin-left: auto;
  padding: 36px 24px;
  flex: 1;
}

.page-home .page {
  width: 100%;
  max-width: none;
  padding-top: 0;
}

.home-hero {
  margin-right: calc(50% - 50vw);
  margin-left: calc(50% - 50vw);
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.12);
  width: fit-content;
}

.page-home .tabs {
  display: none;
}

.tab-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-foreground);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.tab-button {
  background: transparent;
  color: var(--muted);
}

.tab-button.is-active,
.button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--accent-dark-foreground);
  transform: translateY(-1px);
}

.tab-button:hover {
  background: var(--accent-soft);
  transform: none;
}

.tab-button.is-active {
  background: var(--accent);
  color: #ffffff;
  transform: none;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.search-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 600;
}

.search-field {
  position: relative;
  display: block;
}

.game-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.game-filter-tab {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.game-filter-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.game-filter-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

html[data-theme="dark"] .game-filter-tab.is-active {
  color: #111827;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  color: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.search-input:focus {
  border-color: var(--accent);
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 20px;
  scroll-margin-top: 96px;
}

.marketing-stack {
  display: grid;
  gap: 18px;
  margin-top: 96px;
}

.page-home .tabs,
.page-home .tab-panel {
  width: min(var(--layout-width), calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

.page-home .tab-panel {
  margin-top: 32px;
}

.page-banner {
  position: relative;
  width: auto;
  min-height: clamp(320px, 40vw, 420px);
  height: clamp(320px, 40vw, 420px);
  margin: 0 calc(50% - 50vw) 40px;
  overflow: hidden;
  border-radius: 0 0 32px 32px;
}

.page-banner-media {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.page-banner-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 220ms ease;
}

.page-banner-poster {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: inherit;
  overflow: hidden;
  transition: opacity 220ms ease;
}

.page-banner-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.46) 0%, rgba(0, 0, 0, 0.18) 50%, rgba(0, 0, 0, 0.18) 100%);
}

.page-banner-copy {
  position: absolute;
  right: 0;
  bottom: 40px;
  left: 0;
  z-index: 1;
  width: min(var(--layout-width), calc(100% - 64px));
  margin-right: auto;
  margin-left: auto;
}

.page-banner-title {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.04em;
  max-width: 10ch;
}

.page-section {
  width: min(var(--layout-width), calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

.page-profile > :not(.page-banner),
.page-leaderboard .page-section,
.page-privacy .page-section {
  width: min(var(--layout-width), calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

.page-content-stack {
  display: grid;
  gap: 24px;
}

.leaderboard-page-section,
.profile-games,
.privacy-content {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.marketing-section {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--border);
  border-radius: 36px;
  background: #f5f5f7;
}

html[data-theme="dark"] .marketing-section {
  background: #111113;
}

.marketing-hero {
  display: block;
  width: 100%;
  min-height: 500px;
  max-height: 500px;
  padding: 0;
  border: 0;
  border-radius: 0 0 32px 32px;
  background: #000000;
}

.marketing-copy {
  position: relative;
  z-index: 1;
}

.marketing-hero-copy {
  position: absolute;
  left: clamp(24px, 5vw, 72px);
  right: clamp(24px, 5vw, 72px);
  bottom: 64px;
  max-width: 900px;
}

.marketing-hero .marketing-title {
  color: #ffffff;
}

.marketing-hero-title {
  display: grid;
  gap: 2px;
}

.marketing-hero-title span {
  display: block;
}

.marketing-hero .marketing-title {
  max-width: none;
  font-size: clamp(44px, 5vw, 74px);
  line-height: 0.92;
}

.marketing-hero .marketing-pill {
  color: #ffffff;
}

.marketing-copy-centered {
  text-align: center;
}

.marketing-eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.marketing-title {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.marketing-title-medium {
  max-width: 14ch;
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(30px, 5vw, 52px);
}

.marketing-text {
  max-width: 64ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.6;
}

.marketing-text-narrow {
  max-width: 52ch;
  margin-right: auto;
  margin-left: auto;
}

.marketing-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 22px;
}

.marketing-pill {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.marketing-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.marketing-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 220ms ease;
}

.marketing-hero-media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 500px;
  min-height: 500px;
  max-height: 500px;
  border-radius: inherit;
}

.marketing-hero-poster {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: inherit;
  overflow: hidden;
  transition: opacity 220ms ease;
}

.marketing-hero-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.marketing-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.18) 42%, rgba(0, 0, 0, 0.18) 100%);
  border-radius: 0 0 32px 32px;
}

.hero-media-shell.is-video-ready .marketing-hero-video,
.hero-media-shell.is-video-ready .page-banner-video {
  opacity: 1;
}

.hero-media-shell.is-video-ready .marketing-hero-poster,
.hero-media-shell.is-video-ready .page-banner-poster {
  opacity: 0;
}

.marketing-visual {
  position: relative;
  min-height: 420px;
}

.leaderboard-showcase {
  display: grid;
  place-items: center;
}

.leaderboard-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  background: #111113;
  color: #f5f5f7;
}

html[data-theme="dark"] .leaderboard-card {
  background: #0b0b0d;
}

.leaderboard-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #1d1d21;
  color: #f5f5f7;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #1a1a1f;
}

html[data-theme="dark"] .leaderboard-row {
  background: #151519;
}

.leaderboard-row.is-first {
  background: #232329;
}

.leaderboard-rank,
.leaderboard-score {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.leaderboard-name {
  font-size: 16px;
  font-weight: 600;
}

.leaderboard-note {
  margin: 18px 0 0;
  color: rgba(245, 245, 247, 0.72);
  font-size: 14px;
  line-height: 1.6;
}

.marketing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.marketing-actions-centered {
  justify-content: center;
}

.marketing-hero .marketing-actions {
  margin-top: 26px;
}

.marketing-button {
  min-height: 46px;
  padding-right: 18px;
  padding-left: 18px;
}

.marketing-button-hero {
  background: linear-gradient(180deg, #cfff67 0%, #9fe63f 100%);
  color: #10210b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 18px 40px rgba(108, 189, 39, 0.28);
}

.marketing-button-hero:hover,
.marketing-button-hero:focus-visible {
  background: linear-gradient(180deg, #dbff88 0%, #b0f053 100%);
  color: #10210b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 22px 46px rgba(108, 189, 39, 0.34);
}

html[data-theme="dark"] .marketing-button-hero {
  background: linear-gradient(180deg, #d8ff6e 0%, #bde94d 100%);
  color: #111827;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 18px 40px rgba(145, 218, 59, 0.2);
}

html[data-theme="dark"] .marketing-button-hero:hover,
html[data-theme="dark"] .marketing-button-hero:focus-visible {
  background: linear-gradient(180deg, #e5ff94 0%, #cdf160 100%);
  color: #111827;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 22px 46px rgba(145, 218, 59, 0.26);
}

.marketing-stats,
.marketing-trust {
  display: grid;
  gap: 28px;
}

.marketing-stats {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.marketing-trust {
  background: #000000;
  border-color: #000000;
}

html[data-theme="dark"] .marketing-stats {
  background: transparent;
}

.marketing-stats-copy {
  margin: 0;
  padding: 0;
  text-align: left;
}

.marketing-stats-copy .marketing-title {
  max-width: none;
}

.marketing-trust .marketing-eyebrow,
.marketing-trust .marketing-title,
.marketing-trust .trust-value {
  color: #f5f5f7;
}

.marketing-trust .marketing-text,
.marketing-trust .trust-label {
  color: rgba(245, 245, 247, 0.72);
}

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

.marketing-stats .marketing-actions-centered {
  justify-content: flex-start;
}

.stat-card {
  display: grid;
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  justify-items: start;
  text-align: left;
}

.stat-donut {
  position: relative;
  width: 140px;
  height: 140px;
}

.stat-donut-svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.stat-donut-track {
  fill: none;
  stroke-width: 8;
  stroke: rgba(17, 24, 39, 0.1);
}

html[data-theme="dark"] .stat-donut-track {
  stroke: rgba(255, 255, 255, 0.12);
}

.stat-donut-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke: var(--accent);
  stroke-dasharray: 339.3;
  stroke-dashoffset: 339.3;
}

.stat-donut-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-family: var(--font-display);
  color: #111113;
  font-size: clamp(26px, 3.5vw, 34px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

html[data-theme="dark"] .stat-value {
  color: #f5f5f7;
}

.stat-title,
.subject-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
}

.stat-text,
.subject-text,
.trust-label {
  margin: 0;
  color: var(--muted);
}

.trust-grid {
  display: grid;
  gap: 18px;
}

.trust-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: #ffffff;
}

html[data-theme="dark"] .trust-card {
  background: #16161a;
}

.marketing-trust .trust-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: #101012;
}

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

.trust-card {
  display: grid;
  gap: 10px;
}

.trust-value {
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

#leaderboard-panel {
  scroll-margin-top: 96px;
}

@media (prefers-reduced-motion: reduce) {
  .stat-donut-fill,
  .play-button {
    transition: none;
  }

  .game-card,
  .game-card-preview,
  .button,
  .tab-button,
  .company-link,
  .profile-link,
  .theme-toggle {
    transition: none;
  }
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  align-items: stretch;
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(18px);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.game-card:hover {
  background: transparent;
  transform: translateY(-2px);
}

.game-card-preview-wrap {
  display: block;
  min-width: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(118, 118, 128, 0.1);
}

.game-card-preview {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.9) 0%, rgba(241, 245, 249, 0.98) 100%);
  background-size: cover;
  background-position: center;
  transition: transform 0.18s ease;
}

.game-card-preview.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.46) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-100%);
  animation: game-cover-skeleton 1.25s ease-in-out infinite;
}

.game-card-preview.is-loaded::before {
  content: none;
}

.game-card:hover .game-card-preview {
  transform: scale(1.02);
}

html[data-theme="dark"] .game-card-preview {
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(55, 65, 81, 0.98) 100%);
}

@keyframes game-cover-skeleton {
  100% {
    transform: translateX(100%);
  }
}

.game-card-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 4px 8px;
}

.game-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.game-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.game-action-button {
  min-height: 38px;
  padding: 8px 13px;
  gap: 6px;
}

.game-top-player {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-display);
  text-decoration: none;
}

.game-top-player:hover .game-top-player-name,
.game-top-player:hover .game-top-player-score {
  color: var(--accent);
}

.game-top-player-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.game-top-player-avatar {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.1) center / cover no-repeat;
}

.game-top-player-name {
  overflow: hidden;
  max-width: 180px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-top-player-score {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
}

.button-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}


.game-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.08;
}

.game-subject {
  width: fit-content;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-size: 12px;
  font-weight: 700;
}

html[data-theme="dark"] .game-subject {
  color: #6ee7b7;
}

.button .button-icon,
.button .theme-toggle-icon {
  color: currentColor;
}

html[data-theme="dark"] .tab-button.is-active {
  background: var(--accent);
  color: #111827;
}

.game-rating {
  display: none;
}

html[data-theme="dark"] .game-rating,
html[data-theme="dark"] .table-rank-trophy.is-gold {
  color: #f8c85a;
}

html[data-theme="dark"] .table-rank-trophy.is-silver {
  color: #cbd5e1;
}

html[data-theme="dark"] .table-rank-trophy.is-bronze {
  color: #f59e8b;
}

.empty-state {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
}

@keyframes sheet-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ── Backdrop ── */
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  min-width: 100vw;
  height: 100dvh;
  z-index: 2147483000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

/* ── Sheet ── */
.modal-window {
  z-index: 2147483001;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: #ffffff;
  animation: sheet-slide-up 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.install-modal {
  max-width: 520px;
  border-radius: 28px 28px 24px 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .modal-window {
  background: #111113;
}

html[data-theme="dark"] .install-modal {
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

/* ── Fixed header: handle + close ── */
.modal-header {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
}

.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.35);
}

.modal-close {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.18);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
  background: rgba(120, 120, 128, 0.32);
  color: var(--text);
}

/* ── Scrollable content (image + text) ── */
.modal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.game-slider {
  padding: 0 18px 14px;
}

.game-slider-main {
  width: min(100%, 45vh);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
}

.game-slider-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.game-slider-thumbs:has(> :only-child) {
  display: none;
}

.game-slider-thumb {
  aspect-ratio: 1 / 1;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.game-slider-thumb:hover,
.game-slider-thumb.is-active {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.modal-body {
  padding-bottom: 8px;
}

.modal-window h2 {
  margin: 2px 0 10px;
  padding: 0 20px;
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 700;
  line-height: 1.2;
}

.modal-window p {
  margin: 0;
  padding: 0 20px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
}

/* ── Fixed Play button ── */
.modal-actions {
  flex-shrink: 0;
  padding: 12px 18px max(18px, env(safe-area-inset-bottom));
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

html[data-theme="dark"] .modal-actions {
  background: #111113;
  border-top-color: rgba(255, 255, 255, 0.07);
}

.play-button {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
  font-weight: 700;
  border-radius: var(--radius-md);
  animation: play-pulse 1.8s ease-in-out infinite;
}

.play-button:hover {
  animation-play-state: paused;
}

@keyframes play-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }
}

.button-secondary {
  background: var(--surface);
  color: var(--accent);
}

.button-secondary:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

html[data-theme="dark"] .button-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

html[data-theme="dark"] .button-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.login-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}

.login-page h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
}

.login-copy {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
}

.login-actions {
  display: grid;
  width: min(360px, 100%);
  gap: 12px;
}

.google-button {
  min-height: 48px;
}

.code-login {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.code-label {
  color: var(--muted);
  font-weight: 600;
  text-align: left;
}

.code-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: center;
}

.code-input:focus {
  border-color: var(--accent);
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.button:disabled {
  border-color: var(--border);
  background: rgba(118, 118, 128, 0.14);
  color: var(--muted);
  cursor: not-allowed;
}

.auth-status {
  max-width: 420px;
  min-height: 24px;
  color: var(--muted);
}

.site-footer {
  margin-top: 40px;
  width: 100%;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 24px;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-links a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--accent);
}

.footer-install-button {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-foreground);
  font: inherit;
  font-weight: 700;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.footer-install-button:hover,
.footer-install-button:focus-visible {
  background: var(--accent-dark);
  color: var(--accent-dark-foreground);
  transform: translateY(-1px);
}

.install-modal .modal-body {
  display: grid;
  gap: 16px;
  padding: 4px 20px 6px;
}

.install-modal .modal-window h2,
.install-modal .modal-window p {
  padding-left: 0;
  padding-right: 0;
}

.install-hero {
  display: grid;
  gap: 10px;
}

.install-badge {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.install-lead {
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

.install-platform {
  width: fit-content;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.install-card,
.install-note {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.install-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.install-note {
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(72, 56, 247, 0.06), rgba(72, 56, 247, 0.02));
}

.install-section-title {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.install-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  display: grid;
  gap: 12px;
  line-height: 1.55;
}

.install-steps li strong,
.install-lead strong,
.install-modal [data-install-body] strong,
.install-hint strong {
  color: var(--text);
  font-weight: 800;
}

.install-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.install-action {
  min-width: 100%;
  min-height: 46px;
  font-weight: 800;
}

.profile-page {
  display: grid;
  align-content: start;
  gap: 24px;
}

.privacy-page {
  display: grid;
  align-content: start;
  gap: 24px;
}

.privacy-content {
  display: grid;
  gap: 18px;
}

.privacy-content h1,
.privacy-content h2,
.privacy-content p {
  margin: 0;
}

.privacy-content h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
}

.privacy-content h2 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
}

.privacy-content p,
.privacy-content li {
  color: var(--muted);
}

.privacy-content ul {
  margin: 0;
  padding-left: 20px;
}

.not-found-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
  text-align: center;
}

.not-found-content {
  display: grid;
  gap: 18px;
  justify-items: center;
  max-width: 520px;
}

.not-found-code {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(64px, 12vw, 120px);
  font-weight: 800;
  line-height: 0.9;
}

.not-found-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.05;
}

.not-found-copy {
  margin: 0;
  color: var(--muted);
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title-row h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
}

.back-circle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.back-circle-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.profile-summary {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: var(--accent);
  background-size: cover;
  background-position: center;
  border: 0;
}

.avatar-button {
  min-height: 36px;
  font-size: 14px;
}

.profile-layout {
  gap: 80px;
}

.profile-overview,
.profile-section {
  display: grid;
  gap: 28px;
  padding-top: 0;
  border-top: 0;
}

.profile-overview {
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: start;
}

.profile-avatar-panel {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.profile-editor {
  display: grid;
  gap: 26px;
  min-width: 0;
}

.profile-toolbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.profile-toolbar-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.profile-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.profile-section-text {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
}

.profile-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 24px 32px;
  align-items: start;
}

.profile-field-group {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.profile-field-group-wide {
  grid-column: 1 / -1;
}

.profile-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.profile-count {
  margin: 0;
  color: var(--muted);
}

.avatar-picker {
  padding-top: 0;
  border-top: 0;
}

.avatar-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 12px;
}

.avatar-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.14);
  cursor: pointer;
  overflow: visible;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.avatar-option::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.12);
}

.avatar-option img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
}

.avatar-option.has-load-error img {
  display: none;
}

.avatar-option:hover,
.avatar-option.is-active {
  border-color: var(--accent);
  transform: scale(1.05);
}

.avatar-check {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.avatar-option.is-active .avatar-check {
  display: inline-flex;
}

.avatar-credit {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.avatar-credit a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.profile-label {
  color: var(--muted);
  font-weight: 500;
}

.profile-logout-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.profile-logout-link:hover {
  color: var(--accent);
}

.profile-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.profile-input:disabled {
  background: rgba(118, 118, 128, 0.14);
  color: var(--muted);
}

.profile-input:focus {
  border-color: var(--accent);
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.profile-textarea {
  min-height: 104px;
  border-radius: var(--radius-md);
  resize: vertical;
}

.profile-note {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
}

.leaderboard-page-section,
.profile-games {
  display: grid;
  gap: 18px;
}

.profile-empty-games {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: var(--background);
}

.games-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 14px;
  min-width: 680px;
  text-align: left;
}

.games-table th,
.games-table td {
  padding: 0 16px;
  border: 0;
  text-align: left;
  vertical-align: middle;
}

.games-table th {
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: left;
}

.games-table tbody tr:hover {
  background: transparent;
}

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

.game-table-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.game-table-link:hover {
  color: var(--accent);
}

.game-table-link:hover .table-main-text,
.leaderboard-player:hover .table-main-text {
  color: var(--accent);
}

.table-play-button {
  min-height: 36px;
  padding: 8px 14px;
}

.table-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.1);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.table-rank-trophy.is-gold {
  width: auto;
  height: auto;
  flex-basis: auto;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  color: #9a6700;
  font-size: 28px;
}

.table-rank-trophy.is-silver {
  width: auto;
  height: auto;
  flex-basis: auto;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 28px;
}

.table-rank-trophy.is-bronze {
  width: auto;
  height: auto;
  flex-basis: auto;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  color: #92400e;
  font-size: 28px;
}

.table-icon-cover {
  background-color: rgba(118, 118, 128, 0.1);
  background-position: center;
  background-size: cover;
}

.table-main-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
}

.table-main-text span {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-rank,
.table-value {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  text-align: left;
}

.table-value-muted {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
}

.leaderboard-player {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  text-align: left;
}

.leaderboard-player:hover {
  color: var(--accent);
}

.games-table tbody tr:hover .table-value,
.games-table tbody tr:hover .table-rank {
  color: var(--accent);
}

.games-table tbody tr:hover .table-icon:not(.table-rank-trophy) {
  background: var(--accent-soft);
  color: var(--accent);
}

.leaderboard-player-avatar {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.1) center / cover no-repeat;
  background-size: cover;
  background-position: center;
}

@media (max-width: 1180px) {
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-home .tab-panel {
    width: 100%;
  }

  body {
    font-size: 15px;
    line-height: 1.45;
  }

  .brand {
    font-size: 18px;
  }

  .button,
  .tab-button,
  .profile-link,
  .company-link,
  .language-button,
  .search-input,
  .profile-input,
  .code-input {
    font-size: 14px;
  }

  .game-title {
    font-size: 21px;
    line-height: 1.12;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .game-subject,
  .game-rating {
    font-size: 11px;
  }

  .table-main-text {
    font-size: 13px;
  }

  .table-main-text span,
  .table-value-muted {
    font-size: 12px;
  }

  .table-value,
  .table-rank {
    font-size: 13px;
  }

  .games-table th {
    font-size: 11px;
  }

  .page-title-row h1,
  .profile-games h1,
  .profile-games h2 {
    font-size: 24px;
  }

  .privacy-content h1,
  .login-page h1 {
    font-size: 28px;
  }

  .privacy-content h2,
  .avatar-picker h2 {
    font-size: 18px;
  }

  .modal-window h2 {
    font-size: 18px;
  }

  .modal-window p,
  .profile-note,
  .login-copy,
  .auth-status {
    font-size: 14px;
  }

  .profile-summary {
    grid-template-columns: 1fr;
    gap: 18px;
    justify-items: stretch;
    text-align: left;
  }

  .profile-overview {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .profile-avatar-panel {
    justify-items: start;
  }

  .profile-editor {
    gap: 20px;
  }

  .profile-toolbar {
    flex-direction: column;
    align-items: start;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .profile-field-group,
  .profile-fields {
    width: 100%;
    justify-items: stretch;
  }

  .profile-label {
    width: 100%;
    text-align: left;
  }

  .profile-note,
  .profile-section-text {
    max-width: none;
  }

  .profile-logout-link {
    order: -1;
  }

  .profile-games .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .profile-games .games-table {
    min-width: 0;
  }

  .profile-games .games-table,
  .profile-games .games-table thead,
  .profile-games .games-table tbody,
  .profile-games .games-table tr,
  .profile-games .games-table th,
  .profile-games .games-table td {
    display: block;
  }

  .profile-games .games-table thead {
    display: none;
  }

  .profile-games .games-table tr {
    margin-bottom: 14px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .profile-games .games-table td {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 0;
    text-align: left;
  }

  .profile-games .games-table td:first-child {
    display: block;
    padding-top: 0;
    text-align: left;
  }

  .profile-games .games-table td:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .profile-games .games-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-align: left;
  }

  .profile-games .table-play-button {
    min-width: 120px;
  }

  .leaderboard-table {
    width: max-content;
    min-width: 112vw;
    font-size: 12px;
    table-layout: fixed;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 12px 14px;
    white-space: normal;
    vertical-align: middle;
  }

  .leaderboard-table th:nth-child(1),
  .leaderboard-table td:nth-child(1) {
    width: 14vw;
    max-width: 14vw;
    white-space: nowrap;
  }

  .leaderboard-table th:nth-child(2),
  .leaderboard-table td:nth-child(2) {
    width: 38vw;
    max-width: 38vw;
  }

  .leaderboard-table th:nth-child(3),
  .leaderboard-table td:nth-child(3) {
    width: 30vw;
    max-width: 30vw;
  }

  .leaderboard-table th:nth-child(4),
  .leaderboard-table td:nth-child(4) {
    width: 24vw;
    max-width: 24vw;
  }

  #leaderboard-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #leaderboard-wrap::after {
    content: "";
    position: sticky;
    right: 0;
    display: block;
    width: 26px;
    height: 1px;
    margin-top: -1px;
    margin-left: auto;
    background: var(--background);
  }

  .leaderboard-table .game-table-link,
  .leaderboard-player {
    align-items: flex-start;
    white-space: normal;
    line-height: 1.25;
  }
}

@media (max-width: 1200px) {
  body {
    font-size: 14px;
  }

  .site-header,
  .page,
  .footer-inner {
    padding-right: 16px;
    padding-left: 16px;
  }

  .page-home .site-header {
    padding-right: 16px;
    padding-left: 16px;
  }

  .site-header {
    align-items: center;
    backdrop-filter: none;
  }

  .brand-group {
    width: auto;
    justify-content: flex-start;
    gap: 10px;
  }

  .brand-logo img,
  .brand-logo svg {
    height: 18px;
  }

  .company-link {
    margin-left: auto;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .page-home .header-actions,
  .page-home .tabs {
    display: none;
  }

  .page-home .header-nav {
    display: none;
  }

  .page-home .site-header-home {
    align-items: center;
    min-height: 58px;
  }

  .page-home .site-header-home .brand-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .page-home .site-header-home .company-link {
    display: inline-flex;
    margin-left: auto;
  }

  .page-home .site-header-home .brand-logo img,
  .page-home .site-header-home .brand-logo svg {
    height: 20px;
  }

  .mobile-island {
    position: fixed;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 1100;
    display: flex;
    justify-content: center;
  }

  .mobile-island-main {
    display: flex;
    align-items: stretch;
    width: min(100%, 720px);
    min-width: 0;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #ffffff;
  }

  html[data-theme="dark"] .mobile-island-main {
    background: #050506;
    border-color: rgba(255, 255, 255, 0.12);
  }

  .mobile-island-tab {
    display: inline-flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 4px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
  }

  .mobile-island-tab.is-active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .mobile-island-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
  }

  .mobile-island-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
  }

  .mobile-island-settings-wrap {
    position: relative;
    display: flex;
    flex: 1 1 0;
  }

  .mobile-settings-popover {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 18px);
    transform: translateX(-50%);
    display: grid;
    gap: 10px;
    min-width: 220px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(17, 24, 39, 0.16);
  }

  html[data-theme="dark"] .mobile-settings-popover {
    background: #111113;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  }

  .mobile-settings-group {
    display: flex;
    gap: 8px;
  }

  .mobile-settings-language {
    flex: 1;
    justify-content: center;
  }

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

  .mobile-theme-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }

  .mobile-theme-button.is-active {
    background: var(--accent-soft);
    border-color: rgba(72, 56, 247, 0.24);
    color: var(--text);
  }

  html[data-theme="dark"] .mobile-theme-button {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text);
  }

  html[data-theme="dark"] .mobile-theme-button.is-active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
  }

  .mobile-account-link {
    display: inline-flex;
    min-width: 0;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 16px;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-island-login {
    background: var(--accent);
    color: var(--accent-foreground);
  }

  html[data-theme="dark"] .mobile-island-login {
    color: var(--accent-foreground);
  }

  .mobile-account-profile {
    display: inline-flex;
    flex: 1 1 0;
    min-width: 0;
    justify-content: flex-end;
  }

  .mobile-account-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
  }

  .mobile-account-name {
    min-width: 0;
    flex: 0 1 auto;
    max-width: calc(100% - 36px);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.modal-open .header-actions {
    z-index: 1;
    pointer-events: none;
  }

  .site-footer {
    margin-bottom: 92px;
  }

  .page,
  .login-page {
    padding-bottom: calc(124px + env(safe-area-inset-bottom));
  }

  .tabs {
    margin-bottom: 18px;
  }

  .tab-button,
  .button {
    min-height: 38px;
    padding: 9px 14px;
    font-size: 13px;
  }

  .search-input {
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 14px;
  }

  .search-icon {
    width: 18px;
    height: 18px;
  }

  .game-title {
    font-size: 20px;
  }

  .game-card-actions {
    gap: 6px;
  }

  .game-action-button {
    min-height: 36px;
    padding: 8px 11px;
  }

  .table-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 12px;
  }

  .table-rank-trophy.is-gold,
  .table-rank-trophy.is-silver,
  .table-rank-trophy.is-bronze {
    font-size: 22px;
  }

  .leaderboard-player-avatar {
    width: 32px;
    height: 32px;
  }

  .modal-actions {
    padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  }

  .game-card {
    gap: 12px;
    padding: 0;
  }

  .game-card-info {
    padding: 2px 6px 8px;
  }

  .game-card-preview {
    min-height: 0;
  }
}

@media (max-width: 1100px) {
  .marketing-hero,
  .stats-grid,
  .trust-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketing-title {
    max-width: 100%;
  }
}

@media (max-width: 820px) {
  .marketing-hero,
  .stats-grid,
  .trust-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .marketing-section {
    padding: 24px;
    border-radius: 28px;
  }

  .marketing-stats {
    padding: 0;
    border-radius: 0;
  }

  .marketing-stack {
    margin-top: 40px;
    gap: 20px;
  }

  .marketing-hero {
    min-height: 500px;
    max-height: 500px;
    padding: 0;
    border-radius: 0 0 28px 28px;
  }

  .marketing-visual {
    min-height: 320px;
  }

  .leaderboard-card {
    padding: 20px;
    border-radius: 24px;
  }

  .marketing-title {
    font-size: clamp(32px, 9vw, 52px);
  }

  .marketing-hero .marketing-title {
    font-size: clamp(34px, 9.2vw, 52px);
  }

  .marketing-text {
    font-size: 16px;
  }

  .marketing-hero-copy {
    left: 24px;
    right: 24px;
    bottom: 24px;
  }

  .marketing-pill {
    font-size: 14px;
  }

  .marketing-hero-video {
    height: 500px;
    min-height: 500px;
    max-height: 500px;
    border-radius: 0 0 28px 28px;
  }

  .marketing-hero-overlay {
    border-radius: 0 0 28px 28px;
  }

  .page-banner {
    width: auto;
    min-height: 180px;
    height: 180px;
    margin-bottom: 24px;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
    border-radius: 0 0 24px 24px;
  }

  .page-banner-video {
    height: 100%;
  }

  .page-banner-copy {
    bottom: 20px;
    width: min(var(--layout-width), calc(100% - 48px));
  }

  .page-banner-title {
    font-size: clamp(30px, 8vw, 42px);
  }
}

@media (max-width: 520px) {
  .footer-inner,
  .footer-links {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .button-icon {
    width: 16px;
    height: 16px;
  }

  .game-title {
    font-size: 19px;
  }

  .table-main-text {
    font-size: 12px;
  }

  .table-value,
  .table-rank {
    font-size: 12px;
  }

  .profile-avatar {
    width: 96px;
    height: 96px;
  }

  .profile-summary {
    padding: 0;
  }

  .profile-games .games-table td {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
  }

  .profile-games .table-play-button {
    width: 100%;
  }

  .subject-card,
  .trust-card,
  .stat-card {
    padding: 0;
    border-radius: 0;
  }

  .marketing-pill {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 13px;
  }
}
