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

body {
    font-family: 'Hiragino Kaku Gothic Std', 'Hiragino Kaku Gothic ProN', sans-serif;
    background: linear-gradient(180deg, #FF6B35 0%, #FF8C42 25%, #FFA94D 50%, #FFC265 75%, #FFD380 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.15) 2px, transparent 2px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* アニメーション定義 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.container {
    width: 100vw;
    max-width: 100vw;
    margin: 0 auto;
    position: relative;
    background-color: white;
    background-image: url('assets/ca89feaa8ca2182ce26442f2e622c8b54c2d7ea2.svg');
    background-repeat: no-repeat;
    background-position: center -100px;
    background-size: 100vw auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
}

/* KVセクション */
.kv-section {
    position: relative;
    width: 100vw;
    height: 661px;
    background-color: #EAF3FF;
    animation: fadeIn 1s ease-out;
}

.kv-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: auto;
    object-fit: contain;
    margin-bottom: 80px;
}

.anniversary-badge {
    position: absolute;
    top: 474px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 0, 0, 1) 20%, rgba(255, 0, 0, 1) 80%, transparent 100%);
    padding: 1px 20px;
    border-radius: 5px;
    z-index: 10;
    animation: fadeIn 1s ease-out 0.1s backwards;
    margin-left: 0;
    margin-right: 0;
}

.anniversary-image {
    height: 30px;
    width: auto;
    display: block;
}

.logo {
    position: absolute;
    top: 387px;
    left: 115px;
    width: 167px;
    height: 91px;
    object-fit: cover;
    z-index: 10;
    animation: fadeIn 1s ease-out 0.2s backwards, floating 3s ease-in-out 1.2s infinite;
}

.voting-title {
    position: absolute;
    top: 511px;
    left: 53px;
    width: 290px;
    height: 168px;
    object-fit: cover;
    z-index: 10;
    animation: fadeIn 1s ease-out 0.3s backwards;
}

/* 投票期間バナー */
.period-banner {
    position: relative;
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1s ease-out 0.4s backwards;
}

.period-banner-image {
    width: 100%;
    height: auto;
    display: block;
}

.period-text {
    font-size: 16px;
    font-weight: 800;
    color: white;
    text-align: center;
    line-height: 100.08%;
    text-shadow: rgba(0, 0, 0, 0.25) 0px 0px 3px;
}

.period-banner-character {
    position: absolute;
    right: -15px;
    bottom: -5px;
    width: 60px;
    height: auto;
    z-index: 10;
    animation: fadeIn 1s ease-out 0.5s backwards;
}

/* 説明文 */
.description {
    margin-top: 15px;
    padding: 0 24px;
    animation: fadeIn 1s ease-out 0.5s backwards;
}

.description-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 13px;
}

.description-item .character-icon {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.description-item p {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    line-height: 22px;
    color: black;
    text-align: left;
    padding-top: 8px;
}

.description-last {
    margin-bottom: 0;
}

/* 企画概要セクション */
.overview-section {
    position: relative;
    width: 100vw;
    margin-top: 30px;
}

.overview-section.animate {
    animation: fadeIn 0.8s ease-out;
}

.overview-02-container {
    position: relative;
    width: 290px;
    margin: 0 auto;
    margin-top: 33px;
}

.overview-image {
    position: relative;
    display: block;
    margin: 0 auto;
    z-index: 1;
    opacity: 0;
    transition: all 0.8s ease-out;
}

.overview-section.animate .overview-image {
    opacity: 1;
}

.overview-02 {
    width: 290px;
    height: 231px;
    object-fit: cover;
    transform: translateY(30px);
}

.overview-character-left {
    position: absolute;
    top: calc(50% + 0px);
    left: 10px;
    width: 50px;
    height: auto;
    z-index: 2;
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity 0.8s ease-out;
}

.overview-character-right {
    position: absolute;
    top: -40px;
    right: -50px;
    width: 120px;
    height: auto;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.overview-section.animate .overview-02 {
    transform: translateY(0);
    transition-delay: 0.2s;
}

.overview-section.animate .overview-character-left {
    opacity: 1;
    transition-delay: 0.25s;
    animation: floating 3s ease-in-out infinite;
}

.overview-section.animate .overview-character-right {
    opacity: 1;
    transition-delay: 0.3s;
    animation: floating 3s ease-in-out 0.5s infinite;
}

.overview-03-container {
    position: relative;
    width: 290px;
    margin: 0 auto;
    margin-top: 22px;
    margin-bottom: 40px;
}

.overview-03 {
    width: 290px;
    height: auto;
    object-fit: contain;
    transform: translateY(30px);
}

.overview-character-bottom {
    position: absolute;
    bottom: -20px;
    right: -30px;
    width: 80px;
    height: auto;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.overview-section.animate .overview-03 {
    transform: translateY(0);
    transition-delay: 0.4s;
}

.overview-section.animate .overview-character-bottom {
    opacity: 1;
    transition-delay: 0.5s;
    animation: floating 3s ease-in-out infinite;
}

/* キャラクター一覧セクション */
.character-section {
    position: relative;
    padding: 60px 0 50px;
    margin-top: 19px;
    background-color: #FFFF00;
}

.character-section.animate {
    animation: fadeIn 0.8s ease-out;
}

.character-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 689px;
    z-index: 0;
    animation: none !important;
    opacity: 1 !important;
}

.section-title {
    font-size: 26px;
    font-weight: 800;
    color: black;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    animation: slideInDown 0.8s ease-out;
}

.section-subtitle {
    font-size: 12px;
    font-weight: 800;
    color: black;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
    animation: fadeIn 1s ease-out 0.2s backwards;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(2, 165px);
    gap: 20px 23px;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 0 23px;
}

.character-card {
    width: 165px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    animation: slideInUp 0.6s ease-out forwards;
}

.character-card:nth-child(1) { animation-delay: 0.4s; }
.character-card:nth-child(2) { animation-delay: 0.5s; }
.character-card:nth-child(3) { animation-delay: 0.6s; }
.character-card:nth-child(4) { animation-delay: 0.7s; }
.character-card:nth-child(5) { animation-delay: 0.8s; }
.character-card:nth-child(6) { animation-delay: 0.9s; }

.character-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.character-image {
    width: 165px;
    height: 100px;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.character-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-name {
    width: 165px;
    height: 30px;
    background-color: white;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: black;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 5px;
}

.character-name.long-name {
    font-size: 16px;
}

/* フッター */
.footer {
    background-color: black;
    width: 100vw;
    position: relative;
    overflow: hidden;
}

.youtube-section {
    position: relative;
    padding-top: 50px;
    z-index: 2;
}

.youtube-title {
    font-size: 28px;
    font-weight: 800;
    color: white;
    text-align: center;
    margin-bottom: 25px;
}

.youtube-embed {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
}

.youtube-embed iframe {
    max-width: 100%;
    border-radius: 10px;
    border: none;
}

/* SNSアイコン */
.sns-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 20px;
    position: relative;
    z-index: 3;
    animation: fadeIn 1s ease-out;
}

.sns-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: white;
    border-radius: 50%;
    color: black;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: scaleIn 0.6s ease-out forwards;
}

.sns-icon:nth-child(1) { animation-delay: 0.2s; }
.sns-icon:nth-child(2) { animation-delay: 0.4s; }
.sns-icon:nth-child(3) { animation-delay: 0.6s; }

.sns-icon:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.4);
    background-color: #f0f0f0;
}

.sns-icon:active {
    transform: translateY(-2px) scale(1.05);
}

.sns-icon svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.sns-icon:hover svg {
    transform: rotate(5deg);
}

.footer-logo-section {
    position: relative;
    width: 248px;
    height: 114px;
    background-color: black;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    z-index: 3;
}

.footer-logo {
    width: 139px;
    height: 75px;
    object-fit: cover;
}

.copyright {
    font-family: 'Hiragino Kaku Gothic ProN', sans-serif;
    font-weight: 600;
    font-size: 10px;
    color: white;
    text-align: center;
    padding: 10px 0 20px;
    position: relative;
    z-index: 3;
}

/* ページ上へボタン */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: calc(50% - 196.5px + 319px);
    width: 49px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    animation: bounce 3s ease-in-out infinite;
}

.scroll-top:hover {
    transform: translateY(-5px);
    animation: none;
}

.scroll-top-circle {
    position: relative;
    width: 49px;
    height: 49px;
}

.circle-bg {
    width: 49px;
    height: 49px;
}

.play-icon {
    position: absolute;
    top: 11px;
    left: 11px;
    width: 28px;
    height: 28px;
}

.arrow-icon {
    width: 100%;
    height: 100%;
}

.scroll-top-text {
    font-size: 11px;
    font-weight: 800;
    color: white;
    text-align: center;
    margin-top: 0;
    white-space: nowrap;
}

/* 投票モーダル */
.vote-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.vote-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    animation: fadeIn 0.3s ease-out;
}

.vote-modal-content {
    position: relative;
    width: 100%;
    max-width: 393px;
    padding: 80px 35px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleIn 0.4s ease-out;
}

.vote-modal-back {
    position: absolute;
    bottom: 40px;
    left: 35px;
    width: 48px;
    height: 48px;
    background-color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.vote-modal-back:hover {
    transform: scale(1.1);
}

.vote-modal-back-dark {
    background-color: white;
    border: none;
}

.vote-modal-back-dark:hover {
    background-color: #f0f0f0;
}

.vote-character-card {
    width: 260px;
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 40px;
}

.vote-character-image {
    width: 260px;
    height: 260px;
    overflow: hidden;
}

.vote-character-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.vote-character-image img.align-right {
    object-position: right center;
}

.vote-character-image img.align-left {
    object-position: left center;
}

.vote-character-name {
    width: 100%;
    padding: 15px 0;
    background-color: white;
    font-size: 24px;
    font-weight: 800;
    color: black;
    text-align: center;
    letter-spacing: 1px;
}

.vote-question {
    font-size: clamp(14px, 4vw, 20px);
    font-weight: 800;
    color: white;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 40px;
    white-space: nowrap;
    overflow: visible;
}

#voteComplete .vote-question {
    white-space: normal;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.vote-submit-btn {
    width: 300px;
    height: 60px;
    background-color: #ff0000;
    color: white;
    font-size: 24px;
    font-weight: 800;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.vote-submit-btn:hover {
    background-color: #dd0000;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.7);
    animation: none;
}

.vote-submit-btn:active {
    transform: translateY(0) scale(0.98);
}

.vote-modal-copyright {
    font-family: 'Hiragino Kaku Gothic ProN', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: white;
    text-align: center;
    margin-top: 60px;
    opacity: 0.7;
}

/* 投票完了画面 */
.vote-character-card-complete {
    position: relative;
    width: 260px;
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 40px;
}

.vote-character-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #ff6b00 0%, #ff0000 100%);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 8px 10px;
    text-align: left;
    z-index: 10;
}

.vote-complete-btn {
    width: 300px;
    padding: 18px 20px;
    background-color: #ffeb3b;
    color: black;
    font-size: 18px;
    font-weight: 800;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 235, 59, 0.4);
    line-height: 1.4;
    animation: bounce 2s ease-in-out infinite;
}

.vote-complete-btn:hover {
    background-color: #fdd835;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 235, 59, 0.7);
    animation: none;
}

.vote-complete-btn:active {
    transform: translateY(0) scale(0.98);
}

.vote-share-text {
    font-size: 16px;
    font-weight: 800;
    color: white;
    text-align: center;
    line-height: 1.6;
    margin-top: 30px;
    margin-bottom: 20px;
}

.vote-modal-sns-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.vote-modal-sns-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: white;
    border-radius: 50%;
    color: black;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.vote-modal-sns-icon:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.4);
    background-color: #f0f0f0;
}

.vote-modal-sns-icon:active {
    transform: translateY(-2px) scale(1.05);
}

.vote-modal-sns-icon svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.vote-modal-sns-icon:hover svg {
    transform: rotate(5deg);
}

/* レスポンシブ対応 */
@media screen and (max-width: 500px) {
    .scroll-top {
        right: 25px;
    }

    .sns-icons {
        gap: 15px;
        margin-top: 20px;
    }

    .sns-icon {
        width: 45px;
        height: 45px;
    }

    .sns-icon svg {
        width: 22px;
        height: 22px;
    }

    .vote-modal-content {
        padding: 80px 20px 40px;
    }

    .vote-character-card {
        width: 90%;
        max-width: 280px;
    }

    .vote-character-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .vote-submit-btn {
        width: 90%;
        max-width: 300px;
    }
}

/* PCビュー対応 */
@media screen and (min-width: 501px) and (max-width: 767px) {
    body {
        padding: 0;
    }

    .container {
        margin-top: 0;
        margin-bottom: 0;
        border-radius: 0;
    }
}

@media screen and (min-width: 768px) {
    body {
        padding: 0;
        background-image: url('public/bg.jpg');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }

    .container {
        margin-top: 0;
        margin-bottom: 0;
        box-shadow: 0 10px 60px rgba(0, 0, 0, 0.2);
    }

    .scroll-top {
        right: calc(50% - 196.5px - 80px);
    }

    .voted-today-banner {
        margin-top: 80px;
        margin-left: 20px;
        margin-right: 20px;
    }

    .voted-today-banner p:first-child {
        font-size: 16px;
    }

    .voted-today-banner p:last-child {
        font-size: 14px;
    }
}

/* 500px以上: 393pxに固定 */
@media screen and (min-width: 501px) {
    .container {
        width: 393px;
        max-width: 393px;
        background-size: 393px auto;
    }

    .kv-section {
        width: 393px;
    }

    .kv-image {
        width: 393px;
    }

    .overview-section {
        width: 393px;
    }

    .character-bg {
        width: 393px;
    }

    .footer {
        width: 393px;
    }
}

/* ローディングとエラーメッセージのスタイル */
.loading-message,
.no-characters,
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    margin: 20px;
}

.loading-message {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.error-message {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid rgba(255, 0, 0, 0.5);
}

/* 投票ボタンのdisabled状態 */
.vote-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 投票済みバナー */
.voted-today-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 15px;
    margin: 20px 20px;
    max-width: 600px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: slideInDown 0.5s ease-out;
}

.voted-today-banner p:first-child {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.voted-today-banner p:last-child {
    font-size: 12px;
}

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

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .voted-today-banner {
        margin: 15px;
        padding: 15px;
    }

    .voted-today-banner p:first-child {
        font-size: 18px;
    }

    .voted-today-banner p:last-child {
        font-size: 14px;
    }
}
