:root {
    --page-bg: #f3f5ef;
    --page-bg-soft: #fafbf6;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-strong: #ffffff;
    --surface-muted: #f6f7f1;
    --line: #dfe5d6;
    --line-strong: #cdd7bf;
    --text: #1f2a1f;
    --text-muted: #697364;
    --brand: #b7ea31;
    --brand-deep: #79a800;
    --brand-ink: #243100;
    --accent: #f1566f;
    --shadow: 0 18px 42px rgba(53, 69, 20, 0.08);
}

html,
body {
    min-height: 100%;
}

body.public-page {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(190, 214, 146, 0.18), transparent 34%),
        linear-gradient(180deg, #f7f8f3 0%, var(--page-bg) 48%, #eef1e7 100%);
    font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

body.public-page a {
    color: inherit;
}

.site-shell {
    min-height: 100vh;
    position: relative;
}

.site-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 100% 32px;
    opacity: 0.3;
}

.site-header,
.site-main,
.site-footer {
    position: relative;
    z-index: 1;
}

.page-container {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    padding: 22px 0 18px;
}

.site-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    border: 1px solid rgba(223, 229, 214, 0.95);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 172px;
    height: auto;
    max-width: 100%;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.brand-logo-link:hover,
.profile-link:hover,
.page-link-bar a:hover,
.result-link:hover {
    color: inherit;
}

.brand-caption {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.2;
}

.site-userbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

.site-userbar > * {
    min-width: 0;
}

.site-userbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.current-game-link {
    display: inline-flex;
    align-items: center;
    max-width: min(320px, 100%);
    padding: 8px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    color: #2d6a1d;
    background: #edf8e7;
    border: 1px solid #c8e4b7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--line-strong) 12%, var(--line) 50%, transparent 100%);
    margin: 0 0 28px;
}

.site-main {
    padding-bottom: 28px;
}

.hero-card,
.soft-card,
.announcement-card,
.empty-state {
    border: 1px solid rgba(223, 229, 214, 0.95);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(218, 244, 146, 0.9) 0%, rgba(255, 255, 255, 0.86) 42%, rgba(247, 250, 241, 0.95) 100%);
}

.hero-kicker,
.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--brand-ink);
    font-size: 0.84rem;
    font-weight: 700;
}

.hero-title,
.page-title {
    margin: 16px 0 10px;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.08;
    font-weight: 800;
}

.hero-copy,
.page-subtitle,
.section-subtitle,
.inline-note,
.footer-note {
    color: var(--text-muted);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.hero-chip {
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(36, 49, 0, 0.08);
    background: rgba(255, 255, 255, 0.68);
    font-size: 0.9rem;
}

.content-grid {
    display: grid;
    gap: 20px;
}

.content-grid.two-up {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
}

.soft-card {
    padding: 22px;
}

.card-title-row,
.page-title-row,
.result-title-row,
.title-stack {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.page-title-row {
    flex-wrap: wrap;
}

.title-stack {
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 6px;
}

.section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.section-subtitle {
    margin-top: 6px;
    font-size: 0.92rem;
}

.eyebrow {
    color: var(--brand-deep);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.form-stack {
    display: grid;
    gap: 14px;
}

.required-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.required-mark {
    color: var(--accent);
    font-weight: 800;
    line-height: 1;
}

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

.span-4 {
    grid-column: span 4;
}

.span-3 {
    grid-column: span 3;
}

.span-6 {
    grid-column: span 6;
}

.span-8 {
    grid-column: span 8;
}

.span-12 {
    grid-column: span 12;
}

.public-page .form-control,
.public-page .form-select,
.public-page .input-group-text {
    border-color: var(--line-strong);
    border-radius: 16px;
    min-height: 48px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    box-shadow: none;
}

.public-page .form-control:focus,
.public-page .form-select:focus {
    border-color: rgba(121, 168, 0, 0.45);
    box-shadow: 0 0 0 0.22rem rgba(183, 234, 49, 0.18);
}

.public-page .input-group > .form-control,
.public-page .input-group > .btn {
    min-height: 48px;
}

.public-page .input-group > .form-control {
    min-width: 0;
}

.public-page .btn {
    border-radius: 999px;
    font-weight: 700;
    padding-left: 16px;
    padding-right: 16px;
}

.btn-brand {
    color: var(--brand-ink);
    background: linear-gradient(135deg, #d7f56d 0%, var(--brand) 68%, #a9dc22 100%);
    border: none;
}

.btn-brand:hover,
.btn-brand:focus {
    color: var(--brand-ink);
    background: linear-gradient(135deg, #dff97f 0%, #c9f13e 68%, #b8e43f 100%);
}

.btn-ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--line-strong);
}

.btn-ghost:hover,
.btn-ghost:focus {
    color: var(--text);
    background: rgba(255, 255, 255, 0.95);
    border-color: #b7c6a5;
}

.btn-danger-soft {
    color: #a23a4a;
    background: #fff4f5;
    border: 1px solid #f0c7ce;
}

.btn-danger-soft:hover,
.btn-danger-soft:focus {
    color: #8e2e3d;
    background: #ffecef;
    border-color: #ebb5c0;
}

.team-join-red {
    color: #8f2238;
    background: linear-gradient(135deg, #ffd8de 0%, #ffb7c4 100%);
    border: 1px solid #ef9aaa;
}

.team-join-red:hover,
.team-join-red:focus {
    color: #7e1d31;
    background: linear-gradient(135deg, #ffe0e5 0%, #ffc3ce 100%);
    border-color: #e9899a;
}

.team-join-blue {
    color: #0f4d78;
    background: linear-gradient(135deg, #d9efff 0%, #b4dcff 100%);
    border: 1px solid #8ec5f2;
}

.team-join-blue:hover,
.team-join-blue:focus {
    color: #0d4468;
    background: linear-gradient(135deg, #e4f4ff 0%, #c3e5ff 100%);
    border-color: #7cb8ea;
}

.team-join-white {
    color: #314034;
    background: linear-gradient(135deg, #ffffff 0%, #f1f4eb 100%);
    border: 1px solid #cfd8c4;
}

.team-join-white:hover,
.team-join-white:focus {
    color: #243126;
    background: linear-gradient(135deg, #ffffff 0%, #f7f9f2 100%);
    border-color: #bcc9b0;
}

.announcement-card {
    padding: 18px 20px;
    border-color: #e9d9a6;
    background: linear-gradient(135deg, rgba(255, 247, 219, 0.95) 0%, rgba(255, 255, 255, 0.95) 78%);
}

.current-game-card {
    padding: 20px 22px;
    border: 1px solid #d5e7ad;
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(215, 245, 109, 0.22) 0%, rgba(255, 255, 255, 0.94) 46%, rgba(242, 250, 229, 0.98) 100%);
    box-shadow: var(--shadow);
}

.current-game-copy {
    color: var(--text-muted);
    font-size: 0.94rem;
}

.announcement-content {
    white-space: pre-line;
}

.result-list {
    display: grid;
    gap: 16px;
}

.result-card {
    display: block;
    padding: 20px 22px;
    text-decoration: none;
    border: 1px solid rgba(223, 229, 214, 0.95);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    border-color: #c6d0b7;
    box-shadow: 0 22px 42px rgba(52, 67, 17, 0.12);
}

.result-link {
    text-decoration: none;
}

.result-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.result-meta,
.stat-line,
.info-line {
    color: var(--text-muted);
    font-size: 0.94rem;
}

.result-meta {
    margin-top: 10px;
}

.result-price {
    margin-top: 14px;
    font-size: 1rem;
    font-weight: 700;
}

.stat-line {
    margin-top: 12px;
}

.badge-soft,
.team-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid transparent;
    max-width: 100%;
    text-align: center;
    white-space: normal;
}

.team-badge {
    min-width: 104px;
    background: rgba(255, 255, 255, 0.86);
    border-color: var(--line);
    color: var(--text);
}

.team-badge-red {
    background: linear-gradient(135deg, #fff1f4 0%, #ffd9e0 100%);
    border-color: #efbdc8;
    color: #8f2238;
}

.team-badge-blue {
    background: linear-gradient(135deg, #eef8ff 0%, #d8ecff 100%);
    border-color: #bfdcf4;
    color: #0f4d78;
}

.team-badge-white {
    background: linear-gradient(135deg, #ffffff 0%, #f3f5ef 100%);
    border-color: #cfd8c4;
    color: #314034;
}

.badge-grouping {
    background: #fff6d8;
    color: #8a6810;
    border-color: #f1df9a;
}

.badge-pending {
    background: #e9f8ff;
    color: #14647d;
    border-color: #bce2ee;
}

.badge-success {
    background: #edf8e7;
    color: #2d6a1d;
    border-color: #c8e4b7;
}

.badge-canceled {
    background: #fff2f4;
    color: #9d3d4e;
    border-color: #ebc0c8;
}

.detail-grid {
    display: grid;
    gap: 18px;
}

.detail-hero {
    padding: 26px;
}

.formed-summary-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
    padding: 20px 22px;
    border: 1px solid rgba(116, 163, 74, 0.26);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(218, 244, 146, 0.9) 0%, rgba(244, 253, 230, 0.96) 38%, rgba(255, 255, 255, 0.96) 100%);
    box-shadow: 0 18px 40px rgba(78, 118, 34, 0.12);
}

.formed-summary-copy {
    max-width: 420px;
}

.formed-summary-title {
    margin-top: 12px;
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    line-height: 1.15;
    font-weight: 800;
    color: var(--text);
}

.formed-summary-note {
    margin-top: 8px;
    color: var(--text-muted);
}

.formed-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.formed-summary-item {
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(36, 49, 0, 0.08);
    background: rgba(255, 255, 255, 0.78);
}

.formed-summary-label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.formed-summary-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.detail-headline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.detail-title {
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.detail-price {
    font-size: 1.22rem;
    font-weight: 800;
    margin-top: 18px;
    overflow-wrap: anywhere;
}

.detail-count-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-count-item {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    color: var(--text);
    min-width: 0;
    flex: 1 1 180px;
}

.detail-count-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-muted);
}

.detail-count-value {
    font-size: 1.04rem;
    font-weight: 800;
    color: var(--text);
}

.detail-actions,
.action-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-actions {
    margin-top: 18px;
}

.chat-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.95fr);
    align-items: start;
}

.chat-main {
    min-width: 0;
}

.chat-board {
    height: 260px;
    overflow-y: auto;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 249, 243, 0.96) 100%);
}

.chat-message {
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(223, 229, 214, 0.88);
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

.chat-message:last-child {
    margin-bottom: 0;
}

.chat-nickname {
    font-weight: 700;
}

.audience-side {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface-muted);
}

.audience-section + .audience-section {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.audience-section-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text);
}

.audience-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.audience-pill {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 700;
    border: 1px solid var(--line);
    color: var(--text);
    background: rgba(255, 255, 255, 0.92);
    max-width: 100%;
    overflow-wrap: anywhere;
}

.audience-pill-joined {
    border-color: rgba(116, 163, 74, 0.3);
    background: rgba(239, 248, 225, 0.94);
}

.audience-pill-spectator {
    border-color: rgba(145, 153, 167, 0.28);
    background: rgba(255, 255, 255, 0.94);
}

.empty-state {
    padding: 28px 24px;
    text-align: center;
}

.empty-state-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.empty-state-copy {
    margin-top: 8px;
    color: var(--text-muted);
}

.status-card {
    max-width: 760px;
}

.form-note-box,
.disclaimer-box {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-muted);
}

.disclaimer-scroll {
    max-height: 220px;
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-strong);
}

.site-footer {
    padding: 24px 0 34px;
}

.site-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 22px;
    border-top: 1px solid var(--line-strong);
    color: var(--text-muted);
}

.footer-title {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.footer-copy {
    font-size: 0.92rem;
}

.page-link-bar {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 12px;
}

.profile-link {
    text-decoration: none;
    font-weight: 700;
    max-width: min(240px, 100%);
    overflow-wrap: anywhere;
}

.result-title,
.info-line,
.inline-note,
.section-subtitle,
.current-game-copy,
.formed-summary-note,
.footer-copy {
    overflow-wrap: anywhere;
}

.current-game-link:hover {
    color: #2d6a1d;
    background: #f3faec;
    border-color: #b8d79f;
}

.d-none {
    display: none !important;
}

@media (max-width: 991.98px) {
    .content-grid.two-up {
        grid-template-columns: 1fr;
    }

    .page-title-row,
    .result-title-row,
    .detail-headline,
    .formed-summary-banner {
        flex-direction: column;
    }

    .chat-layout {
        grid-template-columns: 1fr;
    }

    .site-header-inner {
        align-items: flex-start;
    }

    .formed-summary-copy,
    .formed-summary-meta,
    .detail-headline > * {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .formed-summary-meta {
        justify-content: flex-start;
    }

    .formed-summary-item,
    .team-badge {
        min-width: 0;
    }

    .audience-side {
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    .page-container {
        width: min(100% - 20px, 100%);
    }

    .site-header {
        padding: 14px 0 14px;
    }

    .site-header-inner,
    .hero-card,
    .soft-card,
    .announcement-card,
    .site-footer-inner {
        padding: 18px;
        border-radius: 22px;
    }

    .brand-lockup {
        align-items: flex-start;
        gap: 12px;
    }

    .brand-logo {
        width: 150px;
    }

    .brand-caption {
        font-size: 0.84rem;
    }

    .site-header-inner,
    .site-userbar,
    .hero-meta,
    .formed-summary-meta,
    .detail-actions,
    .action-cluster,
    .site-footer-inner {
        align-items: stretch;
    }

    .site-header-inner,
    .site-footer-inner {
        flex-direction: column;
    }

    .site-userbar {
        justify-content: flex-start;
        width: 100%;
        gap: 8px;
    }

    .site-userbar-links {
        width: 100%;
    }

    .brand-copy {
        flex: 1 1 auto;
    }

    .site-userbar-links .btn {
        flex: 1 1 140px;
        text-align: center;
    }

    .hero-title,
    .page-title {
        margin-top: 14px;
        font-size: 1.7rem;
    }

    .detail-hero {
        padding: 18px;
    }

    .formed-summary-banner {
        padding: 18px;
        gap: 14px;
    }

    .formed-summary-item {
        min-width: 0;
        width: 100%;
    }

    .detail-price {
        font-size: 1.08rem;
    }

    .form-row-grid {
        grid-template-columns: 1fr;
    }

    .span-3,
    .span-4,
    .span-6,
    .span-8,
    .span-12 {
        grid-column: auto;
    }

    .public-page .btn {
        width: 100%;
    }

    .site-userbar .btn,
    .site-userbar .profile-link,
    .site-userbar .current-game-link {
        width: auto;
    }

    .site-userbar .profile-link,
    .site-userbar .current-game-link {
        width: 100%;
        max-width: none;
    }

    .current-game-link {
        max-width: 100%;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
    }

    .public-page .input-group.stack-on-mobile {
        flex-direction: column;
        gap: 10px;
    }

    .public-page .input-group.stack-on-mobile > .form-control,
    .public-page .input-group.stack-on-mobile > .btn {
        width: 100%;
        border-radius: 16px !important;
    }

    .detail-actions,
    .action-cluster {
        width: 100%;
    }

    .detail-actions > .action-cluster,
    .detail-actions > .btn,
    .detail-actions > a,
    .action-cluster > .btn,
    .action-cluster > a {
        width: 100%;
    }

    .detail-count-item,
    .team-badge {
        width: 100%;
    }

    .chat-layout {
        gap: 14px;
    }

    .chat-board {
        height: 220px;
        padding: 12px;
    }

    .audience-side {
        padding: 16px;
        border-radius: 20px;
    }
}
