.ca {
    --ink: #233b3b;
    --gold: #deb36b;
    background: #eeeade;
    color: var(--ink);
    padding: 50px 18px 60px;
    margin-top: -40px;
    font: 14px/1.6 system-ui, -apple-system, 'Microsoft JhengHei', sans-serif
}

.ca * {
    box-sizing: border-box
}

.ca [hidden] {
    display: none !important
}

.ca-wrap {
    max-width: 1080px;
    margin: auto
}

.ca a {
    color: inherit;
    text-decoration: none
}

.ca button {
    font: 700 12px system-ui, sans-serif;
    padding: 10px 14px;
    background: #fffcf1;
    color: var(--ink);
    border: 1px solid #aebbb0;
    border-radius: 6px;
    cursor: pointer;
    touch-action: none;
    user-select: none
}

.ca button:disabled {
    opacity: .5;
    cursor: default
}

.ca button:focus-visible,
.ca a:focus-visible,
.ca canvas:focus-visible {
    outline: 3px solid #ec9857;
    outline-offset: 3px
}

.ca-nav {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px
}

.ca-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 35px 0 28px;
    gap: 25px
}

.ca-intro>div>p:first-child {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px
}

.ca-intro>div>p:first-child span {
    color: #8d9383;
    margin-left: 20px
}

.ca h1 {
    font-size: clamp(30px, 4vw, 46px);
    font-weight: 850;
    letter-spacing: -1px;
    margin: 12px 0
}

.ca h1 em {
    font-style: normal;
    color: #b26836
}

.ca-intro>div>p:last-child {
    font-size: 13px;
    color: #7a8273
}

.ca-stamp {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 128px;
    height: 128px;
    border: 2px solid #8a9776;
    transform: rotate(6deg);
    border-radius: 50%;
    color: #778163;
    flex-shrink: 0
}

.ca-stamp strong {
    font: 700 44px monospace
}

.ca-stamp span {
    font-size: 7px;
    letter-spacing: 1px
}

.ca-route {
    display: flex;
    gap: 30px;
    padding: 15px 0;
    border-top: 1px solid #cdd0bd;
    font-size: 10px;
    letter-spacing: 1px;
    color: #8d937f
}

.ca-route .is-current {
    color: #aa6438;
    font-weight: 800
}

.ca-cabinet {
    border: 1px solid #748d7f;
    border-radius: 13px;
    background: #fbf8ed;
    overflow: hidden;
    box-shadow: 0 8px 0 #cfd2c0
}

.ca-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #284747;
    padding: 18px 24px;
    color: #fff3d4
}

.ca-brand>div {
    display: flex;
    gap: 13px;
    align-items: center
}

.ca-logo {
    background: #dfb568;
    color: #284747;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    font-weight: 900;
    transform: rotate(-5deg)
}

.ca-brand h2 {
    font-size: 23px;
    color: inherit;
    margin: 0
}

.ca-brand p {
    font: 10px monospace;
    letter-spacing: 2px;
    margin: 4px 0 0
}

.ca-brand button {
    background: transparent;
    color: inherit;
    border-color: #829589;
    font-size: 10px
}

.ca-mission {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px
}

.ca-mission span {
    font-size: 9px;
    letter-spacing: 1.5px;
    color: #7e8b76
}

.ca-mission h3 {
    font-size: 20px;
    color: var(--ink);
    margin: 3px 0
}

.ca-hud {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0 24px 18px
}

.ca-hud>div {
    border-bottom: 1px solid #d8ddcc;
    padding-bottom: 10px
}

.ca-hud span {
    display: block;
    font-size: 9px;
    color: #7f8977;
    letter-spacing: 1px
}

.ca-hud b {
    font: 700 23px monospace;
    display: block;
    margin-top: 5px;
    color: #405a45
}

.ca #ca-lives {
    color: #b2663f
}

.ca-game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    margin: 0 24px;
    border: 5px solid #284747;
    border-radius: 8px;
    overflow: hidden;
    background: #183539
}

.ca-stage {
    position: relative;
    min-width: 0
}

.ca canvas {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    touch-action: none;
    background: #183539
}

.ca-overlay {
    position: absolute;
    inset: 0;
    background: #142e32e8;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 22px;
    color: #fff0d0;
    z-index: 2
}

.ca-overlay>div {
    max-width: 380px
}

.ca-overlay p:first-child {
    font: 10px monospace;
    letter-spacing: 2px;
    color: #e2ba76
}

.ca-overlay h3 {
    color: inherit;
    font-size: clamp(19px, 2.4vw, 27px);
    line-height: 1.6;
    margin: 14px 0
}

.ca-overlay p {
    font-size: 12px;
    line-height: 1.9
}

.ca-overlay button {
    background: #e5b978;
    border: 0;
    box-shadow: 0 3px 0 #a57846;
    padding: 13px 28px;
    margin-top: 10px;
    font-size: 13px
}

.ca-overlay a {
    display: block;
    font-size: 11px;
    margin-top: 18px;
    text-decoration: underline;
    text-underline-offset: 4px;
    color: #e1bf7d
}

.ca-checklist {
    padding: 20px 18px;
    background: #eceddc;
    border-left: 1px solid #657d6d
}

.ca-checklist>p:first-child {
    font: 9px monospace;
    letter-spacing: 1px;
    color: #8a9279
}

.ca-checklist h3 {
    font-size: 17px;
    line-height: 1.7;
    color: #355042;
    margin: 10px 0 22px
}

.ca-checklist>div {
    font-size: 11px;
    margin: 13px 0;
    color: #667c63
}

.ca-checklist>div.is-done {
    color: #2e724f;
    font-weight: 700
}

.ca-checklist .ca-tip {
    font-size: 11px;
    line-height: 1.95;
    color: #8f7b56;
    border-top: 1px solid #cdd3b8;
    padding-top: 18px;
    margin-top: 22px
}

.ca-checklist .ca-object {
    font-size: 10px;
    padding: 8px;
    border: 1px solid #cdd3b8;
    border-radius: 5px;
    color: #6b7a58
}

.ca-status {
    font-size: 12px;
    min-height: 20px;
    color: #637b65;
    margin: 12px 24px
}

.ca-controls {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 4px 24px 22px
}

.ca-pad {
    display: grid;
    grid-template: repeat(3, 36px)/repeat(3, 40px);
    gap: 4px;
    flex-shrink: 0
}

.ca-pad button {
    padding: 0;
    font-size: 13px;
    box-shadow: 0 2px 0 #bbc3ac
}

.ca-pad [data-control=up] {
    grid-area: 1/2
}

.ca-pad [data-control=left] {
    grid-area: 2/1
}

.ca-pad [data-control=right] {
    grid-area: 2/3
}

.ca-pad [data-control=down] {
    grid-area: 3/2
}

.ca-pad span {
    grid-area: 2/2;
    display: grid;
    place-items: center;
    font: 11px monospace;
    color: #9ba28a
}

.ca-action-buttons {
    display: flex;
    gap: 10px
}

.ca-action-buttons button {
    padding: 12px 16px;
    border-color: #c6ac7f;
    background: #f4e8ca;
    min-height: 54px
}

.ca-action-buttons small {
    display: block;
    font: 8px monospace;
    color: #95866a;
    margin-top: 6px
}

.ca-utility {
    display: flex;
    gap: 10px;
    margin-left: auto
}

.ca button.is-held {
    background: #d6dcb9;
    transform: translateY(2px)
}

.ca-save {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #d4d9c4;
    padding: 15px 24px;
    font-size: 10px;
    color: #7f8a73;
    background: #f0f0e1
}

.ca-save b {
    font-weight: 500
}

.ca-guide {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin: 38px 0
}

.ca-guide b {
    font: 10px monospace;
    color: #b28954;
    letter-spacing: 1px
}

.ca-guide h3 {
    font-size: 18px;
    color: #466047;
    margin: 8px 0
}

.ca-guide p {
    font-size: 12px;
    line-height: 1.9;
    color: #7e8975
}

.ca-help {
    border-top: 1px solid #cdd0bd;
    padding-top: 18px;
    font-size: 12px
}

.ca-help summary {
    cursor: pointer;
    font-weight: 700;
    color: #61765d
}

.ca-help p {
    font-size: 12px;
    line-height: 1.95;
    max-width: 900px;
    color: #7b8874
}

.ca-levels {
    padding: 24px
}

.ca-levels>div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.ca-levels h3 {
    font-size: 20px;
    color: var(--ink)
}

.ca-levels h4 {
    font-size: 13px;
    color: #9c7543;
    margin: 24px 0 12px
}

.ca-level-grid-row {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px
}

.ca-level-grid-row button {
    padding: 12px 4px
}

.ca-level-grid-row button strong {
    display: block;
    font: 700 19px monospace
}

.ca-level-grid-row button small {
    display: block;
    font-size: 9px;
    margin-top: 6px;
    color: #869177
}

.ca-level-grid-row .is-complete {
    background: #e4ecd4;
    border-color: #8b9f74
}

@media(max-width:850px) {
    .ca-game-layout {
        grid-template-columns: 1fr
    }

    .ca-checklist {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 20px;
        padding: 16px;
        border-left: 0;
        border-top: 1px solid #657d6d
    }

    .ca-checklist>p:first-child,
    .ca-checklist h3 {
        display: none
    }

    .ca-checklist>div {
        margin: 3px 0
    }

    .ca-checklist .ca-tip {
        grid-column: 1/-1;
        border: 0;
        margin: 4px 0;
        padding: 0;
        font-size: 10px
    }

    .ca-checklist .ca-object {
        grid-column: 1/-1;
        margin: 2px 0
    }

    .ca-controls {
        gap: 15px
    }

    .ca-utility {
        flex-direction: column;
        gap: 6px
    }

    .ca-stamp {
        width: 95px;
        height: 95px
    }

    .ca-stamp strong {
        font-size: 32px
    }

    .ca-stamp span {
        font-size: 6px
    }
}

@media(max-width:500px) {
    .ca {
        margin-top: -40px;
        padding: 42px 12px 40px
    }

    .ca-intro {
        margin: 27px 0 20px
    }

    .ca-intro>div>p:first-child span {
        display: block;
        margin: 7px 0
    }

    .ca-intro h1 {
        font-size: 29px
    }

    .ca-stamp {
        display: none
    }

    .ca-route {
        gap: 12px;
        justify-content: space-between;
        font-size: 8px;
        letter-spacing: 0
    }

    .ca-brand {
        padding: 14px
    }

    .ca-brand p {
        font-size: 8px;
        letter-spacing: .8px
    }

    .ca-brand h2 {
        font-size: 19px
    }

    .ca-brand>div {
        gap: 8px
    }

    .ca-brand button {
        padding: 8px;
        font-size: 8px
    }

    .ca-logo {
        width: 34px;
        height: 34px
    }

    .ca-mission {
        padding: 16px 14px 12px
    }

    .ca-mission h3 {
        font-size: 17px
    }

    .ca-mission button {
        font-size: 10px;
        padding: 8px
    }

    .ca-hud {
        padding: 0 14px 12px;
        gap: 8px
    }

    .ca-hud span {
        font-size: 7px
    }

    .ca-hud b {
        font-size: 17px
    }

    .ca-game-layout {
        margin: 0 10px;
        border-width: 3px
    }

    .ca-checklist {
        padding: 12px;
        gap: 4px 9px
    }

    .ca-checklist>div {
        font-size: 9px
    }

    .ca-controls {
        padding: 4px 12px 16px;
        gap: 12px;
        flex-wrap: wrap
    }

    .ca-pad {
        grid-template: repeat(3, 38px)/repeat(3, 38px);
        gap: 3px
    }

    .ca-action-buttons {
        gap: 6px;
        flex: 1;
        justify-content: flex-end
    }

    .ca-action-buttons button {
        padding: 11px 8px;
        font-size: 11px;
        min-height: 54px
    }

    .ca-action-buttons small {
        font-size: 7px
    }

    .ca-utility {
        flex-direction: row;
        width: 100%;
        margin: 0;
        justify-content: flex-end
    }

    .ca-utility button {
        font-size: 11px;
        padding: 9px 15px
    }

    .ca-status {
        font-size: 10px;
        margin: 10px 14px
    }

    .ca-save {
        padding: 12px;
        font-size: 9px;
        flex-wrap: wrap
    }

    .ca-overlay {
        padding: 12px
    }

    .ca-overlay h3 {
        font-size: 18px;
        margin: 8px 0
    }

    .ca-overlay p {
        font-size: 10px;
        line-height: 1.7
    }

    .ca-overlay p:first-child {
        font-size: 8px;
        letter-spacing: 1px
    }

    .ca-overlay button {
        padding: 10px 22px;
        font-size: 11px;
        margin-top: 4px
    }

    .ca-overlay a {
        font-size: 9px;
        margin-top: 9px
    }

    .ca-guide {
        gap: 16px;
        grid-template-columns: 1fr;
        margin: 28px 0
    }

    .ca-guide article {
        border-left: 2px solid #d1c4a4;
        padding-left: 14px
    }

    .ca-guide h3 {
        font-size: 16px
    }

    .ca-guide p {
        margin: 5px 0
    }

    .ca-levels {
        padding: 16px
    }

    .ca-level-grid-row {
        grid-template-columns: repeat(5, 1fr)
    }

    .ca-levels h3 {
        font-size: 16px
    }
}