/* Phase 1: a small, readable HUD and town progression. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 98px;
  height: auto;
  gap: 14px;
  padding-top: 11px;
  padding-bottom: 11px;
}
.status { margin-left: auto; justify-content: flex-end; flex-wrap: wrap; }
.status-meters { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 7px; }
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #d6e5dc;
  border-radius: 999px;
  background: #f4faf1;
  color: #345f64;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.status-pill strong { color: #24546e; font-size: 13px; }
body:not(.has-profile) .status-pill { display: none; }
.town-map { width: 100%; }

.progress-card,
.profile-card {
  border: 2px solid #c9d9cb;
  border-radius: 19px;
  background: #fffaf0;
  box-shadow: 0 5px 0 #dce6d9;
}
.progress-card { margin-top: 26px; padding: 18px 22px; }
.progress-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.progress-heading h3 { margin: 3px 0 8px; color: #285d71; }
.progress-heading > strong { color: #6b816d; font-size: 14px; margin-bottom: 9px; }
#xp-progress { display: block; width: 100%; height: 15px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: #e4eadc; }
#xp-progress::-webkit-progress-bar { border-radius: 999px; background: #e4eadc; }
#xp-progress::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, #71ab79, #b1cc6d); }
#xp-progress::-moz-progress-bar { border-radius: 999px; background: #71ab79; }
.progress-card p { margin: 9px 0 0; font-size: 13px; }

.district-section { margin-top: 30px; }
.district-section .section-heading { margin-bottom: 14px; }
.district-section h3 { margin: 4px 0 3px; color: #285d71; }
.town-directory { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.district-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 108px;
  padding: 12px;
  border: 2px dashed #adc6bb;
  border-radius: 15px;
  background: #f0f3e9;
  color: #345e62;
  text-align: left;
  transition: transform .15s, background .15s;
}
.district-card:hover { transform: translateY(-3px); background: #e6f0e9; }
.district-card:focus-visible { outline: 3px solid #d48958; outline-offset: 2px; }
.district-card strong { font: 800 14px Nunito, system-ui, sans-serif; }
.district-card small { color: #788d81; font-size: 11px; }
.district-icon { font-size: 23px; line-height: 1.2; }
.coming-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 580px;
  margin: 35px auto;
  padding: 42px 25px;
  border: 3px solid #cadbcf;
  border-radius: 24px;
  background: #fff9e9;
  text-align: center;
}
.coming-card > span { font-size: 48px; color: #e0b761; }
.coming-card h3 { color: #285d71; margin: 8px 0; }
.coming-card p { max-width: 360px; }

.profile-card { margin-top: 22px; padding: 21px; }
.profile-intro { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.profile-intro h3 { margin: 4px 0 0; color: #285d71; }
.profile-level { border-radius: 999px; background: #e4eed9; color: #3a6c50; padding: 9px 14px; font-weight: 800; white-space: nowrap; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0 15px; }
.profile-stats > div { display: flex; justify-content: space-between; gap: 8px; padding: 13px 14px; border-radius: 12px; background: #eef3e9; color: #416768; }
.profile-stats span { font-size: 13px; }
.profile-stats strong { color: #285d71; }
.profile-hint { font-size: 13px; margin-bottom: 17px; }
.home-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.home-actions .text-button { border: 2px solid #b9d6d9; }
.home-actions button:disabled { cursor: not-allowed; opacity: .55; }
.home-finances { display: flex; flex-wrap: wrap; gap: 18px; border-top: 1px solid #e3e4d4; margin-top: 19px; padding-top: 14px; color: #647e75; font-size: 13px; }
.home-finances strong { color: #285d71; }

@media (max-width: 900px) {
  .status-person { display: none; }
  .town-directory { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 7px; padding-bottom: 8px; }
  .brand { align-self: flex-start; }
  .status { width: 100%; margin: 0; }
  .status-meters { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .status-meters .coin-pill,
  .status-pill { min-width: 0; padding: 6px 5px; justify-content: center; flex-direction: column; gap: 0; font-size: 10px; line-height: 1.2; }
  .status-meters .coin-pill > span:first-child { display: none; }
  .status-meters .coin-pill strong,
  .status-pill strong { font-size: 12px; }
  .status-meters .coin-pill span:last-child { font-size: 9px; }
  .town-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .district-card { min-height: 99px; }
  .progress-card { padding: 15px; }
  .progress-heading h3 { font-size: 20px; }
  .progress-heading > strong { font-size: 12px; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .profile-stats > div { flex-direction: column; gap: 2px; padding: 10px; }
  .profile-card { padding: 15px; }
  .screen > .section-heading { flex-wrap: wrap; }
  .screen > .section-heading .back-map { white-space: nowrap; font-size: 13px; padding: 8px 11px; }
}
