.ypp,
.ypp * {
    box-sizing: border-box;
}

.ypp {
    font-family: 'Meiryo', 'Yu Gothic', 'Hiragino Kaku Gothic ProN', sans-serif;
    max-width: 100%;
    margin: 1rem 0 1.5rem;
    background: #fff;
    border: 1px solid #d0d0d0;
    line-height: 1.4;
    color: #1a1a1a;
}

.ypp .ypp-header {
    background: #4a4a4a !important;
    color: #fff !important;
    font-size: 1rem;
    font-weight: bold;
    padding: 10px 14px;
    line-height: 1.2;
    margin: 0;
}

.ypp .ypp-tabs {
    display: flex !important;
    flex-wrap: nowrap;
    background: #ececec;
    border-bottom: 1px solid #d0d0d0;
    padding: 0;
    margin: 0;
    list-style: none;
}

.ypp .ypp-tab {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0;
    padding: 9px 6px !important;
    background: transparent !important;
    border: 0 !important;
    border-right: 1px solid #d0d0d0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    cursor: pointer;
    font-family: inherit !important;
    font-size: 0.9rem !important;
    color: #555 !important;
    font-weight: bold !important;
    line-height: 1.2 !important;
    text-align: center;
    text-decoration: none !important;
    text-transform: none !important;
    transition: background 0.12s, color 0.12s;
    margin: 0 !important;
    height: auto !important;
    letter-spacing: normal;
}

.ypp .ypp-tab:last-child {
    border-right: 0 !important;
}

.ypp .ypp-tab:hover,
.ypp .ypp-tab:focus {
    background: #f5f5f5 !important;
    color: #222 !important;
    outline: none;
}

.ypp .ypp-tab.is-active {
    background: #fff !important;
    color: #c0392b !important;
    box-shadow: inset 0 -3px 0 #c0392b !important;
}

.ypp .ypp-pane {
    margin: 0;
    padding: 0;
    background: #fff;
}

.ypp .ypp-pane[hidden] {
    display: none !important;
}

.ypp .ypp-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px;
    background: transparent;
}

.ypp .ypp-list > .ypp-item,
.ypp .ypp-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    text-indent: 0 !important;
}

.ypp .ypp-list > .ypp-item::before,
.ypp .ypp-list > .ypp-item::marker {
    content: none !important;
    display: none !important;
}

.ypp .ypp-card {
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.ypp .ypp-card:hover,
.ypp .ypp-card:focus {
    text-decoration: none !important;
    color: inherit !important;
    outline: none;
}

.ypp .ypp-card:hover .ypp-thumb {
    opacity: 0.92;
}

.ypp .ypp-card:hover .ypp-card-title {
    background: rgba(0, 0, 0, 0.88) !important;
}

.ypp .ypp-thumb-wrap {
    position: relative !important;
    display: block;
    width: 100% !important;
    aspect-ratio: 16 / 9;
    background: #1a1a1a;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

@supports not (aspect-ratio: 16 / 9) {
    .ypp .ypp-thumb-wrap {
        height: 0;
        padding-top: 56.25%;
    }
    .ypp .ypp-thumb,
    .ypp .ypp-thumb-fallback {
        position: absolute;
        top: 0;
        left: 0;
    }
}

.ypp .ypp-thumb {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: opacity 0.15s;
    background: #1a1a1a;
}

.ypp .ypp-thumb-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2a2a, #4a4a4a);
}

.ypp .ypp-rank {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    color: #fff !important;
    background: linear-gradient(135deg, #2a2a2a, #555);
    padding: 0 10px !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom-left-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    letter-spacing: -0.02em;
    font-family: 'Arial Black', 'Impact', 'Meiryo', sans-serif;
    z-index: 3;
}

.ypp .ypp-rank::before {
    content: '';
    display: inline-block;
    width: 0;
}

.ypp .ypp-rank::after {
    content: '位';
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 2px;
    align-self: flex-end;
    margin-bottom: 4px;
    opacity: 0.95;
}

.ypp .ypp-rank-1 {
    background: linear-gradient(135deg, #ffe066, #f5b400 60%, #c08800);
    color: #3a2400 !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.ypp .ypp-rank-2 {
    background: linear-gradient(135deg, #f0f0f0, #b8b8b8 60%, #8a8a8a);
    color: #2a2a2a !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.ypp .ypp-rank-3 {
    background: linear-gradient(135deg, #e09a5a, #b56a2a 60%, #7a3a10);
    color: #fff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
}

.ypp .ypp-rank-n {
    background: linear-gradient(135deg, #d83a2a, #a01818);
    color: #fff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
}

.ypp .ypp-badge {
    position: absolute !important;
    top: 6px !important;
    left: 8px !important;
    right: auto !important;
    color: #fff !important;
    font-size: 0.95rem !important;
    font-weight: bold !important;
    line-height: 1.1 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    text-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.95),
        -1px 1px 2px rgba(0, 0, 0, 0.95),
        1px -1px 2px rgba(0, 0, 0, 0.95),
        -1px -1px 2px rgba(0, 0, 0, 0.95),
        0 0 6px rgba(0, 0, 0, 0.6) !important;
    z-index: 2;
}

.ypp .ypp-card-title {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1.05rem !important;
    line-height: 1.45 !important;
    font-weight: bold !important;
    color: #fff !important;
    padding: 8px 12px 10px !important;
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.78) !important;
    text-decoration: none !important;
    transition: background 0.15s;
    z-index: 2;
}

.ypp .ypp-empty {
    color: #888;
    font-size: 0.9rem;
    padding: 1.2rem;
    text-align: center;
    margin: 0;
    background: transparent;
}

.ypp.ypp-layout-carousel .ypp-carousel-wrap {
    position: relative;
    padding: 0;
    margin: 0;
    background: #fff;
}

.ypp.ypp-layout-carousel .ypp-carousel {
    list-style: none !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    padding: 10px !important;
    margin: 0 !important;
    background: transparent;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.ypp.ypp-layout-carousel .ypp-carousel::-webkit-scrollbar {
    display: none;
}

.ypp.ypp-layout-carousel .ypp-arrow {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 36px !important;
    height: 56px !important;
    background: rgba(192, 57, 43, 0.9) !important;
    color: #fff !important;
    border: 0 !important;
    cursor: pointer !important;
    font-size: 1.6rem !important;
    font-weight: bold !important;
    line-height: 1 !important;
    z-index: 4 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 4px !important;
    transition: opacity 0.15s, background 0.15s !important;
    visibility: visible !important;
    opacity: 1;
    box-shadow: none !important;
    text-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.ypp.ypp-layout-carousel .ypp-arrow:hover,
.ypp.ypp-layout-carousel .ypp-arrow:focus {
    background: #c0392b !important;
    color: #fff !important;
    outline: none !important;
}

.ypp.ypp-layout-carousel .ypp-arrow-left {
    left: 4px !important;
}

.ypp.ypp-layout-carousel .ypp-arrow-right {
    right: 4px !important;
}

@media (max-width: 640px) {
    .ypp.ypp-layout-carousel .ypp-arrow {
        width: 32px !important;
        height: 48px !important;
        font-size: 1.4rem !important;
    }
}

.ypp.ypp-layout-carousel .ypp-carousel > .ypp-item {
    flex: 0 0 auto !important;
    width: 180px;
    max-width: 60vw;
    scroll-snap-align: start;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    text-indent: 0 !important;
}

.ypp.ypp-layout-carousel .ypp-thumb-wrap {
    aspect-ratio: 3 / 2;
}

@supports not (aspect-ratio: 3 / 2) {
    .ypp.ypp-layout-carousel .ypp-thumb-wrap {
        padding-top: 66.6667%;
    }
}

.ypp.ypp-layout-carousel .ypp-carousel > .ypp-item::before,
.ypp.ypp-layout-carousel .ypp-carousel > .ypp-item::marker {
    content: none !important;
    display: none !important;
}

.ypp.ypp-display-sp {
    display: block;
}

.ypp.ypp-display-pc {
    display: none;
}

@media (min-width: 768px) {
    .ypp.ypp-display-sp {
        display: none !important;
    }
    .ypp.ypp-display-pc {
        display: block !important;
    }
}

@media (max-width: 480px) {
    .ypp .ypp-header {
        font-size: 0.95rem;
        padding: 9px 12px;
    }
    .ypp .ypp-tab {
        font-size: 0.85rem !important;
        padding: 8px 4px !important;
    }
    .ypp .ypp-rank {
        min-width: 38px;
        height: 38px;
        font-size: 1.2rem !important;
        padding: 0 8px !important;
    }
    .ypp .ypp-rank::after {
        font-size: 0.62rem;
        margin-bottom: 3px;
    }
    .ypp .ypp-badge {
        font-size: 0.85rem !important;
        top: 5px !important;
        left: 6px !important;
    }
    .ypp .ypp-card-title {
        font-size: 0.95rem !important;
        padding: 7px 10px 9px !important;
    }
}
