﻿@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;600&display=swap');

:root {
  --ink: #d9f7e7;
  --ink-dim: #a7c7bb;
  --bg-1: #07080c;
  --bg-2: #0f1016;
  --accent: #f0d39a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink);
  background: #000;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 800px at 10% 10%, #111827 0%, transparent 60%),
    radial-gradient(900px 700px at 90% 20%, #0b1326 0%, transparent 65%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  opacity: 1;
}

.wrap {
  max-width: 2560px;
  margin: 0 auto;
  padding: 24px 8px 80px;
}

pre {
  margin: 0;
  white-space: pre;
  font-size: clamp(10px, 1.4vw, 16px);
  line-height: 1.25;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.ascii-title {
  text-align: center;
  color: var(--ink);
  margin-bottom: 24px;
}

.ascii-banner {
  display: block;
  width: 100%;
  background: transparent;
  color: var(--ink);
  padding: 0;
  border: none;
  text-shadow: none;
  font-size: 7px;
  line-height: 1.0;
  text-align: left;
  overflow: hidden;
}

.section {
  margin-top: 28px;
}

.section.center {
  text-align: center;
}

.section-label {
  font-weight: 600;
  color: var(--ink-dim);
  margin: 0 0 12px;
  letter-spacing: 0.08em;
  font-size: clamp(11px, 1.1vw, 14px);
}

.ascii-box {
  display: inline-block;
  color: var(--ink);
  overflow-x: auto;
  padding-bottom: 6px;
  text-align: left;
  max-width: 100%;
}

.ascii-full {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

#about-box,
#weather-hud,
#weather-anim,
#weather-forecast {
  text-align: left;
}

.weather-controls {
  display: flex;
  gap: 8px;
  width: 100%;
  align-items: center;
  margin: 0 0 8px;
}

.weather-input {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(2, 10, 16, 0.75);
  color: var(--ink);
  border: 1px solid #385046;
  padding: 8px 10px;
  font: inherit;
}

.weather-input::placeholder {
  color: #86a79a;
}

.weather-btn {
  flex: 0 0 auto;
  background: rgba(8, 15, 24, 0.8);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
}

.weather-btn:hover {
  color: #fff6d4;
}

.weather-results {
  width: 100%;
  min-height: 88px;
  background: rgba(2, 10, 16, 0.78);
  color: var(--ink);
  border: 1px solid #385046;
  font: inherit;
  margin: 0 0 10px;
}

.weather-anim {
  font-size: clamp(8px, 0.72vw, 11px);
  line-height: 1.02;
  min-height: 220px;
  max-height: 420px;
  overflow: hidden;
  text-shadow: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 6px;
  row-gap: 14px;
  justify-content: stretch;
  min-width: 0;
}

.ascii-card {
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  width: 100%;
  justify-self: stretch;
  min-width: 0;
  overflow: hidden;
}

.ascii-card:hover {
  color: #ffffff;
  transform: translateY(-2px);
}

.ascii-card-title,
.ascii-card-cta {
  font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  font-size: clamp(13px, 1.35vw, 18px);
  line-height: 1.1;
}

.ascii-card-title {
  margin: 0 0 6px;
}

.ascii-card-cta {
  margin: 6px 0 0;
}

.ascii-card-inner {
  display: block;
  white-space: pre;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  font-size: 6px;
  line-height: 1.0;
}

.ascii-note {
  color: var(--ink-dim);
  display: inline-block;
  text-align: left;
  max-width: 100%;
  overflow-x: auto;
}

.player {
  position: fixed;
  inset: 0;
  background: #000;
  display: none;
  flex-direction: column;
  z-index: 50;
}

.player.show {
  display: flex;
}

.player-ascii {
  color: var(--accent);
  text-align: center;
  padding-top: 12px;
  pointer-events: none;
}

.player-close {
  position: absolute;
  top: 18px;
  right: 24px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: inherit;
  font-size: 14px;
  padding: 6px 10px;
  cursor: pointer;
}

.player-frame {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 100%;
  height: 100%;
}

.player-output {
  margin: 0;
  white-space: pre;
  font-size: 3px;
  line-height: 0.9;
  color: var(--ink);
  display: block;
  width: 100%;
  text-align: left;
}

.player-hidden-video {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 680px) {
  .player-frame {
    padding: 0;
  }
}

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

  .weather-controls {
    flex-wrap: wrap;
  }

  .weather-input {
    flex: 1 1 100%;
  }

  .weather-btn {
    flex: 1 1 calc(50% - 4px);
  }

  .weather-anim {
    min-height: 160px;
    max-height: 300px;
  }
}

/* Phone/tablet (touch): make top banner dense + make player output full-width. */
@media (pointer: coarse) and (max-width: 920px) {
  .ascii-banner {
    font-size: 2px;
    line-height: 1.0;
  }

  .player-output {
    flex: 1 1 auto;
  }

  .weather-anim {
    font-size: 7px;
    line-height: 1.0;
  }
}
