:root {
    --match-bg: #f2ede1;
    --match-surface: #fffdf8;
    --match-ink: #1d1a14;
    --match-muted: #6f6656;
    --match-accent: #8d3c14;
    --match-accent-soft: #f0d9b9;
    --match-border: #d9c7ad;
    --match-board-bg: linear-gradient(135deg, #1e2d29 0%, #16201d 100%);
    --match-board-surface: rgba(245, 240, 230, 0.96);
}

body.site3-match-page {
    min-height: 100vh;
    background: var(--match-bg);
    color: var(--match-ink);
}

.match-app {
    min-height: 100vh;
}

.match-loading-shell,
.match-shell {
    width: min(1280px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

.match-loading-shell {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
}

.match-loading-title {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 900;
    letter-spacing: 0.04em;
}

.match-loading-text,
.match-status-text {
    color: var(--match-muted);
    font-size: 0.98rem;
}

.match-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.match-hero,
.match-panel,
.match-category-panel,
.match-board-column {
    border: 1px solid var(--match-border);
    border-radius: 22px;
    background: var(--match-surface);
    box-shadow: 0 18px 44px rgba(52, 34, 11, 0.08);
}

.match-hero {
    padding: 22px 24px;
}

.match-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.match-eyebrow {
    color: var(--match-accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.match-title {
    margin: 8px 0 6px;
    font-size: clamp(1.7rem, 3vw, 3rem);
    line-height: 1.05;
}

.match-subtitle {
    color: var(--match-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.match-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.match-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f6eee2;
    color: #5f4630;
    font-size: 0.84rem;
    font-weight: 700;
}

.match-panel {
    padding: 18px;
}

.match-panel-title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 800;
}

.match-grid {
    display: grid;
    grid-template-columns: 1.05fr 1.45fr;
    gap: 18px;
}

.match-form,
.match-inline-form,
.match-action-row,
.match-url-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.match-field,
.match-category-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: #5f4630;
}

.match-input,
.match-select,
.match-textarea,
.match-url-input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--match-border);
    border-radius: 14px;
    background: #fffefb;
    color: var(--match-ink);
    font: inherit;
    box-sizing: border-box;
}

.match-url-input {
    min-height: 42px;
    background: #f8f4ec;
}

.match-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: none;
    border-radius: 14px;
    background: var(--match-accent);
    color: #ffffff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.match-button:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.match-button.is-secondary {
    background: #2f5d62;
}

.match-button.is-neutral {
    background: #d9c7ad;
    color: #423220;
}

.match-button.is-danger {
    background: #a53326;
}

.match-button[disabled] {
    opacity: 0.45;
    transform: none;
    cursor: not-allowed;
}

.match-category-list,
.match-category-columns,
.match-board-columns,
.match-players,
.match-active-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.match-category-setup-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-category-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.match-category-columns {
    gap: 16px;
}

.match-category-panel {
    padding: 16px;
}

.match-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.match-category-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.match-category-count {
    color: var(--match-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.match-section-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    gap: 14px;
}

.match-player-card,
.match-active-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8f1e7;
}

.match-active-card {
    background: #f0d9b9;
}

.match-player-name,
.match-active-names {
    font-size: 0.96rem;
    font-weight: 800;
}

.match-empty {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f6f1e8;
    color: var(--match-muted);
    font-size: 0.9rem;
}

.match-qr-shell {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.match-qr-box {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--match-border);
    overflow: hidden;
}

.match-qr-box img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.match-url-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-feedback {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 700;
}

.match-feedback.is-error {
    background: #f8d8d3;
    color: #7d2118;
}

.match-feedback.is-success {
    background: #dcefdc;
    color: #275430;
}

.match-board-shell {
    min-height: 100vh;
    padding: 18px;
    box-sizing: border-box;
    background: var(--match-board-bg);
}

.match-board-shell .match-hero {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(245, 240, 230, 0.1);
    color: #f7f2e7;
}

.match-board-shell .match-eyebrow,
.match-board-shell .match-subtitle,
.match-board-shell .match-chip {
    color: #f0e2c9;
}

.match-board-shell .match-chip {
    background: rgba(255, 255, 255, 0.1);
}

.match-board-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    align-items: start;
}

.match-board-column {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 220px);
    padding: 16px;
    background: var(--match-board-surface);
}

.match-board-column-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 900;
}

.match-board-lane {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
}

.match-board-lane + .match-board-lane {
    margin-top: 14px;
    border-top: 1px solid rgba(56, 34, 15, 0.12);
}

.match-board-lane-title {
    margin: 0;
    color: var(--match-muted);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.match-board-player,
.match-board-match {
    padding: 12px 14px;
    border-radius: 16px;
    background: #f6efe5;
}

.match-board-match {
    background: #eed6b4;
}

.match-board-player-name,
.match-board-match-name {
    font-size: 1rem;
    font-weight: 800;
}

.match-board-match-vs {
    color: #73583f;
    font-size: 0.82rem;
    font-weight: 800;
    margin: 6px 0;
}

@media (max-width: 960px) {
    .match-grid,
    .match-section-split,
    .match-qr-shell,
    .match-field-grid {
        grid-template-columns: 1fr;
    }

    .match-hero-top {
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .match-loading-shell,
    .match-shell {
        width: min(100vw - 20px, 1280px);
        padding-top: 16px;
    }

    .match-board-shell {
        padding: 10px;
    }

    .match-board-columns {
        grid-template-columns: 1fr;
    }

    .match-category-input-row,
    .match-player-card,
    .match-active-card {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .match-button {
        width: 100%;
    }
}