/* /pitch/css/PitchParadise.css
==============================================================
PitchParadise — PitchUI Interface
============================================================== */

:root {
    --pp-forest: #073a2b;
    --pp-felt: #0c6045;
    --pp-felt-light: #14805d;
    --pp-gold: #d9ad55;
    --pp-gold-light: #f4daa0;
    --pp-cream: #fff8e7;
    --pp-ink: #15251e;
    --pp-red: #b72e3b;
    --pp-muted: #b8cbc2;
    --pp-panel: rgba(5, 38, 28, 0.94);
    --pp-line: rgba(236, 205, 137, 0.36);
    --pp-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
}

body {
    color: var(--pp-cream);
    background:
        radial-gradient(
            circle at 50% 18%,
            var(--pp-felt-light),
            var(--pp-felt) 42%,
            var(--pp-forest) 100%
        );
    font-family: Georgia, "Times New Roman", serif;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--pp-gold-light);
    outline-offset: 2px;
}

.red-suit,
.red-card {
    color: var(--pp-red) !important;
}

/* ==========================================================
Application
========================================================== */

.pitch-paradise {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.pitch-main {
    flex: 1;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: clamp(22px, 4vw, 48px);
}

/* ==========================================================
Header
========================================================== */

.pitch-header {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 10px clamp(16px, 4vw, 48px);
    background: rgba(4, 32, 23, 0.96);
    border-bottom: 1px solid var(--pp-line);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(8px);
}

.pitch-brand {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 0;
    color: var(--pp-cream);
    text-align: left;
    background: transparent;
    border: 0;
}

.pitch-brand-mark {
    display: grid;
    width: 44px;
    height: 52px;
    place-items: center;
    color: var(--pp-forest);
    background: var(--pp-cream);
    border: 2px solid var(--pp-gold);
    border-radius: 7px;
    box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
    font-size: 1.7rem;
    font-weight: 700;
}

.pitch-brand-text {
    display: grid;
    gap: 1px;
}

.pitch-brand-text strong {
    color: var(--pp-gold-light);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.pitch-brand-text small {
    color: var(--pp-muted);
    font-size: 0.78rem;
}

.pitch-header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ==========================================================
Common Buttons
========================================================== */

.pitch-outline-button,
.pitch-gold-button,
.pitch-action-button,
.pitch-suit-button {
    min-height: 42px;
    padding: 10px 17px;
    border-radius: 8px;
    font-weight: 700;
    transition:
        transform 120ms ease,
        box-shadow 120ms ease,
        background-color 120ms ease;
}

.pitch-outline-button {
    color: var(--pp-cream);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pitch-gold-button,
.pitch-action-button {
    color: var(--pp-ink);
    background: linear-gradient(
        180deg,
        var(--pp-gold-light),
        var(--pp-gold)
    );
    border: 1px solid #f7e5b7;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
}

.pitch-pass-button {
    color: var(--pp-cream);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.32);
}

.pitch-outline-button:hover:not(:disabled),
.pitch-gold-button:hover:not(:disabled),
.pitch-action-button:hover:not(:disabled),
.pitch-suit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32);
}

/* ==========================================================
Lobby Hero
========================================================== */

.pitch-lobby {
    display: grid;
    gap: 32px;
}

.pitch-hero {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.pitch-eyebrow {
    margin: 0 0 10px;
    color: var(--pp-gold);
    font-size: 0.79rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.pitch-hero h1 {
    margin: 0;
    color: var(--pp-cream);
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 1;
}

.pitch-hero h1 em {
    display: block;
    margin-top: 7px;
    color: var(--pp-gold-light);
    font-weight: 400;
}

.pitch-hero-copy {
    max-width: 690px;
    margin: 22px auto 0;
    color: #e3eee8;
    font-size: clamp(1rem, 2.4vw, 1.23rem);
    line-height: 1.55;
}

/* ==========================================================
Lobby Choices
========================================================== */

.pitch-mode-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
}

.pitch-mode-card {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 11px;
    min-height: 245px;
    padding: 24px 20px;
    color: var(--pp-cream);
    text-align: left;
    background:
        linear-gradient(
            150deg,
            rgba(10, 71, 51, 0.96),
            rgba(4, 38, 27, 0.96)
        );
    border: 1px solid var(--pp-line);
    border-radius: 15px;
    box-shadow: var(--pp-shadow);
    transition:
        transform 150ms ease,
        border-color 150ms ease;
}

.pitch-mode-card.featured {
    border-color: var(--pp-gold);
}

.pitch-mode-card:hover {
    transform: translateY(-5px);
    border-color: var(--pp-gold-light);
}

.pitch-mode-symbol {
    font-size: 2.5rem;
    line-height: 1;
}

.pitch-mode-card strong {
    color: var(--pp-gold-light);
    font-size: 1.22rem;
}

.pitch-mode-card small {
    color: #d7e5de;
    font-size: 0.94rem;
    line-height: 1.45;
}

.pitch-mode-action {
    color: var(--pp-gold);
    font-weight: 700;
}

/* ==========================================================
Messages
========================================================== */

.pitch-message-banner {
    position: relative;
    margin-bottom: 20px;
    padding: 13px 50px 13px 16px;
    border: 1px solid;
    border-radius: 9px;
}

.pitch-message-banner.notice {
    color: #f8e9bc;
    background: rgba(88, 67, 17, 0.74);
    border-color: var(--pp-gold);
}

.pitch-message-banner.error {
    color: #ffe7e7;
    background: rgba(115, 25, 32, 0.84);
    border-color: #ea7a83;
}

.pitch-message-banner button {
    position: absolute;
    top: 50%;
    right: 10px;
    padding: 3px 9px;
    color: inherit;
    background: transparent;
    border: 0;
    transform: translateY(-50%);
    font-size: 1.3rem;
}

/* ==========================================================
Scoreboard
========================================================== */

.pitch-game-wrapper {
    display: grid;
    gap: 18px;
}

.pitch-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px 18px;
    background: var(--pp-panel);
    border: 1px solid var(--pp-line);
    border-radius: 12px;
    box-shadow: var(--pp-shadow);
}

.pitch-team-score {
    display: grid;
    gap: 2px;
    color: var(--pp-muted);
    text-align: center;
}

.pitch-team-score strong {
    color: var(--pp-gold-light);
    font-size: 2rem;
}

.pitch-score-goal {
    color: var(--pp-cream);
    text-align: center;
}

/* ==========================================================
Felt Table
========================================================== */

.pitch-felt {
    position: relative;
    width: min(850px, 100%);
    height: min(57vw, 540px);
    min-height: 440px;
    margin: 0 auto;
    background:
        radial-gradient(
            ellipse at center,
            #1a805d,
            #0d5941 57%,
            #073d2c
        );
    border: clamp(10px, 2vw, 18px) solid #633a21;
    border-radius: 48%;
    box-shadow:
        inset 0 0 35px rgba(0, 0, 0, 0.48),
        0 20px 45px rgba(0, 0, 0, 0.45);
}

.pitch-seat {
    position: absolute;
    z-index: 4;
    display: grid;
    min-width: 130px;
    gap: 3px;
    justify-items: center;
    padding: 9px 12px;
    text-align: center;
    background: rgba(3, 29, 21, 0.94);
    border: 1px solid var(--pp-line);
    border-radius: 10px;
}

.pitch-seat.active {
    border-color: var(--pp-gold-light);
    box-shadow: 0 0 18px rgba(244, 218, 160, 0.6);
}

.pitch-seat.open {
    opacity: 0.72;
    border-style: dashed;
}

.pitch-seat-south {
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
}

.pitch-seat-north {
    top: 4%;
    left: 50%;
    transform: translateX(-50%);
}

.pitch-seat-west {
    top: 50%;
    left: 3%;
    transform: translateY(-50%);
}

.pitch-seat-east {
    top: 50%;
    right: 3%;
    transform: translateY(-50%);
}

.pitch-seat-avatar {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: var(--pp-ink);
    background: var(--pp-gold-light);
    border-radius: 50%;
    font-weight: 700;
}

.pitch-seat strong {
    color: var(--pp-cream);
}

.pitch-seat small {
    color: var(--pp-muted);
    font-size: 0.77rem;
}

.pitch-trump-badge,
.pitch-host-badge {
    position: absolute;
    z-index: 5;
    display: grid;
    gap: 2px;
    place-items: center;
    padding: 7px 10px;
    color: var(--pp-muted);
    background: rgba(3, 27, 19, 0.92);
    border: 1px solid var(--pp-line);
    border-radius: 8px;
    font-size: 0.7rem;
}

.pitch-trump-badge {
    top: 17%;
    left: 17%;
}

.pitch-trump-badge strong {
    font-size: 1.8rem;
}

.pitch-host-badge {
    top: 17%;
    right: 17%;
    color: var(--pp-gold-light);
}

.pitch-trick-area {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250px;
    height: 220px;
    transform: translate(-50%, -50%);
}

.pitch-table-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    color: rgba(244, 218, 160, 0.38);
    transform: translate(-50%, -50%);
}

.pitch-table-mark strong {
    font-size: 3.5rem;
}

.pitch-table-mark small {
    letter-spacing: 0.12em;
}

.pitch-trick-card {
    position: absolute;
}

.pitch-trick-player-0 {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.pitch-trick-player-1 {
    top: 50%;
    left: 0;
    transform: translateY(-50%) rotate(90deg);
}

.pitch-trick-player-2 {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.pitch-trick-player-3 {
    top: 50%;
    right: 0;
    transform: translateY(-50%) rotate(90deg);
}

/* ==========================================================
Cards and Player Hand
========================================================== */

.pitch-player-hand {
    display: flex;
    justify-content: center;
    min-height: 130px;
    padding: 9px 20px 0;
}

.pitch-card {
    position: relative;
    flex: 0 0 82px;
    width: 82px;
    height: 116px;
    padding: 7px;
    color: #151515;
    background: linear-gradient(145deg, #fff, #eee8da);
    border: 1px solid #aaa397;
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.36);
}

.pitch-player-hand .pitch-card + .pitch-card {
    margin-left: -18px;
}

.pitch-card:disabled {
    opacity: 0.78;
}

.pitch-card.playable {
    cursor: pointer;
}

.pitch-card.playable:hover {
    z-index: 10;
    transform: translateY(-14px);
    border-color: var(--pp-gold);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.42);
}

.pitch-card-rank {
    position: absolute;
    top: 7px;
    left: 8px;
    font-weight: 700;
}

.pitch-card-suit {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 2.6rem;
    transform: translate(-50%, -50%);
}

.pitch-card-rank-bottom {
    position: absolute;
    right: 8px;
    bottom: 7px;
    font-weight: 700;
    transform: rotate(180deg);
}

.pitch-empty-hand {
    align-self: center;
    color: var(--pp-muted);
}

/* ==========================================================
Actions and Results
========================================================== */

.pitch-action-area {
    display: grid;
    gap: 14px;
}

.pitch-game-message {
    margin: 0;
    padding: 12px;
    color: var(--pp-cream);
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9px;
}

.pitch-bid-controls,
.pitch-trump-controls,
.pitch-waiting-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.pitch-suit-button {
    width: 54px;
    height: 54px;
    padding: 3px;
    color: #171717;
    background: var(--pp-cream);
    border: 1px solid var(--pp-gold);
    font-size: 2rem;
}

.pitch-table-code {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 10px 14px;
    background: var(--pp-panel);
    border: 1px solid var(--pp-line);
    border-radius: 9px;
}

.pitch-table-code small {
    color: var(--pp-muted);
}

.pitch-table-code strong {
    color: var(--pp-gold-light);
    font-family: Consolas, Monaco, monospace;
    font-size: 1.45rem;
    letter-spacing: 0.12em;
}

.pitch-hand-result,
.pitch-game-result {
    display: grid;
    gap: 16px;
    justify-items: center;
    padding: 20px;
    background: var(--pp-panel);
    border: 1px solid var(--pp-line);
    border-radius: 12px;
}

.pitch-hand-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
}

.pitch-point-summary {
    display: grid;
    gap: 6px;
    padding: 14px;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.pitch-point-summary small {
    color: var(--pp-muted);
}

/* ==========================================================
Dialogs and House Rules
========================================================== */

.pitch-dialog-overlay,
.pitch-panel-overlay {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    padding: 18px;
    place-items: center;
    background: rgba(0, 0, 0, 0.74);
    backdrop-filter: blur(4px);
}

.pitch-dialog,
.pitch-rules-panel {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: clamp(24px, 5vw, 38px);
    color: var(--pp-ink);
    background: var(--pp-cream);
    border: 2px solid var(--pp-gold);
    border-radius: 15px;
    box-shadow: var(--pp-shadow);
}

.pitch-rules-panel {
    width: min(560px, 100%);
}

.pitch-dialog-close,
.pitch-panel-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    color: var(--pp-ink);
    background: transparent;
    border: 0;
    font-size: 1.65rem;
}

.pitch-dialog-content h2,
.pitch-rules-panel h2 {
    margin: 4px 0 8px;
    color: #164c38;
    font-size: 2rem;
}

.pitch-dialog-copy {
    color: #4f6259;
    line-height: 1.45;
}

.pitch-dialog-form,
.pitch-rules-panel {
    display: grid;
    gap: 16px;
}

.pitch-form-field {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.pitch-form-field input,
.pitch-form-field select {
    width: 100%;
    min-height: 45px;
    padding: 9px 11px;
    color: var(--pp-ink);
    background: #fff;
    border: 1px solid #9a9a91;
    border-radius: 7px;
}

.pitch-code-input {
    text-align: center;
    text-transform: uppercase;
    font-family: Consolas, Monaco, monospace;
    font-size: 1.5rem;
    letter-spacing: 0.16em;
}

.pitch-rules-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    width: 100%;
    padding: 14px;
    color: var(--pp-cream);
    background: var(--pp-forest);
    border: 1px solid rgba(244, 218, 160, 0.32);
    border-radius: 9px;
    text-align: left;
    transition:
        background 150ms ease,
        border-color 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

.pitch-rules-summary:hover {
    background: #0b4b38;
    border-color: var(--pp-gold);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.pitch-rules-summary:active {
    transform: translateY(0);
}

.pitch-rules-summary-copy,
.pitch-rules-directions-label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.pitch-rules-summary small {
    color: var(--pp-muted);
}

.pitch-rules-summary-copy strong,
.pitch-rules-summary-copy small {
    overflow-wrap: anywhere;
}

.pitch-rules-directions-label {
    min-width: 130px;
    padding-left: 14px;
    border-left: 1px solid rgba(244, 218, 160, 0.38);
    text-align: right;
}

.pitch-rules-directions-label strong {
    color: var(--pp-gold-light);
    font-size: 0.96rem;
}

.pitch-rules-directions-label small {
    font-size: 0.72rem;
    white-space: nowrap;
}

/* GamePlay Directions opens above the still-visible House Rules panel. */

.pitch-directions-overlay {
    z-index: 160;
    overflow: auto;
    background: rgba(0, 20, 15, 0.86);
}

.pitch-dialog.pitch-directions-panel {
    width: min(880px, 100%);
    max-height: calc(100vh - 36px);
    padding: clamp(24px, 4vw, 42px);
    scroll-behavior: smooth;
}

.pitch-directions-header {
    padding-right: 32px;
}

.pitch-directions-header h2 {
    margin: 4px 0 8px;
    color: #164c38;
    font-size: clamp(1.75rem, 5vw, 2.45rem);
    line-height: 1.08;
}

.pitch-directions-subtitle {
    max-width: 720px;
    margin: 0;
    color: #4f6259;
    font-size: 1.02rem;
    line-height: 1.55;
}

.pitch-directions-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.pitch-directions-facts span {
    padding: 6px 10px;
    color: #26463a;
    background: #f2e8cf;
    border: 1px solid #d2bd89;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pitch-directions-section {
    margin-top: 22px;
}

.pitch-directions-section h3 {
    margin: 0 0 9px;
    padding-bottom: 6px;
    color: #164c38;
    border-bottom: 1px solid #d8c69c;
    font-size: 1.22rem;
}

.pitch-directions-section > p {
    margin: 8px 0 0;
    color: #334d42;
    line-height: 1.62;
}

.pitch-directions-trump-rule {
    margin-top: 22px;
    padding: 16px 18px;
    color: var(--pp-cream);
    background: var(--pp-forest);
    border: 1px solid var(--pp-gold);
    border-radius: 10px;
}

.pitch-directions-trump-rule strong {
    color: var(--pp-gold-light);
    font-size: 1.08rem;
}

.pitch-directions-trump-rule p {
    margin: 6px 0 0;
    line-height: 1.58;
}

.pitch-directions-point-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.pitch-directions-point {
    padding: 14px;
    background: #fffdf5;
    border: 1px solid #d8c69c;
    border-radius: 9px;
    box-shadow: 0 3px 10px rgba(29, 51, 42, 0.08);
}

.pitch-directions-point h4 {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: baseline;
    margin: 0 0 7px;
    color: #164c38;
    font-size: 1.05rem;
}

.pitch-directions-point h4 span {
    flex: none;
    color: #8b681e;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pitch-directions-point p {
    margin: 5px 0 0;
    color: #344d43;
    line-height: 1.48;
}

.pitch-directions-point .pitch-directions-tip {
    margin-top: 8px;
    color: #526a60;
    font-size: 0.88rem;
    font-style: italic;
}

.pitch-directions-back {
    display: block;
    min-height: 42px;
    margin: 26px auto 0;
    padding: 9px 18px;
    color: var(--pp-cream);
    background: var(--pp-forest);
    border: 1px solid var(--pp-gold);
    border-radius: 8px;
    font-weight: 700;
}

.pitch-directions-back:hover,
.pitch-directions-back:focus-visible {
    color: var(--pp-forest);
    background: var(--pp-gold-light);
}

@media (max-width: 620px) {
    .pitch-directions-overlay {
        padding: 7px;
    }

    .pitch-dialog.pitch-directions-panel {
        max-height: calc(100vh - 14px);
        padding: 22px 17px;
        border-radius: 12px;
    }

    .pitch-directions-point-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .pitch-rules-summary {
        gap: 9px;
        padding: 12px;
    }

    .pitch-rules-directions-label {
        min-width: 112px;
        padding-left: 9px;
    }

    .pitch-rules-directions-label strong {
        font-size: 0.86rem;
    }

    .pitch-rules-directions-label small {
        font-size: 0.64rem;
        white-space: normal;
    }
}

/* ==========================================================
Connection, Waiting and Footer
========================================================== */

.pitch-connection-indicator {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: var(--pp-muted);
    font-size: 0.82rem;
}

.pitch-connection-indicator i {
    width: 9px;
    height: 9px;
    background: #d29e36;
    border-radius: 50%;
}

.pitch-connection-indicator.status-connected i {
    background: #46cf78;
}

.pitch-connection-indicator.status-error i {
    background: #e0525d;
}

.pitch-empty-table {
    display: grid;
    min-height: 350px;
    place-content: center;
    justify-items: center;
    color: var(--pp-muted);
}

.pitch-loading-mark {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    color: var(--pp-gold-light);
    border: 3px solid var(--pp-gold);
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
}

.pitch-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 25px;
    justify-content: center;
    padding: 17px;
    color: var(--pp-muted);
    background: rgba(3, 27, 19, 0.94);
    border-top: 1px solid var(--pp-line);
    font-size: 0.84rem;
}

/* ==========================================================
Responsive
========================================================== */

@media (max-width: 900px) {
    .pitch-mode-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pitch-felt {
        height: 560px;
        border-radius: 39%;
    }
}

/* ==========================================================
Mobile Table — Original Criss-Cross, No Black Seat Panels
========================================================== */

@media (max-width: 600px) {
    .pitch-seat,
    .pitch-seat.active,
    .pitch-seat.open {
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .pitch-seat strong,
    .pitch-seat small {
        text-shadow: 0 2px 4px #001a12;
    }

    .pitch-trick-area {
        z-index: 10;
        width: 190px;
        height: 200px;
        pointer-events: none;
    }

    .pitch-trick-player-0 {
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    /*.pitch-trick-player-1 {
        top: 50%;
        left: 0;
        transform: translateY(-50%) rotate(90deg);
    }*/

    .pitch-trick-player-2 {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    /*.pitch-trick-player-3 {
        top: 50%;
        right: 0;
        left: auto;
        transform: translateY(-50%) rotate(90deg);
    }*/
}

@media (max-width: 390px) {
    .pitch-brand-mark {
        width: 37px;
        height: 44px;
    }

    .pitch-brand-text strong {
        font-size: 1.05rem;
    }

    .pitch-header .pitch-outline-button {
        padding-inline: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ==========================================================
Opponent Card Backs
========================================================== */

.pitch-seat:not(.pitch-seat-south) {
    padding-top: 42px;
}

.pitch-seat:not(.pitch-seat-south)::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -34px;
    left: 50%;
    width: 92px;
    height: 72px;
    transform: translateX(-50%);
    background:
        url("/pitch/assets/cards/card-back.svg")
            left 12px center / 38px 54px no-repeat,
        url("/pitch/assets/cards/card-back.svg")
            center center / 38px 54px no-repeat,
        url("/pitch/assets/cards/card-back.svg")
            right 12px center / 38px 54px no-repeat;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.38));
    pointer-events: none;
}

.pitch-seat-west::before {
    transform: translateX(-50%) rotate(8deg);
}

.pitch-seat-east::before {
    transform: translateX(-50%) rotate(-8deg);
}

/* Four-player cutthroat scoreboard */

.pitch-scoreboard.cutthroat {
    grid-template-columns:
        repeat(4, minmax(100px, 1fr));
}

.pitch-scoreboard.cutthroat .pitch-score-goal {
    grid-column: 1 / -1;
    grid-row: 1;
}

@media (max-width: 600px) {
    .pitch-scoreboard.cutthroat {
        grid-template-columns:
            repeat(2, minmax(100px, 1fr));
    }
}

/* ==========================================================
   Table Chat
========================================================== */

.pitch-chat {
    width: min(100%, 760px);
    margin: 16px auto 0;
    padding: 14px;
    color: var(--pp-cream);
    background: var(--pp-panel);
    border: 1px solid var(--pp-line);
    border-radius: 12px;
}

.pitch-chat-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.pitch-chat-heading h2 {
    margin: 0;
    color: var(--pp-gold-light);
    font-size: 1rem;
}

.pitch-chat-status {
    color: var(--pp-muted);
    font-size: 0.75rem;
}

.pitch-chat-messages {
    height: 180px;
    padding: 10px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(236, 205, 137, 0.2);
    border-radius: 8px;
}

.pitch-chat-empty {
    margin: 55px 0 0;
    color: var(--pp-muted);
    text-align: center;
    font-style: italic;
}

.pitch-chat-message {
    margin: 0 0 8px;
    padding: 7px 9px;
    background: rgba(255, 248, 231, 0.08);
    border-radius: 7px;
}

.pitch-chat-message.mine {
    background: rgba(217, 173, 85, 0.15);
    border-left: 3px solid var(--pp-gold);
}

.pitch-chat-message.system {
    color: var(--pp-muted);
    font-style: italic;
}

.pitch-chat-message-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 3px;
    color: var(--pp-gold-light);
    font-size: 0.75rem;
}

.pitch-chat-message-header time {
    color: var(--pp-muted);
    font-weight: normal;
}

.pitch-chat-message p {
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.pitch-chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 10px;
}

.pitch-chat-input {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    color: var(--pp-ink);
    background: var(--pp-cream);
    border: 1px solid var(--pp-gold);
    border-radius: 7px;
    font: inherit;
}

.pitch-chat-input:focus {
    outline: 2px solid var(--pp-gold-light);
    outline-offset: 1px;
}

.pitch-chat-error {
    margin: 8px 0 0;
    color: #ffd0d4;
    font-size: 0.82rem;
}

@media (max-width: 560px) {
    .pitch-chat {
        border-radius: 8px;
    }

    .pitch-chat-messages {
        height: 150px;
    }

    .pitch-chat-form {
        grid-template-columns: 1fr;
    }

    .pitch-chat-form .pitch-button {
        width: 100%;
    }
}

/* Host player-removal control */

.pitch-kick-player {
    position: absolute;
    top: -9px;
    right: -9px;
    z-index: 3;
    padding: 3px 7px;
    color: #fff8e7;
    background: #8f2530;
    border: 1px solid #e19098;
    border-radius: 999px;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}

.pitch-kick-player:hover,
.pitch-kick-player:focus-visible {
    background: #b72e3b;
    outline: 2px solid #ffd0d4;
    outline-offset: 1px;
}

.pitch-player-controls {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(5, 38, 28, 0.86);
    border: 1px solid var(--pp-line);
    border-radius: 8px;
}

.pitch-player-controls > strong {
    color: var(--pp-gold-light);
}

.pitch-player-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pitch-kick-button {
    padding: 6px 10px;
    color: #fff8e7;
    background: #8f2530;
    border: 1px solid #e19098;
    border-radius: 6px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.pitch-kick-button:hover,
.pitch-kick-button:focus-visible {
    background: #b72e3b;
}

.pitch-cancel-table-button {
    padding: 7px 11px;
    color: #fff8e7;
    background: #8f2530;
    border: 1px solid #e19098;
    border-radius: 7px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.pitch-cancel-table-button:hover,
.pitch-cancel-table-button:focus-visible {
    background: #b72e3b;
    outline: 2px solid #ffd0d4;
    outline-offset: 1px;
}

/* ==========================================================
SudokuParadise Family Watermark
========================================================== */

.pitch-family-link {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: clamp(190px, 32vw, 300px);
    padding: 0;
    background: transparent;
    border: 0;
    transform: translate(-50%, -50%);
}

.pitch-family-logo {
    display: block;
    width: 100%;
    height: auto;
    background: transparent;
    opacity: 0.48;
    filter: none;
    mix-blend-mode: normal;
    transition:
        opacity 160ms ease,
        filter 160ms ease,
        transform 160ms ease;
}

.pitch-family-link:hover .pitch-family-logo {
    opacity: 0.92;
    filter:
        sepia(1)
        saturate(2.3)
        brightness(0.95);
    transform: scale(1.02);
}

.pitch-family-link:focus-visible {
    outline: 1px solid rgba(244, 218, 160, 0.45);
    outline-offset: 5px;
}

@media (max-width: 700px) {
    .pitch-family-link {
        width: clamp(155px, 30vw, 210px);
    }

    .pitch-family-logo {
        opacity: 0.50;
    }
}

/* Keep played cards visible above player badges */
.pitch-trick-area {
    z-index: 10;
    pointer-events: none;
}

/* Remove bulky badge shells on phones */
@media (max-width: 600px) {
    .pitch-seat {
        min-width: 0;
        max-width: 100px;
        padding: 4px;
        background: transparent;
        border-color: transparent;
        box-shadow: none;
        pointer-events: none;
    }

    .pitch-seat.active {
        border-color: transparent;
        box-shadow: none;
    }

    .pitch-seat-avatar {
        width: 24px;
        height: 24px;
        color: var(--pp-gold-light);
        background: rgba(3, 29, 21, 0.35);
        border: 1px solid rgba(244, 218, 160, 0.55);
        font-size: 0.72rem;
    }

    .pitch-seat strong,
    .pitch-seat small {
        text-shadow: 0 1px 3px #001a12;
    }

    .pitch-seat:not(.pitch-seat-south) {
        padding-top: 38px;
    }
}

/* Remove large black player badges on phones */
@media (max-width: 600px) {
    .pitch-seat,
    .pitch-seat.active,
    .pitch-seat.open {
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

/* ==========================================================
Mobile Table Cleanup
========================================================== */

@media (max-width: 500px) {
    /* Remove the large black player-panel shells */
    .pitch-seat,
    .pitch-seat.active,
    .pitch-seat.open {
        z-index: 2;
        min-width: 0;
        max-width: 104px;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .pitch-seat strong,
    .pitch-seat small {
        text-shadow: 0 2px 4px #001a12;
    }

    /* Give all four played cards their own space */
    .pitch-trick-area {
        z-index: 10;
        width: min(250px, calc(100vw - 72px));
        height: 230px;
        pointer-events: none;
    }

    /* West card */
    .pitch-trick-player-1 {
        top: 50%;
        right: auto;
        left: 0;
        transform: translateY(-50%);
    }

    /* East card */
    .pitch-trick-player-3 {
        top: 50%;
        right: 0;
        left: auto;
        transform: translateY(-50%);
    }
}

.pitch-forum-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.75rem;
    text-decoration: none;
}

/* ==========================================================
Replay Last Hand
========================================================== */

.pitch-hand-result-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.pitch-replay-overlay {
    position: fixed;
    z-index: 180;
    inset: 0;
    display: grid;
    padding: 18px;
    place-items: center;
    overflow: auto;
    background: rgba(0, 20, 15, 0.86);
    backdrop-filter: blur(5px);
}

.pitch-replay-panel {
    width: min(960px, 100%);
    max-height: calc(100vh - 36px);
    padding: clamp(16px, 3vw, 28px);
    overflow: auto;
    color: var(--pp-cream);
    background: radial-gradient(
        circle at 50% 25%,
        rgba(34, 139, 99, 0.78),
        rgba(4, 63, 47, 0.98) 68%
    );
    border: 2px solid var(--pp-gold);
    border-radius: 18px;
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.58),
        inset 0 0 45px rgba(0, 0, 0, 0.2);
}

.pitch-replay-header {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.pitch-replay-header h2 {
    margin: 2px 0 0;
    color: var(--pp-gold-light);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.pitch-replay-close {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    color: var(--pp-cream);
    font-size: 1.7rem;
    line-height: 1;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.pitch-replay-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    justify-content: center;
    margin-bottom: 16px;
    padding: 9px 12px;
    color: var(--pp-gold-light);
    background: rgba(0, 25, 19, 0.5);
    border: 1px solid rgba(244, 218, 160, 0.28);
    border-radius: 9px;
    font-weight: 700;
}

.pitch-replay-hands {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.pitch-replay-hand {
    min-width: 0;
    padding: 9px;
    background: rgba(0, 28, 21, 0.55);
    border: 1px solid rgba(244, 218, 160, 0.22);
    border-radius: 10px;
}

.pitch-replay-player {
    display: block;
    margin-bottom: 7px;
    color: var(--pp-gold-light);
    text-align: center;
}

.pitch-replay-cards,
.pitch-replay-trick-cards {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: flex-end;
    min-width: 0;
}

.pitch-card.pitch-replay-card {
    width: clamp(38px, 6vw, 54px);
    min-width: clamp(38px, 6vw, 54px);
    height: clamp(55px, 8.4vw, 78px);
    min-height: 0;
    padding: 5px;
    border-radius: 6px;
    cursor: default;
}

.pitch-card.pitch-replay-card .pitch-card-suit {
    font-size: clamp(1rem, 2.5vw, 1.45rem);
}

.pitch-card.pitch-replay-card.is-played {
    opacity: 0.12;
    filter: grayscale(1);
    transform: scale(0.94);
}

.pitch-replay-trick {
    margin-top: 14px;
    padding: 10px;
    text-align: center;
    background: rgba(0, 20, 15, 0.44);
    border: 1px solid rgba(244, 218, 160, 0.3);
    border-radius: 11px;
}

.pitch-replay-trick > strong {
    display: block;
    margin-bottom: 8px;
    color: var(--pp-gold-light);
}

.pitch-replay-trick-cards {
    gap: 12px;
}

.pitch-replay-play {
    display: grid;
    gap: 4px;
    justify-items: center;
}

.pitch-replay-play small {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pitch-replay-scoring {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 14px;
    padding: 11px;
    background: rgba(0, 20, 15, 0.48);
    border: 1px solid rgba(244, 218, 160, 0.3);
    border-radius: 11px;
}

.pitch-replay-scoring span,
.pitch-replay-scoring strong {
    padding: 7px 9px;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 7px;
}

.pitch-replay-narration {
    min-height: 46px;
    margin: 14px 0 10px;
    padding: 11px 14px;
    color: var(--pp-gold-light);
    text-align: center;
    background: rgba(0, 25, 19, 0.62);
    border: 1px solid rgba(244, 218, 160, 0.34);
    border-radius: 9px;
    font-size: 1.05rem;
    font-weight: 700;
}

.pitch-replay-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: center;
    align-items: center;
}

.pitch-replay-controls .pitch-outline-button,
.pitch-replay-controls .pitch-gold-button {
    min-height: 38px;
    padding: 8px 14px;
}

.pitch-replay-progress {
    min-width: 64px;
    color: var(--pp-muted);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 620px) {
    .pitch-replay-overlay {
        padding: 7px;
    }

    .pitch-replay-panel {
        max-height: calc(100vh - 14px);
        padding: 13px;
        border-radius: 12px;
    }

    .pitch-replay-hands,
    .pitch-replay-scoring {
        grid-template-columns: 1fr;
    }

    .pitch-replay-card .pitch-card-rank-bottom {
        display: none;
    }

    .pitch-replay-trick-cards {
        gap: 6px;
    }

    .pitch-replay-controls {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
    }

    .pitch-replay-controls .pitch-gold-button {
        grid-column: 1 / -1;
        grid-row: 1;
    }
}
