* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #0d0d0d; color: #e8e8e8; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #1f1f1f;
}
header h1 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: 0.5px; }

/* Weather-letter wordmark: each letter has its own weather glyph + colour */
.wordmark { display: flex; gap: 2px; font-size: 22px; font-weight: 700; letter-spacing: 1px; line-height: 1; }
.wordmark span { position: relative; display: inline-block; padding-top: 20px; }
.wordmark span::before {
  content: attr(data-w);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  font-size: 12px; line-height: 1;
}
.wordmark span:nth-child(1) { color: #f5b400; } /* a — sunny */
.wordmark span:nth-child(2) { color: #4a90d9; } /* r — rainy */
.wordmark span:nth-child(3) { color: #7fd1c4; } /* t — windy */
.wordmark span:nth-child(4) { color: #aeb6bd; } /* w — cloudy */
.wordmark span:nth-child(5) { color: #eef2f5; } /* e — snowy */
.wordmark span:nth-child(6) { color: #8a7fd9; } /* a — stormy */
.wordmark span:nth-child(7) { color: #9aa0a6; } /* t — foggy */
.wordmark span:nth-child(8) { color: #e8825e; } /* h — rainbow */
.wordmark span:nth-child(9) { color: #ffd56b; } /* e — partly sunny */
.wordmark span:nth-child(10) { color: #6a7fd0; } /* r — clear night */
@media (max-width: 420px) {
  .wordmark { font-size: 18px; }
  .wordmark span::before { font-size: 10px; }
}
.settings-link { color: #888; text-decoration: none; font-size: 14px; }
.settings-link:hover { color: #ddd; }
.header-links { display: flex; gap: 16px; align-items: center; }

.guest-banner { background: #1f2a3a; border: 1px solid #2e3f57; color: #cdd8e6; padding: 9px 14px; border-radius: 8px; font-size: 13.5px; text-align: center; }
.guest-banner a { color: #7fb0ff; font-weight: 600; text-decoration: none; }
.guest-banner a:hover { text-decoration: underline; }
.guest-banner.hidden { display: none; }

/* Login page */
body.login { display: flex; align-items: center; justify-content: center; min-height: 100svh; padding: 24px; }
.login-box { text-align: center; max-width: 340px; }
.login-logo { width: 96px; height: 96px; border-radius: 20px; margin-bottom: 18px; }
.login-box h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: 0.5px; }
.login-box .tagline { margin: 0 0 28px; color: #999; font-size: 15px; }
.google-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: #1f1f1f; text-decoration: none;
  padding: 11px 20px; border-radius: 8px; font-size: 15px; font-weight: 500;
}
.google-btn:hover { background: #f0f0f0; }

main { padding: 24px; max-width: 720px; margin: 0 auto; }

/* Main page */
/* Main page fits the viewport: header + image + button on one screen, no scroll.
   Header and button are fixed; the image flexes to fill whatever space is left. */
body.main { min-height: 100svh; display: flex; flex-direction: column; }
body.main > header { flex: 0 0 auto; }
body.main main { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
/* Image box has an EXPLICIT height (not flex-derived), so the image is forced to scale up to fill it. */
.image-wrap { position: relative; width: 96vw; max-width: 1100px; height: 74svh; display: flex; align-items: center; justify-content: center; }
.image-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 8px; transition: opacity 0.2s; }
body.main .actions { flex: 0 0 auto; }
.spinner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(0,0,0,0.4);
}
.spinner.hidden { display: none; }
.spinner .dot {
  width: 12px; height: 12px; border-radius: 50%; background: #e8e8e8;
  animation: bounce 1.4s infinite ease-in-out both;
}
.spinner .dot:nth-child(1) { animation-delay: -0.32s; }
.spinner .dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

.meta { color: #999; font-size: 14px; text-align: center; min-height: 1em; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
#city-input {
  background: #1a1a1a; color: #e8e8e8; border: 1px solid #444; border-radius: 6px;
  padding: 10px 14px; font-size: 15px; font-family: inherit; width: 280px; max-width: 70vw;
}
#city-input::placeholder { color: #666; }
#city-input:focus { outline: none; border-color: #777; }
button {
  background: #2a2a2a; color: #e8e8e8; border: 1px solid #444; border-radius: 6px;
  padding: 10px 24px; font-size: 15px; cursor: pointer; font-family: inherit;
}
button:hover { background: #353535; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.danger { background: #3a1a1a; border-color: #6a2a2a; color: #ff8a8a; }
button.danger:hover { background: #4a1a1a; }
button.ghost { background: transparent; border: none; color: #777; padding: 8px 6px; font-size: 13px; text-decoration: underline; }
button.ghost:hover { color: #aaa; background: transparent; }
#manage-style { margin-top: 12px; padding: 12px; background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 6px; }
#manage-style p { margin: 0 0 10px 0; }
#manage-style hr { border: none; border-top: 1px solid #2a2a2a; margin: 16px 0; }
#new-style-name {
  background: #2a2a2a; color: #e8e8e8; border: 1px solid #444; border-radius: 6px;
  padding: 8px 10px; font-size: 14px; margin-right: 8px; font-family: inherit; width: 260px; max-width: 70vw;
}
#new-style-name:focus { outline: none; border-color: #777; }
textarea {
  width: 100%; background: #2a2a2a; color: #e8e8e8; border: 1px solid #444; border-radius: 6px;
  padding: 9px 11px; font-size: 14px; font-family: inherit; resize: vertical; margin-bottom: 10px; line-height: 1.4;
}
textarea:focus { outline: none; border-color: #777; }
#clothing-list { margin-bottom: 12px; }
/* Each band is one enclosed card: from-bar on top, outfit in the middle, to-bar on the bottom. */
.band { margin-bottom: 14px; border: 1px solid #333; border-radius: 8px; background: #1c1c1c; overflow: hidden; }
.band:focus-within { border-color: #666; }
.band-temp { font-size: 12px; font-weight: 700; letter-spacing: 0.3px; padding: 6px 11px; }
.band-from { border-bottom: 1px solid #2c2c2c; }
.band-to { border-top: 1px solid #2c2c2c; text-align: right; }
.band-outfit {
  width: 100%; display: block; background: transparent; color: #e8e8e8; border: none;
  padding: 9px 11px; font-size: 13px; font-family: inherit; resize: vertical; line-height: 1.4;
}
.band-outfit:focus { outline: none; }

.error { background: #3a1a1a; color: #ff8a8a; border: 1px solid #5a2a2a; padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.error.hidden, .ok.hidden { display: none; }
.ok { background: #1a3a1a; color: #8aff8a; border: 1px solid #2a5a2a; padding: 10px 14px; border-radius: 6px; font-size: 14px; }

/* Settings page */
body.settings section {
  background: #161616; border: 1px solid #222; border-radius: 8px;
  padding: 18px 20px; margin-bottom: 18px;
}
body.settings h2 { margin: 0 0 12px 0; font-size: 16px; font-weight: 500; }
body.settings p.current { color: #999; font-size: 14px; margin: 0 0 12px 0; }
body.settings p.hint { color: #777; font-size: 13px; margin: 0 0 12px 0; }
body.settings code { background: #222; padding: 2px 6px; border-radius: 3px; font-size: 12px; }
select {
  background: #2a2a2a; color: #e8e8e8; border: 1px solid #444; border-radius: 6px;
  padding: 8px 10px; font-size: 14px; margin-right: 8px; font-family: inherit;
}
input[type=file] {
  color: #999; font-size: 14px; margin-right: 8px;
}
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 12px; }
.face { position: relative; aspect-ratio: 1 / 1; background: #222; border-radius: 4px; overflow: hidden; }
.face img { width: 100%; height: 100%; object-fit: cover; }
.face button {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; padding: 0; line-height: 1;
  background: rgba(0,0,0,0.6); border: 1px solid #555; color: #fff; font-size: 12px;
  border-radius: 50%;
}
