/* ==========================================
   アプリ全体の基本デザイン
   ========================================== */
body {
    /* 🔽 シャープで読みやすいフォント */
    font-family: 'Helvetica Neue', Arial, sans-serif;
    
    /* 🏟️ ドット絵スタジアム背景を画面いっぱいに表示する設定 */
    background-image: url('background.png'); 
    background-size: cover;          /* 画面の縦横比に合わせて隙間なく引き伸ばす */
    background-position: center;     /* 画面が狭くなっても常に画像の中央を基準にする */
    background-attachment: fixed;    /* スクロールしても背景だけは固定する */
    image-rendering: pixelated;      /* ドット絵がボヤけずクッキリ表示されるおまじない */
    
    color: #c5c6c7;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#app {
    background-color: rgba(15, 12, 41, 0.8); 
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 700px;
    
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
}

/* 🎮 作成された画像ロゴのレスポンシブ設定 */
h1.logo-container {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    overflow: visible;
}

/* 👹 ロゴ画像本体のクオリティ向上設定 */
.main-title-logo {
    width: 100%;
    max-width: 450px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

h2 {
    /* 🧊 鮮やかな水色・アイスブルー */
    color: #00e5ff; 
    
    font-size: 1.3rem;
    
    /* ❄️ 下線も鮮やかな水色に（太さも2pxに指定） */
    border-bottom: 2px solid #00e5ff; 
    
    padding-bottom: 8px;
    margin-top: 0;
    letter-spacing: 0.5px;
    
    /* ほんのりテキストを光らせて氷感をアップ */
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

h3 {
    font-size: 1rem;
    color: #a4a5a6;
    margin-top: 20px;
}

/* 入力エリア ＆ 各セクションのグループ背景 */
.setup-section, .oni-section, .players-section {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.input-group input {
    width: 100%;
    padding: 12px;
    background-color: #0b0c10;
    border: 1px solid #12c6f3;
    border-radius: 6px;
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
}

/* 👥 キャラクター選択グリッド */
.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin: 15px 0;
    padding: 10px;
    background: #b5f5ec;
    border-radius: 8px;
    min-height: 90px;
}

/* キャラ選択のカード外枠 */
.char-card {
    background: #c4d8ff;
    border: 2px solid #f0f5ff;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.char-card:hover {
    border-color: #f39c12;
    transform: translateY(-2px);
}

.char-card.selected {
    border-color: #f1c40f;
    box-shadow: 0 0 15px #f1c40f;
    transform: scale(1.05);
}

.char-card img {
    width: 64px !important;
    height: 64px !important;
    object-fit: contain !important;
    display: block;
    margin: 0 auto;
    image-rendering: pixelated !important;
    image-rendering: crisp-edges !important;
}

/* ボタン関係 */
.main-button {
    width: 100%;
    padding: 14px;
    
    /* 🧊 鮮やかな水色のグラデーション */
    background: linear-gradient(180deg, #00e5ff, #00b0ff); 
    color: #ffffff; /* 文字色を白に */
    
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.1s ease;
    
    /* 🧊 厚みを感じさせる濃い青色の立体シャドウ */
    box-shadow: 0 5px 0 #0077c2, 0 8px 12px rgba(0, 0, 0, 0.4);
    
    /* 文字のくっきり感を高めるフチ影 */
    text-shadow: 
        -1px -1px 0 #003366,
         1px -1px 0 #003366,
        -1px  1px 0 #003366,
         1px  1px 0 #003366;
}

/* ホバー時（カーソルを乗せたとき） */
.main-button:hover {
    background: linear-gradient(180deg, #33ebff, #1ac6ff);
    box-shadow: 0 5px 0 #0077c2, 0 0 15px rgba(0, 229, 255, 0.6);
}

/* クリック時（ボタンが凹むアニメーション） */
.main-button:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #0077c2, 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* ==========================================
   🧰 自作イラスト（鬼の顔）＆ オニ選出セクション
   ========================================== */
.oni-section {
    display: flex;
    flex-direction: column;
    align-items: center; /* 👈 スロットボタン等を真ん中に置く設定 */
    justify-content: center;
}

/* 「鬼をきめよう！」の見出し（h2）の設定 */
.oni-section h2 {
    width: 100%;
    text-align: left;
    margin-top: 0;
    margin-bottom: 20px;
}

/* 「🎰 スロットを回す！」ボタン用の個別幅調整 */
#btn-open-slot {
    max-width: 280px;
    width: 100%;
}

.slot-machine-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px auto;
    max-width: 450px;
    position: relative;
}

/* 👹 鬼の顔コンテナ */
.treasure-chest-container {
    position: relative;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 13 / 12;
    z-index: 1;
}

/* 自作した鬼の顔イラスト */
.chest-image-bg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    pointer-events: none; 
    image-rendering: pixelated;
}

/* 🎰 スロット窓の配置用ラッパー */
.slot-window-wrapper {
    position: absolute;
    top: 26%;       
    left: 15%;     
    width: 70%;   
    height: 50%;   
    z-index: 2;
    overflow: hidden;
    border-radius: 4px;
}

/* 🎰 のぞき窓本体 */
.slot-window {
    background: #000000; 
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.8);
    box-sizing: border-box;
}

/* 🎰 縦に回転するリール本体 */
.slot-reel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0; 
    width: 60%; 
    position: absolute;
    top: 0;
    box-sizing: border-box;
}

/* リール内の各プレイヤー枠 */
.reel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 70px;
    width: 100%;
    background-color: #ffffff; 
    flex-shrink: 0;
    box-sizing: border-box;
}

.reel-item img {
    width: 44px !important;  
    height: 44px !important;
    object-fit: contain !important;
    image-rendering: pixelated !important;
    image-rendering: crisp-edges !important;
}

.reel-item .slot-name {
    font-size: 0.75rem; 
    font-weight: bold;
    color: #1f2833; 
    margin-top: 2px;
    white-space: nowrap; 
}

/* READY文字の初期表示 */
#slot-display-name {
    color: #7f8c8d;
    font-size: 1.1rem;
    font-weight: bold;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000; 
}

/* ==========================================
   🚀 レバーの設定
   ========================================== */
.lever-container {
    position: relative;
    width: 50px;
    height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5; 
}

.lever-base {
    position: absolute;
    bottom: 25px;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #d4af37, #aa7c11);
    border: 3px solid #5c3a21;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    z-index: 7;
}

.lever-shaft {
    position: absolute;
    bottom: 45px;
    width: 10px;
    height: 85px;
    background: linear-gradient(to right, #f1c40f, #f39c12, #d4af37);
    border-radius: 5px;
    transform-origin: bottom center;
    transform: rotate(0deg);
    transition: transform 0.15s ease-in-out;
    cursor: pointer;
    z-index: 6;
}

.lever-ball {
    position: absolute;
    top: -24px;
    left: -12px;
    width: 34px;
    height: 34px;
    background: radial-gradient(circle at 30% 30%, #e67e22, #d35400, #800000);
    border-radius: 50%;
    box-shadow: 0 5px 10px rgba(0,0,0,0.4);
}

.lever-shaft.pulled {
    transform: rotateX(60deg) scaleY(0.5) translateY(40px);
}

/* ==========================================
   確定演出
   ========================================== */
.oni-result-box {
    margin-top: 25px;
    font-weight: bold;
    color: #e74c3c;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(1.05rem, 4.2vw, 1.5rem) !important; 
}

.oni-announced {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.oni-announced img {
    width: 44px !important;
    height: 44px !important;
    object-fit: contain !important;
    image-rendering: pixelated !important;
    image-rendering: crisp-edges !important;
    flex-shrink: 0;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.hit-shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px) rotate(-1deg); }
    40%, 80% { transform: translateX(6px) rotate(1deg); }
}

.flash-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
}

.flash-effect.trigger-flash {
    animation: flashAnim 0.4s ease-out;
}

@keyframes flashAnim {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* 下部の参加メンバー一覧のアイコン */
.player-list img {
    width: 32px !important;
    height: 32px !important;
    object-fit: contain !important;
    image-rendering: pixelated !important;
    image-rendering: crisp-edges !important;
}

.player-list {
    margin-top: 15px;
}

/* -----------------------------------------------------------
   👹 次へ進むアクションボタン（おにごっこレッド版）
----------------------------------------------------------- */
.navigation-area {
    margin-top: 30px;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
}

.btn-next-step {
    background: linear-gradient(180deg, #ff4757, #ff6b81);
    color: #ffffff;
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    font-weight: bold;
    padding: 14px 35px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0px 6px 0px #b32d38, 0px 10px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-next-step span {
    text-shadow: -1px -1px 0 #b32d38, 1px -1px 0 #b32d38, -1px 1px 0 #b32d38, 1px 1px 0 #b32d38;
}

.arrow-icon {
    font-style: normal;
    display: inline-block;
    animation: bounceRight 0.6s infinite alternate;
}

@keyframes bounceRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(4px); }
}

.btn-next-step:active {
    transform: translateY(4px);
    box-shadow: 0px 2px 0px #b32d38, 0px 4px 10px rgba(0, 0, 0, 0.6);
}

/* -----------------------------------------------------------
   🏃‍♂️ おにごっこ種類選択エリア
----------------------------------------------------------- */
.game-selection-section {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.game-card {
    background: #1a252f;
    border: 3px solid #34495e;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: #00daff;
}

.game-card-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.game-card h3 {
    color: #00daff;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.game-card p {
    color: #bdc3c7;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
    min-height: 4.5em;
}

.select-game-btn {
    background: linear-gradient(180deg, #e67e22, #d35400);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 4px 0 #a04000;
}

.select-game-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #a04000;
}

.btn-back {
    background: #7f8c8d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

/* 2. JavaScriptで動的に生成される「鬼は【〜】に決定！」内の枠線を強制作消去 */
#oni-result,
#oni-result *,
.oni-result-box,
.oni-result-box * {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ==========================================
   🚫 コピー・ドラッグ防止設定（追記）
   ========================================== */

/* アプリ全体のテキスト選択（ハイライト）を禁止 */
body {
    -webkit-user-select: none; /* Safari / Chrome */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE / Edge */
    user-select: none;        /* 標準 */
}

/* 画像の長押し保存やドラッグ＆ドロップを防止 */
img {
    pointer-events: none;
    -webkit-user-drag: none;
}

/* ⚠️ 名前入力欄やグループ選択などのフォーム要素は文字入力・操作を許可 */
input, textarea, select {
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
}

/* ----------------------------------
   🧊 氷鬼専用：凍結＆解凍アニメーション
---------------------------------- */

/* 凍結時のカードスタイル（氷のような青い発光と半透明感） */
.counter-card.is-frozen {
    background: rgba(0, 162, 232, 0.25) !important;
    border: 2px solid #00e5ff !important;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.6), inset 0 0 10px rgba(0, 229, 255, 0.4) !important;
    animation: freezePulse 2s infinite alternate;
}

/* 凍結時のパルス（じわじわ光る）アニメーション */
@keyframes freezePulse {
    0% {
        box-shadow: 0 0 10px rgba(0, 229, 255, 0.4), inset 0 0 5px rgba(0, 229, 255, 0.2);
    }
    100% {
        box-shadow: 0 0 20px rgba(0, 229, 255, 0.8), inset 0 0 15px rgba(0, 229, 255, 0.5);
    }
}

/* 解凍（復活）時のキラッと弹けるパッとアニメーション */
.counter-card.is-thawed {
    animation: thawSparkle 0.5s ease-out forwards;
}

@keyframes thawSparkle {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 25px #ffeaa7, 0 0 40px #fdcb6e;
        filter: brightness(1.8);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 35px #ffffff, 0 0 50px #00b894;
    }
    100% {
        transform: scale(1);
        box-shadow: none;
        filter: brightness(1);
    }
}

/* ==========================================
   🧊 エントリーボタンの強制適用（水色化）
   ========================================== */
#btn-entry,
.btn-entry-3d,
.main-button {
    /* 🧊 鮮やかな水色のグラデーション */
    background: linear-gradient(180deg, #00e5ff, #00b0ff) !important; 
    color: #ffffff !important; /* 文字色を白に */
    
    border: none !important;
    border-radius: 8px !important;
    font-size: 1.1rem !important;
    font-weight: bold !important;
    letter-spacing: 1px !important;
    cursor: pointer !important;
    transition: all 0.1s ease !important;
    
    /* 🧊 厚みを感じさせる濃い青色の立体シャドウ */
    box-shadow: 0 5px 0 #0077c2, 0 8px 12px rgba(0, 0, 0, 0.4) !important;
    
    /* 文字のくっきり感を高めるフチ影 */
    text-shadow: 
        -1px -1px 0 #003366,
         1px -1px 0 #003366,
        -1px  1px 0 #003366,
         1px  1px 0 #003366 !important;
}

/* ホバー時（カーソルを乗せたとき） */
#btn-entry:hover,
.btn-entry-3d:hover,
.main-button:hover {
    background: linear-gradient(180deg, #33ebff, #1ac6ff) !important;
    box-shadow: 0 5px 0 #0077c2, 0 0 15px rgba(0, 229, 255, 0.6) !important;
}

/* クリック時（沈み込むアニメーション） */
#btn-entry:active,
.btn-entry-3d:active,
.main-button:active {
    transform: translateY(4px) !important;
    box-shadow: 0 1px 0 #0077c2, 0 2px 5px rgba(0, 0, 0, 0.4) !important;
}