.ddz-shell {
    --felt: #155f49;
    --felt-deep: #0d3f34;
    --panel: rgba(255, 255, 255, 0.88);
    --ink: #17201c;
    --muted: #66736d;
    --line: rgba(17, 32, 27, 0.16);
    --gold: #d7a847;
    --red: #c93535;
    --black: #18221e;
    --card-w: clamp(42px, 6.3vw, 72px);
    --card-h: calc(var(--card-w) * 1.42);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px;
}

body:has(.ddz-shell) .wp-block-post-title {
    display: none;
}

body:has(.ddz-shell) .has-global-padding {
    padding-left: clamp(10px, 3vw, 24px) !important;
    padding-right: clamp(10px, 3vw, 24px) !important;
}

.ddz-shell * {
    box-sizing: border-box;
}

.ddz-shell [hidden] {
    display: none !important;
}

.ddz-topbar,
.ddz-scorebar,
.ddz-controls,
.ddz-log {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

.ddz-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.ddz-kicker {
    margin: 0 0 3px;
    color: #7a6330;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.ddz-topbar h1 {
    margin: 0;
    color: #18221e;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.05;
    letter-spacing: 0;
}

.ddz-top-actions,
.ddz-controls,
.ddz-bid-controls,
.ddz-play-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ddz-icon-btn,
.ddz-reset-btn,
.ddz-controls button {
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    border-radius: 8px;
    min-height: 42px;
    padding: 0 16px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(21, 37, 30, 0.1);
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.ddz-icon-btn {
    width: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 20px;
}

.ddz-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 124px;
    justify-content: center;
}

.ddz-icon-btn:hover,
.ddz-reset-btn:hover,
.ddz-controls button:hover,
.ddz-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(21, 37, 30, 0.18);
}

.ddz-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ddz-controls .ddz-primary {
    background: #1f7a5d;
    color: #ffffff;
    border-color: #1f7a5d;
}

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

.ddz-scorebar div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    padding: 10px 12px;
}

.ddz-scorebar span,
.ddz-player-meta span,
.ddz-player-note,
.ddz-log {
    color: var(--muted);
    font-size: 13px;
}

.ddz-scorebar strong {
    display: block;
    margin-top: 2px;
    font-size: 20px;
    line-height: 1.1;
}

.ddz-table {
    position: relative;
    display: grid;
    grid-template-columns: minmax(145px, 190px) 1fr minmax(145px, 190px);
    grid-template-rows: minmax(260px, auto) auto;
    grid-template-areas:
        "left center right"
        "human human human";
    gap: 14px;
    min-height: 590px;
    padding: clamp(14px, 2.2vw, 28px);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.11), transparent 30%),
        linear-gradient(145deg, var(--felt), var(--felt-deep));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 24px 60px rgba(12, 32, 25, 0.26);
    overflow: hidden;
}

.ddz-opponent,
.ddz-human,
.ddz-center {
    min-width: 0;
}

.ddz-opponent-left {
    grid-area: left;
}

.ddz-opponent-right {
    grid-area: right;
}

.ddz-human {
    grid-area: human;
    align-self: end;
}

.ddz-center {
    grid-area: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    min-height: 330px;
}

.ddz-opponent,
.ddz-human {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    padding: 12px;
}

.ddz-player-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #ffffff;
}

.ddz-player-meta strong {
    display: block;
    line-height: 1.15;
    white-space: nowrap;
}

.ddz-player-meta span:not(.ddz-avatar) {
    color: rgba(255, 255, 255, 0.78);
}

.ddz-avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fffdf8;
    color: #145642;
    font-weight: 900;
}

.ddz-card-back-row,
.ddz-landlord-cards,
.ddz-played-zone,
.ddz-hand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ddz-card-back-row {
    margin-top: 18px;
    min-height: var(--card-h);
}

.ddz-card-back-row .ddz-card-back {
    margin-left: calc(var(--card-w) * -0.68);
}

.ddz-card-back-row .ddz-card-back:first-child {
    margin-left: 0;
}

.ddz-player-note {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.78);
    min-height: 18px;
}

.ddz-landlord-cards {
    min-height: calc(var(--card-h) + 12px);
    gap: 8px;
}

.ddz-trick {
    display: grid;
    place-items: center;
    min-height: 190px;
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.36);
    background: rgba(4, 22, 17, 0.18);
    padding: 18px;
}

.ddz-trick p {
    margin: 0 0 14px;
    max-width: 680px;
    color: #fffdf8;
    font-weight: 800;
    text-align: center;
    line-height: 1.45;
}

.ddz-played-zone {
    flex-wrap: wrap;
    gap: 6px;
    min-height: var(--card-h);
}

.ddz-hand {
    margin-top: 12px;
    min-height: calc(var(--card-h) + 32px);
    justify-content: center;
    flex-wrap: nowrap;
    padding: 18px 12px 8px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
}

.ddz-card,
.ddz-card-back {
    flex: 0 0 var(--card-w);
    width: var(--card-w);
    height: var(--card-h);
    border-radius: 8px;
    user-select: none;
}

.ddz-card {
    position: relative;
    border: 1px solid rgba(18, 32, 28, 0.2);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(249, 244, 232, 0.98));
    color: var(--black);
    box-shadow: 0 10px 18px rgba(9, 20, 16, 0.18);
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.ddz-hand .ddz-card {
    margin-left: calc(var(--card-w) * -0.42);
}

.ddz-hand .ddz-card:first-child {
    margin-left: 0;
}

.ddz-card.ddz-red {
    color: var(--red);
}

.ddz-card.ddz-selected {
    transform: translateY(-22px);
    border-color: var(--gold);
    box-shadow: 0 16px 28px rgba(9, 20, 16, 0.26);
}

.ddz-rank {
    position: absolute;
    top: 7px;
    left: 8px;
    font-size: clamp(15px, 2vw, 23px);
    font-weight: 900;
    line-height: 1;
}

.ddz-suit {
    position: absolute;
    bottom: 7px;
    right: 8px;
    font-size: clamp(15px, 2vw, 22px);
    font-weight: 900;
    line-height: 1;
}

.ddz-card-back {
    border: 1px solid rgba(255, 255, 255, 0.42);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%) 0 0 / 14px 14px,
        linear-gradient(225deg, rgba(255, 255, 255, 0.16) 25%, transparent 25%) 0 0 / 14px 14px,
        #8f2634;
    box-shadow: 0 9px 16px rgba(9, 20, 16, 0.2);
}

.ddz-controls {
    justify-content: center;
    min-height: 54px;
    padding: 14px 0 8px;
}

.ddz-log {
    display: grid;
    gap: 6px;
    max-height: 118px;
    overflow: auto;
    border-top: 1px solid var(--line);
    padding-top: 10px;
    line-height: 1.35;
}

.ddz-log p {
    margin: 0;
}

.ddz-log strong {
    color: #1f342d;
}

.ddz-hidden {
    display: none !important;
}

@media (max-width: 760px) {
    .ddz-shell {
        width: calc(100% - 20px);
        margin-left: 10px;
        margin-right: 10px;
        padding: 12px;
        --card-w: clamp(38px, 12.5vw, 58px);
    }

    .ddz-topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .ddz-top-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
        padding-top: 2px;
    }

    .ddz-icon-btn {
        width: 38px;
        min-height: 38px;
    }

    .ddz-reset-btn {
        min-width: 108px;
        min-height: 38px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .ddz-scorebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ddz-table {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto minmax(220px, auto) auto;
        grid-template-areas:
            "left right"
            "center center"
            "human human";
        min-height: 620px;
    }

    .ddz-hand {
        justify-content: flex-start;
        padding-left: 28px;
    }

    .ddz-controls {
        justify-content: stretch;
    }

    .ddz-bid-controls,
    .ddz-play-controls {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ddz-play-controls {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ddz-controls button {
        padding-left: 8px;
        padding-right: 8px;
        min-width: 0;
    }
}
