/* ================================================================
   board.css — Game board grid, cells, pawns, dice, UI layer
   ================================================================ */

/* --- The 2D Board & Wrapper --- */
.ludo-start {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
    display: inline-block;
    background: linear-gradient(to bottom, #66b2d4 0%, #e2f1f8 100%);
}

.ludo-start img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    object-fit: contain;
    height: 100%;
}

@media (max-width: 1024px) {
    .ludo-start img {
        object-fit: contain;
    }
}

.ludo-local-name {
    position: absolute;
    left: 50%;
    bottom: 33%;
    transform: translate(-50%, -50%);
    font-size: 38px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    z-index: 1;
    display: none;
}

#ludo-hello-heading {
    position: absolute;
    left: 50%;
    bottom: 100px;
    transform: translateX(-50%);
    width: 240px;
    height: 8px;
    margin: 0;
    text-indent: -9999px;
    overflow: hidden;
    background: rgba(255, 204, 0, 0.2);
    border-radius: 999px;
}

#ludo-hello-heading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #ffd400 0%, #ffea70 100%);
    border-radius: 999px;
    animation: ludoLoader 3s linear forwards;
}

@keyframes ludoLoader {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.ludo-btn {
    background: linear-gradient(90deg, #FDB714 0%, #F8951D 100%);
    color: var(--white);
    padding: 6px 10px;
    border-radius: 5px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.28);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    font-size: 14px;
}

.ludo-lobby-controls .ludo-btn {
    min-height: 38px;
}

.ludo-btn.ludo-im-back-btn {
    padding: 6px 5px;
    font-size: 12px;
    min-height: 34px;
}

.ludo-claim-color-cell {
    display: inline-block;
    width: 80px;
}

.ludo-card-join-buttons {
    display: flex;
    gap: 10px;
    width: 320px;
    text-align: center;
}

.ludo-card-join-buttons button {
    font-size: 10px;
    padding: 5px;
}

.ludo-profile-score {
    background-color: var(--ludo-green);
    color: var(--white);
    padding: 2px 5px;
    border-radius: 5px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* Združeni bloki, ki delijo isto postavitev (inline-block, width: 100%) */
.ludo-lobby-list {
    display: inline-block;
    width: 100%;
}

.ludo-board-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 20px auto;
}

.ludo-board-container {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    box-sizing: border-box;
}

.ludo-board-grid {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    grid-template-rows: repeat(11, 1fr);
    width: 100%;
    height: 610px;
    aspect-ratio: 1 / 1;
    background-color: transparent; 
}

@media (max-width: 900px) {
    .ludo-board-grid {
        height: 550px;
    }
}

.game-container .ludo-lobby {
    padding: 10px;
}

@media (max-width: 768px) {
    .ludo-lobby {
        padding: 10px;
        overflow-y: auto;
        height: calc(100dvh + -110px);
    }
    
    .ludo-board-grid {
        height: 330px;
    }
}

@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
    .ludo-lobby {
        padding: 10px;
    }

    .ludo-board-grid {
        height: 270px;
    }
}

/* --- UI Layer & Dice --- */
.io-game-frame {
    aspect-ratio: 630 / 432 !important;
    height: 100% !important;
    max-height: 790px;
}

.ludo-ui-layer { 
    width: 640px;
    transition: background-color 0.3s ease-in-out;
    border-radius: 8px;
}

#ludo-game-view {
    position: relative;
    margin: 0 auto;
}

#ludo-root,
#ludo-game-view,
.ludo-canvas-board {
    background-color: #b9c6cc;
}

@media (max-width: 768px) and (orientation: portrait) {
    .ludo-ui-layer {
        position: absolute;
        width: 365px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    #ludo-game-view {
        position: initial;
    }

    .ludo-players-board-overlay {
        pointer-events: none !important;
        width: 365px;
        top: 50% !important;
        left: 50% !important;
        right: initial !important;
        transform: translate(-50%, -41%);
    }
}

/* --- Center Dice Overlay --- */
.ludo-center-dice-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 13%;
    height: 13%; 
    border-radius: 50%;
    aspect-ratio: 16 / 9;
    border-radius: 50%;
    margin-top: -2.6%;
    margin-left: 3px;
    padding-bottom: 10px;
    max-width: 140px;
    max-height: 140px;
}

@media (min-width: 1990px) {
    .ludo-center-dice-container {
        margin-top: -2%
    }
}

@media (max-width: 768px), (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
    .ludo-center-dice-container {
        background: none;
        max-width: 9%;
        height: 9%;
        margin-top: -3%;
        min-width: 76px;
        max-height: 66px;
    }
}

@media (min-width: 769px) and (max-width: 950px) and (min-height: 390px) and (max-height: 500px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
    .ludo-center-dice-container {
        margin-top: -1.3%;
    }
}

.ludo-dice-3d-canvas {
    width: 100%; 
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.ludo-dice-3d-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

.ludo-dice-3d-canvas:hover {
    transform: scale(1.1);
}

.ludo-dice-3d-canvas.disabled {
    cursor: not-allowed;
    pointer-events: none; 
}

.ludo-pawn-number {
    position: absolute;
    pointer-events: none;
    z-index: 3;
    transform: translate(-50%, -180%);
    color: #fff;
    font: bold 12px/1 sans-serif;
    text-shadow: 0 0 3px rgba(0,0,0,.9);
}