.ts-site-header {
  --header-text: #f3f3f5;
  --header-muted: #acacb6;
  --header-accent: #ff9e26;
  --header-border: #35353b;
  position: relative;
  z-index: 25;
  flex: none;
  border-bottom: 1px solid #2e2e33;
  background: #141416;
  color: var(--header-text);
  font: 14px/1.5 system-ui, "Apple SD Gothic Neo", sans-serif;
}

.ts-header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  max-width: 1536px;
  min-height: 65px;
  margin-inline: auto;
  padding: env(safe-area-inset-top) max(28px, env(safe-area-inset-right)) 0 max(28px, env(safe-area-inset-left));
}

.ts-header-brand {
  display: flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  color: var(--header-muted);
}
.ts-header-brand svg { flex: none; }
.ts-header-brand img { display: block; width: 156px; min-width: 0; max-width: 100%; height: auto; }

.ts-product-switch {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 4px;
  border: 1px solid #2e2e33;
  border-radius: 9px;
  background: #101012;
}
.ts-product-switch > a, .ts-game-menu > summary {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding-inline: 14px;
  border-radius: 6px;
  color: var(--header-muted);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}
.ts-product-switch > a[href]:hover, .ts-game-menu > summary:hover { color: var(--header-text); background: #242428; }
.ts-product-switch > a[aria-current=page], .ts-game-menu > summary[data-active] { color: var(--header-accent); background: #342619; }

.ts-game-menu { position: relative; }
.ts-game-menu > summary {
  display: flex;
  justify-content: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  touch-action: manipulation;
}
.ts-game-menu > summary::-webkit-details-marker { display: none; }
.ts-game-menu-chevron { flex: none; transition: transform .15s; }
.ts-game-menu[open] .ts-game-menu-chevron { transform: rotate(180deg); }
.ts-game-options {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 1;
  display: grid;
  gap: 4px;
  box-sizing: border-box;
  width: 184px;
  padding: 7px;
  border: 1px solid var(--header-border);
  border-radius: 12px;
  background: #17171a;
  box-shadow: 0 10px 26px #0009;
}
.ts-game-options > a {
  display: flex;
  align-items: center;
  gap: 11px;
  box-sizing: border-box;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 7px;
  background: transparent;
  color: var(--header-muted);
  font: 650 14px/1.5 system-ui, "Apple SD Gothic Neo", sans-serif;
  text-decoration: none;
  white-space: nowrap;
}
.ts-game-options > a:hover { color: var(--header-text); background: #242428; }
.ts-game-options > a[aria-current=page] { color: var(--header-accent); background: #342619; }
.ts-game-options svg { flex: none; }

.ts-account { position: relative; min-width: 0; max-width: 100%; justify-self: end; }
.ts-account summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding-inline: 2px;
  border-radius: 7px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  touch-action: manipulation;
}
.ts-account summary::-webkit-details-marker { display: none; }
.ts-account summary svg { flex: none; }
.ts-account [hidden], .ts-header-brand [hidden] { display: none; }
.ts-account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-account-avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #202024;
}
.ts-account-avatar img { width: 100%; height: 100%; }
.ts-account-avatar img[hidden] { visibility: hidden; display: block; }

.ts-account-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 3px;
  box-sizing: border-box;
  width: min(272px, calc(100vw - 24px));
  max-height: calc(100dvh - 68px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 9px;
  border: 1px solid var(--header-border);
  border-radius: 12px;
  color: var(--header-text);
  background: #17171a;
  box-shadow: 0 10px 26px #0009;
}
.ts-account-options > :is(button, a) {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: normal;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  translate: none;
}
.ts-account-options > :is(button, a):hover { background: #242428; }
.ts-account-options > .ts-menu-primary {
  background: var(--header-accent);
  color: #18120b;
  font-weight: 800;
}
.ts-account-options > .ts-menu-primary:hover { background: #ffb351; }
.ts-account-options > .ts-menu-profile { justify-content: space-between; gap: 8px; padding-block: 8px; }
.ts-menu-profile-copy { min-width: 0; }
.ts-menu-identity { display: flex; gap: 6px; align-items: baseline; }
.ts-menu-identity strong { overflow-wrap: anywhere; font-size: 15px; }
.ts-menu-identity small { flex: none; color: var(--header-muted); font: 650 12px/1.4 ui-monospace, monospace; }
.ts-menu-identity:not([hidden]) + span { color: var(--header-muted); font-size: 12px; }
.ts-menu-chevron {
  flex: none; width: 6px; height: 6px; margin-inline: 2px;
  border-block-start: 1.5px solid; border-inline-end: 1.5px solid;
  transform: rotate(45deg); color: var(--header-muted);
}
.ts-menu-membership {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-block-end: 5px;
  padding: 3px;
  border: 1px solid var(--header-border);
  border-radius: 8px;
  background: #202024;
}
.ts-menu-plan {
  display: flex; flex: 1; align-items: center; gap: 7px; min-width: 0;
  min-height: 40px; padding: 4px 6px; border-radius: 5px;
  color: var(--header-text); text-decoration: none;
}
.ts-menu-plan:hover { background: #2b2b31; }
.ts-menu-plan-copy { flex: 1; display: grid; line-height: 1.3; }
.ts-menu-plan-copy [data-header-text="currentPlan"] { color: var(--header-muted); font-size: 11px; }
.ts-menu-membership img { flex: none; display: block; width: 28px; height: 28px; object-fit: contain; }
.ts-menu-membership strong { font-size: 13px; }
.ts-menu-upgrade {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 32px;
  margin-inline-end: 3px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--header-accent);
  color: #18120b;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.ts-menu-upgrade:hover { background: #ffb351; }
.ts-menu-language { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 9px; }
.ts-menu-language select {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--header-border);
  border-radius: 7px;
  color: var(--header-text);
  background: #202024;
  font: inherit;
}
.ts-account-options > p { margin: 4px 9px; color: var(--header-accent); }
.ts-site-header :is(a, button, summary, select):focus-visible { outline: 2px solid #ffc879; outline-offset: 2px; }

.ts-inquiry {
  box-sizing: border-box;
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--header-border);
  border-radius: 14px;
  background: #17171a;
  color: var(--header-text);
  font: inherit;
  box-shadow: 0 20px 80px #0008;
}
.ts-inquiry [hidden] { display: none; }
.ts-inquiry::backdrop { background: #000a; }
.ts-inquiry-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--header-border);
  box-shadow: inset 0 2px var(--header-accent);
}
.ts-inquiry h2 { margin: 0; color: inherit; font: 750 20px/1.3 system-ui, sans-serif; }
.ts-inquiry-body { padding: 20px; }
.ts-inquiry-body > p { margin: 0 0 12px; color: var(--header-muted); }
.ts-inquiry-body > p:empty { margin: 0; }
.ts-inquiry form { display: grid; gap: 16px; margin: 0; }
.ts-inquiry label { display: grid; gap: 6px; min-width: 0; font-weight: 650; }
.ts-inquiry :is(input, textarea) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--header-border);
  border-radius: 8px;
  background: #202024;
  color: var(--header-text);
  font: 400 16px/1.45 system-ui, sans-serif;
}
.ts-inquiry textarea { resize: vertical; min-height: 88px; }
.ts-inquiry :is(input, textarea):focus { outline: 2px solid var(--header-accent); outline-offset: 1px; }
.ts-inquiry [role="alert"] { margin: 0; color: #ff969c; }
.ts-inquiry :is(button, a) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--header-border);
  border-radius: 8px;
  background: #202024;
  color: var(--header-text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.ts-inquiry .ts-inquiry-close { flex: none; width: 44px; padding: 0; font-size: 24px; }
.ts-inquiry .ts-inquiry-primary {
  justify-self: end;
  border-color: transparent;
  background: var(--header-accent);
  color: #18120b;
  font-weight: 800;
}
.ts-inquiry .ts-inquiry-primary:hover { background: #ffb351; }
.ts-inquiry button:disabled { opacity: .65; cursor: wait; }

@media (max-width: 767px) {
  .ts-header-inner { min-height: 56px; padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); gap: 8px; }
  .ts-header-brand img { width: 110px; }
  .ts-product-switch > a, .ts-game-menu > summary { padding-inline: 7px; font-size: 12px; }
  .ts-game-options { width: 168px; }
  .ts-account-name { display: none; }
  .ts-account-options > :is(button, a) { min-height: 40px; }
}
