/* =========================================
   基本レイアウト・全体設定
========================================= */
body { background-color: #111; color: #fff; font-family: sans-serif; margin: 0; display: flex; }
.hidden { display: none !important; }

/* 設定パネル */
#settings-panel { width: 320px; padding: 20px; background: #222; overflow-y: auto; height: 100vh; box-sizing: border-box; }
#settings-panel input { width: 95%; margin-bottom: 5px; }
.setting-group { margin-bottom: 15px; border-left: 3px solid #ff4444; padding-left: 10px; }
.setting-group p { margin: 5px 0; font-size: 14px; color: #ff9999; }

/* プレイエリア全体 */
#play-area { display: flex; flex-direction: column; margin: 20px; align-items: center; }

/* =========================================
   データカウンター
========================================= */
#data-counter {
    display: flex; justify-content: space-around; background: #111;
    border: 3px solid #333; border-bottom: none; border-radius: 10px 10px 0 0;
    padding: 15px 20px; width: 940px; box-sizing: border-box; 
    box-shadow: inset 0 0 20px #000, 0 -5px 15px rgba(0,0,0,0.5); margin-bottom: 5px;
}
.data-box {
    display: flex; flex-direction: column; align-items: center; background: #000;
    border: 2px solid #222; border-radius: 5px; padding: 5px 20px;
    min-width: 140px; box-shadow: inset 0 0 10px #000;
}
.data-label { font-size: 14px; color: #ccc; margin-bottom: 5px; letter-spacing: 2px; }
.data-value { font-size: 38px; font-weight: bold; font-family: 'Arial Black', Impact, sans-serif; color: #00ff00; text-shadow: 0 0 15px #00ff00; }
.hit-color { color: #ff33ff; text-shadow: 0 0 15px #ff33ff; }
.ball-color { color: #ffaa00; text-shadow: 0 0 15px #ffaa00; }
.invest-color { color: #ff3333; text-shadow: 0 0 15px #ff3333; }

/* =========================================
   ゲーム画面 ＆ ハンドル
========================================= */
#game-and-handle { display: flex; align-items: flex-end; gap: 20px; }
#game-container {
    position: relative; width: 800px; height: 600px; background: #000;
    overflow: hidden; border: 5px solid silver; border-radius: 10px; margin: 0;
}
#video-background, #youtube-player { position: absolute; top: -10%; left: -10%; width: 120%; height: 120%; z-index: 1; pointer-events: none; overflow: hidden; }
#ui-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; display: flex; flex-direction: column; align-items: center; background: rgba(0, 0, 0, 0.4); }
#status-text { font-size: 28px; font-weight: bold; color: gold; margin-top: 20px; text-shadow: 2px 2px 5px red; }

/* ハンドル (打ち出しボタン) */
#handle-area { display: flex; justify-content: center; align-items: center; width: 120px; height: 120px; margin-bottom: 20px; }
#shoot-button {
    width: 110px; height: 110px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #e0e0e0, #555); 
    border: 5px solid #222;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.8), inset -5px -5px 15px rgba(0,0,0,0.5);
    color: #111; font-size: 18px; font-weight: 900; cursor: pointer;
    text-shadow: 1px 1px 0px #fff; padding: 0; margin: 0;
    transition: transform 0.1s, box-shadow 0.1s;
}
#shoot-button:active {
    transform: rotate(25deg) scale(0.95); 
    box-shadow: 2px 2px 5px rgba(0,0,0,0.8);
    background: radial-gradient(circle at 30% 30%, #fff, #555);
}

/* =========================================
   リール・保留
========================================= */
#slot-reels { display: flex; gap: 30px; margin-top: 150px; z-index: 30;}
.reel { width: 100px; height: 130px; background: transparent; border: none; box-shadow: none; color: #ff2222; font-size: 130px; font-weight: 900; font-family: 'Arial Black', Impact, sans-serif; display: flex; justify-content: center; align-items: center; -webkit-text-stroke: 5px #ffffff; text-shadow: 5px 5px 0 #660000, 0 0 20px #ff0000, 0 0 40px rgba(255,0,0,0.8); }

#horyu-wrapper { display: flex; align-items: center; gap: 10px; margin-top: 40px; font-size: 22px; font-weight: bold; z-index: 30;}
#horyu-container { display: flex; gap: 10px; min-width: 150px; height: 35px; align-items: center; }
.horyu-item { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #ccc; transition: all 0.3s ease; }
.horyu-item.white { background: radial-gradient(circle, #fff 0%, #aaa 100%); box-shadow: 0 0 8px #fff; }
.horyu-item.black { background: radial-gradient(circle, #444 0%, #000 100%); border-color: #ff0000; box-shadow: 0 0 15px #ff0000; animation: pulse 1s infinite alternate; }
.horyu-item.red { background: radial-gradient(circle, #ff8888 0%, #cc0000 100%); border-color: #fff; box-shadow: 0 0 15px #ff0000; animation: pulse-red 0.8s infinite alternate; }
@keyframes pulse { 0% { transform: scale(1); box-shadow: 0 0 10px #ff0000; } 100% { transform: scale(1.2); box-shadow: 0 0 25px #ff0000; } }
@keyframes pulse-red { 0% { transform: scale(1); box-shadow: 0 0 10px #ff0000; } 100% { transform: scale(1.15); box-shadow: 0 0 25px #ff0000; } }

/* =========================================
   演出用テキスト・ボタン・大当り表示
========================================= */
#gekiatsu-text { position: absolute; top: 80px; font-size: 80px; font-weight: 900; z-index: 10; text-align: center; width: 100%; pointer-events: none; letter-spacing: 20px; }
.text-rainbow { background: linear-gradient(to right, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0000ff, #8000ff); -webkit-background-clip: text; color: transparent; animation: pulse 1s infinite alternate; }
.text-purple { color: #cc00ff; text-shadow: 0 0 20px #cc00ff, 0 0 40px #ff00ff; animation: pulse 1s infinite alternate; }

#result-text { position: absolute; top: 220px; font-size: 110px; font-weight: 900; z-index: 15; text-align: center; width: 100%; pointer-events: none; font-family: 'Arial Black', Impact, sans-serif; }
.result-fail { color: #666; text-shadow: 2px 2px 0 #000; font-size: 80px !important; -webkit-text-stroke: 2px #aaaaaa; }

#congratulations {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 30; text-align: center; width: 100%;
    background: rgba(0, 0, 0, 0.6); padding: 60px 0;
    box-shadow: 0 0 50px gold, inset 0 0 30px #ff0000;
    animation: flash-bg 0.3s infinite alternate;
}
.congra-title {
    font-size: 75px; font-weight: 900; font-family: 'Arial Black', Impact, sans-serif;
    background: linear-gradient(to right, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0000ff, #8000ff);
    -webkit-background-clip: text; color: transparent;
    -webkit-text-stroke: 2px #fff; text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.congra-payout {
    font-size: 40px; font-weight: bold; color: gold; margin-top: 20px;
    text-shadow: 0 0 20px orange, 5px 5px 0 #550000; -webkit-text-stroke: 2px #fff;
    animation: pop-in 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.congra-payout span { font-size: 100px; color: #ff3333; text-shadow: 0 0 30px #ff0000, 5px 5px 0 #fff; }

@keyframes flash-bg {
    0% { background: rgba(50, 0, 0, 0.6); box-shadow: 0 0 50px red, inset 0 0 30px gold; }
    100% { background: rgba(0, 50, 0, 0.6); box-shadow: 0 0 50px gold, inset 0 0 30px red; }
}
@keyframes pop-in { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

#push-button {
    position: absolute; bottom: 120px; padding: 25px 60px; font-size: 35px; font-weight: bold; border-radius: 60px;
    background: radial-gradient(circle, #ff3333, #aa0000); color: white; border: 5px solid gold;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.5);
    cursor: pointer; z-index: 20; animation: pop 0.6s infinite alternate; white-space: pre-line; line-height: 1.2; text-align: center;
}
#push-button:active { transform: scale(0.9); box-shadow: 0 0 10px gold; }

#rush-result {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 35; text-align: center; width: 100%;
    background: rgba(0, 0, 30, 0.85); padding: 50px 0;
    box-shadow: 0 0 50px #00aaff, inset 0 0 30px #0055ff;
    animation: slide-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.rush-end-title { font-size: 60px; font-weight: 900; font-family: 'Arial Black', Impact, sans-serif; color: #00ffff; text-shadow: 0 0 20px #00aaff, 3px 3px 0 #0055aa; -webkit-text-stroke: 1px #fff; }
.rush-end-payout { font-size: 50px; font-weight: bold; color: gold; margin-top: 20px; text-shadow: 0 0 20px orange, 3px 3px 0 #aa5500; }
.rush-end-payout span { font-size: 110px; color: #ffff00; text-shadow: 0 0 30px #ffaa00, 5px 5px 0 #aa0000; }
@keyframes slide-in { 0% { transform: translate(-50%, -40%); opacity: 0; } 100% { transform: translate(-50%, -50%); opacity: 1; } }

/* 🌟 追加: プレミアム虹色枠 🌟 */
#premium-frame {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    box-sizing: border-box;
    border: 20px solid transparent;
    border-image: linear-gradient(to bottom right, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0000ff, #8000ff) 1;
    z-index: 25; /* 液晶より上、リールより下 */
    pointer-events: none;
    animation: flash-rainbow 0.3s infinite alternate;
}
@keyframes flash-rainbow {
    0% { opacity: 0.7; box-shadow: inset 0 0 20px rgba(255,255,255,0.6); }
    100% { opacity: 1; box-shadow: inset 0 0 80px rgba(255,255,255,1); }
}