.playground {
    position: relative;
    /*border: 5px solid blue;*/
    height: 100%;
    width: 100%;
    overflow: hidden;
    isolation: isolate;
    --playground-table-circle-center-y: 45%;
    --playground-table-circle-size: clamp(18rem, 35svw, 32rem);
    --playground-bottom-seat-height: 5rem;
    --playground-bottom-seat-shift-y: min(-2svw, calc(var(--playground-bottom-seat-height) * -0.2));
    --playground-bottom-seat-center-y: calc(var(--playground-table-circle-center-y) + (var(--playground-table-circle-size) / 2) - (var(--playground-bottom-seat-height) / 2) + var(--playground-bottom-seat-shift-y));
}

.playground-table-circle {
    position: absolute;
    top: var(--playground-table-circle-center-y);
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--playground-table-circle-size);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, #2d5a3d 0%, #1a3d28 50%, #0d2318 100%);
    border: 4px solid rgba(218, 165, 32, 0.4);
    box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.45), 0 10px 28px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 0;
}

.playground-table-circle::before {
    content: "";
    position: absolute;
    inset: 5.5%;
    border-radius: 50%;
    border: 1px solid rgba(218, 165, 32, 0.25);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.35);
}

.playground-table-circle::after {
    content: "";
    position: absolute;
    inset: -4%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Light theme: same green felt hues as dark (#2d5a3d / #1a3d28 / #0d2318), translucent over the page */
.page:not(.radzen-dark-theme) .playground-table-circle {
    background: radial-gradient(ellipse at center,
            rgba(45, 90, 61, 0.96) 0%,
            rgba(26, 61, 40, 0.93) 52%,
            rgba(13, 35, 24, 0.9) 100%);
}

/* GameTableCard.razor — same light-theme felt as playground-table-circle */
.page:not(.radzen-dark-theme) .game-table-card .game-table-circle {
    background: radial-gradient(ellipse at center,
            rgba(45, 90, 61, 0.96) 0%,
            rgba(26, 61, 40, 0.93) 52%,
            rgba(13, 35, 24, 0.9) 100%);
}

.playground> :not(.playground-table-circle):not(.bottompackofcards) {
    z-index: 1;
}

.playground > .bottompackofcards {
    z-index: 10;
    pointer-events: none;
}

.gameproperties {
    position: absolute;
    top: 0;
    left: 0;
}

.playground > .playground-corner-panels {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.5rem;
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    right: 0.35rem;
    z-index: 5;
    pointer-events: none;
}

.playground-corner-panels>.game-goal-points,
.playground-corner-panels>.gamepoints {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    flex: 0 0 auto;
    align-self: stretch;
    height: auto;
    pointer-events: auto;
}

/* Top corner panels: shared felt gradient (Mud elevation-0 clears default shadow) */
.playground .gamepoints.playground-seat-info-box.mud-paper,
.playground .game-goal-points.playground-seat-info-box.mud-paper {
    --playground-corner-accent: rgba(255, 235, 180, 0.98);
    display: flex;
    align-items: stretch;
    box-sizing: border-box;
    min-height: 3.35rem;
    background: linear-gradient(145deg,
            rgba(41, 88, 66, 0.94) 0%,
            rgba(32, 72, 54, 0.93) 48%,
            rgba(24, 54, 39, 0.96) 100%) !important;
    border: 1px solid rgba(218, 165, 32, 0.45) !important;
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.playground .playground-corner-accent-value {
    color: var(--playground-corner-accent) !important;
    font-variant-numeric: tabular-nums;
}

.playground .playground-corner-accent-icon.mud-icon-button .mud-icon-root,
.playground .playground-corner-accent-icon.mud-icon-root {
    color: var(--playground-corner-accent) !important;
}

.playground .game-goal-points .game-goal-points-icon-row {
    min-width: 2.5rem;
    padding-top: 4px;
    padding-bottom: 4px;
    box-sizing: border-box;
}

.playground .game-goal-points .game-goal-points-icon {
    color: rgba(218, 165, 32, 0.95) !important;
    font-size: 1.75rem !important;
    width: 1.75rem !important;
    height: 1.75rem !important;
}

.playground .game-goal-points .game-goal-points-value {
    margin: 0 !important;
    line-height: 1.15;
}

.playground .game-goal-points .game-goal-points-unit {
    font-size: 0.65em;
    font-weight: 600;
    margin-left: 0.15rem;
    color: rgba(218, 165, 32, 0.85);
}

.playground .gamepoints .gamepoints-bar.mud-stack,
.playground .game-goal-points .gamepoints-bar.mud-stack {
    flex: 1;
    width: 100%;
    gap: 0.35rem !important;
    align-items: center !important;
}

.playground .gamepoints .gamepoints-details-row.mud-stack,
.playground .game-goal-points .game-goal-points-icon-row.mud-stack {
    align-self: center;
    justify-content: center;
}

.playground .gamepoints .gamepoints-details-row.mud-stack {
    gap: 0.1rem !important;
}

.playground .gamepoints .gamepoints-details-row>.mud-typography {
    margin: 0;
}

.playground .gamepoints .gamepoints-details-row .mud-icon-button {
    padding: 0.2rem;
}

.playground .gamepoints .gamepoints-divider {
    margin: 0 !important;
}

.playground .gamepoints .gamepoints-team-summary.mud-stack,
.playground .game-goal-points .gamepoints-team-summary.mud-stack {
    gap: 0.15rem !important;
}

.playground .gamepoints .gamepoints-team-summary>.mud-typography,
.playground .game-goal-points .gamepoints-team-summary>.mud-typography {
    margin: 0;
    line-height: 1.15;
}

@media (max-width: 640px) {
    .playground > .playground-corner-panels {
        justify-content: flex-start;
        top: calc(var(--playground-table-circle-center-y) + (var(--playground-table-circle-size) / 2) - 1rem);
    }

    .playground > .playground-corner-panels > .game-goal-points,
    .playground > .playground-corner-panels > .gamepoints {
        width: fit-content;
        max-width: 10.75rem;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .playground > .playground-corner-panels > .gamepoints {
        margin-left: auto;
    }

    .playground .gamepoints.playground-seat-info-box.mud-paper,
    .playground .game-goal-points.playground-seat-info-box.mud-paper {
        width: fit-content;
        max-width: 10.75rem;
        padding: 0.24rem 0.4rem;
        min-height: 2.95rem;
        height: 100%;
        align-items: center;
        box-sizing: border-box;
    }

    .playground .gamepoints .gamepoints-bar.mud-stack,
    .playground .game-goal-points .gamepoints-bar.mud-stack {
        gap: 0.22rem !important;
        flex: 1 1 auto;
        width: 100%;
        max-height: 100%;
        align-items: center !important;
        align-self: center;
    }

    .playground .game-goal-points .game-goal-points-icon-row {
        min-width: 2rem;
        padding-top: 1px;
        padding-bottom: 1px;
    }

    .playground .game-goal-points .game-goal-points-icon {
        font-size: 1.4rem !important;
        width: 1.4rem !important;
        height: 1.4rem !important;
    }

    .playground .gamepoints .gamepoints-team-summary.mud-stack,
    .playground .game-goal-points .gamepoints-team-summary.mud-stack {
        gap: 0.08rem !important;
    }

    .playground .gamepoints .gamepoints-team-summary>.mud-typography,
    .playground .game-goal-points .gamepoints-team-summary>.mud-typography {
        line-height: 1.1;
        margin: 0 !important;
    }

    .playground .gamepoints .gamepoints-team-summary>.mud-typography.mud-typography-h6,
    .playground .game-goal-points .gamepoints-team-summary>.mud-typography.mud-typography-h6 {
        font-size: 1.05rem !important;
    }

    .playground .gamepoints .gamepoints-details-row>.mud-typography {
        line-height: 1.1;
        margin: 0 !important;
    }

    .playground .gamepoints .gamepoints-details-row .mud-icon-button {
        padding: 0.15rem;
        margin: 0;
    }

    .playground .gamepoints .gamepoints-divider,
    .playground .game-goal-points .gamepoints-divider {
        align-self: stretch;
        max-height: 100%;
    }
}

.playground .gamepoints .mud-typography,
.playground .mud-typography {
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--mud-palette-info-text);
}

/* Legacy class for compatibility */
.playground-game-table-seat-nickname {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    text-overflow: ellipsis;
}

/* Seat info: name + suit/bet/statement in a clear, readable block */
.playground-seat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 0;
    width: 100%;
}

/* Side seats: nickname stays fixed, SuitBet+statement float above the seat box */
.playground-game-table-seat-left .playground-seat-info,
.playground-game-table-seat-right .playground-seat-info,
.playground-game-table-seat-bottom .playground-seat-info {
    position: relative;
    justify-content: center;
}

/* Single shared background for seat content (nickname + suit bet) */
.playground-seat-info-box:not(.gamepoints):not(.game-goal-points),
.playground-seat-suit-statement .suit-bet-box-visible {
    background: rgba(45, 55, 48, 0.55);
    border: 2px solid rgba(218, 165, 32, 0.18);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    padding: 0.35rem 0.5rem;
}

.playground-seat-info-box:not(.gamepoints):not(.game-goal-points) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 0;
    border: none;
}

.playground-seat-info-box-top {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* No inner background when suit bet is already inside the info box */
.playground-seat-info-box .suit-bet-box-visible {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.playground-game-table-seat-left .playground-seat-suit-statement,
.playground-game-table-seat-right .playground-seat-suit-statement {
    position: static;
    transform: none;
    margin: 0;
}

.playground-game-table-seat-bottom .playground-seat-suit-statement {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: -0.3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.playground-seat-round-journal {
    position: absolute;
    right: 0;
    transform: none;
    margin-top: -0.3rem;
    z-index: 5;
}

/* Journal button: same Y as main player's statement (bottom of table circle), to the right of played cards */
.playground-round-journal-button {
    position: static;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    margin-top: 0.25rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: rgba(152, 182, 164, 0.83);
    border: 1px solid rgba(226, 196, 116, 0.73);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.29);
}

.playground-seat-nickname {
    font-size: clamp(0.9rem, 2.6vw, 1.1rem);
    font-weight: 600;
    color: var(--mud-palette-info-text);
    letter-spacing: 0.02em;
    text-align: center;
    max-width: 20ch;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playground-starting-player-message,
.playground-game-points-calculation-message,
.playground-cards-distribution-message {
    font-size: clamp(0.9rem, 2.6vw, 1.1rem);
    font-weight: 600;
    color: var(--mud-palette-info-text);
    letter-spacing: 0.02em;
    text-align: center;
    max-width: 24ch;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.playground-seat-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
}

.playground-seat-name-row .playground-seat-nickname {
    text-align: center;
    min-width: 0;
}

.playground-main-status-center {
    position: absolute;
    left: 50%;
    top: calc(var(--playground-table-circle-center-y) + (var(--playground-table-circle-size) / 2));
    transform: translate(-50%, -100%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(24ch, 100%);
    text-align: center;
    z-index: 2;
    pointer-events: none;
}

/* Side seats: SuitBet icon with statement below */
.playground-game-table-seat-left .playground-seat-suit-statement> :first-child,
.playground-game-table-seat-right .playground-seat-suit-statement> :first-child {
    flex-direction: column !important;
    align-items: center;
}


.playground-seat-suit-statement {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.playground-seat-suit-statement .suit-bet-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.playground-turn-label {
    animation: turn-pulse 2.5s ease-in-out infinite;
}

@keyframes turn-pulse {

    0%,
    100% {
        opacity: 1;
        filter: drop-shadow(0 0 4px color-mix(in srgb, var(--pilottapp-accent-color) 40%, transparent));
    }

    50% {
        opacity: 0.92;
        filter: drop-shadow(0 0 10px color-mix(in srgb, var(--pilottapp-accent-color) 55%, transparent));
    }
}

.blinking {
    animation: blinker 2s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.playground-game-table-seat {
    position: absolute;
    display: flex;
    flex-direction: row;
    align-items: start;
    justify-content: center;
    background: transparent;
    border-radius: 12px;
    box-sizing: border-box;
    pointer-events: auto;
    will-change: transform;
    contain: layout style;
    width: auto;
    height: auto;
    min-height: 3rem;
    max-width: 13rem;
    min-width: 8rem;
}

.playground-game-table-seat-top {
    top: 0px;
    left: 50%;
    transform: translate(-50%, -100%);
    align-items: center;
    max-width: none;
}

.playground-game-table-seat-top .playground-seat-info {
    flex-direction: row;
    gap: 0.4rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.playground-game-table-seat-left,
.playground-game-table-seat-right,
.playground-game-table-seat-bottom {
    height: var(--playground-bottom-seat-height);
    min-height: var(--playground-bottom-seat-height);
    align-items: center;
    /* Fix width so it does not grow with long nicknames */
    width: 10rem;
    min-width: 10rem;
    max-width: 10rem;
}

.playground-game-table-seat-left {
    left: 0px;
    top: 50%;
    transform: translate(max(-50%, -6svw), -150%);
    align-items: end;
}

.playground-game-table-seat-right {
    right: 0px;
    top: 50%;
    transform: translate(min(50%, 6svw), -150%);
    align-items: end;
}

.playground-game-table-seat-bottom {
    bottom: 0px;
    align-items: start;
    transform: translate(0, var(--playground-bottom-seat-shift-y));
}

/* Responsive: smaller seats and more room for long names on mobile */
@media (max-width: 480px) {
    .playground {
        --playground-bottom-seat-height: 4rem;
    }

    .playground-game-table-seat {
        min-width: 6rem;
        max-width: 12rem;
        min-height: 2.5rem;
    }

    .playground-game-table-seat-left,
    .playground-game-table-seat-right,
    .playground-game-table-seat-bottom {
        height: var(--playground-bottom-seat-height);
        min-height: var(--playground-bottom-seat-height);
        /* Slightly narrower fixed width on very small screens */
        width: 8rem;
        min-width: 8rem;
        max-width: 8rem;
    }

    .playground-table-seat-bottom {
        transform: translate(0, 0);
    }

    .playground-seat-info {
        gap: 0.25rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .playground-game-table-seat {
        max-width: 11rem;
        min-width: 7rem;
    }

}