/* backgammon.css — celikezor tavla oyunu stilleri */
/* Template: templates/data_manager/games/backgammon.html'den çıkarıldı */

.game-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
    padding: 4rem 1rem 1rem 1rem;
    min-height: calc(100vh - 120px);
}

.board-container {
    flex: 1.4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.info-wrapper {
    flex: 0.8;
    width: 100%;
}

.glass-card {
    background: rgba(10, 15, 25, 0.65);
    backdrop-filter: blur(8px);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    box-sizing: border-box;
}

/* Scoreboard */
.scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.score-box {
    background: rgba(19, 34, 56, 0.3);
    border: 1px solid var(--surface-border);
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.score-box.active-w {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.score-box.active-b {
    border-color: #888888;
    box-shadow: 0 0 10px rgba(136, 136, 136, 0.2);
}

.score-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.score-val {
    font-size: 1.8rem;
    font-weight: 800;
}

.score-val.w-color {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.score-val.b-color {
    color: #aaaaaa;
    text-shadow: 0 0 10px rgba(170, 170, 170, 0.3);
}

/* Tavla Board Wrapper */
.tavla-board-wrapper {
    position: relative;
    width: 100%;
    max-width: 720px;
    aspect-ratio: 1.25 / 1;
    margin: 0 auto;
    background: #0d121d;
    border: 8px solid #1c273a;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(0, 210, 255, 0.05);
    box-sizing: border-box;
    container-type: inline-size;
    container-name: board;
    --checker-size: 5.2cqw;
}

/* Board Roll Button inside central bar */
.board-roll-btn {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.25), rgba(0, 150, 255, 0.15));
    backdrop-filter: blur(4px);
    border: 1px solid var(--accent-color);
    color: #ffffff;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 800;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 100;
    animation: boardRollPulse 2s infinite alternate;
}

.board-roll-btn:hover {
    background: var(--accent-color);
    color: #0d121d;
    box-shadow: 0 0 20px var(--accent-color), 0 0 5px #ffffff;
    transform: scale(1.06);
}

.board-roll-btn:active {
    transform: scale(0.94);
}

@keyframes boardRollPulse {
    0% {
        box-shadow: 0 0 10px rgba(0, 210, 255, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.2);
        border-color: rgba(0, 210, 255, 0.6);
    }

    100% {
        box-shadow: 0 0 22px rgba(0, 210, 255, 0.8), 0 0 8px rgba(255, 255, 255, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.2);
        border-color: #ffffff;
    }
}

@media (max-width: 576px) {
    .board-roll-btn {
        padding: 0.3rem 0.75rem;
        font-size: 0.7rem;
        gap: 4px;
        border-radius: 15px;
    }
}


.tavla-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr) 40px repeat(6, 1fr) 50px;
    grid-template-rows: 1fr 40px 1fr;
    height: 100%;
    width: 100%;
    position: relative;
}

/* Vertical divisions / Wood lines */
.bar-column {
    grid-column: 7;
    grid-row: 1 / 4;
    background: #1c273a;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    z-index: 10;
    position: relative;
}

.bar-half {
    position: relative;
    height: 40%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar-half.top {
    justify-content: flex-start;
}

.bar-half.bottom {
    justify-content: flex-end;
}

.off-column {
    grid-column: 14;
    grid-row: 1 / 4;
    background: #0a0e17;
    border-left: 2px solid #1c273a;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    z-index: 10;
    box-sizing: border-box;
}

.bear-off-zone {
    height: 42%;
    width: 100%;
    border: 1px dashed rgba(141, 164, 190, 0.2);
    border-radius: 4px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bear-off-zone.top {
    justify-content: flex-start;
}

.bear-off-zone.bottom {
    justify-content: flex-end;
}

/* Point cells holding triangles */
.point-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    z-index: 5;
}

.point-cell::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 90%;
    z-index: -1;
    transition: all 0.2s ease;
}

/* Point rows positioning */
.top-row {
    grid-row: 1;
    justify-content: flex-start;
    padding-top: 4px;
}

.top-row::before {
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    top: 0;
}

.bottom-row {
    grid-row: 3;
    justify-content: flex-end;
    padding-bottom: 4px;
}

.bottom-row::before {
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
    bottom: 0;
}

/* Alternating triangle colors using site themes */
.point-even::before {
    background: linear-gradient(to bottom, rgba(0, 210, 255, 0.15), rgba(0, 210, 255, 0.01));
}

.bottom-row.point-even::before {
    background: linear-gradient(to top, rgba(0, 210, 255, 0.15), rgba(0, 210, 255, 0.01));
}

.point-odd::before {
    background: linear-gradient(to bottom, rgba(141, 164, 190, 0.08), rgba(141, 164, 190, 0.005));
}

.bottom-row.point-odd::before {
    background: linear-gradient(to top, rgba(141, 164, 190, 0.08), rgba(141, 164, 190, 0.005));
}

/* Hover effect for playable points */
.point-cell.playable:hover::before {
    background: linear-gradient(to bottom, rgba(0, 210, 255, 0.35), rgba(0, 210, 255, 0.05)) !important;
}

.bottom-row.playable:hover::before {
    background: linear-gradient(to top, rgba(0, 210, 255, 0.35), rgba(0, 210, 255, 0.05)) !important;
}

/* Highlight valid targets */
.point-cell.valid-target::before {
    background: linear-gradient(to bottom, rgba(0, 210, 255, 0.5), rgba(0, 210, 255, 0.15)) !important;
    filter: drop-shadow(0 0 5px var(--accent-color));
}

.bottom-row.valid-target::before {
    background: linear-gradient(to top, rgba(0, 210, 255, 0.5), rgba(0, 210, 255, 0.15)) !important;
    filter: drop-shadow(0 0 5px var(--accent-color));
}

.point-cell.valid-target-hit::before {
    background: linear-gradient(to bottom, rgba(255, 51, 51, 0.4), rgba(255, 51, 51, 0.1)) !important;
    filter: drop-shadow(0 0 5px #ff3333);
}

.bottom-row.valid-target-hit::before {
    background: linear-gradient(to top, rgba(255, 51, 51, 0.4), rgba(255, 51, 51, 0.1)) !important;
    filter: drop-shadow(0 0 5px #ff3333);
}

/* Drag-hover highlights for points */
.point-cell.valid-target.drag-hover::before {
    background: linear-gradient(to bottom, rgba(0, 210, 255, 0.75), rgba(0, 210, 255, 0.35)) !important;
    filter: drop-shadow(0 0 10px var(--accent-color));
}

.bottom-row.valid-target.drag-hover::before {
    background: linear-gradient(to top, rgba(0, 210, 255, 0.75), rgba(0, 210, 255, 0.35)) !important;
    filter: drop-shadow(0 0 10px var(--accent-color));
}

.point-cell.valid-target-hit.drag-hover::before {
    background: linear-gradient(to bottom, rgba(255, 51, 51, 0.75), rgba(255, 51, 51, 0.35)) !important;
    filter: drop-shadow(0 0 10px #ff3333);
}

.bottom-row.valid-target-hit.drag-hover::before {
    background: linear-gradient(to top, rgba(255, 51, 51, 0.75), rgba(255, 51, 51, 0.35)) !important;
    filter: drop-shadow(0 0 10px #ff3333);
}

/* Bear-off zone valid target states */
.bear-off-zone.valid-target {
    border-color: var(--accent-color) !important;
    background: rgba(0, 210, 255, 0.1) !important;
    box-shadow: inset 0 0 10px rgba(0, 210, 255, 0.3), 0 0 5px rgba(0, 210, 255, 0.3) !important;
    transition: all 0.2s ease;
}

.bear-off-zone.valid-target.drag-hover {
    background: rgba(0, 210, 255, 0.25) !important;
    box-shadow: inset 0 0 15px rgba(0, 210, 255, 0.5), 0 0 12px var(--accent-color) !important;
}

/* Middle bar section where dice and messages are displayed */
.center-row-bar {
    grid-column: 1 / 14;
    grid-row: 2;
    background: rgba(10, 15, 25, 0.4);
    border-top: 2px solid #1c273a;
    border-bottom: 2px solid #1c273a;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 3;
    pointer-events: none;
}

.dice-container-half {
    width: 40%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

/* Checkers styling */
.checker {
    width: var(--checker-size, 32px);
    height: var(--checker-size, 32px);
    border-radius: 50%;
    position: absolute;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.2s;
}

.checker.color-w {
    background: radial-gradient(circle, #ffffff 0%, #e0e0e0 60%, #a8a8a8 100%);
    border: 1.5px solid #ffffff;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6), 0 0 6px rgba(255, 255, 255, 0.4);
}

.checker.color-b {
    background: radial-gradient(circle, #444444 0%, #1a1a1a 70%, #050505 100%);
    border: 1.5px solid #888888;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.8), 0 0 6px rgba(255, 255, 255, 0.15);
}

.checker.selected {
    border-color: #ffffff !important;
    box-shadow: 0 0 12px #ffffff, 0 0 20px #ffffff;
    transform: scale(1.15) translateY(0px) !important;
    z-index: 100 !important;
    animation: pulseSelect 1s infinite alternate;
}

.checker.draggable {
    cursor: grab !important;
    touch-action: none;
}

.checker.draggable:active {
    cursor: grabbing !important;
}

.checker.dragging {
    opacity: 0.9;
    transform: scale(1.15) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6), 0 0 15px var(--accent-color) !important;
    z-index: 2000 !important;
    pointer-events: none;
}

/* Borne off checkers representation in bays */
.borne-off-bar {
    width: 80%;
    height: 8px;
    border-radius: 2px;
    position: absolute;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.borne-off-bar.color-w {
    background: linear-gradient(to right, #ffffff, #b3b3b3);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.borne-off-bar.color-b {
    background: linear-gradient(to right, #333333, #050505);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Interactive Dice display */
.die {
    width: 34px;
    height: 34px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 -2px 5px rgba(0, 0, 0, 0.2);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 5px;
    gap: 3px;
    box-sizing: border-box;
    transition: transform 0.4s ease;
    position: relative;
}

.die.die-b {
    background: #222222;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6), inset 0 -2px 5px rgba(0, 0, 0, 0.5);
}

.die-dot {
    width: 6px;
    height: 6px;
    background: #000000;
    border-radius: 50%;
    align-self: center;
    justify-self: center;
}

.die.die-b .die-dot {
    background: #ffffff;
}

.die-dot.empty {
    visibility: hidden;
}

.die.used {
    opacity: 0.35;
    box-shadow: none;
    transform: scale(0.9);
}

.die.rolling {
    animation: dieRoll 0.5s ease-out;
}

/* Control elements styling */
.control-group {
    margin-bottom: 1.2rem;
}

.control-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.control-buttons-row {
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    flex: 1;
    background: rgba(19, 34, 56, 0.3);
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
    padding: 0.6rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    border-color: var(--accent-color);
    color: #ffffff;
}

.toggle-btn.active {
    background: var(--active-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.2);
}

.game-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.action-btn {
    flex: 1;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: rgba(0, 210, 255, 0.1);
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
}

.action-btn.danger {
    border-color: #ff3333;
    color: #ff3333;
}

.action-btn.danger:hover {
    background: rgba(255, 51, 51, 0.1);
    box-shadow: 0 0 12px rgba(255, 51, 51, 0.3);
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    box-sizing: border-box;
}

.icon-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.icon-btn.muted {
    color: #ff3333;
    border-color: #ff3333;
}

.game-status-bar {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.2rem;
    color: #ffffff;
    min-height: 1.8rem;
}

.game-status-bar span.turn-w {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.game-status-bar span.turn-b {
    color: #aaaaaa;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

/* Modal / Popup styling */
.game-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: var(--surface-color);
    border: 1px solid var(--accent-color);
    border-radius: 16px;
    padding: 2.2rem;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 210, 255, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 85%;
    box-sizing: border-box;
}

.game-modal-overlay.show .modal-card {
    transform: scale(1);
}

.modal-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.modal-title.w-win {
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.5);
}

.modal-title.b-win {
    color: #ff3333;
    text-shadow: 0 0 15px rgba(255, 51, 51, 0.5);
}

.modal-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-card .action-btn {
    width: fit-content;
    margin: 1.5rem auto 0 auto;
    flex: none;
}

/* Rules Guide Modal CSS */
#rulesModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(5, 10, 18, 0.85) !important;
    backdrop-filter: blur(6px) !important;
    z-index: 250 !important;
    border-radius: 0 !important;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#rulesModal.show {
    display: flex !important;
}

.rules-card {
    background: rgba(10, 15, 25, 0.95) !important;
    border: 2px solid var(--accent-color) !important;
    border-radius: 16px !important;
    padding: 2rem !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 210, 255, 0.25) !important;
    max-width: 520px;
    width: 90%;
    text-align: left;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
}

#rulesModal.show .rules-card {
    transform: scale(1) !important;
}

.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.rules-header h3 {
    font-size: 1.5rem;
    color: var(--accent-color);
    font-weight: 700;
}

.close-rules-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-rules-btn:hover {
    color: #ffffff;
}

.rules-body {
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 1.5rem;
}

.rule-slide {
    display: none;
}

.rule-slide.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.rule-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.8rem;
}

.rule-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.rules-diagram-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.rules-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rules-dots {
    display: flex;
    gap: 6px;
}

.rules-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--surface-border);
    cursor: pointer;
    transition: background 0.2s;
}

.rules-dot.active {
    background: var(--accent-color);
}

/* Board Scale variables and responsive logic */
:root {
    --checker-size: 32px;
}

/* Advanced Fullscreen Mode Styles */
.game-layout:fullscreen {
    background: radial-gradient(circle at center, #0d1527 0%, #03060c 100%) !important;
    padding: 2rem 3rem !important;
    overflow-y: auto !important;
    min-height: 100vh !important;
    height: auto !important;
    width: 100vw !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3rem !important;
    box-sizing: border-box !important;
}

.game-layout:fullscreen .board-container {
    flex: 1.6 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

.game-layout:fullscreen .tavla-board-wrapper {
    max-width: 85vw !important;
    max-height: 80vh !important;
    width: calc(80vh * 1.25) !important;
    aspect-ratio: 1.25 / 1 !important;
    border: 12px solid #1c273a !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 210, 255, 0.2) !important;
}

.game-layout:fullscreen .info-wrapper {
    flex: 0.7 !important;
    max-width: 380px !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.game-layout:fullscreen .glass-card {
    background: rgba(10, 15, 25, 0.8) !important;
    border-color: rgba(0, 210, 255, 0.25) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6) !important;
}

.game-layout:fullscreen .game-status-bar {
    font-size: 1.6rem !important;
    margin-bottom: 1.5rem !important;
}

@media (max-width: 1024px) or (orientation: portrait) {
    .game-layout:fullscreen {
        flex-direction: column !important;
        padding: 1.5rem 1rem !important;
        overflow-y: auto !important;
        justify-content: flex-start !important;
        gap: 1.5rem !important;
    }

    .game-layout:fullscreen .board-container {
        flex: none !important;
        width: 100% !important;
        height: auto !important;
    }

    .game-layout:fullscreen .tavla-board-wrapper {
        width: 95vw !important;
        height: calc(95vw / 1.25) !important;
        max-height: 60vh !important;
        border-width: 8px !important;
    }

    .game-layout:fullscreen .info-wrapper {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

@keyframes dieRoll {
    0% {
        transform: scale(0.6) rotate(0deg) translate(-12px, -8px);
    }

    25% {
        transform: scale(1.2) rotate(120deg) translate(12px, 12px);
    }

    50% {
        transform: scale(0.8) rotate(240deg) translate(-8px, 10px);
    }

    75% {
        transform: scale(1.1) rotate(300deg) translate(5px, -3px);
    }

    100% {
        transform: scale(1) rotate(360deg) translate(0, 0);
    }
}

.die.rolling {
    animation: dieRoll 0.8s ease-out;
}

.die.rolling .die-dot {
    animation: dotSpin 0.8s ease-in-out;
}

@keyframes dotSpin {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.9;
    }

    100% {
        opacity: 1;
    }
}

@keyframes pulseSelect {
    0% {
        box-shadow: 0 0 10px #ffffff, 0 0 15px var(--accent-color);
    }

    100% {
        box-shadow: 0 0 18px #ffffff, 0 0 30px var(--accent-color);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Responsive styling */
@media (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
        padding: 4rem 0.5rem 1rem 0.5rem;
        align-items: center;
    }

    .board-container {
        width: 100%;
        margin-bottom: 1.5rem;
    }

    .info-wrapper {
        width: 100%;
    }

    .tavla-board-wrapper {
        max-width: 95vw;
    }
}

@media (max-width: 576px) {
    :root {
        --checker-size: 20px;
    }

    .tavla-board-wrapper {
        border: 4px solid #1c273a;
    }

    .tavla-board {
        grid-template-columns: repeat(6, 1fr) 20px repeat(6, 1fr) 24px;
        grid-template-rows: 1fr 24px 1fr;
    }

    .bar-column {
        grid-column: 7;
        padding: 4px 0;
    }

    .off-column {
        grid-column: 14;
        padding: 2px;
    }

    .center-row-bar {
        grid-column: 1 / 14;
        border-top: 1px solid #1c273a;
        border-bottom: 1px solid #1c273a;
    }

    .die {
        width: 18px;
        height: 18px;
        padding: 2px;
        border-radius: 4px;
    }

    .die-dot {
        width: 3px;
        height: 3px;
    }

    .die-5 .die-dot-center {
        top: 7.5px;
        left: 7.5px;
    }

    .dice-container-half {
        gap: 6px;
    }

    .glass-card {
        padding: 1rem;
    }

    .scoreboard {
        gap: 0.5rem;
    }

    .score-val {
        font-size: 1.4rem;
    }

    .control-buttons-row {
        flex-direction: column;
        gap: 0.35rem;
    }

    .toggle-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .game-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .action-btn {
        padding: 0.7rem;
        font-size: 0.85rem;
    }
}