/* style-game.css - VMO Board Game: In-Game Battle Layout & UI Components */

/* --- ゲーム画面背景設定 --- */
#screen-game {
   background-image: 
    linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.2)), 
    url('img/bg916.webp');

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* --- ゲーム画面トップバー --- */
.game-top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    height: 30px;
}

.turn-indicator {
    font-family: 'Teko', sans-serif;
    font-size: 1.8rem;
    color: #fbbf24;
    text-shadow: 0 0 5px rgba(251, 191, 36, 0.5);
    white-space: nowrap;
}

.btn-small {
    background: #0f172a;
    border: 1px solid #334155;
    color: #94a3b8;
    font-family: 'Teko', sans-serif;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* --- 敵エリア (上段) --- */
.area-enemy {
    width: 100%;
    height: 130px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    gap: 4px;
}

.deck-left-container {
    width: 100px;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    justify-content: center;
    align-content: center;
}

.deck-card {
    width: 100%;
    height: 100%;
    background-image: url('img/card.webp'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid #64748b;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Teko', sans-serif;
    font-size: 0.7rem;       
    font-weight: bold;       
    color: #ffffff;          
    text-shadow:             
        2px 0 0 #000, -2px 0 0 #000,
        0 2px 0 #000, 0 -2px 0 #000,
        1px 1px 0 #000, -1px -1px 0 #000,
        1px -1px 0 #000, -1px 1px 0 #000;
    letter-spacing: 0.1em;
    writing-mode: horizontal-tb;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    cursor: default;
    box-sizing: border-box;
    text-align: center;
    line-height: 1;
}

.enemy-slot.boss {
    height: 100%;
    aspect-ratio: 1 / 1;
    background: #0f172a;
    border: 1px solid #ef4444;
    border-radius: 6px;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
    overflow: hidden;
    transition: transform 0.2s, opacity 0.3s;
    opacity: 0;
}

.enemy-slot.boss.charging {
    box-shadow: 0 0 30px #ef4444;
    border-color: #fca5a5;
    transform: scale(1.05);
}

.enemy-slot.boss::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(239, 68, 68, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(239, 68, 68, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
    pointer-events: none;
}

.card-name {
    z-index: 2;
    font-size: 0.9rem;
    font-family: 'Teko', sans-serif;
    color: #fff;
    text-shadow: 0 0 3px #ef4444;
    position: absolute;
    top: 2px;
    left: 0;
    width: 100%;
    text-align: center;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
}

.hp-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 14px;
    background: #1e293b;
    z-index: 5;
    border: none;
    overflow: visible;
    margin: 0;
    border-radius: 0;
}

.hp-fill {
    height: 100%;
    background: linear-gradient(to right, #22c55e, #4ade80);
    transition: width 0.3s;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.card-hp-text-boss {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Teko', sans-serif;
    font-size: 0.85rem;
    color: #fff;
    text-shadow: 0 0 3px #000;
    line-height: 1;
    z-index: 10;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.card-img-placeholder {
    z-index: 1;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Teko', sans-serif;
    color: #ef4444;
    font-size: 2.2rem;
    opacity: 0.8;
}

.act-container {
    position: absolute;
    bottom: 18px; 
    left: 0;
    width: 100%;
    display: flex;
    justify-content: flex-start; /* 左揃えに変更 */
    padding-left: 6px;           /* 左端に少し隙間を空ける */
    align-items: center;
    gap: 3px;
    z-index: 10;
    box-sizing: border-box;      
}

.act-label {
    font-family: 'Teko', sans-serif;
    font-size: 0.8rem;
    color: #ef4444;
    margin-right: 2px;
    text-shadow: 0 0 2px #000;
}

.act-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #334155;
    box-shadow: 0 0 2px #000;
}

.act-dot.boss-dot {
    background: #ef4444;
    box-shadow: 0 0 5px #ef4444;
}

.intent-right-container {
    width: 95px; /* ★修正: パディング分を含めて少し拡大 */
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px dashed #475569;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px; /* ★修正: 2px -> 6px に増やして余白確保 */
    text-align: center;
    box-sizing: border-box;
}

.intent-label {
    font-family: 'Teko', sans-serif;
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

.intent-display {
    width: 100%;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 0.75rem;
    font-weight: bold;
    color: #ef4444;
    word-break: break-all;
    opacity: 0;
}

/* --- 中央エリア (中段) --- */
.area-center {
    width: 100%;
    flex-grow: 0;
    min-height: auto;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 6px;
    border: 1px dashed #334155;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    padding: 5px;
    position: relative;
    box-sizing: border-box;
}

.game-guide {
    width: 100%;
    text-align: center;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: bold;
    font-size: 0.85rem;
    color: #fbbf24;
    background: rgba(15, 23, 42, 0.9);
    height: 28px;
    line-height: 28px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0;
    border-radius: 4px;
    margin-bottom: 4px;
    border: 1px solid #fbbf24;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
    z-index: 100;
}

.info-log {
    width: 100%;
    height: 35px;
    overflow-y: hidden; /* バーは隠すが、JSでスクロールさせる */
    
    font-size: 0.7rem;
    color: #94a3b8; /* ★フォント指定は削除し、元の設定のみにします */
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 4px;
    border-radius: 4px;
    border-left: 2px solid #475569;
    margin-bottom: 4px;

    /* ★追加: 確実に上から下へ積む設定 */
    display: block; 
}

.info-log p {
    margin: 1px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    line-height: 1.3;
}

/* --- 3Dダイスエリア --- */
.dice-area {
    width: 100%;
    height: 80px;
    min-height: 80px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 10px 10px 10px 10px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    perspective: 800px;
}

.dice-area::-webkit-scrollbar { display: none; }

.dice-scene {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    perspective: 400px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.dice-cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: translateZ(-25px);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dice-face {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid #94a3b8;
    background-color: #f8fafc;
    box-sizing: border-box;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #0f172a;
    backface-visibility: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

/* ダイス面 (SVG) */
.dice-face.face-1 { transform: rotateY(  0deg) translateZ(25px); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='12' fill='%230f172a'/%3E%3C/svg%3E"); }
.dice-face.face-2 { transform: rotateY( 90deg) translateZ(25px); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='25' cy='25' r='10' fill='%230f172a'/%3E%3Ccircle cx='75' cy='75' r='10' fill='%230f172a'/%3E%3C/svg%3E"); }
/* ★修正箇所: rotateY(180deg) を rotateY(-180deg) に変更 */
.dice-face.face-3 { transform: rotateY(-180deg) translateZ(25px); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='25' cy='25' r='10' fill='%230f172a'/%3E%3Ccircle cx='50' cy='50' r='10' fill='%230f172a'/%3E%3Ccircle cx='75' cy='75' r='10' fill='%230f172a'/%3E%3C/svg%3E"); }
.dice-face.face-4 { transform: rotateY(-90deg) translateZ(25px); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='25' cy='25' r='10' fill='%230f172a'/%3E%3Ccircle cx='75' cy='25' r='10' fill='%230f172a'/%3E%3Ccircle cx='25' cy='75' r='10' fill='%230f172a'/%3E%3Ccircle cx='75' cy='75' r='10' fill='%230f172a'/%3E%3C/svg%3E"); }
.dice-face.face-5 { transform: rotateX( 90deg) translateZ(25px); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='25' cy='25' r='10' fill='%230f172a'/%3E%3Ccircle cx='75' cy='25' r='10' fill='%230f172a'/%3E%3Ccircle cx='25' cy='75' r='10' fill='%230f172a'/%3E%3Ccircle cx='75' cy='75' r='10' fill='%230f172a'/%3E%3Ccircle cx='50' cy='50' r='10' fill='%230f172a'/%3E%3C/svg%3E"); }
.dice-face.face-6 { transform: rotateX(-90deg) translateZ(25px); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='25' cy='20' r='10' fill='%230f172a'/%3E%3Ccircle cx='75' cy='20' r='10' fill='%230f172a'/%3E%3Ccircle cx='25' cy='50' r='10' fill='%230f172a'/%3E%3Ccircle cx='75' cy='50' r='10' fill='%230f172a'/%3E%3Ccircle cx='25' cy='80' r='10' fill='%230f172a'/%3E%3Ccircle cx='75' cy='80' r='10' fill='%230f172a'/%3E%3C/svg%3E"); }
.dice-face { background-size: 70%; background-repeat: no-repeat; background-position: center; }

@keyframes tumble {
    0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(360deg) rotateY(720deg) rotateZ(360deg); }
}

.dice-cube.rolling {
    animation: tumble 0.6s linear infinite;
}

.dice-cube.show-1 { transform: translateZ(-25px) rotateY(   0deg); }
.dice-cube.show-2 { transform: translateZ(-25px) rotateY( -90deg); }
.dice-cube.show-3 { transform: translateZ(-25px) rotateY(-180deg); }
.dice-cube.show-4 { transform: translateZ(-25px) rotateY(  90deg); }
.dice-cube.show-5 { transform: translateZ(-25px) rotateX( -90deg); }
.dice-cube.show-6 { transform: translateZ(-25px) rotateX(  90deg); }

.dice-scene.selected .dice-cube {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}
.dice-scene.selected .dice-face {
    border-color: #3b82f6;
    background-color: #dbeafe;
}

.dice-scene.used .dice-cube {
    opacity: 0.4;
    filter: grayscale(100%);
    pointer-events: none;
}

.btn-end-turn {
    position: sticky;
    right: 0;
    top: auto; 
    transform: none; 
    
    width: 50px;
    height: 50px;
    background: #b91c1c;
    border: 2px solid #f87171;
    border-radius: 50%;
    color: #fff;
    font-family: 'Teko', sans-serif;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(185, 28, 28, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    z-index: 50; 
    flex-shrink: 0; 
    margin-left: auto; 
}

.btn-end-turn:hover {
    background: #dc2626;
    transform: scale(1.05); 
}

.btn-end-turn:active {
    transform: scale(0.95);
}

.btn-end-turn span {
    font-size: 0.9rem;
    margin-top: 2px;
}

#btn-roll-dice {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
}

#btn-roll-dice button {
    background: linear-gradient(to bottom, #fbbf24, #d97706);
    border: 2px solid #fffbeb;
    border-radius: 8px;
    padding: 0 20px;
    height: 40px;
    font-family: 'Teko', sans-serif;
    font-size: 1.4rem;
    color: #000;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.8);
    animation: pulseBtn 1s infinite;
}

/* --- プレイヤーエリア (下段) --- */
.area-player {
    width: 100%;
    margin-bottom: 5px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; 
}

.player-slots-container {
    display: flex;
    gap: 4px;
    width: 100%;
    margin-bottom: 5px;
    flex-shrink: 0;
}

.card-slot {
    flex: 1;
    aspect-ratio: 1/1;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.1s;
}

.card-slot.selected {
    border: 2px solid #fbbf24;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
    z-index: 5;
}

.hp-bar-mini {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 14px;
    background: #334155;
    z-index: 2;
}

.hp-fill-mini {
    height: 100%;
    background: #22c55e;
    transition: width 0.2s;
}

.card-visual {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.act-indicator-player {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 5px #4ade80;
    z-index: 25;
    animation: blinkGreen 1.5s infinite;
}

.buff-badge {
    position: absolute;
    top: 15px; 
    right: 2px;
    font-family: 'Teko', sans-serif;
    font-size: 0.7rem;
    color: #fbbf24;
    background: rgba(0, 0, 0, 0.6);
    padding: 0 3px;
    border-radius: 3px;
    border: 1px solid #fbbf24;
    z-index: 30;
    text-shadow: 0 0 2px #000;
}

.card-player-name {
    position: absolute;
    top: 2px;
    left: 2px;
    bottom: auto;
    width: auto;
    text-align: left;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 0.55rem; 
    font-weight: bold;
    color: #fff;
    pointer-events: none;
    line-height: 1;
    z-index: 10;
    
    text-shadow: 
        -1px -1px 0 #000, 1px -1px 0 #000,
        -1px 1px 0 #000, 1px 1px 0 #000;
}

.card-name-overlay {
    position: absolute;
    bottom: 16px;
    width: 100%;
    text-align: center;
    font-family: 'Teko', sans-serif;
    font-size: 0.7rem;
    color: #fff;
    pointer-events: none;
    line-height: 1;
    z-index: 10;
    
    text-shadow: 
        -1px -1px 0 #000, 1px -1px 0 #000,
        -1px 1px 0 #000, 1px 1px 0 #000;
}

.card-icon {
    font-size: 1.6rem;
    opacity: 0.5;
    margin-top: 8px;
}

.card-hp-text {
    position: absolute;
    bottom: 2px;
    width: 100%;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Teko', sans-serif;
    font-size: 0.8rem;
    color: #fff;
    text-shadow: 0 0 2px #000;
    pointer-events: none;
    z-index: 20;
    font-weight: bold;
}

.shield-badge {
    position: absolute;
    right: 0;  
    bottom: 0; 
    
    font-family: 'Teko', sans-serif;
    font-size: 0.85rem; 
    font-weight: bold;
    color: #fff;
    
    background: linear-gradient(135deg, #3b82f6, #1e3a8a); 
    border: 1px solid #dbeafe; 
    box-shadow: 0 0 4px rgba(59, 130, 246, 0.8);
    
    min-width: 16px;
    height: 14px;
    display: flex; 
    align-items: center;
    justify-content: center; 
    
    padding: 0 2px;
    border-radius: 3px 0 0 0; 
    line-height: 1; 
    z-index: 30; 
    white-space: nowrap;
}

.attr-badge-mini {
    font-size: 0.55rem; 
    padding: 0 2px;
    border-radius: 2px;
    margin-left: 2px;
    color: #fff;
    vertical-align: middle;
    border: 1px solid rgba(255,255,255,0.3);
}

.type-fire { background-color: #ef4444; }
.type-water { background-color: #3b82f6; }
.type-grass { background-color: #22c55e; }
.type-light { background-color: #eab308; }
.type-dark { background-color: #64748b; }
.type-neutral { background-color: #94a3b8; }

.status-row {
    position: absolute;
    top: 14px; 
    left: 2px;
    display: flex;
    flex-wrap: wrap; 
    gap: 1px;
    z-index: 20;
    pointer-events: none;
    max-width: 90%;
}

.status-icon {
    font-size: 0.65rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    background: rgba(0,0,0,0.6);
    padding: 0 2px;
    border-radius: 2px;
    white-space: nowrap;
    line-height: 1.1;
}

.status-icon.poison { color: #d8b4fe; } 
.status-icon.stun { color: #facc15; }   
.status-icon.debuff { color: #93c5fd; } 
.status-icon.buff { color: #fca5a5; }   
.status-icon.init { color: #4ade80; }

.status-icon.evade { color: #bae6fd; }

.dice-cube.is-omni .dice-face {
    background-color: #fef3c7; 
    border-color: #fbbf24;
    box-shadow: inset 0 0 10px #fbbf24;
}
.dice-cube.is-omni .dice-face::after {
    content: '★';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    color: #fbbf24;
}

.action-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    overflow-y: auto; 
    padding-bottom: 20px;
    flex-grow: 1;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.action-panel::-webkit-scrollbar {
    width: 4px;
}
.action-panel::-webkit-scrollbar-thumb {
    background-color: #334155;
    border-radius: 4px;
}

/* ★修正: 親コンテナをFlexboxに変更して両端揃え */
.btn-action {
    display: flex;
    justify-content: space-between; /* 名前(左)と情報パネル(右)を分ける */
    align-items: center;
    padding: 6px 10px;
    min-height: 45px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    text-align: left;
    transition: transform 0.1s;
    position: relative;
    flex-shrink: 0;
}

.btn-action:active { transform: translateY(1px); }

/* ★修正: 右側グループのコンテナ */
.act-right-panel {
    display: flex;
    align-items: center;
    gap: 6px; /* 要素間の隙間 */
}

.act-lamp {
    width: 10px;
    height: 10px;
    background: #0f172a;
    border-radius: 50%;
    border: 1px solid #334155;
    box-shadow: inset 0 0 3px #000;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-action.ready .act-lamp {
    background: #4ade80;
    border-color: #22c55e;
    box-shadow: 0 0 8px #4ade80, inset 0 0 2px #fff;
}

/* ★修正: 文字サイズを再調整 */
.act-name {
    font-weight: bold;
    font-size: 0.65rem; /* 0.75 -> 0.65 (文字数対応のため少し縮小) */
    letter-spacing: -0.05em; 
    line-height: 1.1;
    display: flex;
    flex-direction: column;
}

/* ★修正: 文字サイズ微増 */
.act-desc {
    font-size: 0.65rem; /* 0.6 -> 0.65 */
    color: #94a3b8;
    font-weight: normal;
    margin-top: 1px;
    letter-spacing: 0; 
}

.act-pow {
    font-family: 'Teko', sans-serif;
    font-size: 1.0rem;
    text-align: center;
    color: #fbbf24;
    width: 35px; /* 固定幅 */
}

.act-req {
    font-family: 'Teko', sans-serif;
    font-size: 0.65rem;
    text-align: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    padding: 0 2px;
    white-space: nowrap;
    letter-spacing: -0.05em;
    /* ★修正: 幅を固定して位置を揃える */
    width: 50px;
    box-sizing: border-box;
    /* パディングを含めて幅計算 */
}

.btn-action.atk {
    background: linear-gradient(to right, #7f1d1d, #450a0a);
    border-color: #ef4444;
}

.btn-action.skl {
    background: linear-gradient(to right, #1e3a8a, #172554);
    border-color: #3b82f6;
}

.btn-action:disabled {
    cursor: default;
    opacity: 0.7; 
    filter: grayscale(0.5);
}

#modal-overlay {
    display: none;
    z-index: 9000; 
}

#modal-overlay.active {
    display: flex;
}

.anim-ripple-blue {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 5px solid #60a5fa;
    box-shadow: 0 0 15px #3b82f6;
    opacity: 0;
    pointer-events: none;
    background: transparent;
    animation: rippleSimple 0.6s ease-out forwards;
}

@keyframes rippleSimple {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.0); border-width: 5px; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2.0); border-width: 0px; }
}

/* --- 敵専用：黒ダイス --- */
.dice-face.enemy {
    background-color: #0f172a; /* 黒に近い紺色 */
    border-color: #475569;
    box-shadow: inset 0 0 5px rgba(255,255,255,0.1);
}

/* 黒ダイスのドットを白くするSVG上書き */
.dice-face.enemy.face-1 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='12' fill='%23ffffff'/%3E%3C/svg%3E"); }
.dice-face.enemy.face-2 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='25' cy='25' r='10' fill='%23ffffff'/%3E%3Ccircle cx='75' cy='75' r='10' fill='%23ffffff'/%3E%3C/svg%3E"); }
.dice-face.enemy.face-3 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='25' cy='25' r='10' fill='%23ffffff'/%3E%3Ccircle cx='50' cy='50' r='10' fill='%23ffffff'/%3E%3Ccircle cx='75' cy='75' r='10' fill='%23ffffff'/%3E%3C/svg%3E"); }
.dice-face.enemy.face-4 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='25' cy='25' r='10' fill='%23ffffff'/%3E%3Ccircle cx='75' cy='25' r='10' fill='%23ffffff'/%3E%3Ccircle cx='25' cy='75' r='10' fill='%23ffffff'/%3E%3Ccircle cx='75' cy='75' r='10' fill='%23ffffff'/%3E%3C/svg%3E"); }
.dice-face.enemy.face-5 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='25' cy='25' r='10' fill='%23ffffff'/%3E%3Ccircle cx='75' cy='25' r='10' fill='%23ffffff'/%3E%3Ccircle cx='25' cy='75' r='10' fill='%23ffffff'/%3E%3Ccircle cx='75' cy='75' r='10' fill='%23ffffff'/%3E%3Ccircle cx='50' cy='50' r='10' fill='%23ffffff'/%3E%3C/svg%3E"); }
.dice-face.enemy.face-6 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='25' cy='20' r='10' fill='%23ffffff'/%3E%3Ccircle cx='75' cy='20' r='10' fill='%23ffffff'/%3E%3Ccircle cx='25' cy='50' r='10' fill='%23ffffff'/%3E%3Ccircle cx='75' cy='50' r='10' fill='%23ffffff'/%3E%3Ccircle cx='25' cy='80' r='10' fill='%23ffffff'/%3E%3Ccircle cx='75' cy='80' r='10' fill='%23ffffff'/%3E%3C/svg%3E"); }

/* 敵ダイスロール用オーバーレイ */
.enemy-roll-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2800;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.enemy-roll-overlay.active { opacity: 1; }

.enemy-roll-area {
    display: flex;
    gap: 20px;
    perspective: 800px;
    margin-bottom: 20px;
}

.enemy-roll-total {
    font-family: 'Teko', sans-serif;
    font-size: 4rem;
    color: #ef4444;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.8);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.enemy-roll-total.show { opacity: 1; transform: scale(1); }

/* NEXT ACTIONエリア用: 確率表 */
.intent-table {
font-size: 0.75rem; 
    /* ★追加: プロジェクト標準のモダンなフォントを適用 */
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 500; /* 少し太くして視認性アップ */
    letter-spacing: -0.05em; /* 文字間を少し詰める */
    
    color: #cbd5e1;
    width: 100%;
    line-height: 1.4; /* 行間も少し広げて見やすく */
    text-align: left;
    margin-top: 5px;
}
.intent-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* 薄い線を入れて見やすく */
    padding: 1px 0;
}
.intent-val { 
    color: #fbbf24; 
    font-family:'Teko'; 
    margin-right: 4px; /* ★修正: 8px -> 4px に詰めてスペース確保 */
    min-width: 35px;   /* ★修正: 40px -> 35px に微調整 */
}

.intent-act { 
    color: #fff; 
    text-align: right;
    flex: 1;
    white-space: nowrap; /* ★追加: 強制的に1行にする */
}
.intent-danger { color: #ef4444; font-weight:bold; }