/* ========== BOARD SHELL ========== */
.board-shell {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.board-header h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.board-header span {
    font-size: 11px;
    color: var(--text-tertiary);
    background: var(--bg-main);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* ========== BOARD FRAME ========== */
.ludo-board-wrap {
    border-radius: var(--radius-md);
    padding: 4px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

/* ========== BOARD GRID ========== */
.ludo-board {
    width: min(100%, 980px);
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 1px;
    position: relative;
    background: #EEF0F4;
    border-radius: 8px;
    overflow: hidden;
}

/* ========== HOME BASES (4x4) ========== */
.quad {
    border-radius: 10px;
    margin: 3px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}


.quad-red {
    grid-column: 1 / 6; grid-row: 1 / 6;
    background: #FCA5A5;
}

.quad-blue {
    grid-column: 11 / 16; grid-row: 1 / 6;
    background: #93C5FD;
}

.quad-green {
    grid-column: 1 / 6; grid-row: 11 / 16;
    background: #86EFAC;
}

.quad-yellow {
    grid-column: 11 / 16; grid-row: 11 / 16;
    background: #FDE68A;
}

/* ========== HOME BOX ========== */
.home-box {
    width: 70%;
    height: 70%;
    border-radius: 0;
    border: none;
    background: transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px;
}

.home-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.home-subtitle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.35);
    letter-spacing: 0.5px;
}

.home-planes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    width: 82%;
}

.plane-dot {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.45);
    font-size: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.plane-dot.off {
    opacity: 0.25;
    border-style: dashed;
    background: rgba(255, 255, 255, 0.1);
}

.plane-dot.hangar-slot {
    padding: 2px;
    overflow: visible;
    position: relative;
}

.plane-dot.hangar-slot .plane-piece {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

/* ========== CROSS PATH BACKGROUND ========== */
.cross-v {
    grid-column: 6 / 11;
    grid-row: 1 / 16;
    border-radius: 0;
    background: #F5F6F8;
    z-index: 0;
}

.cross-h {
    grid-column: 1 / 16;
    grid-row: 6 / 11;
    border-radius: 0;
    background: #F5F6F8;
    z-index: 0;
}

/* ========== TRACK CELLS ========== */
.track-cell {
    grid-column: var(--c);
    grid-row: var(--r);
    border-radius: 4px;
    margin: 1px;
    position: relative;
    z-index: 3;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.track-cell:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

/* ---- Cell colors (softer pastel tones) ---- */
.seg-red { background: #FCA5A5; border-color: rgba(239, 68, 68, 0.2); }
.seg-blue { background: #93C5FD; border-color: rgba(59, 130, 246, 0.2); }
.seg-yellow { background: #FDE68A; border-color: rgba(245, 158, 11, 0.2); }
.seg-green { background: #86EFAC; border-color: rgba(16, 185, 129, 0.2); }
.seg-neutral { background: #F3F4F6; border-color: rgba(0, 0, 0, 0.04); }

/* ---- White dot (classic style) ---- */
.track-cell::before {
    content: '';
    position: absolute;
    width: 46%;
    height: 46%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ---- Cell number ---- */
.cell-no {
    font-size: 7px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.3px;
    color: rgba(0, 0, 0, 0.45);
    position: relative;
    z-index: 1;
}

/* ---- Cell mark badge ---- */
.cell-mark {
    min-width: 12px;
    height: 10px;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 5px;
    font-weight: 800;
    line-height: 1;
    padding: 0 2px;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.mark-reward { color: #059669; }
.mark-risk { color: #DC2626; }
.mark-neutral { color: #6B7280; }
.mark-trap { color: #EA580C; }

/* ========== JUMP NODES ========== */
.jump-node {
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.9),
        0 0 0 3.5px rgba(0, 0, 0, 0.08);
}

.jump-node::after {
    content: "\2708";
    position: absolute;
    right: -1px;
    top: -1px;
    font-size: 7px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1;
    background: rgba(0,0,0,0.25);
    border-radius: 0 4px 0 4px;
    padding: 1px 2px;
}

/* ========== RUNWAY CELLS ========== */
.runway-cell {
    grid-column: var(--c);
    grid-row: var(--r);
    border-radius: 50%;
    z-index: 1;
    margin: 14%;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.runway-red { background: #FCA5A5; }
.runway-blue { background: #93C5FD; }
.runway-yellow { background: #FDE68A; }
.runway-green { background: #86EFAC; }

.runway-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 1;
}

/* ========== CENTER STAR ========== */
.center-star {
    grid-column: 6 / 11;
    grid-row: 6 / 11;
    z-index: 2;
    border-radius: 8px;
    overflow: hidden;
    background:
        conic-gradient(from 315deg at 50% 50%,
            #93C5FD 0deg,   #93C5FD 90deg,
            #FDE68A 90deg,  #FDE68A 180deg,
            #86EFAC 180deg, #86EFAC 270deg,
            #FCA5A5 270deg, #FCA5A5 360deg
        );
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.05);
}

.center-star::after {
    content: '\1F3C6';
    font-size: 28px;
    line-height: 1;
    width: 36%;
    height: 36%;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: finish-glow 3s ease-in-out infinite;
}

@keyframes finish-glow {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    50% { box-shadow: 0 2px 16px rgba(79,70,229,0.15), 0 2px 8px rgba(0,0,0,0.1); }
}

/* ========== FINISH HUB ========== */
.finish-hub {
    grid-column: 6 / 11;
    grid-row: 6 / 11;
    z-index: 5;
    position: relative;
    pointer-events: none;
}

.finish-slot {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
}

.finish-slot:nth-child(2) {
    top: 0; left: 20%; right: 20%; height: 42%;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.finish-slot:nth-child(4) {
    top: 20%; right: 0; bottom: 20%; width: 42%;
    clip-path: polygon(100% 50%, 0% 100%, 0% 0%);
}

.finish-slot:nth-child(3) {
    bottom: 0; left: 20%; right: 20%; height: 42%;
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
}

.finish-slot:nth-child(1) {
    top: 20%; left: 0; bottom: 20%; width: 42%;
    clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
}

.finish-label {
    font-size: 9px;
    color: rgba(0, 0, 0, 0.4);
    font-weight: 900;
    letter-spacing: 1px;
}

/* ========== JUMP OVERLAY (SVG) ========== */
.jump-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.jump-line {
    fill: none;
    stroke-width: 0.6;
    stroke-dasharray: 2 1;
    opacity: 0.35;
}

.jump-dot {
    r: 0.6;
    opacity: 0.5;
}

/* ========== CELL PULSE ANIMATION ========== */
.track-cell.pulse {
    animation: cell-pulse 0.4s ease;
}

@keyframes cell-pulse {
    0% { transform: scale(1); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
    40% { transform: scale(1.15); box-shadow: 0 0 12px rgba(79,70,229,0.2), 0 4px 12px rgba(0,0,0,0.08); }
    100% { transform: scale(1); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
}

/* ========== PIECES & AVATARS ========== */
.avatar-base {
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.piece {
    position: absolute;
    width: 22px;
    height: 22px;
    right: -5px;
    bottom: -5px;
    z-index: 6;
}

.piece.jump, .plane-piece.jump {
    animation: piece-jump 0.35s cubic-bezier(0.25, 0.8, 0.3, 1);
}

@keyframes piece-jump {
    0% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-18px) scale(1.2); }
    70% { transform: translateY(2px) scale(0.95); }
    100% { transform: translateY(0) scale(1); }
}

.player-avatar {
    width: 36px;
    height: 36px;
}

/* ========== MOVE HINT BAR ========== */
.move-hint-bar {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.debug-step-input {
    width: 78px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-main);
    color: var(--text-primary);
    padding: 7px 9px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.debug-step-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}
