:root {
  --bg-main: #050815;
  --bg-elevated: #0a0f24;
  --bg-elevated-soft: #090d1f;
  --border-subtle: rgba(255, 255, 255, 0.12);
  --text-primary: #f7f7ff;
  --text-muted: #a0a3c2;
  --accent: #ff4ecd;
  --accent2: #4de5ff;
  --accent3: #9b5cff;
  --danger: #ff4976;
  --success: #4dffb5;
  --shadow-glow: 0 0 18px rgba(77, 229, 255, 0.6), 0 0 32px rgba(255, 78, 205, 0.45);
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --nav-height: 64px;
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.28s ease;
  --scrollbar: rgba(255, 255, 255, 0.15);
}

/* Themes */
.theme-neon-abyss {
  --bg-main: #050815;
  --bg-elevated: #0b1028;
  --bg-elevated-soft: #05091d;
  --border-subtle: rgba(89, 246, 255, 0.35);
  --accent: #ff4ecd;
  --accent2: #4de5ff;
  --accent3: #a96bff;
}
.theme-neon-purple {
  --bg-main: #08031f;
  --bg-elevated: #16033e;
  --bg-elevated-soft: #0b0223;
  --border-subtle: rgba(204, 153, 255, 0.45);
  --accent: #ff79f2;
  --accent2: #7cfbff;
  --accent3: #c792ff;
}
.theme-neon-pink {
  --bg-main: #170218;
  --bg-elevated: #2a032b;
  --bg-elevated-soft: #1f021f;
  --border-subtle: rgba(255, 111, 181, 0.5);
  --accent: #ff6fb5;
  --accent2: #5df2ff;
  --accent3: #ffa3e0;
}
.theme-neon-blue {
  --bg-main: #02081a;
  --bg-elevated: #041029;
  --bg-elevated-soft: #050b1f;
  --border-subtle: rgba(61, 187, 255, 0.5);
  --accent: #3dbbff;
  --accent2: #ff68e6;
  --accent3: #64e2ff;
}
.theme-neon-darkblue {
  --bg-main: #01040f;
  --bg-elevated: #04081a;
  --bg-elevated-soft: #050918;
  --border-subtle: rgba(70, 194, 255, 0.55);
  --accent: #46c2ff;
  --accent2: #ff5cc6;
  --accent3: #7aa6ff;
}

/* Global */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #151a3a 0, var(--bg-main) 40%, #020308 90%);
  color: var(--text-primary);
}

body {
  overflow: hidden;
}

.app-root {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Nav */
.top-nav {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(
      90deg,
      rgba(255, 78, 205, 0.1),
      rgba(77, 229, 255, 0.04) 40%,
      transparent
    ),
    rgba(5, 8, 21, 0.98);
  backdrop-filter: blur(18px);
  gap: 8px;
}

.top-nav-left,
.top-nav-center,
.top-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav-left {
  flex: 1 1 auto;
  min-width: 0;
}

.top-nav-center {
  flex: 0 0 auto;
  justify-content: center;
}

.top-nav-right {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.logo-btn {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at 30% 0, rgba(255, 78, 205, 0.4), transparent 55%);
  color: var(--accent2);
  /* padding: 6px 8px; */
  overflow: hidden;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 6px;
  box-shadow: 0 0 14px rgba(77, 229, 255, 0.6);
  border-color: var(--accent2);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.logo-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(77, 229, 255, 0.6);
  border-color: var(--accent2);
}

.logo-icon i {
  font-size: 20px;
}

.app-title-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.app-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-title {
  font-size: 18px;
  margin: 0;
  white-space: nowrap;
}

.version-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at top, rgba(77, 229, 255, 0.3), rgba(255, 78, 205, 0.2));
  color: #e3f9ff;
}

.app-subtitle {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons & links */
.primary-btn,
.secondary-btn,
.danger-btn,
.icon-btn,
.link-btn {
  font-family: inherit;
  border: none;
  outline: none;
  cursor: pointer;
}

.primary-btn {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 7px 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fefbff;
  background: rgba(255, 255, 255, 0.04);
}

.gradient-btn {
  background: linear-gradient(120deg, var(--accent2), var(--accent), var(--accent3));
  box-shadow: var(--shadow-glow);
}

.primary-btn i {
  font-size: 14px;
}

.primary-btn span {
  white-space: nowrap;
}

.secondary-btn {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.danger-btn {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 73, 118, 0.6);
  padding: 7px 14px;
  background: rgba(255, 73, 118, 0.09);
  color: #ffdbe7;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent2);
  transform: translateY(-1px);
}

.icon-circle-link {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.icon-circle-link:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  transform: translateY(-1px);
}

.link-btn {
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--accent2);
  font-size: 13px;
}

/* Top nav center */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Layout */
.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: calc(100vh - var(--nav-height));
  background: radial-gradient(circle at 0 0, rgba(77, 229, 255, 0.1), transparent 45%), var(--bg-main);
}

.app-layout.side-collapsed {
  grid-template-columns: 70px minmax(0, 1fr);
}

/* Side Panel */
.side-panel {
  border-right: 1px solid var(--border-subtle);
  background: linear-gradient(160deg, rgba(13, 18, 53, 0.9), rgba(5, 8, 21, 0.96));
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: width 0.26s ease, transform 0.26s ease;
  max-height: 90vh;
}

.side-panel.collapsed {
  width: 70px !important;
}

.side-panel.hidden-mobile {
  transform: translateX(-100%);
}

.side-panel-header {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.side-panel-user-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.avatar-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent2);
  object-fit: cover;
  box-shadow: 0 0 8px rgba(77, 229, 255, 0.5);
}

.star-count-badge {
  background: linear-gradient(135deg, #ffd54f, #ffb300);
  color: #402100;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.55);
}

.side-panel .avatar-wrapper .star-count-badge {
  position: static;
}

.star-count-badge.small {
  position: absolute;
  bottom: -6px;
  right: -10px;
}

.side-panel-user-meta {
  min-width: 0;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.user-age-gender {
  font-size: 11px;
  color: var(--text-muted);
}

.user-email {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.side-panel-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.side-nav-btn {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  padding: 5px 9px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.side-nav-btn.subtle {
  width: 100%;
  justify-content: center;
}

.side-nav-btn.active {
  border-color: var(--accent2);
  background: linear-gradient(120deg, rgba(77, 229, 255, 0.25), rgba(255, 78, 205, 0.22));
  box-shadow: 0 0 10px rgba(77, 229, 255, 0.45);
}

.side-panel.collapsed .side-panel-nav .side-nav-btn span,
.side-panel.collapsed .side-panel-footer .side-nav-btn span {
  display: none;
}

.side-panel.collapsed .side-panel-user-meta {
  display: none;
}

.side-panel.collapsed .side-panel-nav .side-nav-btn {
  justify-content: center;
  width: 44px;
  padding-inline: 0;
}

.side-panel-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.side-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  padding: 8px 10px 4px;
  margin: 0;
}

.user-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

/* User cards */
.user-card {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: radial-gradient(circle at 0 0, rgba(77, 229, 255, 0.2), transparent 55%), var(--bg-elevated-soft);
  padding: 8px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  margin-bottom: 6px;
}

.user-card.blocked {
  opacity: 0.4;
}

.user-card.blocked .user-card-menu-btn {
  opacity: 1;
}

.user-card-avatar {
  position: relative;
}

.user-card-avatar img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
}

.user-card-star-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: linear-gradient(135deg, #ffd54f, #ffb300);
  font-size: 9px;
  padding: 1px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.5);
  color: #3a2300;
}

.user-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.user-card-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.user-card-name {
  font-size: 13px;
  font-weight: 600;
}

.user-card-subtext {
  font-size: 11px;
  color: var(--text-muted);
}

.user-card-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.user-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.user-card-star-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 215, 0, 0.6);
  background: rgba(255, 215, 0, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffd54f;
  cursor: pointer;
  font-size: 14px;
}

.user-card-star-btn.favorited {
  background: linear-gradient(135deg, #ffd54f, #ffb300);
  color: #3c2600;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.user-card-menu-btn {
  width: 24px;
  height: 24px;
}

/* Collapsed user cards */
.side-panel.collapsed .side-section-title {
  display: none;
}

.side-panel.collapsed .user-list {
  padding-inline: 6px;
}

.side-panel.collapsed .user-card {
  grid-template-columns: auto;
  background: transparent;
  border-color: transparent;
  padding: 4px;
  margin-bottom: 4px;
}

.side-panel.collapsed .user-card-body,
.side-panel.collapsed .user-card-actions {
  display: none;
}

.side-panel.collapsed .user-card-avatar img {
  width: 40px;
  height: 40px;
}

/* Side panel footer */
.side-panel-footer {
  padding: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* Main Content */
.main-content {
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.view {
  position: absolute;
  inset: 0;
  padding: 10px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}

.view-active {
  opacity: 1;
  pointer-events: auto;
}

/* Chat */
.chat-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 0 0, rgba(77, 229, 255, 0.16), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(255, 78, 205, 0.18), transparent 50%), var(--bg-main);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.8);
  padding: 8px;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 4px 2px 8px;
}

/* Message bubble */
.message {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.message-avatar-wrapper {
  position: relative;
}

.message-avatar-wrapper img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent2);
  object-fit: cover;
}

.message-avatar-star {
  position: absolute;
  top: -6px;
  right: -8px;
  background: linear-gradient(135deg, #ffd54f, #ffb300);
  font-size: 9px;
  padding: 1px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.5);
  color: #3a2300;
}

.message-body {
  position: relative;
  background: linear-gradient(120deg, rgba(77, 229, 255, 0.1), rgba(255, 78, 205, 0.08));
  border-radius: 12px;
  padding: 6px 8px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.message-header-row {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 4px;
}

.message-sender {
  font-size: 13px;
  font-weight: 600;
}

.message-timestamp {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  text-align: right;
}

.message-text {
  font-size: 13px;
  margin-top: 3px;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-menu-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
}

/* Blocked overlay */
.message.blocked {
  opacity: 0.45;
}

.message.blocked .message-menu-btn {
  opacity: 1;
}

/* Message form */
.message-form {
  margin-top: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(120deg, rgba(77, 229, 255, 0.16), rgba(255, 78, 205, 0.18));
  box-shadow: var(--shadow-glow);
  padding: 6px;
  position: relative;
}

.message-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.input-profile {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.input-profile img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--accent2);
}

.char-counter {
  font-size: 11px;
  color: #e3f9ff;
}

.message-input-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 6px;
  align-items: flex-end;
}

.message-input {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 8, 21, 0.9);
  padding: 6px 8px;
  resize: none;
  font-size: 13px;
  color: var(--text-primary);
  max-height: 100px;
}

.message-input:focus {
  outline: none;
  border-color: var(--accent2);
  box-shadow: 0 0 0 1px rgba(77, 229, 255, 0.5);
}

.send-btn {
  white-space: nowrap;
}

/* Emoji tooltip */
.emoji-tooltip {
  position: absolute;
  left: 6px;
  bottom: 100%;
  transform: translateY(-8px);
  width: min(380px, 100%);
  min-height: 300px;
  max-height: 300px;
  border-radius: 12px;
  background: rgba(8, 10, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.9);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
}

.emoji-tooltip.visible {
  display: flex;
}

.emoji-tooltip-header {
  display: flex;
  gap: 6px;
  align-items: center;
}

.emoji-search-input {
  flex: 1;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 8, 21, 0.9);
  padding: 5px 8px;
  color: var(--text-primary);
  font-size: 12px;
}

.emoji-search-input:focus {
  outline: none;
  border-color: var(--accent2);
}

.emoji-cats {
  display: flex;
  gap: 4px;
}

.emoji-cat-btn {
  flex: 1;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
  font-size: 16px;
  padding: 3px 0;
  cursor: pointer;
}

.emoji-cat-btn.active {
  border-color: var(--accent2);
  background: linear-gradient(130deg, rgba(77, 229, 255, 0.3), rgba(255, 78, 205, 0.3));
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 5px;
}

.emoji-item-btn {
  border-radius: 8px;
  border: none;
  background: transparent;
  padding: 4px;
  font-size: 20px;
  cursor: pointer;
}

.emoji-item-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Tooltip menu (3-dots) */
.dropdown-menu {
  position: absolute;
  top: 24px;
  right: 0;
  min-width: 140px;
  border-radius: 10px;
  background: rgba(6, 8, 25, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
  padding: 4px;
  z-index: 60;
}

.dropdown-menu button {
  width: 100%;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.dropdown-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 3, 12, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-backdrop.visible {
  display: flex;
}

.modal {
  position: relative;
  border-radius: 14px;
  background: radial-gradient(circle at 0 0, rgba(255, 77, 225, 0.22), transparent 60%), var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 14px 12px 12px;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  color: var(--text-primary);
}

.modal h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

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

.modal-close-btn {
  position: absolute;
  top: 6px;
  right: 6px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
  font-size: 13px;
}

.auth-form input,
.auth-form select {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 8, 21, 0.9);
  padding: 6px 8px;
  color: var(--text-primary);
  font-size: 13px;
}

.auth-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.auth-switch {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
}

.settings-user-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
}

.settings-user-summary img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent2);
}

.settings-user-text {
  flex: 1;
  min-width: 0;
}

.settings-user-stars {
  margin-left: auto;
  font-size: 12px;
  color: #ffd54f;
}

.settings-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

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

.toggle-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toggle-row input {
  accent-color: var(--accent2);
}

.full-width {
  width: 100%;
}

/* Game modal */
.game-modal {
  width: min(900px, calc(100vw - 24px));
}

.game-embed-wrapper {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #000;
  aspect-ratio: 16 / 9;
}

.game-embed-wrapper iframe {
  width: 100%;
  height: 100%;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2100;
}

.toast {
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(6, 12, 32, 0.98);
  border: 1px solid rgba(77, 229, 255, 0.5);
  color: #e2f7ff;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.9);
}

/* Market Place */
.market-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.market-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.market-title-row h2 {
  margin: 0;
  font-size: 18px;
}

.market-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.market-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  margin-bottom: 6px;
}

.market-search-input {
  flex: 1;
  min-width: 140px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 8, 21, 0.9);
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 13px;
}

.market-select {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 8, 21, 0.9);
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 12px;
}

.badge-toggle-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge-toggle {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 3px 8px;
  font-size: 11px;
  background: rgba(5, 8, 21, 0.7);
  color: var(--text-muted);
  cursor: pointer;
}

.badge-toggle.active {
  border-color: var(--accent2);
  background: linear-gradient(130deg, rgba(77, 229, 255, 0.32), rgba(255, 78, 205, 0.28));
  color: #fff;
}

/* Market content */
.market-content {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at 0 0, rgba(77, 229, 255, 0.16), transparent 48%), var(--bg-main);
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.85);
  padding: 8px;
  height: calc(100% - 80px);
  display: flex;
  flex-direction: column;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 4px 2px 6px;
  height: calc(100% - 80px);
}

.market-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 4px 2px 6px;
}

/* Store card */
.store-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle at 0 0, rgba(77, 229, 255, 0.18), transparent 55%), var(--bg-elevated-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 370px;
}

.store-card-banner {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #050812;
}

.store-card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-badges-bottom-left {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.store-status-badge {
  border-radius: var(--radius-pill);
  padding: 2px 6px;
  font-size: 10px;
  color: #fff;
}

.store-status-published {
  background: #00cc00;
}

.store-status-draft {
  background: rgba(255, 193, 7, 0.9);
}

.store-status-review {
  background: rgba(77, 229, 255, 0.9);
}

.store-status-progress {
  background: rgba(156, 39, 176, 0.9);
}

.store-price-badge {
  border-radius: var(--radius-pill);
  padding: 2px 6px;
  font-size: 10px;
  background: linear-gradient(135deg, #ffd54f, #ffb300);
  color: #3a2400;
}

.store-card-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.store-card-header-row {
  display: flex;
  gap: 6px;
}

.store-card-icon img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

.store-card-title-block {
  flex: 1;
}

.store-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.store-card-title-row h3 {
  margin: 0;
  font-size: 14px;
}

.store-version-badge {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 1px 6px;
  font-size: 10px;
  color: #e3f9ff;
}

.store-card-subtitle {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.store-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.store-meta-badge {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 2px 6px;
  font-size: 10px;
  color: var(--text-muted);
}

.store-card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  gap: 6px;
}

.store-card-actions-row .primary-btn {
  font-size: 11px;
  padding: 6px 8px;
}

/* Market action button styles */
.store-card-actions-row .store-install-btn {
  /* neon pink/blue gradient + glow */
  background: linear-gradient(120deg, var(--accent2), var(--accent), var(--accent3));
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 14px rgba(77, 229, 255, 0.7), 0 0 24px rgba(255, 78, 205, 0.6);
  color: #fdfbff;
}

.store-card-actions-row .store-install-btn:hover {
  box-shadow: 0 0 18px rgba(77, 229, 255, 0.9), 0 0 28px rgba(255, 78, 205, 0.8);
  transform: translateY(-1px);
}

.store-card-actions-row .store-buy-btn {
  /* gold / orange gradient for Buy Now */
  background: linear-gradient(125deg, #ffd54f, #ffb300, #ff7b32);
  border-color: rgba(255, 184, 0, 0.8);
  box-shadow: 0 0 14px rgba(255, 193, 7, 0.8), 0 0 22px rgba(255, 140, 0, 0.7);
  color: #3b2200;
}

.store-card-actions-row .store-buy-btn:hover {
  box-shadow: 0 0 18px rgba(255, 213, 79, 0.95), 0 0 26px rgba(255, 140, 0, 0.9);
  transform: translateY(-1px);
}

.store-links-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* List view */
.store-card-list {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  padding: 8px;
  align-items: center;
}

/* Pagination */
.pagination {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 8, 21, 0.9);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}

.page-btn.active {
  border-color: var(--accent2);
  background: linear-gradient(130deg, rgba(77, 229, 255, 0.3), rgba(255, 78, 205, 0.3));
}

/* Crazy Games */
.games-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.games-title-row h2 {
  margin: 0;
  font-size: 18px;
}

.games-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.games-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.games-search-input {
  flex: 1;
  min-width: 140px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 8, 21, 0.9);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-primary);
}

.category-badge-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.category-badge-btn {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 8, 21, 0.8);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.category-badge-btn i {
  font-size: 12px;
}

.category-badge-btn.active {
  border-color: var(--accent2);
  background: linear-gradient(130deg, rgba(77, 229, 255, 0.3), rgba(255, 78, 205, 0.3));
  color: #fff;
}

.games-content {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at 0 0, rgba(77, 229, 255, 0.16), transparent 48%), var(--bg-main);
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.85);
  padding: 8px;
  height: calc(100% - 80px);
  display: flex;
  flex-direction: column;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 2px;
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
}

/* Game cards */
.game-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle at 0 0, rgba(77, 229, 255, 0.18), transparent 55%), var(--bg-elevated-soft);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 240px;
}

.game-card-banner {
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.game-card-body {
  padding: 6px 8px 8px;
}

.game-card-title-row {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  align-items: baseline;
}

.game-card-title-row h3 {
  margin: 0;
  font-size: 14px;
}

.game-genre-badge {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  font-size: 10px;
  color: var(--text-muted);
}

/* List view */
.game-card-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  padding: 6px 8px;
}

/* Global Network */
.network-container {
  height: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at 0 0, rgba(77, 229, 255, 0.16), transparent 48%), var(--bg-main);
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  padding: 6px;
}

.network-header {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.network-header h2 {
  margin: 0;
  font-size: 18px;
}

.map-style-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.map-style-btn {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 4px 9px;
  font-size: 11px;
  background: rgba(5, 8, 21, 0.8);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-style-btn.active {
  border-color: var(--accent2);
  background: linear-gradient(130deg, rgba(77, 229, 255, 0.3), rgba(255, 78, 205, 0.3));
  color: #fff;
}

.map-controls-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.location-toggle-group {
  display: inline-flex;
  gap: 4px;
}

.location-toggle-btn {
  font-size: 11px;
  padding-inline: 10px;
}

.location-toggle-btn.active {
  border-color: var(--accent2);
  background: linear-gradient(130deg, rgba(77, 229, 255, 0.3), rgba(255, 78, 205, 0.3));
  box-shadow: 0 0 14px rgba(77, 229, 255, 0.6);
}

.map-main {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #000;
}

#globalMap {
  width: 100%;
  height: 100%;
}

/* Leaflet user marker tooltip */
.map-user-tooltip-wrapper {
  background: transparent;
  border: none;
  box-shadow: none;
}

.map-user-tooltip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(6, 8, 25, 0.96);
  border: 1px solid rgba(77, 229, 255, 0.6);
}

.map-user-avatar-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
}

.map-user-avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent2);
  object-fit: cover;
}

.user-marker-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(77, 229, 255, 0.7);
  animation: pulse 2s infinite;
}

.map-user-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.map-user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.map-user-stars {
  margin-left: auto;
  font-size: 11px;
  color: #ffd54f;
}

.map-user-subtext {
  font-size: 11px;
  color: var(--text-muted);
}

@keyframes pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.4);
    opacity: 0;
  }
  100% {
    transform: scale(0.9);
    opacity: 0;
  }
}
