/* ===================================================
   星座占いランキング - Modern Responsive CSS
   =================================================== */

/* CSS Variables */
:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #e94560;
    --gold: #FFD700;
    --silver: #C0C0C0;
    --bronze: #CD7F32;
    --text: #2c2c2c;
    --text-light: #666;
    --bg: #f8f9ff;
    --card-bg: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 32px rgba(0,0,0,0.15);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.3s ease;
    --font-ja: 'Noto Sans JP', sans-serif;
    --font-en: 'Cinzel', serif;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-ja);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ===== HEADER ===== */
.site-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo-star {
    font-size: 2.5rem;
    animation: twinkle 2s infinite alternate;
}
@keyframes twinkle {
    from { opacity: 0.7; transform: scale(1); }
    to   { opacity: 1;   transform: scale(1.1); }
}
.logo-text h1 {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FF6B35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-text p {
    font-size: 0.75rem;
    color: #aaa;
    letter-spacing: 0.1em;
}
.header-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.source-badge, .live-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.source-badge {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
}
.live-badge {
    background: rgba(233,69,96,0.2);
    border: 1px solid rgba(233,69,96,0.5);
    color: #ff6b8a;
}
.pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ff6b8a;
    animation: pulse 1.5s infinite;
    display: inline-block;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

/* ===== DATE NAV ===== */
.date-nav {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}
.date-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}
.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    background: var(--bg);
    border: 2px solid var(--border);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
}
.nav-btn:hover:not(.disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.nav-btn.disabled { opacity: 0.4; cursor: default; }
.current-date {
    text-align: center;
}
.date-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--primary);
}
.date-sub {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
}

/* ===== STATS BAR ===== */
.stats-bar {
    background: linear-gradient(90deg, #1a1a2e, #0f3460);
    color: white;
    padding: 0.75rem 0;
}
.stats-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}
.stat-icon { font-size: 1rem; }
.stat-label { color: #aaa; }
.stat-value { font-weight: 700; color: #FFD700; }

/* ===== SECTION TITLES ===== */
.section-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 2rem;
    color: var(--primary);
    position: relative;
    padding-bottom: 0.75rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #FFD700, #FF6B35);
    border-radius: 2px;
}

/* ===== PODIUM ===== */
.podium-section {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.podium-card {
    background: var(--bg-color, #fff);
    border: 3px solid var(--border-color, #ddd);
    border-radius: var(--radius);
    padding: 1.5rem 1.2rem;
    text-align: center;
    flex: 1;
    min-width: 260px;
    max-width: 340px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.podium-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--border-color, #ddd);
}
.podium-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}
.podium-1 { order: 2; transform: scale(1.05); }
.podium-1:hover { transform: scale(1.05) translateY(-6px); }
.podium-2 { order: 1; }
.podium-3 { order: 3; }
.podium-medal { font-size: 2.5rem; margin-bottom: 0.25rem; }
.podium-rank { font-size: 0.8rem; color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.podium-emoji { font-size: 3rem; margin: 0.5rem 0; }
.podium-symbol { font-size: 1.8rem; color: var(--border-color); margin-bottom: 0.25rem; }
.podium-name { font-size: 1.4rem; font-weight: 900; color: var(--primary); margin-bottom: 0.25rem; }
.podium-dates { font-size: 0.75rem; color: var(--text-light); margin-bottom: 0.75rem; }
.podium-label {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 999px;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.podium-stars { color: #FFD700; font-size: 1.1rem; margin-bottom: 0.75rem; letter-spacing: 2px; }
.podium-fortune {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    text-align: left;
}
.podium-advice {
    background: rgba(0,0,0,0.04);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
    text-align: left;
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
}

/* ===== FILTER TABS ===== */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.tab-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    border: 2px solid var(--border);
    background: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-ja);
    color: var(--text);
}
.tab-btn:hover, .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== RANKING SECTION ===== */
.ranking-section {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.ranking-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 70px 140px 1fr auto;
    gap: 0;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border);
}
.ranking-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}
.ranking-card.hidden { display: none; }

/* Rank column */
.rc-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    padding: 1rem 0.5rem;
    background: #f9f9f9;
    border-right: 1px solid var(--border);
}
.rank-num {
    font-size: 1.8rem;
    font-weight: 900;
}

/* Identity column */
.rc-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    border-right: 1px solid var(--border);
    text-align: center;
    border-left: 4px solid var(--border-color);
}
.rc-emoji { font-size: 2rem; margin-bottom: 0.2rem; }
.rc-symbol { font-size: 1.2rem; color: #666; }
.rc-name { font-size: 1rem; font-weight: 900; color: var(--primary); margin: 0.2rem 0; }
.rc-dates { font-size: 0.7rem; color: var(--text-light); }
.rc-element-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 0.4rem;
}

/* Content column */
.rc-content {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.rc-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.rc-label {
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}
.rc-stars { color: #FFD700; font-size: 0.9rem; letter-spacing: 1px; }
.rc-avg { font-size: 0.75rem; color: var(--text-light); margin-left: auto; }
.rc-fortune {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.65;
    margin: 0;
}
.rc-advice {
    background: #f8f9ff;
    border-left: 3px solid #1a1a2e;
    padding: 0.5rem 0.75rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    font-size: 0.85rem;
}
.advice-label { font-weight: 700; color: var(--primary); white-space: nowrap; }
.advice-text { color: var(--text); }
.rc-lucky {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.lucky-item {
    font-size: 0.78rem;
    color: var(--text-light);
}
.lucky-item strong { color: var(--primary); }

/* Stats mini column */
.rc-stats {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1rem;
    background: #f9f9f9;
    border-left: 1px solid var(--border);
    min-width: 90px;
}
.stat-mini {
    text-align: center;
}
.sm-label { display: block; font-size: 0.65rem; color: var(--text-light); }
.sm-value { display: block; font-size: 0.85rem; font-weight: 700; color: var(--primary); }

/* ===== SOURCES SECTION ===== */
.sources-section {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.source-region {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.region-title {
    font-size: 1rem;
    font-weight: 900;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid currentColor;
}
.source-list { list-style: none; }
.source-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.82rem;
}
.source-item:last-child { border-bottom: none; }
.source-status { font-size: 0.9rem; }
.source-name { flex: 1; color: var(--text); }
.source-lang {
    font-size: 0.65rem;
    background: #eee;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    color: #666;
    font-weight: 700;
}
.sources-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 1rem;
    line-height: 2;
}

/* ===== METHODOLOGY ===== */
.method-section {
    background: var(--primary);
    color: white;
    padding: 3rem 0;
    margin: 3rem 0;
}
.method-section .section-title { color: white; }
.method-section .section-title::after { background: linear-gradient(90deg, #FFD700, #FF6B35); }
.method-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}
.method-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}
.method-card:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-4px);
}
.method-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.method-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; color: #FFD700; }
.method-card p { font-size: 0.85rem; color: #ccc; line-height: 1.6; }

/* ===== FOOTER ===== */
.site-footer {
    background: #0d0d1a;
    color: #aaa;
    padding: 2.5rem 0;
    text-align: center;
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.footer-logo { font-size: 1.3rem; font-weight: 900; color: #FFD700; margin-bottom: 0.75rem; }
.footer-desc { font-size: 0.85rem; margin-bottom: 0.5rem; }
.footer-note { font-size: 0.75rem; color: #666; margin-bottom: 0.5rem; }
.footer-copy { font-size: 0.75rem; color: #555; }

/* ===== BACK TO TOP ===== */
.back-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 50;
}
.back-top.visible { opacity: 1; transform: translateY(0); }
.back-top:hover { background: var(--accent); }

/* ===== LOADING STATE ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,26,46,0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}
.loading-spinner {
    width: 60px; height: 60px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 1rem; color: #ccc; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .ranking-card {
        grid-template-columns: 55px 110px 1fr;
    }
    .rc-stats { display: none; }
}

@media (max-width: 640px) {
    .logo-text h1 { font-size: 1.1rem; }
    .ranking-card {
        grid-template-columns: 50px 1fr;
        grid-template-rows: auto auto;
    }
    .rc-identity {
        grid-column: 2;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    .rc-content { grid-column: 1 / -1; padding: 0.75rem; }
    .rc-stats { display: none; }
    .rc-rank { grid-row: 1 / 3; }
    .podium-card { min-width: 200px; }
    .stats-inner { gap: 1rem; }
    .stat-item { font-size: 0.7rem; }
    .date-display { font-size: 1rem; }
    .section-title { font-size: 1.3rem; }
}

@media (max-width: 400px) {
    .header-meta { display: none; }
    .podium-1 { transform: none; }
    .podium-1:hover { transform: translateY(-6px); }
}

/* ===== ANIMATIONS ===== */
.ranking-card {
    animation: fadeInUp 0.4s ease both;
}
.ranking-card:nth-child(1)  { animation-delay: 0.05s; }
.ranking-card:nth-child(2)  { animation-delay: 0.10s; }
.ranking-card:nth-child(3)  { animation-delay: 0.15s; }
.ranking-card:nth-child(4)  { animation-delay: 0.20s; }
.ranking-card:nth-child(5)  { animation-delay: 0.25s; }
.ranking-card:nth-child(6)  { animation-delay: 0.30s; }
.ranking-card:nth-child(7)  { animation-delay: 0.35s; }
.ranking-card:nth-child(8)  { animation-delay: 0.40s; }
.ranking-card:nth-child(9)  { animation-delay: 0.45s; }
.ranking-card:nth-child(10) { animation-delay: 0.50s; }
.ranking-card:nth-child(11) { animation-delay: 0.55s; }
.ranking-card:nth-child(12) { animation-delay: 0.60s; }

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

.podium-card {
    animation: fadeInUp 0.5s ease both;
}
.podium-2 { animation-delay: 0.1s; }
.podium-1 { animation-delay: 0.2s; }
.podium-3 { animation-delay: 0.3s; }

/* Rank highlight colors */
.ranking-card[data-rank="1"] { border-left: 4px solid #FFD700; }
.ranking-card[data-rank="2"] { border-left: 4px solid #C0C0C0; }
.ranking-card[data-rank="3"] { border-left: 4px solid #CD7F32; }
.ranking-card[data-rank="4"],
.ranking-card[data-rank="5"] { border-left: 4px solid #4CAF50; }
.ranking-card[data-rank="10"],
.ranking-card[data-rank="11"],
.ranking-card[data-rank="12"] { border-left: 4px solid #EF5350; }

/* Emoji font support */
.podium-emoji, .rc-emoji, .method-icon, .logo-star,
.podium-medal, .stat-icon, .date-icon, .advice-icon,
.source-status, .badge-icon, .pulse-icon {
    font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Twemoji Mozilla', sans-serif;
}

/* ── Detail link button ── */
.rc-detail-link {
    margin-top: .75rem;
    display: block;
}
.detail-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: .6rem 1.2rem;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #FFD700;
    text-decoration: none;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 700;
    transition: all .2s;
    border: 1px solid rgba(255,215,0,.3);
    text-align: center;
    letter-spacing: .03em;
}
.detail-btn:hover {
    background: linear-gradient(135deg, #16213e, #0f3460);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
