/* --- style_v7.css (v104.0: Consolidated CSS) --- */

/* 1. Base & Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    width: 100%;
    overflow-x: hidden;
}

/* Semantic Resets */
article,
aside,
details,
figcaption,
figure,
footer,
header,
main,
menu,
nav,
section {
    display: block;
}

ul,
ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(1200px 600px at 20% -10%, rgba(0, 113, 227, 0.12), transparent 60%),
        radial-gradient(900px 500px at 90% 0%, rgba(175, 82, 222, 0.10), transparent 55%),
        #f2f2f7;
    color: #1d1d1f;
    margin: 0;
    padding: 0 0 40px 0;
    width: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

:root {
    --primary: #0071e3;
    --bg-page: #f2f2f7;
    --bg-card: rgba(255, 255, 255, 0.86);
    --text-main: #1d1d1f;
    --text-sub: #6b7280;
    --text-light: #cbd5e1;
    --radius: 18px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --border: rgba(0, 0, 0, 0.06);
    --like: #e11d48;
    --dislike: #2563eb;
    --comment: #10b981;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

a:active {
    opacity: 0.7;
}

.text-bold {
    font-weight: bold;
}

.val-pos {
    color: var(--like);
}

.val-neg {
    color: var(--dislike);
}

.text-flat {
    color: #64748b;
}

.invisible {
    visibility: hidden;
}

.no-data-msg {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 0.9rem;
}

/* 2. Header & Nav */
.header-container {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0 8px;
    width: 100%;
}

.header-title {
    text-align: center;
    padding: 0 14px;
}

.header-title h1 {
    font-size: 1.05rem;
    margin: 0;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.header-title i {
    margin-right: 6px;
    color: #64748b;
}

.header-title .meta {
    font-size: 0.72rem;
    color: var(--text-sub);
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-chip,
.meta-date-label {
    font-size: 0.62rem;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-sub);
    display: inline-block;
    margin-right: 5px;
}

.meta-date-label:last-child {
    margin-right: 0;
}

.scroll-nav {
    display: flex;
    overflow-x: auto;
    padding: 10px 12px 8px;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.scroll-nav::-webkit-scrollbar {
    display: none;
}

.scroll-nav::after {
    content: "";
    flex: 0 0 12px;
    display: block;
}

.pill {
    flex: 0 0 auto;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.045);
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition: transform .08s ease, background .12s ease;
}

.pill:active {
    transform: scale(0.98);
}

.pill.active {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.95), rgba(79, 172, 254, 0.85));
    color: #fff;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 18px rgba(0, 113, 227, 0.18);
}

.separator {
    margin: 0 2px;
    border-left: 1px solid #cbd5e1;
    height: 16px;
}

/* 3. Cards & Index Layout */
.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

.card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 0 0 14px;
    overflow: hidden;
    --accent-color: #cccccc;
    border-left: 6px solid var(--accent-color) !important;
}

.card-main {
    padding: 14px 14px 12px;
    display: flex;
    align-items: center;
    width: 100%;
}

.card-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: block;
    min-width: 0;
}

/* Rank Badges (Index) */
.rank-box {
    width: 30px;
    text-align: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.rank-num {
    font-size: 1.12rem;
    font-weight: 900;
    font-style: italic;
    line-height: 1;
    color: rgba(0, 0, 0, 0.25);
}

.rank-1 {
    color: #f59e0b;
}

.rank-2 {
    color: #94a3b8;
}

.rank-3 {
    color: #b45309;
}

.rank-other {
    color: rgba(0, 0, 0, 0.25);
}

/* Index Profile */
.profile-flex {
    display: flex;
    align-items: center;
}

.rank-thumb,
.rank-thumb-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-right: 10px;
    flex-shrink: 0;
}

.profile {
    flex: 1;
    min-width: 0;
    margin-right: 10px;
}

.name {
    font-size: 0.94rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-info {
    font-size: 0.64rem;
    color: var(--text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Index Stream Card */
.stream-rank-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rank-thumb-wrapper {
    position: relative;
    width: 120px;
    height: 68px;
    flex-shrink: 0;
}

.stream-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.prof-icon-overlay {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stream-info-col {
    flex: 1;
    min-width: 0;
}

.stream-title-text {
    font-size: 0.85rem;
    font-weight: bold;
    color: #334155;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    margin-bottom: 4px;
}

.stream-sub-row {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Index Metrics */
.main-metric {
    text-align: right;
    min-width: 92px;
    flex-shrink: 0;
}

.metric-val {
    font-size: 0.98rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--accent-color);
}

.metric-label {
    margin-top: 5px;
    font-size: 0.62rem;
    color: var(--text-sub);
    font-weight: 800;
}

.unit {
    font-size: 0.78em;
    opacity: 0.85;
    font-weight: 900;
    margin-left: 2px;
}

/* Index Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid var(--border);
}

.stat-box {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.045);
    border-radius: 14px;
    padding: 10px 8px;
    text-align: center;
    min-width: 0;
}

.stat-label {
    font-size: 0.60rem;
    color: #64748b;
    font-weight: 900;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.stat-val {
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 900;
    color: var(--text-main);
    white-space: nowrap;
}

/* 4. History Detail (history2.php) */
.profile-main-visual {
    text-align: center;
    margin-top: 5px;
}

.profile-thumb-wrapper {
    display: inline-block;
    padding: 4px;
    border-radius: 50%;
    border: 3px solid var(--oshi-color, var(--primary));
}

.profile-thumb-large {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

.profile-name-large {
    margin: 10px 0 5px;
    font-size: 1.4rem;
    font-weight: 900;
    color: #1e293b;
}

.oshi-mark {
    font-size: 0.8em;
    color: #64748b;
    margin-left: 6px;
}

.badge-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.prof-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.icon-cake {
    color: #ec4899;
}

.icon-oshi {
    color: var(--oshi-color, var(--primary));
}

.summary-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    border: 1px solid #f1f5f9;
}

.summary-header {
    text-align: center;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.total-label {
    font-size: 0.75rem;
    font-weight: bold;
    color: #94a3b8;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.total-value {
    font-size: 2.4rem;
    font-weight: 900;
    color: #1e293b;
    letter-spacing: -1px;
    font-feature-settings: "pnum";
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    text-align: center;
}

.summary-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-k {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: bold;
}

.summary-v {
    font-size: 1.1rem;
    font-weight: 800;
    color: #334155;
}

.section-title {
    margin: 35px 0 15px;
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f5f9;
}

.mt-large {
    margin-top: 40px;
}

.fans-scroll-box {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

.fan-row-item {
    display: flex;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.fan-rank-badge {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-right: 12px;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
}

.fan-name {
    flex: 1;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 10px;
    color: #334155;
}

.fan-val {
    font-weight: 800;
    color: #334155;
}

.history-item {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

.h-header {
    padding: 10px 15px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.h-date {
    font-weight: 800;
    color: #475569;
    font-size: 0.9rem;
}

.h-body {
    padding: 15px;
}

.stat-split-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.stat-row-daily,
.stat-row-total {
    padding: 8px 12px;
    border-radius: 8px;
}

.stat-row-daily {
    background: #fff;
}

.stat-row-total {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.label-tiny {
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8;
    margin-bottom: 2px;
    display: block;
}

.h-bar-area {
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.h-bar-fill {
    height: 100%;
    border-radius: 4px;
}

.h-stats {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: bold;
}

.val-high,
.text-rose {
    color: var(--like);
}

.val-low {
    color: var(--dislike);
}

.bg-high {
    background: var(--like);
}

.bg-low {
    background: var(--dislike);
}

.total-val-wrapper {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.total-percent {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--like);
}

.total-diff {
    font-size: 0.8rem;
    font-weight: 700;
}

.stream-embed {
    margin-top: 15px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 12px;
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.se-thumb {
    width: 140px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.se-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.se-tag {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 4px;
}

.se-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.se-title {
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1e293b;
}

.se-metrics {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: bold;
    flex-wrap: wrap;
}

.se-metric {
    display: flex;
    align-items: center;
    gap: 4px;
}

.text-pink {
    color: #ec4899;
}

.text-green {
    color: #10b981;
}

.footer-members-title {
    margin-top: 40px;
    font-weight: 800;
    color: #334155;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.member-card {
    --mem-color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    border: 2px solid var(--mem-color);
    position: relative;
    overflow: hidden;
    transition: transform 0.1s, box-shadow 0.2s;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.member-rank-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--mem-color);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-bottom-right-radius: 8px;
    font-weight: bold;
    z-index: 1;
}

.member-thumb-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
}

.member-info-box {
    flex: 1;
    min-width: 0;
}

.member-name-small {
    font-size: 0.8rem;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-val-small {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
}

.footer-copy {
    text-align: center;
    margin: 50px 0 20px;
    font-size: 0.75rem;
    color: #cbd5e1;
}

/* 5. Stats Hub & Ranking List */
.stats-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 10px;
}

.rank-card,
.ranking-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.rank-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
    cursor: pointer;
}

.rank-header:hover {
    background: #f1f5f9;
}

.rank-header::after {
    content: '\f054';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: auto;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.rank-body {
    padding: 0;
}

.r-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px dashed #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}

.r-row:last-child {
    border-bottom: none;
}

.r-row:hover {
    background: #f0f9ff;
}

.r-rank {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    margin-right: 10px;
    color: white;
    flex-shrink: 0;
}

.r-name {
    flex: 1;
    font-weight: 700;
    font-size: 0.9rem;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.r-val {
    font-weight: 800;
    color: #0f172a;
    text-align: right;
    white-space: nowrap;
}

.r-sub {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: normal;
    display: block;
}

/* Rank Colors (Hub) */
.rk-1 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.rk-2 {
    background: #94a3b8;
    color: white;
}

.rk-3 {
    background: #b45309;
    color: white;
}

.rk-other {
    background: #e2e8f0;
    color: #64748b;
}

/* Hub Header Colors */
.rh-total {
    color: #e11d48;
}

.rh-count {
    color: #f59e0b;
}

.rh-avg {
    color: #8b5cf6;
}

.rh-eff {
    color: #14b8a6;
}

.rh-red {
    color: #ef4444;
}

.rh-core {
    color: #0ea5e9;
}

.rh-casual {
    color: #84cc16;
}

.rh-pop {
    color: #3b82f6;
}

.rh-silent {
    color: #64748b;
}

.rh-rainbow {
    background: linear-gradient(90deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #ec4899;
}

.hub-footer {
    text-align: center;
    margin: 40px 0;
    color: #94a3b8;
    font-size: 0.8rem;
}

.hub-footer-date {
    color: #cbd5e1;
}

/* Mobile */
@media (max-width: 480px) {

    .stats-grid,
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .se-thumb {
        width: 110px;
    }

    .se-title {
        font-size: 0.85rem;
    }

    .stats-grid-container {
        grid-template-columns: 1fr;
    }
}

/* --- live.php (V-Lavi Style) v76.0 --- */
.live-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 10px;
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.live-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.live-card:hover {
    transform: translateY(-3px);
}

.live-thumb-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

.live-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.live-card:hover .live-thumbnail {
    opacity: 1;
}

.live-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e11d48;
    color: white;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.live-ccv-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(4px);
}

.live-ccv-badge i {
    font-size: 0.8rem;
    color: #ef4444;
}

.live-info {
    padding: 12px;
    display: flex;
    gap: 10px;
    flex: 1;
}

.live-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ccc;
    flex-shrink: 0;
}

.live-text {
    flex: 1;
    min-width: 0;
}

.live-title {
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.live-title a {
    color: #1e293b;
    text-decoration: none;
}

.live-name {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: bold;
}

.live-stats-row {
    display: flex;
    border-top: 1px dashed #e2e8f0;
    padding: 8px 12px;
    background: #f8fafc;
    justify-content: space-between;
}

.ls-item {
    font-size: 0.8rem;
    color: #475569;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ls-item i {
    color: #94a3b8;
}

/* LIVE点滅アニメーション */
@keyframes pulse-red {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.live-pulse {
    color: #e11d48;
    font-weight: 900;
    animation: pulse-red 2s infinite;
}

/* スマホ対応 */
@media (max-width: 480px) {
    .live-grid {
        grid-template-columns: 1fr;
    }
}

/* --- FROM INDEX.PHP --- */
/* Hero Sections & Grid */
.hero-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 20px 0 10px;
    padding-left: 10px;
    border-left: 4px solid #ccc;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-section-title.live {
    border-color: #ef4444;
    color: #ef4444;
}

.hero-section-title.next {
    border-color: #10b981;
    color: #10b981;
}

/* Scroll Box for compact vertical display (Updated from History2 to avoid conflict?) NO, keep consistent */
.stream-scroll-box {
    max-height: 240px;
    overflow-y: auto;
    padding: 2px;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    background: #f8fafc;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    padding: 10px;
}

/* Compact Card */
.hero-card {
    background: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.hero-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.hero-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    background: #eee;
}

.hero-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-size: 0.8rem;
    font-weight: bold;
    line-height: 1.3;
    color: #334155;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-meta {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pill {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.7rem;
}

.pill-live {
    background: #fee2e2;
    color: #ef4444;
}

.pill-next {
    background: #ecfdf5;
    color: #10b981;
}

/* --- FROM STREAM_GRAPH.PHP (Partial Duplicates handled) --- */
/* Main Layout */
.graph-container {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

@media(min-width: 600px) {
    .stat-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.s-card {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.s-card-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: bold;
    margin-bottom: 5px;
}

.s-card-val {
    font-size: 1.25rem;
    font-weight: 900;
    color: #1e293b;
}

/* Main Thumbnail */
.main-thumb-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.main-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Rich Stream Card (Same Day) */
.related-section {
    margin-top: 30px;
}

.sec-title {
    font-size: 1rem;
    font-weight: bold;
    color: #334155;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stream-card {
    display: flex;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    text-decoration: none;
    color: inherit;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.stream-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.stream-thumb {
    width: 130px;
    aspect-ratio: 16/9;
    background: #eee;
    flex-shrink: 0;
    position: relative;
}

.stream-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stream-info {
    padding: 10px 12px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* New: Owner Line */
.stream-owner-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.owner-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
}

.owner-name {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stream-title {
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    color: #1e293b;
}

.stream-stats-row {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.s-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.s-time {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 4px;
    border-radius: 4px;
}

/* YouTube Button */
.yt-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FF0000;
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 20px;
    box-shadow: 0 4px 6px rgba(255, 0, 0, 0.2);
    transition: transform 0.2s;
}

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

/* Navigation */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 10px;
}

.nav-btn {
    flex: 1;
    background: #fff;
    border: 1px solid #cbd5e1;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.nav-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: bold;
    margin-bottom: 4px;
}

.nav-title {
    font-weight: bold;
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- FROM HISTORY2.PHP --- */
/* Common: Modern Card Style (Duplicates checked, stream-card etc reused) */
.stream-section {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 12px 15px;
    margin-top: 10px;
    border-radius: 0 0 8px 8px;
}

.stream-sec-title {
    font-size: 0.8rem;
    font-weight: bold;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stream-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.stream-card.member-only {
    background: #f0fdf4;
    border-color: #dcfce7;
}

.stream-card.is-live {
    border: 2px solid #ef4444;
    background: #fef2f2;
}

.mem-badge {
    font-size: 0.65rem;
    color: #10b981;
    font-weight: bold;
    margin-bottom: 2px;
}

.badge-live-pulsing {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    animation: pulse 2s infinite;
}

/* TOP HERO CARD (NOW/NEXT) */
.hero-live-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.hero-live-box:hover {
    transform: translateY(-2px);
}

.hero-header {
    padding: 8px 16px;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Gradients */
.hero-bg-live {
    background: linear-gradient(135deg, #ff4b4b, #ff9068);
}

.hero-bg-next {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.hero-body {
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.hero-thumb {
    width: 160px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.hero-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-info {
    flex: 1;
    min-width: 0;
}

/* hero-title existing */
/* hero-meta existing */
.hero-meta-live {
    color: #ef4444;
    background: #fee2e2;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.hero-meta-next {
    color: #10b981;
    background: #ecfdf5;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* SCHEDULE LIST (New Design) */
.schedule-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sch-card {
    display: flex;
    gap: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    align-items: center;
}

.sch-card:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateX(4px);
}

.sch-thumb {
    width: 100px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eee;
}

.sch-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sch-info {
    flex: 1;
    min-width: 0;
}

.sch-time {
    display: inline-block;
    background: #f0fdf4;
    color: #16a34a;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.sch-title {
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 1.4;
    color: #334155;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

@media(max-width: 480px) {
    .hero-body {
        flex-direction: column;
    }

    .hero-thumb {
        width: 100%;
    }
}

/* TOP SUPPORTERS LIST - (Check for duplicates with Fans Scroll box) */
/* .fans-scroll-box already defined */
/* .fan-row-item already defined */
/* .fan-rank-badge already defined */

/* Specific rank badge colors for fans list */
.fan-rank-badge.rank-1 {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #fff;
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.3);
}

.fan-rank-badge.rank-2 {
    background: #94a3b8;
    color: #fff;
}

.fan-rank-badge.rank-3 {
    background: #b45309;
    color: #fff;
}

/* Scrollbar styling */
.fans-scroll-box::-webkit-scrollbar {
    width: 6px;
}

.fans-scroll-box::-webkit-scrollbar-track {
    background: transparent;
}

.fans-scroll-box::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* --- Semantic Refactoring Adjustments (v105) --- */
/* Fix grid layouts where <a> cards were wrapped in <li> */
.hero-grid>li,
.member-grid>li,
.live-grid>li {
    display: flex;
    flex-direction: column;
}

.hero-card,
.member-card,
.live-card {
    flex: 1;
    width: 100%;
}

/* Ensure li wrappers don't break layout flow */
.schedule-container>li,
.stream-container>li,
.fans-scroll-box ul>li {
    display: block;
    width: 100%;
}