:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.hdr {
  padding: 22px 26px 16px;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid #23233a;
  flex-shrink: 0;
}
.hdr-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.hdr-eyebrow {
  font-size: 14px; font-weight: 700; letter-spacing: 2.5px;
  color: var(--accent);
}
.hdr-date { font-size: 15px; color: var(--text-secondary); font-weight: 500; }
.hdr-city { font-size: 32px; font-weight: 700; line-height: 1.1; }

/* ---------- Home ---------- */
.home-body { flex: 1; display: flex; flex-direction: column; padding: 18px 22px; gap: 16px; }

.now-card {
  display: flex; gap: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 1px solid #2a2a40;
}
.now-left, .now-right { flex: 1; display: flex; flex-direction: column; }
.now-right { align-items: flex-end; text-align: right; border-left: 1px solid #2a2a40; padding-left: 16px; }
.now-label { font-size: 12px; letter-spacing: 1.5px; color: var(--text-muted); font-weight: 600; }
.now-height { font-size: 46px; font-weight: 700; line-height: 1; margin-top: 4px; color: var(--accent); }
.now-state { font-size: 17px; margin-top: 6px; color: var(--text-secondary); font-weight: 600; }
.now-state.rising { color: var(--accent-secondary); }
.now-state.falling { color: #ffaa44; }
.next-time { font-size: 40px; font-weight: 700; line-height: 1; margin-top: 4px; }
.next-in { font-size: 16px; margin-top: 6px; color: var(--text-secondary); }

.spark-wrap {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px 22px;
  border: 1px solid #23233a;
}
#spark { display: block; width: 556px; height: 120px; }

.home-nav { display: flex; gap: 12px; margin-top: auto; }
.nav-btn {
  flex: 1; min-height: 88px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  font-family: inherit;
}
.nav-btn-icon { font-size: 26px; color: var(--accent); line-height: 1; }
.nav-btn-label { font-size: 16px; font-weight: 600; }

/* ---------- Chart ---------- */
.chart-body { flex: 1; display: flex; flex-direction: column; padding: 16px 22px; gap: 12px; }
#curve {
  display: block; width: 556px; height: 320px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid #23233a;
}
.chart-legend {
  display: flex; justify-content: center; gap: 24px;
  font-size: 15px; color: var(--text-secondary);
}
.chart-legend b { color: var(--text-primary); font-weight: 700; }

/* ---------- Table ---------- */
.table-body { flex: 1; padding: 14px 22px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.tide-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-height: 64px;
}
.tide-row.next { background: #1a2435; border-color: var(--accent); }
.tide-badge {
  width: 56px; flex-shrink: 0; text-align: center;
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  padding: 6px 0; border-radius: 8px;
}
.tide-badge.high { background: rgba(0,212,255,0.16); color: var(--accent); }
.tide-badge.low { background: rgba(255,170,68,0.16); color: #ffaa44; }
.tide-time { font-size: 26px; font-weight: 700; min-width: 96px; }
.tide-h { font-size: 18px; color: var(--text-secondary); margin-left: auto; }
.tide-tag { font-size: 12px; color: var(--accent); letter-spacing: 1px; font-weight: 700; }

/* ---------- Cities ---------- */
.cities-body { flex: 1; padding: 14px 22px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.city-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0 18px; min-height: 66px;
  color: var(--text-primary);
  font-family: inherit; text-align: left;
}
.city-name { font-size: 20px; font-weight: 600; }
.city-region { font-size: 14px; color: var(--text-muted); margin-left: auto; }
.city-check { color: var(--accent-secondary); font-size: 22px; width: 22px; }

/* ---------- Footer ---------- */
.foot { padding: 16px 22px 22px; flex-shrink: 0; }
.foot-btn {
  width: 100%; min-height: 56px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 17px; font-weight: 600; font-family: inherit;
}
