@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
  color-scheme: dark;

  --bg: #020617;
  --bg-2: #07111f;
  --surface: #0f172a;
  --surface-2: #111c31;
  --surface-3: #172339;

  --text: #f8fafc;
  --text-strong: #ffffff;
  --muted: #94a3b8;
  --muted-2: #64748b;

  --border: rgba(30, 41, 59, 0.95);
  --border-strong: #334155;

  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --accent-ring: rgba(96, 165, 250, 0.25);

  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 22px 55px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 40px 100px rgba(0, 0, 0, 0.58);

  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 26px;
  --radius-xl: 34px;

  --sidebar-w: 270px;
  --right-w: 350px;

  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f8fafc;
  --bg-2: #eef4ff;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #eaf1fb;

  --text: #111827;
  --text-strong: #020617;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --border: rgba(226, 232, 240, 0.9);
  --border-strong: #cbd5e1;

  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: #dbeafe;
  --accent-ring: rgba(59, 130, 246, 0.22);

  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 32px 90px rgba(15, 23, 42, 0.18);

  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 26px;
  --radius-xl: 34px;

  --sidebar-w: 270px;
  --right-w: 350px;

  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 12% -8%, rgba(59, 130, 246, 0.18), transparent 30rem),
    radial-gradient(circle at 96% 2%, rgba(34, 197, 94, 0.08), transparent 24rem),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 42%, var(--bg) 100%);
  line-height: 1.5;
  overflow-x: hidden;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% -8%, rgba(96, 165, 250, 0.18), transparent 31rem),
    radial-gradient(circle at 95% 0%, rgba(139, 92, 246, 0.12), transparent 26rem),
    linear-gradient(180deg, #07111f 0%, #020617 44%, #020617 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* Layout */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--right-w);
  min-height: 100vh;
}

.sidebar,
.right-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--border);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .right-panel {
  background: rgba(15, 23, 42, 0.76);
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 1.45rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.main-content {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 2rem 2rem 3.2rem;
}

.right-panel {
  border-left: 1px solid var(--border);
  padding: 1.5rem 1.45rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.right-panel > * {
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Logo and navigation */

.logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.35rem 0.35rem 0.95rem;
}

.logo-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  box-shadow: 0 16px 36px rgba(59, 130, 246, 0.28);
  font-size: 1.28rem;
}

.logo-text {
  color: var(--text-strong);
  font-size: 1.42rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item,
.bottom-nav-item {
  cursor: pointer;
  border: 0;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.nav-item {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.78rem 0.9rem;
  background: transparent;
  color: var(--muted);
  border-radius: 16px;
  text-align: left;
  font-size: 0.94rem;
  font-weight: 750;
}

.nav-item span {
  width: 25px;
  display: inline-grid;
  place-items: center;
  font-size: 1.08rem;
}

.nav-item:hover {
  color: var(--text-strong);
  background: var(--surface-2);
  transform: translateX(3px);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: 0 14px 30px rgba(59, 130, 246, 0.26);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* Header */

.top-bar,
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.top-bar {
  padding-top: 0.25rem;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.mobile-header {
  padding: 0.4rem 0 1.1rem;
}

.mobile-title {
  color: var(--text-strong);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.07em;
}

.mobile-header-actions,
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.search-wrap {
  flex: 1;
  position: relative;
}

.search-wrap::before {
  content: "⌕";
  position: absolute;
  left: 1.05rem;
  top: 50%;
  transform: translateY(-54%);
  color: var(--muted);
  font-size: 1.2rem;
  pointer-events: none;
}

.search-wrap input {
  height: 56px;
  padding-left: 2.8rem !important;
  border-radius: 18px;
  font-size: 0.96rem;
  font-weight: 500;
}

/* Inputs */

input[type="text"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 0.76rem 0.9rem;
  font-size: 0.94rem;
  outline: 0;
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: rgba(15, 23, 42, 0.92);
}

textarea {
  min-height: 124px;
  resize: vertical;
}

select {
  cursor: pointer;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-xs);
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.form-hint {
  margin-top: 0.36rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Buttons */

.btn,
.icon-btn,
.theme-toggle {
  border: 0;
  cursor: pointer;
  user-select: none;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  padding: 0.72rem 1.08rem;
  border-radius: 15px;
  font-size: 0.9rem;
  font-weight: 780;
  white-space: nowrap;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.btn:active,
.icon-btn:active,
.theme-toggle:active,
.chip:active,
.reaction-btn:active {
  transform: scale(0.98);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: 0 15px 30px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(59, 130, 246, 0.33);
}

.btn-secondary {
  color: var(--text-strong);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--text-strong);
  background: var(--surface-2);
}

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

.btn-success {
  color: #fff;
  background: var(--success);
}

.btn-sm {
  min-height: 38px;
  padding: 0.54rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 13px;
}

.btn-block {
  width: 100%;
}

.icon-btn,
.theme-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--text-strong);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.icon-btn:hover,
.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
}

/* Cards */

.card,
.panel-card,
.quest-card,
.activity-item {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(226, 232, 240, 0.82);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.025),
    0 10px 28px rgba(15, 23, 42, 0.055);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

[data-theme="dark"] .card,
[data-theme="dark"] .panel-card,
[data-theme="dark"] .quest-card,
[data-theme="dark"] .activity-item {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(51, 65, 85, 0.72);
}

.card {
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.panel-card {
  border-radius: 24px;
  padding: 1.45rem 1.25rem;
}

.panel-card h3 {
  margin-bottom: 1.1rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.panel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-item {
  padding: 1rem 0.92rem;
  margin-top: 10px;
  margin-bottom: 10px;
  border-radius: 16px;
  color: var(--muted);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
  font-size: 0.9rem;
}

.panel-item:hover {
  color: var(--text-strong);
  background: var(--surface-2);
  transform: translateX(2px);
}

.panel-loading {
  color: var(--muted);
  font-size: 0.88rem;
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(2.6rem, 6vw, 4.6rem) 1.5rem;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.15), transparent 46%),
    linear-gradient(225deg, rgba(34, 197, 94, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.6rem;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

[data-theme="dark"] .hero {
  background:
    linear-gradient(135deg, rgba(96, 165, 250, 0.16), transparent 46%),
    linear-gradient(225deg, rgba(139, 92, 246, 0.1), transparent 42%),
    rgba(15, 23, 42, 0.84);
  border-color: rgba(51, 65, 85, 0.78);
}

.hero::after {
  content: "";
  position: absolute;
  right: -96px;
  top: -96px;
  width: 270px;
  height: 270px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  filter: blur(2px);
}

.hero::before {
  content: "";
  position: absolute;
  left: -120px;
  bottom: -120px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.09);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h2 {
  max-width: 780px;
  margin: 0 auto 0.85rem;
  color: var(--text-strong);
  font-size: clamp(2.65rem, 7vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.09em;
  font-weight: 900;
}

.hero p {
  max-width: 650px;
  margin: 0 auto 1.5rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.14rem);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* Filters */

.filter-chips {
  display: flex;
  gap: 0.62rem;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
  margin: 0 0 10px;
}

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0.52rem 0.86rem;
  margin-top: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.chip:hover {
  color: var(--text-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.chip.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.24);
}

.advanced-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 1rem;
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* Sections */

.section {
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-header h3 {
  color: var(--text-strong);
  font-size: 1.26rem;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 1.35rem;
}

/* Quest cards */

.quest-card {
  position: relative;
  overflow: hidden;
  border-radius: 25px;
}

.quest-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 130, 246, 0.36);
}

.quest-carousel {
  position: relative;
  height: 196px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, var(--accent-soft), transparent 55%),
    var(--surface-2);
}

.quest-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.quest-card:hover .quest-carousel img {
  transform: scale(1.04);
}

.quest-carousel-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 3rem;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.56);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.16s ease;
}

.carousel-btn:hover {
  background: rgba(2, 6, 23, 0.78);
}

.carousel-prev {
  left: 0.65rem;
}

.carousel-next {
  right: 0.65rem;
}

.quest-card-body {
  padding: 1.18rem;
}

.quest-card-title {
  color: var(--text-strong);
  font-size: 1.1rem;
  line-height: 1.22;
  letter-spacing: -0.055em;
  font-weight: 900;
  margin-bottom: 0.45rem;
}

.quest-card-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quest-meta,
.quest-stats,
.detail-meta,
.detail-actions,
.reactions-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.quest-meta {
  margin: 0.9rem 0 0.7rem;
}

.quest-stats {
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.quest-author {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  margin-top: 0.82rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.quest-card-footer {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.18rem 1.08rem;
  border-top: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.62);
}

[data-theme="dark"] .quest-card-footer {
  background: rgba(2, 6, 23, 0.24);
}

/* Pills */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border-radius: 999px;
  padding: 0.31rem 0.68rem;
  font-size: 0.71rem;
  font-weight: 900;
  line-height: 1;
}

.pill-category {
  color: var(--accent);
  background: var(--accent-soft);
}

.pill-easy {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.14);
}

.pill-medium {
  color: #d97706;
  background: rgba(245, 158, 11, 0.16);
}

.pill-hard {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.14);
}

.pill-legendary {
  color: var(--purple);
  background: rgba(139, 92, 246, 0.15);
}

/* Avatars */

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.avatar-lg {
  width: 84px;
  height: 84px;
}

.avatar-xl {
  width: 112px;
  height: 112px;
}

/* Maps */

.map-container {
  height: calc(100vh - 205px);
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

#mini-map {
  height: 190px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  margin-top: 0.15rem;
}

.map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.leaflet-container {
  font-family: var(--font);
}

[data-theme="dark"] .leaflet-tile {
  filter: brightness(0.72) contrast(1.15) saturate(0.85);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

/* Profile */

.profile-header {
  text-align: center;
  padding: 2rem 1.25rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 34px;
  background:
    radial-gradient(circle at top, var(--accent-soft), transparent 62%),
    var(--surface);
  box-shadow: var(--shadow-md);
}

.profile-header .avatar-xl {
  margin: 0 auto 0.95rem;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-md);
}

.profile-header h2 {
  color: var(--text-strong);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.profile-header p {
  color: var(--muted);
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: clamp(0.9rem, 4vw, 2.5rem);
  margin: 1.25rem 0;
}

.profile-stat {
  min-width: 72px;
  text-align: center;
}

.profile-stat strong {
  display: block;
  color: var(--text-strong);
  font-size: 1.28rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.profile-stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.profile-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.profile-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.36rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.profile-tab {
  flex: 1;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  padding: 0.78rem;
  cursor: pointer;
  font-weight: 900;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.profile-tab:hover {
  color: var(--text-strong);
  background: var(--surface-2);
}

.profile-tab.active {
  color: #fff;
  background: var(--accent);
}

/* Image previews */

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.7rem;
  margin-top: 0.75rem;
}

.image-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-2);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview .remove-img {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 900;
}

/* Activity / notifications */

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.9rem;
}

.activity-item img,
.activity-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 17px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.notif-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.16s ease;
}

.notif-item:hover {
  background: var(--surface-2);
}

.notif-item.unread {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
}

.notif-time {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

/* Modals */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal {
  width: min(100%, 600px);
  max-height: 91vh;
  overflow-y: auto;
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.modal-lg {
  width: min(100%, 820px);
  max-width: 820px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.modal-header h2 {
  color: var(--text-strong);
  font-size: 1.42rem;
  font-weight: 900;
  letter-spacing: -0.055em;
}

.modal-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.modal-close:hover {
  color: var(--text-strong);
  background: var(--surface-3);
}

.detail-carousel {
  position: relative;
  height: 292px;
  overflow: hidden;
  margin: -1.35rem -1.35rem 1.1rem;
  border-radius: 30px 30px 0 0;
  background: var(--surface-2);
}

.detail-carousel .quest-carousel {
  height: 100%;
  border-radius: 0;
}

.detail-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

/* Comments / reactions */

.reaction-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem 0.78rem;
  font-weight: 850;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.reaction-btn:hover,
.reaction-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.comments-section {
  margin-top: 1.4rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.comments-section h3 {
  margin-bottom: 0.95rem;
  color: var(--text-strong);
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.comment {
  display: flex;
  gap: 0.78rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--border);
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-author {
  color: var(--text-strong);
  font-size: 0.88rem;
  font-weight: 900;
}

.comment-text {
  margin-top: 0.22rem;
  color: var(--text);
  font-size: 0.9rem;
}

.comment-time {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 650;
}

/* Gallery */

.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.94);
}

.gallery-overlay img {
  max-width: 90vw;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.gallery-close,
.gallery-nav {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.16s ease;
}

.gallery-close:hover,
.gallery-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 1.3rem;
}

.gallery-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 58px;
  border-radius: 16px;
  font-size: 2.2rem;
}

.gallery-prev {
  left: 1rem;
}

.gallery-next {
  right: 1rem;
}

.gallery-counter {
  position: absolute;
  bottom: 1.3rem;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
}

/* QR / toast / states */

.qr-container {
  width: fit-content;
  margin: 1rem auto;
  padding: 1rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.toast-container {
  position: fixed;
  left: 50%;
  bottom: 5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  min-width: min(360px, calc(100vw - 2rem));
  padding: 0.78rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  font-weight: 650;
  animation: toastIn 0.22s ease;
  pointer-events: auto;
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.45);
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.45);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.empty-state,
.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.25rem 1.5rem;
  color: var(--muted);
}

.empty-state .emoji,
.error-state .emoji {
  margin-bottom: 0.75rem;
  font-size: 2.9rem;
}

.error-state {
  color: var(--danger);
}

.deletion-banner {
  position: sticky;
  top: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding: 0.76rem 1rem;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #111827;
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.pin-display {
  margin: 0.9rem 0;
  padding: 1.1rem;
  border: 1px dashed var(--border-strong);
  border-radius: 17px;
  background: var(--surface-2);
  color: var(--text-strong);
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.34em;
}

.my-post-card .post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.sort-select {
  max-width: 190px;
}

/* Mobile nav */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

[data-theme="dark"] .bottom-nav {
  background: rgba(15, 23, 42, 0.9);
}

.bottom-nav-item {
  min-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  padding: 0.38rem 0.58rem;
  font-size: 0.66rem;
  font-weight: 800;
}

.bottom-nav-item span {
  font-size: 1.18rem;
  line-height: 1;
}

.bottom-nav-item.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

/* Responsive */

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }

  .right-panel {
    display: none;
  }
}

@media (max-width: 1024px) {
  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar,
  .right-panel,
  .desktop-only {
    display: none !important;
  }

  .mobile-only,
  .mobile-only.mobile-header,
  .bottom-nav.mobile-only {
    display: flex;
  }

  .main-content {
    width: 100%;
    max-width: 100%;
    padding: 0.9rem 1rem 5.8rem;
  }

  .quest-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  }

  .hero {
    min-height: 250px;
    padding: 2.5rem 1rem;
    border-radius: 28px;
  }

  .hero h2 {
    font-size: clamp(2.15rem, 12vw, 3.5rem);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .map-container {
    height: calc(100vh - 220px);
    min-height: 390px;
  }

  .modal {
    border-radius: 24px;
    padding: 1rem;
  }

  .detail-carousel {
    margin: -1rem -1rem 1rem;
    height: 245px;
  }
}

@media (min-width: 1025px) {
  .bottom-nav {
    display: none;
  }
}

@media (max-width: 560px) {
  body {
    background:
      radial-gradient(circle at 20% -5%, rgba(59, 130, 246, 0.17), transparent 19rem),
      linear-gradient(180deg, var(--bg-2), var(--bg) 48%);
  }

  .main-content {
    padding-inline: 0.85rem;
  }

  .hero {
    margin-inline: -0.05rem;
  }

  .quest-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .quest-card-footer,
  .detail-actions,
  .hero-actions,
  .profile-actions {
    flex-direction: column;
  }

  .quest-card-footer .btn,
  .detail-actions .btn,
  .hero-actions .btn,
  .profile-actions .btn {
    width: 100%;
  }

  .profile-stats {
    gap: 0.55rem;
  }

  .profile-stat {
    min-width: 62px;
  }

  .activity-item {
    align-items: flex-start;
  }

  .gallery-nav {
    width: 42px;
    height: 50px;
  }

  .gallery-prev {
    left: 0.5rem;
  }

  .gallery-next {
    right: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
.top-bar-actions {
  transform: translateY(10px);
}


/* Dark is the default theme now.
   These overrides handle places that used fixed rgba/light colors instead of CSS variables. */

body {
  background:
    radial-gradient(circle at 12% -8%, rgba(96, 165, 250, 0.18), transparent 31rem),
    radial-gradient(circle at 95% 0%, rgba(139, 92, 246, 0.12), transparent 26rem),
    linear-gradient(180deg, #07111f 0%, #020617 44%, #020617 100%);
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at 12% -8%, rgba(59, 130, 246, 0.18), transparent 30rem),
    radial-gradient(circle at 96% 2%, rgba(34, 197, 94, 0.08), transparent 24rem),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 42%, var(--bg) 100%);
}

.sidebar,
.right-panel {
  background: rgba(15, 23, 42, 0.76);
}

[data-theme="light"] .sidebar,
[data-theme="light"] .right-panel {
  background: rgba(255, 255, 255, 0.76);
}

input[type="text"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
  background: rgba(15, 23, 42, 0.92);
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="search"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] input[type="url"],
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: rgba(255, 255, 255, 0.92);
}

.card,
.panel-card,
.quest-card,
.activity-item {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(51, 65, 85, 0.72);
}

[data-theme="light"] .card,
[data-theme="light"] .panel-card,
[data-theme="light"] .quest-card,
[data-theme="light"] .activity-item {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(226, 232, 240, 0.82);
}

.hero {
  background:
    linear-gradient(135deg, rgba(96, 165, 250, 0.16), transparent 46%),
    linear-gradient(225deg, rgba(139, 92, 246, 0.1), transparent 42%),
    rgba(15, 23, 42, 0.84);
  border-color: rgba(51, 65, 85, 0.78);
}

[data-theme="light"] .hero {
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.15), transparent 46%),
    linear-gradient(225deg, rgba(34, 197, 94, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.82);
  border-color: rgba(226, 232, 240, 0.82);
}

.quest-card-footer {
  background: rgba(2, 6, 23, 0.24);
}

[data-theme="light"] .quest-card-footer {
  background: rgba(248, 250, 252, 0.62);
}

.bottom-nav {
  background: rgba(15, 23, 42, 0.9);
}

[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.9);
}

.leaflet-tile {
  filter: brightness(0.72) contrast(1.15) saturate(0.85);
}

[data-theme="light"] .leaflet-tile {
  filter: none;
}

