.fvw-widget {
    position: relative;
    z-index: 9999;
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}

.fvw-widget *,
.fvw-widget *::before,
.fvw-widget *::after {
    box-sizing: border-box;
}

.fvw-trigger-wrapper {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.fvw-trigger-bubble {
    position: relative;
    margin: 0;
    padding: 8px 15px;
    border-radius: 999px;
    background: #ffffff;
    color: #007aff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    animation: fvw-bounce 2s infinite;
}

.fvw-trigger-bubble::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-right: 8px solid transparent;
    border-left: 8px solid transparent;
    border-top: 8px solid #ffffff;
}

.fvw-trigger {
    width: 180px;
    height: 180px;
    padding: 0;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #000000;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.fvw-trigger:hover {
    transform: scale(1.03);
}

.fvw-trigger-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center -10px;
}

.fvw-modal {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 300px;
    height: 550px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.24s ease, transform 0.24s ease;
    z-index: 9999;
}

.fvw-modal.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.fvw-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
    background: #000000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.fvw-main-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.fvw-controls-top {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    width: 100%;
    padding: 20px 0 30px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent);
}

.fvw-progress-container {
    position: relative;
    width: 90%;
    height: 4px;
    margin: 2px auto;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    touch-action: none;
}

.fvw-progress-container::before {
    content: "";
    position: absolute;
    inset: -4px 0;
}

.fvw-progress-bar {
    position: relative;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #007aff;
}

.fvw-progress-thumb {
    position: absolute;
    top: 50%;
    right: -6px;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #007aff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%);
    transition: transform 0.1s ease;
    cursor: pointer;
}

.fvw-progress-thumb:hover {
    transform: translateY(-50%) scale(1.18);
}

.fvw-time-display {
    margin-top: 5px;
    padding-right: 5%;
    color: #ffffff;
    font-size: 11px;
    text-align: right;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.fvw-close-button,
.fvw-restart-button,
.fvw-volume-button,
.fvw-play-pause-button,
.fvw-back-button {
    font: inherit;
}

.fvw-close-button {
    position: absolute;
    top: 45px;
    right: 10px;
    z-index: 11;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.fvw-restart-button {
    position: absolute;
    top: 88px;
    right: 8px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.fvw-volume-control {
    position: absolute;
    top: 120px;
    right: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.fvw-volume-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.fvw-volume-slider {
    width: 4px;
    height: 60px;
    touch-action: none;
}

.fvw-volume-track {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.fvw-volume-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #007aff;
}

.fvw-volume-thumb {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #007aff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    transform: translate(-4px, 50%);
    transition: transform 0.1s ease;
    cursor: pointer;
}

.fvw-volume-thumb:hover {
    transform: translate(-4px, 50%) scale(1.18);
}

.fvw-play-pause-button {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 9;
    display: none;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    transform: translate(-50%, -50%);
    cursor: pointer;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    transition: opacity 0.2s ease, background 0.2s ease;
}

.fvw-play-pause-button:hover {
    background: rgba(0, 0, 0, 0.68);
}

.fvw-nav {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    padding-top: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.42) 60%, transparent 100%);
}

.fvw-link-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 8px;
    margin-top: 8px;
    padding: 16px 10px;
    background: rgba(255, 255, 255, 0.88);
}

.fvw-video-link,
.fvw-video-link:link,
.fvw-video-link:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 6px 8px;
    border: 2px solid #007aff;
    border-radius: 999px;
    background: #ffffff;
    color: #007aff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.2s ease;
}

.fvw-video-link:hover,
.fvw-video-link.is-active {
    background: #007aff;
    color: #ffffff;
}

.fvw-back-button {
    display: inline-flex;
    margin-left: 10px;
    padding: 4px 8px;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: #333333;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.fvw-back-button:hover {
    opacity: 0.82;
}

@keyframes fvw-bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-5px);
    }

    60% {
        transform: translateY(-3px);
    }
}

@media (max-width: 768px) {
    .fvw-trigger-wrapper {
        right: 15px;
        bottom: 75px;
    }

    .fvw-trigger-bubble {
        padding: 4px 10px;
        font-size: 12px;
    }

    .fvw-trigger {
        width: 100px;
        height: 100px;
    }

    .fvw-modal {
        right: auto;
        left: 50%;
        width: calc(100% - 90px);
        max-width: 300px;
        transform: translate(-50%, 20px);
    }

    .fvw-modal.is-open {
        transform: translate(-50%, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fvw-trigger-bubble,
    .fvw-modal,
    .fvw-trigger,
    .fvw-play-pause-button,
    .fvw-progress-thumb,
    .fvw-volume-thumb,
    .fvw-video-link,
    .fvw-back-button {
        animation: none;
        transition: none;
    }
}
