/* ===================================
   うどん店ルーレット - 紅白お祝いスタイル
   =================================== */

#udonRoulette {
    background: #fff;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#udonRoulette .titleSection {
    margin-bottom: 40px;
}

.rouletteContainer {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    min-height: 500px;
}

/* ===================================
   ルーレット状態管理
   =================================== */
.rouletteState {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.rouletteState.active {
    display: block;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===================================
   ルーレットボックス共通スタイル
   =================================== */
.rouletteBox {
    text-align: center;
    position: relative;
}

/* ===================================
   スタート画面
   =================================== */
.udonAnimation {
    margin-bottom: 30px;
}

.startImageWrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 629px;
    width: 100%;    
    aspect-ratio: 629/516;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    background: url(../img/top/bg_fukidashi.svg) no-repeat center bottom / cover;
}

.startImageWrapper img {
    max-width: 356px;
    height: auto;
    margin: -12% auto 0;
    padding: 7px;
    object-fit: cover;
    display: block;
    transition: opacity 0.5s ease;
    background-color: #fff;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
    /* min-height: 200px; */
}

.startImageWrapper img[src*="no-image"] {
    background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

.rouletteDescription {
    font-size: 30px;
    font-family: "Yuji Syuku", serif;
    font-weight: 400;
    margin: 20px auto 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* ===================================
   ボタンスタイル
   =================================== */
.rouletteButton {
    background: #CC3537;
    font-family: "Yuji Syuku", serif;
    font-size: 40px;
    font-weight: 400;
    font-style: normal;
    color: #ffffff;
    border: none;
    padding: 20px 60px 24px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.rouletteButton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.rouletteButton:hover {
    transform: translateY(-3px);
    box-shadow:
        0 12px 30px rgba(196, 30, 58, 0.4),
        inset 0 -3px 0 rgba(0,0,0,0.2);
}

.rouletteButton:hover::before {
    left: 100%;
}

.rouletteButton:active {
    transform: translateY(0);
    box-shadow:
        0 5px 15px rgba(196, 30, 58, 0.3),
        inset 0 -2px 0 rgba(0,0,0,0.2);
}

.rouletteButton:disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.rouletteButton:disabled::before {
    display: none;
}

.rouletteButton:disabled:hover {
    transform: none;
    box-shadow: none;
}

.rouletteButton.secondary {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #333;
    box-shadow:
        0 8px 20px rgba(255, 215, 0, 0.3),
        inset 0 -3px 0 rgba(0,0,0,0.1);
}

.rouletteButton.secondary:hover {
    box-shadow:
        0 12px 30px rgba(255, 215, 0, 0.4),
        inset 0 -3px 0 rgba(0,0,0,0.1);
}

.buttonInner {
    position: relative;
    z-index: 1;
}

/* ===================================
   回転中のアニメーション
   =================================== */

.spinningImageWrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 629px;
    width: 100%;
    aspect-ratio: 629/516;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    background: url(../img/top/bg_fukidashi.svg) no-repeat center bottom / cover;
}

.spinningImageWrapper img {
    max-width: 356px;
    height: auto;
    margin: -12% auto 0;
    padding: 7px;
    object-fit: cover;
    display: block;
    transition: opacity 0.5s ease;
    background-color: #fff;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
}


.udonSpinner {
    font-size: 150px;
    animation: spin360 1s linear infinite;
    display: inline-block;
    margin-bottom: 30px;
}

@keyframes spin360 {
    from { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    to { transform: rotate(360deg) scale(1); }
}

.shopNameShuffle {
    font-size: 30px;
    font-family: "Yuji Syuku", serif;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-block: 20px 0;
    animation: textPulse 0.5s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

/* ===================================
   結果表示
   =================================== */
/* .resultBox {
    animation: resultAppear 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
} */

@keyframes resultAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.congratsMessage {
    margin-bottom: 30px;
}

.congrats {
    display: inline-block;
    font-size: 32px;
    font-weight: bold;
    color: #c41e3a;
    animation: congratsBounce 0.6s ease-in-out 3;
    text-shadow:
        2px 2px 0 #ffd700,
        4px 4px 10px rgba(196, 30, 58, 0.3);
}

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

.shopImageWrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 629px;
    width: 100%;
    aspect-ratio: 629/516;
    margin: 0 auto;
    overflow: hidden;
    background: url(../img/top/bg_fukidashi.svg) no-repeat center bottom / cover;
    /* animation: imageReveal 0.8s ease-out 0.3s backwards; */
}

@keyframes imageReveal {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.shopImageWrapper a {
    color: #333;
    text-decoration: none;
    animation: resultAppear 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.shopImageWrapper img {
    max-width: 356px;
    height: auto;
    margin: -12% auto 0;
    padding: 7px;
    object-fit: cover;
    display: block;
    transition: opacity 0.5s ease;
    background-color: #fff;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
}

.shopName {
    font-family: "Yuji Syuku", serif;
    font-weight: 400;
    font-size: 30px;
    font-weight: bold;
    margin: 20px 0;
    padding-inline: 30px;
    animation: nameSlideIn 0.8s ease-out 0.5s backwards;
    line-height: 1.4;
}

.shopName a {
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.shopName a:hover {
    color: #a01830;
    transform: scale(1.05);
    text-shadow: 2px 2px 4px rgba(196, 30, 58, 0.3);
}

.shopName a:visited {
    color: #c41e3a;
}

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

.resultButtons {
    margin-top: 40px;
    animation: buttonsSlideIn 0.8s ease-out 0.7s backwards;
}

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

/* ===================================
   紙吹雪キャンバス
   =================================== */
#confettiCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* ===================================
   レスポンシブ対応（SP）
   =================================== */
@media screen and (max-width: 768px) {
    #udonRoulette {
        padding: 40px 0;
    }

    .rouletteBox {
        padding: 30px 20px;
        border-radius: 15px;
    }

    .udonBowl {
        font-size: 80px;
    }

    .rouletteDescription {
        width: 140px;
        margin: 15px auto 30px;
    }

    .rouletteButton {
        padding: 15px 40px;
        font-size: 18px;
    }

    .udonSpinner {
        font-size: 100px;
    }

    .shopNameShuffle {
        font-size: 20px;
    }

    .congrats {
        font-size: 24px;
    }

    .startImageWrapper img,
    .spinningImageWrapper img,
    .shopImageWrapper img {
        max-width: 60%;
    }
    .shopImageWrapper img {
        margin-top: -6%;
    }

    .shopName {
        font-size: 24px;
    }

    .resultButtons {
        margin-top: 30px;
    }
    #udonRoulette .titleSection {
        margin-bottom: 0;
    }
}

@media screen and (max-width: 480px) {
    .rouletteBox {
        padding: 25px 15px;
    }

    .udonBowl {
        font-size: 60px;
    }

    .rouletteDescription {
        font-size: 16px;
    }

    .rouletteButton {
        padding: 12px 30px;
        font-size: 16px;
    }

    .udonSpinner {
        font-size: 80px;
    }

    .shopNameShuffle {
        font-size: 18px;
        padding: 0 10px;
    }

    .congrats {
        font-size: 20px;
    }

    .shopName {
        font-size: 20px;
        padding: 0 10px;
    }
}
