* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent author display: values from overriding the hidden attribute.
   Chrome's UA stylesheet omits !important, so class-level display rules
   (display:flex on game mount divs) would keep hidden siblings in flex flow,
   splitting the solo body height and making all game boards render too small. */
[hidden] {
  display: none !important;
}

:root {
  /* Momotokki Design System v1 */
  --bg-main: #0B0D11;

  --surface-1: #11141A;
  --surface-2: #171B22;
  --surface-3: #1D2430;

  --accent-primary: #27E0B3;
  --accent-primary-hover: #39EDC1;
  --accent-primary-pressed: #1CC89F;

  --accent-secondary: #7B9CFF;
  --accent-gold: #FFC96B;
  --accent-rare: #C084FC;

  --text-primary: #F5F7FA;
  --text-secondary: #B7C0CC;
  --text-muted: #7E8794;

  --success: #3DDB8B;
  --warning: #FFB84D;
  --error: #FF6B7A;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-soft: rgba(255, 255, 255, 0.09);

  --shadow-card:
    0 4px 20px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);

  --shadow-card-hover:
    0 10px 30px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(39, 224, 179, 0.08);

  --glow-primary:
    0 0 0 1px rgba(39, 224, 179, 0.04),
    0 8px 30px rgba(39, 224, 179, 0.06);

  --radius-panel: 20px;
  --radius-card: 18px;
  --radius-input: 14px;
  --radius-pill: 999px;

  --motion-hover: 180ms ease;
  --motion-panel: 250ms ease;
  --motion-modal: 300ms ease;

  /* Legacy bridge variables */
  --background: var(--bg-main);
  --surface: var(--surface-1);
  --card-bg: var(--surface-1);
  --bg-card: var(--surface-1);

  --border-color: var(--border-subtle);

  --primary-color: var(--accent-primary);
  --secondary-color: var(--accent-secondary);
  --success-color: var(--success);
  --danger-color: var(--error);
}

html {
  overflow-y: scroll;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Auth Pages (login / register / reset — MDS Auth-A) */
.container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 32px 20px 48px;
  background-color: var(--bg-main);
  background-image: radial-gradient(
    ellipse 90% 55% at 50% -8%,
    color-mix(in srgb, var(--accent-primary) 9%, transparent),
    transparent 58%
  );
}

.auth-container {
  padding: 0;
  max-width: 420px;
  width: 100%;
}

.auth-brand {
  text-align: center;
  margin-bottom: 30px;
}

.auth-brand-name {
  display: block;
  text-decoration: none;
  text-align: center;
}

.auth-brand-name:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 50%, transparent);
  outline-offset: 6px;
  border-radius: 8px;
}

.auth-brand-tag {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.auth-card {
  background: var(--surface-1);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 420px;
  padding: 28px 28px 32px;
}

.auth-card-title {
  margin: 0 0 24px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.auth-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .auth-name-row {
    grid-template-columns: 1fr;
  }
}

.auth-field--city {
  position: relative;
}

.form-container {
  position: relative;
  min-height: 520px;
  width: 100%;
}

.auth-name-row > .auth-field {
  margin-bottom: 0;
}

.auth-name-row {
  margin-bottom: 16px;
}

.form-section {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
}

.form-section.active {
  opacity: 1;
  pointer-events: all;
  position: relative;
}

.auth-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  padding: 11px 14px;
  border-radius: var(--radius-input);
  font-size: 0.925rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition:
    border-color var(--motion-hover),
    box-shadow var(--motion-hover),
    background-color var(--motion-hover);
}

.auth-input:hover {
  border-color: color-mix(in srgb, var(--text-muted) 35%, var(--border-soft));
}

.auth-input:focus {
  border-color: color-mix(in srgb, var(--accent-primary) 48%, var(--border-soft));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

.auth-input::placeholder {
  color: var(--text-muted);
}

.auth-input--error {
  border-color: color-mix(in srgb, var(--error) 55%, var(--border-soft));
}

.auth-input--error:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 14%, transparent);
}

.auth-input--success {
  border-color: color-mix(in srgb, var(--accent-primary) 55%, var(--border-soft));
}

.auth-input--success:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

.auth-input--checking {
  border-color: var(--border-soft);
}

.auth-select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  padding: 11px 14px;
  border-radius: var(--radius-input);
  font-size: 0.925rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition:
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.auth-select:hover {
  border-color: color-mix(in srgb, var(--text-muted) 35%, var(--border-soft));
}

.auth-select:focus {
  border-color: color-mix(in srgb, var(--accent-primary) 48%, var(--border-soft));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

.auth-dob-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.auth-pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-pw-wrap .auth-input {
  padding-right: 44px;
}

.auth-pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color var(--motion-hover);
}

.auth-pw-toggle:hover {
  color: var(--text-secondary);
}

.auth-pw-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}

.auth-pw-toggle svg[hidden] {
  display: none;
}

.auth-forgot-link {
  display: block;
  text-align: right;
  font-size: 0.8125rem;
  color: var(--accent-primary);
  margin-top: -6px;
  margin-bottom: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--motion-hover);
}

.auth-forgot-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.auth-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding: 12px 14px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  line-height: 1.45;
}

.auth-checkbox-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.auth-checkbox-row label {
  cursor: pointer;
  line-height: 1.45;
}

.auth-checkbox-row label .auth-link {
  font-weight: 500;
}

.auth-link {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--motion-hover);
}

.auth-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.auth-submit-btn {
  width: 100%;
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  color: #08120f;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 32%, transparent);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-primary) 22%, transparent);
  padding: 13px 16px;
  border-radius: var(--radius-input);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 8px;
  transition:
    background var(--motion-hover),
    box-shadow var(--motion-hover),
    border-color var(--motion-hover);
}

.auth-submit-btn:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-primary) 28%, transparent);
}

.auth-submit-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 55%, transparent);
  outline-offset: 3px;
}

.auth-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 22px 0 18px;
}

.auth-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px 20px;
}

.auth-footer-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--motion-hover);
}

.auth-footer-link:hover {
  color: var(--text-secondary);
}

.auth-age-notice {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
  line-height: 1.45;
}

.auth-city-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  max-height: 200px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: var(--shadow-card-hover);
  padding: 4px;
}

.auth-city-suggestion {
  padding: 10px 12px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 10px;
  transition: background-color var(--motion-hover), color var(--motion-hover);
}

.auth-city-suggestion:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

.auth-field--city #cityError.auth-field-error:not(.auth-hidden):not(:empty) {
  margin-top: 8px;
}

.auth-username-wrap {
  position: relative;
}

.auth-username-wrap .auth-input {
  padding-left: 36px;
}

.auth-username-status-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-username-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.45;
}

.auth-username-msg {
  font-size: 0.75rem;
  margin-top: 8px;
  line-height: 1.45;
}

.auth-username-msg--checking {
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}

.auth-username-msg--error {
  color: color-mix(in srgb, var(--error) 88%, var(--text-primary));
  padding: 6px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--error) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 18%, transparent);
}

.auth-username-msg--ok {
  color: color-mix(in srgb, var(--success) 88%, var(--text-primary));
  padding: 6px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--success) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 18%, transparent);
}

.auth-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-soft);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-pw-strength-bar {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  padding: 0 1px;
}

.auth-pw-seg {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  transition: background-color var(--motion-hover);
}

.auth-pw-seg--weak {
  background: color-mix(in srgb, var(--error) 85%, var(--surface-3));
}

.auth-pw-seg--medium {
  background: color-mix(in srgb, var(--warning) 85%, var(--surface-3));
}

.auth-pw-seg--strong {
  background: var(--accent-primary);
}

.auth-pw-strength-label {
  font-size: 0.6875rem;
  font-weight: 500;
  margin-top: 6px;
  letter-spacing: 0.02em;
}

.auth-pw-strength-label--weak {
  color: color-mix(in srgb, var(--error) 90%, var(--text-secondary));
}

.auth-pw-strength-label--medium {
  color: color-mix(in srgb, var(--warning) 90%, var(--text-secondary));
}

.auth-pw-strength-label--strong {
  color: var(--accent-primary);
}

.auth-pw-reqs {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
}

.auth-pw-req {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.auth-pw-req--met {
  color: color-mix(in srgb, var(--success) 90%, var(--text-primary));
}

.auth-pw-req-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentcolor;
  opacity: 0.45;
  flex-shrink: 0;
}

.auth-pw-req--met .auth-pw-req-dot {
  opacity: 1;
}

/* Auth-B: register avatar chooser */
.auth-avatar-section {
  margin-bottom: 4px;
}

.auth-avatar-label {
  margin-bottom: 0;
}

.auth-avatar-sub {
  color: var(--text-muted);
  font-weight: 400;
}

.auth-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
}

.auth-avatar-grid-msg {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.auth-avatar-grid-msg--error {
  color: color-mix(in srgb, var(--error) 80%, var(--text-muted));
}

.auth-avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 6px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--surface-1);
  transition:
    border-color var(--motion-hover),
    background-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.auth-avatar-card:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 32%, transparent);
  background: var(--surface-3);
}

.auth-avatar-card--selected {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 11%, var(--surface-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 22%, transparent);
}

.auth-avatar-card--selected:hover {
  border-color: var(--accent-primary-hover);
  background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-2));
}

.auth-avatar-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.auth-avatar-name {
  font-size: 0.625rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-avatar-card--selected .auth-avatar-name {
  color: var(--text-primary);
}

.auth-avatar-selected {
  margin: 10px 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--success);
  line-height: 1.4;
}

.auth-avatar-clear {
  display: block;
  margin-top: 6px;
  padding: 4px 0;
  font-size: 0.75rem;
  font-family: inherit;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--motion-hover);
}

.auth-avatar-clear:hover {
  color: var(--text-secondary);
}

.auth-avatar-clear:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

.auth-hidden {
  display: none !important;
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.78);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-modal-card {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-hover);
  padding: 28px 28px 24px;
  max-width: 400px;
  width: 100%;
}

.auth-modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 10px;
}

.auth-modal-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 18px;
  line-height: 1.55;
}

.auth-modal-sub strong {
  color: var(--text-primary);
  font-weight: 600;
}

.auth-modal-step--centered {
  text-align: center;
}

.auth-modal-back {
  margin-top: 18px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--accent-primary);
  cursor: pointer;
  transition: color var(--motion-hover);
}

.auth-modal-back:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.auth-field-error {
  color: var(--error);
  font-size: 0.75rem;
  margin-top: 6px;
  line-height: 1.4;
}

.auth-field-error:not(.auth-hidden):not(:empty) {
  padding: 6px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--error) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 20%, transparent);
}

.auth-success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-success-icon svg {
  stroke: currentColor;
}

/* Buttons (global — used outside auth) */
.btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 5px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 15px;
}

.btn-primary {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  color: #08120f;
  border: 1px solid rgba(39, 224, 179, 0.28);
  box-shadow: 0 8px 20px rgba(39, 224, 179, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(39, 224, 179, 0.24);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(39, 224, 179, 0.1);
  color: var(--accent-primary-hover);
  border-color: rgba(39, 224, 179, 0.18);
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.form-toggle {
  text-align: center;
  color: var(--text-secondary);
  margin-top: 16px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.form-toggle a {
  color: var(--accent-primary);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  transition: color var(--motion-hover);
}

.form-toggle a:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.auth-card > .form-toggle:last-child {
  margin-top: 18px;
}

.error-message {
  color: var(--error);
  text-align: center;
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 0.8125rem;
  line-height: 1.45;
  min-height: 0;
}

.error-message:not(:empty) {
  padding: 8px 12px;
  border-radius: var(--radius-input);
  background: color-mix(in srgb, var(--error) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 22%, transparent);
}

.error-message--success {
  color: var(--success);
}

.error-message--success:not(:empty) {
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border-color: color-mix(in srgb, var(--success) 22%, transparent);
}

.auth-modal-card .error-message--success:not(.auth-hidden):not(:empty) {
  text-align: center;
  margin-bottom: 12px;
}

/* Chat Pages */
.chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
  background-color: var(--background);
}

.header {
  background-color: var(--surface);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header h1 {
  color: #667eea;
  font-size: 1.8em;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info span {
  color: var(--text-secondary);
}

#leaveChatBtn,
#logoutBtn {
  padding: 8px 16px;
  width: auto;
  margin: 0;
}

/* Screens */
.waiting-screen,
.chat-screen,
.disconnected-screen {
  display: none;
  flex: 1;
  justify-content: center;
  align-items: center;
}

.waiting-screen.active,
.chat-screen.active,
.disconnected-screen.active {
  display: flex;
}

.waiting-screen {
  background-color: var(--bg-main);
  background-image: radial-gradient(
    ellipse 90% 55% at 50% 18%,
    color-mix(in srgb, var(--accent-primary) 11%, transparent),
    transparent 58%
  );
  flex-direction: column;
}

.waiting-content {
  text-align: center;
  max-width: 100%;
  width: min(100%, 480px);
  padding: 28px 20px 36px;
  box-sizing: border-box;
}

.waiting-momo-img {
  display: block;
  width: min(280px, 76vw);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin: 0 auto 22px;
}

.waiting-ad-container {
  margin-top: 28px;
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  min-height: 100px;
  padding: 12px;
  box-sizing: border-box;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
}

.waiting-ad-container--hidden {
  display: none !important;
}

.spinner {
  border: 3px solid var(--border-soft);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  animation: spin 1s linear infinite;
  margin: 22px auto 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.waiting-screen h2 {
  color: var(--text-primary);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0 0 10px;
}

.waiting-screen p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 26em;
}

/* Chat Screen */
.chat-screen {
  position: relative;
  flex-direction: column;
  padding: 20px;
  gap: 20px;
}

.chat-countdown-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(6, 8, 12, 0.88);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}

.chat-countdown-overlay.active {
  display: flex;
}

.chat-countdown-inner {
  text-align: center;
  padding: 28px 24px;
  max-width: min(100%, 420px);
}

.chat-countdown-label {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.45;
  margin: 0 0 18px;
}

.chat-countdown-label span,
.chat-countdown-label #countdownPartnerName {
  color: var(--accent-primary);
  font-weight: 600;
}

.chat-countdown-ad-slot,
#chatCountdownAdSlot.chat-countdown-ad-slot {
  display: none;
  margin: 0 auto 20px;
  max-width: 320px;
  min-height: 0;
  padding: 10px;
  box-sizing: border-box;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
}

.chat-countdown-number,
#chatCountdownNumber.chat-countdown-number {
  font-size: clamp(4rem, 18vw, 6rem);
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.chat-countdown-sub {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 16px 0 0;
  line-height: 1.45;
}

.video-container:not(.chat-v2-video-stack) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  flex: 1;
  min-height: 0;
}

.video-container.chat-v2-video-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  grid-template-columns: unset;
}

.video-wrapper {
  position: relative;
  background-color: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border-color);
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-label {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.9em;
  z-index: 10;
}

.video-remote-overlays {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.video-handshake-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  line-height: 1;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.2s;
}

.video-block-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(231, 76, 60, 0.85);
  background-color: rgba(0, 0, 0, 0.55);
  color: #e74c3c;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.2s;
}

.video-block-btn:hover {
  background-color: rgba(231, 76, 60, 0.25);
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.video-block-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.video-handshake-btn:hover {
  background-color: rgba(39, 237, 193, 0.22);
  border-color: var(--accent-primary-hover);
}

.video-handshake-btn.handshake-pulse {
  animation: handshake-pulse 1s ease-in-out infinite;
}

@keyframes handshake-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.55);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(102, 126, 234, 0);
    transform: scale(1.06);
  }
}

.video-handshake-btn.handshake-state-play {
  cursor: pointer;
  background-color: rgba(39, 174, 96, 0.35);
  border-color: var(--success-color);
}

.video-handshake-btn.handshake-state-play:hover {
  background-color: rgba(39, 174, 96, 0.45);
  border-color: var(--success-color);
}

.video-handshake-btn.handshake-state-play .handshake-btn-icon {
  font-size: 1.1rem;
  margin-left: 2px;
}

.chat-session-timer-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 1rem;
}

.chat-timer-label {
  color: var(--text-secondary);
}

.chat-timer-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.chat-timer-value.chat-timer-infinity {
  font-size: 1.65rem;
  line-height: 1;
  color: #27ae60;
}

.chat-timer-unit {
  color: var(--text-secondary);
  font-size: 0.95em;
}

.add-time-btn.add-time-pulse:not(.add-time-flash-red) {
  animation: add-time-pulse 1s ease-in-out infinite;
}

.add-time-btn.add-time-flash-red:not(.add-time-pulse) {
  animation: add-time-red-flash 0.75s ease-in-out infinite;
}

.add-time-btn.add-time-pulse.add-time-flash-red {
  animation: add-time-pulse-urgent 0.9s ease-in-out infinite;
}

@keyframes add-time-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.55);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(102, 126, 234, 0);
    transform: scale(1.08);
  }
}

@keyframes add-time-red-flash {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.65);
    border-color: rgba(231, 76, 60, 0.95);
    background-color: var(--surface);
  }
  50% {
    box-shadow: 0 0 20px 6px rgba(231, 76, 60, 0.45);
    border-color: #ff6b6b;
    background-color: rgba(231, 76, 60, 0.28);
  }
}

@keyframes add-time-pulse-urgent {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.75);
    transform: scale(1);
    border-color: #e74c3c;
  }
  50% {
    box-shadow: 0 0 22px 10px rgba(231, 76, 60, 0.42);
    transform: scale(1.08);
    border-color: #ff8787;
  }
}

.control-btn.add-time-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.control-btn.add-time-btn:disabled:hover {
  transform: none;
  background-color: var(--surface);
}

.timer-ended-modal,
#timerEndedModal.timer-ended-modal,
#blockEndedModal.timer-ended-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6, 8, 12, 0.78);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.timer-ended-modal.active,
#timerEndedModal.timer-ended-modal.active,
#blockEndedModal.timer-ended-modal.active {
  display: flex;
}

.timer-ended-inner,
.timer-ended-content {
  background: var(--surface-1);
  border-radius: var(--radius-card);
  padding: 32px 28px 28px;
  max-width: 400px;
  width: 100%;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card-hover);
  text-align: center;
  box-sizing: border-box;
}

.timer-ended-inner h2,
#timerEndedTitle,
#blockEndedTitle {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.3;
}

.timer-ended-text,
#blockEndedText.timer-ended-text {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.timer-ended-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.timer-ended-actions .btn {
  width: 100%;
  margin: 0;
  font-family: inherit;
}

.timer-ended-actions .btn-primary,
#timerNewConnectionBtn,
#blockNewConnectionBtn {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  border: 1px solid color-mix(in srgb, var(--accent-primary) 32%, transparent);
  border-radius: var(--radius-input);
  color: #08120f;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 12px 20px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-primary) 22%, transparent);
  transition:
    background var(--motion-hover),
    box-shadow var(--motion-hover),
    border-color var(--motion-hover);
}

.timer-ended-actions .btn-primary:hover,
#timerNewConnectionBtn:hover,
#blockNewConnectionBtn:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-primary) 28%, transparent);
}

.timer-ended-actions .btn-secondary,
#timerLeaveChatBtn,
#blockLeaveChatBtn {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 11px 20px;
  transition:
    color var(--motion-hover),
    border-color var(--motion-hover),
    background-color var(--motion-hover);
}

.timer-ended-actions .btn-secondary:hover,
#timerLeaveChatBtn:hover,
#blockLeaveChatBtn:hover {
  color: var(--text-primary);
  background: var(--surface-3);
  border-color: color-mix(in srgb, var(--text-muted) 35%, var(--border-soft));
}

.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}

.control-btn {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background-color: var(--surface);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  transition: all 0.3s;
  border: 2px solid var(--border-color);
}

.control-btn:hover {
  background-color: #3a3a3a;
  transform: scale(1.1);
}

.control-btn.btn-danger {
  background-color: rgba(231, 76, 60, 0.2);
}

.control-btn.btn-danger:hover {
  background-color: var(--danger-color);
}

.btn-icon {
  line-height: 1;
}

.chat-messages {
  background-color: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 200px;
  padding: 15px;
}

.messages-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 5px;
  background-color: var(--background);
}

.message.own {
  justify-content: flex-end;
}

.message.own .message-content {
  background-color: #667eea;
}

.message-content {
  background-color: #3a3a3a;
  padding: 8px 12px;
  border-radius: 5px;
  max-width: 70%;
  word-wrap: break-word;
}

.message-time {
  font-size: 0.8em;
  color: var(--text-secondary);
  align-self: flex-end;
  margin-left: 5px;
}

.message-input-container {
  display: flex;
  gap: 10px;
}

/* Attach button */
.chat-attach-btn {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
}
.chat-attach-btn:hover { color: #1db88a; }

/* Image preview strip above input */
.chat-image-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #1a1a1a;
  border-top: 1px solid #2a2a2a;
  position: relative;
}
.chat-image-clear-btn {
  background: rgba(0,0,0,0.6);
  border: none;
  color: #aaa;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-image-clear-btn:hover { color: #e74c3c; }

/* Image messages in chat */
.chat-image-msg {
  max-width: 100%;
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  margin-top: 4px;
  box-sizing: border-box;
}

.message-input {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background-color: var(--background);
  color: var(--text-primary);
  font-size: 0.95em;
}

.message-input:focus {
  outline: none;
  border-color: #667eea;
}

#sendBtn {
  padding: 10px 20px;
  width: auto;
  margin: 0;
}

/* Disconnected Screen (Chat-A) */
.disconnected-screen {
  background-color: var(--bg-main);
  background-image: radial-gradient(
    ellipse 80% 45% at 50% 40%,
    color-mix(in srgb, var(--surface-3) 40%, transparent),
    transparent 62%
  );
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
}

.disconnected-content {
  text-align: center;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  padding: 36px 28px 32px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  min-width: min(320px, 92vw);
  max-width: 400px;
  width: 100%;
  box-sizing: border-box;
}

.disconnected-content h2 {
  font-size: 1.35rem;
  margin: 0 0 10px;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.disconnected-content p,
#disconnectMessage {
  color: var(--text-secondary);
  margin: 0 0 24px;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.disconnected-content .btn-primary,
#findNextBtn.btn-primary {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  border: 1px solid color-mix(in srgb, var(--accent-primary) 32%, transparent);
  border-radius: var(--radius-input);
  padding: 12px 28px;
  color: #08120f;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent-primary) 22%, transparent);
  transition:
    background var(--motion-hover),
    box-shadow var(--motion-hover),
    border-color var(--motion-hover);
}

.disconnected-content .btn-primary:hover,
#findNextBtn.btn-primary:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-primary) 28%, transparent);
}

.disconnected-content .btn-primary:focus-visible,
#findNextBtn.btn-primary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 55%, transparent);
  outline-offset: 3px;
}

#findNextBtn {
  margin: 0 auto;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
  .video-container:not(.chat-v2-video-stack) {
    grid-template-columns: 1fr;
  }

  .chat-messages {
    height: 150px;
  }

  .message-content {
    max-width: 90%;
  }

  .header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .header h1 {
    font-size: 1.3em;
  }

  .user-info {
    justify-content: center;
    width: 100%;
  }

  .controls {
    flex-wrap: wrap;
  }

  .control-btn {
    width: 50px;
    height: 50px;
    font-size: 1.2em;
  }

  .auth-card {
    padding: 24px;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5568d3;
}

/* Profile Page - Facebook-style layout */
.profile-page {
  min-height: 100vh;
  background-color: #3a3b3d;
  color: var(--text-primary);
  padding: 16px;
  padding-top: 8px;
}

.profile-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.profile-top-bar-spacer {
  flex: 1;
}

.profile-top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  padding: 6px 10px;
  text-decoration: none;
  color: var(--text-primary);
  line-height: 1;
}

.profile-logout-btn {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e74c3c;
}

.profile-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 768px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

/* Left column: avatar, name, meta, about */
.profile-left {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-avatar-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.profile-avatar img:not([src]) {
  display: none;
}

.profile-avatar-crop {
  overflow: hidden;
}

.profile-avatar-crop img {
  transition: transform 0.1s ease-out;
}

.profile-avatar-camera {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #4a4b4d;
  border: 2px solid var(--surface);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.profile-avatar-camera:hover {
  background: #5a5b5d;
}

.profile-photo-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.profile-name-line {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.profile-name-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.profile-name-link:hover {
  color: #667eea;
  text-decoration: underline;
}

.profile-name-link:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
  border-radius: 2px;
}

.profile-name-link--inactive {
  color: inherit;
  cursor: default;
  pointer-events: none;
  text-decoration: none;
}

.profile-age {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.profile-meta-line {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0 0 4px 0;
}

.profile-about-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.profile-about-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.profile-about-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.profile-about-edit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  opacity: 0.85;
}

.profile-about-edit:hover {
  opacity: 1;
}

.profile-about-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

.profile-about-textarea {
  width: 100%;
  min-height: 88px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 10px;
  background: var(--background);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.profile-about-save {
  margin-top: 10px;
  width: auto;
}

/* Right column: match preferences */
.profile-right {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-match-preferences h4 {
  font-size: 1rem;
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

.profile-match-preferences label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.profile-match-preferences select,
.profile-match-preferences input:not(.profile-dual-range-input) {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--background);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.profile-age-range-heading {
  margin-top: 4px;
}

.profile-age-range-inputs {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

/* ~40% narrower than equal flex columns (each ~60% of prior share ≈ 30% of row) */
.profile-age-field {
  flex: 0 0 30%;
  max-width: 132px;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 10px 8px;
  min-width: 0;
  box-sizing: border-box;
}

.profile-age-field-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: none;
  margin-bottom: 3px;
  letter-spacing: 0.02em;
}

.profile-age-field-input {
  width: 100% !important;
  margin: 0 !important;
  padding: 3px 0 !important;
  border: none !important;
  background: transparent !important;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  -moz-appearance: textfield;
}

.profile-age-field-input::-webkit-outer-spin-button,
.profile-age-field-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.profile-age-field-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.85;
  font-weight: 500;
}

.profile-age-field-input:focus {
  outline: none;
}

.profile-age-to {
  flex-shrink: 0;
  padding-bottom: 9px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Thumb centers sit on a line shortened by one thumb width so min/max align with track ends */
.profile-dual-range {
  --range-purple: #667eea;
  --thumb-size: 22px;
  --thumb-half: 11px;
  --track-h: 6px;
  --slider-h: 40px;
  position: relative;
  height: var(--slider-h);
  margin-bottom: 16px;
  margin-top: 4px;
  overflow: visible;
  box-sizing: border-box;
  --age-t0: 0;
  --age-t1: 1;
  --age-span: 1;
}

.profile-dual-range-track {
  position: absolute;
  left: var(--thumb-half);
  right: var(--thumb-half);
  top: 50%;
  transform: translateY(-50%);
  height: var(--track-h);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 1;
}

.profile-dual-range-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: var(--track-h);
  border-radius: 3px;
  background: var(--range-purple);
  pointer-events: none;
  z-index: 2;
  left: calc(var(--thumb-half) + (100% - var(--thumb-size)) * var(--age-t0));
  width: calc((100% - var(--thumb-size)) * var(--age-span));
  box-sizing: border-box;
}

.profile-dual-range-input {
  position: absolute;
  left: var(--thumb-half);
  width: calc(100% - var(--thumb-size));
  height: var(--slider-h);
  top: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  -moz-appearance: none;
  outline: none;
  box-sizing: border-box;
}

.profile-dual-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: var(--thumb-size);
  height: var(--thumb-size);
  border-radius: 50%;
  background: var(--range-purple);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  /* Align thumb center with track center (Chrome default sits low without this) */
  margin-top: calc(var(--track-h) / 2 - var(--thumb-size) / 2);
}

.profile-dual-range-input::-webkit-slider-runnable-track {
  height: var(--track-h);
  background: transparent;
  border: none;
}

.profile-dual-range-input::-moz-range-thumb {
  pointer-events: auto;
  width: var(--thumb-size);
  height: var(--thumb-size);
  border-radius: 50%;
  background: var(--range-purple);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  box-sizing: border-box;
}

.profile-dual-range-input::-moz-range-track {
  height: var(--track-h);
  background: transparent;
  border: none;
}

/* Min thumb above max so Firefox shows both; drag max from the right of min */
.profile-dual-range-min {
  z-index: 4;
}

.profile-dual-range-max {
  z-index: 3;
}

.profile-exclude-friends-label {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.profile-exclude-friends-label input[type="checkbox"] {
  width: auto !important;
  margin: 0 !important;
  flex-shrink: 0;
  accent-color: var(--accent, #667eea);
}

.profile-exclude-friends-label span {
  color: var(--text-primary);
  font-weight: 500;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.profile-actions .btn {
  margin-bottom: 0;
}

/* 10-slot profile photos modal */
.profile-photos-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.profile-photos-modal-visible {
  opacity: 1;
  pointer-events: auto;
}

.profile-photos-modal-inner {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  max-width: 96vw;
  max-height: 90vh;
  overflow: auto;
}

.profile-photos-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.profile-photos-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.profile-photos-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.profile-photos-modal-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
}

.profile-photos-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: 100%;
  min-width: 400px;
  max-width: 560px;
}

.profile-photo-slot {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--background);
  border: 2px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.profile-photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-photo-slot-check {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #27ae60;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

.profile-photo-slot-empty {
  font-size: 1.25rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.profile-photo-slot:hover,
.profile-photo-slot-drag-over {
  border-color: #667eea;
  border-style: solid;
}

/* Photo viewer (enlarged, Facebook-style: dark bg, arrows, toolbar) */
.profile-photo-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.profile-photo-viewer-visible {
  opacity: 1;
  pointer-events: auto;
}

.profile-photo-viewer-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
}

.profile-photo-viewer-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.profile-photo-viewer-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.profile-photo-viewer-arrow:hover {
  background: rgba(255, 255, 255, 0.35);
}

.profile-photo-viewer-prev {
  left: 20px;
}

.profile-photo-viewer-next {
  right: 20px;
}

.profile-photo-viewer-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 85vw;
  z-index: 1;
}

.profile-photo-viewer-main img {
  max-width: 85vw;
  max-height: calc(85vh - 140px);
  object-fit: contain;
}

.photo-viewer-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}

.photo-viewer-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.photo-viewer-btn:hover {
  opacity: 0.85;
}

.photo-viewer-btn--profile {
  background: #1db88a;
  color: #fff;
}

.photo-viewer-btn--delete {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.35);
}

.photo-viewer-btn--delete:hover {
  background: rgba(231, 76, 60, 0.25);
  opacity: 1;
}

.photo-viewer-counter {
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

/* Slot action menu (Replace / Delete / Set as profile picture) */
.profile-slot-menu {
  position: fixed;
  z-index: 1001;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  padding: 6px 0;
  min-width: 180px;
  opacity: 0;
  pointer-events: none;
}

.profile-slot-menu-visible {
  opacity: 1;
  pointer-events: auto;
}

.profile-slot-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.profile-slot-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Crop editor modal */
.profile-crop-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.profile-crop-modal-visible {
  opacity: 1;
  pointer-events: auto;
}

.profile-crop-modal-inner {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  max-width: 95vw;
  max-height: 95vh;
  overflow: auto;
}

.profile-crop-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.profile-crop-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.profile-crop-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.profile-crop-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
}

.profile-crop-viewport {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  margin: 0 auto 20px;
  background: var(--background);
}

.profile-crop-circle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

.profile-crop-image-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-crop-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.profile-crop-controls {
  margin-bottom: 16px;
}

.profile-crop-controls label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.profile-crop-controls input[type="range"] {
  width: 100%;
}

.profile-crop-actions {
  display: flex;
  gap: 12px;
}

.profile-crop-actions .btn {
  flex: 1;
}

/* Settings page */
.settings-page {
  min-height: 100vh;
  background: var(--background);
  color: var(--text-primary);
  padding: 24px;
}

.settings-header {
  max-width: 560px;
  margin: 0 auto 24px;
}

.settings-back {
  display: inline-block;
  color: #667eea;
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.settings-back:hover {
  text-decoration: underline;
}

.settings-header h1 {
  font-size: 1.75rem;
  margin: 0;
  color: var(--text-primary);
}

.settings-main {
  max-width: 560px;
  margin: 0 auto;
}

.settings-form label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.settings-form input,
.settings-form select {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 1rem;
}

.settings-actions {
  margin-top: 24px;
}

.settings-actions .btn {
  width: auto;
  min-width: 160px;
}

/* Public profile page (view-only) */
.public-profile-page {
  min-height: 100vh;
  background: var(--background);
  color: var(--text-primary);
}

.public-profile-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px;
}

.public-profile-loading {
  text-align: center;
  color: var(--text-secondary);
  padding: 48px 0;
}

.public-profile-content {
  padding-top: 8px;
}

.public-profile-avatar-wrap {
  margin-bottom: 16px;
}

.public-profile-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.public-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.public-profile-no-photo {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.public-profile-name-line {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.public-profile-about h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.public-profile-photos-link-wrap {
  margin-top: 20px;
}

.public-profile-photos-link {
  color: #667eea;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.public-profile-photos-link:hover {
  text-decoration: underline;
}

.public-profile-error {
  text-align: center;
  padding: 48px 20px;
}

.public-profile-error p {
  margin: 0 0 16px 0;
  color: var(--text-secondary);
}

.public-profile-error .btn {
  display: inline-block;
}

/* Public profile photos modal */
.public-photos-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.public-photos-modal-visible {
  opacity: 1;
  pointer-events: auto;
}

.public-photos-modal-inner {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  max-width: 96vw;
  max-height: 90vh;
  overflow: auto;
}

.public-photos-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.public-photos-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.public-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  min-width: 280px;
}

.public-photo-slot {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--background);
}

.public-photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Messages page */
.messages-page {
  min-height: 100vh;
  background: var(--background);
  color: var(--text-primary);
  padding-bottom: 40px;
}

.messages-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.messages-back {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.messages-back:hover {
  text-decoration: underline;
}

.messages-header h1 {
  font-size: 1.25rem;
  margin: 0;
}

.messages-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
}

.messages-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.messages-tab:hover {
  color: var(--text-primary);
}

.messages-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.messages-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

.messages-toolbar {
  margin-bottom: 16px;
}

.messages-delete-btn,
.messages-clear-trash-btn {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.messages-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  background: var(--surface);
  margin-bottom: 4px;
  border-radius: 8px;
}

.messages-row:hover {
  background: #333;
}

.messages-row-unread .messages-subject {
  font-weight: 700;
}

.messages-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.messages-subject {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages-meta {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.messages-load-error {
  color: #b91c1c;
  max-width: 36rem;
}

.messages-empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 32px;
}

.messages-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.messages-detail-overlay.messages-detail-visible {
  opacity: 1;
  pointer-events: auto;
}

.messages-detail-modal {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow: auto;
}

.messages-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.messages-detail-header h2 {
  font-size: 1.15rem;
  margin: 0;
  flex: 1;
  padding-right: 12px;
}

.messages-detail-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.messages-detail-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
}

.messages-detail-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.messages-detail-in-reply {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  padding: 10px 12px;
  background: var(--background);
  border-radius: 8px;
  border-left: 3px solid #667eea;
}

.messages-detail-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* View messages link on profile (with unread count) */
.profile-view-messages-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.95rem;
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.profile-view-messages-link:hover {
  text-decoration: underline;
}

.profile-view-messages-link.unread {
  font-weight: 700;
}

.profile-view-messages-link .unread-badge {
  font-weight: 700;
  margin-left: 4px;
}

/* Friends / Connections expandable (profile) */
.profile-friends-wrap {
  margin-top: 12px;
}

.profile-friends-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 320px;
  padding: 6px 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.15s;
}

.profile-friends-toggle:hover {
  opacity: 0.88;
}

.profile-friends-toggle-label {
  color: #667eea;
}

.profile-friends-chevron {
  font-size: 0.7rem;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.profile-friends-toggle[aria-expanded="true"] .profile-friends-chevron {
  transform: rotate(-180deg);
}

.profile-friends-panel {
  margin-top: 12px;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--background);
}

.profile-social-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-social-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 0;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.15s;
}

.profile-social-section-toggle:hover {
  opacity: 0.88;
}

.profile-social-section-toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-social-section-chevron {
  flex-shrink: 0;
  margin-left: 10px;
  font-size: 0.65rem;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.profile-social-section-toggle[aria-expanded="true"]
  .profile-social-section-chevron {
  transform: rotate(-180deg);
}

.profile-social-section-panel[hidden] {
  display: none !important;
}

.profile-social-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  min-height: 72px;
  border-radius: 8px;
  border: 1px dashed var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

.profile-social-drop-zone.profile-social-drop-hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.12);
}

.profile-social-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.profile-social-item:last-child {
  margin-bottom: 0;
}

.profile-social-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.profile-social-item-friend .profile-social-item-main,
.profile-social-item-connection .profile-social-item-main {
  cursor: grab;
}

.profile-social-item-friend .profile-social-item-main:active,
.profile-social-item-connection .profile-social-item-main:active {
  cursor: grabbing;
}

.profile-social-item-connection {
  cursor: default;
}

.profile-social-item-friend {
  border-color: rgba(39, 174, 96, 0.35);
}

.profile-social-list-blocked {
  border-style: solid;
  border-color: rgba(231, 76, 60, 0.25);
}

.profile-social-item-blocked {
  border-color: rgba(231, 76, 60, 0.35);
  cursor: default;
}

.profile-social-avatar-wrap {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.22);
}

.profile-social-avatar-clip {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}

.profile-social-avatar-badge {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  border: 1.5px solid #0d0d0d;
  z-index: 2;
  pointer-events: none;
}

.profile-social-avatar-badge--ghost {
  background: #4b5563;
  top: -2px;
  left: -2px;
}

.profile-social-avatar-badge--mute {
  background: #4b5563;
  top: -2px;
  left: 10px;
}

.profile-social-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  overflow: hidden;
  border-radius: 50%;
}

.profile-social-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  overflow: visible;
  border-radius: 50%;
}

.profile-social-avatar-placeholder-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

.profile-social-item-main .profile-social-name {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-social-kebab-details {
  position: relative;
  flex-shrink: 0;
  list-style: none;
}

.profile-social-kebab-details[open] {
  z-index: 20;
}

.profile-social-kebab {
  list-style: none;
  width: 36px;
  height: 36px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1;
  user-select: none;
}

.profile-social-kebab::-webkit-details-marker {
  display: none;
}

.profile-social-kebab::marker {
  content: "";
}

.profile-social-kebab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.profile-social-menu {
  position: fixed;
  min-width: 188px;
  padding: 6px 0;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  z-index: 9999;
}

.profile-social-kebab-details[open] .profile-social-menu {
  pointer-events: auto;
}

.profile-social-menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-social-menu-item:hover {
  background: rgba(102, 126, 234, 0.14);
}

.profile-social-menu-item-delete {
  color: #e74c3c;
}

.profile-social-menu-item-delete:hover {
  background: rgba(231, 76, 60, 0.12);
}

.profile-social-menu-empty {
  margin: 0;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-social-name {
  font-weight: 600;
  color: var(--text-primary);
}

.profile-social-username {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.profile-social-empty {
  list-style: none;
  margin: 0;
  padding: 12px 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Send message on public profile */
.public-profile-send-message-wrap {
  margin-top: 20px;
}

.public-profile-send-message-btn {
  display: inline-block;
  padding: 10px 20px;
  background: #667eea;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
}

.public-profile-send-message-btn:hover {
  background: #5a6fd6;
}

.public-profile-send-message-modal,
.profile-send-message-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding: 24px 16px;
  overflow-y: auto;
}

.public-profile-send-message-modal.visible,
.profile-send-message-modal.profile-send-message-modal-visible {
  display: flex;
}

.public-profile-send-message-modal-inner,
.profile-send-message-modal-inner {
  background: #111;
  border: 1px solid #222;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.public-profile-send-message-modal-inner h3 {
  margin: 0 0 16px 0;
  font-size: 1.2rem;
}

.messages-login-prompt {
  color: var(--text-secondary);
  margin: 0;
}

.messages-login-prompt a {
  color: #667eea;
  font-weight: 600;
}

.public-profile-send-message-modal-inner label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.public-profile-send-message-modal-inner input,
.public-profile-send-message-modal-inner textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--background);
  color: var(--text-primary);
  font-size: 1rem;
}

.public-profile-send-message-modal-inner textarea {
  min-height: 100px;
  resize: vertical;
}

.public-profile-send-message-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.public-profile-send-message-modal-actions .btn {
  flex: 1;
}

/* Send message modal (profile friends / connections kebab) — overlay above; inner shared with public-profile */

.profile-send-message-modal-inner h3 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
}

.profile-send-message-to {
  margin: 0 0 16px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.profile-send-message-modal-inner label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  margin-top: 8px;
}

.profile-send-message-modal-inner label:first-of-type {
  margin-top: 0;
}

.profile-send-message-modal-inner input[type="text"],
.profile-send-message-modal-inner textarea {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}

.profile-send-message-modal-inner textarea {
  min-height: 100px;
  resize: none;
}

.profile-send-message-modal-inner input[type="file"] {
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.profile-send-message-remove-file {
  margin-bottom: 12px;
}

.profile-send-message-preview {
  margin-bottom: 12px;
}

.profile-send-message-preview-img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  display: block;
}

.profile-send-message-error {
  color: #e74c3c;
  font-size: 0.88rem;
  margin: 0 0 8px 0;
  min-height: 1.2em;
}

.profile-send-message-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.profile-send-message-actions .btn {
  flex: 1;
}

.messages-detail-attachment {
  margin-top: 16px;
}

.messages-detail-attachment img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
}

/* ----- Social wall / feed ----- */
.profile-view-feed-link {
  display: block;
  margin-top: 8px;
  font-size: 0.95rem;
  color: #667eea;
  text-decoration: none;
}
.profile-view-feed-link:hover {
  text-decoration: underline;
}

.profile-wall-outer {
  max-width: 640px;
  margin: 24px auto 48px;
  padding: 0 16px;
}
.profile-wall-heading {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.wall-composer.card {
  background: var(--card-bg, #2a2a2a);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color, #444);
}
.wall-composer textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--background);
  color: var(--text-primary);
  box-sizing: border-box;
  margin-bottom: 10px;
}
.wall-composer-vis-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.wall-composer-select {
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--background);
  color: var(--text-primary);
}
.wall-composer-file-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.wall-composer-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.wall-composer-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
}
.wall-composer-error {
  color: #e74c3c;
  font-size: 0.88rem;
  margin-top: 8px;
}

.wall-composer-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.wall-composer-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font: inherit;
}
.wall-composer-tab--active {
  background: linear-gradient(
    180deg,
    rgba(39, 224, 179, 0.18),
    rgba(39, 224, 179, 0.1)
  );
  border-color: rgba(39, 224, 179, 0.22);
  color: var(--accent-primary-hover);
}
.wall-form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #444);
  background: var(--background, #111);
  color: var(--text-primary, #ddd);
  margin-bottom: 8px;
  font: inherit;
}
.wall-poll-choice-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.wall-poll-choice-row .wall-form-input {
  flex: 1;
  margin-bottom: 0;
}
.wall-poll-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wall-poll-thumb img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

.wall-post-head--flex {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 10px;
}
.wall-post-head-main {
  flex: 1;
  min-width: 0;
}
.wall-post-pin-wrap {
  flex-shrink: 0;
}
.wall-post-pin-btn {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
}
.wall-post-pin-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}
.wall-post-meta-poll-badge {
  color: #0d9488;
  font-weight: 700;
  font-size: 0.75rem;
  margin-right: 4px;
}
.wall-post-meta-pinned-badge {
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.75rem;
  margin-right: 4px;
}
.wall-post-poll-shell {
  margin-bottom: 8px;
}
.wall-post-poll-question {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 10px;
  white-space: pre-wrap;
}
.wall-poll-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 100%;
  text-align: left;
  font: inherit;
  box-sizing: border-box;
  background: #1e1e1e;
  color: #e5e5e5;
}
.wall-poll-option-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.wall-poll-option-text {
  flex: 1;
  font-size: 13px;
  color: #ccc;
  position: relative;
  z-index: 1;
}
.wall-poll-option-body {
  flex: 1;
  min-width: 0;
}
.wall-post-poll-img-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.wall-post-poll-img-cell {
  width: calc(50% - 4px);
  max-width: 200px;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
}
.wall-post-poll-img-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wall-post-poll-opt {
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  background: #1e1e1e;
  padding: 10px 12px;
  color: #e5e5e5;
  font: inherit;
}
.wall-post-poll-opt--vote:hover {
  border-color: #444;
}
.wall-post-poll-opt--result {
  padding: 10px 12px;
}
.wall-post-poll-opt--voted {
  border-color: #0d9488;
}
.wall-post-poll-opt-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wall-post-poll-pct {
  color: #aaa;
  font-weight: 600;
}
.wall-post-poll-bar {
  height: 6px;
  background: #333;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.wall-post-poll-bar-fill {
  height: 100%;
  background: #0d9488;
  border-radius: 3px;
}
.wall-post-poll-hint {
  font-size: 0.8rem;
  color: #888;
  margin-top: 6px;
}
.wall-post-poll-close {
  display: inline-block;
  margin-top: 10px;
  color: #14b8a6;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.wall-post-poll-close:hover {
  text-decoration: underline;
}

.wall-post-card {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.025),
      rgba(255, 255, 255, 0.01)
    ),
    var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 14px;
  margin-bottom: 14px;
}
.wall-post-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.wall-post-avatar-wrap {
  flex-shrink: 0;
}
.wall-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  display: block;
}
.wall-post-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a3a31;
  color: #00b894;
  font-size: 13px;
  font-weight: 600;
}
.wall-post-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.wall-post-time-row {
  margin-top: 2px;
}
.wall-post-author-name {
  font-weight: 600;
  color: var(--text-primary);
}
a.wall-post-author-name.wall-post-author-link {
  color: var(--text-primary);
  text-decoration: none;
}
a.wall-post-author-name.wall-post-author-link:hover {
  text-decoration: underline;
}
.wall-post-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.wall-post-time-row .wall-post-time {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.wall-post-time {
  color: var(--text-muted);
}
.wall-post-vis-badge {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(102, 126, 234, 0.25);
  color: #aab4ff;
}
.wall-post-content {
  white-space: pre-wrap;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 10px;
}
.wall-post-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.feed-page .wall-post-single-image,
#profileFeedSection .wall-post-single-image {
  max-width: 100%;
  max-height: 330px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  cursor: pointer;
  margin-top: 6px;
  border: 1px solid var(--border-color, #333);
}

.wall-post-link-preview {
  border: 1px solid #222;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  background: #111;
  transition: border-color 0.15s;
}

.wall-post-link-preview:hover {
  border-color: #444;
}

.wall-post-link-preview-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.wall-post-link-preview-body {
  padding: 10px 12px;
}

.wall-post-link-preview-domain {
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.wall-post-link-preview-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wall-post-link-preview-description {
  font-size: 12px;
  color: #888;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wall-composer-link-preview {
  border: 1px solid #222;
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0;
  background: #111;
  position: relative;
}

.wall-composer-link-preview-dismiss {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.wall-composer-link-preview-loading {
  padding: 12px;
  font-size: 12px;
  color: #666;
}

.wall-post-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wall-post-actions-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.wall-post-actions-pin-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  font: inherit;
}
.wall-post-actions-pin-group:hover {
  background: rgba(255, 255, 255, 0.06);
}
.wall-post-actions-pin-group--pinned {
  color: #1db88a;
}
.wall-post-actions-pin-group--pinned .wall-post-pin-drop,
.wall-post-actions-pin-group--pinned .wall-post-pin-dot {
  stroke: #1db88a;
}
.wall-post-actions-pin-group--pinned .wall-post-pin-drop {
  fill: #1db88a;
}
.wall-post-pin-svg-outer {
  display: flex;
  align-items: center;
  line-height: 0;
}
.wall-post-pin-label {
  font-size: 15px;
  font-weight: 500;
  color: inherit;
}
.wall-post-like-btn,
.wall-post-comment-toggle {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wall-post-like-btn:hover,
.wall-post-comment-toggle:hover {
  background: rgba(39, 224, 179, 0.1);
  border-color: rgba(39, 224, 179, 0.18);
  color: var(--accent-primary-hover);
}
.wall-post-like-icon {
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.wall-post-delete {
  margin-left: auto;
  font-size: 0.85rem;
  padding: 6px 10px;
  background: #333;
  border: 1px solid #555;
  color: var(--text-primary);
  cursor: pointer;
}
.wall-post-delete:hover {
  background: #3a3a3a;
}
.wall-post-comments-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
.wall-post-comment-input {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--background);
  color: var(--text-primary);
  margin-bottom: 8px;
  box-sizing: border-box;
}
.wall-comment-row {
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.wall-comment-body {
  margin-top: 4px;
  white-space: pre-wrap;
}

/* —— Wall comments v2 (scoped: feed + profile feed) —— */
.feed-page .wall-post-card,
#profileFeedSection .wall-post-card {
  position: relative;
}
.feed-page .wall-post-head,
#profileFeedSection .wall-post-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  position: relative;
}
.feed-page .wall-post-head-main,
#profileFeedSection .wall-post-head-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.feed-page .wall-post-head-menu,
#profileFeedSection .wall-post-head-menu {
  position: relative;
  flex-shrink: 0;
}
.feed-page .wall-post-menu-btn,
#profileFeedSection .wall-post-menu-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
}

.feed-page .wall-post-menu-btn:hover,
#profileFeedSection .wall-post-menu-btn:hover {
  background: rgba(39, 224, 179, 0.1);
  border-color: rgba(39, 224, 179, 0.18);
}

.feed-page .wall-post-menu-dot,
#profileFeedSection .wall-post-menu-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  display: block;
}
.feed-page .wall-dropdown,
#profileFeedSection .wall-dropdown {
  display: none;
  position: absolute;
  right: 0;
  min-width: 160px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-hover);
  z-index: 200;
  padding: 4px 0;
}
.feed-page .wall-dropdown.wall-dropdown--open,
#profileFeedSection .wall-dropdown.wall-dropdown--open {
  display: block;
}
.feed-page .wall-dropdown-item,
#profileFeedSection .wall-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}
.feed-page .wall-dropdown-item:hover,
#profileFeedSection .wall-dropdown-item:hover {
  background: rgba(39, 224, 179, 0.08);
}
.feed-page .wall-post-edited-label,
#profileFeedSection .wall-post-edited-label {
  color: #666;
  font-size: 11px;
  font-style: italic;
  margin-left: 4px;
}
.feed-page .wall-post-inline-edit,
#profileFeedSection .wall-post-inline-edit {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 10px;
  box-sizing: border-box;
}
.feed-page .wall-post-edit-textarea,
#profileFeedSection .wall-post-edit-textarea {
  background: #1a1a1a;
  color: #ddd;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.6;
  width: 100%;
  resize: none !important;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  min-height: 80px;
}
.feed-page .wall-post-edit-textarea:focus,
#profileFeedSection .wall-post-edit-textarea:focus {
  border-color: #00b894;
}
.feed-page .wall-inline-edit-actions,
#profileFeedSection .wall-inline-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.feed-page .wall-post-edit-save,
.feed-page .wall-comment-edit-save,
#profileFeedSection .wall-post-edit-save,
#profileFeedSection .wall-comment-edit-save {
  background: #00b894;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.feed-page .wall-post-edit-cancel,
.feed-page .wall-comment-edit-cancel,
#profileFeedSection .wall-post-edit-cancel,
#profileFeedSection .wall-comment-edit-cancel {
  background: transparent;
  color: #888;
  border: 1px solid #333;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
}
.feed-page .wall-post-edit-save:hover,
.feed-page .wall-comment-edit-save:hover,
#profileFeedSection .wall-post-edit-save:hover,
#profileFeedSection .wall-comment-edit-save:hover {
  filter: brightness(1.08);
}
.feed-page .wall-post-edit-cancel:hover,
.feed-page .wall-comment-edit-cancel:hover,
#profileFeedSection .wall-post-edit-cancel:hover,
#profileFeedSection .wall-comment-edit-cancel:hover {
  color: #aaa;
  border-color: #444;
}
.feed-page .wall-comment-pill-form,
#profileFeedSection .wall-comment-pill-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
}
.feed-page .wall-comment-pill-top-row,
#profileFeedSection .wall-comment-pill-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.feed-page .wall-comment-pill-input-row,
#profileFeedSection .wall-comment-pill-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.feed-page .wall-comment-pill-input-row .wall-comment-pill-input,
#profileFeedSection .wall-comment-pill-input-row .wall-comment-pill-input {
  flex: 1;
  min-width: 0;
}
.feed-page .wall-comment-pill-file,
#profileFeedSection .wall-comment-pill-file {
  display: none;
}
.feed-page .wall-comment-pill-attach,
#profileFeedSection .wall-comment-pill-attach {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-color, #444);
  background: var(--background, #111);
  color: var(--text-secondary, #aaa);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feed-page .wall-comment-pill-attach:hover,
#profileFeedSection .wall-comment-pill-attach:hover {
  color: var(--text-primary, #ddd);
  border-color: #555;
}
.feed-page .wall-comment-pill-preview-row,
#profileFeedSection .wall-comment-pill-preview-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 46px;
}
.feed-page .wall-comment-pill-preview-img,
#profileFeedSection .wall-comment-pill-preview-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color, #444);
}
.feed-page .wall-comment-pill-preview-remove,
#profileFeedSection .wall-comment-pill-preview-remove {
  border: none;
  background: transparent;
  color: #888;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.feed-page .wall-comment-inline-image,
#profileFeedSection .wall-comment-inline-image {
  max-width: 100%;
  max-height: 330px;
  border-radius: 8px;
  margin-top: 6px;
  object-fit: contain;
  border: 1px solid var(--border-color, #333);
}
.feed-page .wall-comment-pill-avatar,
#profileFeedSection .wall-comment-pill-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.feed-page .wall-comment-pill-mid,
#profileFeedSection .wall-comment-pill-mid {
  flex: 1;
  min-width: 0;
  position: relative;
}

em-emoji-picker {
  --background-rgb: 30, 30, 30;
  --border-radius: 10px;
  position: absolute;
  bottom: 40px;
  right: 0;
  z-index: 100;
  max-height: 300px;
}

.feed-page .wall-comment-pill-emoji,
#profileFeedSection .wall-comment-pill-emoji {
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  font-size: 14px;
  color: var(--text-secondary, #aaa);
}
.feed-page .wall-comment-pill-emoji:hover,
#profileFeedSection .wall-comment-pill-emoji:hover {
  color: #fff;
}

.wall-composer-emoji-row {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.wall-composer-emoji-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  line-height: 1;
  color: var(--text-secondary, #aaa);
}
.wall-composer-emoji-btn:hover {
  color: #fff;
}

.wall-view-more-replies {
  color: #1db88a;
  font-size: 12px;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  margin-left: 28px;
}

.wall-reply-thread-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0d0d0d;
  z-index: 1000;
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
}
.wall-reply-thread-back {
  display: inline-block;
  margin-bottom: 16px;
  padding: 8px 0;
  border: none;
  background: none;
  color: #1db88a;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.wall-reply-thread-parent {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #222;
}
.wall-reply-thread-nested {
  padding-left: 4px;
}

.wall-reply-thread-page-header {
  border-bottom: 1px solid #333;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.wall-reply-thread-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 6px;
}
.wall-reply-thread-back-link:hover {
  color: #ddd;
  text-decoration: none;
}
.wall-reply-thread-page-title {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px 0;
}
.wall-reply-thread-page-sub {
  color: #888;
  font-size: 11px;
  margin: 0;
}
.wall-reply-thread-parent-card {
  border-left: 3px solid #1db88a;
  background: #111;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.wall-reply-thread-parent-label {
  color: #888;
  font-size: 11px;
  margin: 0 0 8px 0;
}
.wall-reply-thread-parent-inner .wall-comment-author,
.wall-reply-thread-parent-inner a.wall-comment-author {
  color: #1db88a !important;
}
.wall-reply-thread-reply-count {
  color: #888;
  font-size: 12px;
  margin: 0 0 10px 0;
}
.wall-reply-thread-chain .wall-comment-replies {
  border-left: 2px solid rgba(29, 184, 138, 0.15);
  padding-left: 8px;
  margin-top: 4px;
}
.wall-reply-thread-main .wall-comment-replies {
  padding-left: 8px;
}
.wall-reply-thread-error {
  color: #f87171;
  font-size: 13px;
  margin: 0 0 12px 0;
}

.wall-max-depth-msg {
  color: #555;
  font-size: 11px;
  font-style: italic;
  padding: 2px 0;
}

/* Reply thread page: widen main column vs ad rail; avoid nested thread overflow */
.wall-reply-thread-main {
  overflow-x: hidden;
}
.wall-reply-thread-inner {
  min-width: 0;
  width: 100%;
}
.wall-reply-thread-main .wall-comment-pill-top-row {
  flex-wrap: wrap;
  min-width: 0;
}
.wall-reply-thread-main .wall-comment-pill-input-row {
  min-width: 0;
  flex-wrap: nowrap;
}
.wall-reply-thread-feed.feed-page {
  max-width: none;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.wall-reply-thread-main .wall-comment-inner,
.wall-reply-thread-main .wall-comment-main,
.wall-reply-thread-main .wall-comment-replies,
.wall-reply-thread-main .wall-reply-thread-chain,
.wall-reply-thread-main .wall-reply-thread-parent-inner,
.wall-reply-thread-main .wall-comment-row {
  min-width: 0;
}
.feed-page .wall-comment-pill-input,
#profileFeedSection .wall-comment-pill-input,
.wall-reply-thread-main .wall-comment-pill-input {
  width: 100%;
  min-width: 120px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid var(--border-color, #444);
  background: var(--background, #111);
  color: var(--text-primary);
  padding: 10px 16px;
  font-size: 0.95rem;
  resize: none;
  line-height: 1.3;
  max-height: 2.6rem;
  transition:
    max-height 0.2s ease,
    box-shadow 0.2s ease;
}
.feed-page .wall-comment-pill-input:focus,
#profileFeedSection .wall-comment-pill-input:focus,
.wall-reply-thread-main .wall-comment-pill-input:focus {
  outline: none;
  max-height: 6rem;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.35);
}
.feed-page .wall-comment-pill-post,
#profileFeedSection .wall-comment-pill-post {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: #0d9488;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}
.feed-page .wall-comment-pill-post:hover,
#profileFeedSection .wall-comment-pill-post:hover {
  background: #14b8a6;
}
.feed-page .wall-comments-sort-bar,
#profileFeedSection .wall-comments-sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.feed-page .wall-comments-sort-label,
#profileFeedSection .wall-comments-sort-label {
  font-size: 0.8rem;
  color: var(--text-secondary, #888);
}
.feed-page .wall-comments-sort-pill,
#profileFeedSection .wall-comments-sort-pill {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color, #444);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
}
.feed-page .wall-comments-sort-pill--active,
#profileFeedSection .wall-comments-sort-pill--active {
  background: #0d9488;
  border-color: #0d9488;
  color: #fff;
}
.feed-page .wall-comments-thread,
#profileFeedSection .wall-comments-thread {
  margin-top: 4px;
}
.feed-page .wall-comment-inner,
#profileFeedSection .wall-comment-inner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.feed-page .wall-comment-avatar,
#profileFeedSection .wall-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a5568, #2d3748);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feed-page .wall-comment-avatar--sm,
#profileFeedSection .wall-comment-avatar--sm {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
}
.feed-page .wall-comment-row--reply .wall-comment-main,
#profileFeedSection .wall-comment-row--reply .wall-comment-main {
  font-size: 12px;
}
.feed-page .wall-comment-main,
#profileFeedSection .wall-comment-main {
  flex: 1;
  min-width: 0;
}
.feed-page .wall-comment-header,
#profileFeedSection .wall-comment-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  position: relative;
}
.feed-page .wall-comment-author,
#profileFeedSection .wall-comment-author {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.feed-page .wall-comment-author:hover,
#profileFeedSection .wall-comment-author:hover {
  text-decoration: underline;
}
.feed-page .wall-comment-time,
#profileFeedSection .wall-comment-time {
  color: var(--text-secondary, #888);
  font-size: 0.8rem;
}
.feed-page .wall-comment-edited,
#profileFeedSection .wall-comment-edited {
  color: #666;
  font-size: 11px;
  font-style: italic;
}
.feed-page .wall-comment-menu-wrap,
#profileFeedSection .wall-comment-menu-wrap {
  position: relative;
  flex-shrink: 0;
}
.feed-page .wall-comment-reply-menu-row,
#profileFeedSection .wall-comment-reply-menu-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.feed-page .wall-comment-dots-btn,
#profileFeedSection .wall-comment-dots-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-secondary, #888);
  opacity: 1;
}
.feed-page .wall-comment-dots-btn:hover,
#profileFeedSection .wall-comment-dots-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #e5e5e5);
}
.feed-page .wall-comment-reply-slot,
#profileFeedSection .wall-comment-reply-slot,
.feed-page .wall-reply-composer,
#profileFeedSection .wall-reply-composer {
  margin: 8px 0 10px 0;
  width: 100%;
  box-sizing: border-box;
}
.wall-comment-main > .wall-reply-composer {
  margin: 6px 0 8px 0;
  padding-left: 8px;
  border-left: 2px solid #1db88a;
}
.feed-page .wall-reply-composer-footer,
#profileFeedSection .wall-reply-composer-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}
.feed-page .wall-comment-row + .wall-reply-composer,
#profileFeedSection .wall-comment-row + .wall-reply-composer {
  padding-left: 8px;
  border-left: 2px solid #1db88a;
}
.feed-page .wall-reply-composer-cancel,
#profileFeedSection .wall-reply-composer-cancel {
  border: none;
  background: transparent;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font: inherit;
}
.feed-page .wall-reply-composer-cancel:hover,
#profileFeedSection .wall-reply-composer-cancel:hover {
  color: #ccc;
  background: rgba(255, 255, 255, 0.06);
}
.feed-page .wall-comments-sort-slot,
#profileFeedSection .wall-comments-sort-slot {
  margin-bottom: 10px;
}
.feed-page .wall-comment-text,
#profileFeedSection .wall-comment-text {
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}
.feed-page .wall-comment-actions,
#profileFeedSection .wall-comment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.feed-page .wall-comment-like-btn,
.feed-page .wall-comment-reply-btn,
#profileFeedSection .wall-comment-like-btn,
#profileFeedSection .wall-comment-reply-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #888);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
}
.feed-page .wall-comment-reply-btn:hover,
#profileFeedSection .wall-comment-reply-btn:hover {
  color: #0d9488;
}
.feed-page .wall-comment-replies,
#profileFeedSection .wall-comment-replies {
  margin-top: 8px;
  padding-left: 16px;
  border-left: 2px solid #222;
}
.feed-page .wall-comment-row--reply-hidden,
#profileFeedSection .wall-comment-row--reply-hidden {
  display: none;
}
.feed-page .wall-comment-more-replies,
#profileFeedSection .wall-comment-more-replies {
  display: block;
  margin-top: 8px;
  background: none;
  border: none;
  color: #0d9488;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0;
}
.feed-page .wall-comment-reply-box,
#profileFeedSection .wall-comment-reply-box,
.feed-page .wall-comment-reply-slot .wall-comment-pill-form,
#profileFeedSection .wall-comment-reply-slot .wall-comment-pill-form {
  margin-top: 0;
  margin-left: 0;
}
.feed-page .wall-comment-inline-edit,
#profileFeedSection .wall-comment-inline-edit {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
}
.feed-page .wall-comment-edit-input,
#profileFeedSection .wall-comment-edit-input {
  background: #1a1a1a;
  color: #ddd;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  width: 100%;
  resize: none !important;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}
.feed-page .wall-comment-edit-input:focus,
#profileFeedSection .wall-comment-edit-input:focus {
  border-color: #00b894;
}

.feed-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}
.feed-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.feed-back {
  color: #667eea;
  text-decoration: none;
}
.feed-header h1 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--text-primary);
}
.feed-posts {
  margin-top: 8px;
}
.feed-load-more {
  width: 100%;
  margin-top: 12px;
}

.profile-feed-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px 48px;
  border-top: 1px solid var(--border-subtle, #333);
}
.profile-feed-heading {
  font-size: 1.25rem;
  margin: 20px 0 12px;
  color: var(--text-primary);
}
.profile-feed-section .wall-composer-title {
  font-size: 1rem;
  margin: 0 0 10px;
  color: var(--text-primary);
}

.feed-scroll-sentinel {
  height: 2px;
  width: 100%;
  pointer-events: none;
  flex-shrink: 0;
}
.feed-loading-more {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
}
.feed-loading-more[hidden] {
  display: none !important;
}
.feed-loading-more-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(102, 126, 234, 0.35);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: feed-infinite-spin 0.65s linear infinite;
}
@keyframes feed-infinite-spin {
  to {
    transform: rotate(360deg);
  }
}

/*
  IN-CHAT GAME / QUIZ RESPONSIVE PATTERN
  =======================================
  All in-chat games and quizzes must follow this layout pattern:

  1. Outer overlay: uses .quiz-flow-chat-panel class (already handled
     by the shared @media (max-width: 900px) rule — no per-game fix needed)

  2. Inner panel shell: uses .quiz-panel--wide (already covered by
     the shared rule above)

  3. Panel content container:
     display: flex; flex-direction: column;
     height: 100%; overflow: hidden; box-sizing: border-box;

  4. Fixed elements (header, scoreboard, indicators, buttons):
     flex-shrink: 0;

  5. Main game area (board, choices, questions, answers):
     flex: 1 1 0; min-height: 0;
     display: flex; align-items: center; justify-content: center;

  6. Size game elements with clamp() or aspect-ratio — never fixed px
     that could exceed available flex space.

  7. New games must use .quiz-flow-chat-panel on the outer overlay
     and .quiz-panel--wide on the inner shell to automatically
     inherit the responsive behavior.
*/

/* —— Compatibility quiz + PiP —— */
.chat-toast,
#chatToast.chat-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  max-width: min(90vw, 420px);
  padding: 12px 16px;
  border-radius: var(--radius-input);
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card-hover);
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-hover);
}

.chat-toast.chat-toast--visible,
#chatToast.chat-toast.chat-toast--visible {
  opacity: 1;
}

.quiz-hidden {
  display: none !important;
}

.quiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.quiz-overlay--dim {
  background: rgba(0, 0, 0, 0.75);
}
.quiz-overlay:not(.quiz-hidden) {
  display: flex;
}

.quiz-panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--surface, #1e1e1e);
  border: 1px solid var(--border-color, #444);
  border-radius: 14px;
  padding: 22px 20px 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.quiz-panel--wide {
  max-width: 520px;
  max-height: min(90vh, 640px);
  overflow-y: auto;
}

.quiz-heading {
  margin: 0 0 16px;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.quiz-menu-option {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--background, #2a2a2a);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.35;
  cursor: pointer;
  text-align: center;
}
.quiz-menu-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.quiz-menu-option--primary {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.2);
}

.quiz-panel-close {
  width: 100%;
  margin-top: 8px;
}

.quiz-invite-line {
  margin: 0 0 18px;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--text-primary);
}

/* Game invite accept/decline modals (video chat) — dark theme */
#quizInviteOverlay .quiz-panel,
#triviaInviteOverlay .quiz-panel,
#rpsInviteOverlay .quiz-panel,
#tttInviteOverlay .quiz-panel,
#tttTriviaInviteOverlay .quiz-panel {
  width: 85%;
  max-width: 340px;
  background: #111;
  border: 0.5px solid #222;
  border-radius: 16px;
  padding: 24px;
  color: #ddd;
  box-sizing: border-box;
}
#quizInviteOverlay .quiz-invite-line,
#triviaInviteOverlay .quiz-invite-line,
#rpsInviteOverlay .quiz-invite-line,
#tttInviteOverlay .quiz-invite-line,
#tttTriviaInviteOverlay .quiz-invite-line {
  color: #ddd;
  font-size: 15px;
  text-align: center;
  margin: 0 0 20px;
  line-height: 1.45;
}
#quizInviteOverlay .quiz-btn-row,
#triviaInviteOverlay .quiz-btn-row,
#rpsInviteOverlay .quiz-btn-row,
#tttInviteOverlay .quiz-btn-row,
#tttTriviaInviteOverlay .quiz-btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: nowrap;
}
#quizInviteOverlay .quiz-btn-row .btn.btn-primary,
#triviaInviteOverlay .quiz-btn-row .btn.btn-primary,
#rpsInviteOverlay .quiz-btn-row .btn.btn-primary,
#tttInviteOverlay .quiz-btn-row .btn.btn-primary,
#tttTriviaInviteOverlay .quiz-btn-row .btn.btn-primary {
  background: #1db88a;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}
#quizInviteOverlay .quiz-btn-row .btn.btn-primary:hover,
#triviaInviteOverlay .quiz-btn-row .btn.btn-primary:hover,
#rpsInviteOverlay .quiz-btn-row .btn.btn-primary:hover,
#tttInviteOverlay .quiz-btn-row .btn.btn-primary:hover,
#tttTriviaInviteOverlay .quiz-btn-row .btn.btn-primary:hover {
  background: #17a075;
  transform: none;
  box-shadow: none;
}
#quizInviteOverlay .quiz-btn-row .btn.btn-secondary,
#triviaInviteOverlay .quiz-btn-row .btn.btn-secondary,
#rpsInviteOverlay .quiz-btn-row .btn.btn-secondary,
#tttInviteOverlay .quiz-btn-row .btn.btn-secondary,
#tttTriviaInviteOverlay .quiz-btn-row .btn.btn-secondary {
  background: #1a1a1a;
  color: #ddd;
  border: 0.5px solid #333;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}
#quizInviteOverlay .quiz-btn-row .btn.btn-secondary:hover,
#triviaInviteOverlay .quiz-btn-row .btn.btn-secondary:hover,
#rpsInviteOverlay .quiz-btn-row .btn.btn-secondary:hover,
#tttInviteOverlay .quiz-btn-row .btn.btn-secondary:hover,
#tttTriviaInviteOverlay .quiz-btn-row .btn.btn-secondary:hover {
  background: #252525;
  transform: none;
}
#tttTriviaInviteAccept:disabled {
  background: #0a1f15;
  border: 0.5px solid #0e3d2a;
  opacity: 0.5;
  cursor: not-allowed;
}

.quiz-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.quiz-btn-row .btn {
  flex: 1;
  min-width: 120px;
}

.quiz-btn-row .quiz-level-accept-pulse-wrap {
  flex: 1;
  min-width: 120px;
  display: flex;
}

.quiz-btn-row .quiz-level-accept-pulse-wrap .btn {
  width: 100%;
}

.quiz-floating-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.quiz-floating-close:hover {
  background: rgba(231, 76, 60, 0.45);
}

/* Games menu (teal / dark) */
.games-menu-panel {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 14px;
  max-width: 400px;
  padding: 20px 18px 18px;
}
.games-menu-title {
  margin: 0 0 16px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}
.games-menu-subtitle {
  margin-top: 4px;
}
.games-menu-trivia-hint {
  margin: -8px 0 14px;
  font-size: 0.85rem;
  color: #888;
  line-height: 1.4;
}
.games-menu-back {
  display: block;
  margin: 0 0 12px;
  padding: 0;
  border: none;
  background: none;
  color: #00b894;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}
.games-menu-back:hover {
  text-decoration: underline;
}
.games-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px 16px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  border-left: 3px solid #00b894;
  background: #1a1a1a;
  color: #ddd;
  font-size: 0.98rem;
  text-align: left;
  cursor: pointer;
}
.games-menu-row:hover {
  background: rgba(0, 184, 148, 0.1);
}
.games-menu-row--orange {
  border-left-color: #e67e22;
}
.games-menu-row--orange:hover {
  background: rgba(230, 126, 34, 0.12);
}
.games-menu-row-label {
  flex: 1;
  padding-right: 8px;
}
.games-menu-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  margin-right: 10px;
}
.games-menu-row-chevron {
  color: #666;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.games-menu-close-text {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: none;
  background: none;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
}
.games-menu-close-text:hover {
  color: #888;
}

/* Trivia flow overlay — same panel placement as quiz */
.chat-container #triviaFlowOverlay.quiz-flow-chat-panel {
  position: absolute;
  inset: 0;
  z-index: 31;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
}
.chat-container
  #triviaFlowOverlay.quiz-flow-chat-panel
  .trivia-panel.quiz-panel--wide {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  background: #111;
  border-radius: 14px;
  border: 1px solid #1e1e1e;
}
.chat-container #triviaFlowOverlay.quiz-flow-chat-panel #triviaFlowMount {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-container #triviaFlowOverlay #triviaFlowMount > .trivia-scorebar,
.chat-container #triviaFlowOverlay #triviaFlowMount > .quiz-progress,
.chat-container #triviaFlowOverlay #triviaFlowMount > .trivia-timer-track,
.chat-container #triviaFlowOverlay #triviaFlowMount > .trivia-qtext,
.chat-container #triviaFlowOverlay #triviaFlowMount > .trivia-result-banner {
  flex-shrink: 0;
}

.chat-container #triviaFlowOverlay #triviaFlowMount > .trivia-choices {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  overflow-y: auto;
}

.chat-container
  #triviaFlowOverlay
  #triviaFlowMount
  > .trivia-round-intro-screen {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

.chat-container
  #triviaFlowOverlay
  #triviaFlowMount
  > .trivia-scoreboard-screen {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

.chat-container #triviaFlowOverlay #triviaFlowMount > .trivia-final-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

.chat-container #triviaFlowOverlay .trivia-qtext {
  font-size: clamp(13px, 2vw, 16px);
}

.chat-container #triviaFlowOverlay .trivia-choices .trivia-choice-btn {
  font-size: clamp(12px, 1.8vw, 14px);
  padding: clamp(6px, 1vh, 10px) 12px;
  margin-bottom: 0;
}

.trivia-scorebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #1e1e1e;
  box-sizing: border-box;
  width: 100%;
  flex-shrink: 0;
}
.trivia-scorebar-player {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 16px;
}
.trivia-scorebar-player.trivia-scorebar-player--right {
  text-align: right;
  align-items: flex-end;
  padding-right: 12px;
}
.trivia-scorebar-player--left {
  padding-left: 0;
}
.trivia-scorebar-name {
  font-size: 11px;
  font-weight: 600;
  color: #00b894;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trivia-scorebar-score {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}
.trivia-scorebar-vs {
  color: #444;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 0 8px;
  flex-shrink: 0;
}
.trivia-scorebar-close {
  background: none;
  border: none;
  color: #555;
  font-size: 16px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.trivia-scorebar-close:hover {
  color: #aaa;
  background: rgba(255, 255, 255, 0.06);
}

.pre-game-ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 200px;
  background: #111;
  border-radius: 12px;
  gap: 12px;
}
.pre-game-ad-label {
  color: #555;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pre-game-ad-countdown {
  color: #666;
  font-size: 12px;
}

.trivia-ad-slot {
  min-height: 120px;
  margin: 0 0 12px;
  border-radius: 8px;
  border: 1px dashed #2a2a2a;
  background: #151515;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.trivia-ad-slot .trivia-ad-slot-inner {
  text-align: center;
  padding: 12px;
}
.trivia-ad-slot ins.adsbygoogle {
  display: block;
  min-height: 100px;
}

@keyframes trivia-intro-count-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.trivia-round-intro-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  min-height: 360px;
  text-align: center;
  gap: 24px;
  box-sizing: border-box;
}

.trivia-round-pill {
  color: #00b894;
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid rgba(0, 184, 148, 0.25);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.trivia-round-pill--danger {
  color: #f97316;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.trivia-round-title {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.trivia-rule-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 360px;
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #222;
  border-radius: 10px;
  padding: 12px 16px;
  box-sizing: border-box;
  text-align: left;
}
.trivia-rule-card--danger {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.2);
}
.trivia-rule-card-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}
.trivia-rule-card-text {
  color: #aaa;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}
.trivia-rule-card-text strong {
  color: #fff;
  font-weight: 600;
}

.trivia-starting-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.trivia-starting-in-label {
  color: #888;
  font-size: 14px;
}
.trivia-intro-countdown-num {
  color: #00b894;
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  animation: trivia-intro-count-pulse 1s ease-in-out infinite;
}
.trivia-intro-countdown-num--danger {
  color: #f97316;
}

.trivia-timer-track {
  height: 6px;
  background: #2a2a2a;
  border-radius: 3px;
  overflow: hidden;
  margin: 0 0 14px;
}
.trivia-timer-bar {
  height: 100%;
  width: 100%;
  background: #00b894;
  border-radius: 3px;
  transform-origin: left center;
  transition:
    width 0.1s linear,
    background-color 0.25s ease;
}
.trivia-timer-bar.trivia-timer--warn {
  background: #e67e22;
}
.trivia-timer-bar.trivia-timer--danger {
  background: #e74c3c;
}

.trivia-qtext {
  font-size: 1.05rem;
  color: #eee;
  margin: 0 0 14px;
  line-height: 1.4;
}

.trivia-choice-btn {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 12px 16px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: #ddd;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}
.trivia-choice-btn:hover:not(:disabled) {
  background: rgba(0, 184, 148, 0.1);
  border-color: #00b894;
}
.trivia-choice-btn--correct {
  background: rgba(0, 184, 148, 0.2);
  border: 1px solid #00b894;
  color: #00b894;
}
.trivia-choice-btn--wrong {
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid #e74c3c;
  color: #e74c3c;
}
.trivia-choice-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.trivia-choice-btn--correct:disabled,
.trivia-choice-btn--wrong:disabled {
  opacity: 1;
  cursor: default;
}

.trivia-result-banner {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #ccc;
  font-size: 0.92rem;
}
.trivia-scoreboard-big {
  text-align: center;
  padding: 16px 8px;
}
.trivia-scoreboard-big .trivia-sb-name {
  font-size: 1.1rem;
  color: #fff;
  margin: 8px 0 4px;
}
.trivia-scoreboard-big .trivia-sb-pts {
  font-size: 2rem;
  font-weight: 700;
  color: #00b894;
}

.trivia-scoreboard-screen {
  padding: 8px 8px 24px;
  max-width: 440px;
  margin: 0 auto;
}
.trivia-sb-end-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #666;
  text-align: center;
  margin: 0 0 16px;
}
.trivia-scoreboard-scores-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}
.trivia-player-score-card {
  position: relative;
  background: #1a1a1a;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  box-sizing: border-box;
}
.trivia-player-score-card--winner {
  border-color: rgba(0, 184, 148, 0.4);
  background: rgba(0, 184, 148, 0.06);
}
.trivia-sb-crown {
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 6px;
}
.trivia-sb-card-name {
  color: #ddd;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.trivia-sb-card-score {
  color: #00b894;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}
.trivia-sb-card-pts-label {
  color: #555;
  font-size: 11px;
  margin-top: 6px;
}
.trivia-vs-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 4px;
  min-width: 56px;
}
.trivia-vs-divider-text {
  color: #333;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.trivia-vs-divider-gap {
  color: #666;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.trivia-sb-status {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}
.trivia-sb-status--lead {
  background: rgba(0, 184, 148, 0.08);
  border: 1px solid rgba(0, 184, 148, 0.2);
  color: #00b894;
}
.trivia-sb-status--tie {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.2);
  color: #f97316;
}
.trivia-sb-next-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  margin: 0 0 14px;
}
.trivia-sb-next-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #666;
  margin: 0;
}
.trivia-sb-next-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin: 0;
  line-height: 1.25;
}
.trivia-ready-indicators {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-bottom: 14px;
}
.trivia-ready-indicator {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  box-sizing: border-box;
  background: #1a1a1a;
  border: 1px solid #222;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
}
.trivia-ready-indicator--ready {
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid rgba(0, 184, 148, 0.3);
  color: #00b894;
}
.trivia-ready-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #444;
  flex-shrink: 0;
}
.trivia-ready-dot--on {
  background: #00b894;
  box-shadow: 0 0 0 2px rgba(0, 184, 148, 0.25);
}
.trivia-ready-btn {
  display: block;
  width: 100%;
  background: #00b894;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
}
.trivia-ready-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}
.trivia-ready-btn--waiting {
  background: #1a1a1a;
  border: 2px solid #00b894;
  color: #00b894;
  cursor: default;
  animation: trivia-ready-pulse 1.2s ease-in-out infinite;
}
@keyframes trivia-ready-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(0, 184, 148, 0);
  }
}

.trivia-final-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 28px 24px;
  box-sizing: border-box;
}
.trivia-final-game-over {
  color: #666;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
}
.trivia-final-trophy {
  font-size: 40px;
  line-height: 1;
}
.trivia-final-result-label {
  color: #00b894;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  margin: 0;
  line-height: 1.25;
}
.trivia-final-scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 420px;
}
.trivia-final-vs-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.trivia-final-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  background: #1a1a1a;
  border: 1px solid #222;
  border-radius: 12px;
  box-sizing: border-box;
  min-width: 0;
}
.trivia-final-player--winner {
  border-color: rgba(0, 184, 148, 0.4);
  background: rgba(0, 184, 148, 0.06);
}
.trivia-final-player--loser {
  opacity: 0.7;
}
.trivia-final-pts {
  color: #00b894;
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}
.trivia-final-pts--negative {
  color: #e74c3c;
}
.trivia-final-winner-bar {
  background: rgba(0, 184, 148, 0.08);
  border: 1px solid rgba(0, 184, 148, 0.2);
  border-radius: 8px;
  padding: 10px 20px;
  color: #00b894;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
}
.trivia-final-winner-bar--tied {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.2);
  color: #f97316;
}
.trivia-final-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}
.trivia-final-btn-primary {
  background: #00b894;
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}
.trivia-final-btn-secondary {
  background: transparent;
  color: #888;
  border: 1px solid #333;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}
.trivia-final-btn-secondary:hover {
  color: #ccc;
  border-color: #555;
}

/* RPS flow overlay — same panel placement as trivia */
.chat-container #rpsFlowOverlay.quiz-flow-chat-panel {
  position: absolute;
  inset: 0;
  z-index: 31;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
}
.chat-container
  #rpsFlowOverlay.quiz-flow-chat-panel
  .rps-panel.quiz-panel--wide {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  background: #111;
  border-radius: 14px;
  border: 1px solid #1e1e1e;
}
.chat-container #rpsFlowOverlay.quiz-flow-chat-panel #rpsMount {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.chat-container #rpsFlowOverlay #rpsOverlay.rps-overlay-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.chat-container
  #rpsFlowOverlay
  #rpsOverlay.rps-overlay-inner
  > .trivia-scorebar {
  flex-shrink: 0;
}

.chat-container #rpsFlowOverlay #rpsOverlay .rps-body {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}

.chat-container #rpsFlowOverlay #rpsOverlay .rps-round-label,
.chat-container #rpsFlowOverlay #rpsOverlay .rps-pips-row,
.chat-container #rpsFlowOverlay #rpsOverlay .rps-arena,
.chat-container #rpsFlowOverlay #rpsOverlay .rps-main-status {
  flex-shrink: 0;
}

.chat-container #rpsFlowOverlay #rpsOverlay .rps-choice-row {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 380px;
}

.chat-container #rpsFlowOverlay #rpsOverlay .rps-choice-emoji {
  font-size: clamp(28px, 5vw, 48px);
}

.chat-container #rpsFlowOverlay #rpsOverlay .rps-game-over-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

/* Tic Tac Toe flow — same panel placement as RPS */
.chat-container #tttFlowOverlay.quiz-flow-chat-panel {
  position: absolute;
  inset: 0;
  z-index: 31;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
}
.chat-container
  #tttFlowOverlay.quiz-flow-chat-panel
  .ttt-flow-shell.quiz-panel--wide {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  background: #111;
  border-radius: 14px;
  border: 1px solid #1e1e1e;
}
.chat-container #tttFlowOverlay.quiz-flow-chat-panel #tttMount {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Tic Tac Toe Trivia flow — same panel placement as TTT */
.chat-container #tttTriviaFlowOverlay.quiz-flow-chat-panel {
  position: absolute;
  inset: 0;
  z-index: 31;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
}
.chat-container
  #tttTriviaFlowOverlay.quiz-flow-chat-panel
  .ttt-trivia-flow-shell.quiz-panel--wide {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  background: #111;
  border-radius: 14px;
  border: 1px solid #1e1e1e;
}
.chat-container #tttTriviaFlowOverlay.quiz-flow-chat-panel #tttTriviaMount {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Momo 4 (Connect 4) flow — chat sidebar placement (not full-viewport over video) */
.chat-container #connect4FlowOverlay.quiz-flow-chat-panel {
  position: absolute;
  inset: 0;
  z-index: 31;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}
.chat-container
  #connect4FlowOverlay.quiz-flow-chat-panel
  .connect4-flow-shell.quiz-panel--wide {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  background: #111;
  border-radius: 14px;
  border: 1px solid #1e1e1e;
}
.chat-container #connect4FlowOverlay.quiz-flow-chat-panel #connect4Mount {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Memory Match flow — same panel placement as TTT / Connect 4 */
.chat-container #memoryMatchFlowOverlay.quiz-flow-chat-panel {
  position: absolute;
  inset: 0;
  z-index: 31;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}
.chat-container
  #memoryMatchFlowOverlay.quiz-flow-chat-panel
  .memory-match-flow-shell.quiz-panel--wide {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  background: #111;
  border-radius: 14px;
  border: 1px solid #1e1e1e;
}
.chat-container #memoryMatchFlowOverlay.quiz-flow-chat-panel #memoryMatchMount {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Checkers flow — same panel placement as Connect 4 / Memory Match */
.chat-container #checkersFlowOverlay.quiz-flow-chat-panel {
  position: absolute;
  inset: 0;
  z-index: 31;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}
.chat-container
  #checkersFlowOverlay.quiz-flow-chat-panel
  .checkers-flow-shell.quiz-panel--wide {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  background: #111;
  border-radius: 14px;
  border: 1px solid #1e1e1e;
}
.chat-container #checkersFlowOverlay.quiz-flow-chat-panel #checkersMount {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Panel structure */
.ttt-trivia-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  background: #111;
  border-radius: 12px;
  border: 0.5px solid #222;
}
.ttt-trivia-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 0.5px solid #1e1e1e;
}
.ttt-trivia-title {
  font-size: 15px;
  font-weight: 500;
  color: #eee;
}
.ttt-trivia-header-close {
  background: none;
  border: none;
  color: #666;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.ttt-trivia-header-close:hover {
  color: #fff;
}
.ttt-trivia-scoreboard {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 6px;
  gap: 8px;
}
.ttt-trivia-game-info {
  flex-shrink: 0;
  text-align: center;
  font-size: 11px;
  color: #555;
  padding: 2px 0 8px;
}
.ttt-trivia-game-info span {
  color: #1db88a;
}
.ttt-trivia-play-wrap {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Game area — flex fills remaining space */
.ttt-trivia-game-area {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  gap: 12px;
  padding: 0 14px 12px;
  align-items: flex-start;
  overflow: hidden;
}
.ttt-trivia-question-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.ttt-trivia-board-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Board */
.ttt-trivia-board-wrap {
  position: relative;
  width: 180px;
  height: 180px;
}
.ttt-trivia-grid-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ttt-trivia-cells {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.ttt-trivia-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  border-radius: 4px;
  transition: background 0.1s;
  cursor: default;
  background: transparent;
  border: none;
  padding: 0;
}
.ttt-trivia-cell--clickable {
  cursor: pointer;
  background: rgba(29, 184, 138, 0.06);
}
.ttt-trivia-cell--clickable:hover {
  background: rgba(29, 184, 138, 0.12);
}
.ttt-trivia-cell--x {
  color: #1db88a;
}
.ttt-trivia-cell--o {
  color: #e67e22;
}
.ttt-trivia-cell--steal {
  animation: tttTriviaSteal 0.5s ease;
}
@keyframes tttTriviaSteal {
  0% {
    background: transparent;
  }
  30% {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
  }
  100% {
    background: transparent;
    transform: scale(1);
  }
}
.ttt-trivia-win-line {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}
.ttt-trivia-win-line--animate {
  animation: tttTriviaDrawLine 0.4s ease forwards;
}
@keyframes tttTriviaDrawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* Question and choices */
.ttt-trivia-q-label {
  font-size: 10px;
  color: #555;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.ttt-trivia-q-text {
  font-size: clamp(12px, 1.8vw, 14px);
  color: #ddd;
  line-height: 1.5;
  flex-shrink: 0;
  min-height: 1.5em;
  word-break: break-word;
}
.ttt-trivia-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.ttt-trivia-choice-btn {
  background: #1a1a1a;
  border: 0.5px solid #2a2a2a;
  color: #ccc;
  padding: clamp(6px, 1vh, 9px) 10px;
  border-radius: 7px;
  font-size: clamp(11px, 1.6vw, 13px);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}
.ttt-trivia-choice-btn:hover:not(:disabled):not(
    .ttt-trivia-choice-btn--locked
  ):not(.ttt-trivia-choice-btn--selected) {
  background: #222;
  border-color: #333;
}
.ttt-trivia-choice-btn--selected {
  background: #222;
  border-color: #444;
  color: #666;
  cursor: default;
  pointer-events: none;
}
.ttt-trivia-choice-btn--selected:hover {
  background: #222;
  border-color: #444;
}
.ttt-trivia-choice-btn--selected .ttt-trivia-choice-letter {
  color: #666;
}
.ttt-trivia-choice-btn--locked {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}
.ttt-trivia-choice-btn--correct {
  background: rgba(29, 184, 138, 0.12);
  border-color: #1db88a;
  color: #1db88a;
  cursor: default;
  pointer-events: none;
}
.ttt-trivia-choice-btn--correct .ttt-trivia-choice-letter {
  color: #1db88a;
}
.ttt-trivia-choice-btn--wrong {
  background: rgba(231, 76, 60, 0.08);
  border-color: #333;
  color: #555;
  cursor: default;
  pointer-events: none;
}
.ttt-trivia-choice-btn--wrong .ttt-trivia-choice-letter {
  color: #555;
}
.ttt-trivia-choice-btn--correct:disabled,
.ttt-trivia-choice-btn--wrong:disabled,
.ttt-trivia-choice-btn--locked:disabled {
  opacity: 1;
}
.ttt-trivia-choice-letter {
  font-size: 10px;
  color: #555;
  min-width: 14px;
}
.ttt-trivia-partner-answered-note {
  font-size: 11px;
  color: #888;
  margin: 6px 0 0;
  font-style: italic;
}

/* Scoreboard elements */
.ttt-trivia-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 72px;
  flex: 0 1 auto;
}
.ttt-trivia-player-name {
  font-size: 12px;
  color: #aaa;
}
.ttt-trivia-player-symbol {
  font-size: 16px;
  font-weight: 700;
}
.ttt-trivia-player-symbol--x {
  color: #1db88a;
}
.ttt-trivia-player-symbol--o {
  color: #e67e22;
}
.ttt-trivia-player-score {
  font-size: 12px;
  color: #888;
}
.ttt-trivia-vs-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.ttt-trivia-vs-text {
  font-size: 11px;
  color: #444;
  letter-spacing: 1px;
}
.ttt-trivia-dots {
  display: flex;
  gap: 5px;
}
.ttt-trivia-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #333;
}
.ttt-trivia-dot--win {
  background: #1db88a;
  border-color: #1db88a;
}
.ttt-trivia-dot--loss {
  background: #e74c3c;
  border-color: #e74c3c;
}

/* Status bar */
.ttt-trivia-status {
  flex-shrink: 0;
  margin: 0 14px 8px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12px;
  text-align: center;
}
.ttt-trivia-status--waiting {
  background: #1a1a1a;
  color: #777;
  border: 0.5px solid #222;
}
.ttt-trivia-status--place {
  background: rgba(29, 184, 138, 0.1);
  color: #1db88a;
  border: 0.5px solid rgba(29, 184, 138, 0.25);
}
.ttt-trivia-status--both-wrong {
  background: rgba(231, 76, 60, 0.08);
  color: #e74c3c;
  border: 0.5px solid rgba(231, 76, 60, 0.2);
}

/* Result banner */
.ttt-trivia-result-banner {
  flex-shrink: 0;
  margin: 0 14px 8px;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}
.ttt-trivia-result-banner--win {
  background: rgba(29, 184, 138, 0.12);
  color: #1db88a;
  border: 1px solid rgba(29, 184, 138, 0.25);
}
.ttt-trivia-result-banner--loss {
  background: rgba(231, 76, 60, 0.08);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.2);
}
.ttt-trivia-result-banner--draw {
  background: rgba(255, 255, 255, 0.04);
  color: #777;
  border: 1px solid #222;
}

/* Quit button */
.ttt-trivia-quit-btn {
  flex-shrink: 0;
  display: block;
  width: calc(100% - 28px);
  margin: 0 14px 14px;
  background: none;
  border: 0.5px solid #2a2a2a;
  color: #555;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.ttt-trivia-quit-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* Instructions screen */
.ttt-trivia-instructions {
  padding: 20px;
  overflow-y: auto;
  flex: 1 1 0;
  min-height: 0;
}
.ttt-trivia-inst-title {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 14px;
  text-align: center;
}
.ttt-trivia-inst-rule {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}
.ttt-trivia-inst-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 0.5px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  color: #1db88a;
}
.ttt-trivia-inst-text {
  font-size: 13px;
  color: #aaa;
  line-height: 1.5;
}
.ttt-trivia-inst-text strong {
  color: #fff;
}
.ttt-trivia-ready-btn {
  width: 100%;
  background: #1db88a;
  border: none;
  color: #fff;
  padding: 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 16px;
}
.ttt-trivia-ready-btn--waiting {
  background: #1a1a1a;
  border: 0.5px solid #333;
  color: #555;
  cursor: default;
  font-size: 13px;
}

/* Board turn label */
.ttt-trivia-board-turn {
  font-size: 11px;
  color: #666;
  text-align: center;
  max-width: 180px;
}
.ttt-trivia-board-turn strong {
  color: #1db88a;
}

/* Compact mode for short panels */
.ttt-trivia-panel.ttt-trivia-panel--compact .ttt-trivia-scoreboard {
  padding: 6px 16px 4px;
}
.ttt-trivia-panel.ttt-trivia-panel--compact .ttt-trivia-player-score {
  font-size: 11px;
}
.ttt-trivia-panel.ttt-trivia-panel--compact .ttt-trivia-game-info {
  padding: 2px 0 4px;
}
.ttt-trivia-panel.ttt-trivia-panel--compact .ttt-trivia-board-wrap {
  width: 140px;
  height: 140px;
}
.ttt-trivia-panel.ttt-trivia-panel--compact .ttt-trivia-cell {
  font-size: 20px;
}
.ttt-trivia-panel.ttt-trivia-panel--compact .ttt-trivia-quit-btn {
  padding: 6px;
  margin: 0 14px 10px;
}

.ttt-panel {
  display: flex;
  flex-direction: column;
  background: #111;
  border-radius: 12px;
  border: 0.5px solid #222;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.ttt-panel.ttt-panel--compact .ttt-scoreboard {
  padding: 6px 24px 4px;
}
.ttt-panel.ttt-panel--compact .ttt-player-score {
  font-size: 22px;
}
.ttt-panel.ttt-panel--compact .ttt-player-name {
  font-size: 11px;
}
.ttt-panel.ttt-panel--compact .ttt-player-symbol {
  font-size: 16px;
}
.ttt-panel.ttt-panel--compact .ttt-game-count {
  font-size: 14px;
  padding: 6px 0 2px;
}
.ttt-panel.ttt-panel--compact .ttt-goes-first {
  font-size: 12px;
  padding: 2px 0 8px;
}
.ttt-panel.ttt-panel--compact .ttt-turn-indicator {
  font-size: 11px;
  padding: 0 0 6px;
}
.ttt-panel.ttt-panel--compact .ttt-quit-btn {
  padding: 6px;
  margin: 0 24px 10px;
  font-size: 11px;
}
.ttt-panel.ttt-panel--compact .ttt-header {
  padding: 10px 18px;
}

.chat-container #tttFlowOverlay.quiz-flow-chat-panel #tttPanel {
  flex: 1;
}
.ttt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 0.5px solid #1e1e1e;
  flex-shrink: 0;
}
.ttt-title {
  font-size: 13px;
  color: #666;
}
.ttt-close-btn {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.ttt-close-btn:hover {
  color: #aaa;
  background: #1a1a1a;
}
.ttt-scoreboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px 8px;
  flex-shrink: 0;
}
.ttt-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 100px;
}
.ttt-player-name {
  font-size: 13px;
  color: #aaa;
}
.ttt-player-symbol {
  font-size: 20px;
  font-weight: 700;
}
.ttt-player-symbol--x {
  color: #1db88a;
}
.ttt-player-symbol--o {
  color: #e67e22;
}
.ttt-player-score {
  font-size: 32px;
  font-weight: 500;
  color: #fff;
}
.ttt-vs {
  font-size: 12px;
  color: #444;
  letter-spacing: 1px;
}
.ttt-game-count {
  text-align: center;
  padding: 14px 0 4px;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  flex-shrink: 0;
}
.ttt-goes-first {
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  padding: 6px 0 16px;
  flex-shrink: 0;
}
.ttt-goes-first span {
  color: #1db88a;
}
.ttt-goes-first span.ttt-goes-first--o {
  color: #e67e22;
}
.ttt-board-wrap {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 8px;
  overflow: hidden;
}
.ttt-board-svg-wrap {
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
}
.ttt-grid-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.ttt-cells {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.ttt-cell {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: clamp(20px, 4vh, 36px);
  font-weight: 700;
  border-radius: 4px;
  transition: background 0.1s;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
}
.ttt-cell:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
}
.ttt-cell:disabled {
  cursor: default;
  opacity: 1;
}
.ttt-cell--x {
  color: #1db88a;
  cursor: default;
}
.ttt-cell--o {
  color: #e67e22;
  cursor: default;
}
.ttt-cell--taken {
  cursor: default;
}
.ttt-win-line {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}
.ttt-win-line--animate {
  animation: tttDrawLine 0.4s ease forwards;
}
@keyframes tttDrawLine {
  to {
    stroke-dashoffset: 0;
  }
}
.ttt-turn-indicator {
  text-align: center;
  font-size: 13px;
  color: #777;
  padding: 0 0 12px;
  flex-shrink: 0;
}
.ttt-turn-indicator strong {
  color: #1db88a;
}
.ttt-result-banner {
  margin: 0 24px 12px;
  padding: 11px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}
.ttt-result-banner--win {
  background: rgba(29, 184, 138, 0.12);
  color: #1db88a;
  border: 1px solid rgba(29, 184, 138, 0.25);
}
.ttt-result-banner--tie {
  background: rgba(255, 255, 255, 0.04);
  color: #777;
  border: 1px solid #222;
}
.ttt-quit-btn {
  display: block;
  width: calc(100% - 48px);
  margin: 0 24px 18px;
  background: none;
  border: 0.5px solid #2a2a2a;
  color: #555;
  padding: 9px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.ttt-quit-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.06);
}

.ttt-session-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  padding: 20px;
  box-sizing: border-box;
}
.ttt-session-modal-inner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: none;
  box-sizing: border-box;
}
.ttt-session-modal-body {
  width: 100%;
  font-size: 14px;
  color: #bbb;
  line-height: 1.5;
  text-align: center;
}
.ttt-summary-card {
  background: #161616;
  border-radius: 16px;
  border: 0.5px solid #2a2a2a;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}
.ttt-summary-header {
  background: #1a1a1a;
  border-bottom: 0.5px solid #222;
  padding: 20px 24px;
  text-align: center;
}
.ttt-summary-title {
  font-size: 22px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
}
.ttt-summary-sub {
  font-size: 13px;
  color: #555;
}
.ttt-summary-players {
  display: flex;
  align-items: stretch;
}
.ttt-summary-player {
  flex: 1;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ttt-summary-player--winner {
  background: rgba(29, 184, 138, 0.06);
}
.ttt-summary-divider {
  width: 0.5px;
  background: #222;
  flex-shrink: 0;
}
.ttt-summary-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
}
.ttt-summary-badge--winner {
  background: #1db88a;
  color: #fff;
}
.ttt-summary-badge--loser {
  background: #222;
  color: #666;
}
.ttt-summary-name {
  font-size: 15px;
  color: #ccc;
  font-weight: 500;
  text-align: center;
}
.ttt-summary-symbol {
  font-size: 18px;
  font-weight: 700;
}
.ttt-summary-symbol--x {
  color: #1db88a;
}
.ttt-summary-symbol--o {
  color: #e67e22;
}
.ttt-summary-pts {
  font-size: 42px;
  font-weight: 500;
  color: #fff;
  line-height: 1;
}
.ttt-summary-pts--loser {
  color: #555;
}
.ttt-summary-pts-label {
  font-size: 12px;
  color: #555;
}
.ttt-summary-footer {
  padding: 14px 24px;
  border-top: 0.5px solid #1e1e1e;
  text-align: center;
  font-size: 12px;
  color: #444;
}
.ttt-summary-tie-body {
  padding: 32px 24px;
  text-align: center;
}
.ttt-summary-tie-label {
  font-size: 20px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 6px;
}
.ttt-summary-tie-sub {
  font-size: 13px;
  color: #555;
}
.ttt-summary-tie-scores {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  margin-top: 20px;
}
.ttt-summary-tie-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ttt-summary-tie-dash {
  color: #333;
  font-size: 18px;
}
.ttt-summary-penalty-wrap {
  padding: 0 16px 12px;
  border-top: 0.5px solid #1e1e1e;
}
.ttt-session-penalty {
  margin: 12px 0 0;
  font-size: 13px;
  color: #e67e22;
}

#rpsOverlay.rps-overlay-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #111;
}
#rpsOverlay .rps-body {
  flex: 1 1 auto;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}
#rpsOverlay .rps-round-label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #666;
  text-align: center;
}
#rpsOverlay .rps-pips-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}
#rpsOverlay .rps-pips-side {
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
#rpsOverlay .rps-pips-dot {
  color: #444;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
#rpsOverlay .rps-pip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-sizing: border-box;
}
#rpsOverlay .rps-pip--empty {
  background: transparent;
  border: 2px solid #444;
}
#rpsOverlay .rps-pip--win {
  background: #00b894;
  border: none;
}
#rpsOverlay .rps-pip--lose {
  background: #e74c3c;
  border: none;
}
#rpsOverlay .rps-pip--tie {
  background: #555;
  border: none;
}
#rpsOverlay .rps-arena {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
  width: 100%;
  max-width: 420px;
}
#rpsOverlay .rps-arena-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
#rpsOverlay .rps-arena-vs {
  color: #444;
  font-size: 11px;
  font-weight: 600;
  padding-top: 28px;
  flex-shrink: 0;
}
#rpsOverlay .rps-arena-name {
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#rpsOverlay .rps-hand {
  font-size: 64px;
  line-height: 1;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#rpsOverlay .rps-arena-col:first-child .rps-hand.rps-hand--revealed {
  transform: scaleX(-1) rotate(-90deg);
}
#rpsOverlay .rps-arena-col:last-child .rps-hand.rps-hand--revealed {
  transform: rotate(-90deg);
}
#rpsOverlay .rps-hand--shake-left {
  animation: rps-shake-left 0.9s ease-in-out;
}
#rpsOverlay .rps-hand--shake-right {
  animation: rps-shake-right 0.9s ease-in-out;
}
@keyframes rps-shake-left {
  0%,
  100% {
    transform: translateY(0);
  }
  16.66% {
    transform: translateY(-12px);
  }
  33.33% {
    transform: translateY(8px);
  }
  50% {
    transform: translateY(-12px);
  }
  66.66% {
    transform: translateY(8px);
  }
  83.33% {
    transform: translateY(-12px);
  }
}
@keyframes rps-shake-right {
  0%,
  100% {
    transform: translateY(0);
  }
  16.66% {
    transform: translateY(-12px);
  }
  33.33% {
    transform: translateY(8px);
  }
  50% {
    transform: translateY(-12px);
  }
  66.66% {
    transform: translateY(8px);
  }
  83.33% {
    transform: translateY(-12px);
  }
}
#rpsOverlay .rps-hand-sub {
  font-size: 11px;
  color: #666;
  text-align: center;
}
#rpsOverlay .rps-hand-sub--locked {
  color: #00b894;
  font-weight: 600;
}
#rpsOverlay .rps-choice-label--win {
  color: #00b894;
  font-weight: 700;
}
#rpsOverlay .rps-choice-label--lose {
  color: #e74c3c;
  font-weight: 700;
}
#rpsOverlay .rps-choice-label--muted {
  color: #888;
}
#rpsOverlay .rps-main-status {
  width: 100%;
  max-width: 400px;
  text-align: center;
  min-height: 2.5em;
}
#rpsOverlay .rps-status {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}
#rpsOverlay .rps-status--pick {
  color: #ccc;
}
#rpsOverlay .rps-status--wait {
  color: #f97316;
  font-weight: 600;
}
#rpsOverlay .rps-status--shake {
  color: #f97316;
  font-size: 18px;
  font-weight: 700;
}
#rpsOverlay .rps-status--win {
  color: #00b894;
  font-weight: 600;
}
#rpsOverlay .rps-status--lose {
  color: #e74c3c;
  font-weight: 600;
}
#rpsOverlay .rps-status--muted {
  color: #888;
}
#rpsOverlay .rps-choice-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 380px;
}
#rpsOverlay .rps-choice-btn {
  flex: 1 1 90px;
  min-width: 88px;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #ccc;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
#rpsOverlay .rps-choice-btn:hover:not(:disabled) {
  border-color: #00b894;
  background: rgba(0, 184, 148, 0.1);
}
#rpsOverlay .rps-choice-btn--selected {
  border-color: #00b894;
  background: rgba(0, 184, 148, 0.14);
}
#rpsOverlay .rps-choice-btn--disabled,
#rpsOverlay .rps-choice-btn:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}
#rpsOverlay .rps-choice-emoji {
  font-size: 32px;
  line-height: 1;
}
#rpsOverlay .rps-choice-text {
  font-size: 12px;
  font-weight: 600;
}

.rps-game-over-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 28px 24px;
  box-sizing: border-box;
  background: #111;
}
#rpsOverlay .rps-final-go-kicker {
  margin: 0;
  color: #666;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
#rpsOverlay .rps-final-emoji {
  font-size: 48px;
  line-height: 1;
}
#rpsOverlay .rps-final-result {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  line-height: 1.25;
}
#rpsOverlay .rps-final-result--win {
  color: #00b894;
}
#rpsOverlay .rps-final-result--lose {
  color: #e74c3c;
}
#rpsOverlay .rps-final-result--tie {
  color: #f97316;
}
#rpsOverlay .rps-final-score-cards {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  max-width: 420px;
}
#rpsOverlay .rps-final-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  background: #1a1a1a;
  border: 1px solid #222;
  border-radius: 12px;
  box-sizing: border-box;
  min-width: 0;
}
#rpsOverlay .rps-final-card--winner {
  border-color: rgba(0, 184, 148, 0.4);
  background: rgba(0, 184, 148, 0.06);
}
#rpsOverlay .rps-final-card--loser {
  opacity: 0.7;
}
#rpsOverlay .rps-final-crown {
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 2px;
}
#rpsOverlay .rps-final-card-name {
  color: #ddd;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
#rpsOverlay .rps-final-card-score {
  color: #00b894;
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}
#rpsOverlay .rps-final-card-score--loser {
  color: #888;
}
#rpsOverlay .rps-final-card-label {
  color: #555;
  font-size: 11px;
}
#rpsOverlay .rps-final-cards-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
#rpsOverlay .rps-final-recap {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}
#rpsOverlay .rps-final-recap-side {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  flex: 1;
  justify-content: center;
}
#rpsOverlay .rps-final-recap-sep {
  color: #444;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
#rpsOverlay .rps-final-recap-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-sizing: border-box;
}
#rpsOverlay .rps-final-recap-pip--win {
  background: #00b894;
}
#rpsOverlay .rps-final-recap-pip--lose {
  background: #e74c3c;
}
#rpsOverlay .rps-final-recap-pip--empty {
  background: #222;
  border: 1px solid #333;
}
#rpsOverlay .rps-final-winner-bar {
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  border-radius: 8px;
  padding: 10px 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  background: rgba(0, 184, 148, 0.08);
  border: 1px solid rgba(0, 184, 148, 0.2);
  color: #00b894;
}
#rpsOverlay .rps-final-winner-bar--lose {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.2);
  color: #f97316;
}
#rpsOverlay .rps-final-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}
#rpsOverlay .rps-final-btn-primary {
  width: 100%;
  background: #00b894;
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
}
#rpsOverlay .rps-final-btn-secondary {
  width: 100%;
  background: transparent;
  color: #888;
  border: 1px solid #333;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  box-sizing: border-box;
}
#rpsOverlay .rps-final-btn-secondary:hover {
  color: #ccc;
  border-color: #555;
}

.quiz-progress {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.quiz-qtext {
  font-size: 1.1rem;
  margin: 0 0 16px;
  color: var(--text-primary);
  line-height: 1.4;
}

.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.quiz-choice-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--background, #2a2a2a);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.quiz-choice-btn:hover:not(:disabled) {
  border-color: #667eea;
}
.quiz-choice-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.quiz-wait-partner {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.quiz-reveal-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 12px 0 16px;
}

.quiz-reveal-answer-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.quiz-reveal-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quiz-ans-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  margin-left: 6px;
}

.quiz-ans-pill--full {
  display: block;
  margin-left: 0;
  margin-top: 0;
  max-width: 100%;
  white-space: normal;
  line-height: 1.4;
  font-weight: 500;
  text-align: left;
}
.quiz-ans-pill--yours {
  background: rgba(52, 152, 219, 0.35);
  border: 1px solid #3498db;
}
.quiz-ans-pill--theirs {
  background: rgba(155, 89, 182, 0.35);
  border: 1px solid #9b59b6;
}

/* Answer reveal: same choice → green both; different → red both */
.quiz-ans-pill--reveal-same {
  background: rgba(39, 174, 96, 0.42);
  border: 1px solid #27ae60;
  color: #ecfdf3;
}
.quiz-ans-pill--reveal-diff {
  background: rgba(231, 76, 60, 0.42);
  border: 1px solid #e74c3c;
  color: #fff5f5;
}

.quiz-next-wrap {
  margin-top: 8px;
}

/* Final results: Done at half width, centered */
.quiz-next-wrap--done {
  display: flex;
  justify-content: center;
  align-items: center;
}

button.quiz-done-btn {
  width: 50%;
  max-width: 240px;
  box-sizing: border-box;
}

/* Reveal step: compact Next (40% width = 60% smaller than full-width), left-aligned */
.quiz-next-wrap--reveal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

button.quiz-next-question-btn {
  width: 40%;
  min-width: 72px;
  max-width: 200px;
  box-sizing: border-box;
}

.quiz-next-wait-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary, #888);
  line-height: 1.35;
}

.chat-container button.quiz-next-question-btn:disabled {
  background-color: #3d3d3d;
  border-color: #4f4f4f;
  color: #a3a3a3;
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
}

.quiz-results-pct {
  font-size: 2.75rem;
  font-weight: 800;
  margin: 8px 0 4px;
  color: #667eea;
  font-variant-numeric: tabular-nums;
}

.quiz-results-label {
  font-size: 1.15rem;
  margin: 0 0 20px;
  color: var(--text-primary);
}

.quiz-level-prompt {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}
.quiz-level-prompt p {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--text-primary);
}

.quiz-level-accept-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Pulse the wrapper so .btn transition/transform does not fight keyframe animation */
.quiz-level-accept-pulse-wrap--active {
  animation: quiz-level-accept-wrap-pulse 1.1s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes quiz-level-accept-wrap-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px rgba(102, 126, 234, 0.4));
  }
  50% {
    transform: scale(1.07);
    filter: drop-shadow(0 0 14px rgba(102, 126, 234, 0.75));
  }
}

#chatScreen .video-container.quiz-video-pip {
  position: fixed;
  bottom: 14px;
  left: 14px;
  width: min(200px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  z-index: 1400;
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-template-columns: unset;
  min-height: 0;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
  transform-origin: bottom left;
}
#chatScreen .video-container.quiz-video-pip .video-wrapper {
  min-height: 0;
  aspect-ratio: 4 / 3;
  max-height: 120px;
}
#chatScreen .video-container.quiz-video-pip video {
  max-height: 120px;
  object-fit: cover;
}
#chatScreen .video-container.quiz-video-pip .video-menu-wrap {
  transform: scale(0.75);
  transform-origin: top right;
  top: 4px;
  right: 4px;
}
#chatScreen
  .video-container.quiz-video-pip
  .vc-handshake-top-center
  .video-handshake-btn {
  width: auto;
  height: auto;
  padding: 4px 10px;
  font-size: 11px;
  gap: 4px;
}
#chatScreen
  .video-container.quiz-video-pip
  .vc-handshake-top-center
  .video-handshake-btn.handshake-state-play
  .handshake-connect-text {
  font-size: 11px;
}

.video-report-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(241, 196, 15, 0.9);
  background-color: rgba(0, 0, 0, 0.55);
  color: #f1c40f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.2s;
}

.video-report-btn:hover {
  background-color: rgba(241, 196, 15, 0.2);
  border-color: #f39c12;
  color: #f39c12;
}

.video-report-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.public-profile-report-btn {
  font-size: 1.1rem;
  line-height: 1;
}

/* Report user modal (Chat-C — aligned with Settings report modal) */
.report-user-modal,
#reportUserModal.report-user-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1300;
  padding: 16px;
  box-sizing: border-box;
}

.report-user-modal--visible,
#reportUserModal.report-user-modal--visible {
  display: flex;
}

.report-user-modal-inner {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-hover);
  padding: 22px 22px 20px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.report-user-modal-title {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.report-user-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.report-user-close-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color var(--motion-hover),
    background-color var(--motion-hover),
    border-color var(--motion-hover);
}

.report-user-close-btn:hover {
  color: var(--text-primary);
  background: var(--surface-3);
  border-color: var(--border-soft);
}

.report-user-close-btn svg {
  stroke: currentColor;
}

.report-user-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  margin-top: 14px;
}

.report-user-label:first-of-type {
  margin-top: 0;
}

.report-user-label-hint {
  text-transform: none;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.6875rem;
  letter-spacing: 0;
}

.report-user-file-label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-input);
  padding: 10px 14px;
  cursor: pointer;
  transition:
    border-color var(--motion-hover),
    background-color var(--motion-hover);
}

.report-user-file-label:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 35%, var(--border-soft));
  background: var(--surface-3);
}

.report-user-file-label svg {
  stroke: var(--accent-primary);
  flex-shrink: 0;
}

.report-user-file-label svg path:last-of-type {
  stroke: var(--text-muted);
}

.report-user-file-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.report-user-file {
  display: none;
}

.report-user-btn-cancel,
#reportUserCancel,
#reportUserBlockNo {
  flex: 1;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition:
    color var(--motion-hover),
    border-color var(--motion-hover),
    background-color var(--motion-hover);
}

.report-user-btn-cancel:hover,
#reportUserCancel:hover,
#reportUserBlockNo:hover {
  color: var(--text-primary);
  background: var(--surface-3);
  border-color: color-mix(in srgb, var(--text-muted) 35%, var(--border-soft));
}

.report-user-btn-submit,
#reportUserSubmit,
#reportUserBlockYes {
  flex: 1;
  padding: 11px 14px;
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  border: 1px solid color-mix(in srgb, var(--accent-primary) 32%, transparent);
  border-radius: var(--radius-input);
  color: #08120f;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-primary) 20%, transparent);
  transition:
    background var(--motion-hover),
    box-shadow var(--motion-hover);
}

.report-user-btn-submit:hover,
#reportUserSubmit:hover,
#reportUserBlockYes:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent-primary) 26%, transparent);
}

.report-user-select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 0.925rem;
  box-sizing: border-box;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  transition:
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.report-user-select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 48%, var(--border-soft));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

.report-user-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 0.925rem;
  min-height: 100px;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.45;
  transition:
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.report-user-textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 48%, var(--border-soft));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

.report-user-textarea::placeholder {
  color: var(--text-muted);
}

.report-user-error,
#reportUserError.report-user-error {
  display: none;
  color: color-mix(in srgb, var(--error) 90%, var(--text-primary));
  font-size: 0.8125rem;
  margin-top: 10px;
  min-height: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--error) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 20%, transparent);
  line-height: 1.4;
}

.report-user-error.report-user-error--visible,
#reportUserError.report-user-error.report-user-error--visible {
  display: block;
}

.report-user-step-hidden {
  display: none !important;
}

.report-user-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.report-user-thanks {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.55;
  margin: 0 0 4px;
}

.report-user-thanks h3 {
  color: var(--text-primary);
  margin: 0 0 10px;
}

.messages-detail-header-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.messages-detail-header-main h2 {
  flex: 1;
  min-width: 0;
}

.messages-detail-menu-wrap {
  position: relative;
}

.messages-detail-menu-btn {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--text-muted, #666);
}

.messages-detail-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  min-width: 140px;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.messages-detail-dropdown.open {
  display: block;
}

.messages-detail-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}

.messages-detail-dropdown button:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ----- Profile v2 (SpeedDate layout) — scoped to .profile-page-v2 only ----- */
.profile-page.profile-page-v2 {
  --profile-v2-teal: #00b894;
  --profile-v2-teal-dim: rgba(0, 184, 148, 0.35);
  --profile-v2-bg: var(--bg-main);
  --profile-v2-card: var(--surface-1);
  --profile-v2-card-soft: var(--surface-2);
  --profile-v2-card-hover: var(--surface-3);
  --profile-v2-card-alt: var(--profile-v2-card-soft);
  --profile-v2-border: var(--border-subtle);
  --profile-v2-border-strong: var(--border-soft);
  --profile-v2-text: var(--text-primary);
  --profile-v2-muted: var(--text-secondary);
  --profile-v2-muted-soft: var(--text-muted);
  --profile-v2-accent: var(--accent-primary);
  --profile-v2-accent-hover: var(--accent-primary-hover);
  min-height: 100vh;
  padding: 0;
  background:
    radial-gradient(circle at top left, rgba(39, 224, 179, 0.08), transparent 32rem),
    radial-gradient(circle at top right, rgba(123, 156, 255, 0.06), transparent 28rem),
    var(--profile-v2-bg);
  color: #e8eaed;
  font-family:
    system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.profile-page-v2 .profile-v2-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--profile-v2-border);
  background: rgba(17, 20, 26, 0.86);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  pointer-events: none;
}

.profile-page-v2 .profile-v2-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: auto;
}

.profile-page-v2 .profile-v2-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--profile-v2-border);
  border-radius: 10px;
  background: var(--profile-v2-card);
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.profile-page-v2 .profile-v2-menu-toggle:hover {
  background: #1a1a1a;
  border-color: var(--profile-v2-teal-dim);
}

.profile-page-v2 .profile-v2-menu-toggle-bar {
  display: block;
  height: 2px;
  width: 18px;
  margin: 0 auto;
  background: #e8eaed;
  border-radius: 1px;
}

.profile-page-v2 .profile-v2-brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.brand-wordmark {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-wordmark--auth {
  height: auto;
  width: min(280px, 80vw);
  margin: 0 auto;
  display: block;
}


.profile-page-v2 .profile-v2-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-page-v2 .profile-v2-icon-link {
  color: var(--profile-v2-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s;
}

.profile-page-v2 .profile-v2-icon-link:hover {
  color: var(--profile-v2-teal);
}

.profile-page-v2 .profile-v2-logout-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s,
    background 0.2s;
}

.profile-page-v2 .profile-v2-logout-btn:hover {
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
  background: transparent;
}

.profile-page-v2 .profile-v2-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(0, 0, 0, 0.55);
}

.profile-page-v2 .profile-v2-shell {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 16px 48px;
  align-items: start;
}

.profile-page-v2 .profile-v2-content-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 24px;
  align-items: start;
  min-width: 0;
}

.profile-page-v2.games-page-v2-layout .profile-v2-content-columns--games {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 24px;
  align-items: start;
  min-width: 0;
}

.profile-page-v2 div.profile-v2-sidebar-divider {
  border: none;
  border-top: 1px solid #1e1e1e;
  margin: 8px 0;
  height: 0;
}

.profile-v2-match-horiz {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 24px;
  border: 0.5px solid #2a2a2a;
  margin-bottom: 0;
}

/* Phase 1C — profile v2: MDS shell for Match Preferences (inherits padding from above) */
.profile-page-v2 .profile-v2-match-horiz {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.025),
      rgba(255, 255, 255, 0.01)
    ),
    var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-card);
}

.profile-v2-match-horiz-title {
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 20px;
}
.profile-v2-match-horiz-field {
  margin-bottom: 18px;
}
.profile-v2-match-horiz-label {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 8px;
  display: block;
}
.profile-v2-match-age-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-v2-match-age-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.profile-v2-match-age-box-label {
  font-size: 11px;
  color: #777;
}
.profile-v2-match-horiz .profile-age-field-input {
  width: 80px;
  background: #252525;
  border: 0.5px solid #3a3a3a;
  color: #fff;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 500;
  text-align: center;
}
.profile-v2-match-age-sep {
  font-size: 15px;
  color: #666;
  padding-top: 16px;
}
.profile-v2-match-horiz-field--range {
  margin-bottom: 18px;
  padding: 0 4px;
}
.profile-v2-match-horiz-field--check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 15px;
  color: #ccc;
}
.profile-v2-match-horiz-field--check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1db88a;
  cursor: pointer;
}
.profile-v2-match-start-btn {
  width: 100%;
  background: #1db88a;
  border: none;
  color: #fff;
  padding: 13px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.profile-v2-match-start-btn:hover {
  background: #17a67a;
}
.profile-v2-match-start-btn .profile-v2-video-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.profile-page-v2 .profile-v2-match-horiz select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #252525;
  border: 0.5px solid #3a3a3a;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
}
.profile-page-v2 .profile-v2-match-horiz .profile-actions {
  margin: 0;
}
.profile-page-v2 .profile-v2-match-horiz .profile-dual-range {
  width: 100%;
}

.profile-page-v2 .profile-v2-match-horiz + .profile-feed-section {
  margin-top: 20px;
}

.profile-activity-dom-bridge {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Below sticky .profile-v2-topbar (.profile-v2-topbar-inner padding 10+10 + content row ≈ 52px incl. border) */
.profile-page-v2 .profile-v2-sidebar {
  position: sticky;
  top: 52px;
  height: auto;
  max-height: calc(100vh - 52px);
  overflow-y: auto;
  overflow-x: hidden;
  align-self: start;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--profile-v2-border);
  border-radius: 12px;
  background: rgba(17, 20, 26, 0.86);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  transition:
    transform 0.25s ease,
    box-shadow 0.2s;
  min-width: 0;
}

.profile-page-v2 .profile-v2-sidebar-inner {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-page-v2 .profile-v2-friends-wrap {
  margin-top: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.profile-page-v2 .profile-v2-friends-main-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  max-width: none;
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: var(--radius-input);
  box-shadow: none;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--motion-hover),
    color var(--motion-hover),
    border-color var(--motion-hover);
}

/* Suppress transition flash on page load */
.preload .profile-v2-friends-main-toggle,
.preload .profile-v2-nav-cta {
  transition: none !important;
}

.profile-page-v2 .profile-v2-friends-main-toggle:hover {
  background: rgba(39, 224, 179, 0.1);
  color: var(--accent-primary-hover);
  border-color: rgba(39, 224, 179, 0.22);
  box-shadow: 0 8px 20px rgba(39, 224, 179, 0.08);
}

.profile-page-v2
  .profile-v2-friends-main-toggle:not(
    .profile-v2-friends-main-toggle--open
  ):hover {
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--surface-2));
  color: var(--accent-primary-hover);
  border-color: color-mix(in srgb, var(--accent-primary) 24%, var(--border-subtle));
}

.profile-page-v2
  .profile-v2-friends-main-toggle:not(
    .profile-v2-friends-main-toggle--open
  ):hover
  .profile-friends-toggle-label {
  color: inherit;
}

.profile-page-v2
  .profile-v2-friends-main-toggle:not(
    .profile-v2-friends-main-toggle--open
  ):hover
  .profile-v2-friends-main-icon {
  color: inherit;
}

.profile-page-v2 .profile-v2-friends-main-toggle--open {
  background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-2));
  color: var(--accent-primary);
  border-color: color-mix(in srgb, var(--accent-primary) 32%, var(--border-subtle));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.profile-page-v2 .profile-v2-friends-main-toggle--open:hover {
  background: color-mix(in srgb, var(--accent-primary) 18%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-primary) 38%, var(--border-subtle));
}

.profile-page-v2
  .profile-v2-friends-main-toggle--open
  .profile-friends-toggle-label {
  color: inherit;
}

.profile-page-v2
  .profile-v2-friends-main-toggle--open
  .profile-v2-friends-main-icon {
  color: inherit;
}

.profile-page-v2 .profile-v2-friends-main-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  line-height: 0;
  color: inherit;
}

.profile-page-v2 .profile-v2-friends-main-icon-svg {
  display: block;
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.profile-page-v2 .profile-friends-toggle-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  color: inherit;
  font-weight: 500;
  font-size: 18px;
}

.profile-page-v2 .profile-v2-drag-hint {
  margin: 0 0 14px;
  padding: 8px 10px;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-3) 50%, transparent);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
}

.profile-page-v2 .profile-v2-friends-panel {
  margin-top: 8px;
  padding: 14px 12px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 3%, transparent);
}

.profile-page-v2 .profile-v2-friends-panel:not([hidden]) {
  margin-top: 8px;
}

.profile-page-v2 .profile-social-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-page-v2 .profile-social-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-page-v2 .profile-social-section-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover);
}

.profile-page-v2 .profile-social-section-toggle:hover {
  background: color-mix(in srgb, var(--surface-3) 55%, transparent);
  border-color: var(--border-subtle);
  opacity: 1;
}

.profile-page-v2 .profile-v2-social-section-icon {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--text-muted);
}

.profile-page-v2 .profile-social-section-toggle-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.profile-page-v2 .profile-v2-count-badge {
  flex-shrink: 0;
  min-width: 1.5rem;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: #0b0d11;
  background: var(--accent-primary);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
}

.profile-page-v2 .profile-v2-count-badge--zero {
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface-3);
  border: 1px solid var(--border-subtle);
}

.profile-page-v2 .profile-social-section-chevron {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 0.625rem;
  color: var(--text-muted);
  transition: color var(--motion-hover);
}

.profile-page-v2
  .profile-social-section-toggle[aria-expanded="true"]
  .profile-social-section-chevron {
  transform: none;
  color: var(--accent-primary);
}

.profile-page-v2 .profile-v2-sidebar-divider {
  border: none;
  border-top: 1px solid #1e1e1e;
  margin: 8px 0;
}

.profile-page-v2 .profile-v2-sidebar-divider--footer {
  margin: 10px 0;
}

.profile-page-v2 .profile-v2-nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--profile-v2-text);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: var(--radius-input);
  font-weight: 500;
  font-size: 18px;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
  box-sizing: border-box;
  box-shadow: none;
}

.profile-page-v2 .profile-v2-nav-cta-icon {
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1;
  color: #888;
}

/* Side panel nav icons: fixed size + monochrome (scoped — do not affect rail/header icons) */
.profile-page-v2 .profile-v2-sidebar .profile-v2-nav-cta-icon,
.profile-page-v2 .profile-v2-sidebar .profile-v2-friends-main-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  filter: grayscale(100%) brightness(1.8);
}

.profile-page-v2 .profile-v2-sidebar .profile-v2-nav-cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

.profile-page-v2 .profile-v2-sidebar .profile-v2-friends-main-icon-svg {
  width: 24px;
  height: 24px;
}

.profile-page-v2 .profile-v2-nav-cta-label {
  color: inherit;
  font-size: 18px;
  font-weight: 500;
}

.profile-page-v2 .profile-v2-nav-cta--home .profile-v2-nav-cta-label {
  font-weight: 700;
}

.profile-page-v2 .profile-v2-nav-cta:hover {
  background: rgba(39, 224, 179, 0.1);
  color: var(--accent-primary-hover);
  border-color: rgba(39, 224, 179, 0.22);
  box-shadow: 0 8px 20px rgba(39, 224, 179, 0.08);
}

.profile-page-v2 .profile-v2-nav-cta:hover .profile-v2-nav-cta-icon {
  color: inherit;
}

.profile-page-v2 .profile-v2-nav-cta:hover .profile-v2-nav-cta-label {
  color: inherit;
}

/* More button wrapper */
.profile-page-v2 .profile-v2-more-wrap {
  position: relative;
}

.profile-page-v2 .profile-v2-more-toggle .profile-v2-nav-cta-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

/* More floating panel — appears above the button */
.profile-page-v2 .profile-v2-more-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  z-index: 200;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-page-v2 .profile-v2-more-panel[hidden] {
  display: none;
}

/* More panel items */
.profile-page-v2 .profile-v2-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  color: var(--profile-v2-text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.profile-page-v2 .profile-v2-more-item:hover {
  background: rgba(39, 224, 179, 0.1);
  color: var(--accent-primary-hover);
}

.profile-page-v2 .profile-v2-more-item-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  filter: grayscale(100%) brightness(1.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* More button open state */
.profile-page-v2 .profile-v2-more-toggle--open {
  background: rgba(39, 224, 179, 0.1);
  color: var(--accent-primary-hover);
  border-color: rgba(39, 224, 179, 0.22);
}

/* Hide sidebar scrollbar but keep scroll functionality */
.profile-page-v2 .profile-v2-sidebar {
  scrollbar-width: none;
}
.profile-page-v2 .profile-v2-sidebar::-webkit-scrollbar {
  display: none;
}
.profile-page-v2 .profile-v2-sidebar-inner {
  scrollbar-width: none;
}
.profile-page-v2 .profile-v2-sidebar-inner::-webkit-scrollbar {
  display: none;
}

.profile-v2-ad-rail {
  width: 200px;
  min-width: 200px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 2px;
}

.profile-v2-ad-label {
  font-size: 11px;
  color: #555;
  letter-spacing: 0.3px;
}

.profile-v2-ad-slot {
  background: #161616;
  border-radius: 10px;
  border: 0.5px solid #252525;
  overflow: hidden;
  min-height: 180px;
}

.profile-page.profile-page-v2 .profile-v2-ad-slot {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.018),
      rgba(255, 255, 255, 0.008)
    ),
    var(--surface-1);
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.profile-v2-ad-why {
  font-size: 10px;
  color: #444;
  text-align: center;
  cursor: pointer;
}

.profile-v2-ad-why:hover {
  color: #666;
}

.profile-page-v2 .profile-v2-nav-messages {
  position: relative;
}

.profile-page-v2 .profile-v2-nav-messages.unread .profile-v2-nav-cta-label {
  font-weight: 500;
}

.profile-page-v2 .profile-v2-nav-messages .unread-badge {
  margin-left: auto;
  flex-shrink: 0;
  min-width: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #00b894;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-page-v2 .profile-v2-nav-cta--notifications {
  position: relative;
}

.profile-page-v2
  .profile-v2-nav-cta--notifications.notif-unread
  .profile-v2-nav-cta-label {
  font-weight: 500;
}

.profile-page-v2 .profile-v2-nav-cta--notifications .notif-badge {
  margin-left: auto;
  flex-shrink: 0;
  min-width: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #00b894;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-page-v2 .profile-v2-main {
  min-width: 0;
  max-width: 740px;
  width: 100%;
  padding: 20px 24px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.profile-page-v2 .profile-v2-center {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-page-v2 .profile-v2-card {
  border: 1px solid var(--profile-v2-border);
  border-radius: var(--radius-panel);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.025),
    rgba(255, 255, 255, 0.01)
  ), var(--profile-v2-card);
  box-shadow: var(--shadow-card);
}

/* Profile edit page — header skeleton (see profile.js fetchProfile) */
.profile-header-skeleton {
  animation: profileSkeletonPulse 1.4s ease-in-out infinite;
}
@keyframes profileSkeletonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.profile-v2-cover--skeleton {
  background: #1a1a1a !important;
  background-image: none !important;
}
.profile-v2-avatar--skeleton {
  background: #1a1a1a !important;
}
.profile-v2-header-body--skeleton .profile-name-link,
.profile-v2-header-body--skeleton .profile-age,
.profile-v2-header-body--skeleton #displayLocation,
.profile-v2-header-body--skeleton #displayGender,
.profile-v2-header-body--skeleton #displayMetaSep,
.profile-v2-header-body--skeleton #profileSelfOnlineBadge {
  visibility: hidden;
}
.profile-v2-header-body--skeleton::before {
  content: '';
  position: absolute;
  left: 128px;
  top: 20px;
  width: 120px;
  height: 18px;
  background: #1a1a1a;
  border-radius: 4px;
}
.profile-v2-header-body--skeleton::after {
  content: '';
  position: absolute;
  left: 128px;
  top: 46px;
  width: 80px;
  height: 13px;
  background: #1a1a1a;
  border-radius: 4px;
}

.profile-page-v2 .profile-v2-header-card {
  overflow: hidden;
}

.profile-page-v2 .profile-v2-cover {
  height: 160px;
  background: linear-gradient(115deg, #063d35 0%, #0a0a0a 45%, #0d3d4a 100%);
  position: relative;
}

.profile-page-v2 .profile-v2-header-body {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px 20px;
  margin-top: -30px;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}

.profile-page-v2 .profile-v2-avatar-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.profile-page-v2 .profile-v2-avatar-wrap .profile-avatar {
  border: 4px solid var(--profile-v2-card);
  box-shadow: 0 0 0 2px rgba(0, 184, 148, 0.25);
}

.profile-page-v2 .profile-v2-avatar-camera {
  right: 2px;
  bottom: 2px;
  background: #1a1a1a;
  border: 2px solid var(--profile-v2-border);
}

.profile-page-v2 .profile-v2-header-text {
  flex: 1;
  min-width: 200px;
  padding-bottom: 4px;
}

.profile-page-v2 .profile-v2-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 0px;
}

.profile-page-v2 .profile-v2-name-line {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
}

.profile-page-v2 .profile-v2-name-line .profile-name-link {
  color: inherit;
}

.profile-page-v2 .profile-v2-name-line .profile-name-link:hover {
  color: var(--profile-v2-teal);
}

.profile-page-v2 .profile-v2-name-line .profile-age {
  color: var(--profile-v2-muted);
  font-weight: 500;
}

.profile-page-v2 .profile-v2-online-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(39, 174, 96, 0.18);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.35);
}

.profile-page-v2 .profile-v2-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.profile-page-v2 .profile-v2-meta-line {
  margin: 0;
  font-size: 0.9rem;
  color: var(--profile-v2-muted);
}

.profile-page-v2 .profile-v2-about-card {
  padding: 20px;
}

.profile-page-v2 .profile-about-section.profile-v2-card {
  border-top: none;
}

.profile-page-v2 .profile-about-header h3 {
  color: #fff;
}

.profile-page-v2 .profile-about-edit {
  color: var(--profile-v2-teal);
  font-weight: 600;
  font-size: 0.9rem;
}

.profile-page-v2 .profile-about-text {
  color: #c4c8d0;
}

.profile-page-v2 .profile-about-section textarea {
  resize: none;
  background: rgba(11, 13, 17, 0.78);
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  outline: none;
}

.profile-page-v2 .profile-about-section textarea:focus {
  border-color: rgba(39, 224, 179, 0.45);
  box-shadow:
    0 0 0 3px rgba(39, 224, 179, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.profile-page-v2 .profile-about-section .profile-about-save {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  color: #08120f;
  border: 1px solid rgba(39, 224, 179, 0.28);
  border-radius: var(--radius-input);
  box-shadow: 0 8px 20px rgba(39, 224, 179, 0.18);
  font-weight: 700;
}

.profile-page-v2 .profile-about-section .profile-about-save:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
  box-shadow: 0 10px 24px rgba(39, 224, 179, 0.24);
}

.profile-page-v2 .profile-v2-feed-wrap {
  max-width: none;
  margin: 0;
  padding: 0;
  border: none;
}

.profile-page-v2 .profile-feed-heading {
  color: #fff;
}

/* Profile embedded feed — v0-style composer & posts (scoped) */
#profileFeedSection .profile-feed-composer-v2 {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.025),
      rgba(255, 255, 255, 0.01)
    ),
    var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 16px;
}

#profileFeedSection #feedComposerText {
  width: 100%;
  box-sizing: border-box;
  min-height: 80px;
  margin: 0 0 12px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  font-family: inherit;
}

#profileFeedSection #feedComposerText::placeholder {
  color: var(--text-muted);
}

#profileFeedSection .profile-feed-composer-preview {
  margin-bottom: 12px;
}

#profileFeedSection .profile-feed-composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#profileFeedSection .profile-feed-composer-toolbar-left {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

#profileFeedSection .profile-feed-file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

#profileFeedSection .profile-feed-vis-pill-wrap {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}

/* Replaced native <select> overlay with custom button + listbox; keep for reference.
#profileFeedSection .profile-feed-vis-native { ... }
#profileFeedSection .profile-feed-vis-native option { ... }
#profileFeedSection .profile-feed-vis-native:focus { ... }
*/

.profile-feed-vis-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 6px 12px;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.profile-feed-vis-btn:hover {
  border-color: #555;
  color: #fff;
}
.profile-feed-vis-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 4px 0;
  min-width: 180px;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.profile-feed-vis-option {
  padding: 10px 16px;
  font-size: 13px;
  color: #ccc;
  cursor: pointer;
  border-radius: 0;
}
.profile-feed-vis-option:hover {
  background: #252525;
  color: #fff;
}
.profile-feed-vis-option--active {
  color: #1db88a;
  font-weight: 600;
}
.profile-feed-vis-option--active:hover {
  background: #252525;
}

#profileFeedSection .profile-feed-vis-pill-icon {
  display: inline-flex;
  color: #ccc;
  flex-shrink: 0;
}

#profileFeedSection .profile-feed-vis-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

#profileFeedSection .profile-feed-vis-pill-chevron {
  flex-shrink: 0;
  font-size: 10px;
  color: #888;
  line-height: 1;
}

#profileFeedSection .profile-feed-add-image-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

#profileFeedSection .profile-feed-add-image-btn:hover {
  background: rgba(39, 224, 179, 0.1);
  color: var(--accent-primary-hover);
  border-color: rgba(39, 224, 179, 0.18);
}

#profileFeedSection .profile-feed-add-image-icon {
  display: inline-flex;
  color: #aaa;
}

#profileFeedSection .profile-feed-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  border: 1px solid rgba(39, 224, 179, 0.28);
  box-shadow: 0 8px 20px rgba(39, 224, 179, 0.18);
  color: #08120f;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

#profileFeedSection .profile-feed-submit-btn:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
  box-shadow: 0 10px 24px rgba(39, 224, 179, 0.24);
}

#profileFeedSection .profile-feed-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#profileFeedSection .profile-feed-submit-icon {
  font-size: 15px;
  line-height: 1;
}

#profileFeedSection .wall-composer-error {
  margin: 10px 0 0;
}

#profileFeedSection .wall-composer-thumb {
  border-radius: 8px;
  border: 1px solid #2a2a2a;
}

#profileFeedSection .feed-posts .wall-post-card {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.025),
      rgba(255, 255, 255, 0.01)
    ),
    var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 8px;
}

#profileFeedSection #ppWallFeedPosts .wall-post-card,
#ppWallFeedPosts .wall-post-card {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.025),
      rgba(255, 255, 255, 0.01)
    ),
    var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 8px;
}

#profileFeedSection .feed-posts .wall-post-head {
  margin-bottom: 0;
  align-items: flex-start;
}

#profileFeedSection .feed-posts .wall-post-meta {
  flex: 1;
  min-width: 0;
}

#profileFeedSection .feed-posts .wall-post-author-name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}

#profileFeedSection .feed-posts a.wall-post-author-name.wall-post-author-link {
  color: var(--text-primary);
}

#profileFeedSection
  .feed-posts
  a.wall-post-author-name.wall-post-author-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

#profileFeedSection .feed-posts .wall-post-vis-badge {
  background: #1e1e1e;
  border: 1px solid #333;
  color: #aaa;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

#profileFeedSection .feed-posts .wall-post-time-row .wall-post-time {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

#profileFeedSection .feed-posts .wall-post-content {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin: 12px 0;
}

#profileFeedSection .feed-posts .wall-post-images {
  margin-bottom: 8px;
}

#profileFeedSection .feed-posts .wall-post-actions {
  margin-top: 4px;
}

#profileFeedSection .feed-posts .wall-post-like-btn,
#profileFeedSection .feed-posts .wall-post-comment-toggle {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 0;
  font-size: 15px;
}

#profileFeedSection .feed-posts .wall-post-like-btn:hover,
#profileFeedSection .feed-posts .wall-post-comment-toggle:hover {
  background: rgba(39, 224, 179, 0.1);
  border-color: rgba(39, 224, 179, 0.18);
  color: var(--accent-primary-hover);
}

#profileFeedSection .feed-posts .wall-post-like-icon {
  font-size: 1.15rem;
  line-height: 1;
}

#profileFeedSection .feed-posts .wall-post-delete {
  margin-left: auto;
  align-self: center;
}

#profileFeedSection .feed-posts .wall-post-comments-wrap {
  border-top-color: #2a2a2a;
}

.profile-page-v2 .profile-v2-feed-wrap .wall-post-card {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.025),
      rgba(255, 255, 255, 0.01)
    ),
    var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.profile-page-v2 .profile-match-preferences {
  flex-shrink: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--profile-v2-border);
  background: var(--profile-v2-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.profile-page-v2 .profile-match-preferences h4 {
  color: #fff;
  margin-top: 0;
}

.profile-page-v2 .profile-v2-match-sub {
  font-size: 0.85rem;
  color: var(--profile-v2-muted);
  margin: -8px 0 14px;
}

.profile-page-v2 .profile-match-preferences label {
  color: var(--profile-v2-muted);
}

.profile-page-v2 .profile-match-preferences select,
.profile-page-v2
  .profile-match-preferences
  input:not(.profile-dual-range-input) {
  background: #0d0d0d;
  border-color: var(--profile-v2-border);
  color: #e8eaed;
}

.profile-page-v2 .profile-age-field {
  background: #0d0d0d;
  border-color: var(--profile-v2-border);
}

.profile-page-v2 .profile-dual-range {
  --range-purple: #00b894;
}

.profile-page-v2 .profile-exclude-friends-label span {
  color: #e8eaed;
}

.profile-page-v2 .profile-exclude-friends-label input[type="checkbox"] {
  accent-color: var(--profile-v2-teal);
}

.profile-page-v2 .profile-v2-start-match-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  background: var(--profile-v2-teal) !important;
  border: none;
  color: #0a0a0a !important;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 10px;
  transition:
    filter 0.2s,
    transform 0.15s;
}

.profile-page-v2 .profile-v2-start-match-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.profile-page-v2 .profile-v2-video-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.profile-page-v2 .profile-v2-activity-card {
  position: relative;
  z-index: 1;
  padding: 18px 16px 20px;
}

.profile-page-v2 .profile-v2-activity-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: #fff;
}

.profile-page-v2 .profile-v2-activity-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--profile-v2-border);
}

.profile-page-v2 .profile-v2-activity-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: #0d0d0d;
  color: var(--profile-v2-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}

.profile-page-v2 .profile-v2-activity-tab--active {
  background: rgba(0, 184, 148, 0.15);
  color: var(--profile-v2-teal);
}

.profile-page-v2 .profile-v2-activity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--profile-v2-border);
  font-size: 0.88rem;
  color: var(--profile-v2-muted);
}

.profile-page-v2 .profile-v2-activity-row:last-child {
  border-bottom: none;
}

.profile-page-v2 .profile-v2-activity-row span:last-child {
  font-weight: 700;
  color: #e8eaed;
}

.profile-page-v2 .profile-social-text-col {
  flex: 1 !important;
  min-width: 0 !important;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px;
}

.profile-page-v2 .profile-social-status {
  font-size: 11px !important;
  line-height: 1.3;
  display: block !important;
  margin-top: 1px !important;
  min-height: 1.1em;
}

.profile-page-v2 .profile-social-status--online {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin-top: 1px !important;
  color: var(--accent-primary);
}

.profile-page-v2 .profile-social-status--online .profile-social-online-label {
  color: var(--accent-primary);
  font-weight: 600;
}

.profile-page-v2 .profile-social-status--recent {
  color: var(--text-muted);
}

.profile-page-v2 .profile-social-status--online .profile-social-online-dot {
  display: none;
}

.profile-page-v2 .profile-social-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-primary);
  flex-shrink: 0;
}

.profile-page-v2 .profile-social-online-label {
  color: inherit;
  font-weight: 500;
}

.profile-page-v2 .profile-social-item {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  width: 100% !important;
  box-sizing: border-box;
  padding: 0;
  margin-bottom: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  background: color-mix(in srgb, var(--surface-1) 65%, var(--surface-2));
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover);
}

.profile-page-v2 .profile-social-item-friend {
  border-color: color-mix(in srgb, var(--accent-primary) 14%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent-primary) 4%, var(--surface-1));
}

.profile-page-v2 .profile-social-item-connection {
  border-color: var(--border-subtle);
  background: color-mix(in srgb, var(--surface-3) 35%, var(--surface-1));
}

.profile-page-v2 .profile-social-item:last-child {
  margin-bottom: 0;
}

.profile-page-v2 .profile-social-item:hover {
  border-color: var(--border-soft);
  background: color-mix(in srgb, var(--surface-3) 45%, var(--surface-1));
}

.profile-page-v2 .profile-social-item-friend:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 22%, var(--border-soft));
}

.profile-page-v2 .profile-social-item-main {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box;
  padding: 7px 4px 7px 8px;
  flex: 1;
  min-width: 0;
  border-radius: calc(var(--radius-input) - 2px);
}

.profile-page-v2 .profile-social-drag-handle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 14px;
  max-width: 14px;
  height: 18px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1;
  user-select: none;
  transition:
    opacity var(--motion-hover),
    color var(--motion-hover);
}

.profile-page-v2 .profile-social-item:hover .profile-social-drag-handle {
  opacity: 0.85;
  color: var(--text-secondary);
}

.profile-page-v2 .profile-social-item .profile-social-kebab-details {
  flex-shrink: 0;
  max-width: 32px;
  padding-right: 4px;
  align-self: center;
}

.profile-page-v2 .profile-social-item .profile-social-kebab {
  width: 30px !important;
  max-width: 30px !important;
  min-width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}

.profile-page-v2 .profile-social-kebab:hover,
.profile-page-v2 .profile-social-kebab-details[open] .profile-social-kebab {
  color: var(--text-secondary);
  background: var(--surface-3);
  border-color: var(--border-soft);
}

.profile-page-v2 .profile-social-item-main .profile-social-name,
.profile-page-v2 .profile-social-name {
  font-size: 0.8125rem !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  display: block !important;
  width: 100% !important;
  max-width: 100%;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.profile-page-v2 .profile-social-avatar-wrap {
  position: relative;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  overflow: visible;
  box-sizing: border-box;
}

.profile-page-v2 .profile-social-avatar-clip {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  overflow: hidden !important;
}

.profile-page-v2
  .profile-social-avatar-wrap.profile-social-avatar-wrap--online {
  overflow: visible;
}

.profile-page-v2 .profile-social-avatar-clip img,
.profile-page-v2 .profile-social-avatar-wrap img {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  object-fit: contain !important;
  border-radius: 50% !important;
  display: block !important;
  flex-shrink: 0 !important;
  overflow: hidden;
}

.profile-page-v2 .profile-social-avatar-placeholder {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-3));
  color: var(--accent-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  overflow: visible;
}

.profile-page-v2 .profile-social-item-connection .profile-social-avatar-placeholder {
  background: color-mix(in srgb, var(--surface-3) 80%, var(--surface-2));
  color: var(--text-secondary);
}

.profile-page-v2 .profile-social-avatar-placeholder-inner {
  overflow: hidden;
  border-radius: 50%;
}

.profile-page-v2 .profile-social-avatar-wrap--online::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--surface-1);
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1;
}

.profile-page-v2 .profile-social-empty {
  list-style: none;
  margin: 0;
  padding: 14px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-input);
  background: color-mix(in srgb, var(--surface-3) 40%, transparent);
}

.profile-page-v2 .profile-social-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  min-height: 52px;
  border-radius: var(--radius-input);
  border: 1px dashed var(--border-subtle);
  background: color-mix(in srgb, var(--surface-3) 35%, transparent);
}

.profile-page-v2 #friendsList.profile-social-list {
  border-color: color-mix(in srgb, var(--accent-primary) 16%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent-primary) 4%, var(--surface-3));
}

.profile-page-v2 #connectionsList.profile-social-list {
  border-color: var(--border-subtle);
  background: color-mix(in srgb, var(--surface-3) 55%, transparent);
}

.profile-page-v2 .profile-social-drop-zone.profile-social-drop-hover {
  border-color: color-mix(in srgb, var(--accent-primary) 38%, var(--border-soft)) !important;
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--surface-2)) !important;
}

.profile-page-v2 .profile-social-list--scroll {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Portaled kebab menu (body.profile-page-v2) — visual only; fixed position unchanged */
.profile-page-v2 .profile-social-menu {
  min-width: 188px;
  padding: 6px;
  margin: 0;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-soft);
  background: var(--surface-1);
  box-shadow: var(--shadow-card-hover);
}

.profile-page-v2 .profile-social-menu-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: calc(var(--radius-input) - 4px);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background var(--motion-hover),
    color var(--motion-hover);
}

.profile-page-v2 .profile-social-menu-item:hover {
  background: var(--surface-2);
}

.profile-page-v2 .profile-social-menu-item-delete {
  color: var(--error);
}

.profile-page-v2 .profile-social-menu-item-delete:hover {
  background: color-mix(in srgb, var(--error) 10%, var(--surface-2));
}

.profile-page-v2 .profile-photos-modal-inner,
.profile-page-v2 .profile-crop-modal-inner {
  background: var(--profile-v2-card);
  border: 1px solid var(--profile-v2-border);
}

@media (max-width: 1024px) {
  .profile-page-v2 .profile-v2-shell {
    grid-template-columns: 1fr;
  }

  .profile-page-v2 .profile-v2-content-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .profile-page-v2 .profile-v2-menu-toggle {
    display: flex;
  }

  .profile-page-v2 .profile-v2-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    height: auto;
    max-height: none;
    z-index: 200;
    transform: translateX(-102%);
    border-radius: 0;
    border-right: 1px solid var(--profile-v2-border);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
    pointer-events: none;
  }

  /* Open drawer: receives scroll/wheel; closed drawer does not block the page */
  .profile-page-v2 .profile-v2-sidebar.profile-v2-sidebar--open {
    transform: translateX(0);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
  }

  .profile-page-v2 .profile-v2-backdrop {
    display: block;
    pointer-events: none;
  }

  .profile-page-v2 .profile-v2-backdrop[hidden] {
    display: none !important;
  }

  .profile-page-v2 .profile-v2-topbar-inner {
    padding: 8px 12px;
  }

  /* Fix: SVG hamburger needs explicit white color and centered alignment */
  .profile-page-v2 .profile-v2-menu-toggle {
    color: #fff;
    align-items: center;
  }
}

@media (min-width: 768px) {
  .profile-page-v2 .profile-v2-sidebar {
    position: sticky !important;
    top: 52px !important;
    height: auto !important;
    width: 280px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: none !important;
    left: auto !important;
    /* backdrop-filter on the topbar (z-index:100) creates a compositing layer whose
       hit-test region Chromium extends through the full container height, intercepting
       clicks at the kebab's position. Raising the sidebar above the topbar in the
       stacking order ensures the sidebar's layer is hit-tested first. */
    z-index: 101 !important;
    pointer-events: auto !important;
  }

  #profileMobileMenuToggle {
    display: none !important;
  }

  .profile-page-v2 .profile-v2-backdrop {
    display: none !important;
  }
}

/* ── Tablet portrait (768px–1024px): sidebar becomes a drawer, ad rail stays in-line ── */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Show hamburger — overrides the min-width:768px display:none !important */
  #profileMobileMenuToggle {
    display: flex !important;
  }
  .profile-page-v2 .profile-v2-menu-toggle {
    display: flex;
    color: #fff;
    align-items: center;
  }

  /* Sidebar: slide-out drawer (overrides min-width:768px sticky/visible rules) */
  .profile-page-v2 .profile-v2-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(300px, 88vw) !important;
    height: auto !important;
    max-height: none !important;
    z-index: 200 !important;
    transform: translateX(-102%) !important;
    border-radius: 0 !important;
    border-right: 1px solid var(--profile-v2-border) !important;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5) !important;
    pointer-events: none !important;
  }
  .profile-page-v2 .profile-v2-sidebar.profile-v2-sidebar--open {
    transform: translateX(0) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    pointer-events: auto !important;
  }

  /* Backdrop: hidden until sidebar opens (overrides min-width:768px display:none !important) */
  .profile-page-v2 .profile-v2-backdrop {
    display: block !important;
    pointer-events: none;
  }
  .profile-page-v2 .profile-v2-backdrop[hidden] {
    display: none !important;
  }

  /* Topbar: compact padding matching mobile */
  .profile-page-v2 .profile-v2-topbar-inner {
    padding: 8px 12px;
  }

  /* Content columns: restore 2-column (main + rail) — max-width:1024px collapsed this to 1fr */
  .profile-page-v2 .profile-v2-content-columns {
    grid-template-columns: minmax(0, 1fr) 200px;
  }

  /* Messages page: profile-v2-hamburger bars (spans) — only styled at ≤767px otherwise */
  .profile-v2-hamburger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    border-radius: 10px;
    background: var(--surface-1, #11141A);
    cursor: pointer;
    color: #fff;
  }
  .profile-v2-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
  }
}

/* ——— Public profile v2 (scoped) ——— */
.public-profile-v2 {
  min-height: 100vh;
  background: #0a0a0a;
  color: #ddd;
}

.public-profile-v2-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #1e1e1e;
  background: #0d0d0d;
}

.public-profile-v2-topbar-spacer {
  flex: 1;
}

.public-profile-v2-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-profile-v2-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #ccc;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.public-profile-v2-icon-btn:hover {
  background: #222;
  color: #fff;
}

.public-profile-v2-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.public-profile-v2-loading {
  text-align: center;
  color: #888;
  padding: 48px 16px;
}

.public-profile-v2-header-card {
  position: relative;
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 14px;
  overflow: visible;
  margin-bottom: 20px;
}

/* Same overlap pattern as .profile-page-v2 .profile-v2-header-body + cover */
.public-profile-v2-cover-gradient {
  position: relative;
  width: 100%;
  height: 120px;
  min-height: 120px;
  max-height: 120px;
  box-sizing: border-box;
  overflow: visible;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(
    135deg,
    #0a2e24 0%,
    #1a3a31 40%,
    #0f4a3a 70%,
    #00b894 100%
  );
}

/* Initial / no-photo: teal ring matches sidebar; photo visible → neutral wrap */
.public-profile-v2-avatar-wrap {
  position: absolute;
  left: 24px;
  bottom: -40px;
  z-index: 2;
  width: 80px;
  height: 80px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #1a3a31;
  color: #00b894;
}

.public-profile-v2-avatar-wrap:not(
    :has(#publicMainPhoto[style*="display: none"])
  ):has(#publicMainPhoto[src]) {
  background: transparent;
  color: inherit;
}

.public-profile-v2 .public-profile-avatar.public-profile-v2-avatar,
.public-profile-v2 .public-profile-v2-avatar {
  width: 80px;
  height: 80px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 50%;
  border: 3px solid #111;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  position: relative;
}

.public-profile-v2-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.public-profile-v2-avatar-initial {
  font-size: 28px;
  font-weight: 700;
  color: inherit;
}

.public-profile-v2-header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  padding: 56px 24px 24px 124px;
  margin-top: -40px;
}

.public-profile-v2-header-text {
  flex: 1;
  min-width: 200px;
  padding-bottom: 4px;
}

.public-profile-v2-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.public-profile-v2-name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.public-profile-v2-age {
  font-weight: 600;
  color: #ccc;
}

.public-profile-v2-online-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 184, 148, 0.2);
  color: #00b894;
  font-size: 12px;
  font-weight: 600;
}

.public-profile-v2-meta {
  margin: 0 0 6px;
  font-size: 14px;
  color: #aaa;
  line-height: 1.5;
}

.public-profile-v2-member-since {
  margin: 0 0 16px;
  font-size: 13px;
  color: #888;
}

.public-profile-v2-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.public-profile-v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition:
    filter 0.15s,
    background 0.15s;
}

.public-profile-v2-btn-primary {
  background: #00b894;
  color: #fff;
}

.public-profile-v2-btn-primary:hover {
  filter: brightness(1.08);
}

.public-profile-v2-btn-secondary {
  background: #1a1a1a;
  color: #ccc;
  border: 1px solid #333;
}

.public-profile-v2-btn-secondary:hover {
  background: #252525;
  color: #fff;
}

.public-profile-v2-btn-report {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #c0392b;
  background: transparent;
  color: #e74c3c;
  font-size: 18px;
  border-radius: 10px;
}

.public-profile-v2-btn-report:hover {
  background: rgba(231, 76, 60, 0.12);
}

.public-profile-v2-btn-inline {
  margin-top: 12px;
  width: auto;
}

.public-profile-v2-connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 184, 148, 0.12);
  color: #00b894;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(0, 184, 148, 0.35);
}

.public-profile-v2-connection-dot,
.public-profile-v2-teal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00b894;
  flex-shrink: 0;
}

.public-profile-v2-columns {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.public-profile-v2-col-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.public-profile-v2-col-side {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.public-profile-v2-card {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 14px;
  padding: 20px;
}

.public-profile-v2-card-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-profile-v2-title-icon {
  color: #00b894;
  font-size: 14px;
}

.public-profile-v2-about-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #bbb;
  white-space: pre-wrap;
}

.public-profile-v2-about-text.public-profile-v2-about-empty {
  color: #555;
}

.public-profile-v2-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.public-profile-v2-gallery-cell {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a;
  aspect-ratio: 1;
}

.public-profile-v2-gallery-cell-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.public-profile-v2-gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

.public-profile-v2-gallery-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 184, 148, 0.35);
  color: #fff;
  font-size: 22px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.public-profile-v2-gallery-cell:hover .public-profile-v2-gallery-hover {
  opacity: 1;
}

.public-profile-v2-gallery-empty {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  color: #555;
  font-size: 14px;
  border: 1px dashed #2a2a2a;
  border-radius: 10px;
}

.public-profile-v2-stats {
  list-style: none;
  margin: 0;
  padding: 0;
}

.public-profile-v2-stats li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #1e1e1e;
  font-size: 14px;
}

.public-profile-v2-stats li:last-child {
  border-bottom: none;
}

.public-profile-v2-stat-label {
  color: #888;
}

.public-profile-v2-stat-value {
  color: #e8e8e8;
  font-weight: 600;
}

.public-profile-v2-muted {
  margin: 8px 0 0;
  font-size: 13px;
  color: #888;
  line-height: 1.5;
}

.public-profile-v2-connection-status {
  margin: 0 0 8px;
  font-size: 14px;
  color: #ddd;
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-profile-v2-not-connected {
  margin: 0 0 8px;
  color: #888;
  font-size: 14px;
}

.public-profile-v2-compat-pct {
  font-size: 2.25rem;
  font-weight: 700;
  color: #00b894;
  line-height: 1.2;
}

.public-profile-v2-compat-label {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e0;
}

.public-profile-v2-compat-note {
  margin-top: 12px;
  font-size: 12px;
}

.public-profile-v2-error {
  text-align: center;
  padding: 48px 20px;
  color: #aaa;
}

.public-profile-v2-error .public-profile-v2-btn {
  margin-top: 16px;
}

/* Lightbox */
.public-profile-v2-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
  box-sizing: border-box;
}

.public-profile-v2-lightbox[hidden] {
  display: none !important;
}

.public-profile-v2-lightbox-stage {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-profile-v2-lightbox-stage img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.public-profile-v2-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.public-profile-v2-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #444;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.public-profile-v2-lightbox-prev {
  left: 16px;
}

.public-profile-v2-lightbox-next {
  right: 16px;
}

.public-profile-v2-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Send message modal (dark, inside v2 page) */
.public-profile-v2 .public-profile-send-message-modal {
  background: rgba(0, 0, 0, 0.75);
}

.public-profile-v2 .public-profile-v2-modal-inner {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 14px;
  color: #ddd;
}

.public-profile-v2 .public-profile-v2-modal-inner h3 {
  color: #fff;
}

.public-profile-v2 .public-profile-v2-modal-inner label {
  color: #aaa;
}

.public-profile-v2 .public-profile-v2-modal-inner input,
.public-profile-v2 .public-profile-v2-modal-inner textarea {
  background: #0d0d0d;
  border: 1px solid #333;
  color: #eee;
}

.public-profile-v2 .messages-login-prompt a {
  color: #00b894;
}

@media (max-width: 640px) {
  .public-profile-v2-columns {
    flex-direction: column;
  }

  .public-profile-v2-col-side {
    width: 100%;
  }

  .public-profile-v2-header-inner {
    padding-left: 24px;
    padding-right: 24px;
    padding-top: 88px;
  }

  .public-profile-v2-lightbox {
    padding: 56px 12px;
  }

  .public-profile-v2-lightbox-prev {
    left: 4px;
  }

  .public-profile-v2-lightbox-next {
    right: 4px;
  }
}

/* =============================================================================
   Chat page (chat.html) — single block: layout + v2 classes (scoped .chat-container)
   ============================================================================= */

html:has(.chat-container) {
  height: 100%;
}

body:has(> .chat-container) {
  margin: 0;
  min-height: 100vh;
}

/* Chat v2 layout — row/column structure; video/chat heights from resizeChatLayout() in app.js */
.chat-container #chatScreen.active {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.chat-container .chat-v2-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-container .chat-v2-body > .waiting-screen,
.chat-container .chat-v2-body > .chat-screen,
.chat-container .chat-v2-body > .disconnected-screen {
  flex: 1;
  min-height: 0;
}

.chat-container .chat-v2-body > .waiting-screen.active,
.chat-container .chat-v2-body > .disconnected-screen.active {
  display: flex;
}

.chat-container .chat-screen.active {
  flex: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.chat-container .chat-v2-main {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  width: 100%;
}

/* Fill #chatScreen above controls so row height matches real layout (avoids panel taller than main → clipped input) */
.chat-container #chatScreen.active .chat-v2-main {
  flex: 1 1 auto;
  min-height: 0;
}

.chat-container .chat-v2-video-column {
  flex: 1 1 0px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 4px 10px 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.chat-container .video-container.chat-v2-video-stack {
  gap: 6px;
}

.chat-container .chat-v2-remote-card,
.chat-container .chat-v2-local-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  box-sizing: border-box;
  width: 100%;
  max-width: min(100%, calc(38.5vh * 16 / 9));
  aspect-ratio: 16 / 9;
  max-height: 38.5vh;
  height: auto;
  flex-shrink: 0;
}

.chat-container .chat-v2-remote-card.video-wrapper,
.chat-container .chat-v2-remote-card.video-card {
  background: var(--surface-2);
  border-color: var(--border-soft);
  box-shadow:
    var(--shadow-card),
    0 0 0 1px color-mix(in srgb, var(--accent-primary) 10%, transparent);
}

.chat-container .chat-v2-local-card.video-wrapper,
.chat-container .chat-v2-local-card.video-card {
  background: var(--surface-1);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.chat-container .chat-v2-remote-card #remoteVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 1;
}
.chat-container .chat-v2-local-card #localVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat-container .chat-v2-remote-card #remoteVideoBg {
  position: absolute;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  display: block;
  filter: blur(18px) brightness(0.5) saturate(1.2);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.chat-container .chat-v2-remote-card #remoteVideoBg.chat-bg-active {
  opacity: 1;
}

/* Sidebar for chat + game overlays: column flex, no overflow past viewport (scroll inside game UIs). */
.chat-container .chat-v2-chat-panel {
  --chat-panel-w: min(702px, 42vw);
  position: relative;
  width: var(--chat-panel-w);
  flex: 0 0 var(--chat-panel-w);
  max-width: var(--chat-panel-w);
  min-height: 0;
  overflow: hidden;
  padding: 8px 8px 8px 2px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Ad rail — third column in default video chat */
.chat-container .chat-v2-ad-rail {
  width: 200px;
  flex-shrink: 0;
  background: #0a0a0a;
  border-left: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  gap: 12px;
  box-sizing: border-box;
}

.chat-container .chat-v2-ad-slot {
  width: 140px;
  min-height: 280px;
  background: #1a1a1a;
  border: 1px solid #222;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-container .chat-v2-ad-label {
  color: #333;
  font-size: 11px;
  text-align: center;
}

/* Quiz flow overlay — same panel placement as trivia; videos stay full size (no PiP). */
.chat-container #quizFlowOverlay.quiz-flow-chat-panel {
  position: absolute;
  inset: 0;
  z-index: 31;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
}

.chat-container
  #quizFlowOverlay.quiz-flow-chat-panel
  .quiz-panel.quiz-panel--wide {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  background: #111;
  border-radius: 14px;
  border: 1px solid #1e1e1e;
}

.chat-container #quizFlowOverlay.quiz-flow-chat-panel #quizFlowMount {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.chat-container #quizFlowOverlay #quizFlowMount > .quiz-progress,
.chat-container #quizFlowOverlay #quizFlowMount > .quiz-heading,
.chat-container #quizFlowOverlay #quizFlowMount > .quiz-results-pct,
.chat-container #quizFlowOverlay #quizFlowMount > .quiz-results-label,
.chat-container #quizFlowOverlay #quizFlowMount > .quiz-next-wrap,
.chat-container #quizFlowOverlay #quizFlowMount > .quiz-level-prompt,
.chat-container #quizFlowOverlay #quizFlowMount > .quiz-wait-partner {
  flex-shrink: 0;
}

.chat-container #quizFlowOverlay #quizFlowMount > .quiz-qtext {
  flex-shrink: 0;
  font-size: clamp(13px, 2vw, 16px);
}

.chat-container #quizFlowOverlay #quizFlowMount > .quiz-choices {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  overflow-y: auto;
}

.chat-container #quizFlowOverlay #quizFlowMount .quiz-choice-btn {
  font-size: clamp(12px, 1.8vw, 14px);
  padding: clamp(6px, 1vh, 10px) 12px;
}

.chat-container #quizFlowOverlay #quizFlowMount > .quiz-reveal-row {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

.chat-container #quizFlowOverlay #quizFlowMount:has(> .quiz-results-pct) {
  overflow-y: auto;
}

.chat-container .chat-v2-chat-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #111;
  border-radius: 12px;
  border: 1px solid #1e1e1e;
  padding: 0;
}

.chat-container .chat-v2-controls-bar {
  padding: 14px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  margin: 0;
  width: 100%;
  max-width: 100%;
  background: var(--surface-1);
  border-top: 1px solid var(--border-subtle);
}

.chat-container .chat-next-btn,
.chat-container #nextBtn.chat-next-btn {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  color: #08120f;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 32%, transparent);
  padding: 13px 52px;
  border-radius: var(--radius-input);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent-primary) 22%, transparent);
  transition:
    background var(--motion-hover),
    box-shadow var(--motion-hover),
    border-color var(--motion-hover);
}

.chat-container .chat-next-btn:hover,
.chat-container #nextBtn.chat-next-btn:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent-primary) 28%, transparent);
}

.chat-container .chat-next-btn:focus-visible,
.chat-container #nextBtn.chat-next-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 55%, transparent);
  outline-offset: 3px;
}

.chat-container .chat-v2-topbar {
  height: 52px;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-subtle);
}

.chat-container .chat-v2-brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.chat-container .chat-v2-brand:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 4px;
  border-radius: 8px;
}

.chat-container .chat-v2-topbar .user-info,
.chat-container .chat-v2-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-container .chat-v2-topbar #currentUsername {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.chat-container .chat-v2-btn-leave {
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  background: var(--surface-2);
  padding: 6px 14px;
  border-radius: var(--radius-input);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  width: auto;
  margin: 0;
  transition:
    color var(--motion-hover),
    border-color var(--motion-hover),
    background-color var(--motion-hover);
}

.chat-container .chat-v2-btn-leave:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--text-muted) 40%, var(--border-soft));
  background: var(--surface-3);
}

.chat-container .vc-name-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: auto;
  z-index: 14;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.chat-container .vc-handshake-top-center {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  pointer-events: none;
}

.chat-container .vc-handshake-top-center #handshakeBtn {
  pointer-events: auto;
}

.chat-container .vc-handshake-top-center .handshake-connect-text {
  color: var(--text-primary);
}

/* ~50% larger than previous 4px/12px padding, 11px text */
.chat-container .vc-handshake-top-center .video-handshake-btn {
  position: relative;
  width: auto;
  height: auto;
  min-height: 0;
  border-radius: var(--radius-pill);
  padding: 7px 20px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  background: color-mix(in srgb, var(--accent-primary) 22%, var(--surface-3));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 55%, var(--border-soft));
  color: var(--text-primary);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent-primary) 18%, transparent);
  transition:
    background-color var(--motion-hover),
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.chat-container .vc-handshake-top-center .video-handshake-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-primary) 30%, var(--surface-3));
  border-color: var(--accent-primary);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent-primary) 24%, transparent);
}

.chat-container
  .vc-handshake-top-center
  .video-handshake-btn:not(.handshake-state-play)
  .handshake-connect-text {
  display: inline;
}

.chat-container
  .vc-handshake-top-center
  .video-handshake-btn:not(.handshake-state-play)
  .handshake-btn-icon {
  display: none;
}

.chat-container
  .vc-handshake-top-center
  .video-handshake-btn.handshake-state-play
  .handshake-connect-text {
  display: inline;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.chat-container
  .vc-handshake-top-center
  .video-handshake-btn.handshake-state-play
  .handshake-btn-icon {
  display: none;
}

.chat-container
  .vc-handshake-top-center
  .video-handshake-btn.handshake-state-play {
  background: color-mix(in srgb, var(--accent-primary) 38%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-primary) 70%, var(--border-soft));
  color: var(--text-primary);
}

.chat-container
  .vc-handshake-top-center
  .video-handshake-btn.handshake-games-locked,
.chat-container
  .vc-handshake-top-center
  .video-handshake-btn.handshake-state-play:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.chat-container .vc-name-pill,
.chat-container #remoteUsername.vc-name-pill {
  display: inline-block;
  max-width: min(200px, 50vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: color-mix(in srgb, var(--surface-3) 82%, transparent);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  line-height: 1.25;
}

.chat-container .video-menu-wrap {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 15;
}

.chat-container .video-dots-btn {
  background: color-mix(in srgb, var(--surface-3) 55%, transparent);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition:
    color var(--motion-hover),
    background-color var(--motion-hover),
    border-color var(--motion-hover);
}

.chat-container .video-dots-btn:hover,
.chat-container .video-card:hover .video-dots-btn {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-3) 88%, transparent);
  border-color: var(--border-soft);
}

.chat-container .video-dots-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}

.chat-container .video-dot {
  width: 3px;
  height: 3px;
  background: currentColor;
  border-radius: 50%;
}

.chat-container .video-dropdown {
  display: none;
  position: absolute;
  top: 34px;
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  padding: 5px;
  min-width: 158px;
  box-shadow: var(--shadow-card-hover);
}

.chat-container .video-dropdown.open {
  display: block;
}

.chat-container .video-dropdown-item {
  padding: 9px 12px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  border-radius: 10px;
  transition:
    background-color var(--motion-hover),
    color var(--motion-hover);
}

.chat-container .video-dropdown-item:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

.chat-container .video-dropdown-item.danger {
  color: color-mix(in srgb, var(--error) 92%, var(--text-primary));
}

.chat-container .video-dropdown-item.danger:hover {
  background: color-mix(in srgb, var(--error) 12%, transparent);
  color: var(--error);
}

.chat-container .video-dropdown-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.chat-container .video-muted-badge {
  display: none;
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: color-mix(in srgb, var(--error) 88%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--error) 35%, transparent);
  color: var(--text-primary);
  font-size: 0.625rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  z-index: 12;
  letter-spacing: 0.02em;
}

.chat-container .video-muted-badge.visible {
  display: block;
}

.chat-container .vc-timer-overlay.chat-session-timer-row {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  z-index: 12;
  background: color-mix(in srgb, var(--surface-3) 88%, transparent);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px 6px 12px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
}

.chat-container .vc-timer-overlay .chat-timer-label {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.chat-container .vc-timer-overlay .chat-timer-value {
  color: var(--accent-primary);
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chat-container .vc-timer-overlay .chat-timer-value.chat-timer-infinity {
  color: var(--accent-primary);
  font-size: 1.125rem;
}

.chat-container .vc-timer-overlay .chat-timer-unit {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.chat-container #addTimeBtn.control-btn.add-time-btn {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border: none;
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-container #addTimeBtn .btn-icon {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-container .chat-v2-addtime-svg {
  display: block;
  flex-shrink: 0;
}

.chat-container .chat-v2-addtime-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
  pointer-events: none;
}

.chat-container .chat-v2-addtime-svg circle,
.chat-container .chat-v2-addtime-svg path {
  stroke: var(--accent-primary);
}

.chat-container .chat-v2-addtime-svg circle {
  fill: color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.chat-container #addTimeBtn.control-btn.add-time-btn:hover {
  background: transparent;
  transform: scale(1.06);
}

.chat-container #addTimeBtn.control-btn.add-time-btn:disabled,
.chat-container #addTimeBtn.control-btn.add-time-btn:disabled:hover {
  background: transparent;
  opacity: 0.35;
  transform: none;
}

.chat-container .video-label.vc-you-pill {
  top: 10px;
  left: 10px;
  background: color-mix(in srgb, var(--surface-3) 80%, transparent);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  z-index: 14;
}

.chat-container .chat-messages.chat-v2-chat-card {
  height: auto;
  max-height: none;
}

.chat-container .chat-v2-chat-header {
  flex-shrink: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #1e1e1e;
  color: #888;
  font-size: 12px;
}

.chat-container .chat-v2-chat-card .messages-list,
.chat-container .chat-v2-chat-card #messagesList.messages-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  margin-bottom: 0;
  gap: 8px;
}

.chat-container .chat-v2-chat-card .message {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.chat-container .chat-v2-chat-card .message.own {
  align-items: flex-end;
  justify-content: flex-start;
}

.chat-container .chat-v2-chat-card .message-content {
  max-width: 200px;
  overflow: hidden;
  padding: 7px 11px;
  font-size: 13px;
  border-radius: 10px 10px 10px 2px;
  background: #1e1e1e;
  color: #ddd;
  word-wrap: break-word;
}

.chat-container .chat-v2-chat-card .message.own .message-content {
  background: rgba(0, 184, 148, 0.2);
  color: #00b894;
  border-radius: 10px 10px 2px 10px;
}

.chat-container .chat-v2-chat-card .message-time {
  font-size: 10px;
  color: #555;
  margin-left: 0;
  align-self: inherit;
}

.chat-container .chat-v2-chat-card .message-input-container {
  flex-shrink: 0;
  padding: 10px;
  border-top: 1px solid #1e1e1e;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-container .chat-v2-chat-card #messageInput.message-input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  padding: 7px 12px;
  color: #ddd;
  font-size: 13px;
}

.chat-container .chat-v2-chat-card #messageInput.message-input:focus {
  border-color: #00b894;
}

.chat-container .chat-v2-chat-card #sendBtn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: none;
  background: #00b894;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-container .chat-countdown-overlay {
  border-radius: 0;
  z-index: 60;
}

.chat-container .timer-ended-modal {
  z-index: 4000;
}

.chat-container .quiz-overlay {
  z-index: 4100;
}

.chat-container .chat-toast {
  z-index: 4200;
}

.chat-container .chat-v2-body > .waiting-screen.active {
  z-index: 1;
}

/* —— Chat-D: narrow / tablet / mobile live room —— */
@media (max-width: 900px) {
  .chat-container .chat-v2-ad-rail {
    display: none;
  }

  .chat-container .chat-screen.active {
    padding: 0;
    gap: 0;
    min-height: 0;
    overflow: hidden;
  }

  .chat-container .chat-v2-main {
    flex: 1 1 0;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .chat-container .chat-v2-video-column {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 6px 8px 4px;
    overflow: hidden;
  }

  .chat-container .video-container.chat-v2-video-stack {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    gap: 6px;
    justify-content: center;
  }

  .chat-container .chat-v2-remote-card,
  .chat-container .chat-v2-local-card {
    max-width: 100%;
    width: 100%;
  }

  .chat-container .chat-v2-remote-card {
    flex: 1 1 auto;
    min-height: 96px;
    max-height: min(50dvh, calc((100vw - 24px) * 9 / 16));
    height: auto;
  }

  .chat-container .chat-v2-local-card {
    flex: 0 0 auto;
    min-height: 0;
    max-height: min(24dvh, 172px);
    max-width: min(78vw, 300px);
    width: min(78vw, 300px);
    align-self: center;
  }

  .chat-container .chat-v2-chat-panel {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto !important;
    max-height: clamp(128px, 30dvh, 252px);
    min-height: 0;
    padding: 4px 8px 6px;
    overflow: hidden;
  }

  .chat-container .chat-messages.chat-v2-chat-card,
  .chat-container .chat-v2-chat-card {
    height: auto !important;
    max-height: clamp(120px, 28dvh, 240px);
    min-height: 108px;
  }

  .chat-container .chat-v2-chat-card .messages-list,
  .chat-container .chat-v2-chat-card #messagesList.messages-list {
    min-height: 0;
  }

  .chat-container .chat-v2-controls-bar {
    flex-shrink: 0;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom, 0px));
  }

  .chat-container .chat-next-btn,
  .chat-container #nextBtn.chat-next-btn {
    width: 100%;
    max-width: 400px;
    padding: 13px 20px;
  }

  .chat-container .vc-timer-overlay.chat-session-timer-row {
    max-width: calc(100% - 20px);
    padding: 5px 10px;
    gap: 8px;
  }

  .chat-container .vc-handshake-top-center .video-handshake-btn {
    padding: 6px 14px;
    font-size: 0.9375rem;
  }

  .waiting-content,
  .disconnected-content {
    margin: 0 12px;
  }

  .chat-countdown-inner {
    padding: 20px 16px;
  }

  .timer-ended-modal,
  #timerEndedModal.timer-ended-modal,
  #blockEndedModal.timer-ended-modal {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .timer-ended-inner,
  .timer-ended-content {
    max-width: min(400px, calc(100vw - 24px));
  }

  .report-user-modal-inner {
    max-width: min(420px, calc(100vw - 20px));
  }

  .chat-toast,
  #chatToast.chat-toast {
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 24px);
  }

  /* In-chat games / quiz: break out of narrow chat panel; full-viewport overlay */
  .chat-container #quizFlowOverlay.quiz-flow-chat-panel,
  .chat-container #triviaFlowOverlay.quiz-flow-chat-panel,
  .chat-container #rpsFlowOverlay.quiz-flow-chat-panel,
  .chat-container #tttFlowOverlay.quiz-flow-chat-panel {
    position: fixed;
    inset: 0;
    z-index: 4200;
    padding: 12px;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .chat-container
    #quizFlowOverlay.quiz-flow-chat-panel
    .quiz-panel.quiz-panel--wide,
  .chat-container
    #triviaFlowOverlay.quiz-flow-chat-panel
    .trivia-panel.quiz-panel--wide,
  .chat-container
    #rpsFlowOverlay.quiz-flow-chat-panel
    .rps-panel.quiz-panel--wide,
  .chat-container
    #tttFlowOverlay.quiz-flow-chat-panel
    .ttt-flow-shell.quiz-panel--wide {
    width: 100%;
    max-width: 460px;
    height: auto;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    border-radius: 14px;
  }
}

@media (max-height: 700px) {
  .chat-container #chatScreen.active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .chat-container .chat-v2-main {
    min-height: min-content;
  }
}

@media (max-height: 700px) and (max-width: 900px) {
  .chat-container .chat-v2-remote-card {
    max-height: min(42dvh, 300px);
    min-height: 88px;
  }

  .chat-container .chat-v2-local-card {
    max-height: min(20dvh, 148px);
    max-width: min(70vw, 260px);
    width: min(70vw, 260px);
  }

  .chat-container .chat-v2-chat-panel {
    max-height: clamp(108px, 24dvh, 200px);
  }

  .chat-container .chat-messages.chat-v2-chat-card,
  .chat-container .chat-v2-chat-card {
    max-height: clamp(100px, 22dvh, 188px);
    min-height: 96px;
  }
}

@media (max-width: 640px) {
  .chat-container .chat-v2-topbar {
    height: auto;
    min-height: 48px;
    padding: 8px 10px;
    gap: 8px;
  }

  .chat-container .chat-v2-brand .brand-wordmark {
    height: 26px;
    width: auto;
  }

  .chat-container .chat-v2-topbar .user-info,
  .chat-container .chat-v2-topbar-right {
    gap: 6px;
    flex-shrink: 1;
    min-width: 0;
  }

  .chat-container .chat-v2-topbar #currentUsername {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
  }

  .chat-container .chat-v2-btn-leave {
    padding: 6px 10px;
    font-size: 0.6875rem;
    white-space: nowrap;
  }

  .chat-container .vc-name-pill,
  .chat-container #remoteUsername.vc-name-pill {
    max-width: min(140px, 42vw);
    font-size: 0.6875rem;
  }

  .chat-container .video-label.vc-you-pill {
    font-size: 0.6875rem;
    padding: 4px 9px;
  }

  .chat-container .video-dots-btn {
    width: 32px;
    height: 32px;
  }

  .chat-container .video-dropdown {
    min-width: 140px;
  }

  .chat-container .chat-v2-chat-card .message-input-container,
  .chat-container .chat-v2-chat-card .chat-v2-chat-input-row {
    padding: 8px;
    gap: 6px;
  }

  .chat-container .chat-v2-chat-card #messageInput.message-input {
    min-width: 0;
    font-size: 16px;
  }

  .chat-container .chat-v2-chat-card #sendBtn,
  .chat-container .chat-attach-btn {
    flex-shrink: 0;
  }

  .chat-countdown-number,
  #chatCountdownNumber.chat-countdown-number {
    font-size: clamp(2.75rem, 14vw, 4.5rem);
  }

  .chat-countdown-label {
    font-size: 0.9375rem;
    padding: 0 8px;
  }
}

@media (max-width: 480px) {
  .chat-container .chat-v2-topbar #currentUsername {
    display: none;
  }

  .chat-container .chat-v2-remote-card {
    max-height: min(46dvh, calc((100vw - 16px) * 9 / 16));
  }

  .chat-container .chat-v2-local-card {
    max-width: min(82vw, 280px);
    width: min(82vw, 280px);
  }

  .chat-container .vc-timer-overlay .chat-timer-label {
    display: none;
  }

  .chat-container .vc-timer-overlay.chat-session-timer-row {
    gap: 6px;
    padding: 4px 8px 4px 10px;
  }
}

/* ——— Games page (.games-page) ——— */
.games-page {
  min-height: 100vh;
  background: #0a0a0a;
  color: #e8eaed;
}
.games-page-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* Games stats page: profile v2 sidebar + full-width main (document scroll only; no extra main scroll) */
.profile-page-v2.games-page-v2-layout {
  overflow-x: hidden;
}

.profile-page-v2.games-page-v2-layout .profile-v2-shell--games {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 24px 16px 48px;
}

.profile-page-v2.games-page-v2-layout .profile-v2-games-main {
  min-width: 0;
  overflow-x: hidden;
}

.profile-page-v2.games-page-v2-layout .games-page-inner {
  max-width: none;
  margin: 0;
  padding: 0 0 48px;
}

.profile-page-v2 .profile-v2-nav-cta--active {
  background: linear-gradient(
    180deg,
    rgba(39, 224, 179, 0.18),
    rgba(39, 224, 179, 0.1)
  );
  color: var(--accent-primary-hover);
  border-color: rgba(39, 224, 179, 0.32);
  box-shadow:
    0 0 0 1px rgba(39, 224, 179, 0.08),
    0 10px 24px rgba(39, 224, 179, 0.1);
}

.profile-page-v2 .profile-v2-nav-cta--active .profile-v2-nav-cta-label {
  color: inherit;
}

.profile-page-v2 .profile-v2-nav-cta--active .profile-v2-nav-cta-icon {
  filter: none;
  color: inherit;
}

.games-hidden-remote-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.games-find-match-btn {
  padding: 16px 28px;
  border-radius: 12px;
  border: 1px solid rgba(39, 224, 179, 0.28);
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  box-shadow: 0 8px 20px rgba(39, 224, 179, 0.18);
  color: #08120f;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  transition:
    filter 0.2s,
    transform 0.15s;
  flex-shrink: 0;
}
.games-find-match-btn:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
  box-shadow: 0 10px 24px rgba(39, 224, 179, 0.24);
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.games-find-match-btn--searching {
  animation: games-pulse-op 1.2s ease-in-out infinite;
}
.games-solo-play-btn {
  padding: 16px 24px;
  border-radius: 12px;
  border: 1px solid #3a4558;
  background: linear-gradient(180deg, #1a2230 0%, #121820 100%);
  color: #e8eef5;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  transition:
    filter 0.2s,
    transform 0.15s,
    border-color 0.2s;
}
.games-solo-play-btn:hover {
  border-color: rgba(39, 224, 179, 0.45);
  filter: brightness(1.08);
  transform: translateY(-1px);
}
@keyframes games-pulse-op {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ─── Games: single-player Memory Match ─── */
.games-solo-screen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  background: #080b10;
  overflow: hidden;
}
.games-solo-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 12px 18px;
  border-bottom: 1px solid #1e2836;
  background: #0c1018;
}
.games-solo-logo .brand-wordmark {
  height: 28px;
  width: auto;
}
.games-solo-title-wrap {
  flex: 1;
  min-width: 140px;
  text-align: center;
}
.games-solo-eyebrow {
  display: none;
}
.games-solo-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.games-solo-back-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #2a3444;
  background: #151c28;
  color: #c5d0de;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.games-solo-back-btn:hover {
  border-color: rgba(39, 224, 179, 0.4);
  color: #fff;
}
.games-solo-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow-y: auto;
}
.games-solo-menu {
  padding: 12px 16px 20px;
  width: 100%;
  box-sizing: border-box;
}

.games-solo-menu-intro {
  display: none;
}

.games-solo-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media (max-width: 900px) {
  .games-solo-menu-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .games-solo-menu-grid { grid-template-columns: repeat(2, 1fr); }
}

.games-solo-game-card {
  background: #121820;
  border: 1px solid #2a3444;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s ease, transform 0.2s ease;
  padding: 0;
  gap: 0;
}

.games-solo-game-card:hover {
  border-color: rgba(39, 224, 179, 0.4);
  transform: translateY(-2px);
}

.games-solo-game-card-icon {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  background: #0e141c center/cover no-repeat;
  flex-shrink: 0;
}

.games-solo-game-card--memory .games-solo-game-card-icon { background: url('/images/game-icons/memorymatch.webp') center/cover no-repeat; }
.games-solo-game-card--connect4 .games-solo-game-card-icon { background: url('/images/game-icons/momo4.webp') center/cover no-repeat; }
.games-solo-game-card--checkers .games-solo-game-card-icon { background: url('/images/game-icons/checkers.webp') center/cover no-repeat; }
.games-solo-game-card--momo-slide .games-solo-game-card-icon { background: url('/images/game-icons/momoslide.webp') center/cover no-repeat; }
.games-solo-game-card--jigsaw .games-solo-game-card-icon { background: url('/images/game-icons/jigsaw.webp') center/cover no-repeat; }

.games-solo-game-card-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.games-solo-game-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.games-solo-game-card-desc {
  font-size: 10px;
  color: #27e0b3;
  margin: 0;
}

.games-solo-game-card-divider {
  height: 1px;
  background: #1e2836;
  margin: 0;
  flex-shrink: 0;
}

.games-solo-game-card-stats-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}

.games-solo-game-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 8px 10px;
}

.games-solo-game-card-stat {
  background: #0e141c;
  border-radius: 6px;
  padding: 5px 7px;
}

.games-solo-game-card-stat-label {
  font-size: 9px;
  color: #4a5a6a;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.games-solo-game-card-stat-val {
  font-size: 13px;
  font-weight: 700;
  color: #e8eaed;
  margin-top: 1px;
}

.games-solo-game-card-no-stats {
  font-size: 10px;
  color: #4a5a6a;
  font-style: italic;
  padding: 8px 10px;
}

.games-solo-game-card-play-wrap {
  padding: 8px 10px 10px;
}

.games-solo-game-card-tag--solo { color: #27e0b3; }
.games-solo-game-card-tag--multi { color: #f0a040; }
.games-solo-game-card-tag--both { color: #9070e0; }

.games-solo-game-card-meta {
  display: none;
}

.games-solo-game-play-btn {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  border: none;
  background: #27e0b3;
  color: #08120f;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}

.games-solo-game-play-btn:hover {
  background: #22c9a0;
}

.games-solo-game-play-btn-icon {
  width: 14px;
  height: 14px;
  background: #08120f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.games-solo-game-play-btn-triangle {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 4px 0 4px 7px;
  border-color: transparent transparent transparent #27e0b3;
  margin-left: 1px;
}

.games-solo-mm-stats {
  display: none;
  width: 100%;
}

.games-solo-mm-stats-grid {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.games-solo-mm-stat {
  display: none;
  background: #0e141c;
  border-radius: 6px;
  padding: 5px 7px;
}

.games-solo-mm-stat--wide {
  display: none;
  grid-column: 1 / -1;
}

.games-solo-mm-stat-label {
  display: none;
  font-size: 9px;
  color: #4a5a6a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.games-solo-mm-stat-value {
  display: none;
  font-size: 13px;
  font-weight: 600;
  color: #e8eaed;
}

.games-solo-mm-stats-empty {
  display: none;
  font-size: 10px;
  color: #4a5a6a;
  font-style: italic;
  padding: 4px 0;
}
.games-solo-ad-mount {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}
.games-solo-ad-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10;
  padding: 24px;
}
.games-solo-ad-card {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  max-width: 300px;
  text-align: center;
}
.games-solo-ad-label {
  color: #666;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}
.games-solo-ad-title {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
}
.games-solo-ad-sub {
  color: #aaa;
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 14px;
}
.games-solo-ad-learn {
  display: inline-block;
  background: #1db88a;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.games-solo-ad-countdown {
  color: #555;
  font-size: 11px;
}
.games-memory-match-mount {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
}
.games-connect4-solo-mount {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 20px 24px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.games-momo-slide-mount {
  --ms-max-board: 520px;
  --ms-width-board: 88vw;
  --ms-height-board: calc(100dvh - 390px);
  flex: 1 1 auto;
  display: block;
  padding: clamp(8px, 1.7vh, 16px) 16px clamp(10px, 2vh, 18px);
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  min-height: 0;
  overflow: visible;
}
.ms-game {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  justify-items: center;
  justify-content: center;
  gap: clamp(6px, 1.35vh, 12px);
  color: #f7fbff;
}
.ms-game--select {
  grid-template-rows: minmax(0, 1fr);
}
.ms-difficulty-card {
  width: min(100%, 560px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(14px, 3vh, 22px);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 224, 162, 0.13), transparent 34%),
    rgba(14, 18, 24, 0.82);
  border: 1px solid rgba(255, 225, 173, 0.16);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}
.ms-hero--select {
  width: 100%;
}
.ms-difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ms-difficulty-btn {
  min-width: 0;
  border: 1px solid rgba(255, 218, 150, 0.24);
  border-radius: 16px;
  padding: 14px 12px;
  background:
    linear-gradient(180deg, rgba(255, 230, 174, 0.16), rgba(118, 74, 34, 0.18)),
    #171b22;
  color: #fff7df;
  cursor: pointer;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 193, 0.12),
    0 8px 20px rgba(0, 0, 0, 0.22);
  transition:
    transform 0.14s ease,
    border-color 0.14s ease,
    filter 0.14s ease;
}
.ms-difficulty-btn:hover,
.ms-difficulty-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(29, 184, 138, 0.65);
  outline: none;
  filter: brightness(1.04);
}
.ms-difficulty-btn--selected {
  border-color: #1db88a;
}
.ms-difficulty-name,
.ms-difficulty-desc {
  display: block;
}
.ms-difficulty-name {
  color: #c6ab85;
  font-size: 0.78rem;
  font-weight: 800;
}
.ms-difficulty-btn strong {
  display: block;
  margin-top: 4px;
  color: #1db88a;
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  line-height: 1;
}
.ms-difficulty-desc {
  margin-top: 8px;
  color: #ffe5b5;
  font-size: 0.82rem;
}
.ms-select-back {
  width: 100%;
}
.ms-hero {
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: clamp(9px, 1.45vh, 13px) 15px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 230, 174, 0.28), rgba(118, 74, 34, 0.16)),
    linear-gradient(145deg, #8a5a2d, #5f381c 68%, #3f2515);
  border: 1px solid rgba(255, 225, 173, 0.28);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.28),
    inset 0 2px 0 rgba(255, 235, 193, 0.24),
    inset 0 -4px 0 rgba(62, 35, 14, 0.28);
}
.ms-hero-mark {
  width: clamp(38px, 6vh, 46px);
  height: clamp(38px, 6vh, 46px);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, #ffe7aa, #d89a47),
    #e7b15f;
  color: #4a2a12;
  font-weight: 950;
  box-shadow:
    0 4px 0 rgba(71, 38, 13, 0.55),
    inset 0 1px 0 rgba(255, 247, 218, 0.72);
}
.ms-hero-copy {
  min-width: 0;
}
.ms-title {
  margin: 0;
  color: #fff7df;
  font-size: clamp(1.05rem, 2.8vw, 1.42rem);
  font-weight: 850;
  text-shadow: 0 2px 0 rgba(57, 31, 12, 0.62);
}
.ms-subtitle {
  margin: 2px 0 0;
  color: #ffe5b5;
  font-size: clamp(0.78rem, 1.7vh, 0.9rem);
}
.ms-hero-spark {
  font-size: 1.15rem;
  width: 28px;
  text-align: center;
}
.ms-mode-row {
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}
.ms-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(14, 18, 24, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ms-mode-btn {
  border: 0;
  border-radius: 10px;
  padding: 7px 12px;
  background: transparent;
  color: #c6ab85;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.ms-mode-btn--active {
  background: linear-gradient(180deg, #ffe0a2, #d99b4b);
  color: #4a2b14;
  box-shadow:
    0 3px 0 rgba(85, 47, 17, 0.42),
    inset 0 1px 0 rgba(255, 248, 223, 0.62);
}
.ms-mode-btn:focus-visible {
  outline: 2px solid rgba(29, 184, 138, 0.75);
  outline-offset: 2px;
}
.ms-preview {
  width: clamp(34px, 5.2vh, 44px);
  height: clamp(34px, 5.2vh, 44px);
  padding: 3px;
  border-radius: 10px;
  background: linear-gradient(145deg, #8b5428, #342013);
  border: 1px solid rgba(255, 218, 150, 0.26);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.24);
}
.ms-preview img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
}
.ms-hud {
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 7px;
}
.ms-hud-stat {
  min-width: 0;
  min-height: clamp(46px, 7vh, 56px);
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(14, 18, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.ms-hud-stat span {
  display: block;
  font-size: 0.68rem;
  color: #7d8b9d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ms-hud-stat strong {
  display: block;
  margin-top: 2px;
  color: #1db88a;
  font-size: clamp(0.9rem, 2.1vh, 1.02rem);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ms-new-btn {
  border: none;
  border-radius: 12px;
  padding: clamp(9px, 1.45vh, 11px) 16px;
  background: linear-gradient(180deg, var(--accent-primary-hover), var(--accent-primary));
  color: #08120f;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 10px 22px rgba(29, 184, 138, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition:
    transform 0.14s ease,
    filter 0.14s ease,
    box-shadow 0.14s ease;
}
.ms-new-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.ms-new-btn:active {
  transform: translateY(1px);
}
.ms-new-btn:focus-visible {
  outline: 2px solid rgba(255, 201, 107, 0.75);
  outline-offset: 3px;
}
.ms-new-btn--secondary {
  background: linear-gradient(180deg, #7b4b22, #513018);
  color: #fff3d1;
  border: 1px solid rgba(255, 223, 165, 0.24);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 231, 181, 0.2);
}
.ms-status {
  margin: -1px 0 0;
  color: #c6ab85;
  font-size: clamp(0.78rem, 1.7vh, 0.88rem);
  text-align: center;
}
.ms-board-wrap {
  align-self: center;
  width: min(var(--ms-max-board), var(--ms-width-board), max(0px, var(--ms-height-board)));
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  padding: clamp(7px, 1.4vw, 12px);
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(255, 240, 194, 0.1), transparent 18%, rgba(92, 51, 18, 0.12) 38%, transparent 58%, rgba(255, 233, 174, 0.08)),
    linear-gradient(145deg, #8b5428, #5b3519 62%, #342013);
  border: 1px solid rgba(255, 218, 150, 0.3);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.44),
    inset 0 3px 0 rgba(255, 232, 181, 0.22),
    inset 0 -7px 0 rgba(51, 28, 12, 0.38),
    inset 0 0 22px rgba(38, 20, 8, 0.42);
  overflow: hidden;
}
.ms-board {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--ms-size, 5), 1fr);
  grid-template-rows: repeat(var(--ms-size, 5), 1fr);
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #24282f;
}
.ms-tile {
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(84, 49, 20, 0.34);
  border-radius: 0;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.34), transparent 26%),
    linear-gradient(90deg, rgba(145, 86, 29, 0.08), transparent 24%, rgba(255, 240, 199, 0.16) 48%, transparent 76%),
    linear-gradient(180deg, #ffe0a2, #e0a454 56%, #c58436);
  background-origin: border-box;
  background-clip: border-box;
  color: #4a2b14;
  font-size: clamp(1rem, 4.6vw, 1.9rem);
  font-weight: 900;
  line-height: 1;
  cursor: default;
  box-shadow:
    inset 0 2px 0 rgba(255, 248, 223, 0.52),
    inset 0 -3px 0 rgba(116, 65, 22, 0.18),
    inset 1px 0 0 rgba(255, 248, 223, 0.16),
    inset -1px 0 0 rgba(82, 45, 17, 0.18);
  transition:
    transform 0.16s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    filter 0.14s ease;
  font-variant-numeric: tabular-nums;
}
.ms-game[data-ms-size="3"] .ms-tile {
  font-size: clamp(1.35rem, 7vw, 2.7rem);
}
.ms-game[data-ms-size="4"] .ms-tile {
  font-size: clamp(1.15rem, 5.8vw, 2.25rem);
}
.ms-tile--movable {
  cursor: pointer;
  border-color: rgba(29, 184, 138, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(29, 184, 138, 0.18),
    inset 0 2px 0 rgba(255, 248, 223, 0.58),
    inset 0 -3px 0 rgba(116, 65, 22, 0.2);
}
.ms-tile--movable:hover,
.ms-tile--movable:focus-visible {
  transform: translateY(-1px);
  border-color: #1db88a;
  outline: none;
  filter: brightness(1.04) saturate(1.05);
}
.ms-tile--movable:active {
  transform: translateY(1px) scale(0.992);
  box-shadow:
    inset 0 0 0 1px rgba(29, 184, 138, 0.14),
    inset 0 1px 0 rgba(255, 248, 223, 0.42);
}
.ms-tile--picture {
  position: relative;
  overflow: hidden;
  border-color: rgba(18, 20, 24, 0.34);
  background-repeat: no-repeat;
  background-origin: border-box;
  background-clip: border-box;
  color: transparent;
}
.ms-tile--picture::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 35%);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 223, 0.24);
}
.ms-picture-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  min-width: 1.35em;
  height: 1.35em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255, 247, 223, 0.86);
  color: #4a2b14;
  font-size: clamp(0.5rem, 1.5vw, 0.7rem);
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(38, 21, 8, 0.28);
  z-index: 1;
}
.ms-tile:disabled:not(.ms-tile--empty) {
  opacity: 0.95;
  filter: saturate(0.92);
}
.ms-tile--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.05), transparent 42%),
    linear-gradient(145deg, #2a2d34, #1c2026);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow:
    inset 0 7px 16px rgba(0, 0, 0, 0.62),
    inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}
.ms-empty-dot {
  width: 20%;
  height: 20%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}
.ms-empty-label {
  color: rgba(255, 255, 255, 0.48);
  font-size: clamp(0.45rem, 1.8vw, 0.62rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ms-complete {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 8, 12, 0.76);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.ms-complete--visible {
  opacity: 1;
  pointer-events: auto;
}
.ms-complete-card {
  width: min(320px, 92vw);
  padding: 24px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(29, 184, 138, 0.14), transparent 38%),
    #121820;
  border: 1px solid rgba(29, 184, 138, 0.32);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: ms-complete-pop 0.28s ease-out;
}
@keyframes ms-complete-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.ms-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ms-confetti span {
  position: absolute;
  width: 8px;
  height: 14px;
  border-radius: 3px;
  background: #ffc96b;
  opacity: 0.78;
  animation: ms-confetti-float 1.6s ease-in-out infinite;
}
.ms-confetti span:nth-child(1) {
  left: 18%;
  top: 18%;
}
.ms-confetti span:nth-child(2) {
  right: 20%;
  top: 15%;
  background: #1db88a;
  animation-delay: 0.25s;
}
.ms-confetti span:nth-child(3) {
  left: 50%;
  top: 9%;
  background: #7b9cff;
  animation-delay: 0.45s;
}
@keyframes ms-confetti-float {
  50% {
    transform: translateY(5px) rotate(14deg);
  }
}
.ms-complete-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1db88a, #ffc96b);
  color: #08120f;
  font-size: 1.35rem;
  font-weight: 900;
  animation: ms-complete-pulse 1.25s ease-in-out infinite;
}
@keyframes ms-complete-pulse {
  50% {
    transform: scale(1.06);
  }
}
.ms-complete-title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 1.35rem;
}
.ms-complete-score {
  color: #1db88a;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}
.ms-complete-score-label {
  margin: 3px 0 10px;
  color: #77869a;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ms-complete-sub {
  margin: 0 0 16px;
  color: #9fb0c4;
}
.ms-complete-save-status {
  margin: -4px 0 12px;
  color: #8b9cb3;
  font-size: 0.88rem;
}
.ms-complete-save-status--ok {
  color: #7dffb8;
}
.ms-complete-save-status--warn {
  color: #e8c070;
}
.ms-complete-record-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: -2px 0 14px;
}
.ms-complete-record-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #0d1720;
  background: linear-gradient(135deg, #ffc96b, #1db88a);
}
.ms-complete-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ms-actions {
  width: min(100%, 500px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.ms-new-btn--difficulty {
  background: linear-gradient(180deg, #ffe0a2, #d99b4b);
  color: #4a2b14;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 248, 223, 0.5);
}
@media (max-height: 760px) and (min-width: 721px) {
  .games-momo-slide-mount {
    --ms-max-board: 470px;
    --ms-width-board: 84vw;
    --ms-height-board: calc(100dvh - 375px);
    padding-top: 6px;
    padding-bottom: 8px;
  }
  .ms-game {
    gap: 5px;
  }
  .ms-hero {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .ms-hero-mark {
    width: 36px;
    height: 36px;
  }
  .ms-title {
    font-size: 1.06rem;
  }
  .ms-subtitle {
    font-size: 0.76rem;
  }
  .ms-hud-stat {
    min-height: 40px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .ms-status {
    font-size: 0.76rem;
  }
  .ms-new-btn {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .ms-mode-btn {
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 0.76rem;
  }
  .ms-preview {
    width: 34px;
    height: 34px;
  }
}
@media (max-height: 650px) and (min-width: 721px) {
  .games-momo-slide-mount {
    --ms-max-board: 400px;
    --ms-width-board: 80vw;
    --ms-height-board: calc(100dvh - 335px);
    padding-top: 4px;
    padding-bottom: 6px;
  }
  .ms-game {
    gap: 4px;
  }
  .ms-hero {
    padding: 6px 12px;
    border-radius: 13px;
  }
  .ms-hero-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .ms-title {
    font-size: 0.98rem;
  }
  .ms-subtitle,
  .ms-hero-spark {
    display: none;
  }
  .ms-mode-row {
    grid-template-columns: 1fr;
  }
  .ms-preview {
    display: none;
  }
  .ms-mode-toggle {
    padding: 3px;
  }
  .ms-mode-btn {
    padding: 4px 10px;
    font-size: 0.72rem;
  }
  .ms-hud-stat {
    min-height: 34px;
    padding: 3px 8px;
  }
  .ms-hud-stat span {
    font-size: 0.6rem;
  }
  .ms-hud-stat strong {
    font-size: 0.82rem;
  }
  .ms-status {
    font-size: 0.72rem;
  }
  .ms-board-wrap {
    padding: 7px;
    border-radius: 18px;
  }
  .ms-actions {
    gap: 8px;
  }
  .ms-new-btn {
    border-radius: 10px;
    padding: 7px 14px;
  }
}
@media (max-width: 420px) {
  .games-momo-slide-mount {
    --ms-max-board: 520px;
    --ms-width-board: 92vw;
    --ms-height-board: calc(100dvh - 465px);
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    height: 100%;
    overflow-y: visible;
  }
  .ms-game {
    justify-content: center;
    gap: 7px;
  }
  .ms-hero {
    padding: 9px 11px;
    border-radius: 16px;
  }
  .ms-hero-mark {
    width: 34px;
    height: 34px;
  }
  .ms-title {
    font-size: 1rem;
  }
  .ms-subtitle {
    font-size: 0.74rem;
  }
  .ms-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .ms-hud-stat {
    min-height: 38px;
    padding: 4px 8px;
  }
  .ms-status {
    font-size: 0.74rem;
  }
  .ms-mode-row {
    width: min(100%, 94vw);
  }
  .ms-mode-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .ms-preview {
    width: 34px;
    height: 34px;
  }
  .ms-tile {
    font-size: clamp(0.95rem, 6.2vw, 1.45rem);
  }
  .ms-actions {
    width: min(100%, 94vw);
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .ms-new-btn {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}
@media (max-width: 560px) {
  .ms-difficulty-grid {
    grid-template-columns: 1fr;
  }
  .ms-difficulty-card {
    gap: 10px;
  }
  .ms-difficulty-btn {
    padding: 11px 12px;
  }
}
@media (max-width: 420px) and (max-height: 760px) {
  .games-momo-slide-mount {
    --ms-height-board: calc(100dvh - 425px);
    padding-top: 6px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .ms-game {
    gap: 5px;
  }
  .ms-hero {
    padding: 7px 10px;
  }
  .ms-hero-mark {
    width: 30px;
    height: 30px;
  }
  .ms-subtitle,
  .ms-hero-spark {
    display: none;
  }
  .ms-preview {
    display: none;
  }
  .ms-mode-row {
    grid-template-columns: 1fr;
  }
  .ms-hud-stat {
    min-height: 34px;
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .ms-new-btn {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ms-tile,
  .ms-new-btn,
  .ms-complete-card,
  .ms-complete-mark,
  .ms-confetti span {
    animation: none;
    transition: none;
  }
}
.c4solo-select-screen,
.cksolo-select-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.c4solo-difficulty-card,
.cksolo-difficulty-card {
  width: min(100%, 520px);
  background: #121820;
  border: 1px solid #2a3444;
  border-radius: 16px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.c4solo-difficulty-hero,
.cksolo-difficulty-hero {
  text-align: center;
}

.c4solo-difficulty-eyebrow,
.cksolo-difficulty-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #27e0b3;
  margin-bottom: 6px;
}

.c4solo-difficulty-hero h2,
.cksolo-difficulty-hero h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.c4solo-difficulty-hero p,
.cksolo-difficulty-hero p {
  font-size: 13px;
  color: #6b7d94;
  line-height: 1.4;
}

.c4solo-difficulty-grid,
.cksolo-difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.c4solo-difficulty-btn,
.cksolo-difficulty-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  background: #0e141c;
  border: 1px solid #2a3444;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.c4solo-difficulty-btn:hover,
.cksolo-difficulty-btn:hover {
  border-color: rgba(39, 224, 179, 0.5);
  background: rgba(39, 224, 179, 0.06);
}

.c4solo-difficulty-name,
.cksolo-difficulty-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.c4solo-difficulty-meta,
.cksolo-difficulty-meta {
  font-size: 11px;
  color: #27e0b3;
  font-weight: 600;
}

.c4solo-difficulty-desc,
.cksolo-difficulty-desc {
  font-size: 11px;
  color: #6b7d94;
  line-height: 1.3;
}

.c4solo-back-btn,
.cksolo-back-btn {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid #2a3444;
  color: #6b7d94;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
}

.c4solo-back-btn:hover,
.cksolo-back-btn:hover {
  border-color: rgba(39, 224, 179, 0.3);
  color: #c5d0de;
}

.c4solo-game {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  width: 100%;
  max-width: 100%;
}
.c4solo-game-head {
  display: none;
}
.c4solo-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.c4solo-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(12, 18, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
}
.c4solo-stat-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.c4solo-stat strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f4f8ff;
  font-variant-numeric: tabular-nums;
}
.c4solo-turn-banner {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-sizing: border-box;
  border: 1px solid transparent;
}
.c4solo-turn-banner--hidden {
  display: none !important;
}
.c4solo-turn-banner--yours {
  color: #b8ffe0;
  background: linear-gradient(180deg, rgba(24, 72, 58, 0.95) 0%, rgba(14, 40, 34, 0.98) 100%);
  border-color: rgba(39, 224, 179, 0.35);
  box-shadow: 0 0 20px rgba(39, 224, 179, 0.12);
}
.c4solo-turn-banner--cpu,
.c4solo-turn-banner--pending {
  color: #c5d4ee;
  background: linear-gradient(180deg, rgba(28, 36, 56, 0.95) 0%, rgba(16, 22, 36, 0.98) 100%);
  border-color: rgba(255, 255, 255, 0.1);
}
.c4solo-turn-piece {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.c4solo-players-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.c4solo-player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.c4solo-player-card.connect4-player--turn {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 20px rgba(0, 0, 0, 0.22);
}
.c4solo-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
  padding: 0 2px;
}
.c4solo-player-card .connect4-player-name {
  font-size: 0.75rem;
  text-align: center;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
  width: 100%;
}
.c4solo-loading {
  padding: 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}
.c4solo-complete {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 14, 0.82);
  backdrop-filter: blur(6px);
  z-index: 12;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.c4solo-complete--visible {
  opacity: 1;
  pointer-events: auto;
}
.c4solo-complete-card {
  position: relative;
  width: min(100%, 360px);
  padding: 28px 24px 22px;
  border-radius: 18px;
  background: linear-gradient(165deg, #1a2838 0%, #101820 100%);
  border: 1px solid rgba(39, 224, 179, 0.28);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(39, 224, 179, 0.1);
  text-align: center;
  overflow: hidden;
  animation: c4solo-complete-in 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}
@keyframes c4solo-complete-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.c4solo-complete-glow {
  position: absolute;
  top: -40%;
  left: 50%;
  width: 140%;
  height: 80%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(39, 224, 179, 0.32) 0%, transparent 70%);
  pointer-events: none;
}
.c4solo-complete--loss .c4solo-complete-glow {
  background: radial-gradient(ellipse, rgba(255, 120, 120, 0.22) 0%, transparent 70%);
}
.c4solo-complete--tie .c4solo-complete-glow {
  background: radial-gradient(ellipse, rgba(140, 160, 255, 0.22) 0%, transparent 70%);
}
.c4solo-complete-mascot {
  position: relative;
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 10px rgba(255, 220, 120, 0.45));
}
.c4solo-complete--win .c4solo-complete-mascot {
  animation: c4solo-mascot-bob 1.2s ease-in-out infinite;
}
@keyframes c4solo-mascot-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
.c4solo-complete-title {
  position: relative;
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.c4solo-complete--win .c4solo-complete-title {
  color: #7dffb8;
}
.c4solo-complete--loss .c4solo-complete-title {
  color: #ff9a9a;
}
.c4solo-complete--tie .c4solo-complete-title {
  color: #c8d4ff;
}
.c4solo-complete-sub {
  position: relative;
  margin: 0 0 8px;
  color: #8b9cb3;
  font-size: 0.88rem;
}
.c4solo-complete-stats {
  position: relative;
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.c4solo-complete-save-status {
  position: relative;
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: #8b9cb3;
}
.c4solo-complete-save-status--ok {
  color: #7dffb8;
}
.c4solo-complete-save-status--warn {
  color: #e8c070;
}
.c4solo-complete-record-badges {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 12px;
}
.c4solo-complete-record-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1a2838;
  background: linear-gradient(135deg, #ffe98a 0%, #27e0b3 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.c4solo-complete-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.c4solo-complete-difficulty {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 4px;
}

.c4solo-complete-diff-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.c4solo-complete-diff-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.c4solo-complete-diff-btn {
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid #2a3444;
  background: #0e141c;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.c4solo-complete-diff-btn:hover {
  border-color: rgba(39,224,179,0.4);
  background: rgba(39,224,179,0.06);
  color: #fff;
}

.c4solo-complete-diff-btn--active {
  border-color: rgba(39,224,179,0.6);
  background: rgba(39,224,179,0.12);
  color: #27e0b3;
}

.c4solo-btn {
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1 1 140px;
  max-width: 220px;
}
.c4solo-btn--primary {
  background: linear-gradient(135deg, #27e0b3 0%, #1a9fd4 100%);
  color: #0a1218;
}
.c4solo-btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e8eef8;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.c4solo-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(39, 224, 179, 0.35);
}
@media (max-width: 420px) {
  .c4solo-complete-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .c4solo-complete-actions .c4solo-btn {
    max-width: none;
    flex: 1 1 auto;
  }
}
.games-connect4-solo-mount .c4solo-layout {
  --connect4-board-width: 320px;
  --connect4-slot-size: calc(var(--connect4-board-width) / 7);
  --connect4-disc-size: calc(var(--connect4-slot-size) * 0.82);
  --connect4-frame-pad: clamp(6px, 1vmin, 10px);
  display: grid;
  grid-template-columns: 1fr 260px;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.c4solo-board-area {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 8px 8px 8px 12px;
  gap: 8px;
}

.c4solo-sidebar {
  background: rgba(16, 20, 16, 0.97);
  border-left: 1px solid #1e2836;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 10px;
  overflow-y: auto;
  align-self: start;
  position: sticky;
  top: 0;
}

.c4solo-sidebar-divider {
  height: 1px;
  background: #1e2836;
  flex-shrink: 0;
}

.c4solo-stat-block {
  background: #0e141c;
  border: 1px solid #1e2836;
  border-radius: 8px;
  padding: 8px 10px;
}

.c4solo-stat-label {
  font-size: 9px;
  color: #4a5a6a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.c4solo-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.c4solo-sidebar-restart-btn {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  background: #27e0b3;
  color: #08120f;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.c4solo-sidebar-restart-btn:hover {
  background: #22c9a0;
}

.games-connect4-solo-mount .connect4-panel {
  max-width: 100%;
}

.games-connect4-solo-mount .c4solo-board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0;
  box-sizing: border-box;
}
.games-connect4-solo-mount .c4solo-board-frame {
  flex-shrink: 0;
  max-height: none;
  width: var(--connect4-board-width, 320px);
  max-width: calc(100% - 8px);
  margin: 0 auto;
  box-sizing: border-box;
  overflow: visible;
}
.games-connect4-solo-mount .c4solo-board-inner {
  width: 100%;
  box-sizing: border-box;
}
.games-connect4-solo-mount .c4solo-board-columns {
  width: 100%;
  box-sizing: border-box;
}
.games-connect4-solo-mount .c4solo-col-hits,
.games-connect4-solo-mount .c4solo-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  box-sizing: border-box;
}
.games-connect4-solo-mount .c4solo-col-hits {
  margin-bottom: 4px;
}
.games-connect4-solo-mount .c4solo-col-hits .connect4-col-hit {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: calc(var(--connect4-slot-size) * 0.52);
  margin: 0;
  padding: 0;
  overflow: visible;
}
.games-connect4-solo-mount .c4solo-col-hits .connect4-col-ghost {
  margin: 0 auto;
  flex-shrink: 0;
  opacity: 0;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
/* All 7 previews visible on player turn */
.games-connect4-solo-mount .c4solo-col-hits--active .connect4-col-ghost--visible {
  opacity: 0.26;
  transform: translateY(3px) scale(1);
}
.games-connect4-solo-mount .c4solo-col-hits--active .connect4-col-hit--full .connect4-col-ghost--visible {
  opacity: 0.14;
}
/* Hovered legal column — brighter and slightly larger */
.games-connect4-solo-mount .c4solo-col-hits--active .connect4-col-hit--available:hover .connect4-col-ghost--visible,
.games-connect4-solo-mount .c4solo-col-hits--active .connect4-col-hit--available.c4solo-col-hit--hover .connect4-col-ghost--visible {
  opacity: 0.55;
  transform: translateY(3px) scale(1.1);
}
.games-connect4-solo-mount .c4solo-col-hits--active .connect4-col-hit--available:active .connect4-col-ghost--visible {
  opacity: 0.65;
  transform: translateY(5px) scale(1.12);
}
.games-connect4-solo-mount .c4solo-board-wrap.c4solo-board--locked .connect4-col-ghost--visible {
  opacity: 0 !important;
  transform: none !important;
}
.games-connect4-solo-mount .c4solo-board-wrap.c4solo-board--locked .c4solo-col-hits {
  pointer-events: none;
}
.games-connect4-solo-mount .c4solo-board-wrap.c4solo-board--locked .connect4-col-hit--available {
  cursor: default;
}
.games-connect4-solo-mount .c4solo-grid .connect4-slot--win .connect4-slot-hole {
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.65),
    inset 0 -1px 2px rgba(255, 255, 255, 0.06),
    0 0 12px rgba(255, 220, 100, 0.45);
}
.games-connect4-solo-mount .c4solo-grid .connect4-disc--win {
  animation: connect4-win-glow 1.1s ease-in-out infinite;
}
.games-connect4-solo-mount .c4solo-grid .connect4-disc--o.connect4-disc--win {
  animation-name: connect4-win-glow-o;
}
.games-connect4-solo-mount .connect4-disc--drop {
  animation: connect4-disc-drop 0.44s cubic-bezier(0.34, 0.72, 0.45, 1) forwards;
}
.games-connect4-solo-mount .c4solo-grid {
  min-height: calc(var(--connect4-slot-size, 45px) * 6);
}
.games-connect4-solo-mount .c4solo-grid .connect4-slot {
  min-width: 0;
}
@media (prefers-reduced-motion: reduce) {
  .games-connect4-solo-mount .connect4-disc--drop,
  .games-connect4-solo-mount .c4solo-grid .connect4-disc--win,
  .c4solo-complete--win .c4solo-complete-mascot,
  .c4solo-complete-card {
    animation: none !important;
  }
}

@media (max-width: 640px) {
  .games-connect4-solo-mount .c4solo-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .c4solo-sidebar {
    grid-row: 1;
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-bottom: 1px solid #1e2836;
    align-self: auto;
    position: static;
  }
}

.mm-game {
  display: grid;
  grid-template-columns: 1fr 220px;
  grid-template-rows: 1fr;
  flex: 1;
  min-height: 0;
  gap: 0;
  height: 100%;
  position: relative;
}
.mm-hud {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 14px;
  background: rgba(16, 20, 16, 0.97);
  border-left: 1px solid #1e2836;
  align-self: start;
  position: sticky;
  top: 0;
}
.mm-hud-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mm-hud-pill {
  display: flex;
  flex-direction: column;
  background: #0e141c;
  border: 1px solid #1e2836;
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}
.mm-hud-pill--score {
  border-color: rgba(39, 224, 179, 0.28);
  background: linear-gradient(135deg, rgba(39, 224, 179, 0.12), rgba(0, 0, 0, 0.2));
}
.mm-hud-pill--score .mm-hud-value {
  color: #5eecc4;
}
.mm-hud-label {
  font-size: 9px;
  color: #4a5a6a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.mm-hud-value {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.mm-hud-restart {
  width: 100%;
}
.mm-hint {
  display: none;
}
.mm-restart-btn {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  background: #27e0b3;
  color: #08120f;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.mm-restart-btn:hover {
  background: #22c9a0;
}
.mm-restart-btn--primary {
  width: 100%;
  margin-top: 12px;
  padding: 13px 16px;
  border: none;
  background: linear-gradient(180deg, var(--accent-primary-hover), var(--accent-primary));
  color: #08120f;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(39, 224, 179, 0.25);
}
.mm-board-wrap {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.mm-board-sparkles {
  pointer-events: none;
  position: absolute;
  inset: -8px;
  z-index: 2;
  opacity: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 220, 120, 0.5) 0%, transparent 8px),
    radial-gradient(circle at 75% 25%, rgba(94, 236, 196, 0.45) 0%, transparent 7px),
    radial-gradient(circle at 55% 70%, rgba(255, 180, 100, 0.4) 0%, transparent 9px),
    radial-gradient(circle at 30% 80%, rgba(120, 200, 255, 0.35) 0%, transparent 6px);
  transition: opacity 0.2s ease;
}
.mm-board-wrap--sparkle .mm-board-sparkles {
  opacity: 1;
  animation: mm-sparkle-fade 0.65s ease-out forwards;
}
@keyframes mm-sparkle-fade {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  35% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.04);
  }
}
.mm-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 11px);
  width: 100%;
  max-width: min(calc((100vh - 80px) * 0.8), 680px);
  position: relative;
  z-index: 1;
}
.mm-card {
  aspect-ratio: 4 / 5;
  min-height: 0;
  cursor: pointer;
  perspective: 600px;
  border: none;
  background: transparent;
  padding: 0;
}
.mm-card:hover:not(:disabled):not(.matched) {
  filter: drop-shadow(0 8px 16px rgba(39, 224, 179, 0.2));
}
.mm-card:disabled {
  cursor: default;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}
.mm-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.34, 1.15, 0.64, 1);
  transform-style: preserve-3d;
  border-radius: 12px;
  will-change: transform;
}
.mm-card.flipped .mm-card-inner,
.mm-card.matched .mm-card-inner {
  transform: rotateY(180deg) scale(1.03);
}
.mm-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  box-sizing: border-box;
}
.mm-card-back {
  background-color: #152238;
  background-image: url('/images/card.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid rgba(94, 236, 196, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -12px 24px rgba(0, 0, 0, 0.35);
}
.mm-game--card-back-fallback .mm-card-back {
  background-image: none;
  background: linear-gradient(155deg, #1f8f7a 0%, #0f5c6e 42%, #152238 100%);
}
.mm-card-back-shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.22) 0%, transparent 42%, transparent 100%);
  pointer-events: none;
}
.mm-card-back-fallback {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.mm-game--card-back-fallback .mm-card-back-fallback {
  display: flex;
}
.mm-card-back-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.9) 1px, transparent 1px);
  background-size: 10px 10px;
  pointer-events: none;
}
.mm-card-back-mark {
  position: relative;
  z-index: 1;
  font-size: 1.75rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.mm-card-back-label {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.mm-card-front {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #1a2438 0%, #121a28 100%);
  border: 2px solid #3a4d66;
  padding: 7px 7px 5px;
  gap: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.mm-card-portrait {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.mm-card-img {
  width: 100%;
  height: 100%;
  min-height: 48px;
  object-fit: cover;
  object-position: center top;
  border-radius: 6px;
  display: block;
}
.mm-card-initial {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2d4a6e, #1a2838);
  font-size: 1.5rem;
  font-weight: 800;
  color: #a8dcff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.mm-card-name {
  font-size: 0.62rem;
  font-weight: 600;
  color: #b8c8dc;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}
.mm-card.matched .mm-card-front {
  border-color: rgba(94, 236, 196, 0.75);
  box-shadow:
    0 0 0 2px rgba(39, 224, 179, 0.25),
    0 0 20px rgba(39, 224, 179, 0.35),
    inset 0 0 12px rgba(39, 224, 179, 0.08);
}
.mm-card.matched {
  filter: drop-shadow(0 6px 14px rgba(39, 224, 179, 0.25));
}
.mm-card.mm-card--match-pop .mm-card-inner {
  animation: mm-match-pop 0.52s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes mm-match-pop {
  0% {
    transform: rotateY(180deg) scale(1.03);
  }
  45% {
    transform: rotateY(180deg) scale(1.1);
  }
  100% {
    transform: rotateY(180deg) scale(1.03);
  }
}
.mm-card.mm-card--shake .mm-card-inner {
  animation: mm-mismatch-shake 0.48s ease-in-out;
}
@keyframes mm-mismatch-shake {
  0%,
  100% {
    transform: rotateY(180deg) scale(1.03) translateX(0);
  }
  20% {
    transform: rotateY(180deg) scale(1.03) translateX(-5px);
  }
  40% {
    transform: rotateY(180deg) scale(1.03) translateX(5px);
  }
  60% {
    transform: rotateY(180deg) scale(1.03) translateX(-4px);
  }
  80% {
    transform: rotateY(180deg) scale(1.03) translateX(4px);
  }
}
.mm-complete {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 14, 0.82);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.mm-complete--visible {
  opacity: 1;
  pointer-events: auto;
}
.mm-complete-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 28px 24px 22px;
  border-radius: 18px;
  background: linear-gradient(165deg, #1a2838 0%, #101820 100%);
  border: 1px solid rgba(39, 224, 179, 0.35);
  text-align: center;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(39, 224, 179, 0.12);
  overflow: hidden;
  animation: mm-win-card-in 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}
@keyframes mm-win-card-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.mm-complete-glow {
  position: absolute;
  top: -40%;
  left: 50%;
  width: 140%;
  height: 80%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(39, 224, 179, 0.35) 0%, transparent 70%);
  pointer-events: none;
}
.mm-complete-mascot {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 12px rgba(255, 220, 120, 0.5));
  animation: mm-mascot-bob 1.2s ease-in-out infinite;
}
@keyframes mm-mascot-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
.mm-complete-title {
  position: relative;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.mm-complete-sub {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: #8b9cb3;
}
.mm-complete-score {
  position: relative;
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent-primary);
  line-height: 1;
  text-shadow: 0 0 24px rgba(39, 224, 179, 0.45);
  font-variant-numeric: tabular-nums;
}
.mm-complete-save-status {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  color: var(--muted, #8a8a9a);
  text-align: center;
  min-height: 1.25rem;
}

.mm-complete-save-status--ok {
  color: #1db88a;
}

.mm-complete-save-status--warn {
  color: #c9a227;
}

.mm-complete-record-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
  min-height: 0;
}

.mm-complete-record-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a1428;
  background: linear-gradient(135deg, #ffe08a 0%, #ffb347 100%);
  box-shadow: 0 0 12px rgba(255, 200, 80, 0.35);
}

.mm-complete-personal-bests {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted, #8a8a9a);
  text-align: center;
}

.mm-complete-score-label {
  font-size: 0.82rem;
  color: #7f92a8;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.mm-final-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.mm-final-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: #6d7f96;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 72px;
}
.mm-final-stat strong {
  font-size: 1.05rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.mm-loading {
  text-align: center;
  color: #7f92a8;
  padding: 40px 16px;
}

@media (prefers-reduced-motion: reduce) {
  .mm-card-inner,
  .mm-card.mm-card--match-pop .mm-card-inner,
  .mm-card.mm-card--shake .mm-card-inner,
  .mm-complete-card,
  .mm-complete-mascot,
  .mm-board-wrap--sparkle .mm-board-sparkles,
  .games-solo-game-card {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .mm-card.flipped .mm-card-inner,
  .mm-card.matched .mm-card-inner {
    transform: rotateY(180deg);
  }
}

@media (max-width: 640px) {
  .mm-game {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .mm-hud {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-bottom: 1px solid #1e2836;
    padding: 10px 12px;
  }
  .mm-hud-stats {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .mm-hud-pill {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
  }
  .mm-board-wrap {
    grid-column: 1;
    grid-row: 2;
    padding: 8px;
  }
  .mm-card {
    min-height: 0;
  }
  .games-solo-title-wrap {
    order: 3;
    width: 100%;
    text-align: left;
  }
}

/* ─── Games: Progress strip — merged lead (points + rank) | period stats grid ─── */
.games-progress-period-toolbar {
  flex-shrink: 0;
}
.games-progress-period-tabs.games-period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.games-stats-strip-section .games-progress-period-tabs .games-period-tab {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.072);
  background: rgba(0, 0, 0, 0.2);
}
.games-stats-strip-section .games-progress-period-tabs .games-period-tab--active {
  border-color: rgba(39, 224, 179, 0.32);
  color: rgba(160, 250, 220, 0.95);
  background: rgba(39, 224, 179, 0.09);
}

/* ─── Games hub: section titles below featured (quiet) ─── */
.games-page .games-section-title:not(.games-section-title--featured) {
  margin: 0 0 8px;
  font-size: 0.93rem;
  font-weight: 600;
  color: rgba(220, 224, 230, 0.72);
  letter-spacing: -0.01em;
}

/* Light stat de-emphasis under Games hub */
.games-page .games-stats-grid-2 {
  margin-top: 6px;
  margin-bottom: 18px;
  gap: 12px;
  opacity: 0.91;
}
.games-page .games-stat-card {
  background: rgba(10, 12, 16, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.032);
  box-shadow:
    0 1px 8px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.012);
  padding: 14px 14px;
  border-radius: 10px;
}
.games-page .games-stat-card-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.88;
}
.games-page .games-stat-card-value {
  opacity: 0.82;
  color: rgba(229, 231, 235, 0.72);
  font-size: 1.55rem;
  font-weight: 700;
}
.games-page .games-mini-row {
  color: rgba(199, 204, 214, 0.58);
  font-size: 0.8rem;
  padding: 4px 0;
}
.games-page .games-lb-section {
  gap: 10px;
  margin-bottom: 4px;
}
.games-page .games-lb-card {
  padding: 10px 10px;
  background: rgba(12, 13, 16, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}
.games-page .games-lb-card-title {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(186, 192, 204, 0.68);
}
.games-page .games-lb-tabs {
  gap: 3px;
  margin-bottom: 6px;
}
.games-page .games-lb-tabs button {
  padding: 3px 7px;
  font-size: 0.68rem;
  border-radius: 4px;
}
.games-page .games-lb-row {
  padding: 5px 5px;
  font-size: 0.78rem;
  border-radius: 5px;
}
.games-page .games-lb-rank {
  min-width: 32px;
  color: rgba(140, 152, 168, 0.78);
}
.games-page .games-lb-you {
  background: rgba(39, 224, 179, 0.06);
  border: 1px solid rgba(39, 224, 179, 0.16);
}
.games-page .games-lb-you-badge {
  background: rgba(39, 224, 179, 0.38);
  font-size: 0.65rem;
  padding: 2px 5px;
}
.games-page .games-lb-pts {
  color: rgba(205, 210, 218, 0.7);
  font-weight: 600;
  font-size: 0.78rem;
}

.games-stats-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 720px) {
  .games-stats-grid-2 {
    grid-template-columns: 1fr;
  }
}
.games-stat-card {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 12px;
  padding: 18px;
}
.games-stat-card-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.games-stat-card-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
}
.games-rank-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 184, 148, 0.2);
  color: #00b894;
  font-size: 0.85rem;
  font-weight: 700;
}
.games-rank-bar {
  height: 8px;
  border-radius: 999px;
  background: #1e1e1e;
  margin-top: 14px;
  overflow: hidden;
}
.games-rank-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #00b894;
  transition: width 0.35s ease;
}
.games-rank-next {
  font-size: 0.8rem;
  margin-top: 8px;
  color: #8b9cb3;
}
.games-period-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.games-period-tab {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  background: #0d0d0d;
  color: #8b9cb3;
  cursor: pointer;
  font-size: 0.85rem;
}
.games-period-tab--active {
  border-color: #00b894;
  color: #00b894;
}
.games-mini-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #1a1a1a;
  font-size: 0.9rem;
}
.games-section-title {
  font-size: 1.05rem;
  margin: 0 0 12px;
  color: #fff;
}

.games-action-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.games-action-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  border: none;
}

.games-action-btn--primary {
  background: #27e0b3;
  color: #08120f;
}

.games-action-btn--primary:hover {
  background: #22c9a0;
}

.games-action-btn--secondary {
  background: rgba(39, 224, 179, 0.08);
  color: #27e0b3;
  border: 1px solid rgba(39, 224, 179, 0.3);
}

.games-action-btn--secondary:hover {
  background: rgba(39, 224, 179, 0.14);
}

.games-all-games-section {
  margin-bottom: 28px;
}

.games-all-games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 900px) {
  .games-all-games-grid { grid-template-columns: repeat(3, 1fr); }
}

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

.games-all-game-tile {
  background: #121820;
  border: 1px solid #2a3444;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
  padding: 0;
  font: inherit;
  text-align: left;
}

.games-all-game-tile:hover {
  border-color: rgba(39, 224, 179, 0.4);
  transform: translateY(-2px);
}

.games-all-game-tile-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: #0e141c;
  flex-shrink: 0;
}

.games-all-game-tile--memory .games-all-game-tile-thumb { background: url('/images/game-icons/memorymatch.webp') center/cover no-repeat; }
.games-all-game-tile--trivia .games-all-game-tile-thumb { background: url('/images/game-icons/trivia.webp') center/cover no-repeat; }
.games-all-game-tile--rps .games-all-game-tile-thumb { background: url('/images/game-icons/rockpaperscissors.webp') center/cover no-repeat; }
.games-all-game-tile--jigsaw .games-all-game-tile-thumb { background: url('/images/game-icons/jigsaw.webp') center/cover no-repeat; }
.games-all-game-tile--checkers .games-all-game-tile-thumb { background: url('/images/game-icons/checkers.webp') center/cover no-repeat; }
.games-all-game-tile--momo-slide .games-all-game-tile-thumb { background: url('/images/game-icons/momoslide.webp') center/cover no-repeat; }
.games-all-game-tile--connect4 .games-all-game-tile-thumb { background: url('/images/game-icons/momo4.webp') center/cover no-repeat; }
.games-all-game-tile--tictactoe .games-all-game-tile-thumb { background: url('/images/game-icons/tictactoe.webp') center/cover no-repeat; }
.games-all-game-tile--triviatictactoe .games-all-game-tile-thumb { background: url('/images/game-icons/triviatictactoe.webp') center/cover no-repeat; }
.games-all-game-tile--compatibilityquiz .games-all-game-tile-thumb { background: url('/images/game-icons/compatibilityquiz.webp') center/cover no-repeat; }

.games-all-game-tile-info {
  padding: 8px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.games-all-game-tile-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.games-all-game-tile-tag {
  font-size: 10px;
  color: #4a6a5a;
}

.games-all-game-tile-tag--solo { color: #27e0b3; }
.games-all-game-tile-tag--multi { color: #f0a040; }
.games-all-game-tile-tag--both { color: #9070e0; }

.games-stats-strip-section {
  margin-bottom: 28px;
}

.games-stats-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: linear-gradient(145deg, #12121a 0%, #0d1118 100%);
  border: 1px solid #1e2836;
  border-radius: 14px;
  padding: 20px;
}

@media (max-width: 600px) {
  .games-stats-strip { grid-template-columns: 1fr; }
}

.games-stats-balance-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7d94;
  margin-bottom: 4px;
}

.games-stats-balance-val {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}

.games-stats-rank-row {
  margin-bottom: 10px;
}

.games-stats-rank-pill {
  font-size: 11px;
  font-weight: 600;
  color: #27e0b3;
  background: rgba(39, 224, 179, 0.1);
  border: 1px solid rgba(39, 224, 179, 0.25);
  border-radius: 20px;
  padding: 3px 10px;
}

.games-stats-balance-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.games-stats-balance-left {
  flex: 1;
  min-width: 0;
}

.games-stats-progress-wrap {
  margin-bottom: 6px;
}

.games-stats-progress-bar {
  height: 4px;
  background: #1e2836;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.games-stats-progress-fill {
  height: 100%;
  background: #27e0b3;
  border-radius: 2px;
  width: 0%;
  transition: width 0.6s ease;
}

.games-stats-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #4a5a6a;
}

.games-stats-lifetime {
  font-size: 10px;
  color: #4a5a6a;
  margin-top: 4px;
}

.games-stats-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.games-stats-mini-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #1e2836;
  border-radius: 8px;
  padding: 8px;
}

.games-stats-mini-val {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.games-stats-mini-label {
  font-size: 10px;
  color: #4a5a6a;
  margin-top: 2px;
}

.games-topbar-pts {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(39, 224, 179, 0.08);
  border: 1px solid rgba(39, 224, 179, 0.2);
  border-radius: 20px;
  padding: 5px 12px;
}

.games-topbar-pts-coin {
  width: 12px;
  height: 12px;
  background: #27e0b3;
  border-radius: 50%;
  flex-shrink: 0;
}

.games-topbar-pts-val {
  font-size: 13px;
  font-weight: 700;
  color: #27e0b3;
}

.games-topbar-pts-label {
  font-size: 10px;
  color: #4a7a6a;
}

.games-topbar-rank-pill {
  font-size: 11px;
  color: #f0c040;
  background: rgba(240, 192, 64, 0.1);
  border: 1px solid rgba(240, 192, 64, 0.25);
  border-radius: 12px;
  padding: 4px 10px;
}

.games-lb-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .games-lb-section { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .games-lb-section { grid-template-columns: 1fr; }
}

.games-muted {
  color: #666;
  font-size: 0.9rem;
  padding: 8px;
}

.games-lb-metric-tabs {
  margin-bottom: 6px;
}
.games-lb-period-tabs {
  margin-bottom: 12px;
}
.games-lb-card {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 12px;
  padding: 16px;
}
.games-lb-card-title {
  margin: 0 0 10px;
  font-size: 1rem;
}
.games-lb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.games-lb-tabs button {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
  background: #0d0d0d;
  color: #8b9cb3;
  cursor: pointer;
  font-size: 0.78rem;
}
.games-lb-tabs button.active {
  border-color: #00b894;
  color: #00b894;
}
.games-lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.88rem;
}
.games-lb-you {
  background: rgba(0, 184, 148, 0.12);
  border: 1px solid rgba(0, 184, 148, 0.35);
}
.games-lb-rank {
  font-weight: 700;
  min-width: 36px;
  color: #8b9cb3;
}
.games-lb-rank--gold {
  color: #fbbf24;
}
.games-lb-rank--silver {
  color: #cbd5e1;
}
.games-lb-rank--bronze {
  color: #d97706;
}
.games-lb-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.games-lb-you-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #00b894;
  color: #0a0a0a;
  font-weight: 700;
  margin-left: 6px;
}
.games-lb-pts {
  font-weight: 700;
  color: #fff;
}

/* Mobile ad slot - hidden by default, shown on mobile */
.games-mobile-ad-slot {
  display: none;
  width: 100%;
  min-height: 100px;
  background: transparent;
  margin: 12px 0;
  text-align: center;
}

@media (max-width: 768px) {

  /* Hide the right ad rail on mobile - too narrow for sidebar */
  .profile-page-v2.games-page-v2-layout .profile-v2-ad-rail {
    display: none !important;
  }

  /* Make the main content fill full width since rail is hidden */
  .profile-page-v2.games-page-v2-layout .profile-v2-content-columns--games {
    grid-template-columns: 1fr !important;
  }

  /* Tighten shell padding on mobile */
  .profile-page-v2.games-page-v2-layout .profile-v2-shell--games {
    padding: 12px 12px 48px;
  }

  /* Stats strip: stack to single column */
  .games-stats-strip {
    grid-template-columns: 1fr;
  }

  /* Action row: stack buttons vertically */
  .games-action-row {
    flex-direction: column;
    gap: 10px;
  }

  .games-action-btn {
    width: 100%;
  }

  /* All games grid: 3 columns on mobile */
  .games-all-games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  /* Leaderboards: stack to single column */
  .games-leaderboards-grid {
    grid-template-columns: 1fr;
  }

  /* Topbar: make points and rank smaller */
  .games-topbar-points {
    font-size: 13px;
  }

  /* Single player grid: 3 columns */
  .games-solo-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Show inline mobile ad slot */
  .games-mobile-ad-slot {
    display: block;
  }

  /* Hide desktop topbar rank on very small screens */
  .games-topbar-rank-badge-img {
    display: none;
  }
}

@media (max-width: 480px) {
  /* 2 columns on very small phones */
  .games-all-games-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .games-solo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.games-match-screen {
  min-height: 100vh;
  background: #0a0a0a;
  color: #e8eaed;
  display: flex;
  flex-direction: column;
}
.games-match-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #111;
  border-bottom: 1px solid #1e1e1e;
}
.games-match-logo {
  font-weight: 800;
  color: #fff;
}
.games-match-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.games-leave-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #1a1a1a;
  color: #e8eaed;
  cursor: pointer;
  font-size: 0.88rem;
}
.games-match-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 580px) 1fr;
  min-height: 520px;
  max-height: calc(100vh - 52px);
}
@media (max-width: 900px) {
  .games-match-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(200px, 40vh) 1fr;
  }
  .games-panel-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.games-match-chat {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e1e1e;
  background: #0d0d0d;
  min-height: 0;
  position: relative;
  z-index: 1;
  pointer-events: auto !important;
  opacity: 1 !important;
}
.games-match-chat input,
.games-match-chat button {
  pointer-events: auto !important;
  opacity: 1 !important;
}
.games-match-chat-header {
  padding: 12px 14px;
  font-weight: 600;
  border-bottom: 1px solid #1e1e1e;
}
.games-match-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.games-msg-row {
  display: flex;
}
.games-msg-row--you {
  justify-content: flex-end;
}
.games-msg-row--them {
  justify-content: flex-start;
}
.games-msg-bubble {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
}
.games-msg-bubble--you {
  background: #00b894;
  color: #0a0a0a;
}
.games-msg-bubble--them {
  background: #1e1e1e;
  color: #e8eaed;
}
.games-msg-sender {
  font-size: 0.72rem;
  color: #8b9cb3;
  margin-bottom: 4px;
}
.games-msg-text {
  word-break: break-word;
}
.games-match-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #1e1e1e;
  position: relative;
  z-index: 2;
}
.games-match-input-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  background: #111;
  color: #e8eaed;
}
.games-match-input-row button {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(39, 224, 179, 0.28);
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  box-shadow: 0 8px 20px rgba(39, 224, 179, 0.18);
  color: #08120f;
  font-weight: 600;
  cursor: pointer;
}
.games-match-game-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-height: 0;
  background: #0a0a0a;
}
.games-match-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #1e1e1e;
  flex-shrink: 0;
}
.games-change-game-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  background: #151515;
  color: #e8eaed;
  cursor: pointer;
  font-size: 0.85rem;
}
.games-change-game-btn:hover {
  border-color: #00b894;
  color: #00b894;
}
#gamesMatchGameMount {
  flex: 1;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* Inline game overlays (reparented into mount on games page) — no full-viewport fixed layer */
#gamesMatchGameMount > .quiz-overlay.games-inline-overlay {
  position: absolute !important;
  inset: 0 !important;
  z-index: 4;
  max-width: none !important;
  width: 100% !important;
  height: 100% !important;
  padding: 8px !important;
  box-sizing: border-box;
  align-items: flex-start !important;
  justify-content: center !important;
  overflow-y: auto !important;
}
#gamesMatchGameMount > .quiz-overlay.games-inline-overlay .trivia-panel,
#gamesMatchGameMount > .quiz-overlay.games-inline-overlay .rps-panel {
  position: relative !important;
  max-height: none !important;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.games-panel-options--narrow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: none;
}
.games-panel-options--narrow .games-panel-option {
  display: flex;
}
.games-panel-option {
  display: none;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 18px 20px;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  width: 100%;
  max-width: 420px;
  transition: all 0.15s;
  box-sizing: border-box;
  font: inherit;
  color: inherit;
  text-align: left;
}
.games-panel-option:hover {
  border-color: #00b894;
  background: rgba(0, 184, 148, 0.06);
}
.games-panel-option-icon {
  font-size: 32px;
  flex-shrink: 0;
}
.games-panel-option-name {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
.games-panel-option-desc {
  color: #666;
  font-size: 12px;
}
.games-panel-option-pts {
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid rgba(0, 184, 148, 0.2);
  color: #00b894;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.games-panel-option-arrow {
  color: #444;
  font-size: 18px;
  margin-left: auto;
}

.games-panel-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 0;
}

.games-panel-card {
  background: #121820;
  border: 1px solid #2a3444;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
  font: inherit;
  text-align: left;
}

.games-panel-card:hover {
  border-color: rgba(39, 224, 179, 0.4);
  transform: translateY(-2px);
}

.games-panel-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0e141c center/cover no-repeat;
  flex-shrink: 0;
  min-height: 60px;
}

.games-panel-card-thumb--trivia {
  background-image: url('/images/game-icons/trivia.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.games-panel-card-thumb--rps {
  background-image: url('/images/game-icons/rockpaperscissors.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.games-panel-card-thumb--connect4 {
  background-image: url('/images/game-icons/momo4.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.games-panel-card-thumb--memory {
  background-image: url('/images/game-icons/memorymatch.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.games-panel-card-thumb--checkers {
  background-image: url('/images/game-icons/checkers.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.games-panel-card-thumb--tictactoe {
  background-image: url('/images/game-icons/tictactoe.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.games-panel-card-thumb--triviatictactoe {
  background-image: url('/images/game-icons/triviatictactoe.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.games-panel-card-thumb--mixcategory { background-image: url('/images/game-icons/mixcategoryquiz.webp'); background-size: cover; background-position: center; background-repeat: no-repeat; }
.games-panel-card-thumb--history { background-image: url('/images/game-icons/historyquiz.webp'); background-size: cover; background-position: center; background-repeat: no-repeat; }
.games-panel-card-thumb--popculture { background-image: url('/images/game-icons/popculturequiz.webp'); background-size: cover; background-position: center; background-repeat: no-repeat; }
.games-panel-card-thumb--sports { background-image: url('/images/game-icons/sportsquiz.webp'); background-size: cover; background-position: center; background-repeat: no-repeat; }
.games-panel-card-thumb--mathscience { background-image: url('/images/game-icons/mathsciencequiz.webp'); background-size: cover; background-position: center; background-repeat: no-repeat; }
.games-panel-card-thumb--geography { background-image: url('/images/game-icons/geographyquiz.webp'); background-size: cover; background-position: center; background-repeat: no-repeat; }

.games-panel-card--waiting {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.games-panel-card--waiting::after {
  content: '⏳';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
}

.games-panel-waiting-banner {
  background: rgba(39, 224, 179, 0.1);
  border: 1px solid rgba(39, 224, 179, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #27e0b3;
  text-align: center;
  font-weight: 600;
  display: none;
  width: 100%;
}

.games-panel-waiting-banner.visible {
  display: block;
}

.games-panel-card-name {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  padding: 4px 6px;
  line-height: 1.3;
}

.games-panel-idle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px;
  gap: 10px;
  overflow-y: auto;
}

.games-panel-idle-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.games-panel-idle-sub {
  font-size: 11px;
  color: #6b7d94;
  text-align: center;
  margin-top: -6px;
}

.games-panel-trivia-cats {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px;
  gap: 10px;
  overflow-y: auto;
}
.games-trivia-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: #8b9cb3;
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.games-trivia-back:hover {
  color: #00b894;
}
.games-panel-cat-btn {
  cursor: pointer;
}

.games-panel-trivia-cats .games-panel-card,
.games-panel-ttt-trivia-cats .games-panel-card {
  display: flex;
}

.games-panel-trivia-cats .games-panel-card-thumb,
.games-panel-ttt-trivia-cats .games-panel-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 60px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.games-panel-ttt-trivia-cats {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px;
  gap: 10px;
  overflow-y: auto;
}
.games-msg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.games-msg-name {
  font-size: 13px;
  font-weight: 600;
  color: #ddd;
}
.games-msg-row--you .games-msg-name {
  color: #0a0a0a;
}
.games-msg-menu-btn {
  background: none;
  border: none;
  color: #555;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  line-height: 1;
}
.games-msg-header:hover .games-msg-menu-btn {
  opacity: 1;
}
.games-msg-menu-btn:hover {
  color: #aaa;
  background: rgba(255, 255, 255, 0.06);
}
.games-msg-dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 4px;
  min-width: 160px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.games-msg-dropdown-item {
  padding: 8px 12px;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.games-msg-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.games-msg-dropdown-item--danger {
  color: #e74c3c;
}
.games-msg-dropdown-item--danger:hover {
  background: rgba(231, 76, 60, 0.1);
}
.profile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  cursor: pointer;
}
.profile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: #111;
  border-left: 1px solid #1e1e1e;
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow-y: auto;
  transform: translateX(100%);
}
.profile-drawer.open {
  transform: translateX(0);
}
.profile-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.profile-drawer-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.profile-drawer-close {
  background: none;
  border: none;
  color: #555;
  font-size: 16px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-drawer-close:hover {
  color: #aaa;
  background: rgba(255, 255, 255, 0.06);
}
.profile-drawer-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.profile-drawer-loading {
  color: #666;
  text-align: center;
  padding: 40px;
}
.profile-drawer-avatar-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto;
  background: #1a1a1a;
}
.profile-drawer-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-drawer-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #00b894;
}
.profile-drawer-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
}
.profile-drawer-age {
  font-weight: 500;
  color: #8b9cb3;
}
.profile-drawer-meta {
  text-align: center;
  color: #8b9cb3;
  font-size: 0.9rem;
}
.profile-drawer-online-row {
  text-align: center;
}
.profile-drawer-online {
  color: #00b894;
  font-size: 0.85rem;
}
.profile-drawer-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #666;
  text-transform: uppercase;
}
.profile-drawer-about {
  color: #ccc;
  font-size: 0.9rem;
  line-height: 1.45;
}
.profile-drawer-muted {
  color: #666;
}
.profile-drawer-game-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #8b9cb3;
}
.profile-drawer-game-row strong {
  color: #fff;
}
.profile-drawer-rank-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 184, 148, 0.15);
  color: #00b894;
  font-size: 0.85rem;
  font-weight: 700;
  align-self: flex-start;
}
.profile-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.profile-drawer-action-btn {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: #e8eaed;
  cursor: pointer;
  font-size: 0.9rem;
}
.profile-drawer-action-btn--primary {
  background: #00b894;
  border-color: #00b894;
  color: #0a0a0a;
  font-weight: 600;
}
.profile-drawer-action-btn:hover {
  filter: brightness(1.05);
}

/* Profile activity — game points */
.profile-v2-activity-divider {
  border: none;
  border-top: 1px solid var(--profile-v2-border, #2a2a2a);
  margin: 14px 0 12px;
}
.profile-v2-activity-game-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--profile-v2-muted, #8b9cb3);
  margin-bottom: 8px;
}
.profile-v2-activity-game-points-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.profile-v2-activity-game-pts {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
}
.profile-v2-activity-game-pts-label {
  font-size: 0.8rem;
  color: var(--profile-v2-muted, #8b9cb3);
}
.profile-v2-activity-game-rank {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 184, 148, 0.15);
  color: #00b894;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.profile-v2-activity-game-per {
  font-size: 0.8rem;
  margin-bottom: 10px;
}
.profile-v2-activity-game-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  color: var(--profile-v2-muted, #b0b8c4);
}
.profile-v2-activity-game-link {
  font-size: 0.82rem;
  color: var(--profile-v2-teal, #00b894);
  text-decoration: none;
  font-weight: 600;
}
.profile-v2-activity-game-link:hover {
  text-decoration: underline;
}

/* Games match: hide duplicate pre-game ad close affordances inside mount */
#gamesMatchGameMount .pre-game-ad-slot .pre-game-ad-close,
#gamesMatchGameMount .pre-game-ad-slot [class*="close"] {
  display: none !important;
}

/* View-only mode (content suspension) */
.content-suspension-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100000;
  background: linear-gradient(90deg, #7c2d12, #b45309);
  color: #fff8f0;
  padding: 12px 16px;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.45;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
body.has-content-suspension-banner {
  padding-top: 52px;
}
body.games-content-suspended #findMatchBtn {
  opacity: 0.45;
  pointer-events: none;
}
body.games-content-suspended .games-panel-idle button,
body.games-content-suspended .games-menu-row,
body.games-content-suspended .trivia-cat-btn,
body.games-content-suspended .ttt-trivia-cat-btn {
  opacity: 0.45;
  pointer-events: none;
}

/* Top-right notifications (friend requests, toasts) */
.notification-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  pointer-events: none;
}
.notification-container .notification-card {
  pointer-events: auto;
}
.notification-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: notification-slide-in 0.3s ease;
  position: relative;
  overflow: hidden;
}
@keyframes notification-slide-in {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
.notification-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.notification-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a3a31;
  color: #00b894;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notification-text {
  flex: 1;
}
.notification-title {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.notification-subtitle {
  color: #888;
  font-size: 11px;
  margin-top: 2px;
}
.notification-actions {
  display: flex;
  gap: 8px;
}
.notification-btn-accept {
  background: #00b894;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
}
.notification-btn-decline {
  background: transparent;
  color: #888;
  border: 1px solid #333;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  flex: 1;
}
.notification-countdown {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #00b894;
  border-radius: 0 0 0 12px;
  animation: notification-countdown 15s linear forwards;
}
@keyframes notification-countdown {
  from {
    width: 100%;
  }
  to {
    width: 0;
  }
}

/* Inbox friend-request card */
.friend-request-message-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
}
.friend-request-message-title {
  color: #eee;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}
.friend-request-message-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.friend-request-message-btn {
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.friend-request-message-btn--accept {
  background: #00b894;
  color: #fff;
}
.friend-request-message-btn--decline {
  background: transparent;
  color: #aaa;
  border: 1px solid #444;
}

/* ——— Messages v2 (inline expand + ad rail) ——— */
.profile-page-v2.messages-page-v2 {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.profile-page-v2.messages-page-v2 .profile-v2-shell.profile-v2-shell--messages {
  flex: 1;
  min-height: 0;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 16px 48px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .profile-page-v2.messages-page-v2 .profile-v2-shell.profile-v2-shell--messages {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .profile-page-v2.messages-page-v2 .profile-v2-sidebar {
    width: 280px !important;
  }
}

.messages-page-v2 .msg-hidden {
  display: none !important;
}

.messages-page-v2 .msg-layout-scroll {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  min-width: 0;
  width: 100%;
}

.messages-page-v2 .msg-layout-scroll .profile-v2-ad-rail {
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  align-self: flex-start;
}

/* Main messages card: replaces inline attrs on .msg-panel in messages.html */
.profile-page-v2.messages-page-v2 .msg-layout-scroll > .msg-panel {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.messages-page-v2 .msg-panel {
  flex: 1;
  min-width: 0;
  background: var(--surface-1);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.messages-page-v2 .msg-panel-head {
  flex-shrink: 0;
  padding: 16px 18px 0;
  border-bottom: 0.5px solid #1e1e1e;
}

.messages-page-v2 .msg-panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.messages-page-v2 .msg-panel-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.messages-page-v2 .msg-compose-open-btn {
  border: none;
  background: #1db88a;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.messages-page-v2 .msg-compose-open-btn:hover {
  filter: brightness(1.06);
}

.messages-page-v2 .msg-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.messages-page-v2 .msg-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  pointer-events: none;
  display: flex;
}

.messages-page-v2 .msg-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px 9px 36px;
  border-radius: 8px;
  border: 0.5px solid #2a2a2a;
  background: #1a1a1a;
  color: #e8eaed;
  font-size: 14px;
}

.messages-page-v2 .msg-search-input::placeholder {
  color: #666;
}

.messages-page-v2 .msg-folder-tabs {
  display: flex;
  gap: 4px;
  background: #1a1a1a;
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.messages-page-v2 .msg-folder-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: #888;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.messages-page-v2 .msg-folder-tab--active {
  background: #2a2a2a;
  color: #fff;
  font-weight: 600;
}

.messages-page-v2 .msg-bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 0 12px;
  font-size: 12px;
  color: #aaa;
}

.messages-page-v2 .msg-bulk-bar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.messages-page-v2 .msg-bulk-pager {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ccc;
  font-size: 12px;
}

.messages-page-v2 .msg-pager-btn {
  border: 1px solid #333;
  background: #1a1a1a;
  color: #ddd;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.messages-page-v2 .msg-pager-btn:hover:not(:disabled) {
  background: #252525;
  border-color: #444;
}

.messages-page-v2 .msg-pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.messages-page-v2 .msg-pager-range {
  min-width: 4.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.messages-page-v2 .msg-bulk-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.messages-page-v2 .msg-bulk-mark-read {
  border: 1px solid #333;
  background: #1a1a1a;
  color: #ddd;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.messages-page-v2 .msg-bulk-delete {
  border: 1px solid #333;
  background: #1a1a1a;
  color: #ddd;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.messages-page-v2 .msg-bulk-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.messages-page-v2 .msg-panel-list {
  flex: 1;
  min-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

.messages-page-v2 .msg-list-error {
  padding: 10px 18px;
  color: #f87171;
  font-size: 13px;
}

.messages-page-v2 .msg-list-empty {
  padding: 24px 18px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

.messages-page-v2 .msg-row {
  border-bottom: 0.5px solid #1a1a1a;
}

.messages-page-v2 .msg-row-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.1s;
}

.messages-page-v2 .msg-row-header:hover {
  background: #161616;
}

.messages-page-v2 .msg-row--active .msg-row-header {
  background: #1a1a1a;
}

.messages-page-v2 .msg-row--active.msg-row--user {
  border-left: 2px solid #1db88a;
}

.messages-page-v2 .msg-row--active.msg-row--friend {
  border-left: 2px solid #f59e0b;
}

.messages-page-v2 .msg-row--active.msg-row--system {
  border-left: 2px solid #3b82f6;
}

.messages-page-v2 .msg-row-check {
  margin-top: 14px;
  flex-shrink: 0;
}

.messages-page-v2 .msg-row-avatar,
.messages-page-v2 .msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.messages-page-v2 .msg-avatar--user {
  background: #1db88a22;
  color: #1db88a;
}

.messages-page-v2 .msg-avatar--friend {
  background: #f59e0b22;
  color: #f59e0b;
}

.messages-page-v2 .msg-avatar--system {
  background: #3b82f622;
  color: #3b82f6;
}

.messages-page-v2 .msg-row-body-col {
  min-width: 0;
  flex: 1;
}

.messages-page-v2 .msg-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 4px;
}

.messages-page-v2 .msg-row-name {
  font-size: 14px;
  font-weight: 600;
  color: #ddd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-page-v2 .msg-row-time {
  font-size: 11px;
  color: #666;
  flex-shrink: 0;
}

.messages-page-v2 .msg-row-subject {
  font-size: 13px;
  color: #aaa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-page-v2 .msg-row-preview {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.messages-page-v2 .msg-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.messages-page-v2 .msg-row--unread .msg-row-name,
.messages-page-v2 .msg-row--unread .msg-row-subject {
  color: #fff;
  font-weight: 700;
}

.messages-page-v2 .msg-badge-official {
  background: #3b82f622;
  color: #3b82f6;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.messages-page-v2 .msg-badge-friend-pill {
  background: #f59e0b22;
  color: #f59e0b;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.messages-page-v2 .msg-badge-new-pill {
  background: #1db88a;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.messages-page-v2 .msg-row-chevron {
  color: #555;
  font-size: 11px;
  margin-top: 4px;
  flex-shrink: 0;
  transition:
    transform 0.2s,
    color 0.2s;
}

.messages-page-v2 .msg-row--active .msg-row-chevron {
  transform: rotate(180deg);
  color: #1db88a;
}

.messages-page-v2 .msg-inline-thread {
  display: none;
  flex-direction: column;
  border-top: 0.5px solid #1e1e1e;
  background: #0d0d0d;
}

.messages-page-v2 .msg-row--active .msg-inline-thread {
  display: flex;
}

.messages-page-v2 .msg-inline-thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 0;
}

.messages-page-v2 .msg-inline-btn {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #ccc;
  cursor: pointer;
}

.messages-page-v2 .msg-inline-btn--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.messages-page-v2 .msg-bubbles {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.messages-page-v2 .bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.messages-page-v2 .bubble-row--theirs {
  align-self: flex-start;
}

.messages-page-v2 .bubble-row--mine {
  align-self: flex-end;
}

.messages-page-v2 .bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}

.messages-page-v2 .bubble--mine {
  background: #1db88a;
  color: #fff;
  border-bottom-right-radius: 3px;
}

.messages-page-v2 .bubble--theirs {
  background: #1a1a1a;
  color: #ddd;
  border-bottom-left-radius: 3px;
}

.messages-page-v2 .bubble-subject {
  font-size: 12px;
  font-weight: 600;
  color: #1db88a;
  margin-bottom: 6px;
}

.messages-page-v2 .bubble--mine .bubble-subject {
  color: rgba(255, 255, 255, 0.85);
}

.messages-page-v2 .bubble-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 0 2px;
}

.messages-page-v2 .bubble-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2a2a;
  color: #aaa;
}

.messages-page-v2 .bubble-row--mine .bubble-avatar {
  background: #1db88a44;
  color: #1db88a;
}

.messages-page-v2 .bubble-time {
  font-size: 11px;
  color: #666;
}

.messages-page-v2 .bubble-row--mine .bubble-time {
  color: #888;
}

.messages-page-v2 .bubble-attachment img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 8px;
  display: block;
}

.messages-page-v2 .msg-reply-box {
  flex-shrink: 0;
  padding: 12px 18px 16px;
  border-top: 0.5px solid #222;
}

.messages-page-v2 .msg-reply-inner {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.messages-page-v2 .msg-reply-input {
  flex: 1;
  min-height: 44px;
  max-height: 200px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0.5px solid #2a2a2a;
  background: #161616;
  color: #e8eaed;
  font-size: 14px;
  resize: none;
  font-family: inherit;
}

.messages-page-v2 .msg-reply-send {
  border: none;
  background: #1db88a;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.messages-page-v2 .msg-reply-send:hover {
  filter: brightness(1.06);
}

.messages-page-v2 .msg-inline-friend-card {
  margin: 14px 18px;
  background: #f59e0b11;
  border: 1px solid #f59e0b22;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.messages-page-v2 .msg-inline-friend-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.messages-page-v2 .msg-inline-friend-avatar {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.messages-page-v2 .msg-inline-friend-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.messages-page-v2 .msg-inline-friend-sub {
  font-size: 13px;
  color: #aaa;
  margin-top: 2px;
}

.messages-page-v2 .msg-inline-friend-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.messages-page-v2 .msg-friend-accept {
  border: none;
  background: #1db88a;
  color: #fff;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.messages-page-v2 .msg-friend-decline {
  border: 1px solid #444;
  background: transparent;
  color: #aaa;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.messages-page-v2 .msg-inline-system-card {
  margin: 14px 18px;
  background: #3b82f611;
  border: 1px solid #3b82f622;
  border-radius: 10px;
  padding: 16px;
}

.messages-page-v2 .msg-system-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.messages-page-v2 .msg-system-badge {
  background: #3b82f622;
  color: #3b82f6;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.messages-page-v2 .msg-system-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.messages-page-v2 .msg-system-body {
  color: #ddd;
  font-size: 14px;
  line-height: 1.55;
}

.messages-page-v2 .msg-system-footer {
  margin-top: 14px;
  font-size: 12px;
  color: #888;
}

.messages-page-v2 .msg-trash-inline-body {
  padding: 0 18px 16px;
  color: #ccc;
  font-size: 14px;
}

.messages-page-v2 .msg-trash-inline-subject {
  margin: 0 0 10px;
  font-size: 17px;
  color: #fff;
}

.messages-page-v2 .msg-trash-inline-text {
  line-height: 1.5;
}

.messages-page-v2 .msg-row--removing {
  animation: msgFadeOut 0.3s ease forwards;
}

@keyframes msgFadeOut {
  to {
    opacity: 0;
    max-height: 0;
    padding: 0;
    overflow: hidden;
  }
}

.messages-page-v2 .msg-compose-modal {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #161616;
  border: 0.5px solid #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.messages-page-v2 .msg-compose-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 0.5px solid #2a2a2a;
  font-weight: 600;
  color: #fff;
}

.messages-page-v2 .msg-compose-header button {
  border: none;
  background: transparent;
  color: #888;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.messages-page-v2 .msg-compose-to-field {
  padding: 12px 14px;
  border-bottom: 0.5px solid #222;
}

.messages-page-v2 .msg-compose-to-field label {
  display: block;
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
}

.messages-page-v2 .msg-compose-to-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0.5px solid #333;
  background: #111;
  color: #e8eaed;
}

.messages-page-v2 .msg-compose-suggestions {
  margin-top: 6px;
  border: 0.5px solid #333;
  border-radius: 8px;
  background: #141414;
  max-height: 180px;
  overflow-y: auto;
}

.messages-page-v2 .msg-compose-suggestion-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-bottom: 0.5px solid #222;
  background: transparent;
  color: #ddd;
  font-size: 13px;
  cursor: pointer;
}

.messages-page-v2 .msg-compose-suggestion-row:last-child {
  border-bottom: none;
}

.messages-page-v2 .msg-compose-suggestion-row:hover {
  background: #1e1e1e;
}

.messages-page-v2 .msg-compose-selected {
  padding: 0 14px 8px;
}

.messages-page-v2 .msg-compose-pill {
  display: inline-block;
  background: #1db88a33;
  color: #1db88a;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.messages-page-v2 .msg-compose-pill-clear {
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 18px;
  margin-left: 4px;
  vertical-align: middle;
}

.messages-page-v2 .msg-compose-body {
  margin: 0;
  min-height: 120px;
  padding: 12px 14px;
  border: none;
  background: #161616;
  color: #e8eaed;
  font-size: 14px;
  font-family: inherit;
  resize: none;
}

.messages-page-v2 .msg-compose-error {
  padding: 0 14px;
  color: #f87171;
  font-size: 12px;
  margin: 0;
}

.messages-page-v2 .msg-compose-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 14px;
  gap: 10px;
  border-top: 0.5px solid #222;
}

.messages-page-v2 .msg-compose-attach-label {
  font-size: 13px;
  color: #1db88a;
  cursor: pointer;
}

.messages-page-v2 .msg-compose-footer button {
  border: none;
  background: #1db88a;
  color: #fff;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
}

@media (max-width: 600px) {
  .messages-page-v2 .msg-compose-modal {
    position: fixed;
    inset: 16px;
    width: auto;
    bottom: 16px;
    max-width: none;
  }
}

@media (max-width: 767px) {
  .messages-page-v2 .msg-layout-scroll {
    padding: 12px;
    gap: 0;
  }

  .messages-page-v2 .profile-v2-ad-rail {
    display: none;
  }

  /* Fix: shell grid collapses to 1 column (sidebar is a drawer off-screen) */
  .profile-page-v2.messages-page-v2 .profile-v2-shell.profile-v2-shell--messages {
    grid-template-columns: 1fr;
  }

  /* Fix: profile-v2-hamburger (messages page) — style the three-span bars */
  .profile-v2-hamburger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    border-radius: 10px;
    background: var(--surface-1, #11141A);
    cursor: pointer;
  }

  .profile-v2-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
  }
}

/* ── Settings v2 page ─────────────────────────────────────── */
.profile-page-v2.settings-page-v2 .profile-v2-shell.profile-v2-shell--settings {
  flex: 1;
  min-height: 0;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 16px 48px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .profile-page-v2.settings-page-v2 .profile-v2-shell.profile-v2-shell--settings {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .profile-page-v2.settings-page-v2 .profile-v2-sidebar {
    width: 280px !important;
  }
}

/* ── Settings page layout (Settings-A — MDS shell / forms) ───────────────── */

.settings-page-v2 .settings-v2-scroll {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  min-width: 0;
  width: 100%;
}

.settings-page-v2 .settings-v2-scroll .profile-v2-ad-rail {
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  align-self: flex-start;
}

.settings-page-v2 .settings-v2-panel {
  flex: 1;
  min-width: 0;
  background: var(--surface-1);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 32px 32px 40px;
}

.settings-page-v2 .settings-v2-panel-head {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-page-v2 .settings-v2-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* ── Status messages ──────────────────────────────────────────────────────── */

.settings-page-v2 .settings-v2-save-msg {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-input);
  margin: 14px 0 8px;
  line-height: 1.45;
}

.settings-page-v2 .settings-v2-save-msg--hidden {
  display: none;
}

.settings-page-v2 .settings-v2-save-msg--ok {
  background: color-mix(in srgb, var(--success) 12%, var(--surface-2));
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 26%, var(--border-subtle));
}

.settings-page-v2 .settings-v2-save-msg--error {
  background: color-mix(in srgb, var(--error) 10%, var(--surface-2));
  color: var(--error);
  border: 1px solid color-mix(in srgb, var(--error) 22%, var(--border-subtle));
}

/* ── Sections ─────────────────────────────────────────────────────────────── */

.settings-page-v2 .settings-v2-section {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-page-v2 .settings-v2-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-page-v2 .settings-v2-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 22px;
}

.settings-page-v2 .settings-v2-section--danger {
  background: color-mix(in srgb, var(--error) 8%, var(--surface-1));
  border: 1px solid color-mix(in srgb, var(--error) 22%, var(--border-subtle));
  border-radius: var(--radius-input);
  padding: 22px 22px 24px;
  margin-top: 8px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--error) 6%, transparent);
}

.settings-page-v2 .settings-v2-section-title--danger {
  color: var(--error);
  letter-spacing: 0.08em;
}

/* ── Form fields ──────────────────────────────────────────────────────────── */

.settings-page-v2 .settings-v2-field {
  margin-bottom: 20px;
}

.settings-page-v2 .settings-v2-field--top-gap {
  margin-top: 8px;
}

.settings-page-v2 .settings-v2-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.settings-page-v2 .settings-v2-char-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}

.settings-page-v2 .settings-v2-city-wrap {
  position: relative;
}

.settings-page-v2 .settings-v2-input,
.settings-page-v2 .settings-v2-select,
.settings-page-v2 .settings-v2-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 0.925rem;
  box-sizing: border-box;
  transition:
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

.settings-page-v2 .settings-v2-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.settings-page-v2 .settings-v2-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237E8794' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.settings-page-v2 .settings-v2-input:focus,
.settings-page-v2 .settings-v2-select:focus,
.settings-page-v2 .settings-v2-textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-soft));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.settings-page-v2 .settings-v2-input::placeholder,
.settings-page-v2 .settings-v2-textarea::placeholder {
  color: var(--text-muted);
}

.settings-page-v2 .settings-v2-field-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.settings-page-v2 .settings-v2-support-blurb {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Name row / DOB row ───────────────────────────────────────────────────── */

.settings-page-v2 .settings-v2-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.settings-page-v2 .settings-v2-name-row .settings-v2-field {
  margin-bottom: 0;
}

.settings-page-v2 .settings-v2-dob-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 10px;
}

.settings-page-v2 .settings-v2-select--dob {
  padding-right: 32px;
}

/* ── City autocomplete ────────────────────────────────────────────────────── */

.settings-page-v2 .settings-v2-city-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  z-index: 200;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: var(--shadow-card-hover);
}

.settings-page-v2 .settings-v2-city-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: background var(--motion-hover), color var(--motion-hover);
}

.settings-page-v2 .settings-v2-city-option:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

/* ── Inline edit (username / email / password) ────────────────────────────── */

.settings-page-v2 .settings-v2-inline-edit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  min-height: 46px;
}

.settings-page-v2 .settings-v2-display-val {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.925rem;
  word-break: break-all;
}

.settings-page-v2 .settings-v2-display-val--muted {
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.settings-page-v2 .settings-v2-change-link {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color var(--motion-hover);
}

.settings-page-v2 .settings-v2-change-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.settings-page-v2 .settings-v2-change-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

.settings-page-v2 .settings-v2-inline-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  background: color-mix(in srgb, var(--surface-2) 88%, var(--surface-1));
}

.settings-page-v2 .settings-v2-inline-hint {
  font-size: 0.82rem;
  min-height: 1.2em;
  color: var(--text-muted);
}

.settings-page-v2 .settings-v2-inline-hint--ok {
  color: var(--accent-primary);
}

.settings-page-v2 .settings-v2-inline-hint--error {
  color: var(--error);
}

.settings-page-v2 .settings-v2-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.settings-page-v2 .settings-v2-inline-save-btn {
  padding: 9px 20px;
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  color: #0b0d11;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
  border-radius: var(--radius-input);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.settings-page-v2 .settings-v2-inline-save-btn:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
  box-shadow: var(--glow-primary);
}

.settings-page-v2 .settings-v2-inline-save-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.settings-page-v2 .settings-v2-inline-cancel-btn {
  padding: 9px 16px;
  background: var(--surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  font-size: 0.875rem;
  cursor: pointer;
  transition:
    background var(--motion-hover),
    color var(--motion-hover),
    border-color var(--motion-hover);
}

.settings-page-v2 .settings-v2-inline-cancel-btn:hover {
  background: color-mix(in srgb, var(--surface-3) 85%, var(--surface-2));
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent-primary) 18%, var(--border-soft));
}

/* ── Password strength ────────────────────────────────────────────────────── */

.settings-page-v2 .settings-v2-pw-strength {
  display: flex;
  gap: 4px;
  height: 4px;
}

.settings-page-v2 .settings-v2-pw-seg {
  flex: 1;
  border-radius: 2px;
  background: #2a2a2a;
  transition: background 0.25s;
}

.settings-page-v2 .settings-v2-pw-reqs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

.settings-page-v2 .settings-v2-pw-req {
  font-size: 0.78rem;
  color: #555;
  padding-left: 16px;
  position: relative;
}

.settings-page-v2 .settings-v2-pw-req::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: #555;
}

.settings-page-v2 .settings-v2-pw-req--met {
  color: #1db88a;
}

.settings-page-v2 .settings-v2-pw-req--met::before {
  content: "✓";
  color: #1db88a;
}

/* ── Toggle switches (Settings-B) ─────────────────────────────────────────── */

.settings-page-v2 .settings-v2-toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-2) 50%, transparent);
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover);
}

.settings-page-v2 .settings-v2-toggle-row:last-of-type {
  margin-bottom: 0;
}

.settings-page-v2 .settings-v2-toggle-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.settings-page-v2 .settings-v2-toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}

.settings-page-v2 .settings-v2-toggle-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.settings-page-v2 .settings-v2-switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex-shrink: 0;
}

.settings-page-v2 .settings-v2-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-page-v2 .settings-v2-switch-track {
  width: 46px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover);
  display: flex;
  align-items: center;
  padding: 0 3px;
  box-sizing: border-box;
}

.settings-page-v2 .settings-v2-switch-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    transform 0.2s ease,
    background var(--motion-hover),
    box-shadow var(--motion-hover);
}

.settings-page-v2
  .settings-v2-switch-input:checked
  + .settings-v2-switch-track {
  background: color-mix(in srgb, var(--accent-primary) 24%, var(--surface-3));
  border-color: color-mix(in srgb, var(--accent-primary) 38%, var(--border-soft));
}

.settings-page-v2
  .settings-v2-switch-input:checked
  + .settings-v2-switch-track
  .settings-v2-switch-thumb {
  transform: translateX(20px);
  background: var(--accent-primary);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.3),
    0 0 0 1px color-mix(in srgb, var(--accent-primary) 35%, transparent);
}

.settings-page-v2
  .settings-v2-switch-input:focus-visible
  + .settings-v2-switch-track {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 50%, transparent);
  outline-offset: 2px;
}

/* ── Who-can-message chips (Settings-B) ───────────────────────────────────── */

.settings-page-v2 .settings-wcm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.settings-page-v2 .settings-wcm-btn {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.settings-page-v2 .settings-wcm-btn:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 22%, var(--border-soft));
  color: var(--text-primary);
}

.settings-page-v2 .settings-wcm-btn--active {
  background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-primary) 40%, var(--border-soft));
  color: var(--accent-primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.settings-page-v2 .settings-wcm-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}

.settings-page-v2 .settings-wcm-hint {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Actions / save buttons ───────────────────────────────────────────────── */

.settings-page-v2 .settings-v2-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding-top: 4px;
}

.settings-page-v2 .settings-v2-save-btn {
  padding: 11px 26px;
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  color: #0b0d11;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
  border-radius: var(--radius-input);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--glow-primary);
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.settings-page-v2 .settings-v2-save-btn:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
}

.settings-page-v2 .settings-v2-save-btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.settings-page-v2 .settings-v2-save-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 50%, transparent);
  outline-offset: 2px;
}

.settings-page-v2 .settings-v2-inline-save-btn:focus-visible,
.settings-page-v2 .settings-v2-inline-cancel-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 40%, transparent);
  outline-offset: 2px;
}

/* ── Danger zone (Settings-C) ─────────────────────────────────────────────── */

.settings-page-v2 .settings-v2-danger-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 16px;
  line-height: 1.55;
}

.settings-page-v2 .settings-v2-delete-btn {
  padding: 10px 22px;
  background: transparent;
  color: var(--error);
  border: 1px solid color-mix(in srgb, var(--error) 42%, var(--border-subtle));
  border-radius: var(--radius-input);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}

.settings-page-v2 .settings-v2-delete-btn:hover {
  background: color-mix(in srgb, var(--error) 12%, var(--surface-2));
  border-color: color-mix(in srgb, var(--error) 55%, var(--border-soft));
}

.settings-page-v2 .settings-v2-delete-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--error) 45%, transparent);
  outline-offset: 2px;
}

/* ── Settings modals (Settings-C) ─────────────────────────────────────────── */

.settings-v2-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
}

.settings-v2-modal-overlay[hidden] {
  display: none;
}

.settings-v2-modal {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-hover);
  padding: 28px 28px 24px;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-v2-modal--narrow {
  max-width: 380px;
}

.settings-v2-modal--danger {
  border-color: color-mix(in srgb, var(--error) 28%, var(--border-soft));
  box-shadow:
    var(--shadow-card-hover),
    0 0 0 1px color-mix(in srgb, var(--error) 10%, transparent);
}

.settings-v2-modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.settings-v2-modal-body {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.settings-v2-modal-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.settings-v2-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 8px;
}

.settings-v2-modal .settings-v2-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 0.925rem;
  box-sizing: border-box;
  font-family: inherit;
  transition:
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.settings-v2-modal .settings-v2-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--error) 40%, var(--border-soft));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 12%, transparent);
}

.settings-v2-modal .settings-v2-input::placeholder {
  color: var(--text-muted);
}

.settings-v2-modal .settings-v2-inline-hint {
  font-size: 0.82rem;
  min-height: 1.2em;
  color: var(--text-muted);
}

.settings-v2-modal .settings-v2-inline-hint--ok {
  color: var(--accent-primary);
}

.settings-v2-modal .settings-v2-inline-hint--error {
  color: var(--error);
}

#settingsDeleteModal .settings-v2-modal-title {
  color: var(--error);
}

#settingsDeleteModal .settings-v2-delete-btn {
  background: color-mix(in srgb, var(--error) 88%, #0b0d11);
  color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--error) 65%, transparent);
}

#settingsDeleteModal .settings-v2-delete-btn:hover {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

.settings-v2-modal-cancel {
  padding: 9px 18px;
  background: var(--surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition:
    background var(--motion-hover),
    color var(--motion-hover),
    border-color var(--motion-hover);
}

.settings-v2-modal-cancel:hover {
  background: color-mix(in srgb, var(--surface-3) 85%, var(--surface-2));
  color: var(--text-primary);
  border-color: var(--border-soft);
}

.settings-v2-modal-cancel:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
  outline-offset: 2px;
}

.settings-v2-modal-confirm {
  padding: 9px 20px;
  border-radius: var(--radius-input);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}

.settings-v2-modal-confirm--primary {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  color: #0b0d11;
  border-color: color-mix(in srgb, var(--accent-primary) 35%, transparent);
}

.settings-v2-modal-confirm--primary:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
}

.settings-v2-modal-confirm--danger {
  background: color-mix(in srgb, var(--error) 18%, var(--surface-2));
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 45%, var(--border-soft));
}

.settings-v2-modal-confirm--danger:hover {
  background: color-mix(in srgb, var(--error) 28%, var(--surface-2));
  border-color: color-mix(in srgb, var(--error) 55%, var(--border-soft));
}

.settings-v2-modal-confirm--secondary {
  background: var(--surface-3);
  color: var(--text-secondary);
  border-color: var(--border-soft);
}

.settings-v2-modal-confirm--secondary:hover {
  background: color-mix(in srgb, var(--surface-3) 85%, var(--surface-2));
  color: var(--text-primary);
}

.settings-v2-modal-confirm:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 40%, transparent);
  outline-offset: 2px;
}

.settings-v2-modal-confirm--danger:focus-visible {
  outline-color: color-mix(in srgb, var(--error) 45%, transparent);
}

/* ── Ghosted / Muted / Blocked (Settings-D) ───────────────────────────────── */

.settings-page-v2 .settings-hm-section,
.settings-page-v2 .settings-blocked-section {
  margin-top: 24px;
}

.settings-page-v2 .settings-subsection-title {
  margin-bottom: 12px;
}

.settings-page-v2 .settings-hm-intro,
.settings-page-v2 .settings-blocked-intro {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.55;
}

.settings-page-v2 .settings-hm-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: var(--radius-input);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}

.settings-page-v2 .hm-tab {
  flex: 1;
  padding: 9px 16px;
  border: none;
  border-radius: calc(var(--radius-input) - 4px);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition:
    background var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.settings-page-v2 .hm-tab:hover {
  color: var(--text-secondary);
}

.settings-page-v2 .hm-tab--active {
  background: var(--surface-1);
  color: var(--accent-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.settings-page-v2 .hm-tab:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}

.settings-page-v2 .settings-user-list {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
  overflow-y: auto;
  max-height: 420px;
  min-height: 60px;
}

.settings-page-v2 .settings-user-list-loading {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.settings-page-v2 .settings-user-list-empty {
  display: none;
  padding: 40px 20px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  background: color-mix(in srgb, var(--surface-2) 50%, transparent);
  line-height: 1.5;
}

.settings-page-v2 .settings-user-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 0 4px;
  display: none;
}

.settings-page-v2 .settings-blocked-search-wrap {
  margin-bottom: 12px;
}

.settings-page-v2 .settings-blocked-search-wrap .settings-v2-input {
  width: 100%;
  box-sizing: border-box;
}

.settings-page-v2 .settings-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.settings-page-v2 .settings-user-row:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}

.settings-page-v2 .settings-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.settings-page-v2 .muted-user-row .settings-user-avatar {
  background: color-mix(in srgb, var(--accent-secondary) 12%, var(--surface-3));
}

.settings-page-v2 .blocked-user-row .settings-user-avatar {
  background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-3));
  color: var(--accent-primary);
}

.settings-page-v2 .settings-user-main {
  flex: 1;
  min-width: 0;
}

.settings-page-v2 .settings-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}

.settings-page-v2 .settings-user-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-page-v2 .settings-user-menu-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}

.settings-page-v2 .settings-user-menu-btn:hover {
  background: var(--surface-3);
  border-color: color-mix(in srgb, var(--accent-primary) 22%, var(--border-soft));
  color: var(--text-secondary);
}

.settings-page-v2 .settings-user-menu-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 40%, transparent);
  outline-offset: 2px;
}

.settings-ctx-menu {
  position: fixed;
  z-index: 10000;
  min-width: 168px;
  display: none;
  padding: 6px;
  border-radius: var(--radius-input);
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card-hover);
}

#blockedCtxMenu.settings-ctx-menu {
  z-index: 1000;
  min-width: 180px;
}

.settings-ctx-menu-item {
  padding: 10px 14px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: calc(var(--radius-input) - 4px);
  transition:
    background var(--motion-hover),
    color var(--motion-hover);
}

.settings-ctx-menu-item:hover {
  background: var(--surface-2);
}

.settings-ctx-menu-item:not(:last-child) {
  margin-bottom: 2px;
}

.settings-ctx-menu-item--danger {
  color: var(--error);
}

.settings-ctx-menu-item--danger:hover {
  background: color-mix(in srgb, var(--error) 10%, var(--surface-2));
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .settings-page-v2 .settings-v2-scroll {
    padding: 12px;
    gap: 0;
  }

  .settings-page-v2 .profile-v2-ad-rail {
    display: none;
  }

  .profile-page-v2.settings-page-v2
    .profile-v2-shell.profile-v2-shell--settings {
    grid-template-columns: 1fr;
  }

  .settings-page-v2 .settings-v2-panel {
    padding: 18px 16px 24px;
  }

  .settings-page-v2 .settings-v2-dob-row {
    grid-template-columns: 1fr 1fr;
  }

  .settings-page-v2 .settings-v2-pw-reqs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .settings-page-v2 .settings-v2-name-row {
    grid-template-columns: 1fr;
  }

  .settings-page-v2 .settings-v2-dob-row {
    grid-template-columns: 1fr;
  }
}

/* ── Notifications page (Notifications-A — MDS shell / feed cards) ─────── */

.notif-page-v2 .notif-page-scroll {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 60px);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.notif-page-v2 .notif-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.notif-page-v2 .notif-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-family: inherit;
}

/* Notifications-B: secondary toolbar control */
.notif-page-v2 .notif-mark-all {
  background: color-mix(in srgb, var(--surface-2) 85%, transparent);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-input);
  cursor: pointer;
  font-family: inherit;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}

.notif-page-v2 .notif-mark-all:hover {
  background: color-mix(in srgb, var(--accent-primary) 7%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-primary) 24%, var(--border-soft));
  color: var(--accent-primary);
}

.notif-page-v2 .notif-mark-all:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}

.notif-page-v2 #notificationsRoot {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Notifications-B: intentional empty state */
.notif-page-v2 .notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface-2) 60%, var(--surface-1));
  margin: 8px 4px 0;
}

.notif-page-v2 .notif-empty .notif-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin-bottom: 18px;
  border-radius: 50%;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-3) 55%, var(--surface-2));
  border: 1px solid var(--border-subtle);
  opacity: 0.85;
}

.notif-page-v2 .notif-empty p {
  margin: 0;
  max-width: 280px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-secondary);
}

.notif-page-v2 .notif-item {
  --notif-accent: var(--accent-primary);
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover);
}

.notif-page-v2 .notif-item:hover {
  border-color: var(--border-soft);
  background: color-mix(in srgb, var(--surface-3) 35%, var(--surface-2));
}

/* Notifications-B: premium unread identity */

.notif-page-v2 .notif-item.notif-item--unread {
  background: color-mix(in srgb, var(--accent-primary) 9%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-primary) 16%, var(--border-subtle));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent-primary) 55%, transparent);
}

.notif-page-v2 .notif-item.notif-item--unread:hover {
  background: color-mix(in srgb, var(--accent-primary) 12%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-primary) 22%, var(--border-soft));
}

.notif-page-v2 .notif-item.notif-item--unread .notif-text {
  color: color-mix(in srgb, var(--text-primary) 92%, var(--text-secondary));
}

.notif-page-v2 .notif-item.notif-item--unread .notif-time {
  color: color-mix(in srgb, var(--text-muted) 80%, var(--accent-primary));
}

.notif-page-v2 .notif-item.notif-item--unread .notif-av-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--surface-2);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 25%, transparent);
}

.notif-page-v2 .notif-item.notif-item--leaving {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.notif-page-v2 .notif-av-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

/* Notifications-B: type accent via --notif-accent (set in JS) */
.notif-page-v2 .notif-av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  color: var(--notif-accent);
  background: color-mix(in srgb, var(--notif-accent) 14%, var(--surface-3));
}

.notif-page-v2 .notif-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notif-page-v2 .notif-ico-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  z-index: 2;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--notif-accent);
  border: 2px solid var(--surface-2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

.notif-page-v2 .notif-item.notif-item--unread .notif-ico-badge {
  border-color: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-2));
}

.notif-page-v2 .notif-body {
  flex: 1;
  min-width: 0;
}

.notif-page-v2 .notif-text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.notif-page-v2 .notif-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.notif-page-v2 .notif-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.notif-page-v2 .notif-time {
  margin-top: 6px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.notif-page-v2 .notif-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Notifications-B: MDS action buttons */
.notif-page-v2 .notif-btn {
  padding: 8px 16px;
  border-radius: var(--radius-input);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover),
    box-shadow var(--motion-hover),
    opacity var(--motion-hover);
}

.notif-page-v2 .notif-btn--primary {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  color: #0b0d11;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 38%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 8%, transparent);
}

.notif-page-v2 .notif-btn--primary:hover:not(:disabled) {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
  border-color: color-mix(in srgb, var(--accent-primary) 48%, transparent);
}

.notif-page-v2 .notif-btn--ghost {
  background: color-mix(in srgb, var(--surface-3) 40%, transparent);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.notif-page-v2 .notif-btn--ghost:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text-secondary);
  border-color: var(--border-soft);
}

.notif-page-v2 .notif-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.notif-page-v2 .notif-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}

.notif-page-v2 .notif-btn--ghost:focus-visible {
  outline-color: color-mix(in srgb, var(--border-soft) 80%, var(--text-muted));
}

.notif-page-v2 .notif-confirm {
  padding: 12px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 11%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--success) 24%, var(--border-subtle));
  border-radius: var(--radius-input);
}

.notif-page-v2 .notif-confirm strong {
  color: color-mix(in srgb, var(--success) 75%, var(--text-primary));
  font-weight: 600;
}

.notif-page-v2 .notif-error {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--error);
  background: color-mix(in srgb, var(--error) 9%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--error) 20%, var(--border-subtle));
  border-radius: calc(var(--radius-input) - 2px);
}

@media (max-width: 767px) {
  .notif-page-v2 .profile-v2-ad-rail {
    display: none;
  }

  .notif-page-v2 .notif-page-head {
    padding: 16px 16px 14px;
  }

  .notif-page-v2 #notificationsRoot {
    padding: 8px 10px 14px;
  }

  .notif-page-v2 .notif-page-scroll {
    min-height: calc(100vh - 56px);
    border-radius: var(--radius-input);
  }
}

/* ── Activity page (Activity-A — MDS shell / cards / feed) ──────────────── */

.activity-page-v2 .activity-page-scroll {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  min-width: 0;
}

.activity-page-v2 .activity-page-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px 2px;
}

.activity-page-v2 .activity-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-family: inherit;
}

.activity-page-v2 .activity-page-sub {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Feed / overview cards */
.activity-page-v2 .activity-feed-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.activity-page-v2 .activity-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.activity-page-v2 .activity-feed-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* MDS segmented tab controls */
.activity-page-v2 .activity-feed-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: color-mix(in srgb, var(--surface-2) 88%, var(--surface-3));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
}

.activity-page-v2 .activity-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}

.activity-page-v2 .activity-tab-btn:hover:not(.active) {
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-3) 45%, transparent);
}

.activity-page-v2 .activity-tab-btn.active {
  background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-primary) 28%, var(--border-soft));
  color: var(--accent-primary);
}

.activity-page-v2 .activity-tab-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}

/* Stats grid (overview card body) */
.activity-page-v2 .activity-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-subtle);
}

.activity-page-v2 .activity-stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 1.35rem 1rem;
  background: var(--surface-1);
}

.activity-page-v2 .activity-stat-cell-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.activity-page-v2 .activity-stat-cell-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}

/* Points summary card */
.activity-page-v2 .activity-summary-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.activity-page-v2 .activity-summary-card > .activity-feed-header {
  grid-column: 1 / -1;
  margin: -18px -18px 0;
}

.activity-page-v2 .activity-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 1.1rem 0.85rem;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface-1));
  border-radius: calc(var(--radius-input) - 2px);
  border: 1px solid var(--border-subtle);
}

.activity-page-v2 .activity-summary-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-primary);
}

.activity-page-v2 .activity-summary-stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Transaction feed list */
.activity-page-v2 .activity-feed-list {
  display: flex;
  flex-direction: column;
}

.activity-page-v2 .activity-feed-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--motion-hover);
}

.activity-page-v2 .activity-feed-item:last-child {
  border-bottom: none;
}

.activity-page-v2 .activity-feed-item:hover {
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface-1));
}

.activity-page-v2 .activity-feed-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.activity-page-v2 .activity-feed-icon--earn {
  background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 22%, var(--border-subtle));
}

.activity-page-v2 .activity-feed-icon--spend {
  background: color-mix(in srgb, var(--error) 12%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--error) 20%, var(--border-subtle));
}

.activity-page-v2 .activity-feed-info {
  flex: 1;
  min-width: 0;
}

.activity-page-v2 .activity-feed-desc {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-page-v2 .activity-feed-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.activity-page-v2 .activity-feed-points {
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.activity-page-v2 .activity-feed-points--earn {
  color: var(--accent-primary);
}

.activity-page-v2 .activity-feed-points--spend {
  color: var(--error);
}

.activity-page-v2 .activity-feed-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.75rem;
  margin: 10px 14px 16px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: calc(var(--radius-input) - 2px);
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface-1));
}

/* Activity-B: loading / empty / error state modifiers */
@keyframes activityEmptyPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.activity-page-v2 .activity-feed-empty--loading::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent-primary) 18%, var(--border-subtle));
  border-top-color: var(--accent-primary);
  box-sizing: border-box;
  animation: activityEmptyPulse 1.1s ease-in-out infinite;
}

.activity-page-v2 .activity-feed-empty--loading {
  color: var(--text-muted);
}

.activity-page-v2 .activity-feed-empty--empty::before {
  content: "💠";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-3) 50%, var(--surface-2));
  border: 1px solid var(--border-subtle);
}

.activity-page-v2 .activity-feed-empty--empty {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-secondary);
}

.activity-page-v2 .activity-feed-empty--error::before {
  content: "!";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  color: var(--error);
  background: color-mix(in srgb, var(--error) 10%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--error) 22%, var(--border-subtle));
}

.activity-page-v2 .activity-feed-empty--error {
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--error) 6%, var(--surface-2));
  border-color: color-mix(in srgb, var(--error) 18%, var(--border-subtle));
}

.activity-page-v2 .activity-load-more {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1.25rem;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface-1));
  border: none;
  border-top: 1px solid var(--border-subtle);
  color: var(--accent-primary);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background var(--motion-hover),
    color var(--motion-hover);
}

.activity-page-v2 .activity-load-more:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-primary) 9%, var(--surface-2));
  color: var(--accent-primary-hover);
}

.activity-page-v2 .activity-load-more:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: -2px;
  z-index: 1;
}

.activity-page-v2 .activity-load-more:disabled {
  color: var(--text-muted);
  cursor: default;
  background: color-mix(in srgb, var(--surface-2) 40%, var(--surface-1));
}

/* Activity-B: responsive refinement */
@media (max-width: 719px) {
  .activity-page-v2 .activity-page-scroll {
    gap: 16px;
  }

  .activity-page-v2 .activity-page-head {
    padding: 2px 0 0;
    gap: 5px;
  }

  .activity-page-v2 .activity-page-title {
    font-size: 1.25rem;
  }

  .activity-page-v2 .activity-feed-header {
    padding: 16px 16px 14px;
    align-items: flex-start;
  }

  .activity-page-v2 .activity-feed-tabs {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .activity-page-v2 .activity-summary-card {
    padding: 14px;
    gap: 10px;
  }

  .activity-page-v2 .activity-summary-card > .activity-feed-header {
    margin: -14px -14px 0;
  }

  .activity-page-v2 .activity-summary-stat {
    padding: 0.95rem 0.75rem;
  }

  .activity-page-v2 .activity-stat-cell {
    padding: 1.1rem 0.85rem;
  }

  .activity-page-v2 .activity-feed-item {
    padding: 12px 16px;
    gap: 12px;
  }

  .activity-page-v2 .activity-feed-empty {
    margin: 8px 12px 14px;
    padding: 3rem 1.25rem;
  }
}

@media (max-width: 599px) {
  .activity-page-v2 .activity-summary-card {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .activity-page-v2 .activity-summary-card > .activity-feed-header {
    margin: -12px -12px 0;
  }

  .activity-page-v2 .activity-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .activity-page-v2 .activity-stat-cell:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .activity-page-v2 .activity-stat-cell-value,
  .activity-page-v2 .activity-summary-stat-value {
    font-size: 1.5rem;
  }

  .activity-page-v2 .activity-feed-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .activity-page-v2 .activity-feed-tabs {
    align-self: flex-start;
  }

  .activity-page-v2 .activity-feed-item {
    align-items: flex-start;
  }

  .activity-page-v2 .activity-feed-desc {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.4;
  }

  .activity-page-v2 .activity-feed-points {
    font-size: 0.875rem;
    max-width: 38%;
    text-align: right;
    line-height: 1.3;
    padding-top: 2px;
  }

  .activity-page-v2 .activity-feed-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .activity-page-v2 .activity-load-more {
    padding: 0.85rem 1rem;
    font-size: 0.8125rem;
  }
}

/* ── Add Friends page (AddFriends-A — MDS shell / cards / forms) ─────────── */

.add-friends-page-v2 .profile-v2-center {
  gap: 20px;
}

.add-friends-page-v2 .af-card {
  margin-bottom: 0;
  padding: 24px 26px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.add-friends-page-v2 .af-card-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.add-friends-page-v2 .af-card-sub {
  margin: 0 0 20px;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.add-friends-page-v2 .af-card-title-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.add-friends-page-v2 .af-card-title--tight {
  margin-bottom: 0;
}

.add-friends-page-v2 .af-card-sub--tight {
  margin-bottom: 0;
}

.add-friends-page-v2 .af-coming-soon {
  opacity: 0.55;
  pointer-events: none;
}

.add-friends-page-v2 .af-badge {
  margin-left: 10px;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: calc(var(--radius-input) - 2px);
}

.add-friends-page-v2 .af-card-head {
  align-self: flex-start;
  width: 100%;
}

/* AddFriends-B: premium QR invite card */
.add-friends-page-v2 .af-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 28px;
  background: color-mix(in srgb, var(--accent-primary) 4%, var(--surface-1));
  border-color: color-mix(in srgb, var(--accent-primary) 14%, var(--border-subtle));
}

.add-friends-page-v2 .af-qr-wrap .af-card-head {
  margin-bottom: 4px;
}

.add-friends-page-v2 .af-qr-lead {
  margin-bottom: 22px;
  max-width: 36rem;
  line-height: 1.6;
}

.add-friends-page-v2 .af-qr-stage {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 12px;
  padding: 20px 24px 18px;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface-1));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 4%, transparent);
}

.add-friends-page-v2 .af-qr-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 228px;
  height: 228px;
  padding: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  border: 2px solid color-mix(in srgb, var(--accent-primary) 22%, #e8e8e8);
  border-radius: var(--radius-card);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-primary) 8%, transparent),
    0 8px 28px rgba(0, 0, 0, 0.28);
  transition:
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}

.add-friends-page-v2 .af-qr-img:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 45%, #e8e8e8);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-primary) 18%, transparent),
    0 10px 32px rgba(0, 0, 0, 0.32);
}

.add-friends-page-v2 .af-qr-img:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 50%, transparent);
  outline-offset: 4px;
}

.add-friends-page-v2 .af-qr-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.add-friends-page-v2 #qrImg {
  display: none;
}

.add-friends-page-v2 .af-qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 200px;
  padding: 16px;
  text-align: center;
  background: color-mix(in srgb, var(--surface-3) 25%, #f4f4f4);
  border-radius: calc(var(--radius-card) - 6px);
}

.add-friends-page-v2 .af-qr-placeholder::before {
  content: '';
  width: 28px;
  height: 28px;
  border: 2px solid color-mix(in srgb, var(--accent-primary) 35%, var(--border-soft));
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: af-qr-spin 0.85s linear infinite;
}

@keyframes af-qr-spin {
  to {
    rotate: 360deg;
  }
}

.add-friends-page-v2 .af-qr-placeholder-label {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-muted);
}

.add-friends-page-v2 .af-qr-hint {
  margin: 0 0 22px;
  max-width: 20rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  color: var(--text-secondary);
}

.add-friends-page-v2 .af-btn-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 340px;
}

.add-friends-page-v2 .af-qr-actions .af-btn {
  min-height: 42px;
}

.add-friends-page-v2 .af-qr-actions .af-btn-primary {
  flex: 1.15;
}

.add-friends-page-v2 .af-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.add-friends-page-v2 .af-input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover);
}

.add-friends-page-v2 .af-input::placeholder {
  color: var(--text-muted);
}

.add-friends-page-v2 .af-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 40%, var(--border-soft));
  background: color-mix(in srgb, var(--surface-3) 35%, var(--surface-2));
}

.add-friends-page-v2 .af-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.add-friends-page-v2 .af-btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  background: color-mix(in srgb, var(--surface-3) 35%, transparent);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}

.add-friends-page-v2 .af-btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-soft);
  color: var(--text-primary);
}

.add-friends-page-v2 .af-btn--shrink {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 10px 18px;
}

.add-friends-page-v2 .af-btn--shrink-sm {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 16px;
  font-size: 0.8125rem;
}

.add-friends-page-v2 .af-btn-primary {
  color: #0b0d11;
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  border: 1px solid color-mix(in srgb, var(--accent-primary) 38%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 6%, transparent);
}

.add-friends-page-v2 .af-btn-primary:hover:not(:disabled) {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
}

.add-friends-page-v2 .af-btn--success {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, var(--surface-2));
  border-color: color-mix(in srgb, var(--success) 32%, var(--border-soft));
  box-shadow: none;
}

.add-friends-page-v2 .af-btn--success:hover:not(:disabled) {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 18%, var(--surface-2));
  border-color: color-mix(in srgb, var(--success) 38%, var(--border-soft));
}

.add-friends-page-v2 .af-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}

.add-friends-page-v2 .af-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* AddFriends-C: email result, status messages, pending invites */
.add-friends-page-v2 .af-result {
  display: none;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--surface-2) 75%, var(--surface-1));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 3%, transparent);
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover);
}

.add-friends-page-v2 .af-result.visible {
  display: flex;
}

.add-friends-page-v2 .af-result.visible:hover {
  border-color: var(--border-soft);
  background: color-mix(in srgb, var(--surface-3) 30%, var(--surface-2));
}

.add-friends-page-v2 .af-result-main {
  flex: 1;
  min-width: 0;
}

.add-friends-page-v2 .af-result-name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text-primary);
}

.add-friends-page-v2 .af-avatar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 16%, var(--surface-3));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 22%, var(--border-subtle));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.add-friends-page-v2 #emailAddBtn.af-add-btn--sent {
  color: #0b0d11;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--success) 85%, var(--accent-primary-hover)),
    var(--success)
  );
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
  box-shadow: none;
  opacity: 1;
  cursor: default;
}

.add-friends-page-v2 #emailAddBtn.af-add-btn--disabled {
  color: var(--text-muted);
  background: var(--surface-3);
  border-color: var(--border-subtle);
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}

.add-friends-page-v2 .af-field-msg {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: var(--radius-input);
}

.add-friends-page-v2 .af-field-msg--error {
  color: var(--error);
  background: color-mix(in srgb, var(--error) 9%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--error) 20%, var(--border-subtle));
}

.add-friends-page-v2 .af-field-msg--success {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 11%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--success) 24%, var(--border-subtle));
}

.add-friends-page-v2 .af-divider {
  margin: 20px 0;
  border: none;
  border-top: 1px solid var(--border-subtle);
}

.add-friends-page-v2 .af-pending-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.add-friends-page-v2 .af-pending-count {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 16%, var(--border-subtle));
  border-radius: 999px;
}

.add-friends-page-v2 #pendingInvitesList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-friends-page-v2 .af-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover);
}

.add-friends-page-v2 .af-invite-row:hover {
  border-color: var(--border-soft);
  background: color-mix(in srgb, var(--surface-3) 35%, var(--surface-2));
}

.add-friends-page-v2 .af-invite-info {
  flex: 1;
  min-width: 0;
}

.add-friends-page-v2 .af-invite-email {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.add-friends-page-v2 .af-invite-meta {
  margin-top: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-muted);
}

.add-friends-page-v2 .af-invite-meta.warning {
  color: var(--warning);
}

.add-friends-page-v2 .af-cancel-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}

.add-friends-page-v2 .af-cancel-btn:hover {
  color: var(--error);
  background: color-mix(in srgb, var(--error) 8%, var(--surface-2));
  border-color: color-mix(in srgb, var(--error) 28%, var(--border-soft));
}

.add-friends-page-v2 .af-cancel-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--error) 40%, transparent);
  outline-offset: 2px;
}

/* AddFriends-B: QR expanded overlay */
.add-friends-page-v2 .af-qr-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(6, 8, 12, 0.92);
}

.add-friends-page-v2 .af-qr-overlay.visible {
  display: flex;
}

.add-friends-page-v2 .af-qr-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 380px);
  padding: 24px 22px 22px;
  text-align: center;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-hover);
}

.add-friends-page-v2 .af-qr-overlay-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.add-friends-page-v2 .af-qr-overlay-lead {
  margin: 0 0 18px;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.add-friends-page-v2 .af-qr-overlay-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(85vw, 300px);
  margin-bottom: 20px;
  padding: 14px;
  background: #fff;
  border: 2px solid color-mix(in srgb, var(--accent-primary) 18%, #e8e8e8);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.add-friends-page-v2 .af-qr-overlay-frame img,
.add-friends-page-v2 #qrOverlayImg {
  display: block;
  width: min(78vw, 272px);
  height: min(78vw, 272px);
  object-fit: contain;
}

.add-friends-page-v2 .af-qr-overlay-close {
  min-width: 140px;
  padding: 11px 28px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}

.add-friends-page-v2 .af-qr-overlay-close:hover {
  color: var(--text-primary);
  background: var(--surface-2);
  border-color: var(--border-soft);
}

.add-friends-page-v2 .af-qr-overlay-close:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .add-friends-page-v2 .profile-v2-ad-rail {
    display: none;
  }

  .add-friends-page-v2 .af-card {
    padding: 20px 18px;
  }

  .add-friends-page-v2 .af-input-row {
    flex-wrap: wrap;
  }

  .add-friends-page-v2 .af-btn--shrink {
    flex: 1 1 auto;
  }
}

/* ——— Public profile v2 (viewing another user) ——— */
.profile-page-v2.public-profile-page-v2 {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.profile-page-v2.public-profile-page-v2
  .profile-v2-shell.profile-v2-shell--public-profile {
  flex: 1;
  min-height: 0;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 16px 48px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

.public-profile-page-v2 .pp-sidebar-guest {
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.public-profile-page-v2 .pp-sidebar-guest-brand {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.public-profile-page-v2 .pp-sidebar-guest-brand a {
  color: #fff;
  text-decoration: none;
}

.public-profile-page-v2 .pp-sidebar-guest-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.public-profile-page-v2 .pp-sidebar-guest-link {
  color: #1db88a;
  font-size: 14px;
  text-decoration: none;
}

.public-profile-page-v2 .pp-sidebar-guest-link:hover {
  text-decoration: underline;
}

.public-profile-page-v2 .pp-topbar-login {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.public-profile-page-v2 .pp-loading,
.public-profile-page-v2 .pp-content,
.public-profile-page-v2 .pp-error {
  min-width: 0;
}

.public-profile-page-v2 .pp-error {
  padding: 24px;
  background: #111;
  border-radius: 12px;
  border: 0.5px solid #222;
  color: #aaa;
}

.public-profile-page-v2 .pp-display-name {
  color: #fff;
  font-size: 1.65rem;
  font-weight: 800;
}

.public-profile-page-v2 .pp-header-card {
  background: #111;
  border-radius: 12px;
  border: 0.5px solid #222;
  overflow: hidden;
  margin-bottom: 16px;
}

.public-profile-page-v2 .pp-cover {
  height: 140px;
  background: #0a3d2e;
  opacity: 0.6;
}

.public-profile-page-v2 .pp-header-body {
  padding: 0 24px 24px;
}

.public-profile-page-v2 .pp-avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -32px;
  margin-bottom: 0;
}

.public-profile-page-v2 .pp-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid #111;
  background: #1db88a11;
  overflow: hidden;
  flex-shrink: 0;
}

.public-profile-page-v2 .pp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-profile-page-v2 .pp-avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 500;
  color: #1db88a;
  background: #1db88a11;
}

.public-profile-page-v2 .pp-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 4px;
}

.public-profile-page-v2 .pp-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.public-profile-page-v2 .pp-name {
  font-size: 22px;
  font-weight: 500;
  color: #fff;
}

.public-profile-page-v2 .pp-age {
  font-size: 1.65rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.public-profile-page-v2 .pp-online-badge {
  background: #1db88a22;
  color: #1db88a;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  border: 0.5px solid #1db88a44;
}

.public-profile-page-v2 .pp-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  align-items: center;
  margin-top: 1px;
  margin-bottom: 1px;
}

.public-profile-page-v2 .pp-meta span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.public-profile-page-v2 .pp-meta-sep {
  margin: 0 6px;
  color: var(--text-secondary);
  opacity: 0.5;
  font-size: 0.9rem;
}

.public-profile-page-v2 .pp-follow-counts {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  gap: 8px;
  margin-top: 1px;
}

.public-profile-page-v2 .pp-follow-count-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.public-profile-page-v2 .pp-follow-counts-sep {
  color: var(--text-secondary);
  opacity: 0.5;
}

.public-profile-page-v2 .pp-mutual {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #3b82f611;
  border: 0.5px solid #3b82f622;
  color: #3b82f6;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  margin-top: 10px;
}

.public-profile-page-v2 .pp-login-nudge {
  background: #1db88a11;
  border: 0.5px solid #1db88a33;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.public-profile-page-v2 .pp-nudge-text {
  font-size: 13px;
  color: #aaa;
}

.public-profile-page-v2 .pp-nudge-btn {
  background: #1db88a;
  border: none;
  color: #fff;
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.public-profile-page-v2 .pp-card {
  background: #111;
  border-radius: 12px;
  border: 0.5px solid #222;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.public-profile-page-v2 .pp-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-profile-page-v2 .pp-card-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1db88a;
  flex-shrink: 0;
}

.public-profile-page-v2 .pp-about-text {
  font-size: 0.95rem;
  color: #c4c8d0;
  line-height: 1.7;
  white-space: pre-wrap;
  margin: 0;
}

.public-profile-page-v2 .pp-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.public-profile-page-v2 .pp-photo-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 0.5px solid #222;
  padding: 0;
  background: none;
  font: inherit;
}

.public-profile-page-v2 .pp-photo-item:hover {
  border-color: #1db88a44;
}

.public-profile-page-v2 .pp-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.public-profile-page-v2 .pp-btn-primary {
  background: #1db88a;
  border: none;
  color: #fff;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.public-profile-page-v2 .pp-btn-primary:hover {
  background: #17a67a;
}

.public-profile-page-v2 .pp-btn-secondary {
  background: none;
  border: 0.5px solid #333;
  color: #ccc;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.public-profile-page-v2 .pp-btn-secondary:hover:not(:disabled) {
  border-color: #555;
  color: #fff;
}

.public-profile-page-v2 .pp-btn-secondary:disabled {
  opacity: 0.55;
  cursor: default;
}

.public-profile-page-v2 .pp-btn-friends {
  background: none;
  border: 0.5px solid #1db88a44;
  color: #1db88a;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 6px;
}

.public-profile-page-v2 .pp-btn-icon {
  background: none;
  border: 0.5px solid #333;
  color: #666;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.public-profile-page-v2 .pp-btn-icon:hover {
  border-color: #555;
  color: #aaa;
}

.public-profile-page-v2 .pp-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1a1a1a;
  border: 0.5px solid #333;
  border-radius: 8px;
  overflow: hidden;
  z-index: 50;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.public-profile-page-v2 .pp-dropdown-item {
  padding: 10px 16px;
  font-size: 13px;
  color: #ccc;
  cursor: pointer;
  white-space: nowrap;
}

.public-profile-page-v2 .pp-dropdown-item:hover {
  background: #222;
}

.public-profile-page-v2 .pp-dropdown-item--danger {
  color: #e74c3c;
}

.public-profile-page-v2 .pp-hidden {
  display: none !important;
}

.public-profile-page-v2 .pp-menu-host {
  position: relative;
}

/* ——— Public profile: logged-out (guest) layout ——— */
.pp-guest-top-nav {
  height: 48px;
  background: #0d0d0d;
  border-bottom: 1px solid #1a1a1a;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
}

.pp-guest-top-nav-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pp-guest-top-nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: #1db88a;
  text-decoration: none;
}

.pp-guest-top-nav-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #1db88a;
  color: #1db88a;
  background: transparent;
  border-radius: 6px;
  padding: 6px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.pp-guest-top-nav-login:hover {
  background: rgba(29, 184, 138, 0.12);
}

.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out {
  padding-top: 0;
}

.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
  .profile-v2-backdrop {
  display: none !important;
}

.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
  .profile-v2-menu-toggle {
  display: none !important;
}

.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
  .profile-v2-sidebar,
.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
  .profile-v2-ad-rail {
  display: none !important;
}

.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
  .profile-v2-shell.profile-v2-shell--public-profile {
  grid-template-columns: 1fr;
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  width: 100%;
  box-sizing: border-box;
}

.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
  .profile-v2-content-columns {
  display: block;
}

.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
  #profileActivityDomBridge {
  display: none !important;
}

.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
  .pp-login-nudge {
  display: none !important;
}

.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
  .pp-actions {
  display: none !important;
}

.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
  .pp-cover {
  height: 100px;
  background: #0f2a1a;
  opacity: 1;
}

.public-profile-page-v2 .pp-guest-gated-block {
  position: relative;
  margin-bottom: 16px;
}

.profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
  .pp-guest-gated-block {
  min-height: 200px;
}

.public-profile-page-v2 .pp-guest-gated-stack {
  position: relative;
  z-index: 0;
}

.public-profile-page-v2 .pp-guest-gated-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(13, 13, 13, 0) 0%,
    rgba(13, 13, 13, 0.6) 30%,
    rgba(13, 13, 13, 0.92) 60%,
    rgba(13, 13, 13, 0.98) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  padding-top: 60px;
  box-sizing: border-box;
  border-radius: 0 0 12px 12px;
}

.public-profile-page-v2 .pp-guest-gated-overlay-inner {
  max-width: 360px;
  text-align: center;
}

.public-profile-page-v2 .pp-guest-gated-text {
  color: #aaa;
  font-size: 14px;
  margin: 0 0 16px;
  line-height: 1.45;
  text-align: center;
}

.public-profile-page-v2 .pp-guest-gated-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.public-profile-page-v2 .pp-guest-gated-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 28px;
  box-sizing: border-box;
}

.public-profile-page-v2 .pp-guest-gated-btn--primary {
  background: #1db88a;
  color: #fff;
  border: 1px solid #1db88a;
}

.public-profile-page-v2 .pp-guest-gated-btn--primary:hover {
  filter: brightness(1.06);
}

.public-profile-page-v2 .pp-guest-gated-btn--outline {
  background: transparent;
  color: #1db88a;
  border: 1px solid #1db88a;
}

.public-profile-page-v2 .pp-guest-gated-btn--outline:hover {
  background: rgba(29, 184, 138, 0.1);
}

@media (max-width: 768px) {
  .profile-page-v2.public-profile-page-v2
    .profile-v2-shell.profile-v2-shell--public-profile {
    grid-template-columns: 1fr;
  }

  .profile-page-v2.public-profile-page-v2.public-profile-page-v2--guest-out
    .profile-v2-shell.profile-v2-shell--public-profile {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px 48px;
  }

  .public-profile-page-v2 .pp-actions {
    flex-wrap: wrap;
  }

  .public-profile-page-v2 .pp-photos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Admin broadcast + feed ads */
.wall-admin-post {
  border: 1px solid rgba(29, 184, 138, 0.25);
  background: rgba(29, 184, 138, 0.04);
}
.wall-admin-post-avatar-s {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(29, 184, 138, 0.25);
  color: #1db88a;
  font-weight: 700;
  font-size: 16px;
}
.wall-admin-post-brand {
  color: #e7ecf3;
}
.wall-admin-post-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px;
  padding: 0 12px;
}
.wall-admin-pinned-label {
  color: #8b9cb3;
  font-size: 12px;
  margin-right: 4px;
}
.wall-admin-post-tag {
  display: inline-block;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  margin-left: 6px;
  text-transform: capitalize;
}
.wall-admin-post-tag.announcement {
  background: #1a2a4a;
  color: #5b9bd5;
}
.wall-admin-post-tag.promotion {
  background: #2a1f0a;
  color: #ef9f27;
}
.wall-admin-post-tag.event {
  background: #0f2a1a;
  color: #1db88a;
}
.wall-ad-card {
  margin: 0 0 12px 0;
  border-radius: 10px;
  border: 1px solid #1e1e1e;
  overflow: hidden;
  background: #0d0d0d;
}
.wall-ad-label {
  color: #555;
  font-size: 11px;
  padding: 6px 12px 2px;
}

/* Settings — report a bug modal (Settings-C / MDS) */
.report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.78);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.report-modal-overlay[hidden] {
  display: none;
}
.report-modal {
  background: var(--surface-1);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card-hover);
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.report-modal-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.report-modal-title {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.report-modal-sub {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 0;
  line-height: 1.45;
}
.report-modal-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}
.report-success-banner {
  background: color-mix(in srgb, var(--success) 12%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--success) 26%, var(--border-subtle));
  color: var(--success);
  font-size: 0.8125rem;
  padding: 10px 14px;
  border-radius: var(--radius-input);
  text-align: center;
  line-height: 1.45;
}
.report-field-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: block;
}
.report-cat-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.report-cat-pill {
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: inherit;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}
.report-cat-pill:hover {
  color: var(--text-secondary);
  border-color: color-mix(in srgb, var(--accent-primary) 18%, var(--border-soft));
}
.report-cat-pill.active.report-cat-pill--bug {
  background: color-mix(in srgb, var(--accent-secondary) 14%, var(--surface-2));
  color: var(--accent-secondary);
  border-color: color-mix(in srgb, var(--accent-secondary) 32%, var(--border-subtle));
}
.report-cat-pill.active.report-cat-pill--feature {
  background: color-mix(in srgb, var(--accent-primary) 12%, var(--surface-2));
  color: var(--accent-primary);
  border-color: color-mix(in srgb, var(--accent-primary) 30%, var(--border-subtle));
}
.report-cat-pill.active.report-cat-pill--account {
  background: color-mix(in srgb, var(--accent-gold) 12%, var(--surface-2));
  color: var(--accent-gold);
  border-color: color-mix(in srgb, var(--accent-gold) 28%, var(--border-subtle));
}
.report-cat-pill.active.report-cat-pill--other {
  background: var(--surface-3);
  color: var(--text-secondary);
  border-color: var(--border-soft);
}
.report-field-input,
.report-field-textarea {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.8125rem;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  transition:
    border-color var(--motion-hover),
    box-shadow var(--motion-hover);
}
.report-field-input:focus,
.report-field-textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 40%, var(--border-soft));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 10%, transparent);
}
.report-field-input::placeholder,
.report-field-textarea::placeholder {
  color: var(--text-muted);
}
.report-field-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
.report-char-count {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-align: right;
  margin-top: 4px;
}
.report-modal-footer-wrap {
  padding: 0 22px 18px;
  flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
}
.report-modal-footer {
  padding: 14px 0 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.report-btn-cancel {
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  padding: 8px 18px;
  cursor: pointer;
  font-family: inherit;
  transition:
    background var(--motion-hover),
    color var(--motion-hover),
    border-color var(--motion-hover);
}
.report-btn-cancel:hover {
  background: color-mix(in srgb, var(--surface-3) 85%, var(--surface-2));
  color: var(--text-primary);
}
.report-btn-submit {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
  border-radius: var(--radius-pill);
  color: #0b0d11;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 8px 20px;
  cursor: pointer;
  font-family: inherit;
  transition:
    background var(--motion-hover),
    border-color var(--motion-hover);
}
.report-btn-submit:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
}
.report-btn-cancel:focus-visible,
.report-btn-submit:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}
.report-footer-error {
  color: var(--error);
  font-size: 0.75rem;
  margin: 8px 0 0;
  text-align: right;
  min-height: 1em;
  line-height: 1.4;
}

/* ── /games match tab: TTT & TTT-Trivia sizing (games.js toggles body.games-tab-match-active; overlays live on body) ── */
/* If TTT markup is ever mounted under #gamesMatchScreen, these apply; primary rules use body.games-tab-match-active + overlay IDs. */
#gamesMatchScreen .ttt-panel {
  min-height: 480px;
  width: 100%;
}
#gamesMatchScreen .ttt-trivia-panel {
  min-height: 520px;
  width: 100%;
  overflow-y: auto;
}

#gamesMatchScreen .games-match-game-area {
  overflow: visible;
  max-height: none;
}
#gamesMatchScreen #gamesMatchGameMount {
  overflow-y: visible;
  max-height: none;
}

body.games-tab-match-active
  #tttFlowOverlay.quiz-flow-chat-panel
  .ttt-flow-shell.quiz-panel--wide {
  max-height: none !important;
  overflow: visible !important;
  width: 100%;
  max-width: min(560px, calc(100vw - 32px));
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

body.games-tab-match-active #tttFlowOverlay #tttMount {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 440px;
  min-width: 0;
}

body.games-tab-match-active #tttFlowOverlay .ttt-panel {
  min-height: 480px;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
}

body.games-tab-match-active #tttFlowOverlay .ttt-board-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1 1 auto;
  min-height: 260px;
  overflow: visible;
}

body.games-tab-match-active #tttFlowOverlay .ttt-board-svg-wrap {
  width: 240px !important;
  height: 240px !important;
  min-width: 240px;
  min-height: 240px;
  flex-shrink: 0;
  position: relative;
}

body.games-tab-match-active #tttFlowOverlay .ttt-cells {
  width: 100%;
  height: 100%;
  min-width: 240px;
  min-height: 240px;
}

body.games-tab-match-active
  #tttTriviaFlowOverlay.quiz-flow-chat-panel
  .ttt-trivia-flow-shell.quiz-panel--wide {
  max-height: none !important;
  overflow: visible !important;
  width: 100%;
  max-width: min(720px, calc(100vw - 32px));
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

body.games-tab-match-active #tttTriviaFlowOverlay #tttTriviaMount {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  min-width: 0;
}

body.games-tab-match-active #tttTriviaFlowOverlay .ttt-trivia-panel {
  min-height: 520px;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
}

body.games-tab-match-active #tttTriviaFlowOverlay .ttt-trivia-play-wrap {
  overflow: visible;
  flex: 1 1 auto;
  min-height: 0;
}

body.games-tab-match-active #tttTriviaFlowOverlay .ttt-trivia-game-area {
  overflow: visible;
  align-items: stretch;
}

body.games-tab-match-active #tttTriviaFlowOverlay .ttt-trivia-instructions {
  overflow-y: visible;
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
}

body.games-tab-match-active
  #tttTriviaFlowOverlay
  #tttTriviaInstructionsWrap:not(.quiz-hidden) {
  flex: 0 0 auto;
  overflow: visible;
  max-height: none;
}

body.games-tab-match-active #tttTriviaFlowOverlay .ttt-trivia-ready-btn {
  flex-shrink: 0;
  margin-bottom: 8px;
}

@media (min-width: 1024px) {
  body.games-tab-match-active #tttTriviaFlowOverlay .ttt-trivia-panel {
    min-height: 560px;
  }
  body.games-tab-match-active #tttTriviaFlowOverlay .ttt-trivia-instructions {
    padding-bottom: 24px;
  }
}

.wall-delete-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  padding: 16px;
}
.wall-delete-modal--visible {
  opacity: 1;
  pointer-events: auto;
}
.wall-delete-modal-inner {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 24px;
  max-width: 380px;
  width: 100%;
}
.wall-delete-modal-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
}
.wall-delete-modal-msg {
  margin: 0 0 20px;
  font-size: 0.9rem;
  color: #aaa;
}
.wall-delete-modal-actions {
  display: flex;
  gap: 12px;
}
.wall-delete-modal-actions .btn {
  flex: 1;
}
.btn-danger {
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover {
  background: #c0392b;
}

/* ── Video chat hub (Video-A1) — /video-chat landing only ── */
.video-chat-hub .profile-online-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.video-chat-hub .profile-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

.video-chat-hub .profile-online-count {
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 600;
}

.video-chat-hub .profile-online-sep {
  color: var(--text-muted);
  font-size: 13px;
}

.video-chat-hub .profile-inchat-count {
  color: var(--text-secondary);
  font-size: 13px;
}

.video-chat-hub .profile-peak-hours {
  padding: 0 0 14px;
  margin-bottom: 4px;
}

.video-chat-hub .profile-peak-hours-text {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.video-chat-hub .vc-match-card {
  padding: 20px;
  margin-bottom: 24px;
}

.video-chat-hub .vc-match-card-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.video-chat-hub .profile-v2-match-horiz {
  padding: 20px;
}

.video-chat-hub .profile-v2-match-horiz-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.video-chat-hub .profile-v2-match-age-box-label {
  color: var(--text-muted);
}

.video-chat-hub .profile-v2-match-horiz .profile-age-field-input,
.video-chat-hub .profile-v2-match-horiz select {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
}

.video-chat-hub .profile-v2-match-horiz .profile-age-field-input:focus,
.video-chat-hub .profile-v2-match-horiz select:focus {
  border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-soft));
  outline: none;
}

.video-chat-hub .profile-v2-match-age-sep {
  color: var(--text-muted);
}

.video-chat-hub .profile-v2-match-horiz-field--check {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.video-chat-hub .profile-v2-match-horiz-field--check input[type="checkbox"] {
  accent-color: var(--accent-primary);
}

.video-chat-hub .vc-match-actions {
  margin-top: 18px;
}

.video-chat-hub .profile-v2-match-start-btn {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, transparent);
  border-radius: var(--radius-input);
  box-shadow: var(--glow-primary);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.video-chat-hub .profile-v2-match-start-btn:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
}

.video-chat-hub .vc-hub-section {
  margin-bottom: 28px;
}

.video-chat-hub .vc-hub-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.video-chat-hub .vc-hub-section-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.video-chat-hub .vc-hub-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.video-chat-hub .vc-hub-toolbar-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.video-chat-hub .vc-hub-toolbar-divider {
  width: 1px;
  height: 14px;
  background: var(--border-soft);
  flex-shrink: 0;
}

.video-chat-hub .vc-hub-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-chat-hub .vc-hub-state {
  margin: 0;
  padding: 20px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.video-chat-hub .vc-hub-state--error {
  color: var(--error);
}

.video-chat-hub .sd-filter-chip,
.video-chat-hub .sd-sort-chip,
.video-chat-hub .dm-filter-chip,
.video-chat-hub .dm-sort-chip {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.video-chat-hub .sd-filter-chip:hover,
.video-chat-hub .sd-sort-chip:hover,
.video-chat-hub .dm-filter-chip:hover,
.video-chat-hub .dm-sort-chip:hover {
  color: var(--text-secondary);
  border-color: color-mix(in srgb, var(--text-primary) 12%, var(--border-soft));
}

.video-chat-hub .sd-filter-chip--active,
.video-chat-hub .dm-filter-chip--active {
  background: color-mix(in srgb, var(--accent-primary) 12%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-primary) 35%, var(--border-soft));
  color: var(--accent-primary);
}

.video-chat-hub .sd-sort-chip--active,
.video-chat-hub .dm-sort-chip--active {
  background: var(--surface-3);
  border-color: color-mix(in srgb, var(--text-primary) 14%, var(--border-soft));
  color: var(--text-primary);
}

.video-chat-hub .vc-hub-state-select {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}

.video-chat-hub .vc-hub-state-select:focus {
  border-color: color-mix(in srgb, var(--accent-primary) 40%, var(--border-soft));
  outline: none;
}

.video-chat-hub .vc-hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.video-chat-hub .vc-hub-btn--compact {
  padding: 8px 16px;
  flex-shrink: 0;
}

.video-chat-hub .vc-hub-btn--sm {
  padding: 7px 14px;
  font-size: 12px;
}

.video-chat-hub .vc-hub-btn--block {
  flex: 1;
  padding: 11px 16px;
  border-radius: var(--radius-input);
}

.video-chat-hub .vc-hub-btn--primary {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  color: var(--bg-main);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.video-chat-hub .vc-hub-btn--primary:hover {
  background: linear-gradient(
    180deg,
    var(--accent-primary-hover),
    var(--accent-primary-pressed)
  );
}

.video-chat-hub .vc-hub-btn--secondary {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
}

.video-chat-hub .vc-hub-btn--secondary:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--text-primary) 12%, var(--border-soft));
}

.video-chat-hub .vc-hub-btn--ghost {
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--surface-1));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 28%, var(--border-soft));
  color: var(--accent-primary);
  cursor: default;
  opacity: 0.85;
}

.video-chat-hub .vc-hub-btn--danger {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--error) 35%, transparent);
  color: var(--error);
}

.video-chat-hub .vc-hub-btn--danger:hover {
  background: color-mix(in srgb, var(--error) 10%, transparent);
}

.video-chat-hub .vc-hub-btn--challenge {
  background: color-mix(in srgb, var(--accent-secondary) 22%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent-secondary) 40%, var(--border-soft));
  color: var(--text-primary);
}

.video-chat-hub .vc-hub-btn--challenge:hover {
  background: color-mix(in srgb, var(--accent-secondary) 32%, var(--surface-2));
}

.video-chat-hub .vc-hub-btn--waiting {
  background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, var(--border-soft));
  color: var(--accent-primary);
  cursor: pointer;
}

.video-chat-hub .vc-hub-btn:disabled {
  cursor: default;
}

.video-chat-hub .vc-hub-card {
  margin-bottom: 0;
  padding: 16px 18px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-1);
  box-shadow: var(--shadow-card);
}

.video-chat-hub .vc-hub-card--scheduled {
  border-color: color-mix(in srgb, var(--accent-secondary) 22%, var(--border-subtle));
  background:
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--accent-secondary) 6%, var(--surface-1)),
      var(--surface-1)
    );
}

.video-chat-hub .vc-hub-card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.video-chat-hub .vc-hub-card-main {
  flex: 1;
  min-width: 0;
}

.video-chat-hub .vc-hub-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.video-chat-hub .vc-hub-card-title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.video-chat-hub .vc-hub-card-meta {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 4px;
}

.video-chat-hub .vc-hub-card-meta--host {
  font-size: 11px;
  margin-top: 2px;
}

.video-chat-hub .vc-hub-card-desc {
  color: var(--text-secondary);
  font-size: 12px;
  font-style: italic;
  margin: 4px 0 8px;
  line-height: 1.45;
}

.video-chat-hub .vc-hub-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}

.video-chat-hub .vc-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  line-height: 1.3;
}

.video-chat-hub .vc-badge--live {
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent-primary) 32%, transparent);
  color: var(--accent-primary);
}

.video-chat-hub .vc-badge--scheduled {
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border-color: color-mix(in srgb, var(--warning) 28%, transparent);
  color: var(--warning);
}

.video-chat-hub .vc-badge--match {
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-primary) 22%, var(--border-soft));
  color: var(--accent-primary);
  font-size: 10px;
}

.video-chat-hub .vc-badge--spots {
  background: var(--surface-3);
  border-color: var(--border-soft);
  color: var(--text-secondary);
}

.video-chat-hub .vc-badge--role {
  background: color-mix(in srgb, var(--accent-secondary) 12%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-secondary) 28%, var(--border-soft));
  color: var(--accent-secondary);
  font-size: 10px;
}

.video-chat-hub .vc-badge--waiting {
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border-color: color-mix(in srgb, var(--warning) 28%, transparent);
  color: var(--warning);
}

.video-chat-hub .vc-badge--for {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent-primary) 28%, transparent);
  color: var(--accent-primary);
  font-size: 10px;
}

.video-chat-hub .vc-badge--against {
  background: color-mix(in srgb, var(--error) 12%, transparent);
  border-color: color-mix(in srgb, var(--error) 28%, transparent);
  color: var(--error);
  font-size: 10px;
}

.video-chat-hub .vc-badge--category {
  background: var(--surface-3);
  border-color: var(--border-soft);
  color: var(--text-muted);
}

.video-chat-hub .vc-debate-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-2));
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.video-chat-hub .vc-debate-card-body {
  flex: 1;
  min-width: 0;
}

.video-chat-hub .vc-debate-topic {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.4;
}

.video-chat-hub .vc-debate-sub {
  color: var(--text-muted);
  font-size: 11px;
}

.video-chat-hub .vc-mode-toggle {
  display: flex;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--surface-2);
}

.video-chat-hub .vc-mode-btn {
  flex: 1;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.video-chat-hub .vc-mode-btn--active {
  background: color-mix(in srgb, var(--accent-primary) 16%, var(--surface-2));
  color: var(--text-primary);
  font-weight: 500;
}

.video-chat-hub .vc-gender-pill,
.video-chat-hub .me-gender-pill {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.video-chat-hub .vc-gender-pill--active,
.video-chat-hub .me-gender-pill--active {
  background: color-mix(in srgb, var(--accent-primary) 12%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-primary) 40%, var(--border-soft));
  color: var(--accent-primary);
}

.video-chat-hub .vc-gender-pill-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.video-chat-hub .vc-gender-pill-row--manage .me-gender-pill {
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-input);
}

.video-chat-hub #hostEventModal .vc-hub-modal-actions,
.video-chat-hub #manageEventModal .vc-hub-modal-actions,
.video-chat-hub #startDebateModal .vc-hub-modal-actions {
  display: flex;
  gap: 10px;
}

.video-chat-hub #hostEventModal .vc-hub-modal-error,
.video-chat-hub #manageEventModal .vc-hub-modal-error,
.video-chat-hub #startDebateModal .vc-hub-modal-error {
  color: var(--error);
  font-size: 13px;
  margin: 0 0 10px;
  min-height: 1.2em;
}

/* ── Video chat hub modals (Video-A2) ── */
.video-chat-hub .vc-hub-modal.profile-send-message-modal {
  background: rgba(6, 8, 12, 0.72);
  align-items: center;
  padding: 20px 16px;
}

.video-chat-hub .vc-hub-modal-inner.profile-send-message-modal-inner {
  display: flex;
  flex-direction: column;
  max-width: 460px;
  max-height: min(90vh, 720px);
  padding: 0;
  overflow: hidden;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.4),
    0 0 0 1px color-mix(in srgb, var(--accent-primary) 6%, transparent);
}

.video-chat-hub .vc-hub-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.video-chat-hub .vc-hub-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.video-chat-hub .vc-hub-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.video-chat-hub .vc-hub-modal-close:hover {
  background: var(--surface-3);
  border-color: var(--border-soft);
  color: var(--text-primary);
}

.video-chat-hub .vc-hub-modal-close:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}

.video-chat-hub .vc-hub-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px;
}

.video-chat-hub .vc-hub-modal-footer {
  flex-shrink: 0;
  padding: 12px 18px 18px;
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-2) 40%, var(--surface-1));
}

.video-chat-hub .vc-hub-modal-footer .vc-hub-modal-actions {
  margin-top: 0;
}

.video-chat-hub .vc-hub-field {
  margin-bottom: 16px;
}

.video-chat-hub .vc-hub-field:last-child {
  margin-bottom: 0;
}

.video-chat-hub .vc-hub-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  text-transform: none;
}

.video-chat-hub .vc-hub-label-hint {
  font-weight: 400;
  color: var(--text-muted);
}

.video-chat-hub .vc-hub-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.video-chat-hub .vc-hub-char-count {
  margin: 6px 0 0;
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
}

.video-chat-hub .vc-hub-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.video-chat-hub .vc-hub-field-row .vc-hub-select,
.video-chat-hub .vc-hub-field-row .settings-v2-select,
.video-chat-hub .vc-hub-field-row .settings-v2-input {
  flex: 1;
  min-width: 0;
}

.video-chat-hub .vc-hub-field-sep {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

.video-chat-hub .vc-hub-select--full,
.video-chat-hub #hostEventModal .settings-v2-select,
.video-chat-hub #manageEventModal .settings-v2-select,
.video-chat-hub #startDebateModal .settings-v2-select {
  width: 100%;
  box-sizing: border-box;
}

.video-chat-hub #hostEventModal .settings-v2-input,
.video-chat-hub #hostEventModal .settings-v2-textarea,
.video-chat-hub #hostEventModal .settings-v2-select,
.video-chat-hub #manageEventModal .settings-v2-input,
.video-chat-hub #manageEventModal .settings-v2-textarea,
.video-chat-hub #manageEventModal .settings-v2-select,
.video-chat-hub #startDebateModal .settings-v2-input,
.video-chat-hub #startDebateModal .settings-v2-textarea,
.video-chat-hub #startDebateModal .settings-v2-select {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.video-chat-hub #hostEventModal .settings-v2-textarea,
.video-chat-hub #manageEventModal .settings-v2-textarea,
.video-chat-hub #startDebateModal .settings-v2-textarea {
  min-height: 88px;
  resize: none;
  line-height: 1.45;
}

.video-chat-hub #hostEventModal .settings-v2-input:focus,
.video-chat-hub #hostEventModal .settings-v2-textarea:focus,
.video-chat-hub #hostEventModal .settings-v2-select:focus,
.video-chat-hub #manageEventModal .settings-v2-input:focus,
.video-chat-hub #manageEventModal .settings-v2-textarea:focus,
.video-chat-hub #manageEventModal .settings-v2-select:focus,
.video-chat-hub #startDebateModal .settings-v2-input:focus,
.video-chat-hub #startDebateModal .settings-v2-textarea:focus,
.video-chat-hub #startDebateModal .settings-v2-select:focus {
  border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-soft));
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.video-chat-hub #hostEventModal .settings-v2-input::placeholder,
.video-chat-hub #hostEventModal .settings-v2-textarea::placeholder,
.video-chat-hub #startDebateModal .settings-v2-textarea::placeholder {
  color: var(--text-muted);
}

.video-chat-hub .vc-hub-input-readonly,
.video-chat-hub #hostEventModal .settings-v2-input[readonly],
.video-chat-hub #startDebateModal .settings-v2-input[readonly] {
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface-3));
  cursor: default;
}

.video-chat-hub .vc-hub-input-date,
.video-chat-hub #hostEventModal input[type="date"],
.video-chat-hub #hostEventModal input[type="time"],
.video-chat-hub #manageEventModal input[type="date"],
.video-chat-hub #manageEventModal input[type="time"] {
  color-scheme: dark;
}

.video-chat-hub #hostEventModal label[style],
.video-chat-hub #startDebateModal label[style] {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary) !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
}

.video-chat-hub #hostEventModal label[style] span,
.video-chat-hub #startDebateModal label[style] span {
  font-weight: 400;
  color: var(--text-muted) !important;
  text-transform: none !important;
}

.video-chat-hub #manageEventModal label[style] {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary) !important;
}

.video-chat-hub #hostEventModal .vc-hub-modal-body > div[style*="font-size:11px"],
.video-chat-hub #hostEventModal .vc-hub-modal-body > div[style*="text-align:right"],
.video-chat-hub #startDebateModal .vc-hub-modal-body > div[style*="text-align:right"] {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  margin-bottom: 16px;
  line-height: 1.45;
}

.video-chat-hub #manageEventModal .vc-hub-modal-body > div[style*="text-align:right"] {
  text-align: right;
  font-size: 11px !important;
  color: var(--text-muted) !important;
  margin-bottom: 16px;
}

.video-chat-hub #hostEventModal .vc-hub-modal-body > div[style*="display:flex"][style*="gap:8px"],
.video-chat-hub #startDebateModal .vc-hub-modal-body > div[style*="display:flex"][style*="gap:8px"] {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.video-chat-hub #hostEventModal .vc-hub-modal-body > div[style*="gap:10px"],
.video-chat-hub #manageEventModal .vc-hub-modal-body > div[style*="gap:8px"] {
  margin-bottom: 16px;
}

.video-chat-hub #hostEventModal .vc-hub-modal-body > div[style*="gap:10px"] span,
.video-chat-hub #manageEventModal .vc-hub-modal-body > div[style*="gap:8px"] span {
  color: var(--text-muted);
}

.video-chat-hub .vc-hub-callout {
  border-radius: var(--radius-input);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.5;
}

.video-chat-hub .vc-hub-callout--info {
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 22%, var(--border-soft));
  color: var(--text-secondary);
}

.video-chat-hub .vc-hub-callout--live {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}

.video-chat-hub .vc-hub-callout-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.video-chat-hub .vc-hub-callout-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.video-chat-hub .vc-mode-toggle {
  margin-bottom: 18px;
}

.video-chat-hub .vc-mode-btn:hover:not(.vc-mode-btn--active) {
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
}

.video-chat-hub .vc-mode-btn--active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-primary) 25%, transparent);
}

.video-chat-hub .vc-gender-pill:hover:not(.vc-gender-pill--active),
.video-chat-hub .me-gender-pill:hover:not(.me-gender-pill--active) {
  color: var(--text-secondary);
  border-color: color-mix(in srgb, var(--text-primary) 12%, var(--border-soft));
}

.video-chat-hub .vc-gender-pill-row--debate .vc-gender-pill {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-input);
}

.video-chat-hub .vc-gender-pill--active,
.video-chat-hub .me-gender-pill--active {
  font-weight: 500;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.video-chat-hub .vc-hub-modal-footer .vc-hub-btn--block {
  min-height: 44px;
}

/* —— Debate-A: live room overlay chrome (waiting / countdown / topbar) —— */
#debateRoomOverlay.debate-room-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-main);
}

#debateRoomOverlay #dbBody {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

#debateRoomOverlay #dbLeft {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-shrink: 0;
}

#debateRoomOverlay #dbAdRail {
  flex-shrink: 0;
}

#debateRoomOverlay .db-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 18px;
  background: color-mix(in srgb, var(--surface-1) 92%, var(--bg-main));
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--accent-primary) 8%, transparent);
}

#debateRoomOverlay .db-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

#debateRoomOverlay .db-topbar-brand::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 22%, transparent);
}

#debateRoomOverlay .db-topbar-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

#debateRoomOverlay .db-btn {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  padding: 7px 14px;
  border-radius: var(--radius-input);
  cursor: pointer;
  transition:
    background-color var(--motion-hover),
    border-color var(--motion-hover),
    color var(--motion-hover);
}

#debateRoomOverlay .db-btn--secondary {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
}

#debateRoomOverlay .db-btn--secondary:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--text-primary) 12%, var(--border-soft));
  background: var(--surface-3);
}

#debateRoomOverlay .db-btn--secondary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
  outline-offset: 2px;
}

#debateRoomOverlay .db-waiting-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  min-height: 0;
}

#debateRoomOverlay .db-waiting-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 320px;
  width: 100%;
  padding: 28px 24px 24px;
  text-align: center;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow:
    var(--shadow-card),
    inset 0 1px 0 color-mix(in srgb, var(--text-primary) 4%, transparent);
}

#debateRoomOverlay .db-waiting-icon {
  font-size: 2.5rem;
  line-height: 1;
  opacity: 0.88;
  animation: db-waiting-glow 2.8s ease-in-out infinite;
}

@keyframes db-waiting-glow {
  0%,
  100% {
    opacity: 0.65;
  }

  50% {
    opacity: 1;
  }
}

#debateRoomOverlay .db-waiting-text {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-secondary);
}

#debateRoomOverlay .db-waiting-card .db-btn--secondary {
  margin-top: 4px;
}

#debateRoomOverlay .db-countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  gap: 4px;
  background: color-mix(in srgb, var(--bg-main) 94%, black);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent-primary) 10%, transparent);
}

#debateRoomOverlay .db-countdown-label {
  margin: 0 0 6px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#debateRoomOverlay .db-countdown-number {
  margin: 4px 0 2px;
  font-size: clamp(4rem, 14vw, 5.5rem);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--accent-primary);
  text-shadow: 0 0 40px color-mix(in srgb, var(--accent-primary) 28%, transparent);
}

#debateRoomOverlay .db-countdown-sub {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

#debateRoomOverlay .db-countdown-ad-slot {
  margin-top: 22px;
  min-height: 100px;
  width: min(100%, 300px);
  text-align: center;
}

#debateRoomOverlay .db-countdown-ad-card {
  padding: 18px 20px;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

#debateRoomOverlay .db-countdown-ad-kicker {
  margin-bottom: 8px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#debateRoomOverlay .db-countdown-ad-title {
  margin-bottom: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

#debateRoomOverlay .db-countdown-ad-body {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

#debateRoomOverlay .db-countdown-ad-skip {
  margin-top: 12px;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* —— Debate-B: debater video stage (cards / identity / connect) —— */
#debateRoomOverlay #dbVideoCall.db-video-stage {
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 10px 10px 12px;
  min-height: 0;
  box-sizing: border-box;
}

#debateRoomOverlay #dbRemoteCard.db-video-card--remote,
#debateRoomOverlay #dbLocalCard.db-video-card--local {
  max-height: 44vh;
  max-width: min(100%, calc(44vh * 16 / 9));
}

#debateRoomOverlay #dbRemoteCard.db-video-card--remote {
  flex: 0 0 auto;
  align-self: center;
  border-color: color-mix(in srgb, var(--accent-primary) 22%, var(--border-soft));
  box-shadow:
    var(--shadow-card),
    0 0 0 1px color-mix(in srgb, var(--accent-primary) 14%, transparent),
    0 12px 40px color-mix(in srgb, var(--bg-main) 55%, transparent);
}

#debateRoomOverlay #dbLocalCard.db-video-card--local {
  flex: 0 0 auto;
  align-self: center;
  border-color: var(--border-subtle);
  box-shadow:
    var(--shadow-card),
    inset 0 1px 0 color-mix(in srgb, var(--text-primary) 3%, transparent);
  opacity: 0.98;
}

#debateRoomOverlay .db-name-bar {
  gap: 6px;
}

#debateRoomOverlay .db-name-pill--remote {
  max-width: min(220px, 46vw);
  font-size: 0.8125rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--surface-3) 88%, transparent);
  border-color: color-mix(in srgb, var(--accent-primary) 18%, var(--border-subtle));
  color: var(--text-primary);
}

#debateRoomOverlay .db-name-pill--local {
  max-width: min(180px, 40vw);
  font-size: 0.75rem;
  font-weight: 500;
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

#debateRoomOverlay .db-position-badge {
  display: inline-block;
  flex-shrink: 0;
  margin-left: 2px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.2;
  border: 1px solid transparent;
}

#debateRoomOverlay .db-position-badge--for {
  background: color-mix(in srgb, var(--accent-primary) 16%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-primary) 32%, var(--border-soft));
  color: var(--accent-primary);
}

#debateRoomOverlay .db-position-badge--against {
  background: color-mix(in srgb, var(--error) 12%, var(--surface-2));
  border-color: color-mix(in srgb, var(--error) 28%, var(--border-soft));
  color: color-mix(in srgb, var(--error) 88%, var(--text-primary));
}

#debateRoomOverlay .vc-handshake-top-center.db-connect-wrap #dbConnectBtn.db-connect-btn {
  pointer-events: auto;
}

#debateRoomOverlay .vc-handshake-top-center #dbConnectBtn.video-handshake-btn {
  background: color-mix(in srgb, var(--accent-primary) 22%, var(--surface-3));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 55%, var(--border-soft));
  color: var(--text-primary);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

#debateRoomOverlay .vc-handshake-top-center #dbConnectBtn.video-handshake-btn:hover:not(:disabled):not(.db-connect-btn--connected) {
  background: color-mix(in srgb, var(--accent-primary) 30%, var(--surface-3));
  border-color: var(--accent-primary);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent-primary) 24%, transparent);
}

#debateRoomOverlay #dbConnectBtn.db-connect-btn--connected {
  background: color-mix(in srgb, var(--surface-3) 72%, transparent);
  border-color: var(--border-soft);
  color: var(--text-muted);
  box-shadow: none;
  cursor: default;
  opacity: 0.92;
}

#debateRoomOverlay #dbConnectBtn.db-connect-btn--connected .handshake-connect-text {
  color: var(--text-muted);
}

#debateRoomOverlay #dbConnectBtn.db-handshake-pulse {
  animation: db-debate-connect-pulse 1.1s ease-in-out infinite;
}

/* Debate tug bar — dual fill sides (FOR left, AGAINST right) */
#debateRoomOverlay .db-tug-fill-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#debateRoomOverlay .db-tug-fill-side {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  transition: width 0.5s ease;
}

#debateRoomOverlay .db-tug-fill-side--for {
  left: 0;
  background: var(--accent-primary);
  border-radius: 20px 0 0 20px;
}

#debateRoomOverlay .db-tug-fill-side--against {
  right: 0;
  background: var(--error);
  border-radius: 0 20px 20px 0;
}

/* —— Debate-C: right rail / audience vote / chat polish —— */
#debateRoomOverlay #dbRight.db-right-rail {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-main);
  border-left: 1px solid var(--border-subtle);
}

#debateRoomOverlay .db-right-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

#debateRoomOverlay .db-right-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

#debateRoomOverlay .db-right-kicker {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 2px;
}

#debateRoomOverlay .db-right-kicker--center {
  text-align: center;
  padding-top: 0;
  margin-bottom: 8px;
}

#debateRoomOverlay .db-category-badge {
  font-size: 0.6875rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-3) 88%, transparent);
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

#debateRoomOverlay .db-topic-label {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 10px;
}

#debateRoomOverlay .db-sides-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

#debateRoomOverlay .db-side-badge {
  font-size: 0.625rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.04em;
}

#debateRoomOverlay .db-side-badge--for {
  background: color-mix(in srgb, var(--accent-primary) 18%, var(--surface-2));
  color: var(--accent-primary);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 32%, var(--border-soft));
}

#debateRoomOverlay .db-side-badge--against {
  background: color-mix(in srgb, var(--error) 14%, var(--surface-2));
  color: color-mix(in srgb, var(--error) 88%, var(--text-primary));
  border: 1px solid color-mix(in srgb, var(--error) 28%, var(--border-soft));
}

#debateRoomOverlay .db-side-name {
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

#debateRoomOverlay .db-sides-vs {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin: 0 2px;
}

#debateRoomOverlay .db-right-section--timer {
  text-align: center;
  background: var(--surface-1);
}

#debateRoomOverlay .db-right-section--timer-compact {
  padding: 12px 14px;
}

#debateRoomOverlay .db-timer-display {
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#debateRoomOverlay #dbTimerDisplay.db-timer-display {
  font-size: 2.375rem;
}

#debateRoomOverlay .db-timer-display--compact {
  font-size: 2rem;
}

#debateRoomOverlay .db-timer-display--warning {
  color: var(--warning);
}

#debateRoomOverlay .db-timer-display--urgent {
  color: var(--error);
}

#debateRoomOverlay .db-timer-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 6px;
}

#debateRoomOverlay .db-right-section--audience {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

#debateRoomOverlay .db-audience-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

#debateRoomOverlay .db-audience-count,
#debateRoomOverlay #dbAudienceCount,
#debateRoomOverlay #dbAudCount {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

#debateRoomOverlay #dbDebaterRail.db-debater-rail {
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

#debateRoomOverlay .db-right-section--vote .db-right-kicker,
#debateRoomOverlay .db-right-section--vote-panel .db-right-kicker {
  margin-bottom: 10px;
}

#debateRoomOverlay .db-tug-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

#debateRoomOverlay .db-vote-label {
  font-size: 0.75rem;
  font-weight: 600;
}

#debateRoomOverlay .db-vote-label--for {
  color: var(--accent-primary);
}

#debateRoomOverlay .db-vote-label--against {
  color: var(--error);
}

#debateRoomOverlay .db-tug-track {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--border-subtle);
}

#debateRoomOverlay .db-tug-track--debater {
  height: 16px;
}

#debateRoomOverlay .db-tug-track--audience {
  height: 12px;
}

#debateRoomOverlay .db-tug-split {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--bg-main);
  pointer-events: none;
}

#debateRoomOverlay .db-tug-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 8px;
}

#debateRoomOverlay .db-tug-pct {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#debateRoomOverlay .db-tug-pct--for {
  font-size: 0.8125rem;
  color: var(--accent-primary);
}

#debateRoomOverlay .db-tug-pct--against {
  font-size: 0.8125rem;
  color: var(--error);
}

#debateRoomOverlay .db-right-section--vote-panel .db-tug-pct {
  font-size: 0.75rem;
}

#debateRoomOverlay .db-tug-total {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: center;
}

#debateRoomOverlay .db-right-section--recent {
  flex: 1;
  min-height: 0;
}

#debateRoomOverlay .db-recent-votes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#debateRoomOverlay .db-recent-votes-note {
  margin: 14px 0 0;
  font-size: 0.625rem;
  color: var(--text-muted);
  text-align: center;
}

#debateRoomOverlay .db-vote-btn-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

#debateRoomOverlay .db-vote-btn {
  flex: 1;
  padding: 9px 10px;
  border-radius: var(--radius-input);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

#debateRoomOverlay .db-vote-btn--for {
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 42%, var(--border-soft));
  color: var(--accent-primary);
}

#debateRoomOverlay .db-vote-btn--against {
  background: color-mix(in srgb, var(--error) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 38%, var(--border-soft));
  color: var(--error);
}

#debateRoomOverlay .db-vote-btn--for:hover:not(.db-vote-btn--selected) {
  background: color-mix(in srgb, var(--accent-primary) 18%, var(--surface-2));
  border-color: var(--accent-primary);
}

#debateRoomOverlay .db-vote-btn--against:hover:not(.db-vote-btn--selected) {
  background: color-mix(in srgb, var(--error) 14%, var(--surface-2));
  border-color: var(--error);
}

#debateRoomOverlay .db-vote-btn--for.db-vote-btn--selected {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--bg-main);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent-primary) 28%, transparent);
}

#debateRoomOverlay .db-vote-btn--against.db-vote-btn--selected {
  background: var(--error);
  border-color: var(--error);
  color: var(--bg-main);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--error) 24%, transparent);
}

#debateRoomOverlay .db-vote-hint {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 10px;
  min-height: 14px;
  line-height: 1.35;
}

#debateRoomOverlay #dbAudienceLayout.db-audience-layout {
  flex: 1;
  min-height: 0;
  width: 100%;
}

#debateRoomOverlay .db-audience-layout-inner {
  display: flex;
  height: 100%;
  width: 100%;
  min-width: 0;
}

#debateRoomOverlay #dbAudLeft.db-aud-left {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg-main);
  border-right: 1px solid var(--border-subtle);
}

#debateRoomOverlay .db-right-section--debaters .db-right-kicker {
  margin-bottom: 10px;
}

#debateRoomOverlay .db-debater-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#debateRoomOverlay .db-debater-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-input);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}

#debateRoomOverlay .db-debater-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  flex-shrink: 0;
}

#debateRoomOverlay .db-debater-avatar--host {
  background: color-mix(in srgb, var(--accent-primary) 72%, var(--surface-3));
  color: var(--bg-main);
}

#debateRoomOverlay .db-debater-avatar--challenger {
  background: color-mix(in srgb, var(--accent-secondary) 32%, var(--surface-3));
  color: var(--text-primary);
}

#debateRoomOverlay .db-debater-card-body {
  flex: 1;
  min-width: 0;
}

#debateRoomOverlay .db-debater-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

#debateRoomOverlay .db-debater-card-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

#debateRoomOverlay .db-aud-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-main);
}

#debateRoomOverlay .db-aud-chat-header {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

#debateRoomOverlay .db-aud-chat-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

#debateRoomOverlay .db-aud-chat-count {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

#debateRoomOverlay #dbAudChatMessages.db-aud-chat-messages {
  flex: 1;
  min-height: 0;
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#debateRoomOverlay .db-aud-chat-compose {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  width: 100%;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  box-sizing: border-box;
}

#debateRoomOverlay .db-aud-chat-input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  padding: 9px 12px;
  color: var(--text-primary);
  outline: none;
}

#debateRoomOverlay .db-aud-chat-input::placeholder {
  color: var(--text-muted);
}

#debateRoomOverlay .db-aud-chat-input:focus {
  border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-soft));
}

#debateRoomOverlay .db-aud-chat-send {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-input);
  background: var(--accent-primary);
  color: var(--bg-main);
  cursor: pointer;
  transition: background 0.2s ease;
}

#debateRoomOverlay .db-aud-chat-send:hover {
  background: var(--accent-primary-hover);
}

#debateRoomOverlay .db-chat-message {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

#debateRoomOverlay .db-chat-message--mine {
  justify-content: flex-end;
}

#debateRoomOverlay .db-chat-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
}

#debateRoomOverlay .db-chat-bubble {
  max-width: 80%;
  padding: 7px 11px;
  border-radius: var(--radius-input);
}

#debateRoomOverlay .db-chat-bubble--mine {
  background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 28%, var(--border-soft));
  border-radius: var(--radius-input) 0 var(--radius-input) var(--radius-input);
}

#debateRoomOverlay .db-chat-bubble--other {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 0 var(--radius-input) var(--radius-input) var(--radius-input);
}

#debateRoomOverlay .db-chat-name {
  display: block;
  margin-bottom: 3px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-primary);
}

#debateRoomOverlay .db-chat-bubble--mine .db-chat-name {
  color: var(--accent-primary);
}

#debateRoomOverlay .db-chat-text {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-primary);
}

/* —— Debate-D: results / end-state / custom modal —— */
#debateRoomOverlay #dbResultsOverlay.db-results-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg-main) 88%, transparent);
}

#debateRoomOverlay .db-results-card {
  max-width: 400px;
  width: 90%;
  padding: 28px 32px;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

#debateRoomOverlay .db-results-title {
  margin-bottom: 6px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

#debateRoomOverlay .db-results-topic {
  margin-bottom: 20px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

#debateRoomOverlay .db-results-votes {
  margin-bottom: 20px;
  text-align: left;
}

#debateRoomOverlay .db-results-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

#debateRoomOverlay .db-results-vote-row {
  margin-bottom: 10px;
}

#debateRoomOverlay .db-results-vote-row--against {
  margin-bottom: 12px;
}

#debateRoomOverlay .db-results-vote-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

#debateRoomOverlay .db-results-vote-row--for .db-results-vote-label,
#debateRoomOverlay .db-results-vote-row--for .db-results-vote-pct {
  color: var(--accent-primary);
}

#debateRoomOverlay .db-results-vote-row--against .db-results-vote-label,
#debateRoomOverlay .db-results-vote-row--against .db-results-vote-pct {
  color: var(--error);
}

#debateRoomOverlay .db-results-vote-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

#debateRoomOverlay .db-results-vote-pct {
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#debateRoomOverlay .db-results-vote-track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--border-subtle);
}

#debateRoomOverlay .db-results-vote-row--for .db-results-vote-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent-primary);
}

#debateRoomOverlay .db-results-vote-row--against .db-results-vote-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--error);
}

#debateRoomOverlay .db-results-total {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: center;
}

#debateRoomOverlay .db-results-winner {
  margin-bottom: 24px;
  font-size: 0.9375rem;
  font-weight: 600;
}

#debateRoomOverlay .db-results-winner--for {
  color: var(--accent-primary);
}

#debateRoomOverlay .db-results-winner--against {
  color: var(--error);
}

#debateRoomOverlay .db-results-winner--tie {
  color: var(--text-secondary);
}

#debateRoomOverlay #dbResultsCloseBtn.db-results-close {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-input);
  background: var(--accent-primary);
  color: var(--bg-main);
  cursor: pointer;
  transition: background 0.2s ease;
}

#debateRoomOverlay #dbResultsCloseBtn.db-results-close:hover {
  background: var(--accent-primary-hover);
}

#debateRoomOverlay .db-end-btn-wrap {
  flex-shrink: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
}

#debateRoomOverlay #dbEndBtn.db-end-btn {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-input);
  background: color-mix(in srgb, var(--error) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 42%, var(--border-soft));
  color: var(--error);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

#debateRoomOverlay #dbEndBtn.db-end-btn:hover {
  background: color-mix(in srgb, var(--error) 16%, var(--surface-2));
  border-color: var(--error);
}

#dbCustomModalOverlay.db-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: color-mix(in srgb, var(--bg-main) 72%, transparent);
}

#dbCustomModalOverlay .db-modal-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  padding: 24px;
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

#dbCustomModalOverlay .db-modal-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

#dbCustomModalOverlay .db-modal-body {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

#dbCustomModalOverlay .db-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

#dbCustomModalOverlay .db-modal-btn {
  flex: 1;
  padding: 10px 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-input);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

#dbCustomModalOverlay .db-modal-btn--secondary {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
}

#dbCustomModalOverlay .db-modal-btn--secondary:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--text-primary) 12%, var(--border-soft));
  background: var(--surface-3);
}

#dbCustomModalOverlay .db-modal-btn--primary {
  border: none;
  background: var(--accent-primary);
  color: var(--bg-main);
}

#dbCustomModalOverlay .db-modal-btn--primary:hover {
  background: var(--accent-primary-hover);
}

#dbCustomModalOverlay .db-modal-btn--danger {
  border: none;
  background: var(--error);
  color: var(--bg-main);
}

#dbCustomModalOverlay .db-modal-btn--danger:hover {
  background: color-mix(in srgb, var(--error) 88%, var(--text-primary));
}

@keyframes db-debate-connect-pulse {
  0%,
  100% {
    box-shadow: 0 4px 16px color-mix(in srgb, var(--accent-primary) 18%, transparent);
  }

  50% {
    box-shadow:
      0 4px 20px color-mix(in srgb, var(--accent-primary) 32%, transparent),
      0 0 0 4px color-mix(in srgb, var(--accent-primary) 12%, transparent);
  }
}

/* —— Debate-E: narrow / tablet / mobile layout —— */
@media (max-width: 900px) {
  #debateRoomOverlay.debate-room-overlay {
    max-width: 100vw;
    overflow: hidden;
  }

  #debateRoomOverlay .db-topbar {
    gap: 8px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
  }

  #debateRoomOverlay .db-topbar-brand {
    display: none;
  }

  #debateRoomOverlay .db-topbar-title {
    font-size: 0.8125rem;
  }

  #debateRoomOverlay #dbLeaveBtn.db-btn,
  #debateRoomOverlay #dbCancelDebateBtn.db-btn {
    min-height: 44px;
    padding: 8px 12px;
  }

  #debateRoomOverlay #dbBody {
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }

  #debateRoomOverlay #dbLeft {
    width: 100% !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: 0;
    border-right: none !important;
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
  }

  #debateRoomOverlay #dbRight.db-right-rail {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 1 auto;
    max-height: min(48dvh, 52vh);
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-left: none;
  }

  #debateRoomOverlay #dbDebaterRail.db-debater-rail {
    min-height: 0;
  }

  #debateRoomOverlay #dbAdRail {
    display: none !important;
  }

  #debateRoomOverlay #dbVideoCall.db-video-stage {
    flex: 1 1 0;
    min-height: 0;
    padding: 6px 8px 4px;
    overflow: hidden;
  }

  /* Override shared Chat-D .chat-container .chat-v2-* mobile rules */
  #debateRoomOverlay #dbRemoteCard.db-video-card--remote,
  #debateRoomOverlay #dbLocalCard.db-video-card--local {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    align-self: center !important;
  }

  #debateRoomOverlay #dbRemoteCard.db-video-card--remote {
    max-height: min(36dvh, calc((100vw - 24px) * 9 / 16)) !important;
    min-height: 88px;
  }

  #debateRoomOverlay #dbLocalCard.db-video-card--local {
    max-height: min(22dvh, 168px) !important;
    max-width: min(82vw, 300px) !important;
    width: min(82vw, 300px) !important;
  }

  #debateRoomOverlay .db-waiting-state {
    flex: 1;
    min-height: 0;
    padding: 16px 12px;
    overflow-y: auto;
  }

  #debateRoomOverlay .db-waiting-card {
    width: min(100%, 360px);
  }

  #debateRoomOverlay .db-countdown-overlay {
    padding: 16px 12px;
    overflow-y: auto;
  }

  #debateRoomOverlay .db-countdown-number {
    font-size: clamp(3rem, 18vw, 4.5rem);
  }

  #debateRoomOverlay .db-countdown-ad-slot {
    width: min(100%, 300px);
  }

  #debateRoomOverlay #dbAudienceLayout.db-audience-layout {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }

  #debateRoomOverlay .db-audience-layout-inner {
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  #debateRoomOverlay #dbAudLeft.db-aud-left {
    width: 100% !important;
    flex: 0 1 auto;
    max-height: min(44dvh, 48vh);
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  #debateRoomOverlay .db-aud-chat-main {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }

  #debateRoomOverlay #dbAudAdRail {
    display: none !important;
  }

  #debateRoomOverlay #dbAudChatMessages.db-aud-chat-messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #debateRoomOverlay .db-aud-chat-compose {
    flex-shrink: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  #debateRoomOverlay .db-aud-chat-send,
  #debateRoomOverlay .db-vote-btn {
    min-height: 44px;
  }

  #debateRoomOverlay #dbResultsOverlay.db-results-overlay {
    padding: 12px;
    overflow-y: auto;
  }

  #debateRoomOverlay .db-results-card {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 22px 20px;
    width: min(100%, 400px);
  }

  #debateRoomOverlay #dbTimerDisplay.db-timer-display {
    font-size: clamp(1.75rem, 10vw, 2.25rem);
  }

  #debateRoomOverlay .db-end-btn-wrap {
    flex-shrink: 0;
  }

  #dbCustomModalOverlay.db-modal-overlay {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  #dbCustomModalOverlay .db-modal-card {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  #dbCustomModalOverlay .db-modal-btn {
    min-height: 44px;
  }
}

@media (max-width: 600px) {
  #debateRoomOverlay #dbRight.db-right-rail {
    max-height: min(52dvh, 58vh);
  }

  #debateRoomOverlay #dbAudLeft.db-aud-left {
    max-height: min(48dvh, 52vh);
  }
}

@media (max-height: 700px) and (max-width: 900px) {
  #debateRoomOverlay #dbRemoteCard.db-video-card--remote {
    max-height: min(30dvh, calc((100vw - 24px) * 9 / 16)) !important;
  }

  #debateRoomOverlay #dbLocalCard.db-video-card--local {
    max-height: min(18dvh, 132px) !important;
  }

  #debateRoomOverlay #dbRight.db-right-rail {
    max-height: min(40dvh, 44vh);
  }

  #debateRoomOverlay #dbAudLeft.db-aud-left {
    max-height: min(38dvh, 42vh);
  }

  #debateRoomOverlay #dbVideoCall.db-video-stage {
    padding-top: 4px;
    padding-bottom: 2px;
  }
}

/* Rank badge image */
.games-rank-badge-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
}

.games-rank-badge-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(29, 184, 138, 0.3));
  transition: transform 0.3s ease;
}

.games-rank-badge-img:hover {
  transform: scale(1.08);
}

/* Rank-up animation */
@keyframes rankUpPulse {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes rankUpGlow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(29, 184, 138, 0.4);
  }
  50% {
    box-shadow: 0 0 60px rgba(29, 184, 138, 0.9);
  }
}

.games-rank-up-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.games-rank-up-content {
  background: #1a1a1a;
  border: 1px solid rgba(29, 184, 138, 0.4);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 320px;
  width: 90%;
  animation: rankUpPulse 0.6s ease forwards, rankUpGlow 2s ease infinite;
}

.games-rank-up-text {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1db88a;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.games-rank-up-badge-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 1rem;
  display: block;
  animation: rankUpPulse 0.8s 0.2s ease both;
}

.games-rank-up-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
}

.games-rank-up-close {
  background: #1db88a;
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.games-rank-up-close:hover {
  background: #17a376;
}

#profileHoverCard {
  position: absolute;
  width: 345px;
  z-index: 9999;
  pointer-events: auto;
}

.phc-inner {
  background: var(--color-bg, #1a1a1a);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.phc-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.phc-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.phc-avatar-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(29,184,138,0.15);
  border: 1.5px solid rgba(29,184,138,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.phc-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phc-avatar-initial {
  font-size: 20px;
  font-weight: 600;
  color: #1db88a;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.phc-info {
  flex: 1;
  min-width: 0;
}

.phc-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-bottom: 3px;
}

.phc-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #eee);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.phc-friends-badge {
  background: rgba(29,184,138,0.12);
  color: #1db88a;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(29,184,138,0.25);
  flex-shrink: 0;
}

.phc-meta {
  font-size: 12px;
  color: var(--muted, #888);
  margin-bottom: 3px;
}

.phc-counts {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  font-size: 12px;
  color: var(--muted, #888);
  margin-top: 3px;
}

.phc-counts span,
.phc-count-item {
  color: var(--muted, #888);
  white-space: nowrap;
  flex-shrink: 0;
}

.phc-counts strong {
  color: var(--text, #eee);
  font-weight: 600;
}

.phc-follow-btn {
  background: #1db88a;
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}

.phc-follow-btn.phc-following {
  background: transparent;
  color: var(--muted, #888);
  border: 1px solid rgba(255,255,255,0.15);
}

.phc-bio {
  font-size: 13px;
  color: var(--muted, #aaa);
  line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 10px;
  margin-top: 4px;
}

/* ==========================================================================
   Connect 4 — scoped .connect4-* only
   ========================================================================== */

.connect4-flow-overlay:not(.quiz-hidden) {
  overflow: hidden;
}

.connect4-flow-shell.quiz-panel--wide {
  max-width: min(480px, 100%);
  width: 100%;
  height: 100%;
  max-height: 100%;
  padding: 6px 8px;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.connect4-flow-overlay .connect4-flow-shell {
  overflow: hidden;
}

#connect4Mount {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.connect4-panel {
  --connect4-board-width: 320px;
  --connect4-board-max-height: 100%;
  --connect4-slot-size: calc(var(--connect4-board-width) / 7);
  --connect4-disc-size: calc(var(--connect4-slot-size) * 0.82);
  --connect4-frame-pad: clamp(6px, 1vmin, 10px);
  --connect4-x: #ff3b5c;
  --connect4-x-glow: rgba(255, 59, 92, 0.55);
  --connect4-o: #ffc93a;
  --connect4-o-glow: rgba(255, 201, 58, 0.55);
  --connect4-board-bg: #1a4fd6;
  --connect4-board-edge: #0d2f8a;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.9vmin, 8px);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: clamp(6px, 1.2vmin, 10px) clamp(8px, 1.5vmin, 12px);
  box-sizing: border-box;
  overflow: hidden;
  font-family: inherit;
  color: var(--text, #eee);
}

.connect4-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.connect4-header-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.connect4-header-icon {
  font-size: clamp(1rem, 2.4vmin, 1.2rem);
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.connect4-title {
  margin: 0;
  font-size: clamp(0.9rem, 2.2vmin, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.connect4-game-count {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted, #999);
  white-space: nowrap;
}

.connect4-close-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted, #aaa);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.connect4-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text, #eee);
}

.connect4-close-btn:active {
  transform: scale(0.94);
}

.connect4-hud {
  flex-shrink: 0;
}

.connect4-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  font-size: 0.72rem;
  color: var(--muted, #999);
  min-height: 0;
}

.connect4-goes-first {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.connect4-goes-first-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  color: #111;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.25);
}

.connect4-goes-first-chip--x {
  background: linear-gradient(145deg, #ff6b84, var(--connect4-x));
}

.connect4-goes-first-chip--o {
  background: linear-gradient(145deg, #ffe066, var(--connect4-o));
}

.connect4-players {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}

.connect4-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.connect4-player--turn {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.22);
}

.connect4-player-disc {
  width: clamp(22px, 4.5vmin, 26px);
  height: clamp(22px, 4.5vmin, 26px);
  border-radius: 50%;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.28), 0 3px 8px rgba(0, 0, 0, 0.35);
}

.connect4-player-disc--x {
  background: radial-gradient(circle at 35% 30%, #ff8fa0, var(--connect4-x) 55%, #c9183a);
}

.connect4-player-disc--o {
  background: radial-gradient(circle at 35% 30%, #ffe98a, var(--connect4-o) 55%, #d4a012);
}

.connect4-player-name {
  font-size: 0.72rem;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connect4-player-score {
  font-size: clamp(1rem, 2.6vmin, 1.2rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.connect4-vs {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted, #888);
}

.connect4-turn {
  min-height: 1.1em;
  text-align: center;
  font-size: clamp(0.72rem, 1.8vmin, 0.82rem);
  margin-top: 0.1rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.connect4-turn--yours {
  color: #7ee8b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.connect4-turn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7ee8b8;
  animation: connect4-turn-pulse 1.4s ease-in-out infinite;
}

.connect4-turn--waiting {
  color: var(--muted, #999);
  font-weight: 500;
}

@keyframes connect4-turn-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.connect4-board-wrap {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.connect4-board-frame {
  position: relative;
  width: var(--connect4-board-width);
  max-width: 100%;
  max-height: var(--connect4-board-max-height);
  margin: 0 auto;
  padding: var(--connect4-frame-pad);
  border-radius: clamp(12px, 2vmin, 18px);
  flex-shrink: 1;
  background: linear-gradient(165deg, #2568f0 0%, var(--connect4-board-bg) 45%, var(--connect4-board-edge) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    inset 0 -4px 12px rgba(0, 0, 0, 0.35),
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 2px rgba(255, 255, 255, 0.06);
}

.connect4-board-glow {
  position: absolute;
  inset: -8px;
  border-radius: 22px;
  background: radial-gradient(ellipse at 50% 0%, rgba(80, 140, 255, 0.35), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.connect4-board-inner {
  position: relative;
  z-index: 1;
}

.connect4-col-hits {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 2px;
}

.connect4-col-hit {
  position: relative;
  height: calc(var(--connect4-slot-size) * 0.55);
  padding: 0;
  border: none;
  background: transparent;
  cursor: default;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.connect4-col-hit--available {
  cursor: pointer;
}

.connect4-col-hit--available:hover .connect4-col-ghost--visible {
  opacity: 0.55;
  transform: translateY(2px);
}

.connect4-col-hit--available:active .connect4-col-ghost--visible {
  opacity: 0.75;
  transform: translateY(6px);
}

.connect4-col-hit:disabled {
  cursor: default;
  pointer-events: none;
}

.connect4-col-ghost {
  display: block;
  width: var(--connect4-disc-size);
  height: var(--connect4-disc-size);
  margin: 0 auto;
  border-radius: 50%;
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.connect4-col-ghost--visible {
  opacity: 0.35;
}

.connect4-col-ghost--x {
  background: radial-gradient(circle at 35% 30%, #ff8fa0, var(--connect4-x) 55%, #c9183a);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.connect4-col-ghost--o {
  background: radial-gradient(circle at 35% 30%, #ffe98a, var(--connect4-o) 55%, #d4a012);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.connect4-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 0;
  aspect-ratio: 7 / 6;
  width: 100%;
}

.connect4-slot {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.connect4-slot-hole {
  width: var(--connect4-disc-size);
  height: var(--connect4-disc-size);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, #0a1a3d 0%, #061028 70%, #030818 100%);
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.65),
    inset 0 -1px 2px rgba(255, 255, 255, 0.06);
}

.connect4-disc {
  position: absolute;
  width: var(--connect4-disc-size);
  height: var(--connect4-disc-size);
  border-radius: 50%;
  z-index: 2;
  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.35),
    inset 0 3px 6px rgba(255, 255, 255, 0.22),
    0 4px 10px rgba(0, 0, 0, 0.4);
}

.connect4-disc--x {
  background: radial-gradient(circle at 35% 28%, #ff8fa0, var(--connect4-x) 52%, #b81435);
}

.connect4-disc--o {
  background: radial-gradient(circle at 35% 28%, #ffe98a, var(--connect4-o) 52%, #c4920f);
}

.connect4-disc--piece.connect4-disc--x,
.connect4-disc--piece.connect4-disc--o,
.connect4-col-ghost--piece.connect4-col-ghost--x,
.connect4-col-ghost--piece.connect4-col-ghost--o,
.connect4-player-disc.connect4-disc--piece.connect4-player-disc--x,
.connect4-player-disc.connect4-disc--piece.connect4-player-disc--o {
  background: transparent;
}

.connect4-piece-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}

.connect4-disc--piece {
  overflow: hidden;
}

.connect4-col-ghost--piece {
  overflow: hidden;
}

.connect4-player-disc.connect4-disc--piece {
  overflow: hidden;
}

.connect4-turn-piece {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.connect4-turn.connect4-turn--yours {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.connect4-disc--mini.connect4-disc--piece {
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}

.connect4-disc--drop {
  animation: connect4-disc-drop 0.42s cubic-bezier(0.34, 0.72, 0.45, 1) forwards;
}

@keyframes connect4-disc-drop {
  0% {
    transform: translateY(calc(var(--connect4-drop-rows, 5) * var(--connect4-slot-size) * -1 - var(--connect4-slot-size)));
    opacity: 0.92;
  }
  78% {
    transform: translateY(4px);
  }
  92% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.connect4-slot--win .connect4-slot-hole {
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.65),
    0 0 12px rgba(255, 255, 255, 0.15);
}

.connect4-disc--win {
  animation: connect4-win-glow 1.1s ease-in-out infinite;
}

@keyframes connect4-win-glow {
  0%, 100% {
    box-shadow:
      inset 0 -4px 8px rgba(0, 0, 0, 0.35),
      inset 0 3px 6px rgba(255, 255, 255, 0.22),
      0 0 14px rgba(255, 255, 255, 0.35),
      0 0 28px var(--connect4-x-glow);
  }
  50% {
    box-shadow:
      inset 0 -4px 8px rgba(0, 0, 0, 0.35),
      inset 0 3px 6px rgba(255, 255, 255, 0.28),
      0 0 22px rgba(255, 255, 255, 0.55),
      0 0 40px var(--connect4-x-glow);
  }
}

.connect4-disc--o.connect4-disc--win {
  animation-name: connect4-win-glow-o;
}

@keyframes connect4-win-glow-o {
  0%, 100% {
    box-shadow:
      inset 0 -4px 8px rgba(0, 0, 0, 0.35),
      inset 0 3px 6px rgba(255, 255, 255, 0.22),
      0 0 14px rgba(255, 255, 255, 0.35),
      0 0 28px var(--connect4-o-glow);
  }
  50% {
    box-shadow:
      inset 0 -4px 8px rgba(0, 0, 0, 0.35),
      inset 0 3px 6px rgba(255, 255, 255, 0.28),
      0 0 22px rgba(255, 255, 255, 0.55),
      0 0 40px var(--connect4-o-glow);
  }
}

.connect4-footer {
  flex-shrink: 0;
}

.connect4-result {
  text-align: center;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: clamp(0.78rem, 1.9vmin, 0.88rem);
  font-weight: 700;
  animation: connect4-result-in 0.35s ease-out;
}

.connect4-result[hidden] {
  display: none !important;
}

.connect4-result--win {
  background: rgba(46, 204, 113, 0.15);
  color: #6ee7a8;
  border: 1px solid rgba(46, 204, 113, 0.35);
}

.connect4-result--loss {
  background: rgba(255, 90, 90, 0.12);
  color: #ff9a9a;
  border: 1px solid rgba(255, 90, 90, 0.3);
}

.connect4-result--tie {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #ddd);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

@keyframes connect4-result-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.connect4-quit-secondary {
  display: none;
  align-self: center;
  margin-top: 2px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #999);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.connect4-quit-secondary:hover {
  color: var(--text, #eee);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
}

.connect4-session-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.connect4-session-modal.quiz-hidden {
  display: none !important;
}

.connect4-session-modal-inner {
  width: min(360px, 100%);
  animation: connect4-result-in 0.35s ease-out;
}

.connect4-session-card {
  padding: 20px 18px;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(30, 35, 50, 0.98), rgba(18, 22, 32, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.connect4-session-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.connect4-session-sub {
  font-size: 0.78rem;
  color: var(--muted, #999);
  margin-bottom: 14px;
}

.connect4-session-tie {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.connect4-session-winner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.connect4-session-winner-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #888);
}

.connect4-session-winner-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.connect4-session-winner-score {
  font-size: 1.35rem;
  font-weight: 800;
  color: #7ee8b8;
}

.connect4-session-scores {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.connect4-session-player {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.connect4-disc--mini {
  width: 16px;
  height: 16px;
  position: static;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.connect4-session-penalty {
  font-size: 0.78rem;
  color: #ff9a9a;
  margin: 8px 0 0;
}

.connect4-session-footer {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--muted, #888);
}

#gamesMatchScreen .connect4-panel {
  max-width: 100%;
}

body.games-tab-match-active #connect4FlowOverlay .connect4-panel {
  max-height: none;
  overflow: hidden;
}

#gamesMatchGameMount > .connect4-flow-overlay.games-inline-overlay {
  overflow: hidden !important;
  align-items: center !important;
  justify-content: center !important;
}
#gamesMatchGameMount > .connect4-flow-overlay.games-inline-overlay .connect4-flow-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  width: 100%;
  max-width: min(640px, 100%);
}
#gamesMatchGameMount > .connect4-flow-overlay.games-inline-overlay #connect4Mount {
  flex: 1 1 auto;
  min-height: 0;
}
body.games-tab-match-active
  #gamesMatchGameMount:has(.connect4-flow-overlay:not(.quiz-hidden)) {
  overflow: hidden !important;
}
body.games-tab-match-active
  #gamesMatchScreen .games-match-game-area:has(.connect4-flow-overlay:not(.quiz-hidden)) {
  overflow: hidden;
}

@media (max-width: 480px) {
  .connect4-panel {
    padding: 10px 8px 14px;
    gap: 10px;
  }

  .connect4-player {
    padding: 8px 6px;
  }

  .connect4-player-score {
    font-size: 1.15rem;
  }

  .connect4-board-frame {
    border-radius: 14px;
  }

  .connect4-col-hit {
    min-height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .connect4-disc--drop,
  .connect4-disc--win,
  .connect4-turn-dot {
    animation: none !important;
  }

  .connect4-col-ghost,
  .connect4-close-btn,
  .connect4-player,
  .connect4-quit-secondary {
    transition: none !important;
  }
}

/* Checkers — 2-player duel (video chat / games match) */
.checkers-flow-overlay:not(.quiz-hidden) {
  overflow: hidden;
}
.checkers-flow-overlay .checkers-flow-shell {
  max-width: min(520px, 100%);
  width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  padding: 6px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
#checkersMount {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ckduel-game {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  --ckduel-board-side: min(100%, 56vmin, calc(100dvh - 220px), 720px);
  gap: 4px;
}
.ckduel-game .cksolo-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
.ckduel-game .cksolo-game-head {
  flex-shrink: 0;
  padding: 0 2px;
}
.ckduel-wait-banner {
  margin: 0 0 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(29, 184, 138, 0.15);
  color: #9ef0d0;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}
.ckduel-wait-banner[hidden] {
  display: none !important;
}
.ckduel-wait-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: min(52vw, 360px);
  width: 100%;
  padding: 28px 20px;
  box-sizing: border-box;
  background: rgba(17, 17, 17, 0.92);
  border-radius: 12px;
  border: 1px solid rgba(29, 184, 138, 0.22);
}
.ckduel-wait-panel[hidden] {
  display: none !important;
}
.ckduel-board-frame.ckduel-board-frame--hidden {
  display: none !important;
}
.ckduel-wait-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(29, 184, 138, 0.2);
  border-top-color: #1db88a;
  border-radius: 50%;
  animation: ckduel-wait-spin 0.85s linear infinite;
}
.ckduel-wait-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #9ef0d0;
  text-align: center;
}
@keyframes ckduel-wait-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ckduel-wait-spinner {
    animation: none;
    border-top-color: #1db88a;
  }
}
.ckduel-game--waiting .cksolo-board-layout,
.ckduel-game--locked .cksolo-board-layout {
  pointer-events: none;
}
.ckduel-game--waiting .cksolo-grid {
  opacity: 0.72;
}
.ckduel-game .cksolo-board-layout {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vmin, 12px);
}
.ckduel-game .cksolo-board-wrap {
  width: var(--ckduel-board-side);
  height: var(--ckduel-board-side);
  max-width: 100%;
  max-height: 100%;
  flex: 0 0 auto;
}
.ckduel-game .cksolo-board-frame {
  width: 100%;
  height: 100%;
  padding: clamp(4px, 1vmin, 10px);
  box-sizing: border-box;
}
.ckduel-game .cksolo-grid {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
}
.ckduel-game .cksolo-piece-img {
  width: 88%;
  height: 88%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.ckduel-game .cksolo-tray-col {
  max-height: var(--ckduel-board-side);
}
.ckduel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.ckduel-header-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.ckduel-title {
  margin: 0;
  font-size: clamp(0.9rem, 2.2vmin, 1.05rem);
  font-weight: 700;
  color: #f4f7fb;
}
.ckduel-game-count {
  font-size: 0.75rem;
  color: rgba(244, 247, 251, 0.65);
}
.ckduel-close-btn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7fb;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.ckduel-session-score {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(244, 247, 251, 0.85);
  margin-top: 0.15rem;
}
.ckduel-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.35rem;
}
.ckduel-result {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  width: 100%;
  max-width: 320px;
}
.ckduel-result--win {
  background: rgba(46, 204, 113, 0.2);
  color: #7bed9f;
}
.ckduel-result--loss {
  background: rgba(231, 76, 60, 0.2);
  color: #ff6b6b;
}
.ckduel-result--tie {
  background: rgba(255, 255, 255, 0.1);
  color: #dfe6e9;
}
.ckduel-next-btn {
  border: none;
  border-radius: 10px;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  background: linear-gradient(135deg, #1abc9c, #16a085);
  color: #fff;
  cursor: pointer;
}
.ckduel-next-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#gamesMatchGameMount > .checkers-flow-overlay.games-inline-overlay {
  overflow: hidden !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}
#gamesMatchGameMount > .checkers-flow-overlay.games-inline-overlay .checkers-flow-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  width: 100%;
  max-width: min(720px, 100%);
}
#gamesMatchGameMount > .checkers-flow-overlay.games-inline-overlay #checkersMount {
  flex: 1 1 auto;
  min-height: 0;
}
@media (max-height: 700px) {
  .ckduel-game .cksolo-game-head {
    gap: 2px;
  }
  .ckduel-game .cksolo-players-row {
    margin-bottom: 2px;
  }
  .ckduel-game .cksolo-tray-col {
    min-width: 40px;
    max-width: 52px;
  }
}
@media (max-height: 580px) {
  .ckduel-game .cksolo-tray-col {
    display: none;
  }
  .ckduel-game .cksolo-board-layout {
    gap: 0;
  }
}

/* Memory Match — 2-player duel (video chat / games match); fit board without scroll */
.memory-match-flow-overlay:not(.quiz-hidden) {
  overflow: hidden;
}
.memory-match-flow-overlay .memory-match-flow-shell {
  max-width: min(520px, 100%);
  width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  padding: 6px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
#memoryMatchMount {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mm-game--duel {
  --mm-duel-cols: 5;
  --mm-duel-rows: 4;
  --mm-duel-card-ratio: 1.25;
  --mm-duel-gap: clamp(2px, 0.45vmin, 5px);
  --mm-duel-card-size: 52px;
  --mm-duel-board-max-height: 100%;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.15rem 0 0.25rem;
  box-sizing: border-box;
}
.mm-duel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.mm-duel-header-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.mm-duel-title {
  margin: 0;
  font-size: clamp(0.9rem, 2.2vmin, 1.05rem);
  font-weight: 700;
  color: #f4f7fb;
  white-space: nowrap;
}
.mm-duel-game-count {
  font-size: 0.68rem;
  color: #8b9bb0;
  white-space: nowrap;
}
.mm-duel-close-btn {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #9aa8bc;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}
.mm-duel-hud {
  flex-shrink: 0;
}
.mm-duel-players {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}
.mm-duel-player {
  flex: 1;
  max-width: 132px;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mm-duel-player--turn {
  border-color: rgba(39, 224, 179, 0.55);
  box-shadow: 0 0 10px rgba(39, 224, 179, 0.18);
}
.mm-duel-player-name {
  font-weight: 600;
  font-size: 0.72rem;
  color: #e8eef5;
  margin-bottom: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mm-duel-pair-score,
.mm-duel-session-score {
  font-size: 0.68rem;
  color: #a8b5c8;
  line-height: 1.25;
}
.mm-duel-score-label {
  opacity: 0.75;
  margin-right: 0.15rem;
}
.mm-duel-vs {
  align-self: center;
  font-weight: 700;
  font-size: 0.65rem;
  color: #6d7d94;
}
.mm-duel-turn {
  text-align: center;
  font-size: clamp(0.72rem, 1.8vmin, 0.82rem);
  color: #c5d0e0;
  min-height: 1em;
  margin-bottom: 0.2rem;
  line-height: 1.25;
}
.mm-duel-turn--waiting {
  color: #9eb0c8;
  font-style: italic;
}
.mm-duel-turn--retry {
  color: #ffd89a;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mm-duel-pair-score--lead {
  color: #27e0b3;
  font-weight: 600;
}
.mm-duel-board-wrap {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-height: var(--mm-duel-board-max-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  container-type: size;
  container-name: mm-duel-board;
}
.mm-duel-board-wrap--mismatch .mm-card.flipped:not(.matched) {
  filter: drop-shadow(0 0 10px rgba(255, 200, 100, 0.35));
}
.mm-duel-board-wrap--locked {
  pointer-events: none;
}
.mm-duel-board-wrap--locked .mm-card {
  cursor: default;
}
.mm-game--duel .mm-duel-board.mm-board {
  display: grid;
  grid-template-columns: repeat(var(--mm-duel-cols), var(--mm-duel-card-size));
  grid-template-rows: repeat(
    var(--mm-duel-rows),
    calc(var(--mm-duel-card-size) * var(--mm-duel-card-ratio))
  );
  gap: var(--mm-duel-gap);
  width: max-content;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
@supports (width: 100cqi) {
  .mm-duel-board-wrap {
    --mm-duel-card-size: min(
      calc((100cqi - (var(--mm-duel-cols) - 1) * var(--mm-duel-gap)) / var(--mm-duel-cols)),
      calc(
        (100cqb - (var(--mm-duel-rows) - 1) * var(--mm-duel-gap)) /
          (var(--mm-duel-rows) * var(--mm-duel-card-ratio))
      )
    );
  }
}
.mm-game--duel .mm-card {
  width: var(--mm-duel-card-size);
  height: calc(var(--mm-duel-card-size) * var(--mm-duel-card-ratio));
  min-height: 0;
  max-height: none;
  aspect-ratio: 4 / 5;
  border-radius: clamp(6px, 1.2vmin, 10px);
}
.mm-game--duel .mm-card-inner,
.mm-game--duel .mm-card-face {
  border-radius: clamp(6px, 1.2vmin, 10px);
}
.mm-game--duel .mm-card-front {
  position: relative;
  padding: 4px 4px 3px;
  gap: 2px;
}
.mm-game--duel .mm-card-name {
  font-size: clamp(0.45rem, 1.1vmin, 0.58rem);
  line-height: 1.1;
}
.mm-game--duel .mm-card.matched.mm-duel-owned--local {
  filter: drop-shadow(0 0 8px rgba(39, 224, 179, 0.45));
}
.mm-game--duel .mm-card.matched.mm-duel-owned--remote {
  filter: drop-shadow(0 0 8px rgba(120, 160, 220, 0.4));
}
.mm-duel-match-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(10, 22, 40, 0.82);
  color: #e8eef5;
  line-height: 1.2;
}
.mm-duel-owned--local .mm-duel-match-badge {
  border: 1px solid rgba(39, 224, 179, 0.55);
  color: #27e0b3;
}
.mm-duel-owned--remote .mm-duel-match-badge {
  border: 1px solid rgba(120, 160, 220, 0.5);
  color: #a8c4f0;
}
.mm-duel-footer {
  flex-shrink: 0;
}
.mm-duel-result {
  margin-top: 0.3rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: clamp(0.78rem, 1.9vmin, 0.88rem);
}
.mm-duel-result--visible.mm-duel-result--win {
  background: rgba(39, 224, 179, 0.12);
  color: #5eecc4;
  border: 1px solid rgba(39, 224, 179, 0.35);
}
.mm-duel-result--visible.mm-duel-result--loss {
  background: rgba(255, 120, 120, 0.1);
  color: #ffb4b4;
  border: 1px solid rgba(255, 120, 120, 0.25);
}
.mm-duel-result--visible.mm-duel-result--tie {
  background: rgba(255, 200, 100, 0.1);
  color: #ffd89a;
  border: 1px solid rgba(255, 200, 100, 0.28);
}
.mm-duel-next-btn {
  display: block;
  width: 100%;
  max-width: 240px;
  margin: 0.35rem auto 0;
  padding: 0.45rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #27e0b3, #1db88a);
  color: #0a1628;
  font-weight: 700;
  font-size: clamp(0.78rem, 1.9vmin, 0.88rem);
  cursor: pointer;
}
.mm-duel-next-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.mm-duel-quit-secondary {
  display: none;
}
.mm-game--duel .mm-card:not(:disabled):hover {
  transform: translateY(-1px);
}
/* Games match tab: fill mount, no overlay scroll */
#gamesMatchGameMount > .memory-match-flow-overlay.games-inline-overlay {
  overflow: hidden !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}
#gamesMatchGameMount > .memory-match-flow-overlay.games-inline-overlay .memory-match-flow-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  width: 100%;
  max-width: min(520px, 100%);
}
#gamesMatchGameMount > .memory-match-flow-overlay.games-inline-overlay #memoryMatchMount {
  flex: 1 1 auto;
  min-height: 0;
}
body.games-tab-match-active
  #gamesMatchGameMount:has(.memory-match-flow-overlay:not(.quiz-hidden)) {
  overflow: hidden !important;
}
body.games-tab-match-active
  #gamesMatchScreen .games-match-game-area:has(.memory-match-flow-overlay:not(.quiz-hidden)) {
  overflow: hidden;
}
.games-match-game-area .memory-match-flow-overlay {
  z-index: 120;
}
@media (max-width: 420px) {
  .mm-game--duel {
    --mm-duel-gap: 2px;
  }
  .mm-duel-player {
    max-width: 108px;
    padding: 0.25rem 0.35rem;
  }
}
@media (max-height: 640px) {
  .mm-duel-header {
    margin-bottom: 0.15rem;
  }
  .mm-duel-players {
    margin-bottom: 0.12rem;
  }
  .mm-duel-turn {
    margin-bottom: 0.12rem;
  }
}

/* —— Checkers solo (Phase 1) —— */
.games-checkers-solo-mount {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 0;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.cksolo-game {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
}
.cksolo-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.cksolo-game-head {
  display: none;
}
.cksolo-board-area {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0 8px 8px 12px;
  gap: 0;
}

.cksolo-sidebar {
  background: rgba(16, 20, 16, 0.97);
  border-left: 1px solid #1e2836;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 10px;
  overflow-y: auto;
  align-self: start;
  position: sticky;
  top: 0;
}

.cksolo-sidebar-divider {
  height: 1px;
  background: #1e2836;
  flex-shrink: 0;
}

.cksolo-stat-block {
  background: #0e141c;
  border: 1px solid #1e2836;
  border-radius: 8px;
  padding: 8px 10px;
}

.cksolo-stat-label {
  font-size: 9px;
  color: #4a5a6a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cksolo-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.cksolo-sidebar-restart-btn {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  background: #27e0b3;
  color: #08120f;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.cksolo-sidebar-restart-btn:hover {
  background: #22c9a0;
}

.cksolo-complete-difficulty {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 4px;
}

.cksolo-complete-diff-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cksolo-complete-diff-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.cksolo-complete-diff-btn {
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid #2a3444;
  background: #0e141c;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.cksolo-complete-diff-btn:hover {
  border-color: rgba(39,224,179,0.4);
  background: rgba(39,224,179,0.06);
  color: #fff;
}

.cksolo-complete-diff-btn--active {
  border-color: rgba(39,224,179,0.6);
  background: rgba(39,224,179,0.12);
  color: #27e0b3;
}

.cksolo-stats-row {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: #888;
}
.cksolo-stat strong {
  color: #eee;
  margin-left: 6px;
}
.cksolo-turn-banner {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  margin-bottom: 0;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}
.cksolo-turn-banner--yours {
  color: #1db88a;
}
.cksolo-turn-banner--cpu {
  color: #c9a227;
}
.cksolo-turn-banner--jump {
  color: #f0b060;
  max-width: 420px;
  line-height: 1.35;
}
.cksolo-turn-banner--done {
  color: #e8c070;
}
.cksolo-turn-banner--hidden {
  visibility: hidden !important;
  opacity: 0;
}
.cksolo-forced-banner {
  height: 28px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  margin-bottom: 0;
  visibility: hidden;
  opacity: 0;
  text-align: center;
}

.cksolo-forced-banner[hidden] {
  display: flex !important;
  visibility: hidden;
  opacity: 0;
}

.cksolo-forced-banner:not([hidden]) {
  visibility: visible;
  opacity: 1;
}
.cksolo-forced-banner--jump-chain {
  background: rgba(29, 184, 138, 0.14);
  border-color: rgba(29, 184, 138, 0.45);
  color: #a8f0d8;
  font-size: 13px;
}
.cksolo-players-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.cksolo-player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 88px;
}
.cksolo-player-card .cksolo-player-name {
  font-size: 0.75rem;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  width: 100%;
}
.cksolo-player-disc {
  width: 36px;
  height: 36px;
}
.cksolo-player-name {
  font-size: 12px;
  color: #aaa;
  text-align: center;
}
.cksolo-vs {
  color: #555;
  font-size: 12px;
  font-weight: 600;
}
.cksolo-board-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  width: 100%;
  flex: 1;
  min-height: 0;
  margin-top: 0;
}
.cksolo-tray-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 52px;
  max-width: 72px;
}
.cksolo-tray-label {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cksolo-tray {
  display: flex;
  flex-direction: column-reverse;
  flex-wrap: wrap;
  align-content: center;
  justify-content: flex-start;
  gap: 3px;
  min-height: 48px;
  max-height: 280px;
  overflow: hidden;
}
.cksolo-tray-empty {
  color: #444;
  font-size: 12px;
}
.cksolo-board-wrap {
  flex: 0 0 auto;
  width: min(calc(100vh - 120px), calc(100% - 120px), 560px);
  max-width: 100%;
}
.cksolo-board-frame {
  background: linear-gradient(145deg, #5c3d1e 0%, #3d2812 100%);
  border-radius: 14px;
  padding: 10px;
  border: 4px solid #2a1a0c;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.cksolo-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1 / 1;
  width: 100%;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
}
.cksolo-cell {
  position: relative;
  border: none;
  margin: 0;
  padding: 0;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cksolo-cell--light {
  background: #e8d4b8;
  cursor: pointer;
}
.cksolo-cell--dark {
  background: #8b5a2b;
  cursor: pointer;
}
.cksolo-cell--dark:hover:not(:disabled) {
  filter: brightness(1.06);
}
.cksolo-cell--selected {
  box-shadow: inset 0 0 0 3px rgba(29, 184, 138, 0.85);
  z-index: 2;
}
.cksolo-cell--selectable-hint {
  box-shadow: inset 0 0 0 2px rgba(29, 184, 138, 0.35);
}
.cksolo-cell--last-from {
  box-shadow: inset 0 0 0 3px rgba(120, 190, 255, 0.85);
  background: #8f6d42 !important;
}
.cksolo-cell--last-to {
  box-shadow:
    inset 0 0 0 4px rgba(29, 184, 138, 0.95),
    0 0 14px rgba(29, 184, 138, 0.45);
  background: #a67d48 !important;
  z-index: 1;
}
.cksolo-cell--move-target .cksolo-move-dot {
  display: block;
}
.cksolo-move-dot {
  display: none;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(29, 184, 138, 0.82);
  pointer-events: none;
}
.cksolo-move-dot--capture {
  width: 34%;
  height: 34%;
  background: rgba(29, 184, 138, 0.9);
  box-shadow: 0 0 0 2px rgba(29, 184, 138, 0.55);
}
@keyframes cksolo-piece-land {
  0% {
    transform: scale(0.55) translateY(-18%);
    opacity: 0.45;
  }
  70% {
    transform: scale(1.06) translateY(2%);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
.cksolo-piece--landed {
  animation: cksolo-piece-land 0.52s ease-out;
}
.cksolo-piece {
  position: relative;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.cksolo-piece--small {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.cksolo-piece--human {
  background: linear-gradient(145deg, #22c99a, #128564);
  border: 2px solid rgba(255, 255, 255, 0.25);
}
.cksolo-piece--cpu {
  background: linear-gradient(145deg, #f0a040, #c56e18);
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.cksolo-piece--king {
  box-shadow:
    0 0 0 3px #e8c040,
    0 0 14px rgba(232, 192, 64, 0.55),
    0 3px 8px rgba(0, 0, 0, 0.35);
}
.cksolo-piece--img {
  overflow: hidden;
  padding: 0;
}
.cksolo-piece-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.cksolo-piece-initial {
  font-size: clamp(10px, 2.5vw, 14px);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.cksolo-king-badge {
  position: absolute;
  left: 50%;
  top: -7px;
  right: auto;
  transform: translateX(-50%);
  font-size: clamp(11px, 2.2vw, 15px);
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65));
  z-index: 2;
  pointer-events: none;
}
.cksolo-piece--small .cksolo-king-badge {
  top: -5px;
  font-size: 10px;
}
.cksolo-complete {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.cksolo-complete--visible {
  opacity: 1;
  pointer-events: auto;
}
.cksolo-complete-card {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 28px 32px;
  text-align: center;
  max-width: 320px;
  width: 90%;
}
.cksolo-complete-title {
  margin: 0 0 8px;
  font-size: 22px;
  color: #fff;
}
.cksolo-complete-sub {
  margin: 0 0 8px;
  color: #888;
  font-size: 14px;
}
.cksolo-complete-save-status {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: #8b9cb3;
}
.cksolo-complete-save-status--ok {
  color: #7dffb8;
}
.cksolo-complete-save-status--warn {
  color: #e8c070;
}
.cksolo-complete-record-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 12px;
}
.cksolo-complete-record-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1a2838;
  background: linear-gradient(135deg, #ffe98a 0%, #27e0b3 100%);
}
.cksolo-complete-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cksolo-btn {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.cksolo-btn--primary {
  background: #1db88a;
  color: #fff;
}
.cksolo-btn--secondary {
  background: transparent;
  border: 1px solid #444;
  color: #ccc;
}
.cksolo-loading,
.cksolo-error {
  color: #888;
  padding: 24px;
  text-align: center;
}
@media (max-width: 640px) {
  .cksolo-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .cksolo-sidebar {
    grid-row: 1;
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-bottom: 1px solid #1e2836;
    align-self: auto;
    position: static;
  }
  .cksolo-board-layout {
    flex-direction: column;
    gap: 8px;
  }
  .cksolo-tray-col {
    flex-direction: row;
    max-width: 100%;
    width: 100%;
    justify-content: center;
  }
  .cksolo-tray {
    flex-direction: row;
    max-height: 40px;
    max-width: 280px;
  }
  .cksolo-board-wrap {
    width: min(94vw, 420px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cksolo-piece--landed {
    animation: none;
  }
}
/* Jigsaw Puzzle */
.games-jigsaw-puzzle-mount {
  width: 100%;
  min-height: calc(100dvh - 74px);
  height: calc(100dvh - 74px);
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
}
.jp-shell { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; overflow: hidden; background: #0a0f0b; }

.jp-select { padding: 0; overflow-y: auto; }

.jp-difficulty-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
  gap: 20px;
}

.jp-difficulty-hero {
  text-align: center;
}

.jp-difficulty-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #27e0b3;
  margin-bottom: 6px;
}

.jp-difficulty-hero h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.jp-difficulty-hero p {
  font-size: 13px;
  color: #6b7d94;
  line-height: 1.4;
}

.jp-difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(100%, 400px);
}

.jp-difficulty-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  background: #0e141c;
  border: 1px solid #2a3444;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.jp-difficulty-btn:hover {
  border-color: rgba(39, 224, 179, 0.5);
  background: rgba(39, 224, 179, 0.06);
}

.jp-difficulty-btn--active {
  border-color: rgba(39, 224, 179, 0.6);
  background: rgba(39, 224, 179, 0.12);
}

.jp-difficulty-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.jp-difficulty-meta {
  font-size: 11px;
  color: #27e0b3;
  font-weight: 600;
}

.jp-back-btn {
  width: min(100%, 400px);
  padding: 9px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid #2a3444;
  color: #6b7d94;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
}

.jp-back-btn:hover {
  border-color: rgba(39, 224, 179, 0.3);
  color: #c5d0de;
}

.jp-hero { padding: 24px 20px 16px; border-bottom: 0.5px solid rgba(255,255,255,0.08); }
.jp-eyebrow { font-size: 11px; color: #1db88a; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.jp-hero h2 { font-size: 22px; font-weight: 500; color: rgba(255,255,255,0.9); margin-bottom: 6px; }
.jp-hero p { font-size: 13px; color: rgba(255,255,255,0.5); }

.jp-select-toolbar { padding: 14px 20px; border-bottom: 0.5px solid rgba(255,255,255,0.08); }
.jp-difficulties { display: flex; gap: 8px; flex-wrap: wrap; }
.jp-difficulty { background: rgba(255,255,255,0.06); border: 0.5px solid rgba(255,255,255,0.12); border-radius: 20px; color: rgba(255,255,255,0.6); font-size: 13px; padding: 6px 16px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.jp-difficulty span { font-size: 11px; color: rgba(255,255,255,0.4); }
.jp-difficulty:hover { background: rgba(255,255,255,0.1); }
.jp-difficulty--active { background: rgba(29,184,138,0.15); border-color: rgba(29,184,138,0.5); color: #1db88a; }
.jp-difficulty--active span { color: rgba(29,184,138,0.7); }

.jp-puzzle-grid { padding: 16px 20px 32px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; overflow-y: auto; }
.jp-puzzle-card { background: rgba(255,255,255,0.04); border: 0.5px solid rgba(255,255,255,0.1); border-radius: 10px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: border-color 0.15s; padding: 0; }
.jp-puzzle-card:hover { border-color: rgba(29,184,138,0.5); }
.jp-puzzle-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.jp-puzzle-card span { font-size: 11px; color: rgba(255,255,255,0.7); padding: 6px 8px; display: block; text-align: center; line-height: 1.3; }
.jp-loading { padding: 32px 20px; color: rgba(255,255,255,0.4); font-size: 13px; text-align: center; }

.jp-topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: rgba(20,24,20,0.95); border-bottom: 0.5px solid rgba(255,255,255,0.1); flex-shrink: 0; gap: 12px; }

.jp-topbar-left { display: flex; align-items: center; gap: 10px; }

.jp-back-btn { font-size: 12px; color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.06); border: 0.5px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }

.jp-back-btn:hover { background: rgba(255,255,255,0.1); }

.jp-topbar-title { font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.9); }

.jp-topbar-hud { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.jp-hud-pill { font-size: 12px; color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.06); border: 0.5px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 4px 12px; white-space: nowrap; }

.jp-hud-pill strong { color: rgba(255,255,255,0.9); font-weight: 500; }

.jp-play-layout { display: grid; grid-template-columns: 1fr 220px; flex: 1; min-height: 0; overflow: hidden; }

.jp-stage-wrap { display: flex; flex-direction: column; min-height: 0; overflow: hidden; position: relative; }

.jp-stage { position: relative; flex: 1; min-height: 0; overflow: visible; touch-action: none; }

.jp-board { position: absolute; border-radius: 14px; background: rgba(7,9,10,0.44); box-shadow: inset 0 0 0 2px rgba(29,184,138,0.72), inset 0 0 36px rgba(0,0,0,0.55); }

.jp-board::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background-image: linear-gradient(to right, rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.1) 1px, transparent 1px); background-size: calc(100% / var(--jp-size)) calc(100% / var(--jp-size)); }

.jp-pieces { position: absolute; inset: 0; overflow: visible; }

.jp-tray { display: none; flex-shrink: 0; height: 90px; border-top: 0.5px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.35); align-items: center; gap: 0; padding: 0 12px; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; }

.jp-tray::-webkit-scrollbar { height: 4px; }
.jp-tray::-webkit-scrollbar-track { background: transparent; }
.jp-tray::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.jp-tray-label { font-size: 10px; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; margin-right: 12px; flex-shrink: 0; }

.jp-piece { position: absolute; left: 0; top: 0; border: 0; padding: 0; background: transparent; cursor: grab; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); touch-action: none; overflow: visible; }

.jp-piece svg { width: 100%; height: 100%; display: block; overflow: visible; }

.jp-piece-edge { fill: transparent; stroke: rgba(255,255,255,0.85); stroke-width: 1.6; }

.jp-piece--dragging { cursor: grabbing; z-index: 100; filter: drop-shadow(0 12px 16px rgba(0,0,0,0.6)); }

.jp-piece--placed { cursor: default; filter: none; }

.jp-sidebar { background: rgba(16,20,16,0.97); border-left: 0.5px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; padding: 14px; gap: 12px; overflow-y: auto; }

.jp-preview { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; border: 0.5px solid rgba(255,255,255,0.1); display: block; }

.jp-puzzle-title { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.9); line-height: 1.3; }

.jp-puzzle-sub { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }

.jp-sidebar-divider { height: 0.5px; background: rgba(255,255,255,0.08); flex-shrink: 0; }

.jp-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.jp-stat { background: rgba(255,255,255,0.04); border: 0.5px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 8px; }

.jp-stat-label { font-size: 10px; color: rgba(255,255,255,0.4); }

.jp-stat-val { font-size: 18px; font-weight: 500; color: rgba(255,255,255,0.9); }

.jp-btn { width: 100%; padding: 9px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; text-align: center; border: none; }

.jp-btn--primary { background: #1db88a; color: #fff; }
.jp-btn--primary:hover { background: #19a87c; }
.jp-btn--secondary { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); border: 0.5px solid rgba(255,255,255,0.12); margin-top: 4px; }
.jp-btn--secondary:hover { background: rgba(255,255,255,0.1); }

.jp-complete { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 200; }
.jp-complete[hidden] { display: none; }
.jp-complete-card { background: rgba(20,26,20,0.98); border: 0.5px solid rgba(29,184,138,0.4); border-radius: 16px; padding: 32px; text-align: center; max-width: 320px; }
.jp-complete-kicker { font-size: 12px; color: #1db88a; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.jp-complete-card h3 { font-size: 22px; font-weight: 500; color: #fff; margin-bottom: 12px; }
.jp-complete-card p { font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 24px; }
.jp-complete-card .jp-btn { margin-top: 8px; }

@media (max-width: 700px) {
  .jp-play-layout { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .jp-sidebar { display: none; }
  .jp-topbar-hud { display: flex; }
}
