:root {
    --green: #003f24;
    --green-light: #0d5c38;
    --cream: #fbf8ee;
    --paper: rgba(255, 252, 243, 0.97);
    --line: #cfc7b5;
    --line-dark: #8aa092;
    --text: #10251b;
    --muted: #6b6559;
    --red: #b8323c;
    --gold: #b89a42;
    --yellow-tee: #f2d64b;
    --white-tee: #ffffff;
    --red-tee: #9b2f3f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--text);
    background:
        linear-gradient(rgba(0, 40, 20, 0.18), rgba(0, 40, 20, 0.42)),
        url("assets/course-bg.JPG");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.25rem;
}

.scorecard {
    background:
        linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.25)),
        var(--paper);
    border-radius: 16px;
    padding: 1.15rem;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.hero {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1rem;
    align-items: center;
    text-align: center;
    margin-bottom: 0.9rem;
    border: 2px solid var(--green);
    border-radius: 10px;
    padding: 0.65rem;
    background: rgba(255, 253, 247, 0.8);
}

.club-logo {
    width: 100%;
    max-width: 140px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.title-block h1 {
    margin: 0;
    font-size: clamp(1.45rem, 3.6vw, 2.35rem);
    text-transform: uppercase;
    color: var(--green);
    letter-spacing: 0.04em;
    line-height: 1;
}

.panel {
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.9rem;
    background: rgba(255, 253, 247, 0.9);
}

.panel-title {
    background: linear-gradient(180deg, var(--green-light), var(--green));
    color: white;
    padding: 0.45rem;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--gold);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.7rem;
    padding: 0.85rem;
    align-items: end;
}

label {
    display: block;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 0.3rem;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--green);
}

select,
input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #bfb6a2;
    border-radius: 7px;
    background: white;
    padding: 0.5rem;
    font-size: 0.95rem;
    font-family: Georgia, "Times New Roman", serif;
}

.hcp-box {
    border: 1px solid var(--line-dark);
    border-radius: 8px;
    min-height: 58px;
    padding: 0.45rem;
    text-align: center;
    background: #fffaf0;
}

.hcp-box span {
    display: block;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.62rem;
    letter-spacing: 0.03em;
    line-height: 1.15;
    color: var(--green);
}

.hcp-box strong {
    display: block;
    margin-top: 0.24rem;
    font-size: 1.32rem;
    color: var(--green);
}

.course-info {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0 0.75rem 0.75rem;
    font-size: 0.86rem;
    color: var(--muted);
}

.tee-white {
    background: var(--white-tee) !important;
    color: #111 !important;
}

.tee-yellow {
    background: var(--yellow-tee) !important;
    color: #111 !important;
}

.tee-red {
    background: var(--red-tee) !important;
    color: #fff !important;
}

.table-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fffaf0;
}

.score-table,
.guide table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 253, 247, 0.95);
}

.score-table th,
.score-table td,
.guide th,
.guide td {
    border: 1px solid var(--line);
    padding: 0.42rem;
    text-align: center;
}

.score-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--green);
    color: white;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.score-table td {
    height: 40px;
    font-size: 0.88rem;
}

.score-table tbody tr:nth-child(even) {
    background: rgba(0, 63, 36, 0.035);
}

.score-table td:first-child {
    font-weight: bold;
    color: var(--green);
}

.score-table td:nth-child(2) {
    font-weight: bold;
    background: #fff4bf;
}

.score-table th:nth-child(2) {
    background: #d1ad21;
    color: #111;
}

.score-table td:nth-child(3) {
    font-weight: bold;
}

.si {
    color: var(--red);
    font-weight: bold;
}

.score-table input {
    width: 48px;
    min-height: 32px;
    height: 32px;
    padding: 0.15rem;
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    border: 1px solid #a89d86;
    background: white;
}

.score-input:focus {
    outline: 2px solid var(--gold);
    border-color: var(--gold);
    background: #fffbe8;
}

.score-table tfoot td {
    font-weight: bold;
    text-transform: uppercase;
    background: #efe6cf;
    border-top: 2px solid var(--green);
}

.shot-hole {
    background: rgba(184, 154, 66, 0.13) !important;
}

.double-shot-hole {
    background: rgba(184, 154, 66, 0.25) !important;
}

.double-shot-hole td:first-child {
    color: var(--red);
}

.shot-marker {
    margin-top: 0.15rem;
    font-size: 0.6rem;
    font-weight: bold;
    color: var(--green);
    white-space: nowrap;
}

.totals {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.9rem;
    background: #fffaf0;
}

.secondary-totals {
    grid-template-columns: repeat(3, 1fr);
    margin-top: -0.4rem;
}

.totals div {
    padding: 0.7rem;
    text-align: center;
    border-right: 1px solid var(--line);
}

.totals div:last-child {
    border-right: none;
    background: rgba(184, 154, 66, 0.16);
}

.totals span {
    display: block;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.72rem;
    color: var(--green);
    letter-spacing: 0.04em;
}

.totals strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.55rem;
    color: var(--green);
}

.actions {
    text-align: center;
    margin-bottom: 1rem;
}

.reset-btn,
.share-btn {
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn {
    background: #9b2f3f;
}

.share-btn {
    background: var(--green);
    margin-left: 0.5rem;
}

.reset-btn:hover,
.share-btn:hover {
    transform: translateY(-1px);
}

.guide table {
    font-size: 0.84rem;
}

.guide th {
    text-transform: uppercase;
    color: var(--green);
    background: #f5efdf;
}

.guide p {
    text-align: center;
    padding: 0.75rem;
    margin: 0;
    color: var(--muted);
}

.share-card {
    display: none;
    width: 1200px;
    background: #fbf8ee;
    color: #10251b;
    padding: 30px;
    font-family: Georgia, "Times New Roman", serif;
}

.share-card-exporting {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 9999;
}

.share-header {
    display: flex;
    align-items: center;
    gap: 24px;
    border-bottom: 4px solid var(--green);
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.share-logo {
    width: 110px;
    height: auto;
}

.share-header h2 {
    margin: 0;
    color: var(--green);
    font-size: 38px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.share-header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 24px;
}

.share-round-info {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    margin-bottom: 20px;
    gap: 10px;
}

.share-round-info div {
    border: 2px solid var(--line-dark);
    background: #fffaf0;
    padding: 12px;
    text-align: center;
}

.share-round-info strong {
    display: block;
    color: var(--green);
    text-transform: uppercase;
    font-size: 16px;
}

.share-round-info span {
    display: block;
    margin-top: 6px;
    font-size: 22px;
    font-weight: bold;
}

.share-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.share-tables table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.share-tables th,
.share-tables td {
    border: 1px solid #999;
    padding: 8px;
    text-align: center;
    font-size: 18px;
}

.share-tables th {
    background: var(--green);
    color: white;
    text-transform: uppercase;
}

.share-tables td:nth-child(2) {
    background: #fff4bf;
    font-weight: bold;
}

.share-summary {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.share-summary div {
    border: 2px solid var(--green);
    background: #fffaf0;
    padding: 16px;
    text-align: center;
}

.share-summary div:last-child {
    background: rgba(184, 154, 66, 0.2);
}

.share-summary strong {
    display: block;
    color: var(--green);
    text-transform: uppercase;
    font-size: 20px;
}

.share-summary span {
    display: block;
    margin-top: 8px;
    color: var(--green);
    font-size: 40px;
    font-weight: bold;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .details-grid {
        grid-template-columns: 1fr 1fr;
    }

    .table-wrap {
        grid-template-columns: 1fr;
    }

    .totals {
        grid-template-columns: 1fr 1fr;
    }

    .secondary-totals {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    body {
        background-attachment: scroll;
    }

    .page {
        padding: 0.45rem;
    }

    .scorecard {
        padding: 0.55rem;
        border-radius: 10px;
    }

    .hero {
        display: block;
        margin-bottom: 0.6rem;
        padding: 0.5rem;
    }

    .brand {
        margin-bottom: 0.25rem;
    }

    .club-logo {
        max-width: 105px;
    }

    .title-block h1 {
        font-size: 1.38rem;
        line-height: 1;
        margin-top: 0.25rem;
    }

    .panel {
        margin-bottom: 0.6rem;
        border-radius: 8px;
    }

    .panel-title {
        padding: 0.36rem;
        font-size: 0.78rem;
    }

    .details-grid {
        grid-template-columns: 1fr 1fr;
        padding: 0.6rem;
        gap: 0.5rem;
    }

    label {
        margin-bottom: 0.22rem;
        font-size: 0.68rem;
    }

    select,
    input {
        min-height: 38px;
        font-size: 0.82rem;
        padding: 0.42rem;
    }

    .hcp-box {
        min-height: 54px;
        padding: 0.38rem;
    }

    .hcp-box span {
        font-size: 0.56rem;
    }

    .hcp-box strong {
        margin-top: 0.15rem;
        font-size: 1.12rem;
    }

    .course-info {
        gap: 0.5rem;
        padding: 0 0.45rem 0.6rem;
        font-size: 0.72rem;
    }

    .score-table th,
    .score-table td,
    .guide th,
    .guide td {
        padding: 0.28rem;
        font-size: 0.68rem;
    }

    .score-table td {
        height: 34px;
    }

    .score-table input {
        width: 42px;
        min-height: 30px;
        height: 30px;
        font-size: 0.86rem;
    }

    .shot-marker {
        font-size: 0.52rem;
        line-height: 1;
    }

    .totals div {
        padding: 0.55rem;
    }

    .totals strong {
        font-size: 1.25rem;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .reset-btn,
    .share-btn {
        width: 100%;
        margin-left: 0;
        padding: 0.85rem;
    }

    .guide {
        display: none;
    }
}