﻿/* Background */
body {
    color:gold;
    background-image: url('/img/field/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

    /* Dark overlay */
    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0); /* start transparent */
        transition: background 1.2s ease; /* smooth fade */
        pointer-events: none;
        z-index: 0;
    }

    /* After load → darker */
    body.loaded::before {
        background: rgba(0, 0, 0, 0.9); /* adjust darkness */
    }
/* 🎮 Wrapper */
.game-wrapper {
    text-align: center;
    color: #f5f5f5;
    font-family: 'Segoe UI', sans-serif;
}

/* 🎖 Title */
.game-title {
    font-size: 36px;
    letter-spacing: 4px;
    margin-bottom: 10px;
    color: #d4af37;
    text-shadow: 2px 2px 5px black;
}

/* Flip button */
.flip-btn {
    margin-bottom: 20px;
    padding: 8px 16px;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s ease;
}

    .flip-btn:hover {
        background: #274c77;
    }

/* 🎖 Board Container */
.board-container {
    display: inline-grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: stretch;
    /*align-items: center;*/
}

/* 🧭 Labels */
.column-labels {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    max-width: 900px;
}

.row-labels {
    display: grid;
    grid-template-rows: repeat(8, 1fr);
}

.label {
    font-weight: bold;
    color: #d4af37;
}

/* 🎖 Military Border Board */
.board {
    width: 90vw;
    max-width: 900px;
    aspect-ratio: 9 / 8;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    padding: 15px;
    border: 8px solid #4b5320; /* military olive */
    border-radius: 20px;
    background: linear-gradient(145deg, #3e432e, #2f3423);
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transition: transform 0.6s ease;
    position: relative;

}

.board-gen-p- {
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    padding: 15px;
    border: 8px solid #4b5320a9; /* military olive */
    border-radius: 20px;
    background: #204b539c;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transition: transform 0.6s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}
.board-gen-e- {
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    padding: 15px;
    border: 8px solid #4b5320a9; /* military olive */
    border-radius: 20px;
    background: #ff000020;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transition: transform 0.6s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.board-gen-e-win {
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    padding: 15px;
    border: 8px solid #4b5320a9; /* military olive */
    border-radius: 20px;
    background: #ff000039;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transition: transform 0.6s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.board-gen-e-lose {
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    padding: 15px;
    border: 8px solid #4b5320a9; /* military olive */
    border-radius: 20px;
    background: #0a561787;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transition: transform 0.6s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.board-gen-p-win {
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    padding: 15px;
    border: 8px solid #4b5320a9; /* military olive */
    border-radius: 20px;
    background: #0a561787;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transition: transform 0.6s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.board-gen-p-lose {
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    padding: 15px;
    border: 8px solid #4b5320a9; /* military olive */
    border-radius: 20px;
    background: #ff000039;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transition: transform 0.6s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}



 🔄 Flip animation 
.flipped {
    transform: rotate(180deg);
}
.flipped .piece {
    transform: rotate(180deg);
}


    .tile:hover {
        box-shadow: 0 0 12px gold;
    }

/* Tile Colors */
.light {
    background-color: #fff;
}

.dark {
    background-color: #fff;
}

/* Dark page background */
body {
    background-color: rgba(0,0,0,0.8);
}


.piece {

    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
    margin:8px; 
    z-index: 10; 

}

.mine {
    background-color: #dddddd;
    color: white;
    border-radius: 10px;
}

.enemy {
    background-color: darkred;
    color: white;
    border-radius: 10px;
}

.selected {
    box-shadow: 0 0 12px gold inset;
    transform: scale(1.1);
}


@keyframes shake {
    0% {
        transform: translate(0, 0)
    }

    25% {
        transform: translate(-5px, 0)
    }

    50% {
        transform: translate(5px, 0)
    }

    75% {
        transform: translate(-5px, 0)
    }

    100% {
        transform: translate(0, 0)
    }
}

.battle {
    animation: shake 0.5s ease-in-out;
    box-shadow: 0 0 20px red inset;
}

.smoke {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(200,200,200,0.8) 0%, rgba(100,100,100,0.6) 50%, transparent 70%);
    animation: smokeFade 0.8s ease-out forwards;
  /*  pointer-events: none;*/
}

@keyframes smokeFade {
    0% {
        opacity: 1;
        transform: scale(0.5);
    }

    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

.victory-banner {
    font-size: 28px;
    color: gold;
    background: #222;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 12px;
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


.possible {
    box-shadow: inset 0 0 15px limegreen;
    cursor: pointer;
}


.normal-move {
    position: relative;
}

    .normal-move::after {
        content: "";
        width: 20px;
        height: 20px;
        background: limegreen;
        border-radius: 50%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        animation: fadeIn 0.2s ease forwards;
    }

.attack-move {
    position: relative;
}

    .attack-move::after {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(255,0,0,0.35);
        animation: fadeIn 0.2s ease forwards;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


.selected-tile {
 background-color: limegreen !important;
}

.player-turn {
   animation: blinkFade 1s  ;
    box-shadow: 0 0 12px gray inset;
}

@keyframes blinkFade {
    0% {
        opacity: 0.7;
    }


    100% {
        opacity: 1;
    }
}


.intro-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.intro-modal {
    position: relative;
    background: #1e1e1e;
    padding: 40px 220px 40px 40px; /* extra RIGHT padding */
    border-radius: 18px;
    width: 600px;
    color: white;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.25);
    overflow: visible;
}

/* RIGHT SIDE OVERLAP */
.assistant-wrapper {
    position: absolute;
    right: -80px; /* pushes outside */
    bottom: -90px;
}

.assistant-img {
    width: 345px;
    max-width: none;
}

/* TEXT */
.intro-text-area {
    position: relative;
}

.intro-title {
    color: gold;
    margin-bottom: 10px;
}

.intro-text {
    font-size: 14px;
    margin-bottom: 18px;
    opacity: 0.85;
}

.general-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 2px solid #444;
    background: #2a2a2a;
    color: gold;
    font-size: 20px; 
    font-weight: 600;
    outline: none;
    transition: all 0.25s ease;
}


    /* Hover effect */
    .general-input:hover {
        border-color: gold;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    }

    /* Focus effect (when typing) */
    .general-input:focus {
        border-color: gold;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
        background: #1f1f1f;
    }

.start-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: gold;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s ease;
}

    .start-btn:hover {
        background: orange;
        transform: scale(1.03);
    }

    .start-btn:disabled {
        background: gray;
        cursor: not-allowed;
    }

.gender-group {
    margin-bottom: 15px;
}

.gender-label {
    font-size: 14px;
    display: block;
    margin-bottom: 6px;
    opacity: 0.85;
}

.gender-options {
    display: flex;
    gap: 20px;
    font-size: 14px;    margin: 8px 0 15px;
}

    .gender-options input {
        margin-right: 6px;
    }


.gender-options {
    display: flex;
    gap: 12px;
    margin: 10px 0 18px;
}

.gender-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: 2px solid #444;
    background: #2a2a2a;
    color: white;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 600;
    width:100%;
}

    /* Hover effect */
    .gender-btn:hover {
        border-color: gold;
        transform: translateY(-2px);
    }

    /* ✅ SELECTED STATE (Yellow Highlight) */
    .gender-btn.active {
        background: gold;
        color: black;
        border-color: gold;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    }

.mode-modal {
    width: 720px;
    padding: 35px;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 18px 0 16px;
}

.mode-card {
    border: 2px solid #444;
    background: #2a2a2a;
    color: white;
    padding: 16px;
    border-radius: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
}
    .mode-card:hover:not(.disabled) {
        border-color: gold;
        transform: translateY(-2px);
    }
    .mode-card b {
        text-align: center;
        display: block;
        margin: 6px 0 6px;
    }

    .mode-card small {
        text-align: center;
        opacity: 0.75;
        display: block;
        font-size: 12px;
    }
    /* Disabled style */
    .mode-card.disabled {
        text-align: center;
        background: #1c1c1c;
        color: #777;
        border-color: #333;
        cursor: not-allowed;
        opacity: 0.7;
    }
.status.available {
    color: #00ff88;
}

.status.unavailable {
    color: #ff5555;
}
    .mode-card:hover {
        text-align: center;
        border-color: gold;
        transform: translateY(-2px);
    }

    .mode-card.active {
        text-align: center;
        background: gold;
        color: black;
        border-color: gold;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    }

.mode-actions {
    gap:15px;
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.back-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: 2px solid #666;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: 0.25s ease;
}

    .back-btn:hover {
        border-color: gold;
        color: gold;
    }



.mode-modal-2 {
    position: relative;
    width: 750px;
    padding: 40px 160px; /* give side spacing */
    overflow: visible;
}

/* LEFT assistant */
.assistant-left {
    position: absolute;
/*    left: -86px;
    bottom: -22px;*/
    left: -142px;
    bottom: -22px;

}
/* LEFT assistant */
.assistant-left-intro {
    position: absolute;
    right: -91px;
    bottom: -25px;
}
/* RIGHT assistant */
.assistant-right {
    position: absolute;
    right: -172px;
    bottom: -40px;
}

.assistant-img-l {
    width: 345px;
    transform: scaleX(-1); /* ✅ horizontal flip */
}

.assistant-img-r {
    width: 400px;
}


.mode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}


/* Base circle */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

    /* 🟢 Available (Blinking) */
    .status-dot.available {
        background: #00ff88;
        box-shadow: 0 0 10px #00ff88;
        animation: blinkGreen 1.2s infinite;
    }

    /* 🔴 Unavailable */
    .status-dot.unavailable {
        background: #ff4444;
        box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
    }

/* Blinking animation */
@keyframes blinkGreen {
    0% {
        opacity: 1;
        box-shadow: 0 0 10px #00ff88;
    }

    50% {
        opacity: 0.4;
        box-shadow: 0 0 20px #00ff88;
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 10px #00ff88;
    }
}


.row-labels {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 300px;
}



.enemy-panel {
    border-left: 5px solid #d9534f;
}

.player-panel {
    border-left: 5px solid #5bc0de;
}



    .selected-preview img {
        display: block;
        margin: 5px auto;
    }

.turn-indicator {
    font-weight: bold;
    font-size: 16px;
}

/* Glow when it's player's turn */
.active-turn {
    animation: pulseTurn 1.5s infinite;
    color: #00ffcc;
}

@keyframes pulseTurn {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}



/* Side column same height as board */
.row-labels {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Make enemy auto size */
.enemy-panel {
    flex: 1; /* takes remaining space */
}

/* Player takes EXACTLY half of board height */
.player-panel {
    height: 50%;
    min-height: 50%;
    overflow: auto;
   
}
    .player-panel::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        height: 80%;
        background: var(--general-bg) no-repeat bottom center;
        background-size: contain;
        opacity: .5;
        pointer-events: none;
    }



    .player-panel::after {
        background: var(--general-bg) no-repeat bottom center;
        background-size: contain;
    }

    /*

.setup-overlay- {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
*/
.setup-overlay {

    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

.setup-header h3 {
    margin: 0 0 6px;
}

.setup-header p {
    margin: 0 0 14px;
    opacity: .85;
}

.setup-pool {
    border: 1px dashed rgba(255,255,255,.25);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255,255,255,.04);
}

.setup-pool-title {
    margin-bottom: 10px;
    opacity: .9;
}

.setup-pool-grid {
    display: grid;
    grid-template-columns: repeat(11, minmax(24px, 1fr));
    gap: 10px;
}

.setup-piece {
    border-radius: 12px;
    padding: 6px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    cursor: grab;
}

    .setup-piece:active {
        cursor: grabbing;
    }

.setup-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}

.setup-hint {
    margin-top: 10px;
    font-size: 12px;
    opacity: .75;
}

    /**/

.setup-modal {
    pointer-events: auto;
    position: fixed;
    width: min(900px, 92vw);
    max-height: 85vh;
    overflow: auto;
    border-radius: 16px;
    padding: 18px;
    background: #1f1f1f;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,.55);
}



.setup-header.draggable {
    cursor: move;
    user-select: none;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.drag-hint {
    opacity: .6;
    font-size: 12px;
}

.drag-ghost {
    position: fixed;
    z-index: 20000;
    width: 60px;
    height: 60px;
    pointer-events: none; /* don't block tiles */
    opacity: 0.9;
    transform: translate(-50%, -50%);
    border-radius: 12px;
    padding: 6px;
    background: #8d8585c1;
    border:  2px solid #000;
    cursor: grab;

}

    .drag-ghost img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        filter: drop-shadow(0 6px 10px rgba(0,0,0,.6));
    }


/* ✅ tile must be relative (you already have this) */
.tile {
    position: relative;
  
}

    .normal-move::after,
    .attack-move::after,
    .tile.move-from::after,
    .tile.move-to::after {
        position: absolute;

        z-index: 1; /* behind piece */
        pointer-events: none;
    }


    /* OLD spot: fade green */
    .tile.move-from {
        animation: moveFadeOut 1.2s ease forwards;
        z-index: 1;
    }

    /* NEW spot: blink/pulse green */
    .tile.move-to {
        animation: moveBlink 1.2s ease-in-out;
        z-index: 1;
    }

/* Fade out: starts strong then disappears */
@keyframes moveFadeOut {
    0% {
        box-shadow: inset 0 0 0 999px rgba(0,255,120,0.55), 0 0 30px rgba(0,255,120,0.85), 0 0 60px rgba(0,255,120,0.65);
        transform: scale(1.03);
    }

    40% {
        box-shadow: inset 0 0 0 999px rgba(0,255,120,0.35), 0 0 22px rgba(0,255,120,0.6);
    }

    100% {
        box-shadow: inset 0 0 0 999px rgba(0,255,120,0.0), 0 0 0 rgba(0,255,120,0.0);
        transform: scale(1);
    }
}

/* Blink: pulse on the tile border/glow so it shows above the piece */
@keyframes moveBlink {
    0% {
        box-shadow: 0 0 0 rgba(0,255,120,0), inset 0 0 0 0 rgba(0,255,120,0);
        transform: scale(1);
    }

    25% {
        box-shadow: 0 0 40px rgba(0,255,120,1), 0 0 80px rgba(0,255,120,0.7), inset 0 0 0 999px rgba(0,255,120,0.35);
        transform: scale(1.06);
    }

    50% {
        box-shadow: 0 0 20px rgba(0,255,120,0.6), inset 0 0 0 999px rgba(0,255,120,0.2);
        transform: scale(1.02);
    }

    75% {
        box-shadow: 0 0 35px rgba(0,255,120,0.9), inset 0 0 0 999px rgba(0,255,120,0.28);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 25px rgba(0,255,120,0.75), inset 0 0 0 999px rgba(0,255,120,0.22);
        transform: scale(1);
    }
}
/* start FX*/

.tile.battle-tile {
    animation: battleRedFade 20s ease-out forwards;
}

@keyframes battleRedFade {
    0% {
        box-shadow: inset 0 0 0 999px rgba(255,0,0,0.35), 0 0 20px rgba(255,0,0,0.75), 0 0 45px rgba(255,0,0,0.5);
    }

    40% {
        inset: 0;
        box-shadow: inset 0 0 0 999px rgba(180,0,0,0.25), 0 0 15px rgba(255,0,0,0.4);
    }

    100% {
        box-shadow: inset 0 0 0 999px rgba(120,0,0,0.08), 0 0 0 rgba(255,0,0,0);
    }
}


.tile.gold-capture {
    animation: goldCapture 10s ease-out;
}

@keyframes goldCapture {
    0% {
        box-shadow: inset 0 0 0 999px rgba(255,215,0,0.10), 0 0 18px rgba(255,215,0,0.65), 0 0 40px rgba(255,215,0,0.45);
        transform: scale(1);
    }

    35% {
        box-shadow: inset 0 0 0 999px rgba(255,215,0,0.28), 0 0 28px rgba(255,215,0,0.95), 0 0 70px rgba(255,215,0,0.55);
        transform: scale(1.04);
    }

    100% {
        box-shadow: inset 0 0 0 999px rgba(255,215,0,0.0), 0 0 0 rgba(255,215,0,0.0);
        transform: scale(1);
    }
}


.shake-board {
    animation: boardShake 220ms ease-in-out;
}

@keyframes boardShake {
    0% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-6px, 3px);
    }

    40% {
        transform: translate(6px, -3px);
    }

    60% {
        transform: translate(-5px, -2px);
    }

    80% {
        transform: translate(5px, 2px);
    }

    100% {
        transform: translate(0, 0);
    }
}


/* ===============================
   PLAYER TURN BLINK (Blue Glow)
=================================*/
.active-player {
    animation: playerPulse 1.5s infinite ease-in-out;
    box-shadow: 0 0 18px rgba(0, 200, 255, 0.6);
}

@keyframes playerPulse {
    0% {
        box-shadow: 0 0 10px rgba(0, 200, 255, 0.4);
        border-left-color: #5bc0de;
    }

    50% {
        box-shadow: 0 0 30px rgba(0, 200, 255, 0.9);
        border-left-color: #00e1ff;
    }

    100% {
        box-shadow: 0 0 10px rgba(0, 200, 255, 0.4);
        border-left-color: #5bc0de;
    }
}


/* ===============================
   ENEMY TURN BLINK (Red Glow)
=================================*/
.active-enemy {
    animation: enemyPulse 1.5s infinite ease-in-out;
    box-shadow: 0 0 18px rgba(255, 60, 60, 0.6);
}

@keyframes enemyPulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 60, 60, 0.4);
        border-left-color: #d9534f;
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 60, 60, 0.9);
        border-left-color: #ff2a2a;
    }

    100% {
        box-shadow: 0 0 10px rgba(255, 60, 60, 0.4);
        border-left-color: #d9534f;
    }
}

/* End FX*/






/* player panel*/
.player-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    position: relative;
    overflow: visible; 

}

/* Top section */
.player-header {
    display: flex;

    display: flex;
    justify-content: center;
    align-items: center;
}

/* Text block */
.player-info h4 {
    margin: 0;
    text-align:center
}

.player-info p {
    margin: 4px 0 0;
}

/* General image on top-right */
.general-img {
    width: 110px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5));
}

    /* Optional: slight hover animation */
    .general-img:hover {
        transform: scale(1.05);
        transition: 0.2s ease;
    }

.general-float {
    position: absolute;
    right: -23%;
    bottom: -6%;
    width: 71%;
    max-width: 320px;
    min-width: 180px;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    z-index: 50;
    filter: drop-shadow(0 12px 18px rgba(0,0,0,0.65));
}

/* Optional: boost on your turn */
.player-panel.active-player .general-float {
    filter: drop-shadow(0 14px 22px rgba(0,0,0,0.7)) drop-shadow(0 0 18px rgba(0, 225, 255, 0.35));
}

.hero-subtitle-left {
    font-size: 15px;
    letter-spacing: 1.5px;
    color: #cccccc;

    margin: 0 auto;

    text-align: left;
}


.selected-preview {
    margin-top: -17px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start; /* ✅ align left */
}

/* Make preview look like actual board piece */
.preview-piece {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    /* Match board piece styles */
    .preview-piece.mine {
        background-color: #dddddd;
    }

    .preview-piece.enemy {
        background-color: red;
    }

    /* Inner image */
    .preview-piece img {
        width: 80%;
        height: auto;
        object-fit: contain;
    }

/* Optional subtle glow */
.preview-piece {
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}
/*end player pannel*/


.setup-actions {
    display: flex;
    justify-content: space-between; /* pushes left & right apart */
    align-items: center;
    margin-top: 20px;
}

.setup-left {
    display: flex;
    gap: 10px; /* spacing between Random & Undo */
}

.setup-actions .btn-primary {
    min-width: 120px;
    font-weight: bold;
}

.btn-primary:not(:disabled) {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

/* --- Ready button FX --- */
.ready-btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

    /* Pulse only when enabled */
    .ready-btn:not(:disabled) {
        animation: readyPulse 1.2s ease-in-out infinite;
    }

        /* subtle sweep highlight */
        .ready-btn:not(:disabled)::after {
            content: "";
            position: absolute;
            top: -20%;
            left: -35%;
            width: 30%;
            height: 140%;
            background: rgba(255, 255, 255, 0.25);
            transform: skewX(-20deg);
            animation: readySweep 1.6s ease-in-out infinite;
            pointer-events: none;
        }

/* Slide-in when setup becomes complete (apply class from code) */
.ready-slidein {
    animation: readySlideIn 420ms cubic-bezier(.2,.9,.2,1) both;
}

/* Optional: disabled style still feels “locked” */
.ready-btn:disabled {
    opacity: 0.6;
    filter: grayscale(0.2);
}

/* Animations */
@keyframes readyPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255,215,0,0.0);
    }

    55% {
        transform: scale(1.03);
        box-shadow: 0 0 18px rgba(255,215,0,0.55);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255,215,0,0.0);
    }
}

@keyframes readySweep {
    0% {
        left: -35%;
        opacity: 0;
    }

    25% {
        opacity: 1;
    }

    60% {
        left: 120%;
        opacity: 0;
    }

    100% {
        left: 120%;
        opacity: 0;
    }
}

@keyframes readySlideIn {
    0% {
        transform: translateX(18px);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.enemy-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.ztop {
z-index:999
}
.enemy-modal {
    padding-right: 126px !important;
    background: rgba(10, 14, 12, 0.92);
    border: 1px solid rgba(120,170,120,0.22);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.65);
    animation: enemyIn 220ms ease-out both;
    color: #e7efe7;
    max-width: 650px;
}

@keyframes enemyIn {
    from {
        transform: translateY(10px) scale(0.98);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.enemy-badge {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(104,255,127,0.10);
    border: 1px solid rgba(104,255,127,0.25);
    margin-bottom: 10px;
}

.enemy-title {
    margin: 0;
    font-size: 22px;
    letter-spacing: 1px;
}

.enemy-sub {
    margin: 8px 0 0 0;
    opacity: 0.8;
    line-height: 1.45;
}

.enemy-status {
    margin-top: 18px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.enemy-loading {
    display: flex;
    gap: 12px;
    align-items: center;
}

.enemy-loading-text small {
    display: block;
    opacity: 0.75;
    margin-top: 4px;
}

.spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: rgba(104,255,127,0.95);
    animation: spin 800ms linear infinite;
    flex: 0 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.enemy-ready {
    font-weight: 600;
    letter-spacing: 0.4px;
}

.enemy-actions {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}



.intro-actions {
    display: flex;
    gap: 12px; /* spacing between buttons */
    margin-top: 18px;
}

.abort-btn {
    flex: 0 0 30%; /* fixed 30% width */
}

.continue-btn {
    flex: 0 0 70%; /* fixed 70% width */
    font-weight: bold;
    letter-spacing: 1px;
}

.continue-btn:not(:disabled) {
    box-shadow: 0 0 18px rgba(13, 110, 253, 0.6);
    transition: all 0.25s ease;
}

    .continue-btn:not(:disabled):hover {
        transform: translateY(-2px);
        box-shadow: 0 0 25px rgba(13, 110, 253, 0.9);
    }


.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.confirm-modal {
    width: min(420px, 92vw);
    background: #121826;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 12px 40px rgba(0,0,0,.45);
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}



.victory-icon {
    font-size: 60px;
    animation: bounce 1s infinite alternate;
}

.victory-title {
    font-size: 42px;
    font-weight: 800;
    color: gold;
    margin-top: 10px;
    text-shadow: 0 0 15px gold;
}

.victory-winner {
    margin-top: 10px;
    font-size: 24px;
    font-family: "Gugi";
}

.victory-sub {
    opacity: .8;
    margin-top: 5px;
}

.victory-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes popIn {
    from {
        transform: scale(.8);
        opacity: 0
    }

    to {
        transform: scale(1);
        opacity: 1
    }
}

@keyframes bounce {
    from {
        transform: translateY(0)
    }

    to {
        transform: translateY(-10px)
    }
}

.victory-overlay-win {
    position: fixed;
    inset: 0;
    background: rgb(7, 122, 3, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}


.victory-overlay-lose {
    position: fixed;
    inset: 0;
    background: rgba(255,0,0,.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.victory-modal {
    position: relative; /* IMPORTANT */
    text-align: center;
    padding: 40px;
    border-radius: 20px;
    background: linear-gradient(145deg,#1b2433,#0f1622);
    box-shadow: 0 0 40px rgba(255,215,0,.6);
    color: white;
    width: min(650px, 92vw);
    overflow: visible;
}

/* RIGHT CHARACTER */
.victory-assistant-right {
    position: absolute;
    right: -160px; /* pushes outside modal */
    bottom: -40px;
}

.victory-assistant-img-r {
    width: 350px;
  /*  animation: floatChar 3s ease-in-out infinite;*/
}

/* Floating animation */
@keyframes floatChar {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}
.battle-report {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.15);
}

.report-title {
    text-align: center;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 1px;
    opacity: .9;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.report-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* pushes content */
    min-height: 160px; /* ensures equal height */
    padding: 12px;
    border-radius: 10px;
    background: rgba(0,0,0,.25);
}

.report-content {
    margin-top: auto; /* forces stats to bottom */
}

    .report-col h4 {
        text-align: center;
        margin-bottom: 8px;
        font-weight: 700;
    }

.player-col {
    border: 1px solid rgba(0,200,255,.4);
}

.enemy-col {
    border: 1px solid rgba(255,80,80,.4);
}

.report-stat {
    font-size: 14px;
    margin: 4px 0;
    opacity: .9;
    text-align:left;
}
.match-timer {
    position: fixed;
  
    z-index: 1000;
    padding: 8px 12px;
    border-radius: 10px;
    /*background: rgba(0,0,0,.55);
    border: 1px solid rgba(255,255,255,.15);*/
    font-weight: 700;
    letter-spacing: 1px;
}
/*
.debug-console {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 200px;
    background: #0b0f14;
    border-top: 2px solid #00ff90;
    color: #00ff90;
    font-family: monospace;
    font-size: 12px;
    z-index: 9999;
}
*/
.debug-chat {
    position: fixed;
    right: 12px;
    top: 90px;
    z-index: 99999;
    /* pointer-events: none;  board remains clickable */
}

.debug-portal {
    position: fixed;
    left: 12px;
    top: 90px;
    z-index: 99999;
   /* pointer-events: none;  board remains clickable */
}

.debug-console {
    left: 0;
    width: 300px;
    text-align: left !important;
    border-top: 2px solid #00ff90;
    color: #00ff90;
    font-family: monospace;
    font-size: 10px;
    z-index: 9999;
}

.debug-header {
    background: rgba(255,255,255,0.09);
    padding: 10px 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px;
    color: white !important;
    font-size: 15px;
}

.debug-btn-danger {
    border-radius: 10px !important;
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}
    .debug-body {
    padding: 8px 0px;
    overflow-y: auto;
    height: calc(100vh - 160px);
    display: flex;
    flex-direction: column-reverse;
    /*background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);*/
}

.debug-line {
    margin-bottom: 4px;
}

/* ===== Custom Scrollbar ===== */
.debug-body::-webkit-scrollbar {
    width: 8px;
}

.debug-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.debug-body::-webkit-scrollbar-thumb {

    border-radius: 10px;

    transition: all 0.2s ease;
    background: linear-gradient( 180deg, rgba(0, 200, 120, 0.8), rgba(0, 150, 80, 0.8) );
    box-shadow: 0 0 8px rgba(0, 255, 150, 0.5);
}

    .debug-body::-webkit-scrollbar-thumb:hover {
        background: linear-gradient( 180deg, rgba(0, 200, 120, 0.8), rgba(0, 150, 80, 0.8) );
        box-shadow: 0 0 8px rgba(0, 255, 150, 0.5);
    }

.debug-body {
    scrollbar-width: thin;
    scrollbar-color: rgb(34, 78, 2, 0.65)  rgba(255, 255, 255, 0.05);
}


.panel-content {
    flex: 1;
}

/* Graveyard section */
.graveyard {
    margin-top: auto;
  /*  border-top: 1px solid rgba(255,255,255,.15);*/
    padding: 8px;
 /*   background: rgba(0,0,0,.35);*/
}

.graveyard-title {
    font-size: 12px;
    font-weight: 600;
    opacity: .8;
    margin-bottom: 6px;
    text-align: center;
}

.graveyard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;

    width: 167px;
}

.grave-piece-enemy {
    width: 30px;
    height: 30px;

    border: solid 1px red;
    border-radius: 5px;
    background-color: red;
}
.grave-piece-player {
    width: 30px;
    height: 30px;
    border: solid 1px white;
    border-radius: 5px;
    background-color: white;
}

.board-flash {
    animation: warFlash 0.3s ease-in-out 4;
}

@keyframes warFlash {
    0% {
        background-color: rgba(255,0,0,0);
    }

    50% {
        background-color: rgba(255,0,0,0.35);
    }

    100% {
        background-color: rgba(255,0,0,0);
    }
}

.board-disabled {
    pointer-events: none;
    opacity: 0.8;
}

.win-tile {
    background-color: green !important;
    
}
.lose-tile {
 background-color: red !important

}

.tile-losing-flag {
    background-color: gold;
    animation: losingPulse 0.6s ease-in-out infinite alternate;
}

.tile-winning-flag {
    background-color: gold;
    animation: winningGlow 0.8s ease-in-out infinite alternate;
}

@keyframes losingPulse {
    from {
        box-shadow: 0 0 10px rgba(255,0,0,0.6);
    }

    to {
        box-shadow: 0 0 30px rgba(255,0,0,1);
    }
}

@keyframes winningGlow {
    from {
        box-shadow: 0 0 10px rgba(0,255,0,0.6);
    }

    to {
        box-shadow: 0 0 35px rgba(0,255,0,1);
    }
}


/* container that holds enemy + mid + player should be position:relative */
.row-labels {
    position: relative;
}

/* floating panel sits between enemy and player areas */
.mid-float-panel {
    position: absolute;
    left: 50%;
    top: 49%;
    transform: translate(-50%, -50%);
    z-index: 80;
    pointer-events: none; /* allow board clicks through except buttons */
}





.mid-title {
    font-weight: 800;
    letter-spacing: 0.12em;
    font-size: 12px;
    opacity: 0.9;
}

.mid-sub {
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.8;
}

.mid-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: center;
}

.mid-btn {
    color: white;
    height: 44px;
    width: 300px;
    border: 0;
    border-radius: 12px;
    /* font-weight: 700; */
    font-size: 20px;
    cursor: pointer;
    transition: transform .12s ease, opacity .12s ease;
    margin-top: 20px;
    margin-left: -110px;
    font-family: 'Gugi';
}

    .mid-btn:active {
        transform: scale(0.98);
    }

    .mid-btn[disabled] {
        opacity: 0.45;
        cursor: not-allowed;
    }

.mid-btn-primary {
    margin-left: -74px;
    background: #FFC107;
    border: 5px solid rgb(255 210 73);
    animation: battleGlowPulsebBtn 1.2s ease-in-out infinite;
}

.mid-btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.mid-result {
    margin-top: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 999px;
}

    .mid-result.win {
        background: rgba(0, 180, 0, 0.18);
        border: 1px solid rgba(0, 255, 0, 0.35);
    }

    .mid-result.lose {
        background: rgba(255, 0, 0, 0.18);
        border: 1px solid rgba(255, 0, 0, 0.35);
    }

.mid-card {
    pointer-events: auto;
  
    padding: 12px 14px;

    text-align: center;
    transition: all .3s ease;
    gap: 5px;
    display: flex;
    flex-direction: column;
}




/* 🔥 WHEN THERE IS A WINNER */
.mid-card-result {
    flex-direction: row;
    justify-content: left;
    gap: 0px;
    margin-left: -81px;
}

.img-x-battle {
    width: 130px;
    transition: all 0.3s ease;
    z-index:100;
}
.mid-card-result .img-x-battle {
    width: 65px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8)) drop-shadow(0 0 18px rgba(255, 200, 0, 0.9)) drop-shadow(0 0 35px rgba(255, 180, 0, 1));
    animation: battleGlowPulse 1.2s ease-in-out infinite;
}
@keyframes battleGlowPulsebBtn {
    0% {
        filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 1px rgba(255, 200, 0, 0.7)) drop-shadow(0 0 5px rgba(255, 180, 0, 0.8));
    }

    50% {
        filter: drop-shadow(0 0 4px rgba(255, 235, 120, 1)) drop-shadow(0 0 2px rgba(255, 210, 0, 1)) drop-shadow(0 0 10px rgba(255, 190, 0, 1));
    }

    100% {
        filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 1px rgba(255, 200, 0, 0.7)) drop-shadow(0 0 5px rgba(255, 180, 0, 0.8));
    }
}

@keyframes battleGlowPulse {
    0% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 18px rgba(255, 200, 0, 0.7)) drop-shadow(0 0 25px rgba(255, 180, 0, 0.8));
    }

    50% {
        filter: drop-shadow(0 0 12px rgba(255, 235, 120, 1)) drop-shadow(0 0 28px rgba(255, 210, 0, 1)) drop-shadow(0 0 45px rgba(255, 190, 0, 1));
    }

    100% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 18px rgba(255, 200, 0, 0.7)) drop-shadow(0 0 25px rgba(255, 180, 0, 0.8));
    }
}
/* Slightly bigger icon when match ends */
.mid-card-result .img-x-battle {
    width: 150px;
}

.mid-result {
    font-weight: 900;
    letter-spacing: 0.12em;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 999px;
}

    .mid-result.win {
        background: rgba(0, 180, 0, 0.2);
        border: 1px solid rgba(0, 255, 0, 0.5);
    }

    .mid-result.lose {
        background: rgba(255, 0, 0, 0.2);
        border: 1px solid rgba(255, 0, 0, 0.5);
    }

@media (max-width: 1873px) {
    .chat-console,
    .debug-console {
        display: none !important;
    }
}

.chat-console {
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    width: 300px;
    position: absolute;
  /* right: 0 position: fixed;*/
    right: 12px;
    bottom: 12px;
    top: auto;
    z-index: 99999;
    pointer-events: none;


}
    .chat-console * {
        pointer-events: auto;
    }

/* HEADER */
.chat-header {
    padding: 10px 14px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    background: rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-status {
    font-size: 11px;
    color: #ff4d4d;
}

/* BODY */
.chat-body {
 
    padding: 8px 0px;
    overflow-y: auto;
    height: calc(100vh - 170px);
    display: flex;
    flex-direction: column-reverse;

}

/* MESSAGE CONTAINER */
.chat-message {
 /*   display: flex;*/
}

    .chat-message.player {
        justify-content: flex-end;
    }

    .chat-message.enemy {
        justify-content: flex-start;
    }

/* CHAT BUBBLE */
.chat-bubble {
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    background: rgba(255,255,255,0.08);
}

/* Player bubble style */
.chat-message.player .chat-bubble {
    background: rgba(255, 215, 0, 0.2);
}

/* INPUT AREA */
.chat-input {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
}

    .chat-input input {
        flex: 1;
        padding: 8px;
        border-radius: 8px;
        border: none;
        font-size: 12px;
    }

    .chat-input button {
        padding: 8px 12px;
        border-radius: 8px;
        border: none;
        font-weight: 600;
        cursor: not-allowed;
        opacity: 0.6;
    }