:root {
  font-family: 'Segoe UI', Roboto, sans-serif;
  color: #f8f8f8;
  --bg-color: #141621;
  --surface: rgba(28, 30, 44, 0.9);
  --surface-soft: rgba(40, 42, 58, 0.7);
  --accent: #ff6b6b;
  --accent-strong: #ff5252;
  --secondary: #4ecdc4;
  --text-muted: rgba(255, 255, 255, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #3a1c71 0%, #1d1f27 40%, #0f111b 100%);
  color: #f8f8f8;
}

html.debug-mode::before {
  content: 'DEBUG MODE';
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 9999;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(255, 0, 110, 0.25);
  border: 1px solid rgba(255, 0, 110, 0.6);
  color: #ffddf1;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

button {
  font-family: inherit;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--accent-strong);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: var(--secondary);
  color: #06121d;
}

button.danger {
  background: var(--accent-strong);
  color: #fff;
}

button.danger:hover:not(:disabled) {
  background: #ff3838;
}

#app {
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 24px 180px;
  gap: 16px;
}

.app-shell.immersive-stage-active {
  padding: 0 24px 140px;
}

.app-shell.immersive-stage-active main.app-main {
  padding-bottom: 0;
  overflow: hidden;
  align-items: stretch;
}

.app-shell.immersive-stage-active .party-view.in-game {
  flex: 1;
  max-width: 100%;
}

.app-shell.immersive-stage-active .party-layout.in-game {
  display: flex;
  flex-direction: column;
}

.app-shell.immersive-stage-active .party-layout.in-game,
.app-shell.immersive-stage-active .party-stage.in-game,
.game-stage.immersive-active {
  flex: 1;
  min-height: 0;
}

.game-stage.immersive-active {
  gap: 16px;
}

.game-stage.immersive-active .game-table {
  flex: 1;
  min-height: max(420px, calc(100vh - 220px));
  height: auto;
  padding: clamp(32px, 5vw, 64px);
}

.app-banner-region:empty {
  display: none;
}

.hand-bar-container {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 0 24px 24px;
  pointer-events: none;
  z-index: 60;
}

.hand-bar-container:not(.visible) {
  display: none;
}

body.has-modal-overlay .header-island__tag-lane {
  opacity: 0 !important;
  pointer-events: none !important;
}

.auth-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px;
  isolation: isolate;
}

.auth-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 22, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: -1;
}

.auth-panel {
  width: min(520px, 100%);
  padding: 36px 32px 40px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(31, 33, 51, 0.94), rgba(19, 21, 36, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.auth-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.75));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
}

.auth-notice {
  text-align: center;
  font-size: 0.85rem;
}

.auth-switcher {
  align-self: center;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  gap: 4px;
}

.auth-switcher-button {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  transform: none !important;
}

.auth-switcher-button.is-active {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.95), rgba(246, 52, 89, 0.95));
  color: #fff;
  box-shadow: 0 12px 25px rgba(255, 84, 102, 0.35);
}

.auth-switcher-button[data-disabled='1'] {
  opacity: 0.55;
}

.auth-content {
  position: relative;
  min-height: 220px;
}

.auth-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field:focus-within {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.auth-field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
}

.auth-field-icon svg {
  width: 20px;
  height: 20px;
}

.auth-field input {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  min-width: 0;
}

.auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.auth-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6b6b, #f63459);
  color: #fff;
  box-shadow: 0 20px 40px rgba(246, 52, 89, 0.35);
  border: none;
  cursor: pointer;
  transform: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 24px 45px rgba(246, 52, 89, 0.45);
}

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

.auth-submit-icon {
  display: inline-flex;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.auth-submit-icon svg {
  width: 20px;
  height: 20px;
}

.auth-submit-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: auth-spin 0.8s linear infinite;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.auth-form[data-loading='1'] .auth-submit-icon {
  opacity: 0;
  transform: translateX(-6px);
}

.auth-form[data-loading='1'] .auth-submit-spinner {
  opacity: 1;
}

.auth-reset {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 600;
  align-self: center;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
  transform: none !important;
}

.auth-reset:hover:not(:disabled) {
  color: #fff;
}

.auth-reset:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-message {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

.auth-step-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-helper {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: -10px 0 10px 4px;
}

.auth-helper[data-variant='error'] {
  color: #ff8f8f;
}

.auth-helper[data-variant='success'] {
  color: #7fffb0;
}

.auth-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.auth-buttons .auth-submit {
  flex: 1;
}

.auth-buttons .auth-reset {
  flex: none;
}

.notice {
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}

.notice--info {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.notice--error,
.notice-error {
  background: rgba(156, 42, 54, 0.45);
  border-color: rgba(255, 107, 107, 0.75);
}

.maintenance-banner {
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 4px solid rgba(240, 173, 0, 0.8);
  background: rgba(240, 173, 0, 0.12);
  color: #a36400;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.maintenance-banner-active {
  border-left-color: rgba(220, 60, 60, 0.8);
  background: rgba(220, 60, 60, 0.12);
  color: #9c2f2f;
}

.maintenance-banner-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.maintenance-banner-message {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.maintenance-banner-auth {
  margin-bottom: 16px;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.session-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-card[data-current='1'] {
  border-color: rgba(108, 199, 255, 0.45);
  box-shadow: 0 12px 30px rgba(108, 199, 255, 0.25);
}

.session-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.session-card__header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.session-card__badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(108, 199, 255, 0.2);
  color: #9ddcff;
  font-size: 0.75rem;
  font-weight: 600;
}

.session-card__meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.session-card__warning {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 195, 113, 0.15);
  border: 1px solid rgba(255, 195, 113, 0.35);
  color: #ffd59d;
  font-size: 0.85rem;
}

.session-card__footer {
  display: flex;
  justify-content: flex-end;
}

.notice--success {
  background: rgba(40, 120, 108, 0.55);
  border-color: rgba(78, 220, 196, 0.8);
}

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

@media (max-width: 540px) {
  .auth-panel {
    padding: 28px 20px 32px;
    border-radius: 24px;
  }

  .auth-content {
    min-height: 200px;
  }

  .auth-switcher-button {
    font-size: 0.9rem;
    padding: 8px 16px;
  }
}


.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(18, 21, 34, 0.95));
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
  position: relative;
  backdrop-filter: blur(14px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.header-brand img {
  width: 52px;
}

.header-center {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.header-center:empty {
  display: none;
}

.scoreboard {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.score-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.3));
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.score-chip.bot {
  background: rgba(78, 205, 196, 0.2);
}

.turn-timer {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.header-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 22px;
  border-radius: 20px;
  background: rgba(16, 22, 40, 0.65);
  border: 1px solid rgba(120, 190, 255, 0.28);
  box-shadow:
    0 20px 44px rgba(8, 12, 30, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
}

.header-tag--empty {
  opacity: 0.55;
  min-height: 44px;
}

.header-island-root[data-quality='low'] .header-tag {
  backdrop-filter: none;
  background: rgba(42, 46, 58, 0.9);
  border-color: rgba(180, 188, 205, 0.24);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

.header-tag--reverseGame {
  gap: 12px;
}

.header-tag--reverseGame .status-chip[data-color='red'] {
  background: linear-gradient(135deg, rgba(249, 65, 68, 0.85), rgba(200, 30, 34, 0.85));
  color: #1b0404;
}

.header-tag--reverseGame .status-chip[data-color='yellow'] {
  background: linear-gradient(135deg, rgba(249, 199, 79, 0.85), rgba(216, 158, 16, 0.85));
  color: #231902;
}

.header-tag--reverseGame .status-chip[data-color='green'] {
  background: linear-gradient(135deg, rgba(67, 170, 139, 0.82), rgba(32, 109, 84, 0.85));
  color: #04140f;
}

.header-tag--reverseGame .status-chip[data-color='blue'] {
  background: linear-gradient(135deg, rgba(39, 125, 161, 0.88), rgba(15, 76, 117, 0.88));
  color: #e8f5ff;
}

.header-tag--reverseGame .status-chip[data-color='wild'] {
  background: linear-gradient(135deg, rgba(173, 181, 189, 0.8), rgba(73, 80, 87, 0.85));
  color: #0b0d14;
}

.status-chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f8f8f8;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.status-chip-accent {
  background: rgba(255, 107, 107, 0.35);
}

.status-chip-success {
  background: rgba(78, 205, 196, 0.3);
}

.status-chip-warning {
  background: rgba(255, 193, 7, 0.4);
  color: #261700;
}

.status-chip-muted {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

.status-chip-priority {
  background: rgba(130, 87, 230, 0.45);
}

.status-strip .turn-timer {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  color: #f8f8f8;
}

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

.header-action-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 60;
}

.coin-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 14px;
  color: #ffe082;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.coin-display .coin-icon {
  font-size: 18px;
}

.coin-icon {
  display: inline-flex;
  align-items: center;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
  position: relative;
}

.icon-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.15);
}

.icon-button.active {
  background: rgba(78, 205, 196, 0.4);
  color: #051d1a;
}

.icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.leave-game-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.75), rgba(220, 20, 60, 0.85));
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(220, 20, 60, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.leave-game-button .icon {
  font-size: 18px;
}

.leave-game-button .label {
  font-size: 14px;
}

.leave-game-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(220, 20, 60, 0.55);
}

.leave-game-button.active {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.9), rgba(220, 20, 60, 0.95));
  box-shadow: 0 20px 44px rgba(220, 20, 60, 0.6);
}

.leave-game-popover {
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  min-width: 320px;
  background: var(--surface);
  padding: 20px 22px;
  border-radius: 18px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 260;
}

.leave-game-popover h3 {
  margin: 0;
  font-size: 18px;
}

.leave-game-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.leave-game-options {
  display: grid;
  gap: 10px;
}

.leave-game-option {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.leave-game-option:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.leave-game-option.destructive {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.65), rgba(220, 20, 60, 0.75));
  text-align: center;
}

.leave-game-option.destructive:hover {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.8), rgba(220, 20, 60, 0.9));
}

.leave-game-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leave-game-cancel {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: center;
}

.leave-game-cancel:hover {
  background: rgba(255, 255, 255, 0.16);
}

.share-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--surface);
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 8px;
  min-width: 280px;
  z-index: 260;
}

.share-popover input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.share-popover button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--secondary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.priority-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--surface);
  padding: 18px 20px;
  border-radius: 16px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 12px;
  min-width: 260px;
  z-index: 260;
}

.priority-popover h3 {
  margin: 0;
  font-size: 18px;
}

.priority-popover .priority-availability {
  margin: 0;
}

.priority-popover .priority-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.priority-popover .priority-commit {
  white-space: nowrap;
}

.priority-popover .priority-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.priority-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: #031213;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.app-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding-bottom: 24px;
  overflow-y: auto;
}

.lobby-view {
  width: 100%;
  max-width: 1280px;
  display: grid;
  gap: 20px;
}

.party-view {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.party-layout {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

.party-view.in-game {
  gap: 0;
  max-width: 100%;
}

.party-layout.in-game {
  gap: 0;
  flex: 1;
  width: 100%;
  align-items: stretch;
  flex-direction: column;
}

.party-stage.in-game,
.party-layout.in-game .party-stage {
  flex: 1;
  gap: 0;
  min-height: 0;
}

.party-layout.in-game .party-side-stage {
  display: none !important;
}

.party-layout.in-game .game-stage {
  flex: 1;
}

.party-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.party-waiting {
  text-align: center;
  background: rgba(20, 22, 33, 0.8);
}

.party-lobby-stage {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: rgba(20, 22, 33, 0.85);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.lobby-stage-alerts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.lobby-stage-alert {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid rgba(78, 205, 196, 0.4);
  background: rgba(78, 205, 196, 0.12);
  color: #f6f7fb;
}

.lobby-stage-alert strong {
  font-size: 15px;
}

.lobby-stage-alert p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.lobby-stage-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.lobby-stage-alert--confirm {
  border-color: rgba(255, 189, 89, 0.45);
  background: rgba(255, 189, 89, 0.15);
}

.lobby-stage-alert--voting {
  border-color: rgba(110, 191, 255, 0.5);
  background: rgba(110, 191, 255, 0.18);
}

.lobby-stage-alert--warning {
  border-color: rgba(255, 112, 112, 0.5);
  background: rgba(255, 112, 112, 0.18);
}

.lobby-stage-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-phase-chip {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(78, 205, 196, 0.18);
}

.lobby-stage-header h2 {
  margin: 0;
  font-size: 24px;
}

.lobby-stage-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

.lobby-stage-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.lobby-stage-primary,
.lobby-stage-secondary {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1 1 360px;
  min-width: 280px;
}

.lobby-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-section-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lobby-section-heading h3 {
  margin: 0;
  font-size: 18px;
}

.lobby-section-note {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}

.lobby-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.lobby-game-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid transparent;
  color: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, border 0.18s ease, box-shadow 0.18s ease;
}

.lobby-game-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.lobby-game-banner {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.32), rgba(41, 121, 255, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lobby-game-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lobby-game-banner.placeholder {
  background: linear-gradient(135deg, rgba(130, 87, 230, 0.35), rgba(255, 100, 100, 0.28));
  color: rgba(255, 255, 255, 0.86);
}

.lobby-game-banner.placeholder span {
  font-size: 26px;
}

.lobby-game-card strong {
  font-size: 16px;
}

.lobby-game-card span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.lobby-game-card.selected {
  border-color: rgba(78, 205, 196, 0.6);
  box-shadow: 0 18px 36px rgba(78, 205, 196, 0.25);
}

.lobby-game-card:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.coming-soon-badge {
  margin-top: auto;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 214, 10, 0.2);
  color: #ffd60a;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.lobby-ready-panel {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ready-summary {
  margin: 0;
  font-weight: 600;
}

.ready-toggle {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.9), rgba(78, 205, 196, 0.7));
  color: #04121f;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.ready-toggle.active {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.9), rgba(0, 200, 83, 0.65));
}

.ready-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ready-toggle:not(:disabled):hover {
  filter: brightness(1.05);
}

.ready-note {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}

.ready-note.secondary {
  color: rgba(255, 255, 255, 0.45);
}

.side-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.side-stage-header h3 {
  margin: 0;
}

.side-stage-header span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 600;
}

.leave-party-button {
  width: 100%;
}

.leave-party-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leave-party-actions .ghost-button {
  width: 100%;
  justify-content: center;
}

.share-party-button {
  width: 100%;
  justify-content: center;
}

.share-modal-link {
  display: grid;
  gap: 8px;
}

.share-modal-link input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.share-modal-link button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--secondary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  justify-self: start;
}

@media (min-width: 640px) {
  .leave-party-actions {
    flex-direction: row;
  }

  .leave-party-actions > * {
    flex: 1;
  }
}

.ready-check-section .ready-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ready-check-section .ready-content > button {
  align-self: stretch;
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.player-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.player-avatar {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.player-list-item.member-ready {
  border-color: rgba(78, 205, 196, 0.4);
  background: rgba(78, 205, 196, 0.12);
}

.player-list-item.bot-entry {
  background: rgba(255, 255, 255, 0.03);
}

.player-nameplate {
  flex: 1 1 auto;
  min-width: 0;
}

.player-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.player-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.player-actions {
  display: flex;
  gap: 8px;
}

.ghost-button.small {
  padding: 6px 12px;
  font-size: 13px;
}

.players-empty {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
}

.join-request-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.join-request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.join-request-name {
  font-weight: 600;
}

.join-request-actions {
  display: flex;
  gap: 8px;
}

.spectator-search {
  width: 100%;
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.85);
}

.spectator-list.side-stage {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spectator-item {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.spectator-nameplate {
  font-weight: 600;
}

.spectator-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.spectator-note.warning {
  color: #ffb347;
}

.access-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.toggle-pill {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease, color 0.2s ease;
}

.toggle-pill.active {
  border-color: rgba(78, 205, 196, 0.7);
  background: rgba(78, 205, 196, 0.15);
  color: rgba(78, 205, 196, 0.95);
}

.toggle-pill:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.toggle-pill.inactive:not(:disabled):hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.85);
}

.access-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(78, 205, 196, 0.18);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.access-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.access-publish-notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  line-height: 1.4;
}
.ready-layout-driver {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.58);
}

.ready-layout-driver .priority-driver-link {
  color: var(--secondary);
}

.ghost-button {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: border 0.2s ease, color 0.2s ease;
}

.ghost-button:hover {
  border-color: rgba(255, 255, 255, 0.55);
  color: rgba(255, 255, 255, 0.85);
}

.lobby-vote-placeholder {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.62);
}

.lobby-player-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
}

.lobby-player-row.ready {
  background: rgba(78, 205, 196, 0.12);
}

.lobby-player-row.needs-confirm {
  background: rgba(255, 214, 10, 0.14);
}

.lobby-player-row.leader {
  border-color: rgba(78, 205, 196, 0.45);
}

.lobby-player-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lobby-player-name {
  font-weight: 600;
}

.lobby-player-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.lobby-player-badges .status-chip {
  box-shadow: none;
}

.lobby-spectator-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lobby-rules-section {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lobby-rules-hash {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.48);
}

.lobby-rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.lobby-rule-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

.lobby-rule-row dt {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  flex: 0 1 40%;
}

.lobby-rule-row dd {
  margin: 0;
  font-weight: 600;
  margin-left: auto;
  text-align: right;
}

.lobby-rule-row.rule-diff-default {
  border: 1px solid rgba(78, 205, 196, 0.45);
}

.lobby-rule-row.rule-needs-confirm {
  background: rgba(255, 214, 10, 0.18);
}

.rule-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.rule-toggle input {
  width: 18px;
  height: 18px;
}

.round-limit-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.round-limit-row input[type='number'] {
  width: 80px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: inherit;
}

.lobby-rule-edit-hint {
  margin-top: 8px;
}

.lobby-rules-inline-editor {
  margin: 0;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-rule-row--editing {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.rule-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rule-editor-title {
  margin: 0;
  font-size: 16px;
}

.rule-editor-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.rule-editor-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rule-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.rule-editor-save,
.rule-editor-cancel {
  min-width: 112px;
}

.rule-select-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rule-number-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.rule-number-input {
  width: 96px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: inherit;
}

.rule-select-row span {
  flex: 1 1 auto;
  color: rgba(255, 255, 255, 0.75);
}

.rule-select-input {
  width: 100%;
  max-width: 200px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 14px;
}

.rule-edit-button {
  margin-left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.65);
  background: transparent;
  border: none;
  transition: background 150ms ease, color 150ms ease;
  cursor: pointer;
}

.rule-edit-button:hover,
.rule-edit-button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.lobby-coming-soon {
  border-radius: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lobby-coming-soon h3 {
  margin: 0;
}

.lobby-coming-soon p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
}

.lobby-coming-soon button {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.9), rgba(78, 205, 196, 0.7));
  color: #04121f;
  font-weight: 600;
  cursor: pointer;
}

.lobby-coming-soon button:hover {
  filter: brightness(1.05);
}

.spectator-block {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spectator-block h4 {
  margin: 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
}

.party-side-stage {
  flex: 0 0 680px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: flex-basis 0.3s ease, width 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.party-side-stage-scroll {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-right: 6px;
}

.party-rules-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
}

.party-rules-summary dt {
  color: var(--text-muted);
}

.party-rules-summary dd {
  margin: 0;
  font-weight: 600;
}

.party-rules-note {
  margin: 16px 0 0;
  color: var(--text-muted);
}

.party-view.sidebar-collapsed .party-side-stage {
  flex-basis: 0;
  width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(32px);
}

@media (max-width: 1100px) {
  .party-layout {
    flex-direction: column;
  }

  .party-side-stage {
    flex: none;
    width: 100%;
    max-height: none;
    transform: none;
  }

  .party-view.sidebar-collapsed .party-side-stage {
    transform: translateY(-20px);
  }
}

 .side-stage-section,
.panel-section {
  background: var(--surface);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.side-stage-section h2,
.side-stage-section h3,
.side-stage-section h4,
.panel-section h2,
.panel-section h3,
.panel-section h4 {
  margin: 0 0 12px;
}

.lobby-description {
  color: var(--text-muted);
  margin: 0 0 16px;
}

.lobby-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.lobby-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}

.lobby-card button,
.party-controls button,
.add-friend-form button,
.activity-card button,
.friend-actions button,
.party-settings button,
.share-popover button,
.admin-controls button {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

button.secondary {
  background: var(--secondary);
  color: #06121d;
}

.lobby-actions button:hover,
.party-controls button:hover,
.add-friend-form button:hover,
.activity-card button:hover,
.party-settings button:hover,
.share-popover button:hover {
  transform: translateY(-2px);
  background: var(--accent-strong);
}

.join-form {
  display: flex;
  gap: 12px;
  align-items: center;
}

.join-form input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.friend-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.friend-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.friend-card span {
  color: var(--text-muted);
}

.add-friend-form {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.add-friend-form .form-row {
  display: flex;
  gap: 12px;
}

.add-friend-form input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.invite-list .notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.overlay-list {
  margin-top: 4px;
}

.friends-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.friend-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 16px 18px;
}

.friend-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.avatar-badge--image {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.avatar-badge--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-badge--large {
  width: 72px;
  height: 72px;
  font-size: 32px;
}

.avatar-badge--medium {
  width: 48px;
  height: 48px;
  font-size: 24px;
}

.avatar-badge--small {
  width: 32px;
  height: 32px;
  font-size: 18px;
}

.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.friend-nameplate {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.friend-row-name {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.friend-status {
  font-size: 13px;
  color: var(--text-muted);
}

.friend-status--online {
  color: var(--secondary);
}

.friend-status--busy {
  color: #f59e0b;
}

.friend-status--away {
  color: #f97316;
}

.friend-status--offline {
  color: rgba(255, 255, 255, 0.55);
}

.friend-party-summary {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  min-width: 0;
}

.friend-party-summary span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.friend-actions button {
  min-width: 100px;
}

.friend-join-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.friends-activity {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.friends-activity h3 {
  margin: 0;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.activity-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 16px 18px;
  border-radius: 18px;
}

.activity-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.activity-card-header strong {
  font-size: 16px;
  letter-spacing: 0.08em;
}

.activity-card-header span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.activity-card-friends {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.activity-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .friend-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .friend-actions {
    justify-content: flex-start;
  }
}

.friends-panel h2 {
  margin-bottom: 0;
}
.priority-availability {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.priority-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.priority-form label {
  font-size: 13px;
  color: var(--text-muted);
}

.priority-form select {
  background: rgba(12, 14, 24, 0.8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px 12px;
}

.priority-commit {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--secondary);
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.priority-commit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

.ready-meta {
  align-self: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 8px;
}

.join-requests .notice {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.nameplate {
  --nameplate-bg: rgba(255, 255, 255, 0.08);
  --nameplate-border: rgba(255, 255, 255, 0.2);
  --nameplate-color: #ffffff;
  --nameplate-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
  --nameplate-bg-size: cover;
  --nameplate-bg-repeat: no-repeat;
  --nameplate-bg-position: center;
  --nameplate-bg-blend: normal;
  --nameplate-overlay-opacity: 0;
  --nameplate-overlay: transparent;
  --nameplate-overlay-size: 180% 180%;
  --nameplate-overlay-repeat: no-repeat;
  --nameplate-overlay-position: center;
  --nameplate-overlay-blend: screen;
  --nameplate-overlay-animation: none;
  --nameplate-before-opacity: 0;
  --nameplate-before-bg: transparent;
  --nameplate-before-size: auto;
  --nameplate-before-repeat: no-repeat;
  --nameplate-before-position: center;
  --nameplate-before-animation: none;
  --nameplate-before-blur: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid var(--nameplate-border);
  background: var(--nameplate-bg);
  background-size: var(--nameplate-bg-size);
  background-repeat: var(--nameplate-bg-repeat);
  background-position: var(--nameplate-bg-position);
  background-blend-mode: var(--nameplate-bg-blend);
  color: var(--nameplate-color);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  box-shadow: var(--nameplate-shadow);
  overflow: visible;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nameplate::after,
.nameplate::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}

.nameplate::after {
  opacity: var(--nameplate-overlay-opacity);
  background: var(--nameplate-overlay);
  background-size: var(--nameplate-overlay-size);
  background-repeat: var(--nameplate-overlay-repeat);
  background-position: var(--nameplate-overlay-position);
  mix-blend-mode: var(--nameplate-overlay-blend);
  animation: var(--nameplate-overlay-animation);
}

.nameplate::before {
  opacity: var(--nameplate-before-opacity);
  background: var(--nameplate-before-bg);
  background-size: var(--nameplate-before-size);
  background-repeat: var(--nameplate-before-repeat);
  background-position: var(--nameplate-before-position);
  filter: blur(var(--nameplate-before-blur));
  animation: var(--nameplate-before-animation);
}

.nameplate-label {
  white-space: nowrap;
}

.nameplate-handle {
  font-size: 12px;
  opacity: 0.75;
  font-weight: 500;
}

.nameplate-block {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 18px;
}

.nameplate-compact {
  padding: 4px 12px;
  font-size: 14px;
}

.nameplate-chat {
  padding: 2px 10px;
  font-size: 13px;
  gap: 4px;
}

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

.user-link:hover {
  text-decoration: underline;
}

.user-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nameplate-clickable {
  cursor: pointer;
}

.nameplate-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
}

.nameplate-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.chat-mention {
  font-weight: 600;
  color: var(--accent);
}


.party-roster-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.member-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.member-list-item.member-ready {
  border: 1px solid rgba(78, 205, 196, 0.45);
  box-shadow: 0 16px 36px rgba(78, 205, 196, 0.2);
}

.member-list-item.priority-driver {
  border: 1px solid rgba(130, 87, 230, 0.5);
  box-shadow: 0 18px 40px rgba(130, 87, 230, 0.2);
}

.member-list-item.bot {
  background: rgba(78, 205, 196, 0.15);
}

.member-list-meta {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.member-list-meta:empty {
  display: none;
}

.member-list-meta .member-status {
  justify-content: flex-end;
}

.member-list-item .member-nameplate {
  flex-shrink: 0;
}

.member-list-item button {
  white-space: nowrap;
}

.member-card .member-nameplate {
  align-self: flex-start;
}

.member-card .nameplate-handle {
  font-size: 12px;
}

.member-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.member-card.member-ready {
  border: 1px solid rgba(78, 205, 196, 0.45);
  box-shadow: 0 16px 36px rgba(78, 205, 196, 0.2);
}

.member-card.priority-driver {
  border: 1px solid rgba(130, 87, 230, 0.5);
  box-shadow: 0 18px 40px rgba(130, 87, 230, 0.2);
}

.member-card.bot {
  background: rgba(78, 205, 196, 0.15);
}

.member-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.member-status .status-chip {
  font-size: 11px;
  padding: 4px 10px;
}

.spectator-list {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin-left: 0;
}

.party-roster-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.party-spectators {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.party-spectators .lobby-section-heading {
  gap: 6px;
}

.party-spectators-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.party-spectators .spectator-list {
  margin-top: 8px;
}

.spectator-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.overlay-party-spectators {
  margin-top: 20px;
}

.overlay-party-spectators .spectator-list {
  margin-top: 12px;
}

.winner-overlay-host {
  position: relative;
}

.winner-overlay-active > :not(.winner-overlay) {
  pointer-events: none;
  user-select: none;
}

.winner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.55));
  z-index: 40;
}

.winner-overlay.winner-overlay-classic {
  background: radial-gradient(circle at 50% 20%, rgba(255, 214, 10, 0.3), rgba(0, 0, 0, 0.65));
}

.winner-overlay.winner-overlay-neon-rush {
  background: radial-gradient(circle at 40% 30%, rgba(63, 81, 181, 0.4), rgba(0, 0, 0, 0.7));
}

.winner-overlay.winner-overlay-starlight {
  background: radial-gradient(circle at 50% 10%, rgba(129, 212, 250, 0.35), rgba(0, 0, 0, 0.7));
}

.winner-overlay-neon-rush .winner-content {
  background: rgba(32, 43, 74, 0.92);
  box-shadow: 0 30px 90px rgba(63, 81, 181, 0.45);
}

.winner-overlay-starlight .winner-content {
  background: rgba(18, 31, 52, 0.9);
  box-shadow: 0 30px 90px rgba(129, 212, 250, 0.35);
}

.winner-content {
  text-align: center;
  padding: 28px 36px;
  border-radius: 20px;
  background: rgba(12, 16, 28, 0.88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 2;
}

.winner-content h2 {
  margin: 0 0 10px;
  font-size: 32px;
  letter-spacing: 0.05em;
}

.winner-subtext {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.winner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.winner-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-inline: 20px;
}

.winner-action-exit {
  font-weight: 600;
}

.winner-action-replay {
  position: relative;
  padding-inline: 24px;
}

.winner-action-label {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.winner-replay-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.winner-replay-avatar-badge {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.winner-replay-check {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--success-500, #2ecc71);
  color: #04110a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.winner-action-replay.active .winner-replay-check {
  opacity: 1;
  transform: scale(1);
}

.winner-action-replay.active .winner-replay-avatar-badge {
  box-shadow:
    0 0 0 2px rgba(46, 204, 113, 0.75),
    0 10px 28px rgba(46, 204, 113, 0.4);
}

.winner-ready-heading {
  margin: 28px auto 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.winner-ready-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.winner-ready-entry {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.winner-ready-avatar {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.winner-ready-entry.leader .winner-ready-avatar {
  box-shadow:
    0 0 0 2px rgba(255, 215, 0, 0.65),
    0 12px 28px rgba(255, 215, 0, 0.35);
}

.winner-ready-entry.ready .winner-ready-avatar {
  box-shadow:
    0 0 0 3px rgba(46, 204, 113, 0.75),
    0 12px 32px rgba(46, 204, 113, 0.45);
}

.winner-ready-check {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--success-500, #2ecc71);
  color: #04110a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.winner-ready-entry.ready .winner-ready-check {
  opacity: 1;
  transform: scale(1);
}

.winner-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.winner-confetti span {
  position: absolute;
  top: -12%;
  left: var(--left, 50%);
  width: 8px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(135deg, #ff6b6b, #fddb92);
  opacity: 0;
  animation-name: confettiFall;
  animation-duration: var(--fall-duration, 2.6s);
  animation-timing-function: ease-in-out;
  animation-delay: var(--fall-delay, 0s);
  animation-iteration-count: infinite;
  will-change: transform;
}

.winner-confetti span:nth-child(3n) {
  background: linear-gradient(135deg, #4ecdc4, #556270);
}

.winner-confetti span:nth-child(4n) {
  background: linear-gradient(135deg, #ffe066, #ff6b6b);
}

@keyframes confettiFall {
  0% {
    transform: translate3d(0, -15%, 0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--sway, 0px), 110vh, 0) rotate(260deg);
    opacity: 0;
  }
}

.game-stage {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  position: relative;
}

.game-table {
  position: relative;
  border-radius: 36px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.05) 0%, rgba(14, 18, 29, 0.95) 70%);
  min-height: clamp(420px, 60vh, 680px);
  height: clamp(420px, 60vh, 720px);
  padding: 48px;
  overflow: hidden;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6), 0 24px 70px rgba(0, 0, 0, 0.65);
}

.ready-panel {
  position: absolute;
  left: 32px;
  bottom: 32px;
  background: rgba(10, 14, 24, 0.85);
  border-radius: 18px;
  padding: 16px 18px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  pointer-events: none;
  z-index: 60;
}

.ready-list {
  display: grid;
  gap: 6px;
}

.ready-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.ready-name {
  font-weight: 600;
}

.ready-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.12);
}

.ready-badge.ready {
  background: rgba(78, 205, 196, 0.45);
  color: #061c17;
}

.ready-badge.waiting {
  background: rgba(255, 107, 107, 0.4);
}

.ready-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.ready-summary strong {
  color: #fff;
  font-size: 14px;
}

.game-table.your-turn-board {
  box-shadow: inset 0 0 80px rgba(56, 239, 125, 0.28), 0 24px 80px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(56, 239, 125, 0.45);
}

.game-table.time-warning-board {
  border: 1px solid rgba(255, 107, 107, 0.6);
  animation: boardWarning 1s ease-in-out infinite;
}

.table-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 24px;
}

.pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.pile:hover {
  transform: translateY(-4px);
}

.pile.disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
  transform: none;
}

.pile.needs-draw {
  animation: drawPulse 1s infinite;
}

.pile.pending-draw {
  animation: pendingDrawPulse 1.2s ease-in-out infinite;
}

@keyframes drawPulse {
  0% {
    filter: drop-shadow(0 0 0 rgba(255, 107, 107, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(255, 107, 107, 0.8));
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(255, 107, 107, 0.4));
  }
}

@keyframes pendingDrawPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(255, 64, 129, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(255, 64, 129, 0.9));
  }
}

@keyframes boardWarning {
  0%,
  100% {
    box-shadow: inset 0 0 70px rgba(255, 107, 107, 0.25), 0 24px 70px rgba(0, 0, 0, 0.68);
  }
  50% {
    box-shadow: inset 0 0 120px rgba(255, 107, 107, 0.45), 0 24px 90px rgba(255, 107, 107, 0.35);
  }
}

.pile-label {
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.7;
}

.pile.pending-draw .pile-label {
  color: #ff8a80;
  opacity: 1;
  font-weight: 700;
}

.pile.pending-draw .card-count-badge {
  background: #ff1744;
  color: #fff;
}

.color-indicator {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.color-indicator.red {
  background: linear-gradient(135deg, #ff4e50, #f9d423);
}

.color-indicator.green {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}

.color-indicator.blue {
  background: linear-gradient(135deg, #24c6dc, #514a9d);
}

.color-indicator.yellow {
  background: linear-gradient(135deg, #fceabb, #f8b500);
}

.color-indicator.wild {
  background: linear-gradient(135deg, #000, #333);
}

.table-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  font-size: 14px;
}

.table-direction {
  font-size: 18px;
  font-weight: 600;
}

.seat {
  position: absolute;
  width: 170px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 18px;
  backdrop-filter: blur(6px);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.seat.you {
  border: 2px solid var(--secondary);
  box-shadow: 0 0 18px rgba(78, 205, 196, 0.6);
}

.seat.reverseGame::after {
  content: 'Reverse!';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 18px rgba(255, 107, 107, 0.4);
}

.seat.reverse-armed {
  border: 1px solid rgba(255, 152, 0, 0.6);
  box-shadow: 0 0 18px rgba(255, 152, 0, 0.45);
}

.seat.current {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 0 24px rgba(255, 107, 107, 0.65);
}

.seat.bot {
  border: 1px solid rgba(78, 205, 196, 0.5);
}

.seat.automated {
  border: 1px solid rgba(255, 193, 7, 0.45);
}

.seat.afk {
  opacity: 0.9;
}

.seat.winner {
  border: 2px solid var(--accent);
}

.seat-name {
  font-weight: 700;
  font-size: 16px;
}

.seat-avatar {
  margin: 0 auto 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.seat-count {
  font-size: 13px;
  opacity: 0.7;
}

.seat-status {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.seat-status .status-chip {
  font-size: 11px;
  padding: 4px 10px;
}

.seat-bottom {
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
}

.seat-bottom-right {
  bottom: 80px;
  right: 40px;
}

.seat-right {
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
}

.seat-top-right {
  top: 36px;
  right: 60px;
}

.seat-top {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.seat-top-left {
  top: 36px;
  left: 60px;
}

.seat-left {
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
}

.seat-bottom-left {
  bottom: 80px;
  left: 40px;
}

.hand-bar-container .player-hand {
  pointer-events: auto;
}

.player-hand {
  background: rgba(12, 16, 28, 0.92);
  border-radius: 28px 28px 0 0;
  padding: 18px 32px 26px;
  backdrop-filter: blur(14px);
  width: min(1100px, 100%);
  margin: 0 auto;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid transparent;
  transition: background 0.5s ease, box-shadow 0.5s ease, border 0.5s ease;
}

.player-hand.your-turn {
  background: linear-gradient(135deg, rgba(16, 44, 26, 0.95), rgba(56, 138, 72, 0.88));
  box-shadow: 0 -30px 80px rgba(56, 138, 72, 0.5);
  border: 1px solid rgba(130, 220, 150, 0.35);
}

.player-hand .hand-layout {
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.player-hand.with-seat-dock .hand-layout {
  flex-wrap: nowrap;
}

.hand-cards-column {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hand-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.immersive-seat-dock {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.immersive-seat-dock .seat {
  position: relative;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  transform: none;
  align-items: center;
}

.immersive-seat-dock .seat.current {
  transform: none;
}

.immersive-seat-dock .seat .seat-status {
  justify-content: center;
}

.immersive-seat-dock .seat .card-fan {
  margin: 0 auto;
}

@media (max-width: 960px) {
  .player-hand.with-seat-dock .hand-layout {
    flex-direction: column;
  }

  .immersive-seat-dock {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
    align-items: center;
  }

  .immersive-seat-dock .seat {
    max-width: 320px;
  }
}

.player-hand h4 {
  margin: 0 0 12px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.5s ease;
}

.player-hand.your-turn h4 {
  color: #c8ffd7;
}

.reverse-panel {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  width: fit-content;
}

.reverse-panel.needs-action {
  background: rgba(255, 193, 7, 0.25);
  animation: reverse-pulse 1s ease-in-out infinite;
}

.reverse-button {
  min-width: 90px;
  padding: 10px 18px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  text-transform: uppercase;
}

.reverse-button.active {
  background: rgba(102, 187, 106, 0.9);
  color: #042410;
  box-shadow: 0 8px 20px rgba(102, 187, 106, 0.45);
}

.reverse-button.inactive {
  background: rgba(255, 152, 0, 0.85);
  color: #2b1500;
}

.reverse-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.reverse-note {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  max-width: 280px;
}

@keyframes reverse-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.5);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(255, 193, 7, 0.05);
  }
}

.automation-notice {
  margin-top: 12px;
  background: rgba(255, 107, 107, 0.18);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.automation-notice .secondary {
  white-space: nowrap;
}

.ready-control {
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 12px 16px;
  display: grid;
  gap: 6px;
  align-items: start;
  font-size: 14px;
}

.ready-control button {
  justify-self: start;
}

.ready-status {
  font-weight: 600;
}

.ready-counter {
  font-size: 13px;
  color: var(--text-muted);
}

.ready-note {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.card-hand {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 8px;
  padding-inline: 12px;
}

.card-hand::-webkit-scrollbar {
  height: 6px;
}

.card-hand::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.card {
  width: 92px;
  height: 142px;
  border-radius: 16px;
  position: relative;
  flex: 0 0 auto;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.3s ease;
}

.card.display-only {
  pointer-events: none;
  cursor: default;
}

.card.face.compact {
  width: 72px;
  height: 110px;
  font-size: 0.9rem;
}

.card:hover {
  transform: translateY(-6px);
}

.card.combo-candidate {
  transform: translateY(-14px) scale(1.02);
  box-shadow: 0 22px 48px rgba(56, 138, 72, 0.45);
}

.card.combo-candidate:hover {
  transform: translateY(-16px) scale(1.02);
}

.card.disabled,
.card.disabled:hover {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.card-drag-source {
  opacity: 0.2;
}

.card-drag-preview {
  pointer-events: none;
  z-index: 160;
  transform-origin: center center;
  transition: transform 0.12s ease;
}

.draw-drag-preview {
  filter: drop-shadow(0 14px 30px rgba(255, 99, 132, 0.45));
  opacity: 0.95;
}

.pile.draw-dragging {
  transform: translateY(-6px) scale(1.05);
}

.table-drag-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.remote-drag-card {
  position: absolute;
  transform: translate(-50%, -50%);
  opacity: 0.95;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.discard-pile {
  position: relative;
}

.discard-stack {
  position: relative;
  width: 96px;
  height: 120px;
}

.discard-stack .card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center;
  transition: transform 0.3s ease;
}

.discard-history-card {
  opacity: 0.7;
}

.card.muted {
  position: relative;
  overflow: hidden;
}

.card.muted::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(220, 220, 220, 0.25), rgba(36, 36, 36, 0.85));
  opacity: 0;
  pointer-events: none;
  animation: cardMutedOverlay 1.5s ease forwards;
}

@keyframes cardMutedOverlay {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes nameplate-shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 120% 50%;
  }
  100% {
    background-position: 240% 50%;
  }
}

@keyframes nameplate-glow {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.18;
  }
  50% {
    transform: scale(1.12);
    opacity: 0.55;
  }
}

@keyframes suit-drift {
  0% {
    transform: translate3d(-10px, -8px, 0);
  }
  50% {
    transform: translate3d(8px, 10px, 0);
  }
  100% {
    transform: translate3d(-10px, -8px, 0);
  }
}

@keyframes confetti-fall {
  0% {
    background-position: 0% -40%;
  }
  100% {
    background-position: 0% 140%;
  }
}

@keyframes crown-twinkle {
  0%,
  100% {
    transform: scale(0.6) rotate(-10deg);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.05) rotate(12deg);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card.muted::after {
    animation: none;
    opacity: 1;
  }
}

.card.face {
  overflow: hidden;
  color: #fff;
}

.card.face .card-face {
  position: absolute;
  inset: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  font-weight: 700;
}

.card.face .symbol {
  font-size: 40px;
  letter-spacing: -1px;
}

.card.face .corner {
  font-size: 16px;
  align-self: stretch;
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
}

.card.face .corner-bottom {
  transform: rotate(180deg);
}

.card.face.red {
  background: linear-gradient(135deg, #ff4e50, #f9d423);
}

.card.face.green {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}

.card.face.blue {
  background: linear-gradient(135deg, #24c6dc, #514a9d);
}

.card.face.yellow {
  background: linear-gradient(135deg, #fceabb, #f8b500);
}

.card.face.wild {
  background: linear-gradient(135deg, #000, #333);
}

.card.back {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-back-bg, linear-gradient(135deg, #1f1f1f, #3e3e3e));
  background-size: var(--card-back-bg-size, cover);
  background-repeat: var(--card-back-bg-repeat, no-repeat);
  background-position: var(--card-back-bg-position, center);
  background-blend-mode: var(--card-back-bg-blend, normal);
  box-shadow: var(--card-back-shadow, 0 18px 40px rgba(0, 0, 0, 0.45));
}

.card.back .card-back-pattern {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(
    --card-back-pattern,
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.12) 0,
      rgba(255, 255, 255, 0.12) 6px,
      transparent 6px,
      transparent 12px
    )
  );
  background-size: var(--card-back-pattern-size, auto);
  background-repeat: var(--card-back-pattern-repeat, repeat);
  background-position: var(--card-back-pattern-position, center);
  mix-blend-mode: var(--card-back-pattern-blend, screen);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--card-back-label-color, rgba(255, 255, 255, 0.78));
  text-transform: uppercase;
}

.card.back::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: var(--card-back-overlay, linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.35)));
  mix-blend-mode: var(--card-back-overlay-blend, normal);
  opacity: var(--card-back-overlay-opacity, 1);
}


.card-count-badge {
  position: absolute;
  bottom: -10px;
  right: -10px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.card-fan {
  position: relative;
  width: 120px;
  height: 70px;
  display: flex;
  align-items: flex-end;
}

.card-fan .card.back {
  position: absolute;
  bottom: 0;
  left: 0;
}

.card-fan-count {
  margin-left: auto;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 240;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.26s ease;
}

.modal-overlay.is-visible {
  opacity: 1;
}

.modal-overlay.is-closing {
  pointer-events: none;
}

.modal-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: min(860px, 95vw);
  max-height: 90vh;
  background: linear-gradient(160deg, rgba(23, 32, 56, 0.98), rgba(11, 16, 30, 0.95));
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  opacity: 0;
  --modal-translate-x: -50%;
  --modal-translate-y: -50%;
  --modal-scale: 0.94;
  transform: translate(var(--modal-translate-x), var(--modal-translate-y)) scale(var(--modal-scale));
  transition: transform 0.28s cubic-bezier(0.18, 0.82, 0.22, 1), opacity 0.22s ease;
}

.modal-overlay.is-visible .modal-window {
  opacity: 1;
  --modal-scale: 1;
}

.modal-overlay.is-closing .modal-window {
  opacity: 0;
  --modal-scale: 0.96;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 0;
  cursor: grab;
}

.modal-header:active {
  cursor: grabbing;
}

.modal-header-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-title {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.06em;
}

.modal-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.modal-content {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.modal-content.decision-modal {
  gap: 1.5rem;
}

.alpha-launch-modal {
  align-items: stretch;
}

.alpha-launch-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.alpha-launch-modal__grid--cta {
  gap: 12px;
}

.alpha-launch-modal__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

.alpha-launch-modal__section[lang='ar'] {
  direction: rtl;
  text-align: right;
}

.alpha-launch-modal__heading {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.alpha-launch-modal__discord {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.alpha-launch-modal__cta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
}

.alpha-launch-modal__cta-heading {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.alpha-launch-modal__discord iframe {
  width: 100%;
  max-width: 100%;
  height: 360px;
  border: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
}

.modal-description {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.74);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.modal-form-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border: none;
  margin: 0;
  padding: 0;
}

.modal-form-options legend {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.modal-form-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.78);
}

.modal-form-option input[type='radio'] {
  accent-color: var(--accent);
}

.modal-form-notes {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.modal-form textarea {
  width: 100%;
  background: rgba(12, 18, 36, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 0.75rem;
  color: #fff;
  font-family: inherit;
  resize: vertical;
  min-height: 108px;
}

.modal-form textarea:focus {
  outline: none;
  border-color: rgba(78, 205, 196, 0.6);
  box-shadow: 0 0 0 1px rgba(78, 205, 196, 0.4);
}

.modal-status {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
}

.modal-content::-webkit-scrollbar {
  width: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay {
    transition: none;
  }

  .modal-window {
    transition: none;
  }
}
.content-transition {
  transition: opacity 0.22s ease, transform 0.22s ease;
}


.settings-panel {
  width: min(640px, 92vw);
  max-height: 92vh;
}

.settings-panel .modal-content {
  gap: 24px;
  padding-top: 16px;
}

.players-panel {
  width: min(460px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rules-panel {
  width: min(540px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.overlay-header h2 {
  margin: 0;
  font-size: 22px;
}

.overlay-note {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.overlay-meta {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.overlay-hint {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.52);
}

.overlay-party-roster {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.overlay-party-roster.party-roster-list {
  gap: 16px;
}

.overlay-party-roster h3 {
  margin: 0;
}

.overlay-party-roster .member-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.overlay-party-roster.party-roster-list .member-list-item {
  background: rgba(255, 255, 255, 0.08);
}

.rules-overlay-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rules-overlay-summary .party-rules-summary {
  margin: 0;
}

.rules-overlay-list .lobby-rule-row {
  background: rgba(255, 255, 255, 0.05);
}

.store-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 75;
  padding: 24px;
}

.store-panel {
  width: min(1080px, 96vw);
}

.store-panel .modal-content {
  gap: 24px;
}

.store-detail-window {
  width: min(420px, 88vw);
  max-height: 92vh;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(160deg, rgba(23, 32, 56, 0.96), rgba(11, 16, 30, 0.94));
}

.store-detail-window.has-selection {
  background: linear-gradient(160deg, hsla(var(--item-hue, 210), 70%, 32%, 0.42), rgba(9, 14, 26, 0.95));
  border-color: hsla(var(--item-hue, 210), 70%, 62%, 0.5);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}

.store-detail-window .modal-content {
  padding: 18px 24px 26px;
  gap: 18px;
}

.store-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 214, 10, 0.18);
  color: #ffe082;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.store-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
}

.store-info-banner,
.store-closed-banner {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.store-info-banner {
  background: rgba(92, 179, 255, 0.12);
  border: 1px solid rgba(92, 179, 255, 0.35);
  color: #d5ebff;
}

.store-closed-banner {
  background: rgba(220, 60, 60, 0.12);
  border: 1px solid rgba(220, 60, 60, 0.45);
  color: #ff9a9a;
}

.store-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-filter-button {
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.store-filter-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.store-filter-button.active {
  background: rgba(78, 205, 196, 0.25);
  color: #4ecdc4;
}

.store-category-description {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
}

.store-utility {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.store-utility-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.store-updated-at {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}

.store-hero {
  --hero-hue: 210;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 20px;
  align-items: stretch;
  padding: 24px;
  border-radius: 26px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, hsla(var(--hero-hue, 210), 80%, 36%, 0.35), rgba(9, 14, 26, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  min-height: 260px;
}

.store-hero::after {
  content: '';
  position: absolute;
  inset: -40% 20% 0;
  background: radial-gradient(circle at top right, hsla(var(--hero-hue, 210), 80%, 55%, 0.4), transparent 60%);
  pointer-events: none;
}

.store-hero-highlight {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.store-hero-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.store-hero-highlight h3 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.08em;
}

.store-hero-tagline {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.store-hero-preview {
  margin-top: 8px;
  align-self: flex-start;
  max-width: 320px;
}

.store-hero-poster {
  position: relative;
  z-index: 1;
  border-radius: 22px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
}

.store-hero-poster.has-image {
  background-image: linear-gradient(180deg, rgba(6, 10, 20, 0.72), rgba(6, 10, 20, 0.82)), var(--poster-image);
  background-size: cover;
  background-position: center;
}

.store-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
}

.store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}

.store-grid-wrapper {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.store-item-card {
  --item-hue: 210;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.store-item-card:hover {
  transform: translateY(-3px);
}

.store-item-card.selected {
  border-color: hsla(var(--item-hue, 210), 80%, 70%, 0.6);
  box-shadow: 0 18px 42px hsla(var(--item-hue, 210), 80%, 60%, 0.32);
}

.store-item-card.owned {
  border-color: rgba(255, 255, 255, 0.2);
}

.store-item-card.equipped {
  border-color: hsla(var(--item-hue, 210), 80%, 60%, 0.55);
  box-shadow: 0 16px 36px hsla(var(--item-hue, 210), 80%, 55%, 0.35);
}
.store-item-card.limited {
  border-color: rgba(255, 82, 82, 0.35);
  box-shadow: 0 16px 36px rgba(255, 82, 82, 0.25);
}


.store-item-card h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.store-card-preview {
  margin: -4px -4px 12px;
  border-radius: 18px;
  overflow: hidden;
}

.store-item-preview {
  position: relative;
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
}

.store-item-preview.preview-loading {
  min-height: 140px;
}

.store-item-preview .preview-loader {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  opacity: 0.8;
  animation: previewPulse 1.4s ease-in-out infinite;
}

.store-item-preview.preview-error .preview-loader {
  color: rgba(255, 142, 142, 0.9);
  opacity: 1;
  animation: none;
}

.store-item-preview.preview-error {
  background: rgba(255, 82, 82, 0.08);
}

.store-item-preview.store-context {
  margin-bottom: 16px;
}

.store-item-preview.inventory-context {
  margin-bottom: 8px;
}

.store-item-preview.preview-nameplate .nameplate {
  pointer-events: none;
  transform: scale(0.9);
  transform-origin: center;
}

.store-item-preview.preview-nameplate .nameplate-handle {
  font-size: 12px;
}

.store-item-preview.preview-card-back {
  padding: 24px 10px;
}

.store-item-preview.preview-card-back .card.back {
  transform: scale(0.9);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.4);
}

@keyframes previewPulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.store-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.store-price {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 214, 10, 0.18);
  color: #ffe082;
  font-weight: 700;
}

.store-tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
}

.store-tag.common {
  background: rgba(156, 161, 178, 0.28);
}

.store-tag.rare {
  background: rgba(82, 137, 255, 0.35);
}

.store-tag.epic {
  background: rgba(186, 104, 200, 0.35);
}

.store-tag.limited {
  background: rgba(255, 82, 82, 0.3);
}

.store-detail,
.inventory-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 360px;
}

.inventory-detail {
  position: sticky;
  top: 0;
}

.inventory-detail.has-selection {
  background: linear-gradient(160deg, hsla(var(--item-hue, 210), 70%, 32%, 0.32), rgba(9, 14, 26, 0.92));
  border-color: hsla(var(--item-hue, 210), 70%, 62%, 0.45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.store-detail {
  background: transparent;
  border: none;
  padding: 0;
}

.store-detail.has-selection {
  background: transparent;
  border: none;
  box-shadow: none;
}

.catalog-detail-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.catalog-detail-header h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.08em;
}

.catalog-detail-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-detail-type {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.catalog-detail-description {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.catalog-detail-preview {
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.catalog-detail-price {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 214, 10, 0.18);
  color: #ffe082;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 16px;
}

.catalog-detail-applies {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.catalog-detail-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.catalog-detail-applies ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.78);
}

.catalog-detail-media {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.catalog-media-item {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
}

.catalog-media-item img,
.catalog-media-item video {
  width: 100%;
  display: block;
  border-radius: 0;
}

.catalog-media-item.video video {
  aspect-ratio: 16 / 9;
}

.catalog-detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.catalog-detail-summary {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.catalog-detail-limited {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 214, 10, 0.12);
  color: #ffe082;
  font-size: 13px;
}

.catalog-detail-countdown {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.store-action {
  border: none;
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  background: rgba(78, 205, 196, 0.4);
  color: #041f1d;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.store-action:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(78, 205, 196, 0.3);
}

.store-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.store-empty {
  padding: 40px;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
}

.store-loading {
  padding: 60px 0;
  text-align: center;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.75);
}

.store-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 10, 18, 0.6);
  border-radius: 28px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.inventory-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 76;
}

.inventory-panel {
  width: min(980px, 96vw);
}

.inventory-panel .modal-content {
  gap: 24px;
}

.inventory-subtitle {
  margin: 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
}

.inventory-utility {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inventory-catalog-status {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}

.inventory-note {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid rgba(78, 205, 196, 0.65);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.inventory-filter-description {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.inventory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}

.inventory-grid-wrapper {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inventory-achievements {
  margin-top: 8px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inventory-achievements h3 {
  margin: 0;
}

.inventory-achievements p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
}

.inventory-achievements-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.inventory-achievements-actions .secondary {
  min-width: 220px;
}

.inventory-achievements-status {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.inventory-item-card {
  --item-hue: 210;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.inventory-item-card:hover {
  transform: translateY(-3px);
}

.inventory-item-card.selected {
  border-color: hsla(var(--item-hue, 210), 80%, 70%, 0.6);
  box-shadow: 0 16px 36px hsla(var(--item-hue, 210), 80%, 60%, 0.28);
}

.inventory-item-card.equipped {
  border-color: hsla(var(--item-hue, 210), 80%, 62%, 0.5);
  box-shadow: 0 18px 40px hsla(var(--item-hue, 210), 80%, 56%, 0.32);
}

.inventory-item-card h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.inventory-card-preview {
  margin: -4px -4px 10px;
  border-radius: 18px;
  overflow: hidden;
}

.inventory-empty {
  padding: 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  text-align: center;
}



@media (max-width: 900px) {
  .store-layout,
  .inventory-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .store-detail,
  .inventory-detail {
    position: static;
  }
}
.profile-overlay,
.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 24px;
}

.profile-panel,
.history-panel {
  width: min(640px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(160deg, rgba(27, 35, 54, 0.98), rgba(10, 15, 26, 0.95));
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(130, 208, 255, 0.7) rgba(12, 16, 28, 0.55);
}

.profile-panel::-webkit-scrollbar,
.history-panel::-webkit-scrollbar {
  width: 10px;
}

.profile-panel::-webkit-scrollbar-track,
.history-panel::-webkit-scrollbar-track {
  background: rgba(12, 16, 28, 0.55);
  border-radius: 999px;
}

.profile-panel::-webkit-scrollbar-thumb,
.history-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(130, 208, 255, 0.85), rgba(88, 120, 255, 0.85));
  border-radius: 999px;
  border: 2px solid rgba(12, 16, 28, 0.6);
}

.profile-panel::-webkit-scrollbar-thumb:hover,
.history-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(152, 218, 255, 0.95), rgba(104, 136, 255, 0.95));
}

.profile-header,
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-header h2,
.history-header h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.06em;
}

.close-profile,
.close-history {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.profile-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.profile-nameplate {
  font-size: 20px;
  min-width: 0;
}

.profile-nameplate .nameplate-handle {
  font-size: 14px;
}

.profile-username {
  color: rgba(255, 255, 255, 0.7);
}

.profile-coins {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 214, 10, 0.2);
  color: #ffe082;
  font-weight: 700;
}

.profile-reputation {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.profile-reputation__level {
  font-size: 16px;
  letter-spacing: 0.05em;
}

.profile-reputation__count {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.profile-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.profile-friend-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-friend-controls__status {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.profile-thumb-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.profile-thumb-actions .secondary {
  border-radius: 14px;
  padding: 8px 14px;
  border: none;
  cursor: pointer;
}

.profile-achievements {
  margin-top: 18px;
}

.profile-achievements h3 {
  margin-bottom: 10px;
}

.profile-stats {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-stats h3 {
  margin: 0;
  font-size: 18px;
}

.profile-stats__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.profile-stats__item {
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 12px;
}

.profile-stats__empty {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.profile-socials {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-socials h3 {
  margin: 0;
  font-size: 18px;
}

.profile-socials__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-socials__link {
  align-self: flex-start;
  border: none;
  border-radius: 14px;
  padding: 8px 14px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.profile-socials__link:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.profile-socials__empty {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.profile-socials__note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.profile-actions .danger {
  background: rgba(239, 83, 80, 0.85);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.profile-actions .secondary {
  padding: 10px 18px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.profile-history h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.history-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.history-details strong {
  font-size: 15px;
  color: #fff;
}

.history-loading,
.history-error,
.history-empty {
  padding: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.75);
}

.history-error {
  color: #ff8a80;
}

.history-meta {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.history-pov-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-pov-row select {
  padding: 6px 10px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.history-timeline {
  display: grid;
  gap: 10px;
}

.history-timeline input[type='range'] {
  width: 100%;
}

.history-counters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-counters button {
  border: none;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.history-action {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
}

.history-board {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.history-discard {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.history-hand {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.history-players {
  display: grid;
  gap: 8px;
}

.history-player-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.history-player-row.winner {
  background: rgba(129, 199, 132, 0.2);
}

.history-player-row.reverse-armed {
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.history-hand h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.history-hand-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.friends-panel {
  width: min(720px, 94vw);
}

.friends-panel .modal-content {
  gap: 20px;
}

.settings-panel-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-layout[data-columns='2'] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 879px) {
  .settings-layout[data-columns='2'] {
    grid-template-columns: 1fr;
  }
}

.settings-section {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 28px;
  border-radius: 24px;
  background: linear-gradient(150deg, rgba(32, 38, 58, 0.92), rgba(16, 20, 34, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(7, 12, 24, 0.42);
  overflow: hidden;
}

.settings-section::before {
  content: '';
  position: absolute;
  inset: -60% 32% 32% -60%;
  background: radial-gradient(circle at center, rgba(86, 112, 255, 0.35), transparent 65%);
  opacity: 0.28;
  transform: rotate(8deg);
  pointer-events: none;
}

.settings-section > * {
  position: relative;
  z-index: 1;
}

.settings-section__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-section__title {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-section__description {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.95rem;
  line-height: 1.5;
}

.settings-section__content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-section__grid {
  display: grid;
  gap: 18px;
}

@media (min-width: 960px) {
  .settings-section__grid[data-columns='2'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label,
.form-field .form-field__label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  background: rgba(10, 14, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  color: #fff;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(122, 197, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(122, 197, 255, 0.35);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}


.tabs-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.tabs-container.is-rtl {
  flex-direction: row-reverse;
}

.tabs {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(16, 20, 32, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(6, 10, 24, 0.36);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-y;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs.is-scrollable {
  cursor: grab;
}

.tabs.is-scrollable.is-dragging {
  cursor: grabbing;
}

.tab-scroll-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 20, 32, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(6, 10, 24, 0.35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.tab-scroll-button:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.tab-scroll-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.tab-scroll-button.is-hidden {
  display: none;
}

body.language--rtl .tab-scroll-button--prev .icon,
body.language--rtl .tab-scroll-button--next .icon {
  transform: scaleX(-1);
}

.tab-button {
  flex: 0 0 auto;
  padding: 10px 22px;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.tab-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.tab-button:focus-visible {
  outline: 2px solid rgba(117, 203, 255, 0.75);
  outline-offset: 2px;
}

.tab-button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(86, 112, 255, 0.92), rgba(117, 203, 255, 0.92));
  box-shadow: 0 18px 32px rgba(28, 64, 148, 0.45);
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: rgba(16, 22, 34, 0.82);
  border-radius: 28px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 64px rgba(6, 10, 24, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.settings-content > * {
  position: relative;
  z-index: 1;
}

.settings-content::before {
  content: '';
  position: absolute;
  inset: -40% 20% 40% -40%;
  background: radial-gradient(circle at top left, rgba(255, 114, 229, 0.24), transparent 60%);
  opacity: 0.4;
  pointer-events: none;
}

.sound-settings {
  display: grid;
  gap: 14px;
}

.sound-slider {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sound-slider span:first-child {
  flex: 1;
  font-weight: 600;
}

.sound-slider input[type='range'] {
  flex: 1;
  accent-color: rgba(86, 112, 255, 0.9);
}

.slider-value {
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.7);
}

.sound-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.sound-actions .notice,
.sound-actions .settings-alert {
  margin: 0;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.settings-toggle input {
  width: 18px;
  height: 18px;
  accent-color: rgba(86, 112, 255, 0.9);
}

.settings-toggle span {
  flex: 1;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-alert {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(86, 112, 255, 0.16);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
}

.settings-alert[data-variant='error'] {
  background: rgba(244, 92, 120, 0.2);
  color: #ffd7e0;
}

.settings-inline-hint {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
}

.avatar-preview {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar-preview__image {
  width: 84px;
  height: 84px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 38px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.avatar-preview__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.avatar-preview__name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.avatar-preview__meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
}

.avatar-upload {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  padding: 18px;
  background: rgba(10, 14, 26, 0.6);
}

.avatar-upload__input {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.avatar-upload__file {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 600;
}

.avatar-upload__file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.avatar-upload__filename {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.avatar-upload__preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.avatar-upload__hint {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.avatar-cropper {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (min-width: 720px) {
  .avatar-cropper {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }
}

.avatar-cropper__stage {
  position: relative;
  width: min(240px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 16, 28, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.avatar-cropper__stage.is-empty {
  background: rgba(12, 16, 28, 0.48);
}

.avatar-cropper__canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}

.avatar-cropper__canvas.is-dragging {
  cursor: grabbing;
}

.avatar-cropper__stage-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(6, 10, 24, 0.72);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.avatar-cropper__controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.avatar-cropper__zoom-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.avatar-cropper__zoom-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-cropper__zoom-control input[type='range'] {
  flex: 1;
}

.avatar-cropper__zoom-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.avatar-cropper__samples {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.avatar-cropper__sample {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.avatar-cropper__sample-figure {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(16, 24, 42, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.avatar-cropper__sample-figure--header {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.avatar-cropper__sample-figure.is-image {
  color: transparent;
}

.avatar-cropper__sample-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.72);
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.settings-card.settings-socials {
  gap: 20px;
}

.settings-socials__form {
  display: grid;
  gap: 18px;
}

@media (min-width: 720px) {
  .settings-socials__form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.settings-socials__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.settings-socials__helper {
  margin: 0;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-socials__field {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.settings-socials__field:focus-within {
  border-color: rgba(117, 203, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(117, 203, 255, 0.35);
}

.settings-socials__field-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-field__label {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.settings-socials__icon {
  font-size: 1.2rem;
}

.settings-socials__input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.settings-socials__field:focus-within .settings-socials__input {
  border-color: rgba(117, 203, 255, 0.55);
  background: rgba(0, 0, 0, 0.45);
}

.settings-socials__prefix {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.55);
}

.settings-field__input {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  padding: 6px 0;
  outline: none;
}

.settings-field__input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.settings-field__hint {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
}

.settings-field--disabled {
  opacity: 0.65;
}

.settings-socials__field.settings-field--disabled {
  background: rgba(255, 255, 255, 0.03);
}

.theme-option-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.theme-option {
  border: none;
  border-radius: 16px;
  padding: 16px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  background-size: cover;
  background-position: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.4);
}

.theme-option.is-active {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.65), 0 16px 32px rgba(0, 0, 0, 0.45);
}

.window-handle {
  cursor: grab;
}

.window-handle:not(.modal-header):not(.overlay-header) {
  width: 100%;
  height: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.window-handle:active {
  cursor: grabbing;
}

.modal-header.window-handle {
  height: auto;
  margin-bottom: 0;
  justify-content: space-between;
}

.window-handle-grip {
  width: 48px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.settings-content {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 16px;
}

.sound-settings {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.sound-slider {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px 16px;
  border-radius: 14px;
}

.sound-slider input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

.slider-value {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

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

.sound-actions .notice {
  margin: 0;
  padding: 10px 14px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.08);
}

.close-settings {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.settings-toggle input {
  width: 18px;
  height: 18px;
}

.party-scope {
  display: grid;
  gap: 8px;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.party-scope p {
  margin: 0;
  font-weight: 600;
}

.party-scope .settings-toggle {
  margin-bottom: 0;
  align-items: center;
}

.party-scope input[type='radio'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.party-settings {
  display: grid;
  gap: 12px;
}

.party-settings label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.party-settings select,
.party-settings input[type='number'] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-dashboard {
  display: grid;
  gap: 12px;
}

.admin-card {
  background: rgba(255, 255, 255, 0.06);
  padding: 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.chat-dock {
  position: fixed;
  bottom: 20px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 60;
}

.chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 24px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  position: relative;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #fff;
  color: #000;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.chat-badge--alert {
  background: #ff4f6b;
  color: #fff;
}

.chat-panel {
  width: 320px;
  height: 360px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}

.chat-messages {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 180, 255, 0.55) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 12px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(120, 180, 255, 0.7), rgba(94, 168, 255, 0.45));
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(142, 196, 255, 0.95), rgba(94, 168, 255, 0.7));
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #fff;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  touch-action: pan-y;
}

.chat-author {
  flex-shrink: 0;
}

.chat-message__line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.chat-message__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.chat-separator {
  font-weight: 700;
  opacity: 0.65;
}

.chat-content {
  flex: 1;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-message__toggle {
  background: none;
  border: none;
  color: #5ea8ff;
  font-size: 12px;
  align-self: flex-start;
  cursor: pointer;
}

.chat-message__menu {
  opacity: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  transition: opacity 0.15s ease;
}

.chat-message:hover .chat-message__menu,
.chat-message:focus-within .chat-message__menu {
  opacity: 1;
}

.chat-message__menu-panel {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  background: rgba(12, 13, 27, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  z-index: 5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.chat-message__menu-item {
  background: transparent;
  border: none;
  color: #fff;
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
}

.chat-message__menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.chat-message__quote {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.chat-message__quote:hover {
  background: rgba(255, 255, 255, 0.12);
}

.chat-message--reply-source {
  background: rgba(94, 168, 255, 0.18);
}

.chat-message--highlight {
  box-shadow: 0 0 0 2px rgba(94, 168, 255, 0.6);
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 16px;
}

.chat-form__controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chat-form textarea {
  flex: 1;
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(28, 30, 42, 0.82);
  color: #fff;
  resize: none;
  line-height: 1.45;
  min-height: 44px;
  max-height: 160px;
  overflow-y: hidden;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.chat-form textarea.chat-form__textarea--overflow {
  overflow-y: auto;
}

.chat-form textarea:focus {
  border-color: rgba(94, 168, 255, 0.85);
  background: rgba(28, 30, 42, 0.92);
  outline: none;
  box-shadow: 0 0 0 2px rgba(94, 168, 255, 0.35);
}

.chat-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.chat-form__send {
  border: none;
  border-radius: 14px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease;
}

.chat-form__send:active {
  transform: scale(0.97);
}

.chat-form__send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (hover: hover) {
  .chat-form__send:hover:not(:disabled) {
    background: var(--accent-strong);
  }
}

.chat-form__reply {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 10px;
  flex-wrap: wrap;
}

.chat-form__reply-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.chat-form__reply-preview {
  border: none;
  background: transparent;
  color: #5ea8ff;
  font-size: 12px;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.chat-form__reply-remove {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  cursor: pointer;
}

.chat-form__reply-remove:hover {
  color: #fff;
}

.color-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
}

.color-picker {
  background: rgba(28, 30, 42, 0.95);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  min-width: 280px;
}

.color-options {
  display: flex;
  gap: 12px;
}

.color-choice {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.color-choice.red {
  background: linear-gradient(135deg, #ff4e50, #f9d423);
}

.color-choice.yellow {
  background: linear-gradient(135deg, #fceabb, #f8b500);
}

.color-choice.green {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}

.color-choice.blue {
  background: linear-gradient(135deg, #24c6dc, #514a9d);
}

.close-picker {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 18px;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
}

.client-settings {
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
  border-radius: 16px;
}

.client-settings-options {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.settings-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.settings-radio input {
  margin: 0;
  accent-color: var(--accent);
}

.xo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.xo-status {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.xo-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 12px;
  width: min(100%, 360px);
}

.xo-cell {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 700;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.xo-cell.available {
  cursor: pointer;
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.xo-cell.available:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.3);
}

.xo-cell.filled {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
}

.xo-cell:disabled {
  cursor: default;
}

.xo-player-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 360px);
}

.xo-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  gap: 12px;
}

.xo-player-row.you {
  background: rgba(102, 187, 255, 0.2);
}

.xo-player-row.active {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.xo-player-name {
  font-weight: 600;
}

.xo-player-score {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.xo-spectator-note {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.75;
}

@media (max-width: 1024px) {
  .app-shell {
    padding: 0 12px 24px;
  }

  .app-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .header-actions {
    justify-content: center;
  }

  .game-table {
    min-height: 480px;
  }
}

@media (max-width: 768px) {
  .join-form,
  .add-friend-form .form-row,
  .party-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .share-popover {
    right: 12px;
    left: 12px;
    top: auto;
    bottom: -160px;
  }
}
