/* ==========================================================================
   VOIDCALL - BATTLEFIELD 6x5 GRID & PIECES
   ========================================================================== */

.battlefield-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.battlefield-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 6px;
    width: 100%;
    aspect-ratio: 5 / 6;
    background: rgba(14, 10, 30, 0.7);
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--border-glass);
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.8),
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(160, 130, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
}

/* Individual Slot */
.grid-slot {
    aspect-ratio: 1;
    background: rgba(22, 18, 44, 0.45);
    border: 1.5px dashed rgba(160, 130, 255, 0.2);
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.grid-slot:hover {
    background: rgba(35, 28, 68, 0.6);
    border-color: rgba(190, 160, 255, 0.4);
}

.grid-slot.occupied {
    border-style: solid;
    border-color: rgba(160, 130, 255, 0.35);
    background: rgba(16, 12, 34, 0.6);
}

/* Coordinate indicator (subtle) */
.slot-coord {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 8px;
    color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
    pointer-events: none;
    display: none; /* Can be toggled in settings */
}

/* Highlight: Valid Movement */
.grid-slot.highlight-move {
    background: rgba(0, 242, 254, 0.18) !important;
    border: 2px solid #00f2fe !important;
    box-shadow: 0 0 16px rgba(0, 242, 254, 0.6), inset 0 0 10px rgba(0, 242, 254, 0.3);
    animation: movePulse 1.4s infinite ease-in-out;
    cursor: pointer;
}

.grid-slot.highlight-move::after {
    content: '◆';
    position: absolute;
    font-size: 14px;
    color: #00f2fe;
    opacity: 0.8;
    filter: drop-shadow(0 0 6px #00f2fe);
}

/* Highlight: Valid Capture (Attack) */
.grid-slot.highlight-capture {
    background: rgba(255, 42, 109, 0.28) !important;
    border: 2px solid #ff2a6d !important;
    box-shadow: 0 0 20px rgba(255, 42, 109, 0.8), inset 0 0 12px rgba(255, 42, 109, 0.4);
    animation: capturePulse 1.1s infinite ease-in-out;
    cursor: pointer;
}

.grid-slot.highlight-capture::after {
    content: '⚔';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 14px;
    color: #ff2a6d;
    filter: drop-shadow(0 0 8px #ff2a6d);
    z-index: 10;
}

/* Highlight: Valid Summon (Row 5 or Row 0) */
.grid-slot.highlight-summon {
    background: rgba(255, 215, 0, 0.18) !important;
    border: 2px solid #ffd700 !important;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.6), inset 0 0 10px rgba(255, 215, 0, 0.3);
    animation: summonPulse 1.5s infinite ease-in-out;
    cursor: pointer;
}

.grid-slot.highlight-summon::after {
    content: '✦';
    position: absolute;
    font-size: 14px;
    color: #ffd700;
    filter: drop-shadow(0 0 6px #ffd700);
}

/* Highlight: Spell Target */
.grid-slot.highlight-spell {
    background: rgba(160, 130, 255, 0.25) !important;
    border: 2px solid #b388ff !important;
    box-shadow: 0 0 18px rgba(179, 136, 255, 0.7);
    cursor: pointer;
}

/* Source piece selected for movement */
.grid-slot.selected-source {
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.8);
    transform: scale(1.04);
    z-index: 20;
}

/* Trap Indicator (owner only or revealed) */
.grid-slot.trap-active::before {
    content: '⚡';
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 14px;
    color: #b388ff;
    text-shadow: 0 0 8px #7209b7;
    animation: trapFloat 2s infinite ease-in-out alternate;
    z-index: 8;
}

@keyframes trapFloat {
    0% { transform: translateY(0); opacity: 0.7; }
    100% { transform: translateY(-3px); opacity: 1; }
}

/* Piece Placed on Battlefield */
.board-piece {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-size: cover;
    background-position: center top;
    transition: transform 0.2s ease;
}

.board-piece-p0 {
    border: 2px solid rgba(0, 242, 254, 0.5);
    box-shadow: inset 0 0 8px rgba(0, 242, 254, 0.3);
}

.board-piece-p1 {
    border: 2px solid rgba(255, 42, 109, 0.5);
    box-shadow: inset 0 0 8px rgba(255, 42, 109, 0.3);
}

/* Name banner on board piece */
.piece-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    padding: 2px 1px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: capitalize;
}

/* King distinction on board */
.board-piece.is-king {
    border-color: var(--gold-accent) !important;
    box-shadow: 0 0 12px rgba(255, 183, 3, 0.6) !important;
}

.board-piece.is-king .piece-label {
    background: linear-gradient(90deg, rgba(255, 183, 3, 0.8), rgba(255, 100, 0, 0.8));
    color: #000;
    font-weight: 900;
}

/* Status Overlays on Board Pieces */
/* 1. Divine Shield */
.board-piece.shielded::after {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border: 2.5px solid #ffd700;
    border-radius: 10px;
    box-shadow: 0 0 14px #ffd700, inset 0 0 8px rgba(255, 215, 0, 0.4);
    animation: shieldSpin 3s linear infinite;
    pointer-events: none;
    z-index: 12;
}

@keyframes shieldSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 2. Frozen in Time */
.board-piece.frozen {
    filter: brightness(0.8) hue-rotate(180deg);
}

.board-piece.frozen::before {
    content: '❄️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    filter: drop-shadow(0 0 8px #00e5ff);
    z-index: 14;
    animation: freezeShiver 1.5s infinite ease-in-out;
}

@keyframes freezeShiver {
    0%, 100% { transform: translate(-50%, -50%) rotate(-3deg); }
    50% { transform: translate(-50%, -50%) rotate(3deg); }
}

/* 3. Glacial Wall Barrier */
.grid-slot.has-barrier {
    background: radial-gradient(circle, rgba(0, 229, 255, 0.4) 0%, rgba(10, 30, 60, 0.8) 100%) !important;
    border: 2px solid #00e5ff !important;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
}

.grid-slot.has-barrier::before {
    content: '🧊';
    position: absolute;
    font-size: 24px;
    filter: drop-shadow(0 0 10px #00e5ff);
    z-index: 10;
}

/* Keyframes */
@keyframes movePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(0, 242, 254, 0.5); }
    50% { transform: scale(1.03); box-shadow: 0 0 20px rgba(0, 242, 254, 0.8); }
}

@keyframes capturePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 42, 109, 0.6); }
    50% { transform: scale(1.04); box-shadow: 0 0 24px rgba(255, 42, 109, 1); }
}

@keyframes summonPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(255, 215, 0, 0.5); }
    50% { transform: scale(1.03); box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}
