:root {
  --bg: #08131e;
  --panel: rgba(9, 22, 35, 0.74);
  --panel-border: rgba(139, 184, 214, 0.22);
  --text: #e9f5ff;
  --muted: #a7bfd0;
  --accent: #59d5c2;
  --accent-strong: #23c0a9;
  --warning: #ffca6e;
  --best: rgba(89, 213, 194, 0.18);
  --match: rgba(89, 213, 194, 0.1);
  --no-match: rgba(255, 255, 255, 0.04);
  --danger: #ff7f7f;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% -20%, #1e3f63 0%, transparent 55%),
    radial-gradient(900px 500px at 95% 10%, #0f6e74 0%, transparent 60%),
    linear-gradient(180deg, #061019 0%, #08131e 100%);
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.4;
  pointer-events: none;
}

.bg-glow-a {
  width: 240px;
  height: 240px;
  background: #4e8bd8;
  top: 14vh;
  left: -40px;
}

.bg-glow-b {
  width: 260px;
  height: 260px;
  background: #25cdb4;
  right: -60px;
  top: 32vh;
}

.app-shell {
  width: min(1050px, 100% - 2rem);
  margin: 1.6rem auto 2rem;
  display: grid;
  gap: 1rem;
}

.hero {
  padding: 1rem 0.2rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  font-size: 0.75rem;
}

h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  line-height: 1.1;
}

.subhead {
  margin: 0.45rem 0 0;
  color: var(--muted);
  max-width: 64ch;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.controls,
.summary {
  padding: 1rem;
}

.split {
  display: grid;
  grid-template-columns: auto minmax(80px, 120px) auto minmax(80px, 120px);
  gap: 0.55rem;
  align-items: center;
}

label,
.group-title {
  color: var(--muted);
  font-size: 0.92rem;
}

input[type="number"] {
  width: 100%;
  border: 1px solid rgba(167, 191, 208, 0.28);
  border-radius: 10px;
  background: rgba(7, 20, 30, 0.82);
  color: var(--text);
  font: inherit;
  padding: 0.45rem 0.55rem;
}

.control-group + .control-group {
  margin-top: 0.8rem;
}

.direction-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.5rem;
}

.direction-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.42rem 0.15rem;
  border: 1px solid rgba(167, 191, 208, 0.26);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.83rem;
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s ease;
}

.direction-chip.selected {
  background: rgba(89, 213, 194, 0.18);
  border-color: rgba(89, 213, 194, 0.6);
  color: var(--text);
}

.control-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 1rem;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  color: #052019;
  background: linear-gradient(135deg, var(--accent) 0%, #7af4d0 100%);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(167, 191, 208, 0.28);
}

.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
}

.summary strong {
  color: var(--warning);
}

.forecast {
  display: grid;
  gap: 0.85rem;
}

.day-card {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(6, 18, 30, 0.65);
  overflow: hidden;
}

.day-card.best-day {
  border-color: rgba(89, 213, 194, 0.72);
  box-shadow: inset 0 0 0 1px rgba(89, 213, 194, 0.45);
}

.day-header {
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
}

.day-title {
  font-weight: 600;
}

.day-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.best-chip {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: #041f17;
  background: linear-gradient(140deg, #7ef0d4, #56dbbe);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.day-hours {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.45rem;
  padding: 0.7rem;
}

.hour-row {
  border-radius: 11px;
  border: 1px solid rgba(167, 191, 208, 0.18);
  background: var(--no-match);
  padding: 0.55rem;
  display: grid;
  gap: 0.2rem;
}

.hour-row.match {
  background: var(--match);
  border-color: rgba(89, 213, 194, 0.4);
}

.hour-row.best-hour {
  background: var(--best);
  border-color: rgba(89, 213, 194, 0.78);
}

.hour-time {
  font-size: 0.83rem;
  color: var(--muted);
}

.hour-main {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.speed {
  font-size: 1.06rem;
  font-weight: 600;
}

.dir {
  color: var(--muted);
  font-size: 0.85rem;
}

.hour-tag {
  font-size: 0.73rem;
  color: #8be9db;
  min-height: 0.85rem;
}

.error {
  color: var(--danger);
}

@media (max-width: 820px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .direction-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .summary {
    align-items: flex-start;
  }
}
