/* 🔥 完全修正版CSS - スマホ表示対応（重複削除版 V2） */

@font-face {
    font-family: 'チェックアンドＵ－Ｆｏフォント';
    src: url('https://ero-video.fun/css/font/CP and U-Fo.woff') format('woff'),
        url('https://ero-video.fun/css/font/CP and U-Fo.otf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ========================================
   🚨 緊急修正：グリッド表示のための最優先スタイル
========================================= */

.video-row,
.category-all,
.category-beauty,
.category-busty,
.category-amateur,
.category-married,
.category-young,
.category-schoolgirl,
.category-office,
.category-massage,
.category-cosplay,
.category-body-beautiful-breasts,
.category-anal,
.category-creampie {
    display: contents !important;
}

/* ========================================
   🎯 基本設定とリセット
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: rgb(66, 130, 198);
    --secondary-color: rgb(103, 100, 186);
    --accent-color: rgb(135, 162, 206);
    --background-color: #f8f9ff;
    --card-background: #ffffff25;
    --text-color: #2c3e50;
    --text-light: #6b7280;
    --favorite-color: #e53935;
    --success-color: #4caf50;
    --border-radius: 12px;
    --shadow: 0 8px 32px rgba(102, 126, 234, 0.15);
    --shadow-hover: 0 20px 60px rgba(102, 126, 234, 0.25);
    --gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --transition: all 0.2s ease-out;
    --sinchaku: rgba(41, 216, 255, 0.6);
    --bg-primary: #f8f9ff;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e1e8ed;
    --sub-title-color: rgba(205, 205, 205, 0.85);
}

.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #333333;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --background-color: rgb(30, 30, 43);
    --card-background: #16213e;
    --text-color: #eee;
    --text-light: #bbb;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --sub-title-color: rgba(46, 46, 46, 0.85);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-top: 80px !important;
    overflow-x: visible !important;
    overscroll-behavior-y: contain;
}

a {
    text-decoration: none !important;
}

/* ========================================
   🖥️ PC版ヘッダー（スクロール連動対応）
========================================= */

.header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 8000 !important;
    overflow: visible !important;
    contain: none !important;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-backface-visibility: hidden;
    background: var(--gradient);
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.header.hidden {
    transform: translate3d(0, -100%, 0);
}

.header.visible {
    transform: translate3d(0, 0, 0);
}

.header.scroll-hidden,
.header.header-hidden {
    transform: translate3d(0, -100%, 0) !important;
    pointer-events: none !important;
}

.header.header-visible {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto !important;
}

.header-container {
    position: relative !important;
    overflow: visible !important;
    contain: none !important;
    transform: none !important;
    isolation: auto !important;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.header-container > * {
    min-width: 0 !important;
}

.logo {
    font-size: 2rem;
    display: inline-block;
    white-space: nowrap;
    font-weight: 900;
    background: linear-gradient(45deg, #fff, #e8f4fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: var(--transition);
    font-family: 'チェックアンドＵ－Ｆｏフォント', sans-serif;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 2rem;
}

.search-form {
    width: 100%;
    max-width: 600px;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 0.75rem 1.5rem;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    z-index: 9;
}

.search-box {
    flex: 1;
    background: rgba(255, 255, 255, 0) !important;
    border:none !important;
    color: white;
    font-size: 1rem;
    outline: none;
    padding-left:1rem;
}

.search-box::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-item a:active,
.nav-item a.active {
    background: rgba(255, 255, 255, 0.25);
}

.mode-toggle {
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.6rem;
}

.mobile-search-toggle,
.mobile-menu-toggle {
    display: none;
}

/* ========================================
   🖥️ メインコンテナ
========================================= */

.main-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 5fr 1fr;
    gap: 0.6rem;
    contain: layout style paint;
}

.main-content {
    min-width: 0;
}

/* ========================================
   🎨 コンテンツヘッダー
========================================= */

.content-header {
    margin-bottom: 2rem !important;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0.5rem 3rem 2rem !important;
}

.page-title {
    margin-top: 0 !important;
    text-align: center !important;
    width: 72%;
    margin: 0 auto !important;
    background: var(--background-color);
    box-shadow: 0px 0px 18px -6px rgba(0,0,0,0.1) inset !important;
    border-radius: 50px;
    padding: 1rem 3rem !important;
    margin-bottom: 2rem !important;
    color: var(--text-primary);
}

/* ========================================
   🔍 検索オプション
========================================= */

.search-options-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 1280px;
    box-shadow: var(--shadow);
}

.search-options-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.search-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-option label {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.search-option select {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-option select:hover {
    border-color: var(--primary-color);
}

.search-option select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 134, 198, 0.1);
}

/* ========================================
   🎨 コンテンツフィルター
========================================= */

.content-filters {
    display: flex;
    gap: 0.75rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.filter-button {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
}

.filter-button::first-letter {
    font-size: 1.6rem;
    -webkit-text-stroke: 2px black;
    text-stroke: 2px black;
    paint-order: stroke;
}

.filter-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(66, 134, 198, 0.3);
}

.filter-button.active {
    background: linear-gradient(135deg, #4286c6, #6764ba);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(66, 134, 198, 0.4);
}

.filter-button-special {
    background: linear-gradient(135deg, #b3ff6b, #f4ff53);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.filter-button-special:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* ========================================
   🏷️ タグセクション
========================================= */

.tags-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem !important;
    margin: 2rem auto !important;
    max-width: 1680px;
    box-shadow: var(--shadow);
}

.tags-container-wrapper h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-right: 2rem !important;
}

.tag {
    background: var(--gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(66, 134, 198, 0.4);
}

/* ========================================
   📂 カテゴリセクション
========================================= */

.category-section {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 2rem auto;
    padding: 1.5rem;
    max-width: 1680px;
    overflow: visible;
}

.category-container {
    width: 100%;
    max-width: 100%;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.category-icon {
    font-size: 1.6rem;
}

.category-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.category-tab:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(66, 134, 198, 0.3);
}

.category-tab.active {
    background: linear-gradient(135deg, #4286c6, #6764ba);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(66, 134, 198, 0.4);
}

.category-tab-icon {
    font-size: 1.2rem;
}

.category-tab-name {
    font-size: 0.95rem;
}

.category-videos-container {
    border-top: 2px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 1rem;
}

.category-videos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.category-videos-header h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.category-videos-count {
    padding: 0.5rem 1rem;
    background: rgba(66, 134, 198, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* ========================================
   🖥️ PC版グリッド（5カラム）
========================================= */

.category-videos-grid {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
}

.category-videos-grid .video-row {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.category-videos-grid .video-card {
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.4s ease-out backwards;
}

.category-videos-grid .video-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.category-videos-grid .video-card:nth-child(1) { animation-delay: 0.05s; }
.category-videos-grid .video-card:nth-child(2) { animation-delay: 0.1s; }
.category-videos-grid .video-card:nth-child(3) { animation-delay: 0.15s; }
.category-videos-grid .video-card:nth-child(4) { animation-delay: 0.2s; }
.category-videos-grid .video-card:nth-child(5) { animation-delay: 0.25s; }

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

.category-videos-grid .video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
}

.category-videos-grid .video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    content-visibility: auto;
    contain-intrinsic-size: 320px 180px;
}

.category-videos-grid .video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.category-videos-grid img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-videos-grid img.lazy.loaded {
    opacity: 1;
}

.category-videos-grid .video-info {
    padding: 1rem;
    position: relative;
}

.category-videos-grid .video-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-videos-grid .video-title a{
    text-decoration: none !important;
}
.category-videos-grid .video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.category-videos-grid .video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.category-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: linear-gradient(135deg, #4286c6, #6764ba);
    color: white;
    padding: 0.28rem 0.45rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.category-videos-grid .loading-placeholder,
.category-videos-grid .error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
}

/* ========================================
   🎨 動画カード
========================================= */

.video-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-card:hover {
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 8px 25px rgba(26, 85, 140, 0.6) !important;
    border: 4px solid rgba(26, 85, 140, 0.4) !important;
    z-index: 999;
}

.video-card:after,
.video-card:before {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info {
    position: relative;
    padding: 1.35rem 0.25rem !important;
}

.video-title {
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    margin-bottom: 1rem !important;
    font-weight: 600;
    color: var(--text-primary);
}

.video-stats {
    position: absolute;
    bottom: 5.5% !important;
    height: 20px !important;
    line-height: 20px !important;
    display: grid;
    grid-template-columns: 1fr 1fr !important;
    padding: 0 5% !important;
    width: 90%;
    font-size: 110%;
    color: var(--text-primary);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ========================================
   📊 サイドバー
========================================= */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
}

.sidebar-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.sidebar-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.horizontal-scroll-section {
    margin-bottom: 2rem;
}

.horizontal-scroll-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.horizontal-scroll-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
}

.horizontal-scroll-container::-webkit-scrollbar {
    display: none;
}

.horizontal-scroll-container .video-card {
    min-width: 200px;
    max-width: 200px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.sidebar .sidebar-videos-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar .category-videos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.sidebar .video-card {
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.sidebar .video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
}

.sidebar .video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar .video-info {
    padding: 1rem;
}

.sidebar .video-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar .video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sidebar .video-stats {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.sidebar .stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sidebar .stat-item i {
    font-size: 0.75rem;
    opacity: 0.7;
}

.sidebar .video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ========================================
   📄 ページネーション
========================================= */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 3rem auto;
    padding: 2rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem !important;
    font-size: 1.875rem !important;
    min-width: 80px !important;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(66, 134, 198, 0.3);
}

.pagination .current {
    background: linear-gradient(135deg, #4286c6, #6764ba);
    color: white;
    border-color: transparent;
}

/* ========================================
   🎲 ランダムセクション
========================================= */

.random-section {
    background: linear-gradient(135deg, 
        rgba(66, 134, 198, 0.1) 0%, 
        rgba(103, 100, 186, 0.1) 100%);
    border-radius: 16px;
    padding: 3rem;
    margin: 3rem auto;
    max-width: 1680px;
    text-align: center;
}

.random-section .section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.random-section .section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.random-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.random-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #4286c6, #6764ba);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(66, 134, 198, 0.3);
}

.random-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(66, 134, 198, 0.4);
}

.random_p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* ========================================
   🦶 フッター
========================================= */

.footer {
    background: var(--bg-card);
    border-top: 2px solid var(--border-color);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1680px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
}

.footer-section h3,
.footer-section h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.footer-section p {
    font-size: 96% !important;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    padding-top: 2rem;
}

.footer-bottom .footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-meta {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ========================================
   🌍 言語切り替え
========================================= */

.language-switcher {
    position: relative;
    z-index: 9999;
}

.language-toggle,
.language-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-weight: 500;
    background: rgba(255, 255, 255, 0) !important;
    border: 2px solid rgba(255, 255, 255, 0) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.language-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.language-button .flag {
    font-size: 1.6rem !important;
}

.language-button i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.language-button.active i {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    overflow: hidden;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
}

.language-menu.active,
.language-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
    z-index: 2147483647 !important;
}

.language-item,
.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f071;
}

.language-option:last-child {
    border-bottom: none;
}

.language-item:hover,
.language-option:hover {
    background: #f8f9ff;
}

.language-option .flag {
    font-size: 1.1rem;
}

.language-option .name {
    flex: 1;
}

.language-option .check {
    color: var(--primary-color);
    font-weight: bold;
}

.x_icon {
    width: 24px;
    height: 24px;
}

/* ========================================
   🌙 ダークモード
========================================= */

.dark-mode .header {
    background: linear-gradient(135deg, 
        rgba(30, 30, 43, 0.95) 0%, 
        rgba(44, 62, 80, 0.95) 100%) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5) !important;
}

.dark-mode .category-section {
    background: var(--bg-secondary);
    box-shadow: 0px 0px 16px -6px rgba(0,0,0,0.1) !important;
}

.dark-mode .category-videos-grid .video-card {
    background: var(--bg-tertiary);
}

.dark-mode .category-videos-grid .video-thumbnail {
    background: linear-gradient(45deg, #2a2a2a, #1a1a1a);
}

.dark-mode .category-tab {
    background: var(--bg-tertiary);
    border-color: var(--border-color-dark);
}

.dark-mode .category-tab:hover {
    background: var(--primary-color);
    color: white;
}

.dark-mode .category-videos-count {
    background: rgba(66, 134, 198, 0.2);
}

.dark-mode .footer {
    background: var(--bg-secondary);
}

.dark-mode .random-section {
    background: var(--bg-secondary);
}

.dark-mode .search-options-section,
.dark-mode .tags-section {
    background: var(--bg-secondary);
}

.dark-mode .language-menu {
    background: rgba(20, 20, 20, 0.95);
}

.dark-mode .video-title {
    color: var(--text-primary);
}

.dark-mode .language-option .name {
    color: #2c3e50;
}

/* ========================================
   📊 タブレット版（3カラム）
========================================= */

@media (min-width: 769px) and (max-width: 1279px) {
    .category-videos-grid .video-row {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.25rem;
    }
    
    .category-section {
        padding: 1.25rem;
    }
}

/* ========================================
   📱 モバイル対応（768px以下）
========================================= */

@media (max-width: 820px) {
    body {
        padding-top: 60px !important;
        padding-bottom: 90px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .header {
        height: 60px !important;
        padding: 0 !important;
    }
    
    .header.scroll-hidden,
    .header.header-hidden {
        transform: translateY(-100%) translateZ(0) !important;
        pointer-events: none !important;
    }

    .header-container {
        padding: 0 0.6rem !important;
        gap: 0.25rem !important;
    }

    .logo {
        font-size: clamp(1.3rem, 5vw, 1.6rem) !important;
        max-width: 30% !important;
        margin: 0 1rem !important;
        flex-grow: 1 !important;
    }

    .header-center {
        display: none !important;
    }

    .nav-menu {
        display: none !important;
    }

    .mobile-search-toggle,
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        border: none;
        background: rgba(255, 255, 255, 0.15);
        color: white;
        border-radius: 10px;
        font-size: 1.3rem !important;
        cursor: pointer;
        flex-shrink: 0 !important;
    }

    .mobile-search-toggle:hover,
    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.6) !important;
        transform: translateY(-3px) rotate(8deg);
        transition: 0.5s;
        box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15);
    }

    .mode-toggle {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.3rem !important;
        flex-shrink: 0 !important;
    }

    .header-right {
        display: flex !important;
        gap: 0.5rem !important;
        flex-shrink: 0 !important;
    }

    .mobile-search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-primary);
        z-index: 9999;
        display: none;
        flex-direction: column;
        padding: 1rem;
    }

    .mobile-search-overlay.active {
        display: flex !important;
    }

    .mobile-search-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .mobile-search-close {
        width: 40px;
        height: 40px;
        border: none;
        background: var(--bg-card);
        color: var(--text-primary);
        border-radius: 10px;
        font-size: 1.5rem;
        cursor: pointer;
    }

    .mobile-search-form {
        flex: 1;
    }

    .mobile-search-container {
        display: flex;
        align-items: center;
        background: var(--bg-card);
        border-radius: 12px;
        padding: 0.75rem 1rem;
        border: 2px solid var(--border-color);
    }

    .mobile-search-input {
        flex: 1;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 1rem;
        outline: none;
    }

    .mobile-nav-menu::-webkit-scrollbar {
        width: 6px;
    }

    .mobile-nav-menu::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
    }

    .mobile-nav-menu::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 10px;
    }

    .mobile-nav-menu::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .native-tab-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9000 !important;
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(20px) saturate(180%) !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
        height: 70px !important;
        padding-bottom: env(safe-area-inset-bottom, 0) !important;
        will-change: transform, opacity !important;
        backface-visibility: hidden !important;
        transform: translate3d(0, 0, 0);
        transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    }

    .native-tab-bar.scroll-hidden,
    .native-tab-bar.tab-bar-hidden {
        transform: translate3d(0, 100%, 0) !important;
        pointer-events: none !important;
    }

    .native-tab-bar.tab-bar-visible {
        transform: translate3d(0, 0, 0) !important;
        pointer-events: auto !important;
    }

    .dark-mode .native-tab-bar {
        background: rgba(40, 40, 40, 0.98) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .tab-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0.5rem !important;
        color: #8e8e93 !important;
        text-decoration: none !important;
        min-width: 60px !important;
        cursor: pointer;
        border-radius: 8px !important;
        transition: all 0.2s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .tab-item.active {
        color: var(--primary-color) !important;
        background: rgba(66, 134, 198, 0.1) !important;
    }

    .tab-icon {
        font-size: 1.5rem !important;
        margin-bottom: 0.25rem !important;
    }

    .tab-label {
        font-size: 0.7rem !important;
        font-weight: 500 !important;
        color: inherit !important;
    }

    .content-header {
        margin-bottom: 2rem !important;
        background: var(--bg-card);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        padding: 0.5rem 0 1rem !important;
    }

    .search-options-section {
        display: none !important;
    }

    #mobile-sort,
    #mobile-limit,
    #mobile-period {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 1.2em;
        padding-right: 2.5rem !important;
    }
    
    #mobile-sort option,
    #mobile-limit option,
    #mobile-period option {
        background: #2c3e50;
        color: white;
        padding: 0.5rem;
    }
    
    #apply-mobile-search-options:active {
        transform: scale(0.95) !important;
        box-shadow: 0 2px 10px rgba(66, 134, 198, 0.3) !important;
    }

    .category-section {
        margin: 0.5rem !important;
        padding: 0.75rem !important;
        border-radius: 12px !important;
        width: calc(100% - 1rem) !important;
        background: linear-gradient(135deg, 
            rgba(66, 134, 198, 0.05) 0%, 
            rgba(103, 100, 186, 0.05) 100%) !important;
        border-left: 5px solid var(--primary-color) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    }
    
    .category-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .category-icon {
        font-size: 1.4rem !important;
        position: relative;
        left: 8px;
    }

    .category-videos-header {
        display: grid;
        grid-template-columns: 3fr 1fr !important;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        text-align: left;
    }
    
    .category-videos-header h4 {
        font-size: 1.3rem !important;
        font-weight: 800 !important;
        color: var(--primary-color) !important;
        margin-left: 12px !important;
    }
    
    .category-videos-count {
        padding: 0.4rem !important;
        text-align: center;
        font-size: 0.8rem;
    }
    
    .category-tabs {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .category-tab {
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem !important;
        font-weight: 700 !important;
    }

    .category-tab.active {
        background: var(--primary-color) !important;
        color: white !important;
        box-shadow: 0 4px 12px rgba(66, 134, 198, 0.3) !important;
    }
    
    .category-tab-icon {
        font-size: 1rem;
    }
    
    .category-videos-container {
        padding-top: 1.5rem;
    }
    
    .category-videos-grid,
    #categoryVideosGrid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .category-videos-grid .video-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.15rem;
    }

    .category-videos-grid .video-card {
        width: 100% !important;
        margin: 0 !important;
        font-size: 0.75rem !important;
    }
    
    .category-videos-grid .video-info {
        padding: 0.25rem;
    }
    
    .category-videos-grid .video-title {
        font-size: 0.7rem !important;
        line-height: 1.3 !important;
        -webkit-line-clamp: 2;
        margin-bottom: 0.5rem;
    }
    
    .category-videos-grid .video-meta {
        font-size: 0.65rem !important;
    }
    
    .category-videos-grid .video-duration {
        bottom: 4px;
        right: 4px;
        background: rgba(0, 0, 0, 0.65);
        color: white;
        padding: 3px 4px;
        font-size: 0.7rem;
    }

    .video-card.hot::before {
        content: '🔥 HOT';
        position: absolute;
        top: 6px;
        left: 6px;
        z-index: 10;
        background: linear-gradient(135deg, #ff3b30 0%, #ff6b6b 100%);
        color: white;
        padding: 3px 8px;
        border-radius: 6px;
        font-size: 0.65rem;
        font-weight: 900;
        box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4);
    }
    
    .video-card.new::before {
        content: '✨ NEW';
        position: absolute;
        top: 6px;
        left: 6px;
        z-index: 10;
        background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
        color: white;
        padding: 3px 8px;
        border-radius: 6px;
        font-size: 0.65rem;
        font-weight: 900;
        box-shadow: 0 2px 8px rgba(52, 199, 89, 0.4);
    }

    .content-filters {
        display: grid;
        grid-row: 1 / 2;
        grid-column: 2 / 3;
        gap: 1.6rem;
    }

    .content-filters a {
        margin: 0 !important;
    }

    a.filter-button-special {
        transform: translateY(-2px) scale(1.05) !important;
        background-image: linear-gradient(135deg,rgba(179,255,107,0.5), rgba(244,255,83,0.5)) !important;
        color: var(--text-primary);
        border-color: transparent;
    }

    .pagination {
        gap: 0.5rem !important;
        margin: 2rem 0 !important;
        padding: 0 1rem !important;
    }

    .pagination a,
    .pagination span {
        padding: 0.6rem 0.85rem !important;
        font-size: 1.05rem !important;
        min-width: 40px !important;
        background-color: rgba(255,255,255,1);
        border: 1px solid rgba(12, 74, 156, 0.04);
        border-radius: 12px;
        color: #5e5e5e;
    }

    .pagination a:hover,
    .pagination span:hover {
        min-width: 40px !important;
        color: #fff;
        transform: translateY(-4px) scale(1.05) !important;
        box-shadow: 0 8px 25px rgba(66, 134, 198, 0.4) !important;
    }

    .pagination a:active,
    .pagination .current {
        padding: 0.385rem 0.75rem !important;
        font-size: 1.35rem !important;
        min-width: 44px !important;
        color: #fff;
        font-weight: bold !important;
        border: 2px rgba(32, 158, 255, 0.4) !important;
        position: relative;
        top: 0px;
    }

    .tags-section {
        background: var(--bg-card);
        border-radius: var(--border-radius);
        padding: 2rem !important;
        margin: 2rem 0 !important;
        max-width: 90%;
        box-shadow: var(--shadow);
    }

    .tags-container-wrapper h3 {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }

    .tags-container {
        width: 100vw;
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    .tags-container::-webkit-scrollbar {
        display: none !important;
    }

    .tag {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    .videos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        padding: 0 !important;
    }

    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .footer-bottom .footer-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .random-section {
        padding: 2rem 1rem;
        margin: 2rem 1rem;
    }

    .random-section .section-title {
        font-size: 1.5rem;
    }

    .random-section .section-description {
        font-size: 1rem;
    }

    .random-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .random-btn {
        width: 100%;
        padding: 1rem;
    }

    .sidebar {
        display: block !important;
    }

    .main-container {
        grid-template-columns: 1fr !important;
        padding: 0 !important;
    }

    .language-button,
    .language-toggle {
        padding: 0.3rem 0.9rem;
        font-size: 0.875rem;
    }

    .language-toggle {
        margin-left: -3px !important;
    }

    .language-menu {
        right: 0;
        min-width: 140px;
    }
}

/* ========================================
   📱 小型スマホ（432px以下）
========================================= */

@media (max-width: 432px) {
    .header-container {
        padding: 0 !important;
        gap: 0.2rem !important;
    }

    .logo {
        font-size: clamp(1.3rem, 5vw, 1.6rem) !important;
        max-width: 28.4% !important;
        margin: 0 0.3rem !important;
        flex-grow: 1 !important;
    }

    .mobile-search-toggle,
    .mobile-menu-toggle,
    .mode-toggle {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
    }

    .videos-grid {
        gap: 0.5rem !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .video-title {
        font-size: 0.8rem !important;
    text-decoration: none !important;
    }
    .category-videos-grid .video-title a{
    text-decoration: none !important;
}
}

/* ========================================
   📱 超小型スマホ（375px以下）
========================================= */

@media (max-width: 375px) {
    .logo {
        font-size: 1.2rem !important;
    }

    .mobile-search-toggle,
    .mobile-menu-toggle,
    .mode-toggle {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.1rem !important;
    }

    .header-right {
        gap: 0.3rem !important;
    }

    .videos-grid {
        gap: 0.4rem !important;
    }

    .tag {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
    }
}

/* ========================================
   📱 480px以下の追加スタイル
========================================= */

@media (max-width: 480px) {
    html,
    body {
        width: 100% !important;
        overflow-x: hidden !important;
        padding: 0;
        margin: 0 !important;
    }

    .header {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    section.tags-section {
        width: 100% !important;
        margin: 0 !important;
        border-left: 5px solid var(--primary-color) !important;
        max-width: 480px;
    }

    .search-options-container {
        display: grid;
        grid-template-columns: 1fr !important;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .search-option {
        display: grid;
        grid-template-columns: 1fr 3fr;
        white-space: nowrap;
        gap: 1rem;
        align-items: center !important;
        justify-content: center !important;
    }

    .search-option label {
        text-align: right !important;
        width: 30% !important;
        font-size: 90% !important;
    }

    .search-option select {
        width: 100% !important;
        max-width: 336px !important;
        padding: 0.6rem 0.2rem;
        border-radius: 12px;
    }

    .content-filters {
        grid-row: 1 / 3;
        grid-column: 1 / 2;
        gap: 1.4rem;
        margin: 1rem auto 2rem !important;
        gap: 1.2rem !important;
        text-align: center !important;
    }

    .filter-button {
        width: 140px !important;
        border-radius: 12px !important;
        text-decoration: none;
        font-size: 1.2rem !important;
        text-align: center !important;
        align-items: center !important;
        justify-content: center !important;
        color: #5e5e5e;
        -webkit-text-stroke: 1px var(--sub-title-color);
        text-stroke: 1px var(--sub-title-color);
        paint-order: stroke;
        padding: 0.8rem;
        margin: 20px 1rem;
        background: transparent;
    }

    .filter-button-special {
        transform: translateY(-2px) scale(1.05) !important;
        background-image: linear-gradient(135deg,rgba(179,255,107,0.5), rgba(244,255,83,0.5)) !important;
        color: var(--text-primary);
        border-color: transparent;
    }

    .page-title {
        width: 90%;
        border: 1px inset var(--background-color) !important;
        margin-top: 20px 0 8px 8% !important;
        text-align: center;
        box-shadow: 0px 0px 18px -6px rgba(0,0,0,0.1) inset !important;
        border-radius: 12px;
        white-space: nowrap;
        margin: 0 1rem !important;
    }

    .category-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .category-videos-grid .video-row,
    .videos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.2rem !important;
        padding: 0.2em !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .category-videos-grid {
        gap: 0.5rem;
    }

    .video-duration {
        position: absolute;
        bottom: 4px;
        right: 4px;
        background: rgba(0, 0, 0, 0.65);
        color: white;
        padding: 3px 4px;
        border-radius: 6px;
        font-size: 0.68rem;
        font-weight: 600;
    }

    .hot::before {
        background-image: linear-gradient(rgba(230, 187, 118, 0.57), rgba(236, 203, 56, 0.61)) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
        padding: 2.2px 6px 2.2px 2px !important;
        left: 4px;
        top: 4px;
        font-size: 110% !important;
        -webkit-text-stroke: 1px #fff !important;
        text-stroke: 1px #fff !important;
        paint-order: stroke !important;
        font-weight: 300 !important;
    }
}

/* ========================================
   🌟 スムーズスクロール制御
========================================= */

body.scrolling .header.header-visible {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    transition: 
        transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.3s ease !important;
}

body.scrolling .native-tab-bar.tab-bar-visible {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
    transition: 
        transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.3s ease !important;
}

.header:focus-within,
.native-tab-bar:focus-within {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto !important;
}

body.user-is-tabbing .header,
body.user-is-tabbing .native-tab-bar {
    transition: transform 0.5s ease !important;
}

.header.preload,
.native-tab-bar.preload {
    transition: none !important;
}

/* ========================================
   ⚡ パフォーマンス最適化
========================================= */

.header,
.native-tab-bar {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000px !important;
    perspective: 1000px !important;
}

.video-card,
.tag {
    will-change: transform;
}

/* ========================================
   🌙 ダークモード追加
========================================= */

.dark-mode .category-section {
    background: linear-gradient(135deg, 
        rgba(66, 134, 198, 0.1) 0%, 
        rgba(103, 100, 186, 0.1) 100%) !important;
}

/* ========================================
   🔥 HOT/NEWバッジ & ランキング表示
========================================= */

/* 急上昇動画セクション */
.sidebar-trending {
    background: linear-gradient(135deg, rgba(255, 87, 87, 0.1), rgba(255, 153, 0, 0.1));
    border-left: 4px solid #ff5757;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* 新着動画セクション */
.sidebar-latest {
    background: linear-gradient(135deg, rgba(76, 209, 55, 0.1), rgba(46, 213, 115, 0.1));
    border-left: 4px solid #4cd137;
    padding: 1.5rem;
    border-radius: 12px;
}

/* ランキングバッジ（赤枠） */
.rank-badge {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    background: linear-gradient(135deg, #ff5757, #ff3838) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 15px rgba(255, 87, 87, 0.4) !important;
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
    z-index: 100 !important;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    font-size: 0.95rem !important;
    animation: pulse-gold 2s ease-in-out infinite;
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8) !important;
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #8B4513) !important;
}

@keyframes pulse-gold {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
    }
}

/* HOTラベル（緑枠） */
.hot-label {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background: linear-gradient(135deg, #4cd137, #2ecc71) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 15px rgba(76, 209, 55, 0.4) !important;
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
    z-index: 100 !important;
    animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(76, 209, 55, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(76, 209, 55, 0.6);
    }
}

/* 急上昇インジケーター */
.trending-indicator {
    color: #ff5757 !important;
    font-weight: 700 !important;
}

.trending-indicator i {
    animation: bounce-up 1s ease-in-out infinite;
}

@keyframes bounce-up {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* サイドバーカードのボーダー */
.trending-card {
    border: 2px solid rgba(255, 87, 87, 0.3) !important;
    transition: all 0.3s ease;
}

.latest-card {
    border: 2px solid rgba(76, 209, 55, 0.3) !important;
    transition: all 0.3s ease;
}

.trending-card:hover {
    border-color: #ff5757 !important;
    box-shadow: 0 8px 25px rgba(255, 87, 87, 0.3) !important;
    transform: translateY(-4px) !important;
}

.latest-card:hover {
    border-color: #4cd137 !important;
    box-shadow: 0 8px 25px rgba(76, 209, 55, 0.3) !important;
    transform: translateY(-4px) !important;
}

/* ========================================
   📱 スマホ対応：サイドバーを表示
========================================= */

@media (max-width: 820px) {
    .main-container {
        grid-template-columns: 1fr !important;
    }
    
    .sidebar {
        display: block !important;
        margin-top: 2rem;
        width: 100%;
    }
    
    .sidebar-section {
        margin-bottom: 2rem;
        padding: 1.5rem 1rem;
    }
    
    .sidebar-section h3 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }
    
    .sidebar-videos-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }
    
    .rank-badge {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
    }
    
    .hot-label {
        font-size: 0.7rem !important;
        padding: 4px 8px !important;
    }
    
    .trending-indicator span {
        display: none;
    }
}

@media (max-width: 480px) {
    .sidebar-videos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
    
    .sidebar-section {
        padding: 1rem 0.5rem;
    }
    
    .rank-badge {
        font-size: 0.7rem !important;
        padding: 3px 6px !important;
    }
    
    .hot-label {
        font-size: 0.65rem !important;
        padding: 3px 6px !important;
    }
}

/* ========================================
   🌙 ダークモード対応
========================================= */

.dark-mode .sidebar-trending {
    background: linear-gradient(135deg, rgba(255, 87, 87, 0.15), rgba(255, 153, 0, 0.15));
    border-left-color: #ff6b6b;
}

.dark-mode .sidebar-latest {
    background: linear-gradient(135deg, rgba(76, 209, 55, 0.15), rgba(46, 213, 115, 0.15));
    border-left-color: #5cd15c;
}

.dark-mode .trending-card {
    border-color: rgba(255, 87, 87, 0.4) !important;
}

.dark-mode .latest-card {
    border-color: rgba(76, 209, 55, 0.4) !important;
}