:root {
  --bg-base: #070912;
  --bg-elevated: rgba(17, 22, 38, 0.78);
  --bg-card: rgba(20, 26, 46, 0.85);
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-glow: rgba(124, 58, 237, 0.5);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #7c3aed;
  --accent-primary-hover: #6d28d9;
  --accent-cyan: #22d3ee;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: clamp(13.5px, 0.38vw + 0.68vh, 21px);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient animated background orbs */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.25;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 520px;
  height: 520px;
  background: #7c3aed;
  top: -160px;
  left: -120px;
}

.orb-2 {
  width: 460px;
  height: 460px;
  background: #06b6d4;
  bottom: -160px;
  right: -100px;
  animation-delay: -6s;
}

.orb-3 {
  width: 360px;
  height: 360px;
  background: #f43f5e;
  top: 40%;
  left: 55%;
  opacity: 0.14;
  animation-delay: -11s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.1); }
}

/* Layout */
.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 96vw;
  margin: 0 auto;
  padding: clamp(10px, 1.3vh, 24px) clamp(14px, 1.6vw, 34px) clamp(14px, 1.8vh, 36px);
}

#view-home,
#view-lobby,
#view-gameover {
  max-width: clamp(960px, 78vw, 1680px);
  margin: 0 auto;
}

.glass-card {
  background: var(--bg-elevated);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hidden {
  display: none !important;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(10px, 1.4vh, 24px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #22d3ee);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.5);
}

.brand-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.connection-pill.connected .status-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.connection-pill.disconnected .status-dot {
  background: var(--accent-rose);
  box-shadow: 0 0 10px var(--accent-rose);
}

/* Views */
.view {
  display: none;
  animation: fadeUp 0.35s ease;
}

.view.active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form Elements & Buttons */
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

input[type="text"],
input[type="number"],
.theme-select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(9, 13, 25, 0.85);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
.theme-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-lg {
  padding: 15px 26px;
  font-size: 1.02rem;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.full-width {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 14px 32px rgba(124, 58, 237, 0.55);
}

.btn-accent {
  background: linear-gradient(135deg, #0891b2, #2563eb);
  box-shadow: 0 10px 26px rgba(8, 145, 178, 0.35);
}

.btn-accent:hover:not(:disabled) {
  box-shadow: 0 14px 32px rgba(34, 211, 238, 0.45);
}

.btn-danger {
  background: linear-gradient(135deg, #e11d48, #9f1239);
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.3);
}

.btn-ready {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.32);
}

.btn-ready.is-ready {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.65);
  color: #6ee7b7;
  box-shadow: none;
}

.ready-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: auto;
}

.ready-badge.ready {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.ready-badge.not-ready {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.ready-badge.offline {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.45);
}

.lobby-settings-panel {
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(9, 13, 25, 0.88);
  border: 1px solid rgba(34, 211, 238, 0.32);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lobby-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lobby-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  align-items: end;
}

.lobby-settings-toggles {
  grid-column: 1 / -1;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.lobby-settings-footer {
  display: flex;
  justify-content: flex-end;
}

.btn-ghost {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
  color: var(--text-primary);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.22);
}

/* ========================================================
   HOME VIEW
======================================================== */
.username-banner {
  padding: 20px 24px;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.username-field-wrap {
  flex: 1;
  min-width: 260px;
}

.username-hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 360px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 22px;
  align-items: stretch;
}

.panel-card {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-header h2 {
  margin: 8px 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.45rem;
}

.panel-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.panel-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: rgba(124, 58, 237, 0.22);
  color: #c4b5fd;
  border: 1px solid rgba(124, 58, 237, 0.4);
}

.badge-secondary {
  background: rgba(34, 211, 238, 0.16);
  color: #67e8f9;
  border-color: rgba(34, 211, 238, 0.35);
}

.theme-picker-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.theme-card {
  position: relative;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(11, 15, 29, 0.78);
  text-align: left;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.theme-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.35);
}

.theme-card.selected {
  border-color: var(--theme-color, #7c3aed);
  box-shadow: 0 0 0 1px var(--theme-color, #7c3aed), 0 8px 24px rgba(0, 0, 0, 0.45);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(11, 15, 29, 0.92));
}

.theme-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.theme-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--theme-color, #7c3aed);
  box-shadow: 0 0 10px var(--theme-color, #7c3aed);
}

.theme-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.theme-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.theme-card.is-mixed {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(6, 182, 212, 0.14));
}

/* Toggle Switch */
.mixed-option {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.toggle-label input {
  display: none;
}

.toggle-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.toggle-label input:checked + .toggle-track {
  background: var(--accent-primary);
}

.toggle-label input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

/* Join Card & Active Lobbies */
.join-card {
  justify-content: space-between;
}

.active-lobbies-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.active-lobbies-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lobbies-count-pill {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  text-align: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(34, 211, 238, 0.16);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.active-lobbies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.lobbies-empty {
  padding: 26px 16px;
  border-radius: var(--radius-md);
  background: rgba(11, 15, 29, 0.65);
  border: 1px dashed rgba(148, 163, 184, 0.24);
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}

.lobby-list-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(11, 15, 29, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.lobby-list-item:hover {
  border-color: rgba(34, 211, 238, 0.55);
  transform: translateY(-1px);
}

.lobby-item-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.lobby-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lobby-item-host {
  font-weight: 700;
  font-size: 0.96rem;
}

.lobby-item-code {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.14);
  color: var(--accent-cyan);
}

.lobby-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.lobby-item-theme {
  font-weight: 600;
  color: #ddd6fe;
}

.join-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.join-divider::before,
.join-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.join-code-inline {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.code-input {
  text-align: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem !important;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  padding: 18px !important;
}

.code-input-compact {
  font-size: 1.3rem !important;
  letter-spacing: 0.26em;
  padding: 12px 14px !important;
}

.universe-switcher .mode-btn.active[data-universe="lol"] {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(20, 184, 166, 0.14));
  box-shadow: 0 0 0 1px #f59e0b;
}

.universe-switcher .mode-btn.active[data-universe="genshin"] {
  border-color: #38bdf8;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(168, 85, 247, 0.18));
  box-shadow: 0 0 0 1px #38bdf8;
}

.universe-pill {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.22);
  color: #ddd6fe;
}

.universe-pill.lol {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

.universe-pill.genshin {
  background: rgba(56, 189, 248, 0.2);
  color: #bae6fd;
}

.mode-switcher {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mode-switcher-3 {
  grid-template-columns: repeat(3, 1fr);
}

.mode-switcher-4 {
  grid-template-columns: repeat(4, 1fr);
}

.emoji-hint-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.emoji-hint-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  font-size: 2.2rem;
  line-height: 1;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.28), rgba(34, 211, 238, 0.16));
  border: 1px solid rgba(34, 211, 238, 0.45);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.category-hint-badge {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(34, 211, 238, 0.25));
  border: 1px solid rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.22);
}

.mode-btn {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(11, 15, 29, 0.78);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mode-btn strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.94rem;
}

.mode-btn span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.mode-btn.active {
  border-color: var(--accent-cyan);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(124, 58, 237, 0.14));
  box-shadow: 0 0 0 1px var(--accent-cyan);
}

.editable-rule-card.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.editable-rules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.lobby-rules-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

/* Hide native browser number spin arrows everywhere */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.editable-rule-card {
  padding: 12px 12px 10px;
  border-radius: var(--radius-md);
  background: rgba(11, 15, 29, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.editable-rule-card:hover {
  border-color: rgba(34, 211, 238, 0.45);
}

.editable-rule-card:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

.number-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.72);
  color: var(--text-primary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.stepper-btn:hover:not(:disabled) {
  background: rgba(34, 211, 238, 0.18);
  border-color: rgba(34, 211, 238, 0.65);
  color: #67e8f9;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.22);
}

.stepper-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.stepper-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.rule-number-input {
  width: 68px !important;
  min-width: 0;
  flex: 0 1 auto;
  padding: 2px 4px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem !important;
  font-weight: 700;
  color: var(--accent-cyan) !important;
}

.rule-card-label {
  font-size: 0.76rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Compact stepper for Host In-Lobby Settings */
.number-stepper-compact {
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  justify-content: space-between;
  gap: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.number-stepper-compact:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.stepper-btn-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 1.05rem;
}

.stepper-compact-input {
  flex: 1;
  min-width: 0;
  width: auto !important;
  padding: 4px 2px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem !important;
  font-weight: 700;
  color: var(--accent-cyan) !important;
}

.join-info-note {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(11, 15, 29, 0.65);
  border: 1px dashed rgba(148, 163, 184, 0.24);
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

.mini-rule {
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  background: rgba(11, 15, 29, 0.7);
  border: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.mini-rule span {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 2px;
}

/* ========================================================
   LOBBY WAITING ROOM
======================================================== */
.lobby-card {
  max-width: 820px;
  margin: 16px auto 0;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.lobby-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.eyebrow {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.mega-theme-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.45), rgba(34, 211, 238, 0.35));
  border: 1px solid rgba(167, 139, 250, 0.55);
  box-shadow: 0 0 28px rgba(124, 58, 237, 0.32);
}

.lobby-mixed-meta {
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.room-code-box {
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: rgba(9, 13, 25, 0.85);
  border: 1px solid rgba(34, 211, 238, 0.28);
  text-align: center;
}

.room-code-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.room-code-display {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent-cyan);
}

.copy-sub {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lobby-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.lobby-player-slot {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(11, 15, 29, 0.75);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
}

.lobby-slot-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-slot-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lobby-slot-top .ready-badge {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.lobby-player-slot.waiting {
  border-style: dashed;
  color: var(--text-muted);
  align-items: center;
  text-align: center;
  justify-content: center;
  animation: pulseSoft 2s infinite;
}

@keyframes pulseSoft {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.player-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  flex-shrink: 0;
}

.player-slot-name {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-you-tag {
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.player-slot-role {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lobby-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lobby-status-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ========================================================
   AUCTION VIEW
======================================================== */
.auction-topbar {
  padding: clamp(8px, 1vh, 14px) clamp(14px, 1.4vw, 24px);
  margin-bottom: clamp(10px, 1.4vh, 20px);
}

.topbar-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.auction-workspace {
  display: grid;
  grid-template-columns: clamp(300px, 21vw, 460px) minmax(0, 1fr) clamp(300px, 21vw, 460px);
  gap: clamp(14px, 1.5vw, 30px);
  align-items: start;
}

.auction-sidebar {
  padding: clamp(12px, 1.2vh, 18px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vh, 14px);
  max-height: calc(100vh - clamp(120px, 16vh, 190px));
  overflow-y: auto;
}

.auction-sidebar-right.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.sidebar-title {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.players-hud-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topbar-meta-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.turn-indicator-pill {
  padding: 6px 16px;
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-secondary);
}

.turn-indicator-pill.my-turn {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.6);
  color: #6ee7b7;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.28);
}

.players-hud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.player-hud-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(9, 13, 25, 0.72);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.player-hud-card.is-self {
  border-color: rgba(124, 58, 237, 0.5);
}

.player-hud-card.is-turn {
  border-color: rgba(16, 185, 129, 0.78);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.22);
}

.player-hud-card.is-highest {
  border-color: rgba(245, 158, 11, 0.75);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.18);
}

.hud-tag.turn {
  background: rgba(16, 185, 129, 0.24);
  color: #6ee7b7;
}

.hud-tag.highest {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}

.hud-power {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #ddd6fe;
  font-weight: 700;
  font-size: 0.82rem;
}

.player-hud {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-hud-right {
  align-items: flex-end;
  text-align: right;
}

.hud-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.player-hud-right .hud-head {
  justify-content: flex-end;
}

.hud-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
}

.hud-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.25);
  color: #c4b5fd;
}

.hud-tag.passed {
  background: rgba(244, 63, 94, 0.22);
  color: #fda4af;
}

.hud-tag.full {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}

.hud-budget {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
  font-weight: 700;
  font-size: 0.88rem;
}

.hud-slots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.roster-slot {
  width: clamp(46px, 3.1vw, 72px);
  height: clamp(60px, 4.1vw, 94px);
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  background: rgba(9, 13, 25, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.roster-slot.filled {
  border-style: solid;
  border-color: rgba(124, 58, 237, 0.6);
  background: #0f172a;
}

.roster-slot.pop-in {
  animation: slotPop 0.55s cubic-bezier(0.22, 1.35, 0.36, 1);
}

@keyframes slotPop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

.roster-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.roster-slot-badges {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 3px 2px;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.94) 65%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.05;
}

.roster-slot-gold {
  color: #fbbf24;
  font-size: 0.62rem;
  font-weight: 700;
}

.roster-slot-power {
  color: #e2e8f0;
  font-size: 0.66rem;
  font-weight: 700;
}

.roster-slot-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.topbar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.topbar-theme-badge {
  padding: 6px 14px;
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(34, 211, 238, 0.25));
  border: 1px solid rgba(167, 139, 250, 0.45);
}

.round-pill {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.round-pill strong {
  color: var(--text-primary);
  margin-left: 4px;
}

/* Center Stage & 3D Flip Card */
.auction-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.5vh, 22px);
}

.card-scene {
  width: 100%;
  max-width: clamp(540px, 42vw, 920px);
  height: clamp(235px, 37vh, 500px);
  perspective: 1400px;
}

.flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.flip-card.is-flipped {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  padding: clamp(14px, 2vh, 28px) clamp(18px, 2vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.flip-front {
  border-color: rgba(124, 58, 237, 0.35);
  background: radial-gradient(circle at 50% 25%, rgba(124, 58, 237, 0.2), rgba(13, 18, 34, 0.94));
}

.flip-back {
  transform: rotateY(180deg);
  border-color: rgba(34, 211, 238, 0.5);
  background: radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.16), rgba(13, 18, 34, 0.96));
}

.mystery-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mystery-tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #c4b5fd;
}

.anime-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(34, 211, 238, 0.16);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.38);
}

.blind-card-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 12px;
}

.open-card-content {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  margin-top: 10px;
}

.open-art-wrap {
  height: clamp(150px, 25vh, 330px);
  aspect-ratio: 5 / 7;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(124, 58, 237, 0.55);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  background: #090d19;
}

.open-art-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.open-char-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.open-char-name {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  line-height: 1.15;
}

.open-char-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.silhouette-wrap {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(70px, 11.5vh, 150px);
}

.silhouette-glow {
  position: absolute;
  width: clamp(76px, 12vh, 155px);
  height: clamp(76px, 12vh, 155px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.45), transparent 70%);
  animation: glowPulse 2.8s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.12); opacity: 1; }
}

.silhouette-figure {
  position: relative;
  width: clamp(64px, 10vh, 124px);
  height: clamp(72px, 11.2vh, 140px);
  display: grid;
  place-items: center;
  color: #c4b5fd;
}

.silhouette-svg {
  width: 100%;
  height: 100%;
}

.silhouette-q {
  position: absolute;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4.2vh, 3.6rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 24px rgba(124, 58, 237, 0.9);
}

.hint-box {
  padding: clamp(10px, 1.4vh, 18px) clamp(14px, 1.6vw, 22px);
  border-radius: var(--radius-md);
  background: rgba(7, 10, 20, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  text-align: center;
}

.hint-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent-amber);
  margin-bottom: 6px;
}

.hint-text {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.45;
  font-weight: 600;
  color: #fff;
}

.hint-list {
  margin: 0;
  padding-left: 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.94rem;
  line-height: 1.38;
  font-weight: 500;
  color: #f8fafc;
}

/* Reveal Back Face */
.reveal-banner {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent-cyan);
}

.reveal-body {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  margin-top: 10px;
}

.reveal-art-wrap {
  height: clamp(145px, 24vh, 320px);
  aspect-ratio: 5 / 7;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(34, 211, 238, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  background: #090d19;
}

.reveal-art-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.reveal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reveal-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reveal-anime-pill {
  align-self: flex-start;
  font-size: 0.85rem;
}

.power-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.reveal-char-name {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.85rem;
  line-height: 1.15;
}

.reveal-outcome {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
  font-weight: 600;
  font-size: 0.96rem;
}

.reveal-outcome.unsold {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text-secondary);
}

.reveal-timer-bar {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.reveal-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22d3ee, #7c3aed);
  transform-origin: left center;
}

.reveal-timer-fill.draining {
  animation: drainBar 3s linear forwards;
}

@keyframes drainBar {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Bid Panel */
.bid-panel {
  width: 100%;
  max-width: clamp(600px, 46vw, 980px);
  padding: clamp(12px, 1.5vh, 22px) clamp(16px, 1.6vw, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vh, 16px);
}

.bid-status-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: clamp(10px, 1vw, 18px);
  align-items: center;
}

.bid-metric {
  padding: clamp(8px, 1vh, 14px) clamp(10px, 1vw, 16px);
  border-radius: var(--radius-md);
  background: rgba(9, 13, 25, 0.72);
  border: 1px solid var(--border-subtle);
}

.metric-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.bid-amount {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.bid-amount.bump {
  animation: bidBump 0.35s ease;
}

@keyframes bidBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.25); color: #fff; }
  100% { transform: scale(1); }
}

.bid-unit {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.bidder-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.countdown-readout {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
}

.countdown-readout.urgent {
  color: var(--accent-rose);
}

.countdown-track {
  margin-top: 6px;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.countdown-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22d3ee, #7c3aed);
  transition: width 0.12s linear;
}

.countdown-fill.urgent {
  background: linear-gradient(90deg, #f43f5e, #fb923c);
}

.bid-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-bids {
  display: flex;
  gap: 8px;
}

.btn-quick {
  min-width: 58px;
  padding: 12px 14px;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(124, 58, 237, 0.48);
  color: #e9d5ff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.btn-quick:hover:not(:disabled) {
  background: rgba(124, 58, 237, 0.4);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.4);
}

.custom-bid-form {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 210px;
}

.custom-bid-form input {
  padding: 10px 14px;
  font-size: 0.95rem;
}

.bid-helper-text {
  min-height: 18px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  text-align: center;
}

/* ========================================================
   GAME OVER VIEW
======================================================== */
.gameover-header {
  padding: 24px 28px;
  text-align: center;
  margin-bottom: 22px;
}

.gameover-header h2 {
  margin: 4px 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.9rem;
}

.gameover-sub {
  margin: 0;
  color: var(--text-secondary);
}

.gameover-scoreboard {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.score-chip {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: rgba(9, 13, 25, 0.85);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.score-chip.is-winner {
  border-color: rgba(245, 158, 11, 0.7);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(9, 13, 25, 0.9));
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.2);
}

.score-chip-points {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fde68a;
}

.col-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.power-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.45);
  font-size: 0.86rem;
  color: #ede9fe;
}

.power-chip strong {
  color: #fde68a;
}

.final-char-stats {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  font-size: 0.78rem;
}

.final-char-paid {
  margin-top: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.final-char-power {
  font-weight: 700;
  color: #ddd6fe;
}

/* Centered Turn Notification Overlay */
.turn-banner-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.turn-banner-card {
  padding: 22px 44px;
  border-radius: 22px;
  background: rgba(8, 16, 30, 0.92);
  border: 2px solid rgba(16, 185, 129, 0.8);
  box-shadow: 0 0 50px rgba(16, 185, 129, 0.45), 0 24px 60px rgba(0, 0, 0, 0.7);
  text-align: center;
  animation: turnBannerPop 1.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.turn-banner-eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #6ee7b7;
  margin-bottom: 4px;
}

.turn-banner-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.35rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 24px rgba(16, 185, 129, 0.8);
}

.turn-banner-sub {
  margin-top: 4px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

@keyframes turnBannerPop {
  0% { opacity: 0; transform: scale(0.75) translateY(12px); }
  14% { opacity: 1; transform: scale(1.04) translateY(0); }
  22% { opacity: 1; transform: scale(1) translateY(0); }
  80% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0.96) translateY(-10px); }
}

.replay-guest-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.gameover-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 22px;
}

.roster-column {
  padding: 22px;
}

.roster-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.roster-col-header h3 {
  margin: 4px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
}

.col-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #c4b5fd;
}

.col-tag-opp {
  color: #67e8f9;
}

.budget-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.budget-chip strong {
  color: var(--accent-amber);
}

.final-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.final-char-card {
  border-radius: var(--radius-md);
  background: rgba(9, 13, 25, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.final-char-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 58, 237, 0.6);
}

.final-char-card img {
  width: 100%;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.final-char-meta {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.final-char-name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
}

.final-char-anime {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.final-char-paid {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.replay-bar {
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.replay-host-controls {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  width: 100%;
}

.replay-select-wrap {
  min-width: 240px;
}

/* Toasts */
.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.25s ease;
}

.toast.error {
  border-color: rgba(244, 63, 94, 0.6);
  background: rgba(45, 10, 22, 0.95);
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(8, 36, 28, 0.95);
}

/* Responsive */
@media (max-width: 1240px) {
  .auction-workspace {
    grid-template-columns: 340px 1fr;
  }

  .auction-sidebar-right.is-empty {
    display: none;
  }

  .auction-sidebar-right:not(.is-empty) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .home-grid,
  .gameover-columns,
  .auction-workspace {
    grid-template-columns: 1fr;
  }

  .auction-sidebar {
    max-height: none;
  }

  .auction-topbar {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .player-hud-right {
    align-items: flex-start;
    text-align: left;
  }

  .player-hud-right .hud-head {
    justify-content: flex-start;
  }

  .bid-status-row {
    grid-template-columns: 1fr;
  }

  .card-scene {
    height: 410px;
  }

  .reveal-body {
    flex-direction: column;
    text-align: center;
  }

  .reveal-art-wrap {
    width: 130px;
    height: 170px;
  }

  .reveal-anime-pill {
    align-self: center;
  }
}

/* ========================================================
   HEADER ACTIONS & HOW TO PLAY MODAL
======================================================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-how-to-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.36);
  color: #a5f3fc;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.btn-how-to-play:hover {
  background: rgba(34, 211, 238, 0.22);
  border-color: rgba(34, 211, 238, 0.72);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.24);
  transform: translateY(-1px);
}

.how-to-play-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.22);
  border: 1px solid rgba(34, 211, 238, 0.55);
  color: #67e8f9;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(5, 8, 20, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.18s ease;
}

.modal-overlay.hidden {
  display: none !important;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  padding: 24px 26px;
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(34, 211, 238, 0.18);
  animation: slideUpModal 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.modal-header h2 {
  margin: 6px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.45rem;
}

.modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
}

.how-to-play-body {
  overflow-y: auto;
  padding: 16px 2px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(11, 15, 29, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.guide-step-num {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(34, 211, 238, 0.3));
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: #e0f2fe;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.guide-step h3 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  color: #f8fafc;
}

.guide-step p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.guide-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.87rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.guide-list code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(34, 211, 238, 0.14);
  color: #67e8f9;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
}

.modal-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  justify-content: flex-end;
}

/* ========================================================
   MINIMALIST COMPACT HOME SCREEN (Fits 1080p cleanly)
======================================================== */
.app-shell {
  padding-top: clamp(12px, 1.8vh, 24px);
  padding-bottom: clamp(14px, 2vh, 26px);
}

.app-header {
  margin-bottom: clamp(12px, 1.6vh, 20px);
}

#view-home .username-banner {
  padding: 14px 20px;
  margin-bottom: 16px;
  align-items: center;
  gap: 16px;
}

#view-home .username-field-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
}

#view-home .username-field-wrap .field-label {
  margin-bottom: 0;
  white-space: nowrap;
  font-size: 0.82rem;
}

#view-home .username-field-wrap input {
  padding: 10px 14px;
  font-size: 1rem;
}

#view-home .username-hint {
  margin: 0;
  font-size: 0.88rem;
  max-width: none;
  color: var(--text-secondary);
}

#view-home .home-grid {
  grid-template-columns: 1.52fr 0.88fr;
  gap: 18px;
  align-items: stretch;
}

#view-home .panel-card {
  padding: 20px 22px;
  gap: 14px;
}

.panel-header-compact {
  margin: 0;
}

.panel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title-row h2 {
  margin: 0;
  font-size: 1.32rem;
}

#view-home .theme-picker-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

#view-home .mode-switcher {
  gap: 10px;
}

#view-home .mode-btn {
  padding: 11px 14px;
  gap: 4px;
  border-radius: var(--radius-sm);
}

#view-home .mode-btn strong {
  font-size: 0.96rem;
}

#view-home .mode-btn span {
  font-size: 0.8rem;
}

#view-home .theme-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  max-height: 255px;
  overflow-y: auto;
  padding-right: 2px;
}

#view-home .theme-card {
  padding: 10px 12px;
  gap: 4px;
  border-radius: var(--radius-sm);
}

#view-home .theme-name {
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#view-home .theme-count {
  font-size: 0.78rem;
}

#view-home .theme-dot {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
}

#view-home .theme-card.is-mixed {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}

#view-home .theme-card.is-mixed .theme-card-top {
  gap: 8px;
}

#view-home .editable-rules-grid {
  gap: 10px;
}

#view-home .editable-rule-card {
  padding: 11px 10px 9px;
  gap: 5px;
  border-radius: var(--radius-sm);
}

#view-home .number-stepper {
  gap: 8px;
}

#view-home .stepper-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 1.12rem;
}

#view-home .rule-number-input {
  width: 58px !important;
  font-size: 1.42rem !important;
  padding: 2px 4px !important;
}

#view-home .rule-card-label {
  font-size: 0.82rem;
}

.home-toggles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-toggles-row .mixed-option {
  flex: 1 1 190px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.home-toggles-row .toggle-label {
  gap: 10px;
  font-size: 0.88rem;
}

.home-toggles-row .toggle-track {
  width: 40px;
  height: 22px;
}

.home-toggles-row .toggle-thumb {
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
}

.home-toggles-row .toggle-label input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

#view-home .btn-lg {
  padding: 13px 20px;
  font-size: 1.02rem;
}

#view-home .active-lobbies-list {
  max-height: 340px;
}

#view-home .lobbies-empty {
  padding: 24px 16px;
  font-size: 0.9rem;
}

#view-home .code-input-compact {
  font-size: 1.3rem !important;
  padding: 11px 14px !important;
}

@media (max-width: 960px) {
  #view-home .home-grid {
    grid-template-columns: 1fr;
  }

  #view-home .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }
}

.chaos-option {
  border-color: rgba(244, 63, 94, 0.28);
}

.chaos-option .toggle-label input:checked + .toggle-track {
  background: linear-gradient(135deg, #f97316, #ef4444);
}

.toggle-disabled {
  opacity: 0.42;
  pointer-events: none;
}

.turn-indicator-pill.chaos-pill {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.24), rgba(239, 68, 68, 0.28));
  border-color: rgba(249, 115, 22, 0.65);
  color: #fed7aa;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.28);
}

/* ========================================================
   ADMIN CHARACTER CATALOG MODAL
======================================================== */
.catalog-modal-card {
  max-width: min(1240px, 95vw);
  height: min(88vh, 840px);
  max-height: 90vh;
  padding: 18px 20px;
  gap: 12px;
  overflow: hidden;
}

.catalog-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.catalog-title-group h2 {
  margin: 0;
  font-size: 1.3rem;
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.catalog-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.catalog-tab {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.78);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.catalog-tab:hover {
  border-color: rgba(34, 211, 238, 0.55);
  color: var(--text-primary);
}

.catalog-tab.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(124, 58, 237, 0.22));
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.catalog-tab span {
  opacity: 0.75;
  font-size: 0.78rem;
  margin-left: 4px;
}

.catalog-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.catalog-select {
  width: auto !important;
  min-width: 150px;
  padding: 8px 12px !important;
  font-size: 0.84rem !important;
}

.catalog-search-input {
  width: 210px !important;
  padding: 8px 12px !important;
  font-size: 0.86rem !important;
}

.catalog-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  grid-auto-rows: max-content;
  gap: 10px;
  padding-right: 6px;
  align-content: start;
}

.catalog-card {
  border-radius: var(--radius-sm);
  background: rgba(11, 15, 29, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 196px;
  transition: transform 0.15s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.catalog-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.catalog-img-wrap {
  position: relative;
  width: 100%;
  height: 145px;
  flex: 0 0 145px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
}

.catalog-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.catalog-score-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.86);
  border: 1px solid rgba(251, 191, 36, 0.65);
  color: #fde68a;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.catalog-card-body {
  padding: 7px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.catalog-char-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.catalog-region {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-category {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.22);
  color: #ddd6fe;
  flex-shrink: 0;
}

/* Custom Brand Logo Image (Transparent PNG only, no background/glow) */
.brand-mark-logo {
  width: 58px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ========================================================
   PLAYER AVATARS & AVATAR MODAL
======================================================== */
.home-avatar-btn {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 2px solid rgba(34, 211, 238, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: #67e8f9;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.home-avatar-btn:hover {
  transform: scale(1.06);
  border-color: #22d3ee;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.35);
}

.home-avatar-btn img,
.player-avatar img,
.hud-avatar img,
.avatar-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-avatar {
  overflow: hidden;
  border-radius: 12px;
}

.hud-avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: rgba(15, 23, 42, 0.9);
  color: #a5f3fc;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-modal-card {
  max-width: 430px;
}

.avatar-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  text-align: center;
}

.avatar-preview-circle {
  width: 112px;
  height: 112px;
  border-radius: 22px;
  border: 3px solid rgba(34, 211, 238, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #67e8f9;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 26px rgba(34, 211, 238, 0.2);
}

.avatar-format-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.avatar-actions-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.avatar-gif-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
  font-size: 0.82rem;
  font-weight: 700;
}

.avatar-mac-row {
  width: 100%;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  text-align: left;
}

.avatar-mac-inline {
  display: flex;
  gap: 8px;
}

.avatar-mac-inline input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.86rem;
}

/* ========================================================
   MOBILE-FIRST POLISHED RESPONSIVE LAYOUT (<= 768px)
======================================================== */
@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-shell {
    padding: 10px 10px 26px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  .brand-mark-logo {
    width: 42px;
    height: 32px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    line-height: 1.15;
  }

  .brand-sub {
    display: none;
  }

  .header-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  .btn-how-to-play {
    padding: 6px 10px;
    font-size: 0.74rem;
    gap: 5px;
  }

  .how-to-play-icon {
    width: 16px;
    height: 16px;
    font-size: 0.68rem;
  }

  .connection-pill {
    padding: 6px 10px;
    font-size: 0.74rem;
    gap: 6px;
  }

  /* Prevent any card from blowing out viewport width */
  .glass-card,
  .panel-card,
  .home-grid,
  .home-grid > * {
    min-width: 0;
    max-width: 100%;
  }

  /* Username banner */
  #view-home .username-banner {
    padding: 10px 12px;
    margin-bottom: 10px;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .home-avatar-btn {
    width: 42px;
    height: 42px;
  }

  #view-home .username-field-wrap {
    min-width: 0;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  #view-home .username-field-wrap .field-label {
    font-size: 0.68rem;
  }

  #view-home .username-field-wrap input {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.92rem;
  }

  #view-home .username-hint {
    display: none;
  }

  /* Home cards */
  #view-home .home-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #view-home .panel-card {
    padding: 14px 12px;
    gap: 10px;
  }

  .panel-title-row h2 {
    font-size: 1.1rem;
  }

  /* Universe & Mode switchers: clean full-width rows on phone */
  #view-home .mode-switcher,
  #view-home .mode-switcher-3,
  #view-home .mode-switcher-4 {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #view-home .mode-btn {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    gap: 8px;
  }

  #view-home .mode-btn strong {
    font-size: 0.88rem;
  }

  #view-home .mode-btn span {
    font-size: 0.72rem;
    text-align: right;
  }

  /* Theme grid: 2 clean columns, zero overflow */
  #view-home .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: 230px;
  }

  #view-home .theme-card {
    padding: 8px 9px;
    min-width: 0;
  }

  #view-home .theme-name {
    font-size: 0.82rem;
  }

  #view-home .theme-count {
    font-size: 0.68rem;
  }

  /* Editable rules: 2x2 grid so 4 steppers fit comfortably */
  #view-home .editable-rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #view-home .editable-rule-card {
    padding: 9px 6px 7px;
    min-width: 0;
  }

  #view-home .stepper-btn {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  #view-home .rule-number-input {
    width: 46px !important;
    font-size: 1.2rem !important;
  }

  #view-home .rule-card-label {
    font-size: 0.72rem;
  }

  /* Home toggles */
  .home-toggles-row {
    flex-direction: column;
    gap: 6px;
  }

  .home-toggles-row .mixed-option {
    flex: 1 1 auto;
    width: 100%;
    padding: 8px 10px;
  }

  .home-toggles-row .toggle-label {
    font-size: 0.82rem;
  }

  /* Join code inline */
  .join-code-inline {
    width: 100%;
    gap: 8px;
  }

  #view-home .code-input-compact {
    min-width: 0;
    flex: 1;
    font-size: 1.1rem !important;
    letter-spacing: 0.18em;
    padding: 10px 8px !important;
  }

  /* Lobby view */
  .lobby-card {
    padding: 16px 14px;
    gap: 14px;
  }

  .lobby-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .mega-theme-badge {
    font-size: 1.25rem;
  }

  .lobby-rules-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .lobby-settings-grid {
    grid-template-columns: 1fr;
  }

  .lobby-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .lobby-actions .btn {
    width: 100%;
  }

  /* Auction view: active auction on top, players below */
  .auction-workspace {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .auction-center-stage {
    order: -1;
    width: 100%;
  }

  .auction-sidebar {
    width: 100%;
    max-height: none;
  }

  .auction-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
  }

  .card-scene {
    height: min(330px, 44vh);
  }

  .bid-panel {
    padding: 12px;
    gap: 10px;
  }

  .bid-status-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .bid-metric {
    padding: 8px 6px;
  }

  .metric-label {
    font-size: 0.62rem;
  }

  .bid-amount {
    font-size: 1.25rem;
  }

  .bid-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .quick-bids {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
  }

  .quick-bids .btn-quick {
    width: 100%;
    padding: 10px 6px;
    font-size: 0.85rem;
  }

  .custom-bid-form {
    width: 100%;
    display: flex;
    gap: 6px;
  }

  .custom-bid-form input {
    flex: 1;
    min-width: 0;
  }

  #btn-pass {
    width: 100%;
    padding: 11px;
  }

  /* Modals & Admin Catalog on mobile */
  .modal-overlay {
    padding: 8px;
  }

  .modal-card {
    padding: 14px;
    max-height: 92vh;
  }

  .catalog-modal-card {
    max-width: 100%;
    height: 92vh;
    padding: 12px;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .catalog-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .catalog-tab {
    padding: 7px 4px;
    font-size: 0.72rem;
    text-align: center;
  }

  .catalog-tab span {
    display: block;
    margin-left: 0;
    font-size: 0.65rem;
  }

  .catalog-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .catalog-select {
    min-width: 0;
    width: 100% !important;
    font-size: 0.78rem !important;
  }

  .catalog-search-input {
    grid-column: 1 / -1;
    width: 100% !important;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

/* ========================================================
   ADMIN NAME COLORS & ANIMATED FADE / RGB STYLES
======================================================== */
.name-style-section {
  width: 100%;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.name-style-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.name-style-head .field-label {
  margin-bottom: 0;
}

.name-style-preview {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.name-style-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.name-swatch {
  padding: 7px 6px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-primary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.name-swatch:hover {
  border-color: rgba(34, 211, 238, 0.65);
  transform: translateY(-1px);
}

.name-swatch.active {
  border-color: #22d3ee;
  box-shadow: 0 0 0 1px #22d3ee, 0 0 12px rgba(34, 211, 238, 0.25);
  background: rgba(30, 41, 59, 0.95);
}

/* Solid name colors */
.name-style-crimson { color: #fb7185 !important; }
.name-style-gold { color: #fbbf24 !important; }
.name-style-cyan { color: #22d3ee !important; }
.name-style-emerald { color: #34d399 !important; }
.name-style-violet { color: #c084fc !important; }
.name-style-pink { color: #f472b6 !important; }

/* Animated gradient / fade name styles */
@keyframes nameGradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.name-style-rgb,
.name-style-fire,
.name-style-cyber,
.name-style-gold-shine,
.name-style-aurora {
  background-size: 300% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  animation: nameGradientFlow 3.2s linear infinite;
}

.name-style-rgb {
  background-image: linear-gradient(90deg, #ff3b3b, #ff9f1c, #ffe600, #2ecc71, #00e5ff, #7c3aed, #ff4fd8, #ff3b3b);
}

.name-style-fire {
  background-image: linear-gradient(90deg, #dc2626, #f97316, #fde047, #f97316, #dc2626);
  animation-duration: 2.6s;
}

.name-style-cyber {
  background-image: linear-gradient(90deg, #22d3ee, #818cf8, #f472b6, #22d3ee);
  animation-duration: 2.8s;
}

.name-style-gold-shine {
  background-image: linear-gradient(90deg, #b45309, #fbbf24, #fef08a, #ffffff, #fbbf24, #b45309);
  animation-duration: 2.4s;
}

.name-style-aurora {
  background-image: linear-gradient(90deg, #10b981, #06b6d4, #6366f1, #a855f7, #10b981);
  animation-duration: 3.6s;
}

/* Clickable Brand Home Link */
.brand-clickable {
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.brand-clickable:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Host Player Controls in Lobby (Transfer Host / Kick) */
.lobby-host-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.btn-slot-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}

.btn-slot-action:hover {
  transform: translateY(-1px);
}

.btn-slot-host {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
}

.btn-slot-host:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(251, 191, 36, 0.8);
}

.btn-slot-kick {
  border-color: rgba(244, 63, 94, 0.45);
  color: #fecdd3;
  background: rgba(225, 29, 72, 0.16);
}

.btn-slot-kick:hover {
  background: rgba(225, 29, 72, 0.34);
  border-color: rgba(244, 63, 94, 0.85);
}
