/* --- 重要：基本設定 --- */
:root {
    /* (調整可能) 1シンボルの高さを指定 */
    --symbol-height: 80px; 
}
/* ---------------------- */
/* -----------アイコンの色設定----------- */

.symbol-lemon{color:yellow;}
.symbol-apple-whole{color:lime;}
.symbol-hippo{color:fuchsia;}
.symbol-bar{color:red;}
.symbol-hat-cowboy{color:teal;}
.symbol-carrot{color:orange;}
.symbol-bell{color:yellow;}

/* ---------------------- */
body {
    font-family: sans-serif;
    background: #111;
    color: white;
    display: grid;
    place-items: center;
    min-height: 100vh;
    margin: 0;
}

#wrapper {
    width: 100%;
    max-width: 450px; 
    background: #333;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 100, 0.5);
}

#slot-machine {
    padding: 20px;
}

/* リールを表示する「窓」コンテナ */
.reels-container {
    display: flex;
    justify-content: space-around; 
    border: 3px solid #gold;
    background: #000;
    margin-bottom: 20px;
}

/* 1リール分の「窓」 */
.reel {
    width: 30%;
    /* 窓の高さ = 真ん中の1シンボル分 */
    height: var(--symbol-height); 
    overflow: hidden; /* 窓の外は隠す */
    border-left: 2px solid #555;
    border-right: 2px solid #555;
}

/* リール本体 (絵文字リスト) */
.reel ul {
    list-style: none;
    padding: 0;
    margin: 0;
    
    /* 停止時の滑らかな動き */
    transition: transform 0.3s ease-out;
}

/* 各シンボル */
.reel li {
    height: var(--symbol-height);
    line-height: var(--symbol-height);
    font-size: calc(var(--symbol-height) * 0.7); /* 高さに合わせて調整 */
    text-align: center;
    text-shadow: 0 0 2px gray;
}

/* --- 操作ボタン (前回と同じ) --- */
.controls { display: flex; flex-direction: column; gap: 10px; }
#start-button { width: 100%; padding: 15px; font-size: 1.2rem; background-color: #d40000; color: white; border: none; border-radius: 5px; cursor: pointer; }
#start-button:disabled { background-color: #555; }
.stop-buttons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.stop-button { padding: 10px; font-size: 1rem; background-color: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer; }
.stop-button:disabled { background-color: #555; opacity: 0.7; }

/* ==============================
   当たりイベント用エフェクト
   ============================== */

/* --- レベル1 (弱：じわっと光る) --- */
.win-level-1 {
    /* box-shadow: 
       [Xオフセット] [Yオフセット] [ぼかし] [広がり] [色] 
    */
    box-shadow: 0 0 15px 5px #00aaff; /* 水色 */
    transition: box-shadow 0.5s ease-in-out;
}

/* --- レベル2 (中：点滅) --- */
.win-level-2 {
    animation: flash-yellow 0.8s infinite;
}

@keyframes flash-yellow {
    0%, 100% {
        box-shadow: 0 0 20px 10px #ffee00; /* 黄色 */
    }
    50% {
        box-shadow: 0 0 10px 0px #ffee00;
    }
}

/* --- レベル3 (強：激しくフラッシュ + 振動) --- */
.win-level-3 {
    animation: flash-rainbow 0.3s infinite, shake 0.1s infinite;
}

@keyframes flash-rainbow {
    0%   { box-shadow: 0 0 30px 15px #ff0000; } /* 赤 */
    25%  { box-shadow: 0 0 30px 15px #00ff00; } /* 緑 */
    50%  { box-shadow: 0 0 30px 15px #0000ff; } /* 青 */
    75%  { box-shadow: 0 0 30px 15px #ffff00; } /* 黄 */
    100% { box-shadow: 0 0 30px 15px #ff00ff; } /* 紫 */
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateY(-3px); }
}


/* ==============================
   [追加] ステータス表示スタイル
   ============================== */
#status-display {
    font-size: 1.5rem; /* 24px相当 */
    font-weight: bold;
    color: #ff0000; /* 赤色 */
    text-shadow: 0 0 5px #fff, 0 0 10px #ff00de; /* 白とピンクで発光 */
    padding: 10px;
    text-align: center;
    
    /* 点滅アニメーション */
    animation: status-flash 1s infinite;
    
    /* デフォルトは非表示 (JSで切り替え) */
    display: none;
}

/* JSで .status-hidden が外されたら表示 */
#status-display:not(.status-hidden) {
    display: block;
}

@keyframes status-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}



/* ==============================
   [追加] GOLD・BET UI
   ============================== */
#game-info {
    padding: 10px 15px;
    background: #222;
    border-radius: 8px;
    margin-bottom: 10px;
    color: white;
}

#initial-gold-setup .input-group {
    display: flex;
    gap: 10px;
}
#initial-gold-setup input[type="number"] {
    flex-grow: 1;
    padding: 8px;
    font-size: 1.1rem;
    border: 1px solid #555;
    background: #111;
    color: white;
    border-radius: 5px;
}
#initial-gold-setup button {
    padding: 8px 12px;
    font-size: 1.1rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* ゲーム中UI (デフォルト非表示) */
.stats-hidden {
    display: none !important;
}

#game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gold-display {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffd700; /* 金色 */
    text-shadow: 0 0 5px #ffc107;
}
.gold-display .label {
    font-size: 0.8rem;
    color: #ccc;
    display: block;
    margin-bottom: -5px;
}

.bet-select {
    font-size: 1.1rem;
}
.bet-select .label {
    font-size: 0.8rem;
    color: #ccc;
    display: block;
    margin-bottom: 0px;
}
.bet-select label {
    margin-left: 10px;
}
.bet-select input[type="radio"] {
    margin-right: 3px;
    /* ラジオボタンを大きく見やすく */
    transform: scale(1.3);
}

/* ==============================
   [追加] 当たり配当表示
   ============================== */
#win-display {
    position: absolute;
    /* リールの真ん中あたり */
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    
    font-size: 4rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px #ff00de, 0 0 20px #ff00de, 0 0 30px #fff;
    
    /* アニメーション */
    animation: win-popup 1.5s ease-out;
    
    /* 他の要素より手前 */
    z-index: 10; 
    
    /* クリックを透過させる */
    pointer-events: none;
    
    /* デフォルトは非表示 */
    display: none;
}
@keyframes win-popup {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translate(-50%, -100%) scale(1.2); opacity: 0; }
}

/* ==============================
   [追加] ゲームオーバー画面
   ============================== */
#game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99;
}
.game-over-hidden {
    display: none !important;
}

.game-over-box {
    background: #111;
    border: 3px solid #ff0000;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    color: white;
    box-shadow: 0 0 20px #ff0000;
}
.game-over-box h1 {
    color: #ff0000;
    margin-top: 0;
}
#restart-button {
    padding: 10px 20px;
    font-size: 1.2rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}