/* Public account pages share the same quiet surfaces as the workspace. */
.auth-workspace {
  --auth-bg: #f3eee5;
  --auth-surface: #fffcf7;
  --auth-subtle: #eee7dd;
  --auth-text: #302820;
  --auth-muted: #766858;
  --auth-border: #e1d6c7;
  --auth-accent: #9e4329;
  --auth-accent-soft: #f3e3d7;
  --auth-on-accent: #ffffff;
  --auth-error: #a53d38;
  --auth-error-bg: #fcf0ef;
  --auth-error-border: #e9c5c2;
  color: var(--auth-text);
  background: transparent;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color-scheme: light;
}
html[data-theme="dark"] .auth-workspace {
  --auth-bg: #1b1815;
  --auth-surface: #24201c;
  --auth-subtle: #302921;
  --auth-text: #f0e7da;
  --auth-muted: #b8a995;
  --auth-border: #44392e;
  --auth-accent: #e7aa7c;
  --auth-accent-soft: #443023;
  --auth-on-accent: #291d14;
  --auth-error: #efa6a0;
  --auth-error-bg: #352522;
  --auth-error-border: #65433e;
  color-scheme: dark;
}
.auth-workspace *, .auth-workspace *::before, .auth-workspace *::after { box-sizing: border-box; }
.auth-workspace :is(h1, h2, h3, strong, button, label) { font-weight: 600; }
.auth-workspace :is(h1, h2, h3) { color: var(--auth-text); letter-spacing: -.025em; }
.auth-workspace h1 { margin: 0 0 10px; font-size: clamp(26px, 3vw, 32px); line-height: 1.2; }
.auth-workspace h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.auth-workspace p { color: var(--auth-muted); }
.auth-workspace a { color: var(--auth-accent); text-underline-offset: 3px; }
.auth-workspace :is(button, input, select, textarea) { font-family: inherit; }
.auth-workspace :is(button, a, input, select, textarea):focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 3px; }
.auth-workspace :is(button, a) { -webkit-tap-highlight-color: transparent; }
.auth-workspace :is(button, a):disabled { opacity: .5; cursor: not-allowed; }
.auth-workspace [hidden] { display: none !important; }
.auth-shell, .login-container, .player-auth, .player-step, .telegram-bridge, .server-select-page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: 40px 24px;
  display: grid;
  place-items: center;
}
.auth-card, .login-card, .player-auth-card, .player-step-card, .telegram-bridge-card, .server-select-shell {
  position: relative;
  width: min(520px, 100%);
  padding: 36px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  background: var(--auth-surface);
  box-shadow: 0 18px 55px -35px #65411f55;
}
.auth-card { width: min(720px, 100%); }
/* Botanical margins never cover inputs or intercept clicks. No particle loop. */
.auth-workspace { position: relative; isolation: isolate; }
.auth-workspace::before, .auth-workspace::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: min(30vw, 400px); height: min(40vw, 480px);
  background: url('autumn-botanical.svg') center / contain no-repeat;
  opacity: .65;
}
.auth-workspace::before { top: 0; right: 0; }
.auth-workspace::after { bottom: 0; left: 0; transform: rotate(180deg); opacity: .35; }
html[data-theme="dark"] .auth-workspace::before { opacity: .42; }
html[data-theme="dark"] .auth-workspace::after { opacity: .24; }
.auth-card::before, .login-card::before, .player-auth-card::before {
  content: ""; position: absolute; top: -1px; left: 36px; width: 76px; height: 3px;
  background: var(--season-gold); border-radius: 0 0 2px 2px;
}
.player-step-card { width: min(580px, 100%); }
.auth-head, .login-header, .player-auth-title { margin-bottom: 28px; text-align: left; }
.auth-head p, .login-header p, .player-auth-title p, .player-step-card > p, .telegram-bridge-card p { margin: 0; font-size: 14px; line-height: 1.65; }
.auth-logo, .login-mark, .player-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--auth-accent);
  color: var(--auth-on-accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.04em;
}
.auth-logo, .login-mark { margin-bottom: 24px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; color: var(--auth-muted); font-size: 13px; font-weight: 600; }
.auth-brand .auth-logo { margin: 0; }
.auth-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-workspace .auth-option {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px 12px;
  padding: 22px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  color: var(--auth-text);
  text-decoration: none;
  background: var(--auth-surface);
  transition: border-color .15s, background .15s;
}
.auth-workspace .auth-option:hover { border-color: var(--auth-accent); background: var(--auth-accent-soft); }
.option-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--auth-accent); }
.option-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.auth-option-copy { grid-row: 2; grid-column: 1 / -1; display: grid; gap: 6px; }
.auth-option-copy strong { font-size: 18px; line-height: 1.3; }
.auth-option-description { color: var(--auth-muted); font-size: 13px; }
.auth-option-arrow { grid-row: 1; grid-column: 2; align-self: center; color: var(--auth-muted); }
.auth-option-arrow svg, .provider-arrow svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.auth-workspace .auth-back { display: inline-block; margin-top: 22px; font-size: 13px; text-decoration: none; }
.auth-workspace .auth-back:hover { text-decoration: underline; }
.provider-list, .vk-login-block { display: grid; gap: 12px; }
.auth-workspace .provider-btn, .auth-workspace .vk-login-fallback {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  padding: 14px 16px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  background: var(--auth-surface);
  color: var(--auth-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.auth-workspace .provider-btn:hover, .auth-workspace .vk-login-fallback:hover { border-color: var(--auth-accent); background: var(--auth-accent-soft); }
.provider-icon, .vk-login-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--auth-muted); font-size: 13px; font-weight: 600; }
.provider-btn.vk .provider-icon, .vk-login-icon { color: #2773bd; }
.provider-btn.tg .provider-icon { color: #32849e; }
.provider-copy, .vk-login-copy { display: grid; gap: 3px; min-width: 0; }
.provider-copy strong, .vk-login-copy strong { font-size: 14px; }
.provider-copy span, .vk-login-copy span { color: var(--auth-muted); font-size: 12px; font-weight: 400; }
.provider-arrow, .vk-login-arrow { color: var(--auth-muted); }
.vk-login-arrow { font-size: 22px; }
.vk-login-title { display: flex; justify-content: space-between; gap: 12px; color: var(--auth-muted); font-size: 13px; }
.vk-login-badge { font-size: 12px; }
.login-method-note { margin: 0; font-size: 12px; }
.auth-workspace .provider-support { margin-top: 24px; padding-top: 20px; border-color: transparent; border-top-color: var(--auth-border); border-radius: 0; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--auth-muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--auth-border); }
.code-form, .player-form, .verify-form { display: grid; gap: 14px; }
.player-form { margin-top: 20px; }
.verify-form { margin-top: 20px; }
.code-label, .player-label { color: var(--auth-text); font-size: 13px; font-weight: 600; }
.auth-workspace :is(.code-input, .player-input) {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  background: var(--auth-surface);
  color: var(--auth-text);
  font-size: 16px;
  box-shadow: none;
}
.auth-workspace :is(.code-input, .player-input)::placeholder { color: var(--auth-muted); opacity: .75; }
.verify-form .code-input { min-height: 56px; font-size: 24px; font-weight: 500; letter-spacing: .22em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-workspace :is(.login-btn, .player-button, .primary-btn, .ghost-btn, .player-back-link, .server-submit, .server-logout, .player-action, .provider-action, .player-server-switch, .logout-inline button) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  background: var(--auth-surface);
  color: var(--auth-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: background .15s, border-color .15s;
}
.auth-workspace :is(.login-btn, .player-button, .primary-btn, .server-submit, .player-action, .provider-action.connect) { background: var(--auth-accent); color: var(--auth-on-accent); border-color: var(--auth-accent); }
.auth-workspace :is(.login-btn, .player-button, .primary-btn, .ghost-btn, .player-back-link, .server-submit, .server-logout, .player-action, .provider-action, .player-server-switch, .logout-inline button):hover:not(:disabled) { filter: brightness(.96); }
.auth-workspace :is(.auth-alert, .player-alert, .error-message, .server-error, .server-empty, .player-notice.error) {
  padding: 12px 14px;
  margin: 16px 0;
  border: 1px solid var(--auth-error-border);
  border-radius: 8px;
  background: var(--auth-error-bg);
  color: var(--auth-error);
  font-size: 13px;
  font-weight: 500;
}
.error-message { display: none; }
.auth-workspace .player-note { padding: 12px 14px; border: 1px solid var(--auth-border); border-radius: 8px; background: var(--auth-subtle); color: var(--auth-muted); font-size: 13px; font-weight: 400; }
.auth-workspace :is(.player-server-context, .verify-server) { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; margin: 16px 0; border-top: 1px solid var(--auth-border); border-bottom: 1px solid var(--auth-border); font-size: 13px; }
.auth-workspace :is(.player-server-context, .verify-server) a { flex-shrink: 0; }
.verify-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.verify-head p { margin: 0; font-size: 14px; }
.status-pill { flex-shrink: 0; padding: 5px 9px; border: 1px solid var(--auth-border); border-radius: 5px; color: var(--auth-muted); background: var(--auth-subtle); font-size: 11px; font-weight: 500; }
.status-pill.ready { color: var(--auth-accent); background: var(--auth-accent-soft); }
.status-pill.error { color: var(--auth-error); background: var(--auth-error-bg); border-color: var(--auth-error-border); }
.verify-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.secondary-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.secondary-row form { margin: 0; }
.secondary-row .ghost-btn { font-size: 13px; }
.login-footer { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--auth-border); font-size: 12px; line-height: 1.65; }
.login-footer p { margin: 0 0 8px; }
.server-select-shell { width: min(900px, 100%); }
.server-select-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.server-select-head p { margin: 0; }
.server-identity { max-width: 250px; overflow-wrap: anywhere; color: var(--auth-muted); font-size: 13px; }
.server-groups { display: grid; gap: 24px; }
.server-group h2 { margin-bottom: 12px; font-size: 15px; letter-spacing: 0; }
.server-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.server-option { position: relative; min-width: 0; }
.server-option input { position: absolute; opacity: 0; pointer-events: none; }
.server-option span { min-height: 46px; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--auth-border); border-radius: 6px; color: var(--auth-text); background: var(--auth-surface); cursor: pointer; font-size: 13px; font-weight: 400; }
.server-option span::before { content: ""; width: 13px; height: 13px; flex-shrink: 0; border: 1px solid var(--auth-border); border-radius: 50%; }
.server-option input:checked + span { color: var(--auth-accent); background: var(--auth-accent-soft); border-color: var(--auth-accent); }
.server-option input:checked + span::before { border: 4px solid var(--auth-accent); }
.server-option input:focus-visible + span { outline: 2px solid var(--auth-accent); outline-offset: 2px; }
.server-select-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--auth-border); }
.server-exit-form { margin: 0; }

/* Player workspace: utility first, with account actions kept in view. */
.player-panel { min-height: 100vh; padding: 0 max(24px, calc((100% - 1280px) / 2)) 40px; }
.player-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; margin-bottom: 28px; border-bottom: 1px solid var(--auth-border); }
.player-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-size: 16px; font-weight: 600; }
.player-top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.logout-inline { margin: 0; }
.player-top-actions .player-server-switch { max-width: 360px; font-size: 13px; }
.player-server-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-bottom: 24px; align-items: center; }
.player-card { border: 1px solid var(--auth-border); border-radius: 10px; background: var(--auth-surface); }
.player-hero .hero-copy { padding: 12px 0; background: transparent; border: 0; }
.hero-copy h1 { margin-bottom: 8px; }
.hero-copy p { max-width: 640px; margin: 0; font-size: 14px; }
.profile-mini { padding: 18px; }
.profile-face { display: flex; align-items: center; gap: 12px; min-width: 0; }
.profile-avatar, .profile-avatar-fallback { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 8px; object-fit: cover; border: 1px solid var(--auth-border); }
.profile-avatar-fallback { display: grid; place-items: center; background: var(--auth-subtle); color: var(--auth-accent); font-weight: 600; }
.profile-name { min-width: 0; }
.profile-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.profile-name span { color: var(--auth-muted); font-size: 12px; }
.player-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .8fr); gap: 20px; }
.panel-section { padding: 22px; min-width: 0; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: 18px; }
.section-head p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
.section-head .player-action { flex-shrink: 0; font-size: 13px; min-height: 38px; }
.game-list { display: grid; }
.game-account { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px 0; border-top: 1px solid var(--auth-border); }
.game-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; color: var(--auth-muted); background: var(--auth-subtle); font-size: 12px; }
.game-account strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.game-account span:not(.game-mark):not(.primary-chip) { color: var(--auth-muted); font-size: 12px; }
.primary-chip { padding: 4px 7px; border-radius: 5px; background: var(--auth-accent-soft); color: var(--auth-accent); font-size: 11px; white-space: nowrap; }
.game-account-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.auth-workspace .game-release-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--auth-border); border-radius: 6px; color: var(--auth-accent); font-size: 12px; text-decoration: none; }
.game-release-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.game-release-link:hover { background: var(--auth-accent-soft); }
.provider-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--auth-border); }
.provider-badge { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; background: var(--auth-subtle); color: var(--auth-muted); font-size: 12px; font-weight: 600; }
.provider-row strong { display: block; font-size: 14px; }
.provider-row > div span { color: var(--auth-muted); font-size: 12px; }
.provider-row .provider-action { font-size: 12px; min-height: 36px; padding: 8px 11px; }
.provider-row span.provider-action { cursor: default; border: 0; color: var(--auth-muted); background: transparent; font-weight: 400; }
.player-notice.success { padding: 12px 14px; margin-bottom: 20px; border: 1px solid var(--auth-border); border-radius: 8px; color: var(--auth-accent); background: var(--auth-accent-soft); font-weight: 500; }

/* Support uses the management form components without the admin navigation. */
.pm-public.auth-workspace { --bg: var(--auth-surface); --surface: var(--auth-surface); --text: var(--auth-text); --text-muted: var(--auth-muted); --border: var(--auth-border); background: transparent; min-height: 100vh; padding: 48px 24px; display: grid; place-items: center; }
.pm-public.auth-workspace .pm-page { width: min(760px, 100%); gap: 24px; }
.pm-public.auth-workspace .pm-eyebrow { color: var(--auth-accent); font-size: 11px; letter-spacing: .06em; font-weight: 500; }
.pm-public.auth-workspace .pm-card { padding: 28px; border-radius: 10px; background: var(--auth-surface); box-shadow: none; }
.pm-public.auth-workspace h1 { font-size: 30px; letter-spacing: -.025em; }
.pm-public.auth-workspace header p { margin: 10px 0 0; }
.pm-public.auth-workspace .pm-form { margin: 0; gap: 20px; }
.pm-public.auth-workspace :is(input, select, textarea) { border-radius: 7px; background: var(--auth-surface); font-size: 14px; }
.pm-public.auth-workspace :is(input, select, textarea):focus { outline: 2px solid var(--auth-accent); outline-offset: 2px; }
.pm-public.auth-workspace label { font-weight: 500; }
.pm-public.auth-workspace .pm-btn { border-radius: 7px; font-size: 14px; font-weight: 600; background: var(--auth-surface); color: var(--auth-text); }
.pm-public.auth-workspace .pm-btn.primary { background: var(--auth-accent); color: var(--auth-on-accent); }
.pm-public.auth-workspace .pm-page > .pm-btn { justify-self: start; min-height: auto; padding: 0; border: 0; background: transparent; color: var(--auth-muted); font-size: 13px; font-weight: 400; }
.pm-public.auth-workspace .pm-footer { color: var(--auth-muted); margin: 0; }
.pm-public.auth-workspace .pm-alert { border-radius: 8px; font-size: 13px; font-weight: 500; }
.pm-public.auth-workspace .pm-alert.error { color: var(--auth-error); border-color: var(--auth-error-border); background: var(--auth-error-bg); }
.pm-public.auth-workspace .pm-alert.success { color: var(--auth-accent); border-color: var(--auth-border); background: var(--auth-accent-soft); }

@media (max-width: 940px) {
  .player-grid { grid-template-columns: 1fr; }
  .player-hero { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 620px) {
  .auth-workspace::before { width: 140px; height: 175px; opacity: .35; }
  .auth-workspace::after { width: 110px; height: 135px; opacity: .25; }
  .auth-shell, .login-container, .player-auth, .player-step, .telegram-bridge, .server-select-page { padding: 24px 16px; }
  .auth-card, .login-card, .player-auth-card, .player-step-card, .telegram-bridge-card, .server-select-shell { padding: 26px 22px; }
  .auth-options { grid-template-columns: 1fr; }
  .auth-workspace .auth-option { grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 18px; }
  .auth-option-copy { grid-row: 1; grid-column: 2; gap: 4px; }
  .auth-option-copy strong { font-size: 16px; }
  .auth-option-arrow { grid-column: 3; }
  .verify-head, .server-select-head { flex-direction: column; gap: 12px; }
  .server-options { grid-template-columns: 1fr 1fr; }
  .server-identity { max-width: 100%; }
  .player-panel { padding: 0 16px 28px; }
  .player-topbar { align-items: flex-start; flex-direction: column; padding: 18px 0; gap: 16px; }
  .player-top-actions { width: 100%; }
  .player-top-actions .player-server-switch { flex: 1; max-width: none; min-width: 0; justify-content: flex-start; }
  .player-hero { grid-template-columns: 1fr; gap: 16px; }
  .panel-section { padding: 18px; }
  .section-head { flex-direction: column; }
  .game-account { grid-template-columns: auto minmax(0, 1fr); }
  .game-account-actions { grid-column: 2; justify-content: flex-start; }
  .pm-public.auth-workspace { padding: 28px 16px; }
  .pm-public.auth-workspace .pm-card { padding: 20px; }
  .pm-public.auth-workspace h1 { font-size: 26px; }
}
@media (max-width: 380px) {
  .auth-card, .login-card, .player-auth-card, .player-step-card, .telegram-bridge-card, .server-select-shell { padding: 22px 18px; }
  .auth-workspace .provider-btn, .auth-workspace .vk-login-fallback { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; padding: 12px 10px; }
  .verify-actions { grid-template-columns: 1fr; }
  .server-options { grid-template-columns: 1fr; }
  .auth-workspace :is(.player-server-context, .verify-server) { align-items: flex-start; flex-direction: column; gap: 6px; }
}
