*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg: #0a0e1a;
      --surface: rgba(255,255,255,0.05);
      --surface-hover: rgba(255,255,255,0.08);
      --border: rgba(255,255,255,0.1);
      --text: #e8eaf2;
      --muted: rgba(232,234,242,0.5);
      --accent: #7eb8f7;
      --radius: 16px;
    }

    body {
      font-family: 'Inter', sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 2rem 1rem 4rem;
      overflow-x: hidden;
    }

    /* Animated background orbs */
    body::before, body::after {
      content: '';
      position: fixed;
      border-radius: 50%;
      filter: blur(80px);
      opacity: 0.15;
      pointer-events: none;
      z-index: 0;
      animation: drift 12s ease-in-out infinite alternate;
    }
    body::before {
      width: 500px; height: 500px;
      background: radial-gradient(circle, #3a7bd5, transparent);
      top: -100px; left: -100px;
    }
    body::after {
      width: 400px; height: 400px;
      background: radial-gradient(circle, #a855f7, transparent);
      bottom: -50px; right: -50px;
      animation-delay: -6s;
    }

    @keyframes drift {
      from { transform: translate(0, 0); }
      to   { transform: translate(40px, 40px); }
    }

    .container {
      position: relative;
      z-index: 1;
      width: 100%;
      max-width: 520px;
    }

    /* Header */
    header {
      text-align: center;
      margin-bottom: 2rem;
    }
    header h1 {
      font-family: 'Playfair Display', serif;
      font-size: 2rem;
      font-weight: 400;
      letter-spacing: 0.02em;
      color: var(--text);
    }
    header p {
      font-size: 0.8rem;
      color: var(--muted);
      margin-top: 0.25rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    /* API key banner */
    .api-banner {
      background: rgba(255, 200, 80, 0.08);
      border: 1px solid rgba(255, 200, 80, 0.25);
      border-radius: var(--radius);
      padding: 0.75rem 1rem;
      font-size: 0.78rem;
      color: rgba(255,220,120,0.9);
      margin-bottom: 1.25rem;
      line-height: 1.5;
    }
    .api-banner a { color: #fbbf24; }
    .api-banner input {
      width: 100%;
      margin-top: 0.5rem;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,200,80,0.3);
      border-radius: 8px;
      padding: 0.4rem 0.75rem;
      font-size: 0.78rem;
      color: var(--text);
      font-family: 'DM Mono', monospace;
      outline: none;
    }
    .api-banner input::placeholder { color: rgba(232,234,242,0.3); }

    /* Search */
    .search-row {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
    }
    .search-row input {
      flex: 1;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 0.75rem 1.1rem;
      font-size: 1rem;
      color: var(--text);
      font-family: 'Inter', sans-serif;
      outline: none;
      transition: border-color 0.2s, background 0.2s;
    }
    .search-row input::placeholder { color: var(--muted); }
    .search-row input:focus {
      border-color: var(--accent);
      background: var(--surface-hover);
    }
    .btn {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 0.75rem 1rem;
      color: var(--text);
      cursor: pointer;
      font-size: 1.1rem;
      transition: background 0.2s, border-color 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .btn:hover {
      background: var(--surface-hover);
      border-color: var(--accent);
    }
    .btn-search {
      padding: 0.75rem 1.4rem;
      font-size: 0.9rem;
      font-weight: 500;
      color: var(--accent);
      border-color: rgba(126,184,247,0.3);
    }

    /* Main card */
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1.75rem;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    .card + .card { margin-top: 1rem; }

    /* Current weather */
    .weather-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 1.5rem;
    }
    .city-name {
      font-family: 'Playfair Display', serif;
      font-size: 1.8rem;
      font-weight: 700;
      line-height: 1.1;
    }
    .country {
      font-size: 0.75rem;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.1em;
      margin-top: 0.25rem;
    }
    .date-time {
      text-align: right;
      font-size: 0.75rem;
      color: var(--muted);
      line-height: 1.6;
    }

    .weather-main {
      display: flex;
      align-items: center;
      gap: 1.25rem;
      margin-bottom: 1.25rem;
    }
    .weather-icon-big {
      font-size: 4rem;
      line-height: 1;
      filter: drop-shadow(0 0 16px rgba(126,184,247,0.3));
    }
    .temp-block {}
    .temp-big {
      font-family: 'DM Mono', monospace;
      font-size: 3.5rem;
      font-weight: 300;
      line-height: 1;
      letter-spacing: -0.02em;
    }
    .temp-big span {
      font-size: 1.5rem;
      opacity: 0.6;
      vertical-align: top;
      margin-top: 0.4rem;
      display: inline-block;
    }
    .description {
      font-size: 0.9rem;
      color: var(--muted);
      margin-top: 0.3rem;
      text-transform: capitalize;
    }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.75rem;
      margin-top: 1rem;
      padding-top: 1rem;
      border-top: 1px solid var(--border);
    }
    .stat {
      text-align: center;
    }
    .stat-label {
      font-size: 0.65rem;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.1em;
    }
    .stat-value {
      font-family: 'DM Mono', monospace;
      font-size: 1.1rem;
      font-weight: 400;
      margin-top: 0.2rem;
    }
    .stat-unit {
      font-size: 0.65rem;
      opacity: 0.6;
    }

    /* Forecast */
    .forecast-title {
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: var(--muted);
      margin-bottom: 1rem;
    }
    .forecast-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.6rem 0;
      border-bottom: 1px solid var(--border);
    }
    .forecast-row:last-child { border-bottom: none; }
    .forecast-day {
      font-size: 0.85rem;
      width: 80px;
      text-transform: capitalize;
    }
    .forecast-icon { font-size: 1.4rem; width: 36px; text-align: center; }
    .forecast-desc {
      font-size: 0.75rem;
      color: var(--muted);
      flex: 1;
      padding: 0 0.5rem;
      text-transform: capitalize;
    }
    .forecast-temps {
      font-family: 'DM Mono', monospace;
      font-size: 0.85rem;
      text-align: right;
      white-space: nowrap;
    }
    .forecast-temps .min { color: var(--muted); margin-left: 0.5rem; }

    /* Loading & error */
    .loading {
      text-align: center;
      padding: 3rem 1rem;
      color: var(--muted);
    }
    .loading .spinner {
      width: 28px; height: 28px;
      border: 2px solid var(--border);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      margin: 0 auto 1rem;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    .error {
      background: rgba(239,68,68,0.08);
      border: 1px solid rgba(239,68,68,0.2);
      border-radius: var(--radius);
      padding: 1rem 1.25rem;
      font-size: 0.85rem;
      color: #fca5a5;
      text-align: center;
    }

    /* Hidden */
    .hidden { display: none !important; }

    /* Fade in */
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(12px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .fade-in {
      animation: fadeUp 0.4s ease both;
    }
    .fade-in:nth-child(2) { animation-delay: 0.05s; }

    /* Background  condition */
    body.clear   ::before { background: radial-gradient(circle, #f59e0b, transparent); }
    body.rain     { --accent: #93c5fd; }
    body.snow     { --accent: #e0f2fe; }
    body.thunder  { --accent: #a78bfa; }

    .footer {
      margin-top: 2rem;
      font-size: 0.7rem;
      color: rgba(232,234,242,0.2);
      text-align: center;
      letter-spacing: 0.08em;
    }