/* ================================================
   Mantrailing Tracker – Stylesheet
   ================================================ */

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

:root {
  --color-hider:        #1D9E75;
  --color-hider-light:  #E1F5EE;
  --color-hider-dark:   #0F6E56;
  --color-seeker:       #378ADD;
  --color-seeker-light: #E6F1FB;
  --color-seeker-dark:  #185FA5;
  --color-danger:       #D85A30;
  --color-danger-dark:  #993C1D;
  --color-score-good:   #1D9E75;
  --color-score-mid:    #BA7517;
  --color-score-bad:    #D85A30;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
}

body {
  font-family: 'Georgia', serif;
  background: #f7f5f0;
  color: #1a1a1a;
  min-height: 100vh;
  padding: 1rem;
}

#mt {
  max-width: 860px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  border: 0.5px solid #ddd;
  padding: 1.5rem;
}

/* ── Header ── */
.mt-header {
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 0.5px solid #e0ddd6;
  margin-bottom: 1.5rem;
}
.mt-header h1 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: #1a1a1a;
}
.mt-header p {
  font-size: 12px;
  color: #888;
  margin-top: 3px;
}

/* ── Tabs ── */
.tab-bar {
  display: flex;
  border-bottom: 0.5px solid #e0ddd6;
  margin-bottom: 1.5rem;
}
.tab {
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
  color: #888;
  border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab.active {
  color: var(--color-hider);
  border-bottom-color: var(--color-hider);
  font-weight: 500;
}
.count-badge {
  font-size: 11px;
  background: #f0ede8;
  border-radius: 10px;
  padding: 1px 7px;
  color: #666;
}

/* ── Card ── */
.card {
  background: #fff;
  border: 0.5px solid #e0ddd6;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 12px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 0.5px solid #bbb;
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: #1a1a1a;
  transition: background 0.12s;
}
.btn:hover { background: #f5f3ee; }
.btn.primary { background: var(--color-hider); color: #fff; border-color: var(--color-hider); }
.btn.primary:hover { background: var(--color-hider-dark); }
.btn.danger  { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn.danger:hover  { background: var(--color-danger-dark); }
.btn.info    { background: var(--color-seeker); color: #fff; border-color: var(--color-seeker); }
.btn.info:hover    { background: var(--color-seeker-dark); }
.btn.sm      { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Form ── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
}
input[type=text] {
  width: 100%;
  padding: 8px 12px;
  border: 0.5px solid #bbb;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
input[type=text]:focus { border-color: var(--color-hider); }

/* ── Role selector ── */
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 420px;
  margin: 0.5rem auto;
}
.role-card {
  border: 0.5px solid #ccc;
  border-radius: var(--radius-md);
  padding: 1.2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.role-card:hover { background: #f5f3ee; }
.role-card.active-hider { border: 2px solid var(--color-hider); background: var(--color-hider-light); }
.role-card.active-seeker { border: 2px solid var(--color-seeker); background: var(--color-seeker-light); }
.role-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.role-title { font-size: 14px; font-weight: 500; }
.role-desc  { font-size: 11px; color: #888; margin-top: 3px; }

/* ── Map ── */
#map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-md);
  border: 0.5px solid #e0ddd6;
  z-index: 0;
}
#report-map {
  width: 100%;
  height: 300px;
  border-radius: var(--radius-sm);
  z-index: 0;
}

/* ── Recording area ── */
.recording-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}
.name-badge { font-weight: 500; color: #1a1a1a; }

/* ── Status bar ── */
.status-bar {
  background: #f5f3ee;
  border: 0.5px solid #e0ddd6;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  color: #888;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
}
.dot.rec  { background: var(--color-danger); animation: pulse 1s infinite; }
.dot.done { background: var(--color-hider); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.point-count { margin-left: auto; font-weight: 500; font-size: 12px; color: #555; }

/* ── Controls ── */
.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ── Route list ── */
.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: #aaa;
  font-size: 13px;
}
.route-list { display: flex; flex-direction: column; gap: 8px; }
.route-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 0.5px solid #e0ddd6;
  border-radius: var(--radius-sm);
  background: #f9f8f5;
}
.route-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 500;
}
.badge-hider  { background: var(--color-hider-light);  color: var(--color-hider-dark); }
.badge-seeker { background: var(--color-seeker-light); color: var(--color-seeker-dark); }
.route-meta { font-size: 13px; font-weight: 500; }
.route-sub  { font-size: 11px; color: #888; }

/* ── Compare ── */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 1rem 0;
}
.select-label { font-size: 11px; color: #888; margin-bottom: 4px; }
.compare-select {
  width: 100%;
  padding: 8px 10px;
  border: 0.5px solid #bbb;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.vs-badge { text-align: center; font-size: 12px; font-weight: 500; color: #888; }

/* ── Report ── */
.report-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}
.report-title { font-size: 16px; font-weight: 500; }
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.stat-card { padding: 1rem; }
.score-big  { font-size: 48px; font-weight: 500; line-height: 1; margin: 6px 0; }
.score-good { color: var(--color-score-good); }
.score-mid  { color: var(--color-score-mid); }
.score-bad  { color: var(--color-score-bad); }
.stat-sublabel { font-size: 11px; color: #888; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 0.5px solid #e0ddd6;
  font-size: 13px;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: #888; }
.stat-value { font-weight: 500; }

.legend {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: #888;
  flex-wrap: wrap;
  margin-top: 8px;
}
.legend-line {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 4px;
}
.hider-color  { background: var(--color-hider); }
.seeker-color { background: var(--color-seeker); border-top: 2px dashed var(--color-seeker); background: none; height: 0; border-bottom: 2px dashed var(--color-seeker); }

.rating-text { font-size: 13px; line-height: 1.75; color: #1a1a1a; }

/* ── Utility ── */
.center       { text-align: center; }
.section-label {
  font-size: 11px;
  font-weight: 500;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

/* ── Role label pills ── */
.pill-hider  { background: var(--color-hider-light);  color: var(--color-hider-dark);  padding: 2px 9px; border-radius: 10px; font-size: 11px; }
.pill-seeker { background: var(--color-seeker-light); color: var(--color-seeker-dark); padding: 2px 9px; border-radius: 10px; font-size: 11px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .vs-badge { display: none; }
  .role-grid { grid-template-columns: 1fr 1fr; }
}
