/* ================= BASE ================= */
html {
  font-size: 14px;
}

.green {
  background: #b2f167;
}

details.green[open] {
  background: #e1fcc1;
}

.emoji {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  display: inline-block;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: #f3eef2;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: moveGrid 6s linear infinite;
}

@keyframes moveGrid {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 40px -40px, 40px -40px; }
}

/* ================= FLAG ================= */
.flag {
  position: fixed;
  top: 0;
  left: 0;
  width: 96px;
  z-index: 9999;
}

/* ================= CARD ================= */
.card {
  border: 1px solid #cfcfcf;
  border-bottom: 3px solid #000;
  border-radius: 16px;
  background: white;
  padding: 20px;
  transition: 0.2s;
}

.card:hover {
  transform: translateY(-2px);
}

.card > div + div {
  border-top: 1px dashed #ddd;
  padding-top: 12px;
}

/* ================= BUTTON ================= */
.btn {
  background: #b2f167;
  border: 1px solid #000;
  border-bottom: 3px solid #000;
  border-radius: 10px;
  padding: 8px 20px;
  font-weight: 500;
  transition: 0.2s;
}

.btn:hover {
  background: #e1fcc1;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
  border-bottom: 1px solid #000;
}

/* ================= FLASH ================= */
#flash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #f3eef2;
  opacity: 1;
  pointer-events: none;
  z-index: 2147483647;
  transform: translateZ(0);
}

/* ================= TIMELINE ================= */
.overlay {
  position: relative;
}

.overlay::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(0,0,0,0.2);
}

.connector {
  position: absolute;
  left: 27px;
  top: 30px;
  transform: translateX(-55%);
  width: 16px;
  height: 16px;
  background: #b2f167;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 0 4px #f3eef2;
}

.node {
  width: 40px;
  height: 40px;
  background: #b2f167;
  border: 2px solid black;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  flex-shrink: 0;
}

/* ================= PROFILE ================= */
.pfp {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid black;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ================= ICON ================= */
.stat-icon {
  width: 18px;
  height: 18px;
}

/* ================= HUD (MOBILE) ================= */
.hud-card {
  position: fixed;
  bottom: 12px;
  left: 10px;
  right: 10px;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: white;
  border-radius: 16px;
  border: 1px solid #ddd;
  border-top: 1px solid #ddd;
  border-bottom: 3px solid black;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  z-index: 9999;
  will-change: transform;
  transform: translateZ(0);
}

/* Remove the dashed divider that .card adds to children */
.hud-card > div + div {
  border-top: none;
  padding-top: 0;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-info {
  display: flex;
  flex-direction: column;
}

#nameHud {
  font-size: 12px;
  font-weight: 600;
}

.stats {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: #555;
}

.stats span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.hud-right {
  display: flex;
  gap: 8px;
}

/* ================= NAV BUTTON ================= */
.nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #f5f5f5;
  transition: all 0.15s ease;
}

.nav-btn svg {
  width: 18px;
  height: 18px;
  stroke: #333;
  fill: none;
  stroke-width: 2;
}

.nav-btn:hover {
  background: #eaeaea;
  transform: translateY(-2px);
}

.nav-btn:active {
  transform: scale(0.95);
}

.nav-btn.active {
  background: #b2f167;
  border-color: black;
}

/* ── Nav label — hidden on mobile, shown on desktop ── */
.nav-label {
  display: none;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

/* ================= DESKTOP SIDEBAR ================= */
@media (min-width: 768px) {
  .hud-card {
    top: 80px;
    bottom: 80px;
    left: 16px;
    right: auto;
    width: 110px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 16px 10px;
    overflow: hidden;
  }

  .hud-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #nameHud {
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
  }

  .stats { display: none; }

  .hud-left {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .hud-right {
    flex-direction: column;
    gap: 6px;
    width: 100%;
    flex: 1;
    justify-content: flex-start;
    margin-top: 4px;
  }

  .nav-btn {
    width: 100%;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
  }

  .nav-btn svg {
    flex-shrink: 0;
  }

  .nav-btn .nav-label {
    display: inline;
  }
}
