.crmg {
    --crmg-blue: #5cddff;
    --crmg-base: #0b1018;
    --crmg-panel: #151d29;
    --crmg-border: #3b4c60;
    box-sizing: border-box;
    width: 100%;
    max-width: 76rem;
    margin: 1rem auto;
    padding: clamp(.8rem, 3vw, 2rem);
    color: #fff;
    background: var(--crmg-base);
    border-radius: 1rem;
    font: 400 1rem/1.5 system-ui, sans-serif;
}
.crmg *, .crmg *::before, .crmg *::after { box-sizing: border-box; }
.crmg h3, .crmg p { color: inherit; margin: 0 0 .85rem; }
.crmg h3 { font: 750 1.35rem/1.25 system-ui, sans-serif; }
.crmg .crmg-panel { min-width: 0; padding: clamp(.75rem, 2vw, 1.25rem); background: var(--crmg-panel); border: 1px solid var(--crmg-border); border-radius: .75rem; }
.crmg .crmg-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.crmg form .crmg-actions { margin: .85rem 0 0; }
.crmg button {
    padding: .55rem .85rem;
    min-height: 44px;
    border-radius: .5rem;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: #203147;
    border: 1px solid var(--crmg-border);
    cursor: pointer;
}
.crmg button:hover { border-color: var(--crmg-blue); }
.crmg button[aria-pressed="true"], .crmg button[type="submit"], .crmg .crmg-panel > button { background: var(--crmg-blue); color: #08131c; }
.crmg button:disabled { opacity: .6; cursor: default; }
.crmg button[hidden] { display: none; }
.crmg :focus-visible { outline: 2px solid var(--crmg-blue); outline-offset: 2px; }
.crmg input:not([type="checkbox"]) {
    display: inline-block;
    background: var(--crmg-base);
    border: 1px solid var(--crmg-border);
    border-radius: .4rem;
    color: #fff;
    font: inherit;
    min-height: 44px;
    padding: .35rem .45rem;
}
.crmg input[type="checkbox"] { accent-color: var(--crmg-blue); }
.crmg input[type="number"] { width: 4.5rem; }
.crmg label { color: inherit; font: inherit; }
.crmg .crmg-players { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .65rem; margin-top: .7rem; }
.crmg .crmg-player { padding: .65rem; border: 1px solid var(--crmg-border); border-radius: .5rem; }
.crmg .crmg-player input[type="text"] { width: 100%; margin: .25rem 0; }
.crmg .crmg-check { display: block; }
.crmg .crmg-scroll { overflow: auto; max-height: min(62vh, 40rem); margin: .5rem 0 .75rem; }
.crmg table { width: 100%; margin: 0; border: 0; border-collapse: separate; border-spacing: 0; color: #fff; }
.crmg th, .crmg td { padding: .35rem .5rem; text-align: left; background: var(--crmg-panel); border: 0; border-bottom: 1px solid var(--crmg-border); }
.crmg .crmg-card { width: max-content; min-width: 100%; }
.crmg .crmg-card td, .crmg .crmg-card th { text-align: center; }
.crmg .crmg-card thead th { position: sticky; top: 0; z-index: 2; min-width: 5rem; max-width: 10rem; overflow-wrap: anywhere; }
.crmg .crmg-card tfoot th, .crmg .crmg-card tfoot td { position: sticky; bottom: 0; z-index: 2; font-weight: 750; color: var(--crmg-blue); border-top: 1px solid var(--crmg-border); }
.crmg .crmg-card tr > :first-child { position: sticky; left: 0; z-index: 1; background: #203147; min-width: 3.5rem; }
.crmg .crmg-card thead th:first-child, .crmg .crmg-card tfoot th:first-child { z-index: 3; }
.crmg .crmg-card input { text-align: center; width: clamp(3.4rem, 12vw, 5rem); }
.crmg .crmg-status { min-height: 1.5em; margin: .5rem 0; color: var(--crmg-blue); }
.crmg .crmg-winner { font-weight: 750; }
@media (max-width: 480px) {
    .crmg .crmg-card thead th { min-width: 3.65rem; max-width: 5.5rem; }
    .crmg th, .crmg td { padding: .3rem .25rem; }
}

/* Scope the scorecard typography to the shortcode. */
.crmg {
    --crmg-base: #0b0b0e;
    --crmg-panel: #16171d;
    --crmg-border: #3b4049;
    --crmg-blue: #67deff;
    --crmg-red: #c92335;
    font-family: Helvetica, Arial, sans-serif;
}
.crmg h3 { font-family: inherit; }
.crmg h3 { text-transform: uppercase; }
.crmg .crmg-panel { border-top: 2px solid var(--crmg-blue); }
.crmg > section.crmg-panel { margin-bottom: 1rem; }
.crmg button[type="submit"] { background: var(--crmg-red); color: #fff; border-color: #ff5c6b; }
.crmg [hidden] { display: none !important; }
.crmg .crmg-lane-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 58px;
    border-bottom: 1px solid var(--crmg-border);
    overflow-wrap: anywhere;
}
.crmg .crmg-lane .crmg-actions { margin-top: .8rem; }
.crmg select {
    min-height: 44px;
    background: var(--crmg-base);
    color: #fff;
    padding: .35rem;
    border: 1px solid var(--crmg-border);
    border-radius: .4rem;
    font: inherit;
}
.crmg .crmg-podium { margin-bottom: .85rem; padding: .85rem; border: 1px solid var(--crmg-border); border-radius: .5rem; }
.crmg .crmg-podium div { padding: .3rem 0; }
.crmg .crmg-scroll, .crmg .crmg-winner { margin-top: .8rem; }
