

:root {
  
  --bg: #0b0b0b;
  --bg-2: #151515;
  --bg-3: #1e1e1e;
  --card: #141414;
  --text: #e6e6e6;
  --muted: #9a9a9a;
  --border: rgba(255, 255, 255, 0.13);
  --accent: #ffffff;
  --accent-2: #9a9a9a;
  --accent-contrast: #000000;
  --ok: #bdbdbd;
  --warn: #8f8f8f;
  --danger: #e6e6e6;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
  --radius: 12px;

  
  --glass: rgba(18, 18, 21, 0.5);
  --glass-strong: rgba(12, 12, 15, 0.72);
  --glass-blur: 20px;
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}


.page-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 2451 / 3467;
  z-index: -1;
  background-color: var(--bg);
  background-image: url("../img/bg/dark.png");
  background-size: 100% 100%;
  background-position: top center;
  background-repeat: no-repeat;
  filter: blur(8px);
}
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0.25;
  pointer-events: none;
}

h1, h2, h3, h4 {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: 0.85em; }


.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 26px rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.12;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 26px; height: 26px;
  flex: 0 0 auto;
}
.brand .mark img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.brand-text { line-height: 1.12; }

.site-nav {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 34px;
}
.nav-link {
  color: var(--muted);
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
.nav-link i { font-size: 0.85em; }
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 0 22px rgba(255, 255, 255, 0.55);
}

.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
#auth-area { display: flex; align-items: center; gap: 8px; }


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: var(--glass-highlight), var(--shadow-sm);
  color: var(--text);
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); box-shadow: var(--glass-highlight), 0 8px 22px rgba(0, 0, 0, 0.45); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: rgba(255, 255, 255, 0.92); color: var(--accent-contrast); box-shadow: var(--glass-highlight), 0 10px 30px rgba(255, 255, 255, 0.16); }
.btn-primary:hover { background: #ffffff; filter: brightness(1.02); }

.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--border); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.btn-danger { background: var(--danger); color: var(--accent-contrast); }
.btn-danger:hover { filter: brightness(1.08); background: var(--danger); }

.btn-sm { padding: 6px 11px; font-size: 0.85rem; border-radius: 8px; }
.btn-block { width: 100%; }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: var(--glass-highlight), var(--shadow-sm);
  color: var(--text);
  border-radius: 10px;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }


.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge-type { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 30%, transparent); }
.badge-documented { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.badge-scouted { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge-status-other { background: var(--bg-3); color: var(--muted); }

.role-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.role-owner { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.role-member { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

.chip {
  display: inline-block;
  padding: 4px 10px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}
.chip.hazard { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 26%, transparent); }


.user-chip { display: flex; align-items: center; gap: 9px; }
a.user-chip {
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background 0.12s ease;
}
a.user-chip:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; gap: 3px; }
.user-name { font-size: 0.85rem; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 5px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input:not([type]), select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text);
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}


input[type="text"], input[type="email"], input[type="password"],
input:not([type]), select, textarea {
  -webkit-appearance: none;
  appearance: none;
}
input[type="text"]:hover, input[type="email"]:hover, input[type="password"]:hover,
input[type="search"]:hover, input:not([type]):hover, select:hover, textarea:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: color-mix(in srgb, var(--border) 55%, var(--accent) 45%);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}
textarea { resize: vertical; min-height: 70px; }
select {
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  padding-right: 32px;
}


input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  width: 16px;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  opacity: 0.75;
}
input[type="search"]::-webkit-search-cancel-button:hover { opacity: 1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }


.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 10, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: var(--glass-highlight), var(--shadow);
  position: relative;
  animation: modal-in 0.18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-title { font-size: 1.25rem; margin: 0 0 16px; }
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  border: none; background: transparent;
  font-size: 1.4rem; line-height: 1;
  cursor: pointer; color: var(--muted);
}
.modal-close:hover { color: var(--text); }


.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100; 
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.auth-gate-inner {
  max-width: 430px;
  width: 100%;
  text-align: center;
  padding: 34px 28px;
  border-radius: 18px;
}
.auth-gate-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  margin-bottom: 18px;
}
.auth-gate h1 { margin: 0 0 8px; font-size: 1.45rem; }
.auth-gate p { margin: 0 0 24px; }
.auth-gate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}
.auth-gate-actions .btn { flex: 1; max-width: 180px; }
.auth-gate .back { display: inline-block; }


@media (max-width: 980px) {
  .site-nav { gap: 24px; }
  .nav-link { font-size: 0.95rem; }
}


@media (max-width: 760px) {
  .site-header {
    gap: 10px;
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
    
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(12, 12, 15, 0.94);
  }
  .brand { font-size: 0.95rem; gap: 7px; }
  .brand .mark { width: 26px; height: 26px; border-radius: 7px; }
  .brand-text { display: none; }
  .hdr-right { gap: 6px; }

  
  .site-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    transform: none;
    display: flex;
    justify-content: space-around;
    gap: 0;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    backdrop-filter: blur(24px) saturate(150%);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
    z-index: 60;
  }
  .nav-link {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    font-size: 0.66rem;
    line-height: 1;
    padding: 5px 2px;
    justify-content: center;
    border-radius: 10px;
    text-align: center;
  }
  .nav-link i { font-size: 1.15rem; }
  .nav-link:active { background: rgba(255, 255, 255, 0.08); }

  
  body:not([data-page="map"]) { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .brand-text { display: none; }
  .user-meta { display: none; }
}


@media (max-width: 760px) {
  .icon-btn { width: 40px; height: 40px; font-size: 1.05rem; border-radius: 11px; }
  .btn-sm { padding: 8px 13px; }
  
  #toast-root { bottom: calc(76px + env(safe-area-inset-bottom)); }
}


#toast-root {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--glass-highlight), var(--shadow-sm);
  font-size: 0.9rem;
  animation: toast-in 0.25s ease;
  max-width: 90vw;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }


.stars { display: inline-flex; gap: 1px; letter-spacing: 0; }
.star { color: color-mix(in srgb, var(--text) 25%, transparent); font-size: 0.9rem; }
.star.on { color: var(--accent); }


.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--glass-highlight), var(--shadow-sm);
}


* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); background-clip: padding-box; }


.hidden { display: none !important; }
[hidden] { display: none !important; }
