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

.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,0.6);
    --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(98deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gs-start: rgba(255, 255, 255, 0.94);
    --gs-end: rgba(95, 120, 146, 0.9);
    --gradient-background: linear-gradient(135deg, var(--gs-start) 0%, var(--gs-end) 100%);
    --transition: all 0.2s ease-out;
    --sinchaku: rgba(41, 216, 255, 0.6);
    --bg-primary: #eaedf7;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #414141;
    --text-secondary: #6b6b6b;
    --border-color: #c5d3e1;
    --sub-title-color: rgba(205, 205, 205, 0.85);
    --sidetitle:rgba(167, 203, 223, 0.3);
    --sidebar-active: linear-gradient(135deg, var(--accent-color) 0%, var(--sidetitle) 100%);
    --grd-erofun:repeating-linear-gradient(90deg, rgb(255, 255, 255), rgba(148, 180, 202, 0.12) 45%, rgba(165, 169, 171, 0.2) 52%, rgb(255, 255, 255));
    --grd-erofun-button:repeating-linear-gradient(90deg, rgb(255, 255, 255), rgba(218, 233, 242, 0.43) 45%, rgba(170, 205, 250, 0.3) 52%, rgb(255, 255, 255));
    --grd-erofun--btn:repeating-linear-gradient(90deg, rgb(255, 255, 255), rgba(218, 233, 242, 0.14) 45%, rgba(170, 205, 250, 0.12) 52%, rgb(255, 255, 255));
    --bg--btn:linear-gradient(135deg, rgba(100, 183, 246, 0.5), rgba(117, 23, 205, 0.2));
    --bg-tertiary:repeating-linear-gradient(90deg, rgb(255, 255, 255), rgba(218, 233, 242, 0.16) 45%, rgba(218, 238, 250, 0.2) 52%, rgb(255, 255, 255));
}

.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --gs-start: rgba(113, 113, 113, 0.6);
    --gs-end: rgba(65, 85, 97, 0.6);
    --accent-color: rgb(71, 86, 109);
    --bg-card: #333333;
    --text-primary: #e0e0e0;
    --text-secondary: #bababa;
    --border-color: #262629;
    --background-color: rgb(30, 30, 43);
    --card-background: #16213e;
    --text-color: #e0e6ed;
    --text-light: #bbb;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --sub-title-color: rgba(46, 46, 46, 0.85);
    --sidetitle:rgba(88, 80, 69, 0.3);
    --sidebar-active: linear-gradient(135deg, var(--accent-color) 0%, var(--sidetitle) 100%);
    --grd-erofun:repeating-linear-gradient(90deg, rgba(31, 31, 31, 0.01), rgba(245, 251, 255, 0.22) 48%, rgba(199, 236, 255, 0.12) 58%, rgba(31, 31, 31, 0.01));
    --grd-erofun-button:repeating-linear-gradient(90deg, rgba(31, 31, 31, 0.0), rgba(245, 251, 255, 0.01) 40%, rgba(245, 251, 255, 0.1) 48%, rgba(199, 236, 255, 0.05) 53%, rgba(31, 31, 31, 0.01));
    --grd-erofun--btn:repeating-linear-gradient(90deg, rgba(31, 31, 31, 0.01), rgba(245, 251, 255, 0.03) 40%, rgba(245, 251, 255, 0.06) 48%, rgba(199, 236, 255, 0.05) 53%, rgba(31, 31, 31, 0.01));
    --bg--btn:linear-gradient(135deg, rgba(41, 149, 231, 0.4), rgba(105, 39, 168, 0.7));
    --bg-tertiary:repeating-linear-gradient(90deg, rgba(31, 31, 31, 0.01), rgba(245, 251, 255, 0.03) 40%, rgba(245, 251, 255, 0.1) 48%, rgba(199, 236, 255, 0.05) 53%, rgba(31, 31, 31, 0.01));
}
body {
    width:100% !important;
    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 {
    margin-top:8px !important;
    display: inline-block;
}

.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;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.04rem;
    top: 50%;
    transform: translateY(-50%) !important;
    color: rgba(172, 173, 177, 0.4);
    font-size: 1rem;
    z-index: 9;
}

.search-box {
    flex: 1;
    background: rgba(24, 2, 80, 0.04);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px inset rgba(6, 25, 87, 0.14);
    margin-top:0 !important;
    box-shadow: -1px -1.2px 29px -6px rgba(0,0,0,0.14) inset;
    color: rgba(253, 253, 254, 0.1);
    font-size: 0.9rem;
    outline: none;
    padding: 0.58rem 1.5rem 0.58rem 2.88rem !important;
}

.search-box::placeholder {
  color: rgba(255,255,255, 0.6);
  text-shadow: 2px 2px 6px rgba(200,200,200, 0.1), 0 0 rgba(130, 130, 130, 0.1);
    -webkit-text-stroke: 1.2px rgba(255,255,255,0.3);
    text-stroke: 1.2px rgba(255,255,255,0.3);
    paint-order: stroke;
}

.dark-mode .search-container {
    display: flex;
    align-items: center;
    position: relative;
}

.dark-mode .search-box {
    flex: 1;
    background: rgba(24, 2, 80, 0.04);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    margin-top:0 !important;
    box-shadow: -3px -142px 29px -6px rgba(0,0,0,0.24) inset;
    border:2px rgba(222,222,222,0.6) !important;
    color: rgba(253, 253, 254, 0.1);
    font-size: 0.9rem;
    outline: none;
    padding: 0.58rem 1.5rem 0.58rem 2.6rem !important;
}
.dark-mode .search-box::placeholder {
  color: rgba(255,255,255, 0.45);
  text-shadow: 2px 2px 6px rgba(0,0,0,0.1), 0 0 rgba(30,30,30,0.1);
    -webkit-text-stroke: 1.2px rgba(20,20,20,0.3);
    text-stroke: 1.2px rgba(20,20,20,0.3);
    paint-order: stroke;
}
.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 1vw;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
    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 4px !important;
    display: grid;
    grid-template-columns: 4fr 320px !important;
    gap: 0.6rem;
    contain: layout style paint;
}

.main-content {
    min-width: 0;
    padding:0.1rem 0.6rem !important;
}

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

.content-header {
    margin-bottom: 2rem !important;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    background-image:var(--grd-erofun) !important;
    box-shadow: -10px 0px 24px -6px rgba(0,0,0,0.18);
    
    box-shadow: var(--shadow);
    padding: 0.5rem 3rem !important;
}

.page-title {
    margin-top: 0 !important;
    text-align: center !important;
    width: 72%;
    margin: 0 auto !important;
    background: var(--bg-primary);
    box-shadow: 0px 0px 18px -6px rgba(0,0,0,0.1) inset !important;
    border-radius: 50px;
    border:2px ridge var(--sidetitle);
    padding: 0.8rem 2.4rem !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.25rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    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 span{
    color: var(--text-secondary);
}
.filter-button::first-letter {
    font-size: 1.4rem;
    -webkit-text-stroke: 2px black;
    text-stroke: 2px black;
    paint-order: stroke;
}

.filter-button:hover {
    background: linear-gradient(135deg, rgba(84, 177, 243, 0.2), rgba(103, 84, 233, 0.3));
    color: var(--text-secondary);
    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, rgba(84, 177, 243, 0.2), rgba(103, 84, 233, 0.3));
    border: 3.2px solid var(--border-color);
}

.filter-button-special {
    background: linear-gradient(135deg, rgba(190, 255, 99, 0.4) rgba(255, 252, 89, 0.8)) !important;
    color: var(--text-secondary);
    border: 3px solid var(--border-color);
    margin-left:calc(1vw - 0.5%) !important;
}

.filter-button-special:hover {
    transform: translateY(-2px) scale(1.05);
    background: linear-gradient(135deg, #b3ff6b, #f4ff53);
}

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

.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-image: var(--grd-erofun) !important;
    box-shadow: -10px 0px 24px -6px rgba(0,0,0,0.18);
    border-radius: 16px;
    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-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-container .ranking-badge{
    position: absolute;
    top: 6px !important;
    left: 6px !important;
    color: white;
    padding: 4px 6px !important;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    -webkit-text-stroke: 2px rgba(50,50,50,0.4);
    text-stroke: 2px rgba(50,50,50,0.4);
    paint-order: stroke;
    text-shadow: 0.2px 0.2px 4px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 15px rgba(255, 87, 87, 0.16) !important;
    border: 1.6px solid rgba(255, 255, 255, 0.8) !important;
    animation: pulse-gold 2s ease-in-out infinite !important;
}
        .video-duration{
            position: absolute;
            bottom: 6px !important;
            right: 6px;
            background: rgba(0, 0, 0, 0.55);
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.86rem;
            -webkit-text-stroke: 2px rgba(50,50,50,0.9);
            text-stroke: 2px rgba(50,50,50,0.9);
            paint-order: stroke;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.36) !important;
        }
        .ai-related-grid .video-duration{
            position: absolute;
            bottom: 3px !important;
            right: 3px;
            background: rgba(0, 0, 0, 0.45);
            color: white;
            padding: 3px 6px;
            border-radius: 4px;
            font-size: 0.75rem;
            -webkit-text-stroke: 2px rgba(50,50,50,0.9);
            text-stroke: 2px rgba(50,50,50,0.9);
            paint-order: stroke;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(255, 87, 87, 0.26) !important;
        }
        .sidebar-thumbnail span.video-duration{
            position: absolute;
            bottom: 8px !important;
            right: 6px;
            background: rgba(0, 0, 0, 0.45);
            color: white;
            padding: 3px 6px;
            border-radius: 4px;
            font-size: 0.75rem;
            -webkit-text-stroke: 2px rgba(50,50,50,0.9);
            text-stroke: 2px rgba(50,50,50,0.9);
            paint-order: stroke;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(255, 87, 87, 0.26) !important;
        }
.category-videos-container button.favorite-btn-small{
    display:none !important;
}
.category-videos-container .ranking-badge .rank-1{
    background: linear-gradient(135deg, rgba(255, 254, 236, 0.75), rgba(216, 202, 0, 0.7)) !important;
}
.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カラム）
========================================= */

/* メイン動画グリッド（検索結果など） */
.videos-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important;
    width: 100% !important;
    padding: 0 0.6rem !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* カテゴリ動画グリッドコンテナ */
.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;
    text-align:center !important;
    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.4);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    -webkit-text-stroke: 2px rgba(50,50,50,0.9);
    text-stroke: 2px rgba(50,50,50,0.9);
    paint-order: stroke;
    box-shadow: 0 4px 15px rgba(255, 87, 87, 0.26) !important;
}

.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.2rem 0.25rem 0.8rem !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:relative;
    bottom:0 !important;
    height:24px !important;
    line-height:24px !important;
    display: grid;
    grid-template-columns: 2fr 2fr 1fr !important;
    padding:0 0.25% 0 !important;
    width:100% !important;
    font-size:0.8rem !important;
    color: var(--text-primary);
    margin:0 auto !important;

}

.stat-item {
    text-align:center !important;
    align-items: center !important;
    justify-content: center !important;
    margin:0 auto !important;
}
.video-stats span{
    white-space:nowrap !important;
}

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

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


.sidebar-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1rem 0.5rem 3rem !important;
    box-shadow: var(--shadow);
    margin-bottom: 1.2rem !important;
    text-align:center !important;
}

.sidebar-section h3 {
    text-align: center !important;
    width: 90%;
    margin: 0 auto 12px !important;
    background: var(--bg-primary);
    box-shadow: 0px 0px 22px -6px rgba(52, 51, 51, 0.1) inset !important;
    border-radius: 50px;
    padding: 1rem !important;
    border:2px ridge var(--sidetitle);
    color: var(--text-primary);
}

.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,
.sidebar-videos-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
}

.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%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin:auto;
    padding-bottom:50px;
}

.sidebar .video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height:340px !important;
    object-fit: cover;

}

.sidebar .video-info {
    padding: 12px 0;
}

.sidebar .video-title {
    font-size: 1.1rem !important;
    font-weight: 600;
    line-height: 1.4 !important;
    margin: 0 0 18px 0 !important;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 20;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    padding:0 0.6rem !important;
    text-align:left !important;
}

.sidebar .video-meta {
    display: grid;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
    font-size: 0.8rem !important;
    text-align:center !important;
    align-items: center !important;
    justify-content: center !important;
    margin:0 auto !important;
    color: #666;
    padding:0 1rem !important;
}

.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;
}



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

.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: 0.6rem 1rem !important;
    font-size: 1.275rem !important;
    min-width: 60px !important;
    background-image: var(--grd-erofun--btn) !important;
    border: 2px outset var(--border-color) !important;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    box-shadow: var(--shadow);
    font-weight: 600;
    transition: all 0.3s ease;
    -webkit-text-stroke: 2px var(--border-color);
    text-stroke: 2px var(--border-color);
    paint-order: stroke;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.pagination .current {
    background: var(--bg--btn) !important;
    color: white;
    border: 2px inset var(--border-color);
    box-shadow: var(--shadow-hover);
}

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

.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 {
    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 {
    position: absolute !important;
    border-radius: 12px !important;
    padding: 0.5rem !important;
    min-width: 180px !important;
    max-width: 250px !important;
    box-shadow: rgba(0, 0, 0, 0.6) 0px 8px 32px, rgba(255, 255, 255, 0.1) 0px 0px 0px 1px !important;
    backdrop-filter: blur(20px) !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0px) scale(1) !important;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    pointer-events: auto !important;
    contain: none !important;
    isolation: auto !important;
    z-index: 2147483647 !important;
}

.language-item,
.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    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-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);
}


    .sidebar-section p {
        position:relative;
        top: 0.7rem;
        font-size: 0.85rem;
        color: #666;
        margin:0 auto !important;
        margin-bottom: 1.2rem !important;
    }


/* HOTラベル（緑枠） */
.hot-label {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    background: linear-gradient(135deg, rgba(81, 241, 41, 0.4), rgba(41, 224, 241, 0.4)) !important;
    color: white !important;
    padding: 4px 8px !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: 1.2px solid rgba(255, 255, 255, 0.9) !important;
    z-index: 100 !important;
    animation: pulse-green 2s ease-in-out infinite;
}

.category-tab.active {
    background: var(--bg--btn) !important;
    color: white;
    border: 2px outset var(--border-color);
    box-shadow: var(--shadow-hover);
}
.native-tab-bar {
    display:none;
}

    #pc{
        display:block !important;
    }
    #sp{
        display:none !important;
    }
    #mobileSearchOverlay div div{
        color:var(--text-primary) !important;
    }
/* ========================================
   📊 タブレット版（3カラム）
========================================= */
    @media (max-width: 1577px) {
    .accordion-tag:first-of-type{
        display:block !important;
    }
    @media (min-width: 769px) and (max-width: 1279px) {
            .videos-grid,
            .category-videos-grid .video-row{
                grid-template-columns: repeat(3, 1fr) !important;
                gap: 1.25rem;
            }
            .category-section {
                padding: 1.25rem;
            }
        }
    }

input[type="text"]:focus {
  background-color: transparent !important; /* 薄いグレーに変わる */
  border-color: rgba(255,255,255,0.8) !important;
}

input.dark-mode [type="text"]:focus {
  background-color: transparent !important; /* 薄いグレーに変わる */
  border-color: rgba(255,255,255,0.8) !important;
}

@media (max-width: 1024px) {
        .videos-grid, .category-videos-grid .video-row {
            grid-template-columns: repeat(2, 1fr) !important;
            gap: 1.25rem;
        }
        .content-filters {
            display:grid;
            grid-template-columns: 1fr 1fr 1fr 1fr;
            text-align: center;
            align-items: center;
            justify-content: center;
        }
}
/* ========================================
   📱 モバイル対応（768px以下）
========================================= */

@media (max-width: 820px) {

.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;
}
    body {
        padding-top: 60px !important;
        -webkit-overflow-scrolling: touch !important;
        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;
    }
    .accordion-tag,.filter-button-accordion {
        position:relative;
        top:8px;
    }

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

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

    .main-content {
        min-width: 0;
        padding:0.1rem 0.6rem !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-top: 0.2rem !important;
        margin-bottom: 5rem !important;
        background: var(--bg-card);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        padding: 0.1rem 0.4rem 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;
        padding:1.5rem 0 0 !important;
    }
    
    .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.6rem !important;
        padding: 0.1em !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .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;
    }

    .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-template-columns: 1fr 1fr 1fr 1fr 1fr !important;
        /*
        grid-row: 1 / 2;
        grid-column: 2 / 3;
        */
        gap: 0.4rem !important;
    }

    .content-filters a {
        max-width:240px !important;
        height:auto;
        margin: 0 auto !important;
        padding: 0.8vh 3.2vw !important;
        font-size:120% !important;
    }
    .content-filters a.filter-button-special{
        position:absolute;
        right:1vw;
        top:8.4vh;
        padding: 0.7vh 3.2vw !important;
        font-size:90% !important;
    }

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

/*
    .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::-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.4rem !important;
    }

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

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

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

    .sidebar {
        display: block !important;
        margin-top: 2rem;
        width: 100% !important;
    }

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

    .sidebar-section {
        margin-bottom: 2rem !important;
        padding: 3rem 0.5rem !important;
    }
    
    .sidebar-section h3 {
        font-size: 1rem;
        margin-bottom: 0 !important;
    }
    
    
    .sidebar-videos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .rank-badge {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
    }
    
    .hot-label {
        font-size: 0.7rem !important;
        padding: 1.2px 1.4px !important;
    }
    
    .trending-indicator span {
        display: none;
    }

    .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) {
    #pc{
        display:none !important;
    }
    #sp{
        display:block !important;
    }
    .search-results-text{
        margin-top:12px !important;
    }
    .header-container {
        position: relative !important;
        overflow: visible !important;
        contain: none !important;
        transform: none !important;
        isolation: auto !important;
        max-width: 432px !important;
        margin: 0 auto !important;
        padding: 0 1rem !important;
        height: 60px !important;
        line-height:0 !important;
        display: flex !important;
        text-align:center !important;
        align-items: center !important;
        justify-content: space-between !important;
    }


    .filter-button.active {
        background: linear-gradient(135deg, rgba(84, 177, 243, 0.2), rgba(103, 84, 233, 0.3));
        border: 2px solid var(--border-color);
        box-shadow: 0 6px 20px rgba(66, 134, 198, 0.4) inset !important;
    }
    .logo {
        max-width: 28.4% !important;
        margin: 0 0.3rem !important;
        justify-content: center !important;
        align-items: center !important;
        margin-top:0 !important;
    }
    .logo img{
        
    }

    .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;
    }

.video-info {
    position: relative;
    padding: 0.1rem 0.25rem 0.55rem !important;
    gap:0.8rem !important;
}
    .category-videos-grid .video-title a{
    text-decoration: none !important;
}
        .video-duration{
            position: absolute;
            bottom: 3px !important;
            right: 3px;
            background: rgba(0, 0, 0, 0.45);
            color: white;
            padding: 3px 6px;
            border-radius: 4px;
            font-size: 0.75rem;
            -webkit-text-stroke: 2px rgba(50,50,50,0.9);
            text-stroke: 2px rgba(50,50,50,0.9);
            paint-order: stroke;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(47, 47, 47, 0.26) !important;
        }
        .category-videos-grid .video-duration{
            position: absolute;
            bottom: 3px !important;
            right: 3px;
            background: rgba(0, 0, 0, 0.45);
            color: white;
            padding: 3px 6px;
            border-radius: 4px;
            font-size: 0.75rem;
            -webkit-text-stroke: 2px rgba(50,50,50,0.9);
            text-stroke: 2px rgba(50,50,50,0.9);
            paint-order: stroke;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(47, 47, 47, 0.26) !important;
        }
.pagination a,
.pagination span {
    display: inline-flex;
    text-align:center !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.4rem 0.3rem !important;
    font-size: 1.175rem !important;
    background-image: var(--grd-erofun--btn);
    border: 2px outset var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    box-shadow: var(--shadow);
    font-weight: 600;
    transition: all 0.3s ease;
    -webkit-text-stroke: 2px var(--border-color);
    text-stroke: 2px var(--border-color);
    paint-order: stroke;
}
.nav-sp{
    width:100%;
    gap:1rem;
    margin:24px auto 0 !important;
            display:grid !important;
            grid-template-columns: 1fr 1fr !important; 
            text-align:center !important;
            align-items: center !important;
            justify-content: center !important;



}
        .pagination a.page-back{
            position:absolute !important;
            left:12px;
            top:68px;
            font-size: 0.875rem !important;
            padding: 0.6rem !important;
            width:140px;
            height:38px;
            line-height:38px;
            white-space: nowrap !important;
        }
        .pagination a.page-next{
            position:absolute !important;
            right:12px;
            top:68px;
            font-size: 0.875rem !important;
            padding: 0.6rem !important;
            width:140px;
            height:38px;
            line-height:38px;
            white-space: nowrap !important;
        }
}

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

@media (max-width: 375px) {

    .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 {
        height:100% !important;
        width: 100% !important;
        overflow-x: hidden !important;
        padding: 0;
        margin: 0 !important;
        background: var(--background-color) !important;
    }

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

    section.tags-section {
        width: calc(100% - 1px);
        margin: 0 !important;
        border-left: 5px solid var(--primary-color) !important;
        overflow-x:hidden !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 {
        display: grid;
        grid-template-columns:1fr 1fr 1fr !important;
        grid-row: 1 / 3;
        grid-column: 1 / 2;
        margin: 1.2rem auto !important;
        gap: 0.6rem !important;
        text-align: center !important;
    }
    .filter-button {
        border-radius: 8px !important;
    }
    .filter-button a{
        width: 100% !important;
        max-width:180px !important;
        text-decoration: none;
        font-size: 0.92rem !important;
        text-align: center !important;
        align-items: center !important;
        justify-content: center !important;
        color: #5e5e5e;
        -webkit-text-stroke: 1px var(--bg-primary);
        text-stroke: 1px var(--bg-primary);
        paint-order: stroke;
        padding: 1rem 0.1rem !important;
        margin: 14px 0.2rem !important;
        background: transparent;
    }
    .accordion-tag{
        position:absolute;
        top:28.2vh;
        left:1%;
        display:block;
        width:100% !important;
        max-width:170px !important;
        height:45px;
    }

    .filter-button-special{
        position:relative !important;
        top:0 !important;
        padding: 0.7vh 3.2vw !important;
        font-size:90% !important;
        margin:0 !important;
        border: 2px solid var(--border-color) !important;
        background-image: linear-gradient(135deg,rgba(179,255,107,0.2), rgba(244,255,83,0.3)) !important;
    }

    .page-title {
        width: 90%;
        color:var(--text-secondary);
        border: 1.4px 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;
        font-size:1.4rem !important;
    }

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

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

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

    .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;
    }

    .sidebar-videos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .sidebar a.video-link div.video-thumbnail{
        height: 220px !important;
    }
    .sidebar .video-thumbnail img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height:100%;
        max-height: 220px !important;
        object-fit: cover;
    }
    .sidebar-section {
        padding: 2rem 0.5rem !important;
    }
    
    .rank-badge {
        font-size: 0.7rem !important;
        padding: 3px 6px !important;
    }
    
    .hot-label {
        font-size: 0.65rem !important;
        padding: 3px 6px !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;
}

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


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

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

/* 急上昇動画セクション */
.sidebar-trending {
    background-image: var(--grd-erofun) !important;
    box-shadow: -10px 0px 24px -6px rgba(0,0,0,0.18);
    padding: 0.8rem;
    border-left:3px solid rgb(225, 181, 222);
    border-radius: 12px;
    margin-bottom: 2.4rem !important;
}

/* 新着動画セクション */
.sidebar-latest {
    background-image: var(--grd-erofun) !important;
    border-left:3px solid rgb(204, 239, 184);
    box-shadow: -10px 0px 18px -6px rgba(0,0,0,0.18);
    padding: 0.8rem;
    border-radius: 12px;
}

/* ランキングバッジ（赤枠） */
.rank-badge {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background: linear-gradient(135deg, #ff5757, #ff3838) !important;
    color: white !important;
    padding: 4px 8px !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 {
    text-shadow: 0.2px 0.2px 4px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 15px rgba(255, 87, 87, 0.16) !important;
    border: 1.6px solid rgba(255, 255, 255, 0.8) !important;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, rgba(255, 254, 236, 0.75), rgba(216, 202, 0, 0.7)) !important;
    font-size: 0.95rem !important;
    padding: 0px 8px 0px !important;
    animation: pulse-gold 2s ease-in-out infinite;
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, rgba(250, 253, 255, 0.76), rgba(121, 121, 121, 0.98)) !important;
    font-size: 0.95rem !important;
    padding: 0px 8px 0px 5px !important;
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, rgba(249, 231, 205, 0.78), rgba(184, 96, 29, 0.86)) !important;
    font-size: 0.95rem !important;
    padding: 0px 8px 0px 5px !important;
}

.category-all .rank-badge::first-letter{
    position:absolute !important;
    font-size: 1.15rem !important;
}
.rank-badge.rank-4,
.rank-badge.rank-5 {
    background: linear-gradient(135deg, rgba(255, 110, 110, 0.44), rgba(255, 65, 65, 0.7)) !important;
}

.rank-badge.rank-1::first-letter{
    position:absolute !important;
    font-size:1.4rem !important;
}
.rank-badge.rank-2::first-letter{
    position:absolute !important;
    font-size:1.5rem !important;
}
.rank-badge.rank-3::first-letter{
    position:absolute !important;
    font-size:1.4rem !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);
    }
}

@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;
}



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

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

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

.dark-mode .trending-card {
    border-color: rgba(230, 159, 88, 0.4) !important;
}

.dark-mode .latest-card {
    border-color: rgba(72, 195, 54, 0.4) !important;
}

.sub-title{
    position:relative;
    margin-top:40px;
}