/* ========================================
   天気予報 & ニュース アプリ
   Ultimate Responsive Design
   RSA-4096 + AES-256 x16 暗号化対応
   ======================================== */

:root {
    /* カラーパレット */
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #f093fb;

    --sunny: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --cloudy: linear-gradient(135deg, #bdc3c7 0%, #2c3e50 100%);
    --rainy: linear-gradient(135deg, #3a7bd5 0%, #3a6073 100%);
    --snowy: linear-gradient(135deg, #e6dada 0%, #274046 100%);
    --stormy: linear-gradient(135deg, #373b44 0%, #4286f4 100%);
    --foggy: linear-gradient(135deg, #606c88 0%, #3f4c6b 100%);

    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-glass: rgba(255, 255, 255, 0.06);
    --bg-glass-hover: rgba(255, 255, 255, 0.1);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(102, 126, 234, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(118, 75, 162, 0.12) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 40px;
}

/* ========================================
   ヘッダー
   ======================================== */
.header {
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    margin: -16px -16px 20px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.6rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-glass);
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.refresh-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.refresh-btn:hover {
    background: var(--bg-glass-hover);
    transform: scale(1.05);
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-btn.loading .refresh-icon {
    animation: spin 1s linear infinite;
}

.refresh-icon {
    width: 20px;
    height: 20px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

/* ========================================
   グラスカード
   ======================================== */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

/* ========================================
   位置情報カード
   ======================================== */
.location-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.2);
}

.location-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.location-icon {
    font-size: 1.8rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.location-info {
    flex: 1;
    min-width: 0;
}

.location-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coordinates {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Consolas', monospace;
}

.location-badge {
    flex-shrink: 0;
}

.realtime-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #4ade80;
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.location-details {
    display: flex;
    gap: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.location-detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detail-icon {
    font-size: 1rem;
}

.accuracy-excellent {
    color: #4ade80;
}

.accuracy-good {
    color: #facc15;
}

.accuracy-low {
    color: #f97316;
}

/* ========================================
   タブナビゲーション
   ======================================== */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.tab-btn:hover {
    background: var(--bg-glass-hover);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.tab-btn.active[data-tab="news"] {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 4px 20px rgba(250, 112, 154, 0.4);
}

.tab-icon {
    font-size: 1.2rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   現在の天気
   ======================================== */
.current-weather {
    position: relative;
    overflow: hidden;
    padding: 28px;
}

.weather-bg-sunny {
    background: var(--sunny);
}

.weather-bg-cloudy {
    background: var(--cloudy);
}

.weather-bg-rainy {
    background: var(--rainy);
}

.weather-bg-snowy {
    background: var(--snowy);
}

.weather-bg-stormy {
    background: var(--stormy);
}

.weather-bg-foggy {
    background: var(--foggy);
}

.current-weather::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 60%;
    height: 120%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.current-weather-content {
    position: relative;
    z-index: 1;
}

.weather-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.weather-left {
    flex: 1;
}

.weather-temp-container {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.weather-temp {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -3px;
}

.weather-unit {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 8px;
}

.weather-condition {
    font-size: 1.3rem;
    font-weight: 500;
    opacity: 0.95;
    margin-bottom: 4px;
}

.weather-feels-like {
    font-size: 0.9rem;
    opacity: 0.75;
}

.weather-right {
    text-align: center;
}

.weather-icon-large {
    font-size: 4.5rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
    margin-bottom: 8px;
}

.weather-high-low {
    display: flex;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
}

.temp-high {
    color: #fbbf24;
}

.temp-low {
    color: #93c5fd;
}

.weather-quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.quick-stat {
    text-align: center;
}

.stat-icon {
    font-size: 1.3rem;
    display: block;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
}

.stat-value small {
    font-size: 0.7rem;
    opacity: 0.8;
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.7;
    display: block;
}

.encryption-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.8;
}

.lock-icon {
    font-size: 0.85rem;
}

/* ========================================
   クイック情報
   ======================================== */
.quick-info-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.info-icon {
    font-size: 1.5rem;
}

.info-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ========================================
   セクションタイトル
   ======================================== */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ========================================
   時間別予報
   ======================================== */
.hourly-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin: 0 -20px;
    padding: 0 20px 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.hourly-scroll::-webkit-scrollbar {
    height: 4px;
}

.hourly-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.hourly-scroll::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}

.hourly-item {
    flex-shrink: 0;
    width: 72px;
    padding: 14px 8px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.hourly-item:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
}

.hourly-item.now {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border-color: rgba(102, 126, 234, 0.4);
}

.hourly-item.night {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.5) 100%);
}

.hourly-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.hourly-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.hourly-temp {
    font-size: 1rem;
    font-weight: 600;
}

.hourly-precip {
    font-size: 0.65rem;
    color: #60a5fa;
    margin-top: 4px;
}

.hourly-precip-empty {
    height: 14px;
}

.hourly-wind {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================
   週間予報
   ======================================== */
.weekly-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.weekly-item {
    display: grid;
    grid-template-columns: 80px 50px 1fr 90px 70px;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.weekly-item:hover {
    background: var(--bg-glass-hover);
}

.weekly-item.today {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

.weekly-item.weekend {
    border-left: 3px solid #f97316;
}

.weekly-day-info {
    display: flex;
    flex-direction: column;
}

.weekly-day {
    font-weight: 600;
    font-size: 0.95rem;
}

.weekly-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.weekly-icon {
    font-size: 1.8rem;
    text-align: center;
}

.weekly-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.weekly-temps {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.temp-high {
    color: #f97316;
}

.temp-low {
    color: #60a5fa;
}

.temp-separator {
    color: var(--text-muted);
}

.weekly-precip {
    font-size: 0.8rem;
    color: #60a5fa;
    text-align: right;
}

.weekly-precip.high {
    color: #3b82f6;
    font-weight: 600;
}

.weekly-precip.medium {
    color: #60a5fa;
}

/* ========================================
   詳細情報グリッド
   ======================================== */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.detail-item .detail-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.detail-info {
    flex: 1;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   日の出・日の入
   ======================================== */
.sun-moon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.sun-moon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
}

.sun-moon-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.sun-moon-time {
    font-size: 1.1rem;
    font-weight: 600;
}

.sun-moon-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   ニュース
   ======================================== */
.news-categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
    scrollbar-width: none;
}

.news-categories::-webkit-scrollbar {
    display: none;
}

.category-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    border: none;
    border-radius: 25px;
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.category-btn:hover {
    background: var(--bg-glass-hover);
}

.category-btn.active {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #1a1a2e;
    border-color: transparent;
    font-weight: 600;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.news-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--bg-glass);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.news-item:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.news-item.featured {
    border-color: rgba(250, 112, 154, 0.3);
}

.news-image {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--bg-card);
    flex-shrink: 0;
}

.news-image-placeholder {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.news-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.news-source {
    padding: 3px 10px;
    background: var(--bg-card);
    border-radius: 12px;
}

.news-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: auto;
}

/* ========================================
   ローディング・エラー
   ======================================== */
.weather-loading,
.news-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    gap: 16px;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: 30px;
}

.error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fca5a5;
}

.error-icon {
    font-size: 1.8rem;
}

.error-retry {
    margin-left: auto;
    padding: 10px 20px;
    background: rgba(239, 68, 68, 0.3);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.error-retry:hover {
    background: rgba(239, 68, 68, 0.5);
}

/* ========================================
   フッター
   ======================================== */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-content {
    margin-bottom: 12px;
}

.firebase-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.status-indicator {
    font-size: 0.6rem;
}

.status-indicator.online {
    color: #22c55e;
}

.status-indicator.offline {
    color: #ef4444;
}

.copyright {
    margin-top: 12px;
    opacity: 0.6;
}

/* ========================================
   レスポンシブ - タブレット
   ======================================== */
@media (min-width: 600px) {
    .app-container {
        padding: 20px;
    }

    .weather-temp {
        font-size: 6rem;
    }

    .weather-icon-large {
        font-size: 5.5rem;
    }

    .details-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .weekly-item {
        grid-template-columns: 90px 60px 1fr 100px 80px;
    }
}

/* ========================================
   レスポンシブ - デスクトップ
   ======================================== */
@media (min-width: 900px) {
    html {
        font-size: 17px;
    }

    .app-container {
        max-width: 900px;
        padding: 24px;
    }

    .header {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        margin: -24px -24px 24px;
        padding: 20px 24px;
    }

    .glass-card {
        padding: 24px;
    }

    .weather-quick-stats {
        gap: 20px;
    }

    .sun-moon-grid {
        gap: 16px;
    }

    .news-item {
        padding: 20px;
    }

    .news-image,
    .news-image-placeholder {
        width: 130px;
        height: 130px;
    }

    .news-title {
        font-size: 1.05rem;
    }
}

/* ========================================
   レスポンシブ - スマホ縦向き
   ======================================== */
@media (max-width: 420px) {
    html {
        font-size: 15px;
    }

    .app-container {
        padding: 12px;
    }

    .header {
        margin: -12px -12px 16px;
        padding: 12px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .glass-card {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .location-header {
        flex-wrap: wrap;
    }

    .location-badge {
        width: 100%;
        margin-top: 8px;
    }

    .weather-temp {
        font-size: 4rem;
    }

    .weather-icon-large {
        font-size: 3.5rem;
    }

    .weather-quick-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .weekly-item {
        grid-template-columns: 65px 40px 1fr 70px;
        padding: 12px;
        gap: 8px;
    }

    .weekly-label {
        display: none;
    }

    .weekly-precip {
        display: none;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .sun-moon-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sun-moon-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px;
        padding: 14px;
    }

    .sun-moon-icon {
        margin-bottom: 0;
    }

    .news-image,
    .news-image-placeholder {
        width: 80px;
        height: 80px;
    }

    .news-description {
        display: none;
    }
}

/* ========================================
   ダークモード固定（既にダーク）
   ライトモード対応はオプション
   ======================================== */
@media (prefers-color-scheme: light) {
    /* ライトモードが必要な場合はここに記述 */
    /* 現在はダークモード固定 */
}

/* ========================================
   アニメーション軽減設定
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   レーダー機能
   ======================================== */
.radar-type-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.radar-type-nav::-webkit-scrollbar {
    display: none;
}

.radar-type-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.radar-type-btn:hover {
    background: var(--bg-glass-hover);
}

.radar-type-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.radar-type-btn.active[data-radar="lightning"] {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.radar-type-btn.active[data-radar="snow"] {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.radar-section {
    padding: 16px;
}

.radar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.radar-time {
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Consolas', monospace;
}

.radar-map {
    width: 100%;
    aspect-ratio: 4/3;
    background: #1a1a1a;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    z-index: 1;
    /* Leafletのために必要 */
}

/* ========================================
   気象警報・注意報
   ======================================== */
.warnings-section {
    margin-bottom: 20px;
    display: none;
    /* デフォルト非表示 */
}

.warning-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.warning-header {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
}

.warning-header.special {
    background: rgba(127, 29, 29, 0.8);
    animation: flash 2s infinite;
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.warning-icon {
    font-size: 1.5rem;
}

.warning-title {
    font-weight: 700;
    font-size: 1rem;
    color: #fecaca;
}

.warning-list {
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.warning-tag {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 特別警報 */
.tag-special {
    background: #7f1d1d;
    color: white;
    border: 1px solid #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* 警報 */
.tag-warning {
    background: #ef4444;
    color: white;
}

/* 注意報 */
.tag-advisory {
    background: #f59e0b;
    color: white;
}

.warning-area-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.warning-no-data {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@keyframes markerPulse {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 2px 20px rgba(239, 68, 68, 0.8);
    }
}

.radar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.radar-control-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--bg-glass);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.radar-control-btn:hover {
    background: var(--bg-glass-hover);
    transform: scale(1.05);
}

.radar-control-btn.play {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: transparent;
}

.radar-control-btn.pause {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: transparent;
}

.radar-slider-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radar-slider {
    width: 100%;
    height: 6px;
    appearance: none;
    background: var(--border-color);
    border-radius: 3px;
    cursor: pointer;
}

.radar-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.radar-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.radar-slider-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* レーダー凡例 */
.legend-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.legend-color {
    width: 20px;
    height: 12px;
    border-radius: 2px;
}

/* 雨雲凡例 */
.legend-rain-1 {
    background: rgba(0, 255, 255, 0.5);
}

.legend-rain-2 {
    background: rgba(0, 200, 255, 0.7);
}

.legend-rain-3 {
    background: rgba(0, 150, 255, 0.8);
}

.legend-rain-4 {
    background: rgba(0, 100, 255, 0.9);
}

.legend-rain-5 {
    background: rgba(255, 255, 0, 0.9);
}

.legend-rain-6 {
    background: rgba(255, 200, 0, 0.9);
}

.legend-rain-7 {
    background: rgba(255, 150, 0, 0.9);
}

.legend-rain-8 {
    background: rgba(255, 0, 0, 0.9);
}

.legend-rain-9 {
    background: rgba(200, 0, 0, 0.9);
}

/* 雷凡例 */
.legend-lightning-1 {
    background: rgba(255, 255, 0, 0.7);
}

.legend-lightning-2 {
    background: rgba(255, 200, 0, 0.8);
}

.legend-lightning-3 {
    background: rgba(255, 100, 0, 0.9);
}

/* 雪凡例 */
.legend-snow-1 {
    background: rgba(200, 220, 255, 0.5);
}

.legend-snow-2 {
    background: rgba(150, 190, 255, 0.7);
}

.legend-snow-3 {
    background: rgba(100, 150, 255, 0.9);
}

/* 雷情報 */
.lightning-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.lightning-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.1) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.lightning-item .item-icon {
    font-size: 2rem;
}

.lightning-item .item-info {
    flex: 1;
}

.lightning-item .item-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.lightning-item .item-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 雪情報 */
.snow-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.snow-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(8, 145, 178, 0.1) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.snow-item .item-icon {
    font-size: 2rem;
}

.snow-item .item-info {
    flex: 1;
}

.snow-item .item-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.snow-item .item-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* レーダータブのアクティブスタイル */
.tab-btn.active[data-tab="radar"] {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

/* レスポンシブ - レーダー */
@media (max-width: 600px) {
    .radar-type-btn {
        min-width: 90px;
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .lightning-grid,
    .snow-grid {
        grid-template-columns: 1fr;
    }

    .radar-controls {
        flex-wrap: wrap;
    }

    .radar-slider-container {
        width: 100%;
        order: 1;
        margin-top: 8px;
    }
}