:root {
  --color-bg: #0c1824;
  --color-text: #e8e4dc;
  --color-text-dim: rgba(200,190,170,0.5);
  --color-text-muted: rgba(200,190,170,0.3);
  --color-accent-gold: rgba(220,180,100,0.9);
  --color-accent-warm: rgba(180,140,70,0.15);
  --color-glass: rgba(8, 14, 22, 0.8);
  --color-border: rgba(180,160,120,0.06);
  --color-bar-base: rgba(120,90,50,0.6);
  --color-bar-top: rgba(200,160,80,0.8);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'DM Mono', monospace;
  --blur: blur(10px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

/* -- UTILITIES -------------------------------------------- */
.glass {
  background: var(--color-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

/* -- CANVAS ----------------------------------------------- */
#canvas-wrap { position: fixed; inset: 0; z-index: 0; }

/* -- APP SHELL -------------------------------------------- */
#app {
  position: relative; z-index: 10;
  height: 100vh;
  display: flex; flex-direction: column;
  pointer-events: none;
}
#app > * { pointer-events: auto; }

/* -- HEADER ----------------------------------------------- */
header {
  text-align: center;
  padding: 20px 16px 14px;
}
header h1 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 300; letter-spacing: 0.2em;
  color: rgba(232,228,220,0.9);
}
.header-latin {
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 0.18em;
  color: rgba(200,190,170,0.45); margin-top: 2px; font-style: italic;
}

/* -- TABS ------------------------------------------------- */
#tab-bar {
  display: flex; justify-content: center;
  gap: 2px; margin: 0 16px; padding: 3px;
  background: rgba(12, 24, 36, 0.5);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: 8px;
}
.tab {
  flex: 1; max-width: 110px; padding: 7px 0;
  background: transparent; border: none; border-radius: 6px;
  color: rgba(200,190,170,0.4);
  font-family: var(--font-mono);
  font-size: 10px; cursor: pointer;
  transition: all 0.2s; letter-spacing: 0.3px;
}
.tab.active {
  background: rgba(180,140,70,0.15);
  color: rgba(220,180,100,0.9);
}
.tab:hover:not(.active) { color: rgba(200,190,170,0.6); }

/* -- MAIN ------------------------------------------------- */
main {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 12px 16px;
  pointer-events: none;
  min-height: 0; gap: 12px;
}
main > * { pointer-events: auto; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
main.tab-enter { animation: fadeIn 0.18s ease-out both; }

/* -- NAV ROW (shared by night + week) -------------------- */
.night-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 18px;
}
.night-info { text-align: center; min-width: 140px; }
.night-date {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 300;
  color: rgba(255,250,240,0.92); letter-spacing: 0.06em;
}
.night-moon { font-size: 16px; vertical-align: middle; }
.night-sub { font-size: 10px; color: rgba(200,190,170,0.5); margin-top: 2px; }
.nav-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(30,25,18,0.6);
  border: 1px solid rgba(180,160,120,0.2);
  color: rgba(220,200,160,0.8); font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; -webkit-tap-highlight-color: transparent;
}
.nav-btn:hover, .nav-btn:active {
  background: rgba(60,45,25,0.6);
  border-color: rgba(200,170,100,0.4);
}
.nav-btn:disabled {
  opacity: 0; pointer-events: none;
}

/* -- CHART (night view) ----------------------------------- */
.chart {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 4px; width: 100%; max-width: 420px; height: 160px;
}
.col {
  flex: 1; max-width: 48px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.col-bar-wrap {
  width: 100%; height: 110px;
  display: flex; align-items: flex-end; justify-content: center;
}
.col-bar {
  width: 55%; min-width: 12px;
  border-radius: 12px 12px 4px 4px;
  position: relative;
  box-shadow: 0 0 10px rgba(180,130,60,0.1);
}
.col-bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, transparent 40%, rgba(255,255,255,0.06));
  border-radius: inherit;
}
.col-count {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 500; color: rgba(255,252,240,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  white-space: nowrap;
}
.col-bar-empty {
  width: 55%; min-width: 12px; height: 3px;
  border-radius: 2px; background: rgba(180,160,120,0.1);
}
.col-hour { font-size: 9px; color: rgba(200,190,170,0.5); }
.col-icon { font-size: 11px; }
.col-temp {
  font-family: var(--font-mono);
  font-size: 9px; color: rgba(200,190,170,0.5);
}
.col-wind {
  font-family: var(--font-mono);
  font-size: 9px; color: rgba(200,190,170,0.35);
}

/* -- WEEK VIEW -------------------------------------------- */
.week-rows { width: 100%; max-width: 360px; }
.week-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 3px; padding: 4px 6px; border-radius: 5px;
}
.week-dt {
  font-family: var(--font-mono);
  font-size: 9px; color: rgba(200,190,170,0.4); width: 40px; flex-shrink: 0;
}
.week-mn { font-size: 11px; width: 18px; text-align: center; }
.week-bg {
  flex: 1; height: 22px;
  background: rgba(100,85,55,0.1); border-radius: 8px; overflow: hidden;
}
.week-fill {
  height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, rgba(120,90,50,0.4), rgba(200,160,80,0.65));
  display: flex; align-items: center; justify-content: flex-end; padding-right: 6px;
}
.week-ct { font-size: 8px; color: rgba(255,250,240,0.75); }
.week-weather {
  font-family: var(--font-mono);
  font-size: 8px; color: rgba(200,190,170,0.35);
  white-space: nowrap; flex-shrink: 0;
}

.week-summary {
  width: 100%; max-width: 360px;
  padding: 8px 10px; margin-top: 4px;
  background: rgba(30,25,18,0.35);
  border-radius: 8px; border: 1px solid rgba(180,160,120,0.06);
}
.week-sum-title {
  font-family: var(--font-mono);
  font-size: 7px; color: rgba(200,190,170,0.25);
  letter-spacing: 1.5px; margin-bottom: 5px;
}
.week-corr { display: flex; gap: 12px; }
.week-corr-item { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.week-corr-ic { font-size: 12px; }
.week-corr-txt { font-size: 9px; color: rgba(200,190,170,0.45); }

/* -- SOORT VIEW ------------------------------------------- */
.soort-card {
  width: 100%; max-width: 340px;
  background: rgba(10,14,20,0.75);
  border-radius: 12px; border: 1px solid rgba(180,160,120,0.08);
  padding: 14px;
}
.soort-top { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.soort-emoji { font-size: 22px; }
.soort-name { font-family: var(--font-display); font-size: 18px; font-weight: 300; color: rgba(232,228,220,0.9); }
.soort-lat {
  font-family: var(--font-mono);
  font-size: 9px; color: rgba(200,190,170,0.4); font-style: italic;
}
.soort-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.soort-stat {
  padding: 5px 7px; background: rgba(180,160,120,0.04); border-radius: 5px;
}
.soort-stat-lbl {
  font-family: var(--font-mono);
  font-size: 7px; color: rgba(200,190,170,0.3); letter-spacing: 1px;
}
.soort-stat-val { font-size: 11px; color: rgba(232,228,220,0.65); }
.soort-sec { margin-bottom: 6px; }
.soort-sec-lbl {
  font-family: var(--font-mono);
  font-size: 8px; color: rgba(200,150,80,0.6); letter-spacing: 1px;
}
.soort-sec-txt { font-size: 11px; color: rgba(232,228,220,0.75); line-height: 1.5; margin-top: 1px; }
.soort-recog {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 4px;
}
.soort-recog-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 7px; background: rgba(180,160,120,0.04); border-radius: 5px;
}
.soort-recog-ic { font-size: 14px; flex-shrink: 0; }
.soort-recog-txt { font-size: 10px; color: rgba(232,228,220,0.65); line-height: 1.3; }

.soort-cons-section {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(90,158,75,0.08);
}
.soort-cons-lbl {
  font-family: var(--font-mono);
  font-size: 7px; color: rgba(90,158,75,0.5); letter-spacing: 1px; margin-bottom: 3px;
}
.soort-cons-txt { font-size: 10px; color: rgba(232,228,220,0.4); line-height: 1.4; }

/* -- FOOTER ----------------------------------------------- */
footer {
  padding: 10px 16px 12px;
}
.footer-timeline {
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.tl-pips {
  display: flex; align-items: flex-end; gap: 2px; height: 24px;
}
.tl-pip {
  flex: 1; border-radius: 2px 2px 0 0;
  background: rgba(180,140,70,0.2);
  cursor: pointer; transition: all 0.2s; min-width: 3px;
}
.tl-pip.active {
  background: rgba(220,175,90,0.85);
  box-shadow: 0 0 6px rgba(200,150,60,0.25);
}
.tl-pip.range {
  background: rgba(220,175,90,0.45);
}
.tl-pip:hover:not(.active) { background: rgba(180,140,70,0.45); }
.tl-labels {
  display: flex; justify-content: space-between; margin-top: 2px;
}
.tl-labels span {
  font-family: var(--font-mono);
  font-size: 8px; color: rgba(200,190,170,0.25);
}
.footer-stats {
  display: flex; justify-content: center; gap: 20px;
  pointer-events: auto;
}
.stat-item {
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.stat-num { font-size: 16px; font-weight: 200; color: rgba(220,200,160,0.85); }
.stat-lbl {
  font-family: var(--font-mono);
  font-size: 7px; color: rgba(200,190,170,0.35);
  letter-spacing: 0.1em; margin-top: 1px;
}
.footer-credit {
  text-align: center; padding: 6px 0 0; margin-top: 6px;
  font-size: 9px; color: rgba(200,190,170,0.2);
  border-top: 1px solid rgba(180,160,120,0.04);
  pointer-events: auto;
}
.footer-credit a { color: rgba(220,180,100,0.4); text-decoration: none; }
.footer-credit a:hover { color: rgba(220,180,100,0.8); }

/* -- RESPONSIVE ------------------------------------------- */
@media (max-width: 480px) {
  .night-date { font-size: 18px; }
  .chart { gap: 2px; height: 130px; }
  .col-bar-wrap { height: 90px; }
  .footer-stats { gap: 14px; }
  .stat-num { font-size: 14px; }
  .nav-btn { width: 28px; height: 28px; font-size: 11px; }
}
@media (min-height: 800px) {
  .chart { height: 200px; }
  .col-bar-wrap { height: 150px; }
}
