/* smash_live_header.css - ライブ配信ページヘッダー・ソート・フィルタ用スタイル */

.page-header {
    text-align: center;
    padding: 20px 0 16px;
    margin-bottom: 0;
    border-bottom: 1px solid #e5e5e5;
}

.page-header h1 {
    font-size: 20px;
    font-weight: bold;
    color: #0f0f0f;
    margin-bottom: 12px;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.live-count {
    color: white;
    padding: 10px 0;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 80px;
    justify-content: center;
    box-sizing: border-box;
}

.yt-count {
    background: #ff0000;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
}

.tw-count {
    background: #9146ff;
    box-shadow: 0 4px 12px rgba(145, 70, 255, 0.2);
}

.last-update {
    color: #444444;
    padding: 10px 20px;
    background: #e5e5e5;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.local-time {
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 4px;
}

.local-time.is-visible {
    opacity: 1;
}

.sort-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 10px;
}

.sort-buttons>a,
.sort-buttons>.nation-dropdown-wrapper {
    flex: 1;
    min-width: 0;
}

.sort-btn {
    width: 100%;
    height: 36px;
    padding: 0 8px;
    background: #e5e5e5;
    border: none;
    color: #333333;
    border-radius: 10px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}

.sort-btn span,
.sort-btn {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sort-btn:hover {
    background: #e5e5e5;
    transform: translateY(-1px);
}

.sort-btn.active {
    background: #0f0f0f;
    color: white;
}

.sort-btn img {
    flex-shrink: 0;
}

/* ドロップダウンメニュー共通 */
.nation-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.nation-dropdown-wrapper.is-active {
    z-index: 10005;
    /* オーバーレイより上に表示してボタンも明るく保つ */
}

/* ドロップダウンを開いたときの背景幕（誤操作防止＆強調） */
.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.dropdown-overlay.show {
    opacity: 1;
    visibility: visible;
}

.nation-custom-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) scaleY(0.8);
    transform-origin: top center;
    z-index: 20000;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    /* ボタンの角丸 10px に合わせる */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.15s;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 画面端での配置調整用クラス */
.nation-custom-menu.align-left {
    left: 0;
    transform: scaleY(0.8);
    transform-origin: top left;
}

.nation-custom-menu.align-right {
    left: auto;
    right: 0;
    transform: scaleY(0.8);
    transform-origin: top right;
}

.nation-custom-menu::-webkit-scrollbar {
    display: none;
}

.nation-custom-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scaleY(1);
}

.nation-custom-menu.show.align-left,
.nation-custom-menu.show.align-right {
    transform: scaleY(1);
}

.nation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #0f0f0f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: background 0.2s;
    white-space: nowrap;
    text-align: left;
}

.nation-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nation-item.selected {
    background: #0f0f0f;
    color: #ffffff;
}

.nation-item .flag-emoji img.emoji {
    width: 18px !important;
    height: 18px !important;
}