:root {
  --bg: #061827;
  --bg2: #08243a;
  --panel: rgba(18, 42, 62, 0.86);
  --panel2: rgba(12, 35, 55, 0.92);
  --border: rgba(84, 160, 220, 0.28);
  --text: #f5f8ff;
  --muted: #aebfd2;
  --blue: #2aa8ff;
  --cyan: #23dcff;
  --green: #55e66e;
  --orange: #ff812c;
  --red: #ff5148;
  --yellow: #ffd33f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(31, 143, 209, 0.26), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(19, 93, 145, 0.25), transparent 36%),
    linear-gradient(180deg, #061827 0%, #03111d 100%);
}

.shell {
  width: min(1500px, calc(100vw - 38px));
  margin: 0 auto;
  padding: 24px 0 18px;
}

.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.weather-icon { font-size: 38px; filter: drop-shadow(0 0 12px rgba(42,168,255,.5)); }
.title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 31px; letter-spacing: .3px; }
.brand p { margin: 4px 0 0; color: #bfd2e5; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 11px;
  background: rgba(20, 100, 76, .65);
  color: #6dff8b; font-weight: 800; font-size: 13px;
  text-transform: uppercase;
}
.badge span { width: 9px; height: 9px; border-radius: 99px; background: var(--green); box-shadow: 0 0 14px var(--green); }
.badge.offline { background: rgba(100,30,30,.55); color: #ff9b96; }
.badge.offline span { background: var(--red); box-shadow: 0 0 14px var(--red); }

.clock-block { text-align: center; }
.clock { font-size: 28px; font-weight: 900; letter-spacing: 1px; }
.date { color: #c9d8e8; margin-top: 3px; }

.update-block { display: flex; justify-content: flex-end; align-items: center; gap: 12px; color: #d1dbe7; }
.spin { color: var(--blue); font-size: 23px; animation: spinSlow 5s linear infinite; }
.icon-btn {
  color: #ddebff; text-decoration: none; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10); padding: 10px 12px; border-radius: 10px;
  font-weight: 800; font-size: 12px;
}
.icon-btn:hover { background: rgba(42,168,255,.18); }

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(20, 46, 68, .93), rgba(8, 30, 49, .94));
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.04);
}
.glow-blue { box-shadow: 0 0 0 1px rgba(35, 174, 255, .15), 0 20px 60px rgba(0,0,0,.25); }

.top-grid { display: grid; grid-template-columns: 1.22fr .9fr; gap: 14px; }
.middle-grid { display: grid; grid-template-columns: .75fr .7fr 1.95fr .85fr 1fr; gap: 14px; margin-top: 14px; }
.bottom-grid { display: grid; grid-template-columns: .92fr repeat(5, 1fr); gap: 0; margin-top: 14px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: rgba(15, 39, 60, .75); }
.bottom-grid .panel { border: none; border-radius: 0; border-right: 1px solid rgba(130, 180, 220, .20); background: transparent; box-shadow: none; }
.bottom-grid .panel:last-child { border-right: none; }

.temp-panel {
  min-height: 375px;
  display: grid;
  grid-template-columns: 140px 1fr 250px;
  align-items: center;
  padding: 34px 32px;
}

.warm-wave {
  position: absolute;
  inset: auto 0 0 0;
  height: 88px;
  background:
    radial-gradient(ellipse at 10% 100%, rgba(255, 130, 37, .7), transparent 50%),
    radial-gradient(ellipse at 65% 100%, rgba(255, 120, 55, .22), transparent 65%),
    linear-gradient(90deg, rgba(255,135,44,.62), rgba(255,135,44,.05));
  filter: blur(.2px);
  opacity: .95;
  animation: wave 7s ease-in-out infinite alternate;
}
.thermo {
  width: 62px; height: 160px; margin: 0 auto; position: relative;
  border: 7px solid #e8f5ff; border-bottom: none; border-radius: 36px 36px 12px 12px;
  filter: drop-shadow(0 0 16px rgba(255,70,50,.35));
}
.thermo::after {
  content:""; position:absolute; left:50%; transform: translateX(-50%); bottom:-38px;
  width:70px; height:70px; border-radius:50%; background:#f4432f; border:7px solid #e8f5ff;
}
.thermo::before {
  content:""; position:absolute; left:50%; transform: translateX(-50%); bottom:-2px;
  width:22px; height:100px; border-radius:14px; background:linear-gradient(#ff5148,#ff812c);
}
.thermo-bulb {
  position:absolute; right:-30px; top:20px; width:18px; height:100px;
  background: repeating-linear-gradient(to bottom, #bcd3e7 0 4px, transparent 4px 20px);
  opacity:.9;
}

.temp-main { text-align: center; position: relative; z-index: 1; }
.panel-label { text-transform: uppercase; letter-spacing: .8px; color:#d6e1ef; font-weight: 800; }
.panel-label.center { margin-bottom: 10px; }
.temperature { font-size: clamp(88px, 11vw, 150px); font-weight: 900; line-height: .92; letter-spacing: -6px; text-shadow: 0 0 22px rgba(255,255,255,.13); }
.temperature .unit { font-size: 40px; letter-spacing: 0; margin-left: 8px; }
.temp-side { position: relative; z-index: 1; border-left: 1px solid rgba(150,190,230,.20); padding-left: 30px; }
.side-metric { padding: 0 0 12px; }
.metric-label { font-size: 15px; font-weight: 900; text-transform: uppercase; }
.metric-value { font-size: 43px; line-height: 1.1; font-weight: 900; margin-top: 9px; }
.metric-value.small { font-size: 34px; }
.metric-value span:last-child { font-size: .52em; }
.orange { color: var(--orange); }
.green { color: var(--green); }
.blue { color: var(--blue); }
.cyan { color: var(--cyan); }
.red { color: var(--red); }
.separator { height: 1px; background: rgba(180,210,235,.16); margin: 12px 0 18px; }

.wind-panel {
  min-height: 375px;
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 22px;
  padding: 28px 28px 24px;
}
.wind-title { position:absolute; left:24px; top:22px; font-weight:900; text-transform: uppercase; letter-spacing:.5px; }
.compass-wrap { display:flex; align-items:center; justify-content:center; min-width: 0; }
.compass {
  width: 260px; height: 260px; border-radius: 50%; position: relative;
  border: 3px solid rgba(113,174,220,.24);
  background: radial-gradient(circle, rgba(15,50,75,.9) 0 53%, rgba(20,60,86,.35) 54% 100%);
  box-shadow: inset 0 0 35px rgba(0,0,0,.45), 0 0 25px rgba(42,168,255,.11);
}
.compass::after { content:""; position:absolute; inset: 58px; border-radius:50%; border:1px dashed rgba(190,220,255,.13); }
.compass-label { position:absolute; font-weight:900; font-size:14px; z-index: 4; }
.n { top:12px; left:50%; transform:translateX(-50%); }
.ne { right:36px; top:42px; }
.e { right:12px; top:50%; transform:translateY(-50%); }
.se { right:34px; bottom:42px; }
.s { bottom:12px; left:50%; transform:translateX(-50%); }
.so { left:32px; bottom:42px; }
.o { left:12px; top:50%; transform:translateY(-50%); }
.no { left:32px; top:42px; }
.ticks span {
  position:absolute; width:1px; height:10px; background:rgba(230,245,255,.85);
  left:50%; top:50%; transform-origin: 0 0;
}
.ticks span.major { height:23px; width:2px; background:rgba(255,255,255,.95); }
.needle {
  position:absolute; left:50%; top:50%; width:30px; height:104px;
  transform-origin: 50% 88px;
  transform: translate(-50%, -88px) rotate(0deg);
  transition: transform 900ms cubic-bezier(.2,.8,.2,1);
  z-index: 6;
  filter: drop-shadow(0 0 10px rgba(42,168,255,.55));
}
.needle::before {
  content:""; position:absolute; left:50%; top:0; transform:translateX(-50%);
  width:0; height:0;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-bottom: 100px solid var(--blue);
  clip-path: polygon(50% 0, 80% 100%, 50% 80%, 20% 100%);
}
.compass-center { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; z-index:7; font-size:44px; font-weight:900; }
.compass-center strong { color: var(--blue); font-size:28px; margin-top:6px; }
.wind-stats { border-left:1px solid rgba(150,190,230,.18); padding-left:24px; display:flex; flex-direction:column; justify-content:center; }
.wind-stat { display:flex; align-items:flex-start; gap:14px; }
.wind-icon { font-size:31px; min-width:36px; filter: drop-shadow(0 0 10px currentColor); }
.stat-label { text-transform:uppercase; font-weight:900; font-size:15px; opacity:.95; }
.stat-value { color:#fff; font-size:32px; font-weight:900; line-height:1.15; margin-top:7px; }
.stat-value span:last-child { font-size:18px; font-weight:500; }
.stat-sub { color:#bfd2e5; font-size:17px; margin-top:3px; }

.small-card { min-height: 250px; padding: 24px; }
.card-title { text-transform:uppercase; font-size:17px; font-weight:900; color:#e6f1ff; letter-spacing:.35px; margin-bottom:20px; }
.ring {
  --pct: 0;
  width: 140px; height: 140px; border-radius: 50%; margin: 12px auto 16px;
  display:flex; align-items:center; justify-content:center;
  background: conic-gradient(var(--blue) calc(var(--pct) * 1%), rgba(80,150,210,.22) 0);
  position:relative;
}
.ring::after { content:""; position:absolute; inset:16px; border-radius:50%; background: #0d2c46; }
.ring span, .ring small { position:relative; z-index:1; font-weight:900; }
.ring span { font-size:38px; }
.ring small { font-size:19px; margin-left:2px; }
.comfort { text-align:center; color:var(--blue); font-size:21px; }
.big-number { font-size:52px; font-weight:900; line-height:1; white-space:nowrap; }
.big-unit { font-size:26px; font-weight:700; margin-top:8px; }
.mini-line { color:var(--blue); font-size:20px; line-height:1.25; }
.mini-line.muted { color:#c4d3e3; font-size:15px; margin-top:12px; }

.chart-panel { padding:24px; min-height:250px; }
.chart-row { display:flex; align-items:center; gap:18px; }
#directionChart { width:100%; height:170px; }
.chart-side { width:92px; font-size:38px; font-weight:900; text-align:center; }
.chart-side strong { display:block; color:var(--blue); }
.chart-panel p { color:#c4d3e3; margin:8px 0 0; font-size:14px; }
.row { display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid rgba(180,210,235,.14); padding:12px 0; gap:10px; }
.row span { color:#d9e5f3; }
.row strong { font-size:16px; }
.uv-number { font-size:61px; line-height:1; color:var(--yellow); font-weight:900; }
.uv-bar { position:relative; height:10px; margin:22px 0; border-radius:99px; background: linear-gradient(90deg, #43e86f, #ffdf39, #ff8d35, #ff3030, #9438ff); }
.uv-bar span { position:absolute; top:50%; width:10px; height:10px; transform:translate(-50%, -50%); border-radius:50%; background:white; box-shadow: 0 0 10px white; left:0%; transition:left 700ms ease; }

.info-card, .spark-card { min-height: 180px; padding: 22px 24px; }
.mini-title { color:#dce8f7; text-transform: uppercase; font-size:14px; margin-bottom:12px; }
.sun-placeholder { color:#c2d4e7; margin-top: 28px; }
.spark-value { font-size:26px; font-weight:900; text-align:center; }
.spark-card canvas { width:100%; height:70px; display:block; margin-top:8px; }
.spark-sub { color:#c3d1e0; text-align:center; }

.footer { display:flex; justify-content:center; gap:10px; align-items:center; color:#92a8bc; margin-top:16px; }
.footer span:last-child { margin-left:auto; }
.dot { width:11px; height:11px; border-radius:50%; background:#2eba64; box-shadow:0 0 12px #2eba64; }

@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes wave { from { transform: translateX(-3%); } to { transform: translateX(3%); } }

@media (max-width: 1150px) {
  .header { grid-template-columns: 1fr; text-align:left; }
  .clock-block { text-align:left; }
  .update-block { justify-content:flex-start; flex-wrap:wrap; }
  .top-grid, .middle-grid { grid-template-columns: 1fr; }
  .temp-panel { grid-template-columns: 90px 1fr; }
  .temp-side { grid-column: 1 / -1; border-left:0; border-top:1px solid rgba(150,190,230,.18); padding-left:0; padding-top:22px; display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
  .temp-side .separator { display:none; }
  .wind-panel { grid-template-columns:1fr; }
  .wind-stats { border-left:0; border-top:1px solid rgba(150,190,230,.18); padding-left:0; padding-top:20px; }
  .bottom-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .shell { width: calc(100vw - 22px); }
  h1 { font-size: 24px; }
  .temp-panel { grid-template-columns: 1fr; padding:24px; }
  .thermo { display:none; }
  .temperature { font-size: 92px; }
  .temp-side { grid-template-columns:1fr; }
  .bottom-grid { grid-template-columns:1fr; }
}
