:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --card: #ffffff;
  --stroke: rgba(15, 23, 42, 0.08);
  --text: #111827;
  --muted: #6b7280;
  --accent: #111827;
  --accent-soft: #eef2ff;
  --shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  background: radial-gradient(circle at top right, #ffffff 0%, #f5f7ff 45%, #f1f5f9 100%);
  color: var(--text);
  min-height: 100vh;
}

.view {
  display: none;
  min-height: 100vh;
}

.view.active {
  display: block;
}

.map-view {
  height: 100vh;
  position: relative;
}

.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#map {
  flex: 1;
  height: 100%;
}

.auth-bar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.auth-bar:empty {
  display: none;
}

.auth-button {
  background: #111111;
  color: #ffffff;
  border: 1px solid #333333;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
}

.user-circle {
  width: 20px;
  height: 20px;
  background-color: #ff0000;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff0000;
}

.left-sidebar {
  width: 300px;
  background: #ffffff;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 2;
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.05);
  transition: transform 0.22s ease;
  position: relative;
}

.left-sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  flex: 1;
}

.sidebar-toggle {
  display: none;
  position: absolute;
  top: 50%;
  right: -16px;
  transform: translateY(-50%);
  z-index: 14;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #ffffff;
  color: #111827;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.sidebar-top {
  display: grid;
  gap: 14px;
  margin-bottom: 4px;
}

.sidebar-logo {
  width: 160px;
  height: auto;
  display: block;
}

.sidebar-back {
  width: fit-content;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}

.sidebar-back:hover {
  background: #f8fafc;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.sidebar-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.sidebar-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
}

.quest-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 10px;
}

.quest-item {
  border: 2px solid var(--quest-accent, rgba(15, 23, 42, 0.08));
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--quest-accent-soft, #ffffff);
}

.quest-item--unlocked {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.quest-item h4 {
  margin: 0 0 4px;
  font-size: 13px;
  color: #111827;
}

.quest-item p {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.quest-item--active {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

.quest-status {
  margin-top: 6px;
  font-size: 12px;
  color: #111827;
}

.quest-status-unlocked {
  margin-top: 8px;
  display: inline-block;
  border: 1px solid var(--quest-accent, var(--accent));
  background: var(--quest-accent-soft, var(--accent-soft));
  color: var(--quest-accent, var(--accent));
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.quest-action {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #111827;
  color: #ffffff;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.quest-cancel {
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: #ffffff;
  color: #111827;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.button-create-quest {
  background: var(--accent);
  border: 1px solid rgba(15, 23, 42, 0.12);
  width: 170px;
  height: 48px;
  border-radius: 12px;
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.18);
  position: fixed;
  right: 50px;
  bottom: 50px;
}

.button-create-quest:hover {
  transform: translateY(-1px);
}

.button-create-quest:focus-visible,
.sidebar-back:focus-visible,
.quest-status-unlocked:focus-visible,
.modal-close-icon:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  .left-sidebar {
    width: 270px;
  }

  .button-create-quest {
    right: 24px;
    bottom: 24px;
  }
}

@media (max-width: 820px) {
  body.mobile-sidebar-scroll-lock {
    overflow: hidden;
  }

  .sidebar-toggle {
    display: inline-grid;
    place-items: center;
  }

  .left-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: min(82vw, 320px);
    overflow: visible;
    transform: translateX(calc(-100% + 18px));
    z-index: 12;
  }

  .left-sidebar-content {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .left-sidebar-content::-webkit-scrollbar {
    display: none;
  }

  .left-sidebar.sidebar-open {
    transform: translateX(0);
  }

  #map {
    width: 100%;
  }
}

.modal-close-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  border-radius: 999px;
  color: #111827;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
