* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: #0a1826;
    color: #e7eef9;
    font: 16px/1.5 system-ui, -apple-system, Segoe UI, sans-serif
}

a {
    color: #90d8ce
}

button,
input,
select {
    font: inherit
}

a:hover {
    text-decoration: none
}

.top {
    background: #0e2235;
    border-bottom: 1px solid #23415a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px max(18px, calc((100vw - 1000px)/2))
}

.top nav {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap
}

.brand {
    font-size: 19px;
    text-decoration: none;
    color: white;
    font-weight: 800
}

.shell {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 18px 70px
}

.hero {
    padding: 16px;
    border: 1px solid #254963;
    border-radius: 18px;
    background: linear-gradient(130deg, #11374a, #11243a)
}

h1 {
    font-size: clamp(28px, 5vw, 43px);
    line-height: 1.12;
    margin: 8px 0 15px
}

h2 {
    font-size: 22px
}

.eyebrow {
    font-size: 12px;
    letter-spacing: .2em;
    color: #9adfd4;
    font-weight: 700
}

.hero p:last-child {
    color: #c5d7e2
}

.panel {
    max-width: 480px;
    margin: 18px auto;
    background: #13293c;
    border: 1px solid #2b4961;
    padding: 28px;
    border-radius: 16px
}

form {
    display: grid;
    gap: 16px
}

label {
    display: grid;
    gap: 6px;
    font-weight: 650
}

input,
select {
    padding: 12px;
    background: #091827;
    border: 1px solid #426076;
    color: white;
    border-radius: 9px;
    width: 100%
}

input:focus,
select:focus {
    outline: 2px solid #5abaaa
}

button {
    padding: 12px 20px;
    border: 0;
    border-radius: 10px;
    background: #59c7ae;
    color: #062129;
    font-weight: 750;
    cursor: pointer
}

button:hover {
    background: #83ddcb
}

.error,
.success,
.notice {
    padding: 15px;
    border-radius: 10px;
    margin: 18px 0
}

.notice {
    background: #1d374a;
    border: 1px solid #3a5a70
}

.error {
    background: #4a2430;
    border: 1px solid #be677b
}

.success {
    background: #1a4b3b;
    border: 1px solid #4a9d81
}

.muted {
    color: #9db7c9
}

.board {
    max-width: 690px;
    margin: 35px auto
}

.axis {
    text-align: center;
    letter-spacing: .13em;
    font-size: 12px;
    color: #9ec8d2;
    margin: 10px
}

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

.square,
.headcell {
    aspect-ratio: 1;
    border-radius: 5px;
    background: #204055
}

.headcell {
    background: #356679;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800
}

.square:hover {
    background: #2d6072
}

.cards {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin: 26px 0
}

.stat {
    background: #163047;
    border: 1px solid #2b4f67;
    border-radius: 14px;
    padding: 22px;
    min-width: 180px;
    display: grid
}

.stat strong {
    font-size: 35px
}

.stat span {
    color: #aac8d9
}

footer {
    text-align: center;
    padding: 28px;
    color: #829cae;
    border-top: 1px solid #24445b
}

@media(max-width:550px) {
    .top {
        align-items: flex-start;
        flex-direction: column
    }

    .shell {
        padding-top: 20px
    }

    .panel {
        padding: 18px
    }

    .grid {
        gap: 2px
    }

    .square,
    .headcell {
        border-radius: 2px
    }

    .hero {
        padding: 22px
    }
}

textarea {
    width: 100%;
    padding: 12px;
    background: #091827;
    border: 1px solid #426076;
    border-radius: 9px;
    color: white;
    font: inherit
}

.panel.wide {
    max-width: 760px
}

.square-form {
    margin: 0;
    min-width: 0;
    display: block
}

.square-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    font-size: clamp(12px, 2vw, 22px);
    background: #204055;
    color: #c5e7e2
}

.square-button.mine {
    background: #237c68
}

.square.taken {
    background: #2e5365
}

.square {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(12px, 2vw, 23px);
    min-width: 0
}

.table-wrap {
    overflow-x: auto
}

table {
    width: 100%;
    border-collapse: collapse
}

th,
td {
    border-bottom: 1px solid #365269;
    padding: 12px;
    text-align: left
}

th {
    color: #b3d3df
}

.inline-form {
    display: flex;
    gap: 6px;
    align-items: center
}

.inline-form input {
    width: 110px
}

.inline-form button {
    padding: 10px
}

details {
    padding: 10px 0
}

summary {
    cursor: pointer
}

button:focus-visible,
.square:focus-visible {
    outline: 3px solid #e5ba6d;
    outline-offset: 2px
}

@media(max-width:550px) {
    .square-button {
        font-size: 12px
    }

    .square {
        font-size: 15px
    }
}

/* Phase 5: prominent team identities, vertical row heading, mobile fit. */
.board {
    max-width: 850px;
    margin: 30px auto
}

.board-body {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: stretch;
    gap: 8px
}

.axis-top {
    margin-left: 90px;
    margin-bottom: 12px
}

.axis-left {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    min-width: 0
}

.axis-left .team-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg)
}

.axis-left .team-label img {
    transform: rotate(180deg)
}

.team-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: clamp(19px, 3vw, 30px);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0;
    text-transform: none;
    color: #fff
}

.team-label img {
    width: 52px;
    height: 52px;
    object-fit: contain
}

.axis-left .team-label {
    font-size: clamp(17px, 2.6vw, 26px);
    gap: 8px
}

.axis-left .team-label img {
    width: 42px;
    height: 42px
}

.payment-links {
    margin: 18px 0;
    background: #163047;
    border: 1px solid #365269;
    border-radius: 12px;
    padding: 16px
}

.payment-links h3 {
    margin: 0
}

.payment-links p {
    margin: 8px 0 15px
}

.pay-link {
    display: inline-block;
    background: #59c7ae;
    color: #062129;
    font-weight: 800;
    padding: 10px 18px;
    border-radius: 9px;
    text-decoration: none;
    margin: 0 10px 8px 0
}

.pay-link:hover {
    background: #83ddcb
}

@media(max-width:550px) {
    .board-body {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 4px
    }

    .axis-top {
        margin-left: 42px
    }

    .team-label {
        font-size: 20px;
        gap: 6px
    }

    .team-label img {
        width: 35px;
        height: 35px
    }

    .axis-left .team-label {
        font-size: 16px
    }

    .axis-left .team-label img {
        width: 28px;
        height: 28px
    }
}

/* Phase 6: board-first layout, donation disclosure, jump link, and print placement */
.hero-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap
}

.hero-topline h1 {
    margin-bottom: 8px
}

.hero-payment-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 1px solid #80d8c5;
    border-radius: 10px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    color: #e9fff7
}

.hero-payment-link:hover,
.hero-payment-link:focus-visible {
    background: #245b59
}

.donation-message {
    background: #204354;
    border-left: 5px solid #7cddc7;
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 20px;
    display: grid;
    gap: 6px
}

.donation-message strong {
    font-size: clamp(17px, 2.6vw, 22px);
    color: #fff
}

.donation-message em {
    font-style: normal;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #98ffe1
}

.donation-message small {
    color: #d4e1ed;
    line-height: 1.5
}

.pool-rules {
    background: #13293c;
    border: 1px solid #2b4961;
    border-radius: 12px;
    padding: 14px 18px;
    margin: 12px 0 20px
}

.pool-rules summary {
    font-weight: 800;
    font-size: 18px
}

.pool-rules p {
    margin-bottom: 0;
    white-space: normal
}

.board {
    margin-top: 20px;
    margin-bottom: 0
}

.board-actions {
    max-width: 850px;
    margin: 8px auto 0;
    display: flex;
    justify-content: flex-end
}

.print-board-link {
    padding: 6px 0;
    font-size: 14px;
    font-weight: 750
}

.payment-section {
    scroll-margin-top: 24px;
    margin: 38px auto 20px;
    max-width: 850px;
    padding: 22px;
    border: 1px solid #365269;
    background: #10273a;
    border-radius: 14px
}

.payment-section h2 {
    margin-top: 0
}

.payment-section .payment-links {
    margin: 14px 0
}

.payment-section .notice {
    margin: 14px 0
}

@media(max-width:550px) {
    .hero-topline {
        align-items: flex-start
    }

    .hero-payment-link {
        width: 100%
    }

    .payment-section {
        padding: 15px
    }
}

/* Phase 6.1: bottom-of-page donation and rules preceding payment. */
.donation-footer {
    max-width: 850px;
    margin: 38px auto 0
}

.pool-rules {
    max-width: 850px;
    margin: 34px auto 16px
}

.pool-rules+.payment-section {
    margin-top: 16px
}