﻿.ludo-lobby,
.ludo-game,
.ludo-modal {
    --ludo-surface: var(--card-bg, var(--bg-white, #fff));
    --ludo-surface-soft: var(--rgba-primary-1, #f7faf9);
    --ludo-text: var(--title, #182027);
    --ludo-muted: var(--text-light, #66717a);
    --ludo-border: var(--border-color, #e8edf0);
    --ludo-accent: #f6c343;
    --ludo-dark: #16212a;
    direction: rtl;
    font-family: inherit;
    color: var(--ludo-text);
}

.ludo-home-banner {
    display: grid;
    place-items: center start;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 21 / 9;
    min-height: 0;
    margin: 0 auto;
    padding: 28px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(24, 32, 39, .58), rgba(10, 132, 95, .28)),
        url('/imgs/webp/mench.webp') center/cover;
    color: #fff;
    text-align: right;
}

.ludo-home-banner span {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f6c343;
    color: #171717;
    font-weight: 900;
}

.ludo-home-banner strong {
    display: block;
    font-size: 2rem;
    font-weight: 900;
}

.ludo-home-banner small {
    display: block;
    margin-top: 8px;
    font-size: 1rem;
    color: rgba(255,255,255,.88);
}

.ludo-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: end;
    aspect-ratio: 21 / 9;
    min-height: 0;
    max-width: 900px;
    margin: 14px auto;
    padding: 18px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(10, 132, 95, .76), rgba(30, 85, 120, .62)),
        url('/imgs/webp/mench.webp') center/cover;
    color: #fff;
    overflow: hidden;
}

.ludo-hero h1 {
    margin: 8px 0;
    font-size: 1.65rem;
    font-weight: 900;
}

.ludo-hero p {
    max-width: 520px;
    line-height: 1.8;
    margin-bottom: 0;
}

.ludo-hero-action {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 2;
    align-self: end;
    min-width: 132px;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: #f6c343;
    color: #171717;
    font-weight: 900;
}

.ludo-create {
    display: grid;
    gap: 10px;
    align-self: center;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(8px);
}

.ludo-create-modal {
    background: transparent;
    backdrop-filter: none;
    padding: 0;
}

.ludo-modal {
    border: 1px solid var(--ludo-border);
    border-radius: 8px;
    background: #fff;
    color: var(--ludo-text);
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
}

.ludo-modal .modal-header {
    border-bottom-color: var(--ludo-border);
}

.ludo-modal .btn-close {
    margin: 0;
}

.theme-dark .ludo-modal,
body.theme-dark .ludo-modal {
    background: #1f2933;
    color: #f5f7fa;
}

.ludo-create input,
.ludo-create button,
.ludo-login-btn,
.ludo-join-link,
.ludo-join-btn,
#rollBtn,
#startBtn {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    font-weight: 800;
}

.ludo-create input {
    background: var(--ludo-surface);
    color: var(--ludo-text);
    border: 1px solid rgba(255,255,255,.2);
}

.ludo-create input::placeholder {
    color: var(--ludo-muted);
}

.ludo-price-label {
    margin: 0;
    color: #ffd9d9;
    font-size: .82rem;
    font-weight: 900;
}

.ludo-create-modal .ludo-price-label,
.ludo-create-modal .ludo-price-preview {
    color: #d71920;
}

.ludo-friendly-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid var(--ludo-border);
    border-radius: 8px;
    background: var(--ludo-surface-soft);
    color: var(--ludo-text);
    font-size: .82rem;
    font-weight: 900;
}

.ludo-friendly-toggle input {
    width: 18px;
    height: 18px;
    min-height: 0;
}

.ludo-price-preview {
    margin-top: -4px;
    color: #ffdddd;
    font-size: .9rem;
    font-weight: 900;
}

.ludo-price-preview.is-invalid {
    color: #ffb1b1;
}

.ludo-create button,
.ludo-login-btn,
.ludo-join-link,
.ludo-join-btn,
#rollBtn,
#startBtn {
    background: #f6c343;
    color: #171717;
    cursor: pointer;
}

.ludo-login-box {
    align-content: center;
    text-align: center;
}

.ludo-login-btn {
    display: grid;
    place-items: center;
    min-height: 42px;
    text-decoration: none;
}

.ludo-join-link {
    display: inline-grid;
    place-items: center;
    text-decoration: none;
}

.ludo-panel,
.ludo-seo {
    margin: 14px 0;
    padding: 16px;
    border: 1px solid var(--ludo-border);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .88)),
        url('/imgs/webp/mench.webp') center/cover;
}

.ludo-panel h1,
.ludo-panel h2,
.ludo-seo h2 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 900;
}

.ludo-game-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.ludo-game-card,
.ludo-rank-row {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: 8px;
    background: var(--ludo-surface-soft);
    color: inherit;
    text-decoration: none;
}

.ludo-table-wrap {
    overflow-x: visible;
}

.ludo-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
    color: var(--ludo-text);
}

.ludo-table th,
.ludo-table td {
    padding: 10px;
    border-bottom: 1px solid var(--ludo-border);
    text-align: right;
    white-space: nowrap;
}

.ludo-table-compact .ludo-join-link {
    min-height: 34px;
}

.ludo-table th {
    color: var(--ludo-muted);
}

.ludo-rank-list {
    display: grid;
    gap: 8px;
}

.ludo-rank-row {
    grid-template-columns: 34px 1fr auto;
    align-items: center;
}

.ludo-empty {
    padding: 14px;
    border-radius: 8px;
    background: var(--ludo-surface-soft);
    color: var(--ludo-muted);
}

.ludo-game-head {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    margin: 10px 0 0;
    padding: 8px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(17, 24, 32, .94), rgba(17, 24, 32, .78)),
        url('/imgs/webp/mench.webp') center/cover;
    color: #fff;
}

.ludo-game-head > div {
    display: grid;
    gap: 2px;
    min-height: 44px;
    align-content: center;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,.08);
}

.ludo-game-head span {
    font-size: .72rem;
    color: rgba(255,255,255,.72);
}

.ludo-game-head strong {
    font-size: .9rem;
    color: #fff;
}

.ludo-icon-market {
    display: grid;
    place-items: center;
    min-height: 44px;
    margin-top: 10px;
    padding: 0 14px;
    border-radius: 8px;
    background: #f6c343;
    color: #171717;
    font-weight: 900;
    text-decoration: none;
    text-align: center;
}

.ludo-icon-market:hover {
    color: #171717;
    text-decoration: none;
    filter: brightness(.96);
}

.ludo-alert {
    padding: 10px;
    border-radius: 8px;
    background: #fff2f2;
    color: #a91616;
}

.ludo-players {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.ludo-player {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    min-height: 58px;
    border-radius: 8px;
    background: var(--ludo-surface-soft);
    border: 2px solid transparent;
}

.ludo-player-emoji {
    position: absolute;
    left: 6px;
    top: -12px;
    z-index: 2;
    display: grid;
    place-items: center;
    min-width: 30px;
    min-height: 30px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,.2);
    font-size: 1.15rem;
    line-height: 1;
}

.ludo-player-emoji:empty {
    display: none;
}

.ludo-player.is-turn {
    border-color: #f6c343;
    background: #fff8df;
}

.ludo-player img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.ludo-player small {
    color: var(--ludo-muted);
}

.ludo-turn-seconds {
    display: none;
    width: fit-content;
    min-width: 28px;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--ludo-dark);
    color: #fff;
    font-size: .78rem;
    line-height: 1.5;
    text-align: center;
}

.ludo-player.is-turn .ludo-turn-seconds {
    display: inline-grid;
    place-items: center;
}

.ludo-play-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 12px;
}

.ludo-board-wrap {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.ludo-board-roll,
#rollBtn.ludo-board-roll,
#startBtn.ludo-board-roll {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8d35d, #f0a928);
    color: #171717;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    box-shadow: 0 10px 22px rgba(246, 195, 67, .24);
    cursor: pointer;
}

.ludo-board-roll:disabled,
#rollBtn.ludo-board-roll:disabled,
#startBtn.ludo-board-roll:disabled {
    background: linear-gradient(135deg, #d8dde2, #aeb7c0);
    color: #59636d;
    cursor: not-allowed;
    box-shadow: none;
}

.ludo-board-roll-bot,
#startBotsBtn.ludo-board-roll {
    background: linear-gradient(135deg, #6ed3ff, #2f91d5);
    color: #071923;
    box-shadow: 0 10px 22px rgba(47, 145, 213, .22);
}

.ludo-board-close {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #e85a5a, #c92f3a);
    color: #fff;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    box-shadow: 0 8px 18px rgba(217,72,72,.18);
    cursor: pointer;
}

.ludo-board-actions {
    display: grid;
    gap: 8px;
}

.ludo-board {
    --ludo-red: #e84c4f;
    --ludo-blue: #2f8fe8;
    --ludo-green: #32a85a;
    --ludo-yellow: #f2bf3d;
    --ludo-board-line: rgba(17, 27, 36, .13);
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    aspect-ratio: 1;
    padding: clamp(5px, 1.1vw, 10px);
    border: 4px solid #263238;
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.72)),
        url('/imgs/webp/mench.webp') center/cover;
    box-shadow:
        0 18px 42px rgba(18, 28, 38, .2),
        inset 0 0 0 2px rgba(255,255,255,.72);
    gap: 1px;
}

.ludo-cell {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    border: 1px solid transparent;
    background: rgba(255,255,255,.18);
    isolation: isolate;
}

.ludo-cell.is-track {
    border-color: var(--ludo-board-line);
    background:
        radial-gradient(circle at 50% 38%, rgba(255,255,255,.98) 0 28%, transparent 30%),
        linear-gradient(145deg, #ffffff, #e7edf2);
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,.9),
        inset -1px -1px 0 rgba(24, 35, 46, .08);
}

.ludo-cell.is-safe {
    border-color: rgba(121, 89, 12, .24);
    background:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,.95) 0 22%, transparent 24%),
        linear-gradient(145deg, #ffe891, #ffc947);
}

.ludo-cell.is-safe::after {
    content: "";
    position: absolute;
    inset: 31%;
    z-index: 1;
    clip-path: polygon(50% 0, 62% 34%, 98% 34%, 68% 55%, 79% 91%, 50% 68%, 21% 91%, 32% 55%, 2% 34%, 38% 34%);
    background: rgba(24, 33, 43, .42);
}

.ludo-cell.is-home.seat-1,
.ludo-cell.is-finish.seat-1 {
    border-color: rgba(160, 24, 31, .22);
    background: linear-gradient(145deg, #ffb8ba, var(--ludo-red));
}
.ludo-cell.is-home.seat-2,
.ludo-cell.is-finish.seat-2 {
    border-color: rgba(28, 91, 148, .22);
    background: linear-gradient(145deg, #b9dcff, var(--ludo-blue));
}
.ludo-cell.is-home.seat-3,
.ludo-cell.is-finish.seat-3 {
    border-color: rgba(28, 118, 62, .22);
    background: linear-gradient(145deg, #b9efc7, var(--ludo-green));
}
.ludo-cell.is-home.seat-4,
.ludo-cell.is-finish.seat-4 {
    border-color: rgba(159, 114, 12, .24);
    background: linear-gradient(145deg, #ffe89b, var(--ludo-yellow));
}

.ludo-cell.is-home {
    border-radius: 50%;
    border-width: 2px;
    box-shadow:
        inset 0 2px 5px rgba(255,255,255,.7),
        inset 0 -4px 7px rgba(0,0,0,.14),
        0 2px 7px rgba(0,0,0,.12);
}

.ludo-cell.is-center {
    border-color: rgba(255,255,255,.28);
    background:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,.92) 0 22%, transparent 24%),
        conic-gradient(from 45deg, var(--ludo-red), var(--ludo-blue), var(--ludo-green), var(--ludo-yellow), var(--ludo-red));
    box-shadow: inset 0 0 14px rgba(0,0,0,.16);
}

.ludo-cell.is-center::after {
    content: "";
    position: absolute;
    inset: 26%;
    border-radius: 50%;
    background: rgba(255,255,255,.86);
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
}

.ludo-token {
    position: absolute;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 76%;
    height: 76%;
    min-width: 16px;
    min-height: 16px;
    padding: 0;
    border: 2px solid rgba(255,255,255,.95);
    border-radius: 50%;
    background: #fff;
    box-shadow:
        0 6px 12px rgba(0,0,0,.24),
        inset 0 2px 4px rgba(255,255,255,.58),
        inset 0 -4px 7px rgba(0,0,0,.18);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, outline-color .16s ease;
}

.ludo-token:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow:
        0 9px 18px rgba(0,0,0,.28),
        inset 0 2px 4px rgba(255,255,255,.58),
        inset 0 -4px 7px rgba(0,0,0,.18);
}

.ludo-token img {
    width: 68%;
    height: 68%;
    object-fit: contain;
    border-radius: 50%;
}

.ludo-token.color-red { background: linear-gradient(145deg, #ff8b8d, var(--ludo-red)); }
.ludo-token.color-blue { background: linear-gradient(145deg, #8fc7ff, var(--ludo-blue)); }
.ludo-token.color-green { background: linear-gradient(145deg, #8be4a4, var(--ludo-green)); }
.ludo-token.color-yellow { background: linear-gradient(145deg, #ffe27d, var(--ludo-yellow)); }

.ludo-token.is-selected {
    outline: 3px solid #151b22;
    outline-offset: 2px;
    transform: translateY(-2px) scale(1.05);
}

.ludo-token.pawn-0 { right: 7%; bottom: 7%; }
.ludo-token.pawn-1 { left: 7%; bottom: 7%; }
.ludo-token.pawn-2 { right: 7%; top: 7%; }
.ludo-token.pawn-3 { left: 7%; top: 7%; }

.ludo-side {
    display: grid;
    align-content: start;
    gap: 10px;
}

.ludo-log,
.ludo-toast {
    padding: 12px;
    border-radius: 8px;
    background: var(--ludo-surface-soft);
    color: var(--ludo-text);
}

.ludo-dice-cube {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    width: 68px;
    height: 68px;
    padding: 11px;
    border-radius: 14px;
    background: linear-gradient(145deg, #fff, #edf1f4);
    border: 1px solid rgba(23, 33, 43, .12);
    box-shadow:
        inset 4px 4px 10px rgba(255,255,255,.92),
        inset -5px -5px 12px rgba(0,0,0,.08),
        0 14px 24px rgba(0,0,0,.2);
    transform: rotateX(10deg) rotateZ(-6deg);
}

.ludo-dice-cube i {
    display: block;
    border-radius: 50%;
    background: transparent;
}

.ludo-dice-cube i.is-active {
    background: #151b22;
    box-shadow: inset 1px 1px 2px rgba(255,255,255,.28);
}

@keyframes ludoDiceRoll {
    0% { transform: rotateX(10deg) rotateZ(-6deg) scale(1); }
    35% { transform: rotateX(64deg) rotateY(38deg) rotateZ(22deg) scale(1.08); }
    70% { transform: rotateX(-18deg) rotateY(-24deg) rotateZ(-16deg) scale(.96); }
    100% { transform: rotateX(10deg) rotateZ(-6deg) scale(1); }
}

.ludo-emojis {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.ludo-emojis button {
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    background: var(--ludo-surface-soft);
    font-size: 1.2rem;
}

.theme-dark .ludo-lobby,
.theme-dark .ludo-game,
body.theme-dark .ludo-lobby,
body.theme-dark .ludo-game {
    --ludo-surface: #1f2933;
    --ludo-surface-soft: #273541;
    --ludo-text: #f5f7fa;
    --ludo-muted: #b8c1cc;
    --ludo-border: rgba(255,255,255,.12);
    --ludo-dark: #111820;
}

.theme-dark .ludo-board,
body.theme-dark .ludo-board {
    --ludo-board-line: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.18);
    background:
        linear-gradient(135deg, rgba(17, 24, 32, .9), rgba(17, 24, 32, .74)),
        url('/imgs/webp/mench.webp') center/cover;
    box-shadow:
        0 18px 42px rgba(0,0,0,.36),
        inset 0 0 0 2px rgba(255,255,255,.08);
}

.theme-dark .ludo-cell.is-track,
body.theme-dark .ludo-cell.is-track {
    background:
        radial-gradient(circle at 50% 38%, rgba(255,255,255,.9) 0 27%, transparent 29%),
        linear-gradient(145deg, #344454, #22303c);
}

.theme-dark .ludo-panel,
.theme-dark .ludo-seo,
body.theme-dark .ludo-panel,
body.theme-dark .ludo-seo {
    background:
        linear-gradient(135deg, rgba(31, 41, 51, .96), rgba(31, 41, 51, .9)),
        url('/imgs/webp/mench.webp') center/cover;
    box-shadow: none;
}

.theme-dark .ludo-table,
.theme-dark .ludo-table th,
.theme-dark .ludo-table td,
body.theme-dark .ludo-table,
body.theme-dark .ludo-table th,
body.theme-dark .ludo-table td {
    background: transparent;
    color: var(--ludo-text);
}

.theme-dark .ludo-table th,
body.theme-dark .ludo-table th {
    color: var(--ludo-muted);
}

.theme-dark .ludo-player.is-turn,
body.theme-dark .ludo-player.is-turn {
    background: rgba(246, 195, 67, .16);
}

.ludo-log {
    max-height: 190px;
    overflow-y: auto;
    font-size: .82rem;
    line-height: 1.9;
}

.ludo-toast {
    display: none;
    background: var(--ludo-dark);
    color: #fff;
    text-align: center;
    font-weight: 900;
}

.ludo-toast.show {
    display: block;
}

.ludo-event-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(8, 14, 20, .32);
    pointer-events: none;
}

.ludo-event-overlay.show {
    display: grid;
}

.ludo-event-overlay > div {
    display: grid;
    gap: 7px;
    min-width: min(310px, 86vw);
    padding: 18px;
    border-radius: 8px;
    background: var(--ludo-surface);
    color: var(--ludo-text);
    text-align: center;
    box-shadow: 0 22px 60px rgba(0,0,0,.32);
    animation: ludoEventPop .28s ease both;
}

.ludo-event-overlay span {
    font-size: 2.4rem;
    line-height: 1;
}

.ludo-event-dice {
    display: grid;
    place-items: center;
}

.ludo-event-dice .ludo-dice-cube {
    width: 76px;
    height: 76px;
    gap: 8px;
    padding: 12px;
    transform: rotateX(10deg) rotateZ(-6deg);
    animation: ludoDiceRoll .5s ease both;
}

.ludo-event-overlay em {
    color: var(--ludo-muted);
    font-style: normal;
    font-weight: 900;
}

.ludo-event-overlay strong {
    font-size: 1.05rem;
    font-weight: 900;
}

.ludo-event-overlay p {
    margin: 0;
    font-weight: 900;
}

.ludo-event-overlay.is-capture > div {
    border: 2px solid #d94848;
}

.ludo-event-overlay.is-finish > div {
    border: 2px solid #16a36f;
}

.ludo-event-overlay.is-normal > div {
    border: 2px solid #f6c343;
}

.ludo-event-overlay.is-winner > div {
    border: 2px solid #f6c343;
    background:
        radial-gradient(circle at 50% 0, rgba(246, 195, 67, .18), transparent 42%),
        var(--ludo-surface);
}

@keyframes ludoEventPop {
    from { opacity: 0; transform: translateY(12px) scale(.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
    .ludo-hero,
    .ludo-play-area {
        grid-template-columns: 1fr;
    }

    .ludo-hero {
        padding: 16px;
        min-height: 0;
    }

    .ludo-hero h1 {
        font-size: 1.15rem;
    }

    .ludo-hero p {
        max-width: 72%;
        font-size: .72rem;
        line-height: 1.55;
    }

    .ludo-hero-action {
        left: 12px;
        bottom: 12px;
        min-width: 92px;
        min-height: 36px;
        padding: 0 10px;
        font-size: .78rem;
    }

    .ludo-home-banner {
        aspect-ratio: 21 / 9;
        padding: 16px;
    }

    .ludo-home-banner strong {
        font-size: 1.35rem;
    }

    .ludo-players {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
    }

    .ludo-player {
        display: grid;
        justify-items: center;
        gap: 4px;
        min-height: 72px;
        padding: 6px 4px;
        text-align: center;
    }

    .ludo-player img {
        width: 30px;
        height: 30px;
    }

    .ludo-player strong {
        display: block;
        max-width: 100%;
        overflow: hidden;
        font-size: .68rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ludo-player small {
        display: block;
        font-size: .58rem;
        line-height: 1.4;
    }

    .ludo-player-emoji {
        left: 50%;
        top: -10px;
        min-width: 26px;
        min-height: 26px;
        transform: translateX(-50%);
        font-size: 1rem;
    }

    .ludo-table-wrap {
        max-width: 100%;
        overflow-x: visible;
    }

    .ludo-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
        border-collapse: separate;
        border-spacing: 0 6px;
    }

    .ludo-table thead {
        display: none;
    }

    .ludo-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, .46fr) minmax(0, .5fr) minmax(0, .72fr) minmax(0, .72fr) minmax(44px, .52fr);
        align-items: center;
        gap: 3px;
        width: 100%;
        max-width: 100%;
        padding: 6px;
        border: 1px solid var(--ludo-border);
        border-radius: 8px;
        background: var(--ludo-surface-soft);
        overflow: hidden;
    }

    .ludo-table td {
        display: block;
        min-width: 0;
        max-width: 100%;
        padding: 0;
        border-bottom: 0;
        overflow: hidden;
        color: var(--ludo-text);
        font-size: clamp(.48rem, 2.15vw, .64rem);
        font-weight: 800;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ludo-table td::before {
        display: none;
    }

    .ludo-table td .ludo-join-btn,
    .ludo-table td .ludo-join-link {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 26px;
        padding: 0 3px;
        overflow: hidden;
        border-radius: 6px;
        font-size: clamp(.48rem, 2vw, .6rem);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ludo-table-compact tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, .46fr) minmax(0, .72fr) minmax(0, .72fr) minmax(44px, .52fr);
    }

    .ludo-game-head {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
        padding: 6px;
    }

    .ludo-game-head > div {
        min-height: 38px;
        padding: 5px;
    }

    .ludo-game-head span {
        font-size: .65rem;
    }

    .ludo-game-head strong {
        font-size: .76rem;
    }

    .ludo-side {
        grid-template-columns: 1fr 1fr;
    }

    .ludo-log,
    .ludo-emojis,
    .ludo-toast {
        grid-column: 1 / -1;
    }

    .ludo-rank-row {
        grid-template-columns: 24px minmax(0, 1fr) minmax(0, .6fr);
        gap: 4px;
        padding: 8px;
        overflow: hidden;
    }

    .ludo-rank-row > * {
        min-width: 0;
        overflow: hidden;
        font-size: clamp(.55rem, 2.35vw, .72rem);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ludo-board {
        padding: 4px;
        border-width: 3px;
        gap: 1px;
    }

    .ludo-token {
        width: 70%;
        height: 70%;
        min-width: 13px;
        min-height: 13px;
        border-width: 1px;
    }
}

@media (max-width: 380px) {
    .ludo-table tr {
        gap: 3px;
        padding: 5px 4px;
        grid-template-columns: minmax(0, 1.02fr) minmax(0, .42fr) minmax(0, .44fr) minmax(0, .63fr) minmax(0, .63fr) minmax(40px, .48fr);
    }

    .ludo-table-compact tr {
        grid-template-columns: minmax(0, .92fr) minmax(0, .42fr) minmax(0, .62fr) minmax(0, .62fr) minmax(40px, .48fr);
    }

    .ludo-table td {
        font-size: clamp(.45rem, 2.1vw, .58rem);
    }
}
