/* --- CLIM＠X！ UI Style (Large Scale) --- */

body { background: #000; color: #fff; font-family: 'Impact', 'Meiryo', sans-serif; margin: 0; overflow: hidden; font-size: 150%; }
#game-ui { display: flex; flex-direction: column; height: 100vh; background-image: url('assets/casino_bg.png'); background-size: cover; background-position: center; }

header { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.8); padding: 10px 20px; border-bottom: 3px solid #d4af37; flex-shrink: 0; z-index: 50; position: relative; }
#title-area { display: flex; align-items: baseline; gap: 20px; }
h1 { color: #d4af37; margin: 0; font-size: 36px; letter-spacing: 2px; }
.player-header-slot { background: rgba(255,255,255,0.1); padding: 6px 18px; border-radius: 5px; border-left: 6px solid #ff6600; display: flex; align-items: center; gap: 12px; }
.player-header-slot .label { color: #ff6600; font-size: 18px; font-weight: bold; }
#player-miss-count { font-size: 24px; font-weight: bold; }
#turn-indicator { color: #00ffff; font-weight: bold; font-size: 24px; }

#stage-main { flex-grow: 1; position: relative; display: flex; justify-content: center; align-items: flex-end; overflow: hidden; }

#voltage-display { position: absolute; top: 15px; width: 100%; text-align: center; z-index: 20; }
#voltage-number { font-size: 120px; font-weight: 900; color: #fff; text-shadow: 0 0 30px #f00; margin: 0; line-height: 1; }
#voltage-gauge-container { width: 450px; margin: 10px auto; }
#voltage-gauge { height: 15px; background: #222; border-radius: 8px; overflow: hidden; border: 2px solid #444; }
#gauge-fill { height: 100%; background: linear-gradient(90deg, #0f0, #ff0, #f00); transition: 0.4s; }

/* 対戦相手の配置（文字1.5倍に伴う被り回避） */
#rivals-container { 
    position: absolute; 
    bottom: 35%; 
    width: 95%; 
    display: flex; 
    justify-content: space-around; 
    z-index: 15; 
}

#rival-2 { margin-bottom: 40px; }

.rival-slot { display: flex; flex-direction: column; align-items: center; background: transparent; border: none; cursor: pointer; }

.status-area {
    background: rgba(0, 0, 0, 0.85); border: 4px solid #ff00ff; border-radius: 12px;
    padding: 15px 25px; margin-bottom: -40px; z-index: 6; position: relative;
    box-shadow: 0 0 20px #ff00ff;
}
.rival-name { font-size: 48px; color: #00ffff; border-bottom: 3px solid #666; margin-bottom: 8px; text-shadow: 0 0 8px #00ffff; line-height: 1.1; }
.stats { font-size: 36px; color: #fff; font-weight: bold; }
.uo-container { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.uo-dot { width: 24px; height: 24px; background: #333; border-radius: 50%; } 
.uo-dot.active { background: #ff6600; box-shadow: 0 0 15px #ff6600; }

.cpu-avatar { width: 260px; height: auto; position: relative; z-index: 5; transition: 0.3s; }
.rival-slot.active .status-area { border-color: #00ffff; box-shadow: 0 0 40px #00ffff; }

/* テーブルの調整（見切れないように高さを抑える） */
#casino-table-container {
    position: absolute; bottom: -20px; 
    width: 1200px; height: 400px;
    z-index: 10; 
    perspective: 1000px;
}
#casino-table {
    width: 100%; height: 100%; background-image: url('assets/table_felt.png'); background-size: 100% 100%;
    border-radius: 50%; transform: rotateX(45deg); box-shadow: 0 40px 80px rgba(0,0,0,0.9);
    display: flex; justify-content: center; align-items: center;
}

.card-slot { width: 180px; height: 252px; border: 4px dashed rgba(255,255,255,0.4); border-radius: 12px; transform: translateZ(20px); }
.card-slot.card-placed { border: 4px solid #ff00ff; box-shadow: 0 0 40px #ff00ff; background: rgba(0,0,0,0.5); }

#action-log { 
    position: absolute; bottom: 20px; left: 15px; width: 500px; height: 200px; 
    background: rgba(0, 0, 0, 0.9); overflow-y: auto; padding: 15px; font-size: 21px; 
    border-radius: 8px; border-left: 8px solid #d4af37; color: #eee; font-family: monospace; 
    z-index: 30; line-height: 1.5;
}
.log-effect { color: #ff00ff; font-weight: bold; }

/* フッター・手札 */
footer { background: rgba(0,0,0,0.95); border-top: 4px solid #d4af37; padding: 15px 0; z-index: 100; position: relative; }
#player-hand { display: flex; justify-content: center; gap: 15px; min-height: 230px; margin-top: 10px; }

.card { width: 150px; height: 210px; border: 3px solid #fff; border-radius: 10px; background: #fff; overflow: hidden; cursor: pointer; transition: 0.2s; }
.card:hover { transform: translateY(-40px); box-shadow: 0 0 30px #00ffff; }
.card-inner { width: 100%; height: 100%; position: relative; }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.card-fallback { position: absolute; top:0; left:0; width:100%; height:100%; display: flex; flex-direction: column; justify-content: space-between; padding: 12px; background: rgba(0,0,0,0.5); }

.top-label { font-size: 42px; font-weight: bold; color: #00ffff; text-shadow: 2px 2px 6px #000; line-height: 1; }
.bottom-name { font-size: 22px; color: #fff; text-align: center; white-space: nowrap; line-height: 1.2; }

#uo-usage-area { display: flex; justify-content: center; margin-bottom: 10px; }
.uo-btn { background: #ff6600; color: #fff; font-weight: bold; border: none; padding: 12px 35px; border-radius: 8px; cursor: pointer; font-size: 24px; transition: 0.2s; }
.uo-btn:hover { background: #ff8800; transform: scale(1.05); }

.card-animating { position: fixed; z-index: 1000; width: 180px; height: 252px; border: 4px solid #00ffff; border-radius: 12px; pointer-events: none; transition: 0.5s; background: #111; }

/* タイトル画面 */
#title-screen {
    position: absolute; top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: url('assets/casino_bg.png'); background-size: cover; background-position: center;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 200;
}
.main-title {
    font-size: 180px; color: #d4af37; text-shadow: 0 0 40px #000; text-align: center; margin-bottom: 60px;
    font-family: 'Impact', sans-serif; letter-spacing: 12px; line-height: 1.1; font-style: italic;
}
.menu-buttons button {
    display: block; width: 420px; padding: 25px; margin: 20px auto;
    font-size: 39px; font-weight: bold; background: rgba(0,0,0,0.8); color: #d4af37;
    border: 4px solid #d4af37; border-radius: 12px; cursor: pointer; transition: 0.3s;
    font-family: 'Impact', 'Meiryo', sans-serif; letter-spacing: 3px;
}
.menu-buttons button:hover { background: #d4af37; color: #000; box-shadow: 0 0 30px #d4af37; }

/* マニュアル */
#manual-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85); z-index: 300;
    display: flex; justify-content: center; align-items: center;
}
.manual-content {
    background: #111; color: #eee; width: 90%; max-width: 1000px; height: 85%;
    padding: 40px; border: 4px solid #d4af37; border-radius: 15px;
    overflow-y: auto; position: relative; font-family: 'Meiryo', sans-serif; line-height: 1.6;
    font-size: 24px;
}
.manual-text h2, .manual-text h3 { color: #d4af37; border-bottom: 2px solid #d4af37; padding-bottom: 10px; margin-top: 30px; }
#btn-close-manual {
    position: absolute; top: 15px; right: 25px; font-size: 60px; font-weight: bold;
    background: none; border: none; color: #d4af37; cursor: pointer; transition: 0.2s;
}