:root {
    --bg-dark: #050510;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    --color-red: #ff3d5e;
    --color-green: #00f291;
    --color-yellow: #ffd600;
    --color-blue: #00d4ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background: radial-gradient(circle at top left, #1a1a2e, #16213e, #0f3460, var(--bg-dark));
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    overflow-x: hidden;
    padding: 10px;
}

/* Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://www.transparenttextures.com/patterns/carbon-fibre.png');
    opacity: 0.1;
    z-index: -1;
}

/* Setup Screen */
.setup-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a4da3 0%, #0d2a6b 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    overflow-y: auto;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    display: none !important;
    justify-content: center;
    align-items: center;
    z-index: 6000;
}

.modal.show {
    display: flex !important;
}

/* Stars Background */
.setup-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 120px, #ddd, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.3;
    pointer-events: none;
}

.setup-content {
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
    padding: 20px;
}

.logo-container {
    background: linear-gradient(180deg, #57d661 0%, #2e7d32 100%);
    padding: 10px 30px;
    border-radius: 18px;
    border: 4px solid #fff;
    box-shadow: 
        0 10px 0 rgba(0,0,0,0.2), 
        inset 0 4px 10px rgba(255,255,255,0.5),
        0 15px 30px rgba(0,0,0,0.4);
    text-align: center;
    margin-bottom: 30px;
    transform: perspective(1000px) rotateX(15deg);
    position: relative;
}

.logo-container::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 25px;
    border: 2px solid rgba(255,255,255,0.2);
    pointer-events: none;
}

.marvel-text {
    font-weight: 900;
    color: #ffd600;
    font-size: 1.1rem;
    letter-spacing: 3px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    margin-bottom: 5px;
}

.ludo-title-text {
    font-size: 3.2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 
        0 1px 0 #ccc,
        0 2px 0 #c9c9c9,
        0 3px 0 #bbb,
        0 4px 0 #b9b9b9,
        0 5px 0 #aaa,
        0 6px 1px rgba(0,0,0,.1);
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

.prepare-section {
    text-align: center;
    margin-bottom: 25px;
}

.prepare-label {
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.player-count-indicator {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ffd600;
    margin-top: 5px;
    text-shadow: 0 0 20px rgba(255, 214, 0, 0.4);
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px 40px;
    margin-bottom: 40px;
    width: 100%;
}

.setup-player-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-circle {
    width: 85px;
    height: 85px;
    background: #fff;
    border-radius: 50%;
    padding: 4px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar-circle:hover {
    transform: scale(1.05);
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
}

.me-tag {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #ffd600;
    color: #000;
    font-weight: 900;
    font-size: 0.85rem;
    padding: 3px 10px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10;
}

.setup-name-input {
    background: transparent;
    border: none;
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 10px;
    width: 110px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
    transition: all 0.3s;
}

.setup-name-input:focus {
    outline: none;
    border-bottom-color: #ffd600;
    background: rgba(255,255,255,0.05);
}

.setup-start-btn {
    width: 100%;
    max-width: 260px;
    background: linear-gradient(180deg, #00d4ff 0%, #0072ff 100%);
    box-shadow: 0 8px 15px rgba(0, 114, 255, 0.4);
    border-radius: 100px;
    font-size: 1.3rem;
    padding: 15px;
}

/* Game Container Background Update */
.bg-pattern {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top left, #1a1a2e, #16213e, #0f3460, #050510);
    z-index: -1;
}

/* Game Container */
.game-container {
    display: grid;
    grid-template-columns: 180px 1fr 180px;
    grid-template-rows: 180px 1fr 180px;
    width: 100%;
    max-width: 900px;
    max-height: 95vh;
    aspect-ratio: 1/1;
    gap: 15px;
    position: relative;
}

/* Positional grid assignments */
.pos-tl {
    grid-column: 1;
    grid-row: 1;
}

.pos-tr {
    grid-column: 3;
    grid-row: 1;
}

.pos-bl {
    grid-column: 1;
    grid-row: 3;
}

.pos-br {
    grid-column: 3;
    grid-row: 3;
}

/* Glass Panels */
.player-panel {
    border-radius: 24px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    height: 100%;
}


/* Glowing corner indicators */
.pos-tl.active .dice-box {
    border-color: var(--color-red);
    --player-color: var(--color-red);
}

.pos-tr.active .dice-box {
    border-color: var(--color-green);
    --player-color: var(--color-green);
}

.pos-br.active .dice-box {
    border-color: var(--color-yellow);
    --player-color: var(--color-yellow);
}

.pos-bl.active .dice-box {
    border-color: var(--color-blue);
    --player-color: var(--color-blue);
}

.dice-box {
    position: relative;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--glass-border);
    perspective: 400px;
}

/* Timer Border Effect */
@property --timer-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.dice-box.timer-active::before,
.dice-box.move-timer-active::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 18px;
    background: conic-gradient(var(--player-color, #fff) var(--timer-angle), transparent 0deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    padding: 3px;
    z-index: 10;
    pointer-events: none;
}

.dice-box.timer-active::before {
    animation: timerFill 15s linear forwards;
}

.dice-box.move-timer-active::before {
    animation: timerFill 20s linear forwards;
}

@keyframes timerFill {
    from { --timer-angle: 0deg; }
    to { --timer-angle: 360deg; }
}

.dice-box:hover {
    background: rgba(255, 255, 255, 0.1);
}

.profile-pic {
    width: 85%;
    height: 85%;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: profileAppear 0.5s ease-out;
}

@keyframes profileAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}



.p-name {
    font-weight: 600;
    font-size: 1rem;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.8);
}

/* Board */
.board-wrapper {
    grid-column: 2;
    grid-row: 2;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 20px;
    /*border: 1px solid var(--glass-border);*/
    backdrop-filter: blur(5px);
}

.ludo-board {
    display: grid;
    grid-template-columns: repeat(15, minmax(0, 1fr));
    grid-template-rows: repeat(15, minmax(0, 1fr));
    width: 100%;
    aspect-ratio: 1/1;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.setup-box p {
    margin-bottom: 20px;
}

.cell {
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}


.cell.path-cell {
    background: rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.cell.red {
    background: linear-gradient(135deg, #ff3d5e, #c2185b);
    border: 0;
}

.cell.green {
    background: linear-gradient(135deg, #00f291, #009688);
    border: 0;
}

.cell.yellow {
    background: linear-gradient(135deg, #ffd600, #ff8f00);
    border: 0;
}

.cell.blue {
    background: linear-gradient(135deg, #00d4ff, #0072ff);
    border: 0;
}

.cell.safe::after {
    content: "✦";
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.4);
    text-shadow: 0 0 10px #fff;
    position: absolute;
}

/* Home Area */
.home-area {
    position: absolute;
    width: 40%;
    height: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.home-area-red {
    top: 0;
    left: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.home-area-green {
    top: 0;
    right: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.home-area-yellow {
    bottom: 0;
    right: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.home-area-blue {
    bottom: 0;
    left: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.home-inner {
    width: 80%;
    height: 80%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    padding: 15%;
    gap: 15%;
    backdrop-filter: blur(10px);
}

.home-slot {
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Center Area */
.center-area {
    position: absolute;
    width: 20%;
    height: 20%;
    top: 40%;
    left: 40%;
    z-index: 10;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.center-area::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: conic-gradient(from -45deg, var(--color-green) 0 90deg, var(--color-yellow) 90deg 180deg, var(--color-blue) 180deg 270deg, var(--color-red) 270deg 360deg);
    clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 0);
    /* This is just a placeholder, I'll use triangles */
}

/* Modern Tokens */
.token {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    position: absolute;
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.8);
    left: 0;
    top: 0;
    /* Default for board positioning */
}

.token::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0.5;
}

.active-p0 .token.red::before,
.active-p1 .token.green::before,
.active-p2 .token.yellow::before,
.active-p3 .token.blue::before {
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.token.playable {
    animation: playableJump 0.6s infinite alternate;
    z-index: 1000;
}

@keyframes playableJump {
    from {
        margin-top: 0;
    }

    to {
        margin-top: -2px;
    }
}

.token.red {
    background: var(--color-red);
    color: var(--color-red);
}

.token.green {
    background: var(--color-green);
    color: var(--color-green);
}

.token.yellow {
    background: var(--color-yellow);
    color: var(--color-yellow);
}

.token.blue {
    background: var(--color-blue);
    color: var(--color-blue);
}

/* 3D DICE STYLING */
.dice-scaler {
    width: 40px;
    height: 40px;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dice-cube {
    width: 40px;
    height: 40px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}

.dice-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, #ffffff, #e0e0e0);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 6px;
    gap: 4px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05), 0 5px 15px rgba(0, 0, 0, 0.2);
    backface-visibility: hidden;
}

.dice-face::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 8px 8px 50% 50%;
    pointer-events: none;
}

.dice-face .dot {
    background: radial-gradient(circle at 30% 30%, #444, #111);
    border-radius: 50%;
    width: 100%;
    height: 100%;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.8), 1px 1px 1px rgba(255, 255, 255, 0.2);
}

/* Face Orientations */
.face-1 {
    transform: translateZ(20px);
}

.face-2 {
    transform: rotateY(180deg) translateZ(20px);
}

.face-3 {
    transform: rotateY(90deg) translateZ(20px);
}

.face-4 {
    transform: rotateY(-90deg) translateZ(20px);
}

.face-5 {
    transform: rotateX(90deg) translateZ(20px);
}

.face-6 {
    transform: rotateX(-90deg) translateZ(20px);
}

/* Dot Layouts */
.face-1 .dot:nth-child(1) {
    grid-column: 2;
    grid-row: 2;
}

.face-2 .dot:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.face-2 .dot:nth-child(2) {
    grid-column: 3;
    grid-row: 3;
}

.face-3 .dot:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.face-3 .dot:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
}

.face-3 .dot:nth-child(3) {
    grid-column: 3;
    grid-row: 3;
}

.face-4 .dot:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.face-4 .dot:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

.face-4 .dot:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
}

.face-4 .dot:nth-child(4) {
    grid-column: 3;
    grid-row: 3;
}

.face-5 .dot:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.face-5 .dot:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

.face-5 .dot:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

.face-5 .dot:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
}

.face-5 .dot:nth-child(5) {
    grid-column: 3;
    grid-row: 3;
}

.face-6 .dot:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.face-6 .dot:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

.face-6 .dot:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
}

.face-6 .dot:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
}

.face-6 .dot:nth-child(5) {
    grid-column: 1;
    grid-row: 3;
}

.face-6 .dot:nth-child(6) {
    grid-column: 3;
    grid-row: 3;
}

/* Rotation Targets */
.dice-cube[data-value="1"] {
    transform: rotateX(0deg) rotateY(0deg);
}

.dice-cube[data-value="2"] {
    transform: rotateX(0deg) rotateY(180deg);
}

.dice-cube[data-value="3"] {
    transform: rotateX(0deg) rotateY(-90deg);
}

.dice-cube[data-value="4"] {
    transform: rotateX(0deg) rotateY(90deg);
}

.dice-cube[data-value="5"] {
    transform: rotateX(-90deg) rotateY(0deg);
}

.dice-cube[data-value="6"] {
    transform: rotateX(90deg) rotateY(0deg);
}

.dice-box.rolling .dice-cube {
    animation: realDiceRoll 0.6s infinite linear;
}

@keyframes realDiceRoll {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    }
}

#home-area-0 {
    background: #ff3d5e;
}

#home-area-1 {
    background: #00f291;
}

#home-area-2 {
    background: #ffd600;
}

#home-area-3 {
    background: #00d4ff;
}

/* Global Button */
.action-btn {
    background: linear-gradient(to right, #00d4ff, #0072ff);
    color: #fff;
    padding: 15px 40px;
    border-radius: 50px;
    border: none;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(0, 114, 255, 0.3);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 114, 255, 0.5);
}

.modal-content {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 50px;
    border-radius: 40px;
    text-align: center;
}

.modal-content h2 {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.modal-content h1 {
    font-size: 3rem;
    margin-bottom: 30px;
}

/* Scoreboard Modal */
.scoreboard-content {
    min-width: 400px;
    padding: 40px;
}

.scoreboard {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    width: 100%;
}

.rank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
    font-weight: bold;
}

.rank-1-row {
    background: linear-gradient(90deg, rgba(255,215,0,0.2) 0%, rgba(255,215,0,0.05) 100%);
    border-color: rgba(255,215,0,0.5);
    color: #ffd700;
}

.rank-2-row {
    background: linear-gradient(90deg, rgba(192,192,192,0.2) 0%, rgba(192,192,192,0.05) 100%);
    border-color: rgba(192,192,192,0.5);
    color: #c0c0c0;
}

.rank-3-row {
    background: linear-gradient(90deg, rgba(205,127,50,0.2) 0%, rgba(205,127,50,0.05) 100%);
    border-color: rgba(205,127,50,0.5);
    color: #cd7f32;
}

.rank-4-row {
    background: linear-gradient(90deg, rgba(255,61,94,0.2) 0%, rgba(255,61,94,0.05) 100%);
    border-color: rgba(255,61,94,0.5);
    color: #ff3d5e;
}

.rank-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    font-size: 2.5rem;
    font-weight: 900;
    text-shadow: 0 5px 15px rgba(0,0,0,0.8), 0 0 10px rgba(255,255,255,0.5);
    padding: 10px 20px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 2px solid;
    animation: badgeDrop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgeDrop {
    0% { transform: translate(-50%, -150%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.rank-badge-1 {
    color: #ffd700;
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
}

.rank-badge-2 {
    color: #c0c0c0;
    border-color: #c0c0c0;
    background: rgba(192, 192, 192, 0.15);
}

.rank-badge-3 {
    color: #cd7f32;
    border-color: #cd7f32;
    background: rgba(205, 127, 50, 0.15);
}

.fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 5500;
}

/* MEDIA QUERIES AT THE END */
@media (max-width: 750px) {
    body {
        padding: 5px;
    }

    .game-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto 1fr auto;
        width: 100vw;
        max-width: 100vw;
        max-height: 100dvh;
        aspect-ratio: auto;
        gap: 5px;
        padding: 5px;
        align-items: center;
        justify-items: center;
        overflow: hidden;
    }

    /* Row 1: Red and Green */
    .pos-tl {
        grid-row: 1;
        grid-column: 1;
        width: 95%;
        justify-self: center;
    }

    .pos-tr {
        grid-row: 1;
        grid-column: 2;
        width: 95%;
        justify-self: center;
    }

    /* Row 2: Board */
    .board-wrapper {
        grid-row: 2;
        grid-column: 1 / span 2;
        width: min(92vw, 58dvh);
        aspect-ratio: 1/1;
        height: auto;
        padding: 4px;
        margin: 0 auto;
    }

    /* Row 3: Blue and Yellow */
    .pos-bl {
        grid-row: 3;
        grid-column: 1;
        width: 95%;
        justify-self: center;
    }

    .pos-br {
        grid-row: 3;
        grid-column: 2;
        width: 95%;
        justify-self: center;
    }

    .player-panel {
        flex-direction: row;
        padding: 5px 8px;
        border-radius: 12px;
        gap: 6px;
        min-height: 45px;
        width: 100% !important;
        height: 100%;
        transform: scale(0.9);
    }

    .dice-box {
        width: 45px;
        height: 45px;
        border-radius: 12px;
        perspective: 300px;
    }

    .dice-scaler {
        transform: scale(0.8);
    }

    .p-name {
        font-size: 0.7rem;
        margin-top: 0;
    }

    .active-arrow {
        display: none !important;
    }

    .token {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }

    .cell.safe::after {
        font-size: 0.7rem;
    }

    .setup-box {
        padding: 20px;
        width: 95%;
    }

    .setup-box h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .input-group input {
        padding: 10px;
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    .dice-box.timer-active::before, .dice-box.move-timer-active::before{ border-radius:12px; }
}

@media (max-width: 500px) {
    .setup-box h1 {
        font-size: 1.8rem;
    }
}

.hidden {
    display: none !important;
}