/* Shared web surfaces, account identity and category status. */
html[data-web-shell] {
  --web-gutter: clamp(.65rem, 1.65vw, 1.75rem);
  --web-content-limit: 96rem;
}
:root[data-web-shell][data-theme="dark"] { color-scheme: dark; }
:root[data-web-shell][data-theme="light"] { color-scheme: light; }
html[data-web-shell] .studio-body { color-scheme: inherit; }
html[data-web-shell]:not([data-saha-web]) {
  font-size: clamp(100%, calc(97% + .16vw), 118.75%);
}
.web-header-inner, .web-body .web-page, .web-body .web-footer {
  max-inline-size: var(--web-content-limit);
}
.web-footer, html[data-saha-web] body > .web-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .35rem .9rem;
  inline-size: var(--web-width);
  max-inline-size: var(--web-content-limit);
  margin-inline: auto;
  padding-block: .7rem;
  border-block-start: 1px solid var(--saha-outline);
}
.web-footer-links { display: flex; flex-wrap: wrap; gap: .1rem .85rem; }
.web-footer :is(.web-footer-brand,.web-footer-links a) { color: var(--saha-muted-text); text-decoration: none; font-size: .9rem; }
.web-footer-links a { display: inline-flex; align-items: center; min-block-size: 2.5rem; }
.web-footer .web-footer-brand { color: var(--saha-text); font-weight: 700; }
.web-footer .web-footer-brand bdi { color: var(--saha-primary); }
.web-footer a:hover { color: var(--saha-primary); text-decoration: underline; }
html[data-saha-web] body:is(.round-focus,.match-view,.audience-view) > .web-footer { display: none; }
html[data-saha-web] :is(main.people-page, body:not(.match-view) main.play-page) {
  max-inline-size: var(--web-content-limit);
  min-inline-size: 0;
}
.studio-content { max-inline-size: 100rem; }
.studio-content > *, .web-header-actions > *, .web-nav > * { min-inline-size: 0; }
.web-page :is(h1, h2, h3, bdi), .studio-content :is(h1, h2, h3, bdi) { overflow-wrap: anywhere; }
.web-auth { inline-size: min(100%, 54rem); grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.web-auth-card { padding: clamp(1rem, 3vw, 2.25rem); }
.portal-home .portal-intro { min-block-size: 0; padding: clamp(1.1rem, 3.2vw, 2.65rem); }
.portal-how-to .portal-columns:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.web-header .page-tour-trigger { border-style: dashed; }
.account-brand {
  display: block;
  inline-size: clamp(96px, 14vw, 112px);
  block-size: auto;
  margin: 0 auto .9rem;
  filter: drop-shadow(0 .35rem .85rem #6e45ac52);
}
.web-appearance { padding: 0; border: 0; background: transparent; }
.web-appearance button[data-theme-toggle] {
  min-block-size: 2.75rem;
  min-inline-size: 2.75rem;
  border: 1px solid var(--saha-outline);
  border-radius: .65rem;
  padding: .32rem .58rem;
  white-space: nowrap;
  color: var(--saha-text);
  background: var(--saha-surface);
}
.web-appearance button[data-theme-toggle]:hover { background: var(--saha-soft); }
[data-theme-icon] { font-size: 1.15em; line-height: 1; }

.saha-account-avatar {
  --avatar-size: 2.5rem;
  position: relative;
  display: inline-grid;
  place-items: center;
  inline-size: var(--avatar-size);
  block-size: var(--avatar-size);
  flex: none;
  vertical-align: middle;
  box-sizing: border-box;
  border-radius: 50%;
  padding: 2px;
  background: var(--saha-outline);
  color: var(--saha-primary);
  font-weight: 800;
}
.saha-account-avatar-profile { --avatar-size: clamp(3.6rem, 8vw, 5.4rem); font-size: 1.45rem; }
.saha-account-avatar-list { --avatar-size: 2rem; font-size: .85rem; }
.saha-account-avatar-member {
  padding: 3px;
  background: linear-gradient(140deg, #fff0b2 5%, #dba449 34%, #8f5cd1 68%, #edc56a 100%);
}
.saha-avatar-face {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  min-inline-size: 0;
  min-block-size: 0;
  border-radius: inherit;
  overflow: hidden;
  background: var(--saha-soft);
}
.saha-avatar-face img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
.saha-avatar-crown {
  position: absolute;
  inset-inline-end: -.11rem;
  inset-block-end: -.1rem;
  display: grid;
  place-items: center;
  inline-size: .95rem;
  block-size: .95rem;
  border: 1px solid #5d3886;
  border-radius: 50%;
  color: #3a2164;
  background: #ffde87;
  font: 800 .65rem/1 var(--web-font);
}
.saha-account-avatar-profile .saha-avatar-crown { inline-size: 1.35rem; block-size: 1.35rem; font-size: .85rem; }
.web-header .host-menu summary.account-avatar {
  width: auto;
  height: auto;
  min-inline-size: 2.75rem;
  min-block-size: 2.75rem;
  overflow: visible;
  border-color: transparent;
}
.player-profile-portrait:has(.saha-account-avatar) {
  inline-size: auto;
  block-size: auto;
  overflow: visible;
  border: 0;
  background: transparent;
}
.player-profile-portrait .saha-avatar-face img { object-fit: cover; }
.avatar-account-row { display: inline-flex; align-items: center; gap: .55rem; min-inline-size: 0; }

.category-status {
  --status-bg: #d7f8e4;
  --status-text: #093d29;
  --status-line: #4d9872;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .15rem .35rem;
  inline-size: fit-content;
  max-inline-size: 100%;
  padding: .28rem .5rem;
  border: 1px solid var(--status-line);
  border-radius: .45rem;
  color: var(--status-text);
  background: var(--status-bg);
  font-size: .9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.category-status[data-state="low"] { --status-bg: #ffe5ab; --status-text: #592e02; --status-line: #ae762d; }
.category-status[data-state="complete"] { --status-bg: #eadff9; --status-text: #412065; --status-line: #9275ba; }
.category-status[data-state="last"] { --status-bg: #fae1d9; --status-text: #6a2319; --status-line: #b56b52; }
html[data-theme="dark"] .category-status { --status-bg: #183b34; --status-text: #b6f4d4; --status-line: #4c9f81; }
html[data-theme="dark"] .category-status[data-state="low"] { --status-bg: #413119; --status-text: #ffe2a7; --status-line: #a77b40; }
html[data-theme="dark"] .category-status[data-state="last"] { --status-bg: #4b2824; --status-text: #ffcec2; --status-line: #ad6c5e; }
html[data-theme="dark"] .category-status[data-state="complete"] { --status-bg: #302743; --status-text: #e3d7f6; --status-line: #816ba1; }
.category-status > :is(strong, small) { color: inherit; font-size: inherit; line-height: inherit; }
.category-status > span:first-child { font-weight: 900; }
#gameCategories label[data-category-state="complete"] {
  background: var(--saha-soft);
}
.category-status-filter {
  display: inline-flex;
  align-items: center;
  align-self: end;
  gap: .4rem;
  min-block-size: 2.75rem;
  min-inline-size: 0;
  padding: .45rem .65rem;
  border: 1px solid var(--saha-outline);
  border-radius: .6rem;
  color: var(--saha-text);
  background: var(--saha-surface);
}
.category-status-filter input { flex: none; margin: 0; }

html[data-web-shell][data-theme] dialog.page-tour {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  max-inline-size: none;
  max-block-size: none;
  inline-size: 100%;
  block-size: 100%;
  overflow: hidden;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
  animation: none;
}
html[data-web-shell][data-theme] dialog.page-tour::backdrop {
  background: transparent;
  backdrop-filter: none;
}
.page-tour-highlight {
  position: absolute;
  z-index: 0;
  border: 2px solid #ffd483;
  border-radius: .65rem;
  box-shadow: 0 0 0 200vmax #100a23bd, 0 0 0 .2rem #aa7bf799;
  pointer-events: none;
}
.page-tour-card {
  position: absolute;
  z-index: 1;
  display: grid;
  gap: .42rem;
  inline-size: min(23rem, calc(100% - 1rem));
  max-block-size: calc(100% - 1rem);
  padding: clamp(.65rem, 2vw, 1rem);
  border: 1px solid var(--saha-primary);
  border-radius: .85rem;
  overflow: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  color: var(--saha-text);
  background: var(--saha-surface);
  box-shadow: 0 .65rem 2.2rem #100a2377;
  font: 1rem/1.55 var(--web-font);
}
.page-tour-card :is(h2, p) { margin: 0; }
.page-tour-card h2 { font-size: 1.2rem; outline: none; }
.page-tour-count { color: var(--saha-primary); font-size: .92rem; font-weight: 750; }
.page-tour-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-block-start: .3rem; }
.page-tour-actions button {
  min-block-size: 2.75rem;
  border: 1px solid var(--saha-outline);
  border-radius: .5rem;
  padding: .35rem .6rem;
  font: inherit;
  color: var(--saha-text);
  background: var(--saha-soft);
  cursor: pointer;
}
.page-tour-actions .page-tour-next { color: var(--saha-primary-ink); background: var(--saha-primary); }
.page-tour-actions button:disabled { opacity: .58; cursor: default; }
html[data-web-shell][data-theme] dialog.page-tour-practice { z-index: 75; pointer-events: none; }
.page-tour-practice .page-tour-card { pointer-events: auto; }
.otp-resend { gap: .45rem; }
.otp-clock { padding-inline: .45rem; border-radius: .45rem; color: var(--saha-primary); background: var(--saha-soft); font-variant-numeric: tabular-nums; }

@media (max-width: 64rem) {
  .studio-top { flex-wrap: wrap; }
  .studio-top .studio-crumb { flex: 1; min-inline-size: 0; overflow-wrap: anywhere; }
  .studio-top .studio-search { order: 3; flex: 1 1 100%; min-inline-size: 0; max-inline-size: none; }
  .web-header .web-header-inner {
    grid-template-areas: "brand actions" "nav nav";
    grid-template-columns: auto minmax(0, 1fr);
    gap: .18rem .7rem;
    min-block-size: 0;
    padding-block: .35rem;
  }
  .web-header .web-nav { justify-content: start; }
  .web-header .web-nav a, .web-header .web-header-control {
    min-block-size: 2.75rem;
    padding: .34rem .55rem;
    font-size: .9rem;
  }
}
@media (max-width: 44rem) {
  .web-header .web-brand-mark { inline-size: 40px; block-size: 40px; }
  .web-auth { display: block; max-inline-size: 33rem; }
  .web-auth-art { display: none; }
  .web-body .web-page { margin-block: .85rem 1.15rem; }
  .web-body .web-card { padding: clamp(.8rem, 3vw, 1.2rem); }
  .studio-content :is(.studio-controls, .web-actions) > * { max-inline-size: 100%; }
  .studio-body :is(.studio-search, .studio-nav-find) input,
  html[data-saha-web] :is(#roundSetup, #peoplePanel) :is(input:not([type="checkbox"], [type="radio"]), select, textarea) {
    font-size: 1rem;
  }
  .portal-category-caption { font-size: .95rem; }
  html[data-saha-web][data-theme][data-web-appearance] #roundSetup .setup-steps button { font-size: .88rem; }
}
@media (max-width: 27.5rem) {
  .web-header .web-header-inner {
    grid-template-areas: "brand" "actions" "nav";
    grid-template-columns: minmax(0, 1fr);
  }
  .web-header .web-header-actions { justify-content: start; }
  .portal-intro-actions :is(.web-primary, .web-secondary) { padding-inline: .55rem; }
  .portal-catalog .portal-category-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.7rem), 1fr)); }
}
@media (orientation: landscape) and (max-height: 31rem) {
  .web-header .web-header-inner { padding-block: .18rem; }
  .portal-home .portal-intro { padding-block: .85rem; }
  .web-body .web-page { margin-block-start: .65rem; }
}
