@import url('https://fonts.googleapis.com/css2?family=Imbue&family=Roboto+Mono:wght@500&display=swap');

/* 基本スタイル設定 */
body {
    font-family: 'Roboto Mono', monospace;
    background-color: #111827; /* gray-900 */
    color: #fbbf24;
    touch-action: manipulation;
    overflow: hidden; /* 全体スクロール防止 */
    user-select: none;
    -webkit-user-select: none;
}

h1, h2, h3, .casino-font { font-family: 'Imbue', serif; }
::-webkit-scrollbar { width: 0px; background: transparent; }

/* ボール関連スタイル */
#ballsWrapper {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 10;
}

.ball-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    transform: rotate(0deg);
}

.ball {
    width: 14px; height: 14px;
    background: radial-gradient(circle at 30% 30%, #ffffff, #d1d5db);
    border-radius: 50%;
    position: absolute;
    top: 12px; left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: top 0.3s ease-out;
}

/* ホイール外枠とエフェクト */
.wheel-rim {
    border: 12px solid #553e20; border-radius: 50%;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 10px 20px rgba(0,0,0,0.5);
    background: #2f2f2f;
    cursor: default;
}
.wheel-rim.target-mode {
    cursor: crosshair;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
    border-color: #fbbf24;
    animation: pulse-rim 2s infinite;
}
@keyframes pulse-rim {
    0% { border-color: #fbbf24; box-shadow: 0 0 20px rgba(251, 191, 36, 0.8); }
    50% { border-color: #fff; box-shadow: 0 0 40px rgba(255, 255, 255, 0.6); }
    100% { border-color: #fbbf24; box-shadow: 0 0 20px rgba(251, 191, 36, 0.8); }
}

/* ベットテーブルのセルスタイル */
.bet-cell {
    transition: all 0.05s; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; position: relative; user-select: none;
    text-align: center; line-height: 1.1; width: 100%; height: 100%;
}
.bet-cell:hover { filter: brightness(1.2); }
.bet-cell:active { transform: scale(0.95); filter: brightness(1.4); }

/* スキルターゲット選択時のハイライト */
.bet-cell.selectable-target {
    box-shadow: inset 0 0 0 2px #fbbf24;
    background-color: rgba(251, 191, 36, 0.2);
    z-index: 20; 
    animation: pulse-border 1.5s infinite;
}
@keyframes pulse-border {
    0% { box-shadow: inset 0 0 0 2px #fbbf24; }
    50% { box-shadow: inset 0 0 0 4px #fbbf24, inset 0 0 10px #fbbf24; }
    100% { box-shadow: inset 0 0 0 2px #fbbf24; }
}

/* ポケット数表示 */
.pocket-count {
    position: absolute; top: 2px; left: 3px; font-size: 9px;
    color: rgba(255, 255, 255, 0.7); pointer-events: none;
    line-height: 1; font-family: sans-serif;
}

/* 倍率表示 */
.payout-rate {
    position: absolute; bottom: 2px; left: 3px; font-size: 8px;
    color: rgba(251, 191, 36, 0.8); pointer-events: none;
    line-height: 1; font-family: sans-serif; transition: all 0.3s;
}
.payout-rate.boosted {
    color: #ef4444; font-weight: bold; font-size: 10px;
    text-shadow: 0 0 5px rgba(239, 68, 68, 0.8);
}

/* チップマーカー */
.chip-marker {
    position: absolute; width: 20px; height: 20px;
    background: radial-gradient(circle at 30% 30%, #fbbf24, #d97706);
    border: 1px dashed #fff; border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.6);
    color: #000; font-size: 9px; display: flex; align-items: center;
    justify-content: center; font-weight: bold; z-index: 5; pointer-events: none;
    top: 2px; right: 2px;
    left: auto;
    transform: none;
}
.chip-marker.high-value {
    background: radial-gradient(circle at 30% 30%, #ef4444, #991b1b);
    color: white; border-color: #fca5a5;
}

/* テーブル配色クラス */
.bg-num-red { background-color: #b91c1c; color: white; }
.bg-num-black { background-color: #1f2937; color: white; }
.bg-num-green { background-color: #047857; color: white; }
.bg-table-base { background-color: #064e3b; color: white; }

.glass-panel {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

/* スキルカードスタイル */
.skill-card {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border: 1px solid #4b5563; 
    border-radius: 8px; padding: 4px;
    cursor: pointer; transition: transform 0.2s, border-color 0.2s;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    width: 100px; min-width: 100px;
    height: 100%; position: relative; overflow: hidden;
    flex-shrink: 0;
}
.skill-card:hover:not(.disabled) {
    transform: translateY(-2px); border-color: #fbbf24;
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}
.skill-card.disabled {
    opacity: 0.5; cursor: not-allowed; filter: grayscale(100%);
}
.skill-cost {
    position: absolute; top: 1px; right: 3px; font-size: 9px; color: #fbbf24; font-weight: bold;
}

/* ショップエリア背景 */
.shop-area-bg {
    background-color: #b91c1c;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* ゲームエリア（緑）背景 */
.game-green-bg {
    background-color: #064e3b;
}

/* 内部シャドウ用オーバーレイ */
.inner-shadow-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.6);
}

@keyframes winPulse {
    0% { border-color: rgba(255,255,255,0.2); }
    50% { border-color: #fbbf24; background-color: rgba(251, 191, 36, 0.4); }
    100% { border-color: rgba(255,255,255,0.2); }
}
.win-highlight { animation: winPulse 1.5s infinite; z-index: 10; border: 2px solid #fbbf24 !important; }

.win-floating-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: #fbbf24; font-weight: 900; font-size: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); pointer-events: none; z-index: 20;
    animation: floatUp 2s forwards; background: rgba(0,0,0,0.85);
    padding: 4px 8px; border-radius: 6px; border: 1px solid #fbbf24; white-space: nowrap;
}
@keyframes floatUp {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    15% { transform: translate(-50%, -120%) scale(1.2); opacity: 1; }
    80% { transform: translate(-50%, -180%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -220%) scale(0.8); opacity: 0; }
}

/* 獲得クレジット演出 */
.credits-gain-float {
    position: absolute;
    left: 50%; top: 100%;
    transform: translateX(-50%);
    color: #fbbf24; font-weight: 900; font-size: 32px;
    text-shadow: 0 0 15px rgba(251, 191, 36, 1);
    pointer-events: none; z-index: 50;
    animation: floatCredits 2s forwards ease-out;
    white-space: nowrap;
}
@keyframes floatCredits {
    0% { transform: translate(-50%, 0) scale(0.5); opacity: 0; }
    10% { transform: translate(-50%, 20px) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, 150px) scale(1); opacity: 0; }
}

.bet-amt-btn.active { background-color: #fbbf24; color: #000; border-color: #d97706; font-weight: bold; }

/* プログレスバー */
.progress-bar-bg { background: #374151; height: 8px; width: 100%; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { background: #fbbf24; height: 100%; width: 0%; transition: width 0.5s ease-out; }

/* ショップUIレイアウト */
.shop-selection-container {
    display: flex; gap: 8px; align-items: center; justify-content: center; height: 100%; width: 100%;
}
.shop-selection-info {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 60px; margin-right: 4px;
}
.shop-selection-title {
    font-size: 10px; color: #fbbf24; font-weight: bold; white-space: nowrap;
}

/* ミニカード（スキル選択用） */
.choice-card-mini {
    background: #1f2937; border: 2px solid #4b5563; border-radius: 6px;
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-weight: bold; font-size: 14px; color: white;
    transition: all 0.2s; position: relative; flex-shrink: 0;
}
.choice-card-mini:hover { border-color: #fbbf24; transform: scale(1.1); }
.choice-card-mini.is-red { background: #b91c1c; }
.choice-card-mini.is-black { background: #111827; }
.choice-card-mini.is-green { background: #047857; }

.choice-card-mini.source-selected {
    border-color: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 1); transform: scale(1.1);
}
.choice-card-mini.source-selected::after {
    content: "FROM"; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
    background: #fbbf24; color: black; font-size: 8px; padding: 0 2px; border-radius: 2px; font-weight: bold; line-height: 1;
}

.choice-card-mini.target-selected {
    border-color: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 1); transform: scale(1.1);
}
.choice-card-mini.target-selected::after {
    content: "TO"; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
    background: #ef4444; color: white; font-size: 8px; padding: 0 2px; border-radius: 2px; font-weight: bold; line-height: 1;
}

.choice-card-mini.boost-selected {
    border-color: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 1); transform: scale(1.1);
}

/* 点滅ハイライトアニメーション */
@keyframes highlight-flash {
    0% { background-color: rgba(251, 191, 36, 0); color: inherit; transform: scale(1); box-shadow: none; border-color: transparent; }
    20% { background-color: #fbbf24; color: #000; transform: scale(1.1); box-shadow: 0 0 20px #fbbf24; border-color: #fff; z-index: 50; }
    40% { background-color: rgba(251, 191, 36, 0); color: inherit; transform: scale(1); box-shadow: none; border-color: transparent; z-index: auto; }
    60% { background-color: #fbbf24; color: #000; transform: scale(1.1); box-shadow: 0 0 20px #fbbf24; border-color: #fff; z-index: 50; }
    80% { background-color: rgba(251, 191, 36, 0); color: inherit; transform: scale(1); box-shadow: none; border-color: transparent; z-index: auto; }
    100% { background-color: rgba(251, 191, 36, 0); color: inherit; transform: scale(1); box-shadow: none; border-color: transparent; }
}
.flash-highlight {
    animation: highlight-flash 1.2s ease-out;
    position: relative;
}

/* ボール発光アニメーション */
@keyframes ball-flash-anim {
    0% { transform: translateX(-50%) scale(1); filter: brightness(1); }
    25% { transform: translateX(-50%) scale(1.8); filter: brightness(3); box-shadow: 0 0 15px #fff; background: #fff; }
    50% { transform: translateX(-50%) scale(1); filter: brightness(1); }
    75% { transform: translateX(-50%) scale(1.8); filter: brightness(3); box-shadow: 0 0 15px #fff; background: #fff; }
    100% { transform: translateX(-50%) scale(1); filter: brightness(1); }
}
.ball-flash-effect {
    animation: ball-flash-anim 1.0s ease-out !important;
}
