/* Boss Lookup — mobile-first, dark theme, big tap targets */

:root {
  --bg: #101418;
  --card: #1a2027;
  --card-active: #232c36;
  --text: #e8edf2;
  --muted: #9aa7b4;
  --accent: #4da3ff;
  --accent-dim: #2b6cb0;
  --border: #2a333d;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.app-header h1 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status {
  font-size: 0.85rem;
  color: var(--muted);
}

.status.ok { color: #7ddf9a; }
.status.loading { color: var(--accent); }
.status.error { color: #ff8a8a; }

.btn {
  background: var(--accent-dim);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

.btn:active {
  background: var(--accent);
}

.controls {
  padding: 12px 16px 4px;
}

#searchInput {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  margin-bottom: 10px;
}

#searchInput:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

.filter-row {
  display: flex;
  gap: 8px;
}

.filter-row select {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  min-height: 44px;
}

.power-row {
  margin-top: 8px;
}

.power-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.power-field input {
  width: 100%;
  padding: 10px 8px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  min-height: 44px;
}

.power-field input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

.count {
  margin: 8px 0 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.server-pill {
  display: inline-block;
  font-size: 0.55em;
  font-weight: 600;
  vertical-align: middle;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  letter-spacing: 0.02em;
}

.btn.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.type-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px 12px;
  margin: 10px 0 0;
}

.type-group legend {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0 6px;
}

.type-group .hint {
  font-size: 0.75rem;
}

.type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.type-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 44px;
}

.type-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  margin: 0;
}

.type-check:has(input:checked) {
  border-color: var(--accent);
  background: var(--card-active);
}

.loc-row {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.loc-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loc-row input {
  width: 90px;
  padding: 10px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  min-height: 44px;
}

.loc-row input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

.notice {
  margin-top: 10px;
  background: #2a2417;
  border: 1px solid #8a6d2f;
  color: #f0d9a0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px;
  text-decoration: underline;
}

.badge.dist {
  background: #2f5d3a;
}

.results {
  padding: 4px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text);
  cursor: pointer;
  min-height: 64px;
  font-size: 1rem;
}

.card:active {
  background: var(--card-active);
}

.card-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.card-type {
  font-weight: 700;
  font-size: 1.05rem;
}

.card-coords {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.card-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}

.badge {
  background: var(--accent-dim);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.extra {
  color: var(--muted);
  font-size: 0.8rem;
}

.copy-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
  font-style: italic;
}

.empty,
.error-card {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
}

.error-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

.error-card strong {
  color: #ff8a8a;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: #2b3540;
  color: var(--text);
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  font-size: 0.95rem;
  max-width: 90vw;
  text-align: center;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-footer {
  padding: 8px 16px 24px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-links a {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 4px;
}

/* Auth pages (login / admin) — dark theme */
.auth-wrap {
  max-width: 24rem;
  margin: 10vh auto 0;
  padding: 0 1rem;
}

.auth-wrap h1 {
  margin-bottom: 0.25rem;
}

.hero {
  display: block;
  width: 100%;
  max-height: 26rem;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.auth-wrap p.sub {
  margin-top: 0;
  color: var(--muted);
}

.auth-field {
  margin: 0.9rem 0;
}

.auth-field label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.auth-field input,
.auth-field select {
  width: 100%;
  padding: 0.65rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-sizing: border-box;
}

.auth-msg {
  min-height: 1.4em;
  margin: 0.5rem 0;
}

.auth-msg.ok { color: #7ddf9a; }
.auth-msg.err { color: #ff8a8a; }

.admin-wrap {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1rem;
}

table.users {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

table.users th,
table.users td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--border);
}

.card-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1rem;
  margin: 1.2rem 0;
}

.card-box h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.btn.danger {
  background: #7a2e2e;
}

.top-links {
  margin-bottom: 1rem;
}

.top-links a {
  color: var(--accent);
  font-weight: 600;
}
