/* Shared MatBet components use the existing colors, buttons and typography. */
.a11y-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 40px;
  min-height: 40px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}
.a11y-trigger:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}
.drawer-a11y {
  width: 100%;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 18px;
}
.desktop-a11y {
  display: inline-flex;
}
.faq-heading {
  font-size: inherit;
}
.faq-toggle {
  width: 100%;
  padding: 0;
  text-align: start;
  background: transparent;
  color: var(--text);
}
.faq-answer[hidden] {
  display: none;
}

.settings-panel,
.assistant-panel {
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 20px 70px #0009;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
}
.settings-panel {
  width: min(440px, calc(100% - 32px));
}
.assistant-panel {
  position: fixed;
  inset: auto 20px calc(var(--assistant-bottom, 20px) + 114px) auto;
  margin: 0;
  width: min(390px, calc(100% - 32px));
  max-height: calc(100dvh - var(--assistant-bottom, 20px) - 130px);
}
dialog::backdrop {
  background: #030513a6;
}
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.panel-heading > :first-child {
  min-width: 0;
}
.panel-heading h2,
#assistant-title {
  font-weight: 700;
  font-size: calc(18px * var(--text-scale, 1));
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.panel-close {
  flex: none;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 24px;
}
.panel-close:hover {
  color: var(--yellow);
}
.panel-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: calc(12px * var(--text-scale, 1));
}
.setting-block {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}
.setting-block label,
.setting-options,
.settings-panel .button,
.assistant-panel label {
  font-size: calc(14px * var(--text-scale, 1));
  line-height: 1.5;
}
.text-size-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.text-size-controls button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: calc(16px * var(--text-scale, 1));
}
.text-size-controls button:disabled {
  opacity: 0.45;
  cursor: default;
}
.text-size-controls input {
  flex: 1;
  width: 100%;
  min-width: 0;
  accent-color: var(--yellow);
}
.setting-block output {
  color: var(--yellow);
  font-size: calc(14px * var(--text-scale, 1));
}
.setting-options {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}
.setting-toggle {
  text-align: start;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.setting-toggle[aria-pressed="true"] {
  border-color: var(--yellow);
  color: var(--yellow);
}
.settings-panel .button {
  height: auto;
  min-height: 44px;
  white-space: normal;
}
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
}

.assistant-trigger {
  position: fixed;
  inset-inline-end: 20px;
  bottom: var(--assistant-bottom, 20px);
  z-index: 40;
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 112px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  transition: transform 180ms ease;
}
.assistant-trigger:hover {
  transform: translateY(-2px);
}
.assistant-visual {
  position: relative;
  display: block;
  width: 80px;
  height: 72px;
}
.assistant-visual::before {
  content: "";
  position: absolute;
  inset: auto 14px 2px;
  height: 8px;
  border-radius: 50%;
  background: #0006;
  filter: blur(4px);
}
.assistant-football {
  position: absolute;
  top: 2px;
  left: 8px;
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 3px 6px #0005);
}
.assistant-football-fallback,
.assistant-football-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.assistant-football-canvas {
  opacity: 0;
}
.assistant-football.is-ready .assistant-football-canvas {
  opacity: 1;
}
.assistant-football.is-ready .assistant-football-fallback {
  opacity: 0;
}
.assistant-trigger-label {
  max-width: 112px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: calc(11px * var(--text-scale, 1));
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
.assistant-trigger:hover .assistant-trigger-label {
  border-color: var(--yellow);
}
.assistant-panel form {
  display: grid;
  gap: 14px;
}
.assistant-panel textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: calc(14px * var(--text-scale, 1));
  line-height: 1.5;
}
.assistant-panel textarea::placeholder {
  color: var(--muted);
}
.assistant-panel .button {
  height: auto;
  min-height: 44px;
  white-space: normal;
  font-size: calc(14px * var(--text-scale, 1));
}
.assistant-status:not([hidden]) {
  color: var(--muted);
  font-size: calc(12px * var(--text-scale, 1));
  line-height: 1.5;
}

/* Reflow is limited to user-selected text modes; the baseline artwork stays fixed. */
.a11y-reflow .top-header {
  height: auto;
  min-height: 76px;
  flex-wrap: wrap;
  position: relative;
}
.a11y-reflow .header-actions {
  flex-wrap: wrap;
}
.a11y-reflow .top-nav {
  display: none;
}
.a11y-reflow .page {
  padding-top: 0;
}
.a11y-reflow .button,
.a11y-reflow .promo-cta {
  height: auto;
  min-height: 44px;
  white-space: normal;
}
.a11y-reflow .hero {
  height: auto;
  min-height: 690px;
  padding: 72px 40px 160px;
}
.a11y-reflow .hero-copy {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: 100%;
}
.a11y-reflow .hero-buttons,
.a11y-reflow .hero-badges {
  flex-wrap: wrap;
}
.a11y-reflow .snapshot,
.a11y-reflow .rating-card,
.a11y-reflow .author-card {
  flex-wrap: wrap;
}
.a11y-reflow .snapshot-rating,
.a11y-reflow .rating-dial {
  min-width: 0;
  height: auto;
  padding-block: 24px;
}
.a11y-reflow .fact-card,
.a11y-reflow .strengths-card,
.a11y-reflow .limitations-card {
  height: auto;
  min-height: 150px;
}
.a11y-reflow .facts-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.a11y-reflow .scenery {
  height: auto;
  min-height: 260px;
}
.a11y-reflow .scenery .promo-cta {
  max-width: calc(100% - 32px);
}
.a11y-reflow .footer-main,
.a11y-reflow .footer-destinations {
  flex-wrap: wrap;
}
.a11y-reflow .footer-brand {
  max-width: 100%;
}
.a11y-reflow :is(h1, h2, h3, #assistant-title, p, li, a, button, label, output, summary) {
  overflow-wrap: anywhere;
}
.a11y-reflow
  :is(
    .brand-copy,
    .promo-heading > div,
    .age-note > p,
    .footer-destinations,
    .footer-destinations details
  ) {
  min-width: 0;
}
.a11y-reflow .brand {
  flex-wrap: wrap;
}
.a11y-reflow .brand-mark {
  width: calc(34px * var(--text-scale, 1));
  height: calc(34px * var(--text-scale, 1));
}
.a11y-reflow :is(.age-note > span, .footer-age) {
  width: calc(30px * var(--text-scale, 1));
  height: calc(30px * var(--text-scale, 1));
}
.a11y-reflow .promo-action {
  height: auto;
  min-height: 44px;
  padding: 8px;
}
.a11y-reflow .promo-cta {
  width: auto;
  padding: 14px 20px;
}
.a11y-reflow :is(.strength, .limitation) {
  height: auto;
}
.a11y-reflow .dial-ring {
  width: calc(170px * var(--text-scale, 1));
  max-width: 100%;
  height: auto;
  min-height: 170px;
  aspect-ratio: 1;
}
.a11y-reflow .crystal-markers {
  flex: none;
}
.a11y-reflow .age-note {
  flex-wrap: wrap;
}
.a11y-reflow .facts-heading {
  flex-wrap: wrap;
}
.a11y-reflow .facts-heading > * {
  min-width: 0;
}
.a11y-reflow .date-label {
  white-space: normal;
  flex-wrap: wrap;
}
.a11y-reflow :is(.hero-actions, .trust-line, .app-icon-group, .rating-labels) {
  flex-wrap: wrap;
}
.a11y-reflow .rating-labels .rating-value {
  white-space: normal;
}
.a11y-reflow .rating-labels > span:not(.rating-value) {
  max-width: 100%;
  min-width: 0;
}
.a11y-reflow :is(.app-copy, .app-icon-group > *, .pill) {
  min-width: 0;
  max-width: 100%;
}
.a11y-reflow .app-visual {
  height: auto;
  min-height: 340px;
  padding-bottom: 300px;
}
.a11y-reflow .app-copy {
  width: 100%;
}
.a11y-reflow :is(span, small, a.body-link, .safety-card strong) {
  overflow-wrap: anywhere;
}
.a11y-reflow .drawer-heading > .brand {
  flex: 1;
  min-width: 0;
}
.a11y-reflow .drawer-close {
  flex: none;
  font-size: 24px;
}
.a11y-reflow .utility-header {
  flex-wrap: wrap;
}
.a11y-reflow .utility-header > .brand {
  flex: 1 1 200px;
  min-width: 0;
}
.a11y-reflow .utility-header .brand-name {
  min-width: 0;
}
.a11y-reflow .utility-header-actions {
  margin-left: auto;
  flex: none;
}
/* The error number is decorative; the meaningful H1 follows the text setting. */
.a11y-reflow .utility-code {
  font-size: clamp(64px, 12vw, 110px);
  letter-spacing: normal !important;
  word-spacing: normal !important;
}
.table-wrap:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
}
.a11y-spacing
  :is(p, li, td, th, h1, h2, h3, #assistant-title, a, button, label, summary, output) {
  line-height: 1.5 !important;
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}
.a11y-spacing p {
  margin-bottom: 2em !important;
}
.a11y-contrast {
  --bg: #000;
  --panel: #000;
  --card: #000;
  --border: #fff;
  --text: #fff;
  --muted: #fff;
  --dim: #fff;
  --yellow: #ffdf00;
}
.a11y-contrast
  :is(.hero-environment, .hero-character, .scenery-image, .app-landscape) {
  filter: brightness(0.3);
}
.a11y-contrast
  :is(
    .sidebar,
    .top-header,
    .drawer,
    .utility-header,
    .assistant-trigger,
    .settings-panel,
    .assistant-panel
  ) {
  background: #000;
}
.a11y-contrast .body-link {
  color: #fff;
}

.utility-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.utility-header-actions {
  display: flex;
  gap: 10px;
}
.utility-header .brand-name {
  display: grid;
  gap: 3px;
}
.utility-header .brand-name .brand-label {
  font-family: Unbounded, sans-serif;
  font-size: calc(16px * var(--text-scale, 1));
}
.utility-header .brand-name small {
  font-size: calc(10px * var(--text-scale, 1));
  color: var(--yellow);
  font-weight: 800;
}
.utility-main {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 196px);
  padding: 48px 20px;
}
.utility-card {
  display: grid;
  gap: 24px;
  justify-items: center;
  text-align: center;
  width: min(620px, 100%);
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}
.utility-code {
  font-family: Unbounded, sans-serif;
  font-weight: 900;
  font-size: calc(clamp(64px, 12vw, 110px) * var(--text-scale, 1));
  line-height: 1;
  color: var(--yellow);
}
.utility-eyebrow {
  font-weight: 900;
  color: var(--yellow);
}
.utility-card h1 {
  font-family: Unbounded, sans-serif;
  font-size: calc(clamp(24px, 4vw, 36px) * var(--text-scale, 1));
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.utility-card > p:not(.utility-code) {
  color: var(--muted);
  font-size: calc(16px * var(--text-scale, 1));
  line-height: 1.6;
}
.utility-card nav {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.utility-card .button {
  height: auto;
  min-height: 44px;
  white-space: normal;
}

@media (min-width: 981px) and (max-width: 1100px) {
  .top-nav {
    gap: 10px;
  }
}
@media (max-width: 980px) {
  .desktop-a11y {
    display: none;
  }
  .assistant-trigger {
    inset-inline-end: 16px;
    bottom: var(--assistant-bottom, 16px);
    width: 104px;
  }
  .assistant-panel {
    inset: auto 16px calc(var(--assistant-bottom, 16px) + 110px) auto;
    max-height: calc(100dvh - var(--assistant-bottom, 16px) - 126px);
    padding: 20px;
  }
  .a11y-reflow .hero {
    padding: 28px 20px 440px;
    min-height: 760px;
  }
  .a11y-reflow .top-header {
    min-height: 64px;
    gap: 12px;
    padding-block: 12px;
  }
  .a11y-reflow .snapshot-rating {
    width: 100%;
  }
  .a11y-reflow .rating-dial {
    max-width: 100%;
  }
  .a11y-reflow .scenery {
    min-height: 260px;
  }
  .a11y-reflow .promo-cta {
    bottom: 16px;
  }
  .a11y-reflow .hero-character {
    max-width: 100%;
  }
  .utility-header {
    padding: 16px 20px;
  }
  .utility-header .menu-toggle {
    display: inline-flex;
  }
}
@media (max-width: 480px) {
  .a11y-reflow .brand {
    flex-shrink: 0;
  }
  .a11y-reflow .header-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
  .a11y-reflow .hero h1 {
    overflow-wrap: anywhere;
  }
  .a11y-reflow .rating-card {
    display: flex;
    flex-direction: column;
  }
  .a11y-reflow .author-card {
    padding: 16px;
  }
}
@media (max-width: 400px) {
  .top-header {
    gap: 4px;
  }
  .header-actions {
    gap: 4px;
  }
  .header-actions .button {
    padding-inline: 8px;
  }
}
@media (max-width: 360px) {
  .top-header {
    gap: 2px;
  }
  .mobile-brand .brand {
    gap: 4px;
  }
  .header-actions .button {
    padding-inline: 6px;
  }
  .language summary {
    padding-inline: 3px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .assistant-trigger,
  .assistant-trigger *,
  .assistant-trigger *::before,
  .assistant-trigger *::after {
    animation: none;
    transition: none;
  }
  .assistant-trigger:hover {
    transform: none;
  }
}

/* Site Search follows the approved MatBet column and interactive palette. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.site-search {
  position: relative;
  padding-block: 16px;
}
.site-search-form {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.site-search-field {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 12px;
  padding-inline: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
}
.site-search-field:focus-within {
  border-color: var(--yellow);
}
.site-search-field > svg {
  flex: none;
}
.site-search-field input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 10px 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: calc(15px * var(--text-scale, 1));
  line-height: 1.5;
}
.site-search-field input::placeholder {
  color: var(--muted);
}
.site-search-field input:focus {
  /* The field wrapper supplies the single visible focus border. */
  outline: none;
}
.site-search-form .button {
  height: auto;
  min-height: 48px;
  padding: 12px 30px;
  font-size: calc(15px * var(--text-scale, 1));
}
.site-search-status:not([hidden]) {
  margin-top: 14px;
  padding-inline-end: 112px;
  color: var(--muted);
  font-size: calc(14px * var(--text-scale, 1));
  line-height: 1.5;
}
.site-search-results:not([hidden]) {
  display: grid;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin-top: 14px;
}
.site-search-results li {
  min-width: 0;
  padding: 16px;
  /* Keep result text and links outside the floating assistant's right-hand lane. */
  padding-inline-end: 112px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  overflow-wrap: anywhere;
}
.site-search-results a {
  font-size: calc(16px * var(--text-scale, 1));
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-search-results a:hover,
.site-search-results a:focus-visible {
  color: var(--yellow);
}
.site-search-results p {
  margin-top: 8px;
  color: var(--muted);
  font-size: calc(14px * var(--text-scale, 1));
  line-height: 1.6;
}
.assistant-answer:not([hidden]) {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: calc(14px * var(--text-scale, 1));
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.assistant-panel button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.assistant-status.is-pending::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-inline-end: 8px;
  border: 2px solid var(--border);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: assistant-request-spin 1s linear infinite;
}
@keyframes assistant-request-spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 480px) {
  .site-search-form {
    gap: 8px;
  }
  .site-search-field {
    padding-inline: 10px;
    gap: 8px;
  }
  .site-search-form .button {
    padding-inline: 16px;
  }
  .site-search-field input {
    font-size: calc(16px * var(--text-scale, 1));
  }
}
.a11y-reflow .site-search-form {
  flex-wrap: wrap;
}
.a11y-reflow .site-search-field {
  flex-basis: 100%;
}
.a11y-spacing :is(.site-search-field input, .assistant-answer) {
  line-height: 1.5 !important;
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}
@media (prefers-reduced-motion: reduce) {
  .assistant-status.is-pending::before {
    animation: none;
  }
}

html[lang^="tg"] :is(
  .brand-mark,
  .brand-copy > span,
  .hero h1,
  .facts .facts-title,
  .section-heading,
  .section-content > h3,
  .utility-header .brand-name .brand-label,
  .utility-code,
  .utility-card h1
) {
  font-family: Inter, Arial, sans-serif;
}

html[lang^="tg"] .language a[lang="hy-AM"] {
  font-family: 'Montserrat Armenian', sans-serif;
}
