* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    height: 100vh;
    width: 100vw;
    max-width: 1080px;
    max-height: 1920px;
    margin: 0 auto;
    overflow-x: hidden;
    background: #fff;
    /* background: rgba(15, 101, 167, 0.05); */
}

.header {
    background: #0f65a7;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1080px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#current-time {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3.8rem;
    font-weight: 600;
    color: #fff;
}

main {
    position: relative;
    min-height: 100vh;
    /* padding: 120px 20px 50px; */
    /* background: linear-gradient(135deg, rgba(15, 101, 167, 0.08) 0%, rgba(220, 12, 22, 0.08) 100%); */
    background: solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

#company-logo img {
    width: auto;
    height: 55px;
    display: flex;
    align-items: center;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

/* .btn-square-so-pop {
    top: 80px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 1.2em 2.5em;
    font-size: 3rem;
    font-weight: 700;

    color: #fff;
    background: #fd9535;
    border-radius: 20px;
    border: solid 4px #d27d00;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 -2px 0 rgba(0, 0, 0, 0.05);

    cursor: pointer;
    user-select: none;
} */

/* 
.btn-square-so-pop:active {
    transform: translateY(4px);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 -2px 0 rgba(0, 0, 0, 0.05);
} */

.btn-square-so-pop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 1100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1.2em 2.5em;
    font-size: 3rem;
    font-weight: 700;

    color: #fff;
    background: #fd9535;
    border-radius: 20px;
    border: solid 4px #d27d00;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 -2px 0 rgba(0, 0, 0, 0.05);
}

.btn-square-so-pop:active {
    transform: translateX(-50%) translateY(4px);
}

/* .title_logo {
    width: 100%;
    height: auto;
    max-width: 100vw;
    display: block;
    margin-top: 40px;
} */

#title {
    position: relative;
    width: 100vw;
    height: 100vh;

    background-image: url("image/title.png");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #26a9f5;
}

.rotate_logo {
    position: absolute;
    top: 62%;
    left: 50%;
    width: 700px;

    transform: translate(-50%, -50%);
    animation: spin 10s linear infinite;
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

#resultOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;

    background: rgba(0, 0, 0, 0.8);
    display: none;

    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#resultOverlay.show {
    display: flex;
}

#resultImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 追加：ルーレット表示 */
#rouletteOverlay {
    position: fixed;
    inset: 0;
    background: #ffffff; /* ← 白背景 */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

#rouletteOverlay.show {
    display: flex;
}

.roulettePanel {
    width: min(92vw, 900px);
    height: min(92vw, 900px);
    max-height: 90vh;
    position: relative;
    display: grid;
    place-items: center;
}

.rouletteHint {
    position: absolute;
    top: -120px;
    transform: translateY(-100%);
    color: #fff;
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 14px;
}

.rouletteWheel {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
    /* ここが回転 */
    animation: rouletteSpin 3.5s linear infinite;
    will-change: transform;
}

/* 画像を円周上に並べる（位置はJSでセット） */
.rouletteItem {
    position: absolute;
    width: 30%;
    height: 30%;
    object-fit: contain;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
}

/* タッチしやすくする：少し大きく反応 */
.rouletteItem:active {
    transform: scale(1.06);
}

@keyframes rouletteSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 追加：エンディング演出 */
#endingOverlay {
    position: fixed;
    inset: 0;
    background: #000; /* 動画が映えるように黒 */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9997; /* ルーレット(9998)より下、結果(9999)より下でもOK */
}

#endingOverlay.show {
    display: flex;
}

#endingVideo {
    width: 100vw;
    height: 100vh;
    object-fit: contain; /* 全画面表示（必要なら cover に） */
}

.result-close-btn {
    position: absolute;
    top: 40px;
    right: 10px;
    padding: 20px 40px;
    font-size: 2.5rem;
    font-weight: bold;

    color: #fff;
    background: #333;
    border: none;
    border-radius: 20px;

    cursor: pointer;
}

.result-close-btn:active {
    transform: scale(0.96);
}
