:root {
  --bg: #e9f0ff;
  --card: #f7faff;
  --text: #1e2a45;
  --text-sub: #6c7a96;
  --accent: #4b7bec;
  --shadow: 8px 8px 20px #c8d4f0, -8px -8px 20px #ffffff;
}

body.dark {
  --bg: #1a1a1a;
  --card: #222;
  --text: #f1f1f1;
  --text-sub: #bbbbbb;
  --accent: #4b7bec;
  --shadow: 6px 6px 16px #111, -6px -6px 16px #333;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background 0.3s, color 0.3s;
}

.header {
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1100px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
}

.logo-text-main {
  font-weight: 700;
  font-size: 14px;
}

.logo-text-sub {
  font-size: 11px;
  color: var(--text-sub);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  border: none;
  cursor: pointer;
  font-size: 12px;
  transition: 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.page-title {
  margin-top: 12px;
  font-size: 22px;
  font-weight: 700;
}

.card {
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: 20px;
  padding: 20px;
  margin: 20px 0;
  animation: fadeIn 0.6s ease;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.card-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-subtitle {
  font-size: 11px;
  color: var(--text-sub);
}

.badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(75, 123, 236, 0.12);
  color: var(--accent);
}

.current-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.current-temp {
  font-size: 40px;
  font-weight: bold;
}

.current-meta {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
}

.current-icon {
  font-size: 60px;
}

.current-extra {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.pill {
  border-radius: 999px;
  padding: 8px 10px;
  background: var(--bg);
  box-shadow: inset 4px 4px 10px rgba(0,0,0,0.05), inset -4px -4px 10px rgba(255,255,255,0.7);
  font-size: 11px;
}

.pill-label {
  color: var(--text-sub);
}

.pill-value {
  font-weight: 600;
}

/* タブ */
.tab-header {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  transition: 0.2s;
}

.tab-btn.active {
  background: var(--accent);
  color: white;
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-content.active {
  display: block;
}

/* 風速矢印 */
.wind-arrows {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.wind-arrow {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: center;
  font-size: 20px;
  animation: pulse 1.5s infinite ease-in-out;
}

.wind-arrow.low {
  color: #0984e3;
}

.wind-arrow.mid {
  color: #fdcb6e;
}

.wind-arrow.high {
  color: #d63031;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* 地図（Leaflet） */
.map {
  width: 100%;
  height: 320px;
  border-radius: 20px;
  overflow: hidden;
}

.map-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-sub);
}

/* 週間予報 */
.forecast-list {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.forecast-item {
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow);
  padding: 8px;
  font-size: 11px;
}

/* フッター */
.footer {
  text-align: center;
  padding: 20px;
  color: var(--text-sub);
  font-size: 11px;
}

/* アニメーション */
.fade-in {
  animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* レスポンシブ */
@media (max-width: 720px) {
  .current-main {
    flex-direction: row;
  }
  .forecast-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .current-main {
    flex-direction: column;
    align-items: flex-start;
  }
  .current-icon {
    align-self: flex-end;
  }
}
