@font-face {
    font-family: "LXGW WenKai";
    src: url("/static/fonts/cat-crown/lxgw-wenkai-ui-subset.woff2?v=36") format("woff2");
    font-display: swap;
    font-weight: 400 800;
    font-style: normal;
}

/* Contextual help and accepted adventure results share the existing paper palette. */
.cc-top-actions .cc-help-control { min-height: 44px; padding: 7px 10px; font-size: 12px; background-image: none; }
.cc-top-actions .cc-help-control::before,
.cc-top-actions .cc-help-control::after { content: none; }
#ccTutorialDialog[open] { grid-template-rows: minmax(0, 1fr); }
.cc-card-dialog .cc-tutorial { display: flex; flex-direction: column; width: min(560px, 100%); min-width: 0; min-height: 0; max-height: 100%; margin: 0; padding: 20px; border-color: var(--cc-gold); color: var(--cc-ink); overflow: hidden; }
.cc-tutorial-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cc-tutorial-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 12px; }
.cc-tutorial-actions button { padding: 8px 12px; }
.cc-tutorial-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-tutorial h3 { margin: 0; font-family: "LXGW WenKai", serif; font-size: 20px; line-height: 1.4; }
.cc-tutorial p { margin: 8px 0 12px; font-size: 14px; line-height: 1.65; }
.cc-tutorial button { min-width: 44px; min-height: 44px; font-size: 13px; }
.cc-tutorial-heading button { flex: 0 0 auto; }
.cc-tutorial-heading .cc-modal-close { float: none; margin: 0; min-width: 64px; }
.cc-tutorial-heading .cc-modal-kicker { margin: 0; }
.cc-tutorial-heading { flex-shrink: 0; margin-bottom: 12px; }
.cc-tutorial-actions { flex-shrink: 0; }
.cc-tutorial-flow { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.cc-tutorial-flow figure { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; }
.cc-tutorial-flow img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; }
.cc-app [data-guide-target="true"] { outline: 3px solid var(--cc-gold); outline-offset: 3px; scroll-margin-block: 90px; }
/* A transformed static button becomes the containing block for its full-card
   hit area, which can alternate hover on and off after a guided scroll. */
.cc-app button.cc-choice-select:is(:hover, :active):not(:disabled) { transform: none; }
.cc-receipt { margin: 12px 0; border-block: 1px solid var(--cc-line); color: var(--cc-ink); }
.cc-receipt summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 14px; font-weight: 700; }
.cc-receipt p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; }
.cc-receipt button { margin-bottom: 12px; }
.cc-card-dialog .cc-report-detail { display: flex; flex-direction: column; width: min(700px, 100%); max-height: 100%; padding: 20px; color: var(--cc-ink); background: var(--cc-paper-strong); overflow: hidden; }
.cc-report-detail > .cc-report-content { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding-right: 4px; }
.cc-report-content { min-width: 0; font-size: 14px; line-height: 1.65; color: var(--cc-ink); }
.cc-report-content h3 { margin: 22px 0 10px; font-family: "LXGW WenKai", serif; font-size: 21px; }
.cc-report-content p { margin: 6px 0 12px; }
.cc-report-content .cc-report-advice { padding: 12px 0; border-block: 1px solid rgba(23, 62, 53, .24); }
.cc-report-totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
.cc-report-totals dd { margin: 0; font-weight: 700; text-align: right; }
.cc-report-content ul { list-style: none; margin: 0; padding: 0; }
.cc-app .cc-report-content li { display: block; border: 0; border-bottom: 1px solid rgba(23, 62, 53, .2); padding: 10px 0; background: transparent; font-size: 14px; }
.cc-report-content li p { margin: 4px 0 0; color: var(--cc-muted); }
.cc-report-content summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
.cc-report-partners { display: flex; flex-wrap: wrap; gap: 12px; }
.cc-report-partners figure { flex: 1 1 130px; min-width: 0; margin: 0; text-align: center; }
.cc-report-partners img { display: block; width: 72px; height: 72px; margin: 0 auto 6px; object-fit: contain; }
.cc-report-partners small { display: block; color: var(--cc-muted); font-size: 12px; }
.cc-ai-reason { grid-column: 1 / -1; margin: 0; padding: 8px 0 0; color: var(--cc-ink); border-top: 1px solid rgba(23, 62, 53, .25); font-size: 14px; line-height: 1.6; }
@media (max-width: 760px) {
    .cc-card-dialog .cc-tutorial { padding: 12px; }
    .cc-tutorial h3 { font-size: 18px; }
    .cc-tutorial-flow { gap: 6px; }
    .cc-tutorial-flow figure { flex: 1; flex-direction: column; text-align: center; }
    .cc-card-dialog .cc-report-detail { padding: 14px 12px; }
}

:root {
    --cc-paper: #f3ecd7;
    --cc-paper-strong: #fffaf0;
    --cc-ink: #173e35;
    --cc-muted: #617169;
    --cc-line: #173e35;
    --cc-forest: #2e7458;
    --cc-forest-dark: #173e35;
    --cc-coral: #bd5b45;
    --cc-gold: #e5b945;
    --cc-gold-soft: #f5dda0;
    --cc-shadow: #a8bcaa;
    --cc-radius: 12px;
    --cc-small-radius: 7px;
    --cc-border: 2px solid var(--cc-line);
    --cc-button-cloth-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='28' viewBox='0 0 52 28'%3E%3Cpath d='M-4 7c9-4 15 2 25-1s18-2 35 1M-3 20c10-3 17 2 28-1s19-1 31 2' fill='none' stroke='%23fffaf0' stroke-opacity='.15' stroke-width='1'/%3E%3C/svg%3E");
    --cc-button-paper-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='26' viewBox='0 0 48 26'%3E%3Cpath d='M-3 6c8-3 13 2 22 0s18-2 33 1M-5 19c10-2 17 2 28 0s18-1 29 1' fill='none' stroke='%23173e35' stroke-opacity='.1' stroke-width='1'/%3E%3C/svg%3E");
}

body:has(.cc-app) {
    margin: 0;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    background: #d9e5d5;
    color: var(--cc-ink);
}

body:has(.cc-app) .navbar,
body:has(.cc-app) > .footer { display: none !important; }

.cc-app,
.cc-app * { box-sizing: border-box; }

.cc-app [hidden] { display: none !important; }

.cc-app {
    position: relative;
    min-height: 100dvh;
    overflow: clip;
    color: var(--cc-ink);
    font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    background: #d9e5d5;
}

.cc-app::before,
.cc-app::after {
    content: "";
    position: fixed;
    z-index: 0;
    width: 220px;
    aspect-ratio: 1;
    border: 28px solid rgba(255, 250, 240, .38);
    border-radius: 50%;
    pointer-events: none;
}

.cc-app::before { top: 12vh; left: -120px; }
.cc-app::after { right: -135px; bottom: 4vh; border-color: rgba(189, 91, 69, .12); }

.cc-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 70px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 8px clamp(16px, 3vw, 44px);
    border-bottom: 2px solid var(--cc-line);
    background: var(--cc-paper);
}

.cc-back,
.cc-music-toggle,
.cc-abandon-control,
.cc-primary,
.cc-secondary,
.cc-danger-confirm,
.cc-route-option,
.cc-event-option,
.cc-danger-actions button,
.cc-card button,
.cc-modal-close {
    position: relative;
    isolation: isolate;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    border-radius: var(--cc-small-radius);
    font: inherit;
    font-weight: 750;
    line-height: 1.15;
    text-align: center;
    text-wrap: balance;
    cursor: pointer;
    touch-action: manipulation;
    background-position: 0 0;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, background-position 260ms ease, border-color 160ms ease;
}

.cc-back {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--cc-forest-dark);
    text-decoration: none;
    padding: 8px 13px 8px 9px;
    border: var(--cc-border);
    background-color: var(--cc-paper-strong);
    background-image: var(--cc-button-paper-texture);
    box-shadow: inset 0 0 0 1px rgba(255, 250, 240, .9), inset 0 -2px 0 rgba(23, 62, 53, .13), 3px 3px 0 var(--cc-shadow);
}
.cc-back span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--cc-paper-strong); background: var(--cc-forest-dark); }
.cc-back b { font-size: 13px; }

.cc-wordmark { justify-self: center; display: flex; align-items: center; gap: 9px; text-align: left; line-height: 1.05; white-space: nowrap; }
.cc-wordmark h1 { display: block; margin: 0; font-family: "LXGW WenKai", "Kaiti SC", serif; font-size: 24px; font-weight: 800; letter-spacing: .08em; }
.cc-wordmark small { display: block; margin-top: 4px; color: var(--cc-muted); font-size: 10px; letter-spacing: .06em; }
.cc-emblem { display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--cc-line); border-radius: 50%; background: var(--cc-gold); }
.cc-emblem svg { width: 25px; fill: var(--cc-paper-strong); stroke: var(--cc-line); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.cc-top-actions { justify-self: end; display: flex; align-items: center; justify-content: flex-end; gap: 13px; }
.cc-top-actions > * { flex: 0 0 auto; white-space: nowrap; }
.cc-abandon-control {
    min-width: 96px;
    padding: 7px 12px;
    border: 2px solid #8f3f30;
    color: #743526;
    background-color: #fff0e4;
    background-image: var(--cc-button-paper-texture);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .82), inset 0 -2px 0 rgba(143, 63, 48, .14), 3px 3px 0 rgba(143, 63, 48, .26);
    font-size: 11px;
}
.cc-music-toggle {
    gap: 8px;
    min-width: 93px;
    padding: 7px 11px;
    border: var(--cc-border);
    color: var(--cc-forest-dark);
    background-color: var(--cc-paper-strong);
    background-image: var(--cc-button-paper-texture);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), inset 0 -2px 0 rgba(23, 62, 53, .12), 3px 3px 0 var(--cc-shadow);
    font-size: 11px;
}
.cc-music-icon { height: 17px; display: flex; align-items: end; gap: 2px; }
.cc-music-icon i { display: block; width: 3px; height: 7px; border-radius: 1px; background: var(--cc-forest); transition: height 160ms ease, opacity 160ms ease; }
.cc-music-icon i:nth-child(2) { height: 15px; }
.cc-music-icon i:nth-child(3) { height: 11px; }
.cc-music-toggle[aria-pressed="false"] .cc-music-icon i { height: 4px; opacity: .45; }
.cc-save-state { justify-self: end; color: var(--cc-muted); font-size: 12px; text-align: right; }
.cc-save-state::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border: 1px solid var(--cc-line); border-radius: 50%; background: #7dbb77; }

.cc-shell { position: relative; z-index: 1; width: 100%; margin: 0 auto; padding: 0; }

.cc-intro {
    position: relative;
    min-height: calc(100dvh - 70px);
    overflow: hidden;
    isolation: isolate;
}

.cc-cover { position: absolute; inset: 0; margin: 0; background: #a8cba9; }
.cc-cover picture { display: block; width: 100%; height: 100%; }
.cc-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 48%;
    filter: saturate(.96) contrast(1.02);
}
.cc-cover::after { content: ""; position: absolute; inset: 0; background: rgba(20, 55, 44, .12); pointer-events: none; }

.cc-intro-copy {
    position: relative;
    z-index: 4;
    isolation: isolate;
    width: 100%;
    padding: clamp(18px, 2vw, 26px) clamp(22px, 3vw, 42px) 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.cc-intro-copy::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 12px 5% 88px;
    background: radial-gradient(ellipse at center, rgba(255, 250, 240, .92) 0 38%, rgba(255, 250, 240, .68) 58%, rgba(255, 250, 240, 0) 78%);
    filter: blur(8px);
    pointer-events: none;
}
.cc-intro-copy::after { display: none; }
.cc-intro-copy > * { position: relative; z-index: 1; }
.cc-intro h2 { margin: 0 0 18px; font-family: "LXGW WenKai", "Kaiti SC", serif; font-size: clamp(44px, 4.4vw, 64px); font-weight: 800; line-height: .92; letter-spacing: -.055em; text-shadow: 0 2px 0 rgba(255, 250, 240, .84); text-wrap: balance; }
.cc-intro h2 > span { position: relative; display: block; width: fit-content; margin-inline: auto; }
/* Hang punctuation outside the centered four-character title lines. */
.cc-intro h2 .cc-title-punctuation { position: absolute; left: 100%; }
.cc-intro-overview { width: min(470px, 100%); margin: 0 auto; padding: 9px 4px 4px; border: 0; border-radius: 4px; color: var(--cc-paper-strong); background: rgba(23, 62, 53, .94); box-shadow: 4px 4px 0 rgba(23, 62, 53, .34); }
.cc-hero-brief { width: 100%; margin: 0; padding: 2px 14px 9px; border: 0; color: rgba(255, 250, 240, .88); background: transparent; font-size: 12px; line-height: 1.45; letter-spacing: .025em; }
.cc-intro-meta { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; padding: 0; border: 0; border-top: 1px solid rgba(255, 250, 240, .24); background: transparent; box-shadow: none; }
.cc-intro-meta span { position: relative; min-width: 0; padding: 9px 12px 8px; color: rgba(255, 250, 240, .72); background: transparent; }
.cc-intro-meta span + span { border-left: 1px solid rgba(255, 250, 240, .22); }
.cc-intro-meta span::after { content: "0" counter(cc-meta); position: absolute; top: 5px; right: 6px; color: rgba(245, 221, 160, .62); font-family: ui-monospace, monospace; font-size: 7px; letter-spacing: .04em; }
.cc-intro-meta { counter-reset: cc-meta; }
.cc-intro-meta span { counter-increment: cc-meta; }
.cc-intro-meta b,
.cc-intro-meta small { display: block; }
.cc-intro-meta b { color: var(--cc-paper-strong); font-family: "LXGW WenKai", serif; font-size: 17px; }
.cc-intro-meta span:last-child b { font-size: 14px; line-height: 1.35; }
.cc-intro-meta small { margin-top: 2px; overflow: hidden; font-size: 9px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.cc-record-board {
    position: absolute;
    z-index: 5;
    top: clamp(16px, 3vw, 40px);
    left: clamp(16px, 3vw, 44px);
    width: min(270px, calc(100% - 32px));
    padding: 10px 24px 10px 12px;
    border: 0;
    border-left: 2px solid rgba(245, 221, 160, .9);
    border-radius: 0;
    background: linear-gradient(90deg, rgba(255, 250, 240, .72) 0 64%, transparent 100%);
    box-shadow: none;
    text-align: left;
}
.cc-records-title { display: flex; align-items: center; gap: 8px; margin: 0 0 5px; color: var(--cc-ink); text-shadow: 0 1px 0 rgba(255, 250, 240, .88); }
.cc-records-title span { font-family: "LXGW WenKai", serif; font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.cc-records-title small { color: var(--cc-muted); font-size: 8px; letter-spacing: .04em; }
.cc-records-title::after { content: ""; flex: 1; height: 1px; background: rgba(23, 62, 53, .28); }
.cc-records { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.cc-records span { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 6px 4px; border: 0; border-top: 1px solid rgba(23, 62, 53, .22); border-radius: 0; background: transparent; }
.cc-records small { overflow: hidden; color: var(--cc-muted); font-size: 10px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.cc-records strong { flex: 0 0 auto; min-width: 28px; height: auto; display: inline-grid; place-items: center; padding: 0 4px; border: 0; border-radius: 0; color: #80520e; background: transparent; font-family: "LXGW WenKai", serif; font-size: 17px; line-height: 1.15; text-shadow: 0 1px 0 rgba(255, 250, 240, .9); }
.cc-records strong[data-value="true"]::after { content: " 金币"; color: var(--cc-muted); font-family: inherit; font-size: 10px; }
/* Achievement details open in place within the existing record-board surface. */
.cc-achievement-wall { display: grid; gap: 5px; margin: 0; padding: 3px 0 0; list-style: none; border-top: 1px solid rgba(23, 62, 53, .22); color: #6c716c; }
.cc-achievement-wall .cc-achievement { display: block; padding: 0; border: 0; border-radius: 0; background: transparent; }
.cc-achievement-trigger { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px; cursor: pointer; list-style: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.cc-achievement-trigger::-webkit-details-marker { display: none; }
.cc-achievement-trigger:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.cc-achievement-trigger:hover { background: rgba(255, 250, 240, .24); }
.cc-achievement-trigger strong { flex: 1; min-width: 0; color: inherit; font-family: "LXGW WenKai", serif; font-size: 13px; font-weight: 400; line-height: 1.4; }
.cc-achievement-trigger .cc-achievement-art { flex-basis: 36px; width: 36px; height: 36px; }
.cc-achievement-trigger svg { flex: 0 0 14px; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cc-achievement-disclosure[open] .cc-achievement-trigger svg { transform: rotate(90deg); }
.cc-achievement-wall .cc-achievement-copy { padding: 0 4px 8px 48px; }
.cc-achievement-copy { min-width: 0; }
.cc-achievement-art { flex: 0 0 48px; width: 48px; height: 48px; object-fit: contain; }
.cc-achievement[data-state="locked"] .cc-achievement-art,
.cc-achievement[data-state="pending"] .cc-achievement-art { filter: grayscale(1); }
.cc-achievement-wall .cc-achievement span { display: block; color: inherit; font-size: 12px; line-height: 1.5; }
.cc-achievement-status { display: block; margin-top: 4px; color: inherit; font-size: 11px; line-height: 1.4; }
.cc-achievement-error { margin: 6px 0 0; color: var(--cc-ink); font-size: 12px; }
.cc-achievement-error button { min-width: 44px; min-height: 44px; margin-left: 6px; }
.cc-result-achievements { display: grid; gap: 8px; margin: 0 0 18px; padding: 12px 14px; border: var(--cc-border); border-radius: var(--cc-small-radius); background: rgba(243, 236, 215, .72); }
.cc-result-achievements h3 { margin: 0; color: var(--cc-forest-dark); font: 800 13px/1.3 "LXGW WenKai", serif; letter-spacing: .04em; }
.cc-result-achievements ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cc-result-achievements .cc-achievement { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 0; padding: 0; border: 0; background: transparent; }
.cc-result-achievements .cc-achievement .cc-achievement-copy { display: grid; gap: 2px; }
.cc-result-achievements .cc-achievement strong { color: #80520e; font: 400 15px/1.35 "LXGW WenKai", serif; }
.cc-result-achievements .cc-achievement span { color: var(--cc-muted); font-size: 12px; line-height: 1.45; }
.cc-intro-menu { position: absolute; z-index: 5; left: 50%; top: 50%; width: min(560px, calc(100% - 36px)); display: grid; justify-items: center; transform: translate(-50%, -50%); text-align: center; }
.cc-menu-crown { position: relative; z-index: 6; width: 88px; height: 72px; display: grid; place-items: center; margin: 8px auto 16px; border: 3px solid var(--cc-line); border-radius: var(--cc-radius); background: rgba(245, 221, 160, .95); box-shadow: 6px 6px 0 rgba(23, 62, 53, .52); transform: rotate(-2deg); }
.cc-menu-crown svg { width: 58px; fill: var(--cc-gold); stroke: var(--cc-line); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cc-intro-actions { width: min(330px, 100%); display: grid; gap: 10px; }
.cc-intro-actions .cc-primary { min-height: 58px; border-width: 3px; font-family: "LXGW WenKai", serif; font-size: 20px; letter-spacing: .06em; box-shadow: inset 0 0 0 2px rgba(255, 250, 240, .2), inset 0 -4px 0 rgba(12, 53, 39, .42), 6px 6px 0 #173e35; }
.cc-intro-actions .cc-secondary { min-height: 48px; background-color: rgba(255, 250, 240, .96); }
.cc-primary,
.cc-secondary { padding: 10px 19px; border: var(--cc-border); }
.cc-primary {
    color: #fffaf0;
    background-color: var(--cc-forest);
    background-image: var(--cc-button-cloth-texture);
    box-shadow: inset 0 0 0 2px rgba(255, 250, 240, .2), inset 0 -3px 0 rgba(12, 53, 39, .42), 4px 4px 0 #173e35;
    text-shadow: 0 1px 0 rgba(10, 40, 31, .7);
}
.cc-secondary {
    color: var(--cc-forest-dark);
    background-color: var(--cc-paper-strong);
    background-image: var(--cc-button-paper-texture);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), inset 0 -3px 0 rgba(23, 62, 53, .12), 3px 3px 0 var(--cc-shadow);
}
.cc-primary::before,
.cc-primary::after,
.cc-secondary::before,
.cc-secondary::after,
.cc-event-option::before,
.cc-event-option::after,
.cc-modal-close::before,
.cc-modal-close::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 5px;
    height: 5px;
    border: 1px solid currentColor;
    opacity: .48;
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
}
.cc-primary::before,
.cc-secondary::before,
.cc-event-option::before,
.cc-modal-close::before { left: 9px; }
.cc-primary::after,
.cc-secondary::after,
.cc-event-option::after,
.cc-modal-close::after { right: 9px; }
.cc-resume-note { width: fit-content; max-width: 100%; margin: 13px auto 0; padding: 7px 10px; border: 1px solid var(--cc-line); border-radius: 4px; color: var(--cc-ink); background: rgba(255, 250, 240, .94); box-shadow: 3px 3px 0 rgba(23, 62, 53, .36); font-size: 11px; }

.cc-game {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(500px, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
}

.cc-area-transition {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
    color: var(--cc-paper-strong);
    background-color: var(--cc-forest-dark);
    background-image: var(--cc-button-cloth-texture);
    animation: cc-area-transition-in .46s cubic-bezier(.2, .75, .2, 1) both;
}
.cc-area-transition[hidden] { display: none; }
.cc-area-transition::before { position: absolute; inset: clamp(12px, 3vw, 30px); border: 2px solid rgba(229, 185, 69, .72); content: ""; pointer-events: none; }
.cc-area-transition::after { position: absolute; top: 50%; left: 50%; width: min(76vw, 720px); border-top: 2px dashed rgba(229, 185, 69, .3); content: ""; transform: translate(-50%, -50%); }
.cc-area-transition-card { position: relative; z-index: 1; width: min(560px, calc(100vw - 48px)); text-align: center; }
.cc-area-transition-card > p { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 0; font-size: 13px; font-weight: 900; letter-spacing: .12em; }
.cc-area-transition-card > p span { padding: 7px 10px; border: 2px solid var(--cc-gold); color: var(--cc-forest-dark); background: var(--cc-gold); }
.cc-area-transition-card > p small { color: var(--cc-gold-soft); font: inherit; }
.cc-area-transition-crown { display: grid; place-items: center; width: 112px; height: 88px; margin: clamp(22px, 5vh, 46px) auto 16px; border: 3px solid var(--cc-gold); color: var(--cc-gold); background-color: rgba(255, 250, 240, .06); box-shadow: 8px 8px 0 rgba(0, 0, 0, .22); animation: cc-area-crown-reveal .58s .18s cubic-bezier(.2, .9, .25, 1.25) both; }
.cc-area-transition-crown svg { width: 72px; fill: currentColor; stroke: var(--cc-paper-strong); stroke-width: 2; }
.cc-area-transition-card h2 { margin: 0; font-family: "LXGW WenKai", serif; font-size: clamp(52px, 10vw, 92px); font-weight: 800; line-height: 1; letter-spacing: .06em; text-shadow: 5px 5px 0 rgba(0, 0, 0, .24); }
.cc-area-transition-card > span:last-child { display: block; margin-top: 18px; color: rgba(255, 250, 240, .82); font-size: 14px; line-height: 1.6; }
.cc-area-transition-route { position: relative; display: grid; grid-template-columns: repeat(4, 18px); justify-content: center; gap: 42px; margin: 28px auto 0; }
.cc-area-transition-route::before { position: absolute; top: 8px; right: 8px; left: 8px; border-top: 2px dashed rgba(255, 250, 240, .38); content: ""; }
.cc-area-transition-route i { position: relative; z-index: 1; width: 18px; height: 18px; border: 2px solid var(--cc-paper-strong); transform: rotate(45deg); background: var(--cc-forest-dark); }
.cc-area-transition-route i[data-state="complete"] { border-color: var(--cc-gold-soft); background: var(--cc-gold-soft); }
.cc-area-transition-route i[data-state="current"] { border-color: var(--cc-paper-strong); background: var(--cc-coral); box-shadow: 0 0 0 5px rgba(229, 185, 69, .26); animation: cc-area-step-pulse .72s .32s ease-out both; }
.cc-area-transition[data-state="leaving"] { animation: cc-area-transition-out .36s ease-in both; }
@keyframes cc-area-transition-in {
    from { opacity: 0; clip-path: inset(48% 0 48% 0); }
    to { opacity: 1; clip-path: inset(0); }
}
@keyframes cc-area-transition-out {
    from { opacity: 1; clip-path: inset(0); }
    to { opacity: 0; clip-path: inset(0 48% 0 48%); }
}
@keyframes cc-area-crown-reveal {
    from { opacity: 0; transform: translateY(18px) scale(.72) rotate(-4deg); }
    to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes cc-area-step-pulse {
    from { transform: rotate(45deg) scale(.6); }
    to { transform: rotate(45deg) scale(1); }
}

.cc-map-panel,
.cc-table,
.cc-team-status,
.cc-log {
    border: var(--cc-border);
    border-radius: var(--cc-radius);
    box-shadow: 5px 5px 0 var(--cc-shadow);
}

.cc-map-panel {
    grid-column: 1;
    grid-row: 1 / span 3;
    position: sticky;
    top: 82px;
    min-height: calc(100dvh - 94px);
    overflow: hidden;
    border-width: 3px;
    color: #fffaf0;
    background: var(--cc-forest-dark);
}
.cc-map-panel > picture { position: absolute; inset: 0; }
.cc-map-panel > picture img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.cc-map-wash { position: absolute; inset: 0; background: rgba(18, 55, 44, .14); }
.cc-map-heading,
.cc-region-track,
.cc-combat,
.cc-map-action,
.cc-route-list,
.cc-encounter { position: relative; z-index: 1; }
.cc-map-heading { width: fit-content; margin: 22px; padding: 13px 16px; border: var(--cc-border); border-radius: var(--cc-small-radius); color: var(--cc-ink); background: rgba(255, 250, 240, .94); box-shadow: 4px 4px 0 rgba(23, 62, 53, .42); }
.cc-map-heading p { display: inline-block; margin: 0; padding: 4px 7px; border: 1px solid rgba(255, 250, 240, .76); border-radius: 4px; color: var(--cc-forest-dark); background: var(--cc-gold); font-size: 10px; font-weight: 850; letter-spacing: .1em; }
.cc-map-heading h1 { margin: 6px 0 0; font-family: "LXGW WenKai", serif; font-size: 42px; font-weight: 800; line-height: .98; }
.cc-map-heading span { font-size: 12px; }
.cc-region-track { position: absolute; top: 24px; right: 24px; display: grid; grid-template-columns: repeat(4, minmax(62px, 1fr)); gap: 5px; padding: 6px; border: var(--cc-border); border-radius: var(--cc-small-radius); background: rgba(23, 62, 53, .87); }
.cc-region-track > span { padding: 8px 5px; border: 1px solid rgba(255, 250, 240, .58); border-radius: 4px; text-align: center; font-size: 10px; opacity: .72; }
.cc-region-track > span[data-current="true"] { border-color: var(--cc-gold-soft); color: var(--cc-gold-soft); opacity: 1; font-weight: 850; }
.cc-region-track > span img { display: block; width: 44px; height: 44px; margin: 0 auto 5px; object-fit: contain; border-radius: 5px; }
.cc-region-track > span b, .cc-region-track > span small { display: block; }
.cc-region-track > span small { margin-top: 4px; font-size: 10px; }
.cc-region-track > span[data-current="true"] img { outline: 2px solid var(--cc-gold); outline-offset: 2px; }
.cc-app[data-duel="true"] .cc-map-panel { border-color: #8f3f30; box-shadow: 7px 7px 0 rgba(143, 63, 48, .32); }
.cc-app[data-duel="true"] .cc-map-wash { background: rgba(63, 20, 16, .34); }

.cc-map-action {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 49%;
    width: min(820px, calc(100% - 44px));
    padding: 20px;
    border: 3px solid var(--cc-line);
    border-radius: 11px 6px 11px 6px;
    color: var(--cc-ink);
    background-color: rgba(255, 250, 240, .96);
    background-image: var(--cc-button-paper-texture);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .84), 7px 7px 0 rgba(13, 43, 34, .62);
    transform: translate(-50%, -50%);
}
.cc-map-action > p { margin: 0; color: var(--cc-coral); font-size: 11px; font-weight: 850; letter-spacing: .1em; }
.cc-map-action > h2 { margin: 5px 0 3px; font-family: "LXGW WenKai", serif; font-size: 34px; line-height: 1.08; }
.cc-map-action > span { display: block; max-width: 58ch; color: var(--cc-muted); font-size: 13px; font-weight: 600; line-height: 1.5; }
.cc-event-scene { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: center; gap: 18px; margin-top: 16px; }
.cc-event-scene img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border: 2px solid var(--cc-line); border-radius: 6px; }
.cc-event-scene p { margin: 0; font-size: 16px; line-height: 1.85; }
.cc-route-list:empty { display: none; }
.cc-route-map { position: relative; margin-top: 20px; isolation: isolate; }
.cc-route-origin { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; width: 100px; margin: 0 auto; }
.cc-route-origin img { width: 52px; height: 52px; border: 3px solid var(--cc-paper-strong); border-radius: 50%; box-shadow: 0 0 0 2px var(--cc-forest), 0 4px 12px #173e3540; }
.cc-route-origin span { margin-top: 6px; padding: 4px 10px; border-radius: 4px; color: var(--cc-paper-strong); background: var(--cc-forest-dark); font-size: 12px; white-space: nowrap; }
.cc-route-roads { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.cc-route-roads path { fill: none; stroke-linecap: round; }
.cc-road-edge { stroke: #715f3e; stroke-width: 17px; }
.cc-road-paper { stroke: #f5dda0; stroke-width: 13px; }
.cc-road-trail { stroke: #a18b5e; stroke-width: 2px; stroke-dasharray: 3 9; }
.cc-route-roads circle { fill: var(--cc-gold); stroke: var(--cc-forest-dark); stroke-width: 2px; }
.cc-route-option,
.cc-event-option {
    border: var(--cc-border);
    color: var(--cc-forest-dark);
    padding: 9px 21px;
    background-color: var(--cc-paper-strong);
    background-image: var(--cc-button-paper-texture);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .82), inset 0 -3px 0 rgba(23, 62, 53, .14), 3px 3px 0 rgba(13, 43, 34, .58);
}
.cc-route-option[data-kind="battle"] { border-color: #8f4b3a; background-color: #fff0e4; }
.cc-route-option[data-kind="event"] { border-color: #476e57; background-color: #edf2df; }
.cc-route-art {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border-right: 2px solid currentColor;
    border-radius: 4px 0 0 4px;
    background: var(--cc-gold-soft);
}
.cc-route-art img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.cc-route-copy { min-width: 0; display: flex; flex-direction: column; align-items: stretch; padding: 13px 14px 11px; }
.cc-route-kicker { color: var(--cc-coral); font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.cc-route-copy > strong { margin-top: 5px; font-family: "LXGW WenKai", serif; font-size: 24px; line-height: 1.08; }
.cc-route-copy > small { margin-top: 5px; color: var(--cc-muted); font-size: 12px; font-weight: 600; line-height: 1.4; }
.cc-route-rewards { display: grid; gap: 7px; margin-block: 9px; }
.cc-route-rewards small { color: var(--cc-muted); font-size: 12px; line-height: 1.5; }

.cc-route-go { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: auto; padding-top: 9px; color: var(--cc-forest-dark); font-size: 12px; font-weight: 850; transition: color 160ms ease, border-color 160ms ease; }
.cc-route-option[data-kind="battle"] .cc-route-go { color: #8f4b3a; }
.cc-route-go b { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; min-height: 36px; padding: 7px 10px; border: 1px solid currentColor; border-radius: 4px; font-size: 12px; line-height: 1; white-space: nowrap; transition: color 160ms ease, background-color 160ms ease, transform 160ms ease; }
.cc-route-go svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cc-route-option:hover .cc-route-go,
.cc-route-option:focus-visible .cc-route-go { border-color: currentColor; }
.cc-route-option:hover .cc-route-go b,
.cc-route-option:focus-visible .cc-route-go b { color: var(--cc-paper-strong); background: var(--cc-forest-dark); transform: translateX(2px); }
.cc-route-option[data-kind="battle"]:hover .cc-route-go b,
.cc-route-option[data-kind="battle"]:focus-visible .cc-route-go b { background: #8f4b3a; }
.cc-event-option {
    flex-wrap: wrap;
    gap: 4px;
    color: var(--cc-ink);
    background-color: var(--cc-gold-soft);
    box-shadow: inset 0 0 0 1px rgba(255, 250, 240, .76), inset 0 -3px 0 rgba(128, 86, 16, .2), 3px 3px 0 rgba(13, 43, 34, .58);
}
.cc-encounter { position: absolute; z-index: 2; left: 22px; bottom: 22px; width: min(560px, calc(100% - 44px)); padding: 15px 17px; border: 2px solid rgba(255, 250, 240, .9); border-radius: var(--cc-small-radius); background: rgba(23, 62, 53, .93); box-shadow: 5px 5px 0 rgba(10, 36, 28, .48); }
.cc-encounter > p:first-child { margin: 0; color: var(--cc-gold); font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.cc-encounter h2 { margin: 6px 0; font-family: "LXGW WenKai", serif; font-size: 29px; }
.cc-encounter p { margin: 0; line-height: 1.55; }
.cc-event-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.cc-event-actions:empty { display: none; }
.cc-map-action .cc-event-option { flex: 1 1 180px; min-height: 52px; }

.cc-team-status { grid-column: 2; grid-row: 1; overflow: hidden; background-color: #dce9d6; background-image: var(--cc-button-paper-texture); }
.cc-team-heading { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 11px 5px; border-bottom: 1px solid rgba(23, 62, 53, .28); }
.cc-team-heading div { display: flex; align-items: baseline; gap: 8px; }
.cc-team-heading span { color: var(--cc-coral); font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.cc-team-heading strong { font-family: "LXGW WenKai", serif; font-size: 17px; }
.cc-team-heading p { display: flex; align-items: center; gap: 5px; margin: 0; color: var(--cc-muted); font-size: 9px; font-weight: 750; }
.cc-team-heading p i { width: 7px; height: 7px; border: 1px solid var(--cc-line); border-radius: 50%; background: var(--cc-forest); box-shadow: 0 0 0 2px rgba(46, 116, 88, .18); }
.cc-team-players { display: grid; grid-template-columns: minmax(168px, .92fr) minmax(230px, 1.35fr); grid-template-rows: repeat(2, 88px); grid-auto-flow: row; gap: 7px; padding: 7px 10px 9px; }
.cc-player { position: relative; min-width: 0; min-height: 0; display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 7px; border: 1px solid rgba(23, 62, 53, .62); border-radius: 9px 5px 9px 5px; background: var(--cc-paper-strong); box-shadow: 3px 3px 0 rgba(23, 62, 53, .18); }
.cc-player[data-seat="2"] { transform: rotate(.18deg); }
.cc-player[data-seat="3"] { transform: rotate(-.18deg); }
.cc-player[data-human="true"] { grid-row: 1 / span 2; grid-template-columns: 78px minmax(0, 1fr); border-width: 2px; border-color: var(--cc-line); background: var(--cc-gold-soft); box-shadow: 4px 4px 0 rgba(23, 62, 53, .3); transform: rotate(-.35deg); }
.cc-player[data-ghost="true"] .cc-player-avatar { filter: grayscale(.72); opacity: .74; }
.cc-player-portrait { position: relative; align-self: center; }
.cc-player-avatar { width: 54px; height: 54px; display: block; border: 2px solid var(--cc-line); border-radius: 12px 7px 12px 7px; object-fit: cover; background: var(--cc-gold-soft); box-shadow: 2px 2px 0 rgba(23, 62, 53, .3); }
.cc-player[data-human="true"] .cc-player-avatar { width: 78px; height: 78px; border-width: 3px; }
.cc-player-portrait > span { position: absolute; right: -3px; bottom: -3px; padding: 2px 4px; border: 1px solid var(--cc-line); border-radius: 3px; color: var(--cc-paper-strong); background: var(--cc-forest); font-size: 7px; font-weight: 850; white-space: nowrap; }
.cc-player[data-human="true"] .cc-player-portrait > span { color: var(--cc-paper-strong); background: var(--cc-coral); }
.cc-player-info { min-width: 0; }
.cc-player header { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.cc-player-contribution { flex: 0 0 auto; color: var(--cc-muted); font-size: 8px; }
.cc-player h3 { order: -1; margin: 0; overflow: hidden; font-size: 13px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.cc-player header span { display: none; }
.cc-player[data-human="true"] h3 { font-size: 15px; }
.cc-player-score-row { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 3px; }
.cc-player-coins { display: flex; align-items: baseline; gap: 3px; color: #946015; font-family: "LXGW WenKai", serif; font-variant-numeric: tabular-nums; }
.cc-player-coins strong { font-size: 21px; line-height: 1; }
.cc-player-coins small { font-family: inherit; font-size: 9px; }
.cc-player-vitals { margin-top: 5px; }
.cc-player-block { padding: 2px 4px; border: 1px solid var(--cc-line); border-radius: 3px; color: var(--cc-paper-strong); background: var(--cc-forest); font-size: 8px; white-space: nowrap; }
.cc-health { display: block; position: relative; width: 100%; min-width: 0; height: 20px; overflow: hidden; border: 1px solid var(--cc-line); border-radius: 4px; background: #d6d8c9; }
.cc-health-fill { position: absolute; inset: 0 auto 0 0; background: #aec29b; }
.cc-health[data-low="true"] .cc-health-fill { background: #e9a282; }
.cc-health b { position: relative; display: block; padding: 0 3px; color: var(--cc-ink); font-size: 10px; line-height: 18px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }

.cc-table { grid-column: 2; grid-row: 2; padding: 16px; background: var(--cc-paper); }
.cc-table-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--cc-line); }
.cc-table-heading[data-duel="true"] { margin: -4px -4px 16px; padding: 14px 16px; border: 3px solid #8f3f30; border-left-width: 9px; border-radius: var(--cc-small-radius); background: #f8dfcf; box-shadow: 4px 4px 0 rgba(143, 63, 48, .2); }
.cc-table-heading[data-duel="true"] .cc-action-guide > p { color: #8f3f30; letter-spacing: .12em; }
.cc-table-heading p { margin: 0; color: var(--cc-muted); font-size: 11px; font-weight: 800; }
.cc-table-heading h2 { margin: 4px 0 0; font-family: "LXGW WenKai", serif; font-size: 26px; }
.cc-action-guide > span { display: block; max-width: 440px; margin-top: 5px; color: var(--cc-muted); font-size: 11px; line-height: 1.45; }
.cc-resource-section { padding: 10px 11px 12px; border-top: 1px solid rgba(23, 62, 53, .28); }
.cc-resource-section > span { display: block; margin-bottom: 7px; color: var(--cc-muted); font-size: 11px; font-weight: 800; }
.cc-resources { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cc-resource {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 6px;
    border: 1px solid var(--cc-line);
    border-radius: 5px;
    background: #dce9d6;
    text-align: center;
}
.cc-resource-icon { width: 28px; height: 28px; display: block; object-fit: contain; border-radius: 4px; }
.cc-resource b { display: block; font-size: 15px; line-height: 1; font-variant-numeric: tabular-nums; }
.cc-resource small { font-size: 10px; line-height: 1.4; white-space: nowrap; }
/* Symbols remain separate buttons from the stretched route/event action. */
.cc-app .cc-resource-chip {
    position: relative;
    z-index: 2;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 3px 5px;
    appearance: none;
    border: 0;
    border-radius: 5px;
    background: transparent;
    box-shadow: none;
    color: var(--cc-ink);
    font: inherit;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    cursor: help;
    touch-action: manipulation;
}
.cc-resource-chip .cc-resource-icon { width: 32px; height: 32px; }
.cc-resource-chip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.cc-resource-chip:hover { background: rgba(229, 185, 69, .18); }
.cc-resource-chip:focus-visible { outline: 2px solid var(--cc-forest); outline-offset: 1px; }
.cc-symbol-tooltip { position: fixed; z-index: 100; max-width: min(260px, calc(100vw - 16px)); padding: 9px 12px; border: 1px solid var(--cc-gold-soft); border-radius: 5px; color: var(--cc-paper-strong); background: var(--cc-forest-dark); box-shadow: 0 3px 10px #173e3540; font-size: 14px; line-height: 1.5; }
.cc-symbol-tooltip strong { display: block; margin-bottom: 4px; color: inherit; font-size: 16px; }
.cc-symbol-tooltip p { margin: 0; color: inherit; font-size: 14px; line-height: 1.6; }
.cc-help-heading { display: flex; align-items: center; gap: 4px; }
.cc-app .cc-help-button {
    min-height: 44px;
    min-width: 44px;
    padding: 4px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    box-shadow: none;
    color: var(--cc-forest-dark);
    font: inherit;
    cursor: help;
    touch-action: manipulation;
}
.cc-app .cc-help-button { font-size: 16px; font-weight: 800; }
.cc-app .cc-resource { color: var(--cc-ink); font: inherit; box-shadow: none; cursor: help; touch-action: manipulation; }
.cc-app [data-symbol]:focus-visible { outline: 2px solid var(--cc-forest); outline-offset: 2px; }
.cc-app .cc-help-button:hover { background: rgba(229, 185, 69, .18); }
.cc-resource-fallback { font-size: 10px; font-weight: 800; }
.cc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.cc-card footer > span { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cc-choice-sep { color: var(--cc-muted); }
.cc-combat,
.cc-danger { margin: 14px 0; padding: 13px; border-radius: var(--cc-radius); }
/* One illustrated encounter on the map for ordinary battles and duels. */
.cc-combat { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(580px, calc(100% - 48px)); padding: 0; overflow: hidden; border: 3px solid var(--cc-line); border-radius: 9px; color: var(--cc-ink); background: var(--cc-paper-strong); box-shadow: 7px 7px 0 rgba(13, 43, 34, .55); }
.cc-enemy-scene { position: relative; height: 100px; overflow: hidden; border-bottom: 3px solid var(--cc-line); background: var(--cc-gold-soft); }
.cc-enemy-scene img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.cc-enemy-details { padding: 18px 22px 20px; background-image: var(--cc-button-paper-texture); }
.cc-enemy-details p { margin: 0; font-size: 12px; color: var(--cc-muted); line-height: 1.6; }
.cc-enemy-details .cc-enemy-kicker { color: var(--cc-coral); font-weight: 800; letter-spacing: .12em; }
.cc-enemy-details h2 { margin: 4px 0; font-family: "LXGW WenKai", serif; font-size: clamp(28px, 3vw, 42px); line-height: 1.15; }
.cc-enemy-health-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 14px 0 6px; font-size: 12px; font-weight: 800; }
.cc-enemy-health-heading strong { font-size: 26px; color: #913e2f; font-variant-numeric: tabular-nums; }
.cc-enemy-health { height: 23px; overflow: hidden; border: 2px solid #713c2d; border-radius: 5px; background: #e1c9b2; }
.cc-enemy-health > span { display: block; height: 100%; background: #b94e3c; box-shadow: inset 0 3px 0 rgba(255, 235, 203, .35); transition: width 550ms cubic-bezier(.22, .8, .3, 1); }
.cc-enemy-details .cc-enemy-hint { margin-top: 12px; }
.cc-enemy-details .cc-enemy-control { margin-top: 8px; padding: 6px 10px; border-left: 3px solid #5c7387; border-radius: 4px; color: #3f4d5a; background: #e7edf2; font-weight: 700; }
.cc-enemy-damage { position: absolute; right: 22px; top: 35%; color: #fffaf0; font-size: 62px; font-weight: 900; text-shadow: 3px 3px 0 #913e2f, -2px -2px 0 #913e2f, 2px -2px 0 #913e2f, -2px 2px 0 #913e2f; animation: cc-damage-rise 700ms ease-out both; }
@keyframes cc-damage-rise { from { opacity: 0; transform: translateY(22px) scale(.8); } 22%, 80% { opacity: 1; } to { opacity: 0; transform: translateY(-30px) scale(1.12); } }

.cc-danger-deck { width: calc((100% - 10px) / 2 - 12px); max-width: 164px; margin: 12px 0 0; }
.cc-app .cc-danger-deck-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 8px 10px; border: 1px solid #b8846d; border-radius: 6px; color: #743526; background: #f8eadb; background-image: var(--cc-button-paper-texture); text-align: left; font: inherit; cursor: pointer; touch-action: manipulation; }
.cc-danger-deck-button > span:last-child { min-width: 0; }
.cc-danger-deck-button > span > b { display: block; font-family: "LXGW WenKai", serif; font-size: 16px; line-height: 1.4; }
.cc-danger-deck-button small { display: block; margin-top: 3px; font-size: 10px; line-height: 1.4; white-space: nowrap; }
.cc-danger-deck-button:focus-visible { outline: 3px solid var(--cc-ink); outline-offset: 3px; }
.cc-danger-stack { position: relative; flex: 0 0 23px; width: 23px; height: 31px; margin: 0 3px 3px 0; }
.cc-danger-stack > i,
.cc-danger-stack > span { position: absolute; inset: 0; display: grid; place-content: center; border: 1px solid #8f3f30; border-radius: 3px; }
.cc-danger-stack > i { background: #d9b89b; }
.cc-danger-stack > i:first-child { transform: translate(4px, 4px) rotate(3deg); }
.cc-danger-stack > i:nth-child(2) { transform: translate(2px, 2px) rotate(-2deg); background: #efd3b6; }
.cc-danger-stack > span { color: var(--cc-paper-strong); background-color: #934938; background-image: var(--cc-button-cloth-texture); text-align: center; }
.cc-danger-stack b { font-size: 18px; line-height: 1; }
.cc-danger-stack[data-empty="true"] { opacity: .46; }
.cc-danger-feedback { min-width: 0; padding-top: 10px; border-top: 1px solid #c8b8a0; }
.cc-danger-feedback > p { margin: 0 0 8px; color: #743526; font-size: 12px; line-height: 1.5; }
.cc-danger-reveal { min-width: 0; }
.cc-danger-reveal > p { margin: 0 0 8px; color: var(--cc-muted); font-size: 11px; line-height: 1.5; }
.cc-danger-reveal > div { display: grid; gap: 6px; }
.cc-danger-reveal-card { display: grid; grid-template-columns: 100px minmax(0, 1fr) 12px; align-items: center; gap: 2px 10px; width: 100%; min-width: 0; min-height: 54px; padding: 7px 9px; border: 1px solid #b9c6ad; border-radius: 4px; color: var(--cc-ink); background: #edf2df; text-align: left; cursor: pointer; touch-action: manipulation; }
.cc-danger-reveal-card > small { grid-column: 1; font-size: 11px; line-height: 1.4; color: var(--cc-muted); }
.cc-danger-reveal-card > b { grid-column: 1; font-family: "LXGW WenKai", serif; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.cc-danger-reveal-card > .cc-danger-recipient { grid-column: 2; grid-row: 1 / span 2; font-size: 12px; line-height: 1.5; }
.cc-danger-reveal-card > span:last-child { display: none; }
.cc-danger-reveal-card::after { content: "↗"; grid-column: 3; grid-row: 1 / span 2; font-size: 14px; }
.cc-danger-reveal-card:focus-visible { outline: 3px solid var(--cc-ink); outline-offset: 3px; }
.cc-danger-reveal-card:hover { background: var(--cc-paper-strong); }
.cc-danger-deal-track { display: flex; flex-wrap: wrap; gap: 5px 12px; padding-top: 6px; }
.cc-danger-dealt-card { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; padding: 5px 8px; border-left: 3px solid #6d8964; color: var(--cc-ink); background: #edf2df; animation: cc-danger-deal 620ms cubic-bezier(.2, .78, .22, 1) calc(var(--deal-index) * 150ms) both; }
.cc-danger-dealt-card small { font-size: 12px; }
.cc-danger-dealt-card b { font-size: 13px; }
.cc-danger-reveal-card[data-tone="danger"],
.cc-danger-dealt-card[data-tone="danger"] { border-color: #a76754; color: #743526; background: #f8e4d8; }
.cc-danger-reveal-card[data-tone="coin"],
.cc-danger-dealt-card[data-tone="coin"] { background: #f5e9c7; }
.cc-danger-reveal-card[data-tone="hazard"],
.cc-danger-dealt-card[data-tone="hazard"] { border-color: #7d8794; color: #3f4d5a; background: #e6ebf0; }
.cc-danger-deck[data-motion="peek"] .cc-danger-stack > span { animation: cc-danger-peek 720ms cubic-bezier(.2, .78, .22, 1); }
.cc-danger-deck[data-motion="move"] .cc-danger-stack > span { animation: cc-danger-move 760ms cubic-bezier(.2, .78, .22, 1); }
.cc-danger-deck[data-motion="shuffle"] .cc-danger-stack > i:first-child { animation: cc-danger-shuffle 700ms cubic-bezier(.2, .78, .22, 1); }
.cc-danger-deck[data-motion="shuffle"] .cc-danger-stack > i:nth-child(2) { animation: cc-danger-shuffle 700ms 90ms cubic-bezier(.2, .78, .22, 1) reverse; }
.cc-danger-deck[data-motion="shuffle"] .cc-danger-stack > span { animation: cc-danger-shuffle 700ms 45ms cubic-bezier(.2, .78, .22, 1); }
.cc-danger { border: 1px solid #cfaa93; border-left: 4px solid var(--cc-coral); border-radius: 12px; background: #fcf1e4; box-shadow: 0 3px 0 #bd5b4510; }
.cc-danger h3 { margin: 0 0 6px; }
.cc-danger-heading { display: flex; gap: 12px; align-items: flex-start; }
.cc-danger-heading > span { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border: 1px solid #cc9b78; border-radius: 50%; background: #f3dbbe; color: #8b4933; font-weight: 800; }
.cc-danger-heading p { margin: 0; font-size: 13px; line-height: 1.7; color: #775643; }
.cc-danger-actions { display: grid; gap: 12px; margin-top: 16px; }
.cc-defuse-option { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px 12px; align-items: center; padding: 14px; border: 1px solid #a5bd9b; border-radius: 9px; background: #f2f6e9; }
.cc-defuse-option img { width: 56px; height: 56px; object-fit: contain; }
.cc-defuse-option small { display: block; font-size: 11px; color: var(--cc-forest); }
.cc-defuse-option strong { display: block; margin: 3px 0; font-size: 17px; }
.cc-defuse-option p, .cc-take-hit p { margin: 0; font-size: 12px; line-height: 1.7; color: var(--cc-muted); }
.cc-defuse-option .cc-defuse-button { grid-column: 1 / -1; color: var(--cc-paper-strong); background: var(--cc-forest); border-color: var(--cc-forest); box-shadow: 0 2px 0 var(--cc-forest-dark); }
.cc-take-hit { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.cc-take-hit p { flex: 1 1 180px; }
.cc-danger[data-can-defuse="true"] .cc-take-hit { padding-top: 12px; border-top: 1px solid #dcc8b2; }
.cc-danger .cc-take-hit-button { flex: 0 0 auto; box-shadow: none; border: 1px solid #ba8f78; background: transparent; font-size: 13px; }
.cc-danger-actions button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #8f3f30;
    border-radius: var(--cc-small-radius);
    color: #743526;
    padding: 8px 13px;
    background-color: #fff2e5;
    background-image: var(--cc-button-paper-texture);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8), inset 0 -3px 0 rgba(143, 63, 48, .14), 3px 3px 0 rgba(143, 63, 48, .25);
    font-weight: 750;
    line-height: 1.15;
    text-align: center;
}
.cc-hand-section,
.cc-market-section { margin-top: 18px; }
.cc-app[data-duel="true"] .cc-hand-section { padding-top: 14px; border-top: 3px solid var(--cc-gold); }
.cc-hand-section > header,
.cc-market-section > header { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.cc-hand-section > header > div > p { margin: -4px 0 8px; color: var(--cc-muted); font-size: 10px; line-height: 1.45; }
.cc-hand-actions > strong { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--cc-line); border-radius: 4px; color: var(--cc-forest); background: #dce9d6; font-size: 12px; white-space: nowrap; }
.cc-hand-section h3,
.cc-market-section h3 { margin: 0 0 8px; font-size: 14px; letter-spacing: .03em; }
.cc-market-section header p { margin: 0 0 8px; color: var(--cc-muted); font-size: 10px; text-align: right; }
.cc-market-help b { color: var(--cc-ink); }
.cc-recruit-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; list-style: none; margin: 2px 0 14px; padding: 0; }
.cc-recruit-flow li { position: relative; min-width: 0; padding: 8px 6px; border: 1px solid #bdc9b3; border-radius: 5px; background: #edf2e3; text-align: center; }
.cc-recruit-flow li + li::before { content: '→'; position: absolute; left: -16px; top: 16px; color: var(--cc-forest); }
.cc-recruit-flow b { display: block; font-size: 12px; }
.cc-recruit-flow span { display: block; margin-top: 4px; font-size: 10px; color: var(--cc-muted); }
.cc-recruit-receipt { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px; border: 2px solid var(--cc-forest); border-radius: 6px; background: #f5edc9; scroll-margin-block: 80px; animation: cc-recruited 600ms ease-out; }
.cc-recruit-receipt:focus { outline: 3px solid var(--cc-gold); outline-offset: 2px; }
.cc-recruit-receipt img { flex: 0 0 72px; object-fit: contain; border-radius: 4px; }
.cc-recruit-receipt div { min-width: 0; }
.cc-recruit-receipt strong { font-size: 14px; }
.cc-recruit-receipt p { margin: 6px 0; font-size: 12px; line-height: 1.6; }
.cc-recruit-receipt small { font-size: 11px; color: var(--cc-muted); }
.cc-card-row { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 0 4px 8px 0; }
.cc-card-row[data-context="market"] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    overflow: visible;
    padding: 2px 6px 38px 0;
}
.cc-card-row[data-context="hand"] { --fan-card-width: 140px; position: relative; display: block; height: 424px; min-height: 424px; margin: 0; padding: 0; overflow: visible; isolation: isolate; }
.cc-card-row[data-context="hand"] .cc-card { position: absolute; top: calc(96px + var(--fan-arc, 0px)); left: calc(30px + (100% - var(--fan-card-width) - 60px) * var(--fan-position, .5)); width: var(--fan-card-width); max-width: none; min-width: 0; height: 300px; min-height: 300px; padding: 8px; transform: rotate(var(--fan-angle, 0deg)) scale(.84); transform-origin: 50% 90%; z-index: var(--fan-order, 1); scroll-margin-top: 80px; border-radius: 12px; box-shadow: inset 0 0 0 2px #e9d8ac, 3px 4px 0 var(--cc-shadow); transition: transform 180ms ease, top 180ms ease, box-shadow 180ms ease; }
.cc-card-row[data-context="hand"] .cc-card[data-fan-selected="true"] { top: 16px; width: 180px; height: 340px; min-height: 340px; left: clamp(12px, calc(10px + (100% - var(--fan-card-width) - 60px) * var(--fan-position, .5)), calc(100% - 192px)); transform: none; z-index: 50; border-color: #bd8631; box-shadow: inset 0 0 0 2px #f3dfa1, 0 8px 16px #173e3538; }
.cc-card-row[data-context="hand"] .cc-card:not([data-fan-selected="true"]) footer > button,
.cc-card-row[data-context="hand"] .cc-card:not([data-fan-selected="true"]) .cc-healing-choice { display: none; }
.cc-app .cc-hand-controls { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 10px; margin: 0 auto 10px; max-width: 340px; }
.cc-hand-controls[hidden] { display: none; }
.cc-app .cc-hand-controls button { width: 44px; min-height: 44px; padding: 0; border: 1px solid #91a38c; border-radius: 6px; color: var(--cc-forest); background: #edf2e3; box-shadow: 1px 2px 0 #b2c5ac; font: inherit; font-size: 22px; cursor: pointer; touch-action: manipulation; }
.cc-hand-controls svg { display: block; width: 20px; height: 20px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cc-hand-controls > span { color: var(--cc-forest); font-size: 12px; text-align: center; }
.cc-card-row[data-context="hand"] > .cc-empty { padding-top: 100px; text-align: center; }
.cc-app .cc-card[data-context="hand"] .cc-card-inspect { position: static; transform: none; flex: 1 0 auto; display: flex; flex-direction: column; gap: 4px; justify-content: start; align-items: center; min-height: 0; width: 100%; }
.cc-card[data-context="hand"] .cc-card-art { position: static; width: min(100%, 128px); height: auto; aspect-ratio: 1; margin: 0; border: 1px solid #c7b98c; border-radius: 8px; object-fit: contain; }
.cc-card[data-context="hand"] .cc-card-identity { justify-content: center; flex-wrap: wrap; gap: 3px; font-size: 10px; }
.cc-card[data-context="hand"] .cc-card-inspect > strong { margin: 0; font-size: 15px; line-height: 1.3; text-align: center; }
.cc-card[data-context="hand"] .cc-card-stats { justify-content: center; flex-wrap: wrap; min-height: 0; margin: 2px 0; }
.cc-card[data-context="hand"] .cc-card-stats > span { display: flex; gap: 3px; align-items: center; }
.cc-card[data-context="hand"] .cc-card-stats small { font-size: 10px; }
.cc-card[data-context="hand"] .cc-card-description { flex: 0; min-height: 0; font-size: 12px; font-weight: 400; line-height: 1.5; text-align: center; }
.cc-card[data-context="hand"] .cc-card-inspect-hint { position: static; max-width: 100%; margin-top: auto; padding: 3px 0 0; border: 0; color: var(--cc-forest); background: transparent; font-size: 10px; line-height: 1.4; text-align: center; }
.cc-card[data-context="hand"] footer { margin-top: 6px; gap: 5px; flex-wrap: wrap; align-items: center; }
.cc-card[data-context="hand"] .cc-card-energy { position: absolute; z-index: 2; top: 4px; left: 4px; min-height: 24px; padding: 3px 6px; border: 1px solid var(--cc-line); border-radius: 12px; color: var(--cc-paper-strong); background: var(--cc-forest); font-size: 10px; line-height: 1.4; white-space: nowrap; pointer-events: none; }
.cc-card[data-context="hand"] footer > button { width: 100%; min-width: 44px; }
@media (min-width: 1300px) {
    .cc-app:is([data-phase="combat"], [data-phase="danger_response"]) .cc-game { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
    .cc-app:is([data-phase="combat"], [data-phase="danger_response"]) .cc-region-track { grid-template-columns: repeat(2, minmax(62px, 1fr)); }
}
@media (max-width: 640px) {
    .cc-card-row[data-context="hand"] .cc-card { padding: 6px; border-radius: 9px; }
    .cc-card[data-context="hand"] .cc-card-inspect > strong { font-size: 12px; }
    .cc-card[data-context="hand"] .cc-card-identity { font-size: 9px; }
    .cc-card[data-context="hand"] .cc-card-description { font-size: 11px; line-height: 1.4; }
    .cc-card[data-context="hand"] .cc-card-stats { gap: 3px; }
    .cc-card[data-context="hand"] .cc-card-stats svg { width: 14px; height: 16px; }
    .cc-card[data-context="hand"] footer > button { padding: 6px 3px; font-size: 10px; }
    .cc-card[data-context="hand"] .cc-card-energy { padding: 2px 4px; font-size: 9px; }
}
#ccHandTitle { scroll-margin-top: 80px; }
.cc-hand-section > header { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
.cc-hand-section > header > div:not(.cc-hand-actions) { display: contents; }
.cc-hand-section > header > div > p { order: 1; flex: 0 0 100%; }
.cc-hand-section > header > .cc-hand-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 0 0 8px auto; }
.cc-hand-actions .cc-primary { min-height: 44px; padding: 8px 14px; font-size: 14px; white-space: nowrap; }
.cc-app:is([data-phase="combat"], [data-phase="danger_response"]) .cc-command-bar { position: static; width: auto; }
.cc-card-preview { margin: 8px 0; padding: 8px; color: var(--cc-ink); background: var(--cc-gold-soft); font-size: 13px; }
.cc-card[data-context="hand"] .cc-card-unavailable { margin: 6px 0; color: #913e2f; }
.cc-card-row[data-context="hand"] .cc-card[data-playing="true"] { pointer-events: none; outline: 3px solid var(--cc-gold); }
.cc-card-row[data-context="hand"] .cc-card[data-accepted="true"] { opacity: 0; }
.cc-healing-targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.cc-healing-targets .cc-healing-target { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; min-height: 60px; margin: 0; font-size: 12px; }
.cc-healing-target img { width: 32px; height: 32px; border-radius: 6px; }
.cc-healing-target small { display: block; font-size: 10px; }
.cc-healing-target .cc-target-selected { width: 100%; visibility: hidden; font-size: 11px; }
.cc-healing-target[aria-pressed="true"] .cc-target-selected { visibility: visible; }
.cc-app .cc-healing-choice { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin-top: 6px; padding: 4px; border: 1px dashed var(--cc-forest); border-radius: 6px; background: #edf2e3; color: var(--cc-ink); box-shadow: none; font-size: 12px; line-height: 1.3; }
.cc-healing-choice svg { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cc-healing-choice small { display: block; font-size: 10px; color: var(--cc-forest); }
.cc-healing-target[aria-pressed="true"] { outline: 3px solid var(--cc-coral); outline-offset: -3px; background: var(--cc-gold-soft); }
.cc-team-intent { min-width: 0; margin: 0; padding: 0; border: 0; }
.cc-team-intent { --cc-intent-color: #2e7458; }
.cc-team-intent[data-intent="attack"] { --cc-intent-color: #a64532; }
.cc-team-intent[data-intent="defend"] { --cc-intent-color: #355d88; }
.cc-team-intent[data-intent="support"] { --cc-intent-color: #746022; }
.cc-segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; padding: 3px; border: 1px solid #b9c5b1; border-radius: 9px; background: #e7ebdc; }
.cc-segmented label { position: relative; min-width: 0; cursor: pointer; }
.cc-segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cc-segmented span { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 0 14px; border-radius: 6px; color: #52675b; font-size: 13px; white-space: nowrap; transition: background 140ms, color 140ms; }
.cc-segmented input:checked + span { color: var(--cc-paper-strong); background: var(--cc-intent-color); box-shadow: 0 2px 2px #173e3520; }
.cc-segmented svg { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cc-team-intent .cc-intent-hint { border-left: 3px solid var(--cc-intent-color); padding-left: 9px; }
.cc-segmented input:focus-visible + span { outline: 3px solid var(--cc-gold); outline-offset: 2px; }
.cc-segmented input:disabled + span { opacity: .55; cursor: wait; }
.cc-segmented label:hover input:not(:checked):not(:disabled) + span { background: #d7dfca; }
.cc-segmented small { font-family: sans-serif; font-size: 18px; line-height: 1; }
.cc-damage-summary { position: relative; margin: 12px 0 0; padding: 11px 14px 11px 38px; border: 1px solid #c4d2b8; border-radius: 8px; background: #edf2e3; color: var(--cc-ink); font-size: 13px; line-height: 1.7; white-space: pre-line; max-height: 130px; overflow: auto; }
.cc-damage-summary::before { content: ""; position: absolute; left: 15px; top: 16px; width: 9px; height: 9px; border: 2px solid var(--cc-forest); border-radius: 50%; background: #c7dcb3; }
.cc-turn-risk { margin: 0 0 14px; font-size: 12px; line-height: 1.7; color: #913e2f; }
.cc-team-intent { margin: 0 0 18px; padding: 14px 16px 10px; border: 1px solid #c8c9ac; border-radius: 10px; background: #fffaf070; }
.cc-team-intent legend { padding: 0 7px; color: var(--cc-ink); font-size: 13px; font-weight: 700; }
.cc-team-intent .cc-segmented { max-width: 460px; }
.cc-intent-hint { margin: 9px 0 0; font-size: 12px; line-height: 1.7; color: var(--cc-muted); }
.cc-card[data-recruited="true"] { outline: 3px solid var(--cc-gold); outline-offset: 2px; background: #f5edc9; animation: cc-recruited 600ms ease-out; }
@keyframes cc-recruited { from { transform: translateY(5px); box-shadow: 0 0 0 8px #e5b94550; } to { transform: translateY(0); box-shadow: 0 0 0 0 #e5b94500; } }
@media (max-width: 640px) {
    .cc-team-intent { padding: 10px; }
    .cc-segmented span { padding: 0 10px; }
}
.cc-app:is([data-phase="combat"], [data-phase="danger_response"]) #ccActionGuide { display: none; }
.cc-app:is([data-phase="combat"], [data-phase="danger_response"]) .cc-table { display: flex; flex-direction: column; }
.cc-app:is([data-phase="combat"], [data-phase="danger_response"]) .cc-card-table { order: -2; }
.cc-app:is([data-phase="combat"], [data-phase="danger_response"]) #ccCommandBar { order: -1; }
.cc-card-table { min-width: 0; }
.cc-player-piles { min-width: 0; margin: 0 0 16px; scroll-margin-top: 84px; }
.cc-pile-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cc-app .cc-pile { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; min-height: 86px; padding: 10px; border: 2px solid var(--cc-forest); border-radius: 8px; color: var(--cc-ink); background: #edf2e3; background-image: var(--cc-button-paper-texture); box-shadow: 2px 3px 0 #b2c5ac; font: inherit; text-align: left; text-shadow: none; cursor: pointer; touch-action: manipulation; transition: background-color 160ms, transform 160ms; }
.cc-app .cc-pile-discard { border-color: #916630; background-color: #faefd7; box-shadow: 2px 3px 0 #d5be94; }
.cc-pile-art { display: block; width: 36px; height: 44px; fill: var(--cc-forest); stroke: var(--cc-paper-strong); stroke-width: 1.6; stroke-linejoin: round; }
.cc-pile-art > path:first-child { fill: #c1d2b4; stroke: var(--cc-forest); }
.cc-pile-art .cc-pile-emblem { fill: none; stroke: var(--cc-gold-soft); stroke-width: 2; }
.cc-pile-discard .cc-pile-art { fill: var(--cc-paper-strong); stroke: #916630; }
.cc-pile-discard .cc-pile-art > path:first-child { fill: #e7d3a8; stroke: #916630; }
.cc-pile-discard .cc-pile-emblem { stroke: #916630; }
.cc-pile-copy b { display: block; font-family: "LXGW WenKai", serif; font-size: 18px; line-height: 1.3; }
.cc-pile-copy small { display: block; margin-top: 5px; font-size: 11px; line-height: 1.4; }
.cc-pile-count { min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; }
.cc-pile-count strong { display: block; font-family: ui-sans-serif, sans-serif; font-size: 30px; line-height: 1.1; }
.cc-pile-count small { display: block; margin-top: 3px; font-size: 10px; white-space: nowrap; }
.cc-pile[data-empty="true"] .cc-pile-art { opacity: .55; }
.cc-pile-status { margin: 9px 0 0; color: var(--cc-muted); font-size: 12px; line-height: 1.5; }
.cc-app .cc-pile:focus-visible { outline: 3px solid var(--cc-ink); outline-offset: 4px; }
.cc-app .cc-pile:active:not(:disabled) { transform: translateY(2px); }
.cc-pile[data-changed="true"] .cc-pile-count { animation: cc-pile-change 750ms ease-out; }
@keyframes cc-pile-change { 30% { color: #8f3f30; transform: scale(1.16); } }
@media (hover: hover) {
    .cc-app .cc-pile:hover:not(:disabled) { background-color: #dce8ce; }
    .cc-app .cc-pile-discard:hover:not(:disabled) { background-color: #f5dfa8; }
}
@media (max-width: 640px) {
    .cc-pile-buttons { gap: 8px; }
    .cc-app .cc-pile { grid-template-columns: minmax(0, 1fr) auto; gap: 5px; padding: 10px 8px; min-height: 78px; }
    .cc-pile-art { display: none; }
    .cc-pile-copy b { font-size: 17px; }
    .cc-pile-count strong { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    .cc-app .cc-pile { transition: none; }
    .cc-pile[data-changed="true"] .cc-pile-count { animation: none; }
}
.cc-app:is([data-phase="combat"], [data-phase="danger_response"]) .cc-team-heading span { padding: 3px 8px; border-radius: 4px; color: var(--cc-paper-strong); background: var(--cc-forest); font-size: 12px; }
.cc-app:is([data-phase="combat"], [data-phase="danger_response"]) .cc-combat { border-color: #a24c36; }
.cc-app:is([data-phase="combat"], [data-phase="danger_response"]) .cc-enemy-kicker { color: #a24c36; }
.cc-card-table { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.cc-pile-rail, .cc-play-area { min-width: 0; }
.cc-pile-rail .cc-player-piles { margin: 0; }
.cc-play-area { display: flex; flex-direction: column; gap: 14px; border-top: 1px dashed #849886; padding-top: 14px; }
.cc-play-area > section { min-width: 0; margin: 0; }
.cc-play-area .cc-hand-section { padding-top: 0; border-top: 0; }
@media (min-width: 1300px) {
    .cc-card-table { grid-template-columns: 180px minmax(0, 1fr); gap: 12px; }
    .cc-pile-buttons { grid-template-columns: minmax(0, 1fr); }
    .cc-danger-deck { width: calc(100% - 16px); }
    .cc-play-area { align-self: stretch; border-top: 0; border-left: 1px dashed #849886; padding-top: 0; padding-left: 12px; }
}
@media (max-width: 640px) {
    .cc-danger-deck { width: calc((100% - 8px) / 2 - 8px); }
    .cc-app .cc-danger-deck-button { gap: 7px; padding-inline: 7px; }
    .cc-danger-deck-button > span > b { font-size: 14px; }
    .cc-danger-deck-button small { font-size: 9px; }
    .cc-segmented span { padding-inline: 4px; gap: 3px; }
}
.cc-card {
    position: relative;
    flex: 0 0 min(190px, 64%);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    border: var(--cc-border);
    border-radius: var(--cc-small-radius);
    background: var(--cc-paper-strong);
    box-shadow: 3px 3px 0 var(--cc-shadow);
    scroll-snap-align: start;
}
@keyframes cc-card-cast { from { opacity: 1; transform: translateY(-24px) scale(1.03); } to { opacity: 0; transform: translate(-70px, -100px) rotate(-12deg) scale(.75); } }
.cc-card[data-playing="true"]::after {
    content: "出牌中";
    position: absolute;
    inset: 10px 10px auto auto;
    padding: 4px 6px;
    border: 1px solid var(--cc-line);
    border-radius: 3px;
    color: var(--cc-paper-strong);
    background: var(--cc-coral);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .06em;
}
.cc-card[data-kind="partner"] { border-top: 7px solid var(--cc-forest); background: #edf2df; }
.cc-card-art { width: calc(100% + 20px); height: 104px; margin: -10px -10px 8px; border-bottom: 2px solid var(--cc-line); object-fit: cover; object-position: center 42%; background: var(--cc-gold-soft); }
.cc-card-inspect { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0; border: 0; color: inherit; background: transparent; box-shadow: none; font: inherit; text-align: left; text-shadow: none; cursor: zoom-in; }
.cc-card-inspect:focus-visible { outline: 3px solid var(--cc-gold); outline-offset: 3px; }
.cc-card-inspect-hint { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 3px 5px; border: 1px solid rgba(255, 250, 240, .78); border-radius: 3px; color: var(--cc-paper-strong); background: rgba(23, 62, 53, .86); font-size: 8px; font-weight: 800; }
.cc-card-identity { display: flex; align-items: center; gap: 5px; color: var(--cc-coral); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.cc-card-identity span + span::before { margin-right: 5px; content: "·"; color: var(--cc-muted); }
.cc-card-identity small { margin-left: auto; padding: 2px 5px; border: 1px solid rgba(23, 62, 53, .3); border-radius: 3px; color: var(--cc-muted); font-size: 9px; letter-spacing: 0; }
.cc-card strong { margin: 5px 0; font-size: 14px; }
.cc-card-row[data-context="market"] .cc-card > strong { font-size: 16px; line-height: 1.25; }
.cc-card p { flex: 1; margin: 0; color: #53665d; font-size: 11px; line-height: 1.45; }
.cc-card-description { min-height: 33px; text-wrap: pretty; }
/* Open ink emblems keep every active attribute on one compact row. */
.cc-card-stats { min-height: 34px; display: flex; flex-wrap: nowrap; gap: 12px; margin: 5px 0 9px; }
.cc-card-stats > span { min-width: 0; display: grid; grid-template-columns: 18px auto; grid-template-rows: 20px 12px; align-items: center; column-gap: 4px; color: #984730; }
.cc-card-stats svg { width: 18px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cc-card-stats small { grid-column: 1 / -1; grid-row: 2; color: var(--cc-muted); font-size: 9px; line-height: 1; text-align: center; }
.cc-card-stats b { grid-column: 2; grid-row: 1; color: var(--cc-forest-dark); font-size: 17px; line-height: 1; font-variant-numeric: tabular-nums; }
.cc-card-stats [data-stat="defense"] { color: #476e57; }
.cc-card-stats [data-stat="heal"] { color: #857020; }
.cc-card-stats [data-stat="control"] { color: #685782; }
.cc-card[data-context="hand"] .cc-card-stats { gap: 8px; }
.cc-card footer { display: flex !important; justify-content: space-between; align-items: end; margin-top: 8px; }
.cc-card[data-context="market"] footer { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(23, 62, 53, .22); }
.cc-card-row[data-context="market"] .cc-card { width: 100%; min-width: 0; display: grid; grid-template-columns: clamp(64px, 5.5vw, 100px) minmax(0, 1fr); column-gap: 8px; row-gap: 2px; padding: 8px; min-height: 0; }
.cc-card-row[data-context="market"] .cc-card-art { grid-column: 1; grid-row: 1 / span 4; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; object-position: center; align-self: center; margin: 0; border: 1px solid rgba(23, 62, 53, .3); border-radius: 3px; }
.cc-card-row[data-context="market"] .cc-card-identity,
.cc-card-row[data-context="market"] .cc-card > strong,
.cc-card-row[data-context="market"] .cc-card-stats,
.cc-card-row[data-context="market"] .cc-card-description { grid-column: 2; }
.cc-card-row[data-context="market"] .cc-card-identity { flex-wrap: wrap; gap: 3px; font-size: 9px; }
.cc-card-row[data-context="market"] .cc-card-identity small { padding: 1px 3px; font-size: 8px; }
.cc-card-row[data-context="market"] .cc-card > strong { margin: 0; }
.cc-card-row[data-context="market"] .cc-card-stats { gap: 4px; margin: 1px 0 3px; }
.cc-card-row[data-context="market"] .cc-card-description { min-height: 0; font-size: 10px; }
.cc-card[data-context="market"] footer { grid-column: 1 / -1; margin-top: 5px; }
.cc-card-row[data-context="market"] .cc-card-stats > span { grid-template-columns: 16px auto; column-gap: 2px; }
.cc-card-row[data-context="market"] .cc-card-stats svg { width: 16px; }
.cc-card-row[data-context="market"] .cc-card-stats b { font-size: 15px; }
.cc-card-cost { position: relative; min-height: 48px; display: flex !important; flex-direction: row; align-items: center; justify-content: center; gap: 2px !important; padding: 0 6px 0 12px; border: 1px solid #b7954e; border-radius: 3px 8px 8px 3px; color: var(--cc-ink); background-color: #f4e4b6; background-image: var(--cc-button-paper-texture); box-shadow: 2px 2px 0 rgba(120, 91, 42, .18); }
.cc-card-cost::before { content: ""; position: absolute; left: 4px; top: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: #a4854d; }
.cc-card-cost > small { color: #685331; font-size: 9px; font-weight: 750; white-space: nowrap; }
.cc-card-cost > span { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 104px; }
.cc-card-cost[data-affordable="false"] { border-color: #ad6247; background-color: #f3d9c8; }
.cc-card-cost .cc-resource-chip { min-width: 44px; }
.cc-card-note { max-width: 90px; color: var(--cc-coral); font-size: 10px; font-weight: 800; line-height: 1.25; text-align: right; }
.cc-card footer > button {
    min-height: 44px;
    padding: 7px 12px;
    border: 1px solid var(--cc-line);
    border-radius: 5px;
    color: #fffaf0;
    background-color: var(--cc-forest);
    background-image: var(--cc-button-cloth-texture);
    box-shadow: inset 0 0 0 1px rgba(255, 250, 240, .17), inset 0 -2px 0 rgba(11, 48, 35, .42), 2px 2px 0 var(--cc-line);
    font-size: 11px;
    text-shadow: 0 1px 0 rgba(10, 40, 31, .66);
}
.cc-card[data-context="market"] footer > button { width: 100%; }
.cc-card footer > button:disabled,
.cc-primary:disabled,
.cc-secondary:disabled,
.cc-danger-confirm:disabled,
.cc-abandon-control:disabled,
.cc-route-list button:disabled,
.cc-event-option:has(.cc-choice-select:disabled),
.cc-danger-actions button:disabled {
    cursor: not-allowed;
    opacity: .46;
    filter: saturate(.4);
    box-shadow: inset 0 0 0 1px rgba(23, 62, 53, .12), 1px 1px 0 rgba(23, 62, 53, .28);
}
.cc-empty { min-height: 110px; display: grid; place-items: center; padding: 18px; border: 2px dashed rgba(23, 62, 53, .38); border-radius: var(--cc-small-radius); color: var(--cc-muted); background: rgba(255, 250, 240, .48); text-align: center; font-size: 11px; }
.cc-command-bar { display: flex !important; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 2px solid var(--cc-line); }
.cc-app[data-phase="route"] .cc-table-heading,
.cc-app[data-phase="event"] .cc-table-heading { display: none; }
.cc-command-bar:not(:has(button:not([hidden]))) { display: none !important; }


.cc-table > .cc-log { width: 100%; max-height: 220px; overflow: auto; margin: 12px 0 14px; padding: 7px 11px; border: 2px solid rgba(23, 62, 53, .48); border-left: 6px solid var(--cc-gold); border-radius: var(--cc-small-radius); background: var(--cc-paper-strong); box-shadow: 2px 2px 0 rgba(23, 62, 53, .16); }
.cc-log summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; }
.cc-log summary::-webkit-details-marker { display: none; }
.cc-log summary::after { content: "+"; color: var(--cc-coral); font-size: 20px; font-weight: 800; }
.cc-log[open] summary::after { content: "−"; }
.cc-log h2 { margin: 0; font-family: "LXGW WenKai", serif; font-size: 18px; }
.cc-log ol { padding: 0; margin: 14px 0 0; list-style: none; }
.cc-log li { position: relative; padding: 10px 0 10px 14px; border-bottom: 1px solid rgba(23, 62, 53, .24); font-size: 11px; line-height: 1.55; }
.cc-log li::before { content: ""; position: absolute; top: 15px; left: 0; width: 6px; height: 6px; border: 1px solid var(--cc-line); background: var(--cc-gold); transform: rotate(45deg); }
.cc-log li.cc-empty { padding: 18px; border: 2px dashed rgba(23, 62, 53, .38); }
.cc-log li.cc-empty::before { display: none; }

.cc-loading { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; gap: 18px; color: var(--cc-ink); text-align: center; background: var(--cc-paper); }
.cc-map-loading-art { display: block; width: 180px; height: 110px; margin: 0 auto 8px; overflow: visible; }
.cc-map-fold { transform-origin: center; stroke: var(--cc-line); stroke-width: 2; stroke-linejoin: round; animation: cc-map-unfold 2200ms ease-in-out infinite; }
.cc-map-loading-road { stroke: #b95a40; stroke-width: 3; stroke-dasharray: 5 5; animation: cc-map-road 1100ms linear infinite; }
@keyframes cc-map-unfold { 0%, 100% { transform: perspective(400px) rotateY(-25deg) scaleX(.62); } 45%, 70% { transform: perspective(400px) rotateY(0) scaleX(1); } }
@keyframes cc-map-road { to { stroke-dashoffset: -30; } }
.cc-loading strong { font-family: "LXGW WenKai", serif; font-size: 17px; }
.cc-action-loading {
    position: fixed;
    z-index: 45;
    left: 50%;
    top: 50%;
    min-width: min(310px, calc(100vw - 32px));
    display: grid;
    place-items: center;
    gap: 7px;
    padding: 19px 24px;
    border: 3px solid var(--cc-line);
    border-radius: 11px 6px 11px 6px;
    color: var(--cc-ink);
    background-color: var(--cc-paper-strong);
    background-image: var(--cc-button-paper-texture);
    box-shadow: 8px 8px 0 rgba(13, 43, 34, .58);
    text-align: center;
    transform: translate(-50%, -50%);
}
.cc-action-loading strong { font-family: "LXGW WenKai", serif; font-size: 18px; }
.cc-action-loading small { color: var(--cc-muted); font-size: 10px; }
.cc-ai-turn {
    position: fixed;
    inset: 0;
    z-index: 46;
    display: grid;
    place-items: end end;
    padding: 24px;
    pointer-events: none;
    background: rgba(23, 62, 53, .08);
}
.cc-ai-turn[data-mode="reaction"] { background: transparent; }
.cc-ai-turn[data-mode="reaction"] .cc-ai-turn-card { gap: 8px 12px; padding: 12px; }
.cc-ai-turn[data-mode="reaction"] .cc-ai-turn-player img { width: 48px; height: 48px; }
.cc-ai-turn[data-mode="reaction"] .cc-ai-turn-speech { margin: 0; }
.cc-ai-turn-card {
    width: min(440px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 13px 16px;
    align-items: center;
    padding: 18px;
    border: 3px solid var(--cc-line);
    border-left-width: 8px;
    border-radius: 12px 6px 12px 6px;
    color: var(--cc-ink);
    background-color: var(--cc-paper-strong);
    background-image: var(--cc-button-paper-texture);
    box-shadow: 9px 9px 0 rgba(13, 43, 34, .58);
    pointer-events: auto;
    animation: cc-ai-turn-in 220ms ease-out both;
}
.cc-ai-turn-player { grid-column: 1 / -1; display: flex; align-items: center; gap: 13px; }
.cc-ai-turn-player img { width: 72px; height: 72px; flex: 0 0 auto; border: 3px solid var(--cc-line); border-radius: 15px 8px 15px 8px; object-fit: cover; background: var(--cc-gold-soft); box-shadow: 3px 3px 0 rgba(23, 62, 53, .28); }
.cc-ai-turn-player p { margin: 0; color: var(--cc-coral); font-size: 10px; font-weight: 850; letter-spacing: .1em; }
.cc-ai-turn-player h2 { margin: 4px 0 0; font-size: 22px; line-height: 1.12; }
.cc-ai-turn-player h2 span { margin-right: .25em; font-family: "LXGW WenKai", serif; font-size: 28px; }
.cc-ai-turn-player small { display: block; margin-top: 5px; color: var(--cc-muted); font-size: 10px; font-weight: 750; }
.cc-ai-turn-speech { grid-column: 1 / -1; margin: 0; padding: 12px 15px; border-left: 4px solid var(--cc-gold); background: #f3e8c9; font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; font-size: 17px; line-height: 1.65; }
#ccAITurnName { font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; }
.cc-ai-turn[data-stage="handoff"] .cc-ai-turn-action { color: var(--cc-ink); background: var(--cc-gold-soft); }
.cc-ai-turn-action { min-height: 58px; display: flex; align-items: center; margin: 0; padding: 11px 13px; border: 2px solid rgba(23, 62, 53, .62); border-radius: 7px 4px 7px 4px; color: var(--cc-paper-strong); background: var(--cc-forest-dark); font-size: 14px; font-weight: 750; line-height: 1.45; }
.cc-ai-turn-action[data-changed="true"] { animation: cc-ai-action-step 180ms ease-out both; }
#ccAITurnSkip { min-width: 94px; min-height: 44px; padding-inline: 12px; }
.cc-ai-turn[data-player-id="ai-ink"] .cc-ai-turn-card { border-left-color: var(--cc-coral); }
.cc-ai-turn[data-player-id="ai-ginger"] .cc-ai-turn-card { border-left-color: var(--cc-gold); }
.cc-player[data-ai-active="true"] { z-index: 9; border: 3px solid var(--cc-coral); box-shadow: 0 0 0 4px rgba(229, 185, 69, .72), 5px 5px 0 rgba(23, 62, 53, .35); animation: cc-ai-seat-active 620ms ease-in-out infinite alternate; }
.cc-player[data-ai-active="true"]::after { content: "行动中"; position: absolute; z-index: 2; top: -11px; right: 7px; padding: 3px 7px; border: 2px solid var(--cc-line); border-radius: 3px; color: var(--cc-paper-strong); background: var(--cc-coral); font-size: 8px; font-weight: 850; letter-spacing: .06em; }
.cc-toast { position: fixed; z-index: 60; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); width: max-content; max-width: min(90vw, 520px); font-size: 14px; line-height: 1.5; transform: translateX(-50%); padding: 12px 18px; border: 2px solid var(--cc-paper-strong); border-radius: var(--cc-small-radius); color: #fffaf0; background: var(--cc-forest-dark); box-shadow: 5px 5px 0 rgba(23, 62, 53, .28); }
.cc-modal-backdrop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 18px; background: rgba(23, 62, 53, .72); }
.cc-card-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); border: 0; background: transparent; color: var(--cc-ink); overflow: hidden; }
.cc-card-dialog[open] { display: grid; place-items: center; }
.cc-card-dialog::backdrop { background: rgba(23, 62, 53, .72); }
.cc-bomb-impact { position: fixed; z-index: 85; inset: auto 16px max(22px, env(safe-area-inset-bottom)); width: min(340px, calc(100% - 32px)); margin-inline: auto; padding: 18px; border: 3px solid #8f3f30; border-radius: 12px; background: #fff1de; color: #743526; box-shadow: 6px 6px 0 #173e3555; text-align: center; pointer-events: none; animation: cc-bomb-hit 480ms ease-out; }
.cc-bomb-impact > strong { display: block; font-size: 18px; }
.cc-bomb-impact > b { display: block; margin-top: 5px; font-size: 34px; }
.cc-bomb-impact > p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.cc-bomb-burst { position: relative; width: 64px; height: 58px; margin: 0 auto 8px; }
.cc-bomb-burst svg { position: relative; z-index: 1; width: 64px; height: 64px; margin-top: -8px; }
.cc-bomb-burst::before, .cc-bomb-burst::after { content: ''; position: absolute; inset: 0; border: 3px solid #d57836; border-radius: 50%; animation: cc-bomb-ring 700ms ease-out both; }
.cc-bomb-burst::after { inset: 8px; animation-delay: 90ms; border-color: #b94731; }
@keyframes cc-bomb-hit { 0% { transform: scale(.92); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 65% { transform: translateX(-3px); } 100% { transform: none; } }
@keyframes cc-bomb-ring { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .cc-bomb-impact { animation: none; }
    .cc-bomb-burst::before, .cc-bomb-burst::after { animation: none; opacity: .35; }
    .cc-segmented span { transition: none; }
}
body:has(.cc-card-dialog[open]) { overflow: hidden; }
.cc-card-dialog .cc-card-detail { width: min(700px, 100%); max-height: 100%; padding: 22px; overscroll-behavior: contain; }
.cc-card-detail-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 18px; }
.cc-card-detail-heading > div { min-width: 0; }
.cc-card-detail .cc-card-detail-heading h2 { margin: 0; font-size: clamp(24px, 4vw, 32px); line-height: 1.3; overflow-wrap: anywhere; }
.cc-card-detail-heading .cc-modal-close { flex: 0 0 auto; float: none; margin: 0; min-width: 64px; min-height: 44px; }
.cc-card-detail-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); gap: 22px; }
.cc-card-detail-face { min-width: 0; text-align: center; }
.cc-card-detail-face .cc-card-art { display: block; width: min(100%, 240px); height: auto; aspect-ratio: 1; object-fit: contain; margin: 0 auto 10px; border: 1px solid #c7b98c; border-radius: 8px; }
.cc-card-detail-face .cc-card-identity, .cc-card-detail-face .cc-card-stats { justify-content: center; flex-wrap: wrap; }
.cc-card-detail-face .cc-card-description { font-size: 14px; line-height: 1.6; }
.cc-card-detail-actions { min-width: 0; }
.cc-card-detail-cost { margin: 0 0 16px; font-size: 14px; font-weight: 800; }
.cc-healing-heading { margin: 0; font-size: 14px; }
.cc-card-detail .cc-card-preview { line-height: 1.8; border-radius: 6px; }
.cc-card-detail .cc-card-detail-play { width: 100%; min-height: 44px; margin-top: 10px; }
.cc-card-detail-error, .cc-card-detail .cc-card-unavailable { color: #913e2f; font-size: 13px; line-height: 1.5; }
.cc-card-detail .cc-healing-targets { gap: 6px; margin-bottom: 16px; }
.cc-card-detail .cc-healing-target { padding: 8px 3px; flex-direction: column; min-width: 0; }
@media (max-width: 540px) {
    .cc-card-dialog .cc-card-detail { padding: 16px 12px; }
    .cc-card-detail-heading { margin-bottom: 12px; }
    .cc-card-detail-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .cc-card-detail-face .cc-card-art { width: 148px; }
    .cc-card-detail-face .cc-card-description { margin: 6px 0; }
    .cc-card-detail-cost { margin-bottom: 10px; }
}
.cc-modal { width: min(640px, 100%); max-height: min(780px, 90dvh); overflow: auto; padding: 28px; border: 3px solid var(--cc-line); border-radius: var(--cc-radius); background: var(--cc-paper-strong); box-shadow: 9px 9px 0 rgba(10, 37, 29, .55); }
.cc-pile-detail.cc-modal { display: flex; flex-direction: column; width: min(760px, 100%); max-height: min(800px, 100%); overflow: hidden; padding: 18px; }
.cc-pile-detail .cc-card-detail-heading { flex: 0 0 auto; margin-bottom: 12px; }
.cc-pile-detail .cc-card-detail-heading h2 { margin: 0; font-size: clamp(23px, 4vw, 30px); line-height: 1.3; }
.cc-pile-detail-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 5px; }
#ccPileHint { margin: 0 0 16px; font-size: 14px; line-height: 1.8; }
#ccPileContent[data-context="discard"] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#ccPileContent[data-context="danger"] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cc-danger-preview-card { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 12px; border: 2px solid var(--cc-line); border-radius: 6px; color: var(--cc-ink); background: #edf2df; text-align: center; }
.cc-danger-preview-card small { font-size: 14px; line-height: 1.5; }
.cc-danger-preview-card img { width: 72px; height: 72px; object-fit: contain; }
.cc-danger-preview-card b { font-family: "LXGW WenKai", serif; font-size: 22px; line-height: 1.4; }
.cc-danger-preview-card span { font-size: 16px; line-height: 1.6; }
.cc-danger-preview-card[data-tone="danger"] { border-color: #8f3f30; color: #743526; background: #f8d7c8; }
.cc-danger-preview-card[data-tone="coin"] { background: var(--cc-gold-soft); }
.cc-danger-preview-card[data-tone="hazard"] { border-color: #6f7c8a; color: #3f4d5a; background: #e6ebf0; }
@media (max-width: 540px) {
    #ccPileContent[data-context="danger"] { grid-template-columns: minmax(0, 1fr); }
    .cc-danger-preview-card { position: relative; align-items: stretch; gap: 5px; padding: 12px; text-align: left; }
    .cc-danger-preview-card:has(img) { padding-right: 72px; }
    .cc-danger-preview-card img { position: absolute; top: 16px; right: 10px; width: 52px; height: 52px; }
    .cc-danger-preview-card b { font-size: 20px; }
}
#ccPileContent .cc-card { min-width: 0; min-height: 0; }
#ccPileContent .cc-card-art { width: 100%; height: auto; max-height: 144px; object-fit: contain; }
#ccPileContent .cc-card-energy { position: static; color: var(--cc-ink); background: transparent; }
#ccPileContent .cc-card-description { font-size: 13px; }
#ccPileContent .cc-empty { grid-column: 1 / -1; }
.cc-pile-detail .cc-pile-flow { gap: 8px; padding: 0; list-style: none; }
.cc-pile-detail .cc-pile-flow li { display: block; padding: 14px 12px; border-left: 4px solid var(--cc-forest); background: #edf2e3; font-size: 14px; line-height: 1.6; }
@media (max-width: 540px) {
    .cc-pile-detail.cc-modal { padding: 14px 10px; }
    #ccPileContent[data-context="discard"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
}
.cc-modal-kicker { margin: 0 0 7px; color: var(--cc-coral); font-family: ui-monospace, monospace; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.cc-modal h2 { margin: 0 0 18px; font-family: "LXGW WenKai", serif; font-size: 38px; line-height: 1.1; }
.cc-abandon-modal { width: min(500px, 100%); }
.cc-abandon-modal > p:not(.cc-modal-kicker) { margin: 0; color: var(--cc-muted); font-size: 13px; line-height: 1.7; }
.cc-abandon-notes { display: grid; gap: 7px; margin: 18px 0 22px; padding: 13px 14px; border-left: 5px solid var(--cc-coral); background: #fff0e4; font-size: 12px; line-height: 1.45; }
.cc-abandon-notes span::before { margin-right: 7px; content: "—"; color: var(--cc-coral); font-weight: 850; }
.cc-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.cc-modal-actions > button { min-width: 150px; padding: 9px 16px; }
.cc-danger-confirm { border: 2px solid #743526; color: var(--cc-paper-strong); background-color: #8f3f30; background-image: var(--cc-button-cloth-texture); box-shadow: inset 0 0 0 1px rgba(255, 250, 240, .18), inset 0 -3px 0 rgba(76, 24, 17, .32), 3px 3px 0 var(--cc-line); }
.cc-modal ol { display: grid; gap: 10px; padding-left: 22px; }
.cc-modal li { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; column-gap: 14px; padding: 8px 8px 10px; border-bottom: 1px solid rgba(23, 62, 53, .22); }
.cc-modal li b,
.cc-modal li span { display: block; }
.cc-modal li span { margin-top: 3px; color: var(--cc-muted); line-height: 1.65; }
.cc-rule-visual { grid-column: 1; grid-row: 1 / span 2; width: 120px; height: 82px; filter: drop-shadow(2px 2px 0 rgba(23, 62, 53, .16)); }
.cc-rule-paper { fill: #fff8e8; stroke: rgba(23, 62, 53, .48); stroke-width: 2; }
.cc-rule-land { fill: #d7e4bd; }
.cc-rule-road { fill: none; stroke: #fffaf0; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.cc-rule-ink,
.cc-rule-card-stack rect,
.cc-rule-card-stack path,
.cc-rule-arrow,
.cc-rule-crown,
.cc-rule-coins circle,
.cc-rule-coins path { fill: none; stroke: var(--cc-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cc-rule-fill-gold { fill: var(--cc-gold); }
.cc-rule-fill-coral { fill: #d78368; }
.cc-rule-cats path,
.cc-rule-cat-single { fill: #718b80; stroke: var(--cc-ink); stroke-width: 2; stroke-linejoin: round; }
.cc-rule-cats path:nth-child(2),
.cc-rule-cat-single { fill: #d99a58; }
.cc-rule-cats path:nth-child(3) { fill: #e7e2d3; }
.cc-rule-card-stack rect { fill: #f5dda0; }
.cc-rule-card-stack path { fill: #d99a58; }
.cc-rule-arrow { stroke: var(--cc-coral); stroke-width: 3; }
.cc-rule-danger-stack path { fill: none; }
.cc-rule-danger-fuzz { fill: #d96b4c; stroke: var(--cc-ink); stroke-width: 2; stroke-linejoin: round; }
.cc-rule-crown { fill: var(--cc-gold); stroke-width: 2.5; }
.cc-rule-coins circle { fill: var(--cc-gold); }
.cc-rule-cats-duel path:last-child { fill: #bd5b45; }
.cc-modal-close {
    float: right;
    padding: 8px 22px;
    border: var(--cc-border);
    color: var(--cc-ink);
    background-color: var(--cc-gold-soft);
    background-image: var(--cc-button-paper-texture);
    box-shadow: inset 0 0 0 1px rgba(255, 250, 240, .72), inset 0 -3px 0 rgba(128, 86, 16, .18), 3px 3px 0 var(--cc-shadow);
}


@keyframes cc-card-play {
    0% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
    58% { opacity: 1; transform: translateY(-24px) rotate(-1.5deg) scale(1.035); box-shadow: 7px 10px 0 rgba(23, 62, 53, .34); }
    100% { opacity: .74; transform: translateY(-8px) rotate(.5deg) scale(.975); box-shadow: 2px 2px 0 var(--cc-shadow); }
}

@keyframes cc-danger-deal {
    0% { opacity: 0; transform: translateY(-8px); }
    62% { opacity: 1; transform: translateY(1px); }
    100% { opacity: 1; transform: translate(0) rotate(0) scale(1); }
}

@keyframes cc-danger-peek {
    0%, 100% { transform: translateY(0) rotate(1deg); }
    48% { transform: translateY(-6px) rotate(-4deg); }
}

@keyframes cc-danger-move {
    0%, 100% { transform: translate(0) rotate(1deg); }
    42% { transform: translate(7px, -5px) rotate(7deg); }
    72% { transform: translate(-2px, 3px) rotate(-3deg); }
}

@keyframes cc-danger-shuffle {
    0%, 100% { transform: translate(0) rotate(1deg); }
    45% { transform: translate(6px, -2px) rotate(9deg); }
    72% { transform: translate(-4px, 2px) rotate(-6deg); }
}


@keyframes cc-ai-turn-in {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cc-ai-action-step {
    from { opacity: .35; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cc-ai-seat-active {
    from { filter: brightness(1); }
    to { filter: brightness(1.06); }
}

.cc-app button:focus-visible,
.cc-app a:focus-visible { outline: 3px solid #e8bd54; outline-offset: 3px; }
.cc-app button:hover:not(:disabled),
.cc-app a:hover { background-position: 10px 2px; transform: translate(-1px, -1px); }
.cc-app button:active,
.cc-app a:active {
    background-position: 4px 1px;
    box-shadow: inset 0 0 0 1px rgba(23, 62, 53, .16), inset 0 3px 0 rgba(23, 62, 53, .2), 1px 1px 0 rgba(23, 62, 53, .5);
    transform: translate(2px, 2px) scale(.99);
}

@media (max-width: 1180px) {
    .cc-game { grid-template-columns: minmax(0, 1.1fr) minmax(500px, 1fr); }
    .cc-map-panel { position: relative; top: auto; }
    .cc-team-status { grid-column: 2; grid-row: 1; }
    .cc-map-panel { grid-column: 1; grid-row: 1 / span 3; min-height: calc(100dvh - 94px); }
    .cc-table { grid-column: 2; grid-row: 2; }
}

@media (max-width: 1120px) {
    .cc-record-board { width: 220px; }
    .cc-intro-menu { left: calc(50% + 110px); width: min(500px, calc(100% - 36px)); }
}

/* Compact controls also cover phones after rotation, when width exceeds 760px. */
@media (max-width: 1100px) {
    .cc-topbar { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; min-height: 62px; padding: max(7px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 7px max(10px, env(safe-area-inset-left)); background-image: var(--cc-button-paper-texture); }
    .cc-back { width: 44px; padding: 0; box-shadow: 2px 2px 0 var(--cc-shadow); }
    .cc-back span { width: 100%; height: 100%; border-radius: 4px; color: var(--cc-ink); background: transparent; font-size: 20px; }
    .cc-back b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .cc-wordmark { gap: 6px; text-align: center; }
    .cc-wordmark h1 { font-size: 19px; }
    .cc-wordmark small,
    .cc-emblem { display: none; }
    .cc-top-actions { min-width: 0; gap: 8px; }
    .cc-abandon-control { min-width: 76px; padding-inline: 8px; font-size: 12px; }
    .cc-save-state { display: none; }
    .cc-intro { min-height: calc(100dvh - 62px); }
}
@media (max-width: 760px) {
    .cc-app:has(.cc-help-control:not([hidden])) .cc-wordmark { display: none; }
    .cc-app:has(.cc-help-control:not([hidden])) .cc-top-actions { grid-column: 2 / -1; }
    .cc-top-actions { gap: 6px; }
    .cc-music-toggle { min-width: 44px; width: 44px; padding: 0; }
    .cc-music-toggle > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
.cc-orientation-hint { display: none; }
@media (max-width: 760px) and (orientation: portrait) and (pointer: coarse) {
    .cc-orientation-hint { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 12px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left)); border-bottom: 1px solid #b49b58; background: var(--cc-gold-soft); }
    .cc-orientation-hint > div { flex: 1; min-width: 0; }
    .cc-orientation-hint strong { font-size: 15px; }
    .cc-orientation-hint p { margin: 4px 0 0; font-size: 12px; line-height: 1.6; }
    .cc-orientation-hint button { flex: 0 0 auto; min-height: 44px; padding: 8px 10px; font-size: 12px; white-space: nowrap; }
}
@media (orientation: landscape) and (max-height: 500px) {
    .cc-topbar { position: relative; }
    .cc-card-dialog { padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
    .cc-card-dialog .cc-tutorial { padding: 12px; }
    .cc-tutorial-heading { margin-bottom: 6px; }
    .cc-tutorial-actions { padding-top: 6px; }
}

@media (min-width: 761px) and (max-width: 900px) {
    .cc-game { display: flex; flex-direction: column; }
    .cc-map-panel { position: relative; top: auto; order: 0; width: 100%; min-height: 70dvh; }
    .cc-team-status { order: 1; width: 100%; }
    .cc-table { order: 2; width: 100%; }
}

@media (max-width: 760px) {
    .cc-app::before,
    .cc-app::after { display: none; }
    .cc-modal-close { float: none; width: fit-content; display: flex; margin-left: auto; }
    .cc-modal h2 { margin-top: 12px; }
    .cc-modal { padding: 20px 16px; }
    .cc-modal ol { gap: 8px; padding-left: 22px; }
    .cc-modal li { grid-template-columns: 88px minmax(0, 1fr); column-gap: 10px; padding-inline: 4px; }
    .cc-rule-visual { width: 88px; height: auto; }
    .cc-intro { min-height: calc(100dvh - 62px); }
    .cc-cover img { object-position: 51% center; }
    .cc-intro-copy { width: 100%; padding: 13px 15px 10px; }
    .cc-intro-copy::before { inset: 5px 0 68px; }
    .cc-intro h2 { margin: 0 0 12px; font-size: 34px; line-height: .94; }
    .cc-intro-overview { padding-top: 7px; }
    .cc-hero-brief { padding: 1px 8px 7px; font-size: 10px; line-height: 1.4; }
    .cc-intro-meta span { padding: 5px 5px; }
    .cc-intro-meta b { font-size: 13px; }
    .cc-intro-meta span:last-child b { font-size: 11px; }
    .cc-intro-meta small { font-size: 8px; }
    .cc-record-board { top: 17px; left: 17px; width: 180px; padding: 7px; }
    .cc-records-title { margin-bottom: 5px; }
    .cc-records { gap: 5px; }
    .cc-records span { padding: 5px 6px; }
    .cc-records small { font-size: 8px; }
    .cc-records strong { min-width: 24px; height: 21px; padding-inline: 4px; font-size: 14px; }
    .cc-intro-menu { left: calc(50% + 99px); top: 50%; width: min(320px, calc(100% - 34px)); }
    .cc-menu-crown { width: 70px; height: 58px; margin: 6px auto 11px; box-shadow: 4px 4px 0 rgba(23, 62, 53, .52); }
    .cc-menu-crown svg { width: 47px; }
    .cc-intro-actions { gap: 8px; }
    .cc-intro-actions .cc-primary { min-height: 54px; font-size: 18px; box-shadow: inset 0 0 0 2px rgba(255, 250, 240, .2), inset 0 -4px 0 rgba(12, 53, 39, .42), 5px 5px 0 #173e35; }
    .cc-intro-actions .cc-secondary { min-height: 44px; }
    .cc-resume-note { margin-top: 10px; }
    .cc-game { display: flex; flex-direction: column; gap: 0; padding: 0 0 calc(92px + env(safe-area-inset-bottom)); }
    .cc-map-panel { order: 0; width: 100%; min-height: 68dvh; }
    .cc-map-panel { height: calc(100dvh - 62px); min-height: max(68dvh, calc(100svh - 62px)); max-height: 820px; border-width: 0 0 3px; border-radius: 0; box-shadow: none; }
    .cc-team-status { order: 1; width: calc(100% - 16px); min-width: 0; align-self: center; margin-top: -220px; position: relative; z-index: 8; border-width: 3px; box-shadow: 5px 5px 0 rgba(23, 62, 53, .28); }
    .cc-team-heading { min-height: 36px; padding: 5px 8px 4px; }
    .cc-team-heading strong { font-size: 14px; }
    .cc-team-heading div > span { display: none; }
    .cc-team-players { display: flex; gap: 7px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 8px; }
    .cc-player,
    .cc-player[data-human="true"] { flex: 0 0 174px; min-height: 94px; grid-template-columns: 56px minmax(0, 1fr); gap: 7px; padding: 7px; scroll-snap-align: start; transform: none; }
    .cc-player[data-human="true"] { flex-basis: 184px; }
    .cc-player-avatar,
    .cc-player[data-human="true"] .cc-player-avatar { width: 56px; height: 56px; border-width: 2px; }
    .cc-player h3,
    .cc-player[data-human="true"] h3 { font-size: 12px; }
    .cc-player header span { display: none; }
    .cc-player-score-row { display: block; margin-top: 4px; }
    .cc-player-coins strong { font-size: 18px; }
    .cc-player-vitals { margin-top: 3px; }
    .cc-map-heading { margin: 12px; padding: 10px 12px; }
    .cc-map-heading h1 { font-size: 34px; }
    .cc-region-track { top: auto; right: 12px; bottom: 225px; left: 12px; grid-template-columns: repeat(4, 1fr); }
    .cc-map-action { top: 40%; width: calc(100% - 24px); max-height: min(520px, calc(100dvh - 350px)); overflow-y: auto; overscroll-behavior-y: contain; padding: 12px; box-shadow: 5px 5px 0 rgba(13, 43, 34, .58); }
    .cc-map-action > h2 { font-size: 27px; }
    .cc-map-action > span { font-size: 12px; }
    .cc-route-list { width: 100%; }
    .cc-encounter { left: 12px; bottom: 292px; width: calc(100% - 24px); max-height: 96px; overflow: auto; padding: 10px 12px; }
    .cc-encounter h2 { margin-block: 3px; font-size: 22px; }
    .cc-encounter p { font-size: 11px; }
    .cc-table { order: 2; width: 100%; min-width: 0; margin-top: 12px; padding: 18px 14px 24px; border-width: 3px 0 0; border-radius: 18px 18px 0 0; box-shadow: 0 -5px 0 rgba(23, 62, 53, .18); }
    .cc-table-heading { position: sticky; top: calc(62px + env(safe-area-inset-top)); z-index: 9; display: block; margin: -18px -14px 14px; padding: 14px; border-radius: 15px 15px 0 0; background-color: rgba(243, 236, 215, .98); background-image: var(--cc-button-paper-texture); }
    .cc-table-heading[data-duel="true"] { margin: -18px -14px 14px; padding: 14px; border-width: 0 0 3px 7px; border-radius: 15px 15px 0 0; }
    .cc-resource-section { padding: 8px; }
    .cc-resource { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 2px; min-width: 0; padding: 5px 4px; }
    .cc-resource .cc-resource-icon { grid-row: span 2; width: 24px; height: 24px; }
    .cc-event-scene { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; margin-top: 12px; }
    .cc-event-scene p { font-size: 14px; line-height: 1.7; }
    .cc-app[data-phase="event"] .cc-event-actions { grid-template-columns: minmax(0, 1fr); }
    .cc-app[data-phase="event"] .cc-event-option { flex: auto; }
    .cc-card-row { margin-inline: -14px; padding: 0 14px 10px; scroll-padding-inline: 14px; }
    .cc-card-row[data-context="market"] { grid-template-columns: 1fr; margin-inline: 0; padding-inline: 0; }
    .cc-card-row[data-context="market"] .cc-card { grid-template-columns: 110px minmax(0, 1fr); }
    .cc-card-row[data-context="market"] .cc-card-art { width: 110px; height: 110px; }
    .cc-card { flex: 0 0 min(64vw, 206px); scroll-snap-align: start; }
    .cc-table > .cc-log { width: 100%; margin: 0 0 14px; }
    .cc-market-section header { display: block; }
    .cc-market-section header p { text-align: left; }
    .cc-command-bar { position: fixed; right: 8px; bottom: 0; left: 8px; z-index: 18; gap: 10px; margin: 0; padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border: 3px solid var(--cc-line); border-bottom: 0; border-radius: 14px 14px 0 0; background-color: var(--cc-paper-strong); background-image: var(--cc-button-paper-texture); box-shadow: 0 -5px 0 rgba(23, 62, 53, .24); }
    .cc-command-bar .cc-primary,
    .cc-command-bar .cc-secondary { flex: 1; min-height: 50px; }
    .cc-toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
    .cc-ai-turn { place-items: end center; padding: 14px 12px calc(88px + env(safe-area-inset-bottom)); background: rgba(23, 62, 53, .14); }
    .cc-ai-turn-card { width: 100%; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 13px; border-left-width: 7px; box-shadow: 6px 6px 0 rgba(13, 43, 34, .58); }
    .cc-ai-turn-player { gap: 10px; }
    .cc-ai-turn-player img { width: 58px; height: 58px; border-width: 2px; }
    .cc-ai-turn-player h2 { font-size: 17px; }
    .cc-ai-turn-player h2 span { font-size: 22px; }
    .cc-ai-turn-action { min-height: 50px; padding: 9px 10px; font-size: 12px; }
    #ccAITurnSkip { min-width: 88px; }
    .cc-modal-backdrop { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
}

@media (max-width: 900px) {
    .cc-intro { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 12px 28px; }
    .cc-intro .cc-record-board { position: relative; inset: auto; width: min(560px, 100%); padding: 8px 12px; }
    .cc-intro .cc-records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cc-intro .cc-intro-menu { position: relative; inset: auto; width: min(560px, 100%); transform: none; }
}

@media (max-width: 520px) {
    .cc-area-transition-card > p { flex-direction: column; gap: 9px; }
    .cc-area-transition-crown { width: 90px; height: 72px; margin-block: 22px 13px; }
    .cc-area-transition-crown svg { width: 58px; }
    .cc-area-transition-card > span:last-child { max-width: 290px; margin-inline: auto; font-size: 12px; }
    .cc-intro { min-height: calc(100dvh - 62px); }
    .cc-record-board { top: 12px; width: min(270px, calc(100% - 34px)); }
    .cc-records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cc-intro-menu { left: 50%; top: 112px; width: calc(100% - 24px); transform: translateX(-50%); }
    .cc-modal-actions { display: grid; grid-template-columns: 1fr; }
    .cc-modal-actions > button { width: 100%; }
}

@media (max-width: 600px) {
    .cc-route-list .cc-route-option { min-height: 146px; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); }
    .cc-route-copy { padding: 11px 12px 10px; }
    .cc-route-copy > strong { font-size: 22px; }
    .cc-route-copy > small,
    .cc-route-go { font-size: 11px; }
}

@media (max-width: 390px) {
    .cc-intro-copy { width: 100%; padding: 12px 12px 9px; }
    .cc-intro h2 { font-size: 32px; }
    .cc-map-panel { min-height: max(68dvh, calc(100svh - 62px)); }
    .cc-intro-meta span { padding-inline: 5px; }
    .cc-card { flex-basis: min(66vw, 202px); }
}

@media (max-width: 760px) {
    .cc-map-panel:has(.cc-combat:not([hidden])) { height: auto; min-height: 0; max-height: none; padding-bottom: 20px; }
    .cc-app:has(.cc-combat:not([hidden])) .cc-team-status { margin-top: 0; }
    .cc-combat { position: relative; left: auto; top: auto; transform: none; width: calc(100% - 24px); margin: 20px 12px 0; }
    .cc-enemy-scene { height: 80px; }
    .cc-enemy-details { padding: 12px 15px; }
    .cc-enemy-health-heading { margin-top: 8px; }
    .cc-ai-turn-speech { font-size: 15px; }
}

/* Journey phases share a stable stage and team rail; content grows in page flow. */
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-game {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-panel {
    position: relative;
    top: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-content: start;
    align-items: center;
    gap: 18px;
    height: auto;
    min-height: calc(100dvh - 94px);
    max-height: none;
    padding: 20px;
}
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-heading { margin: 0; padding: 12px 16px; }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-heading h1 { margin: 0 0 5px; font-size: 30px; }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-region-track { position: relative; inset: auto; gap: 0; padding: 10px 8px; border: 0; box-shadow: none; }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-region-track > span { position: relative; min-width: 0; padding: 8px; border: 0; opacity: 1; font-size: 12px; }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-region-track > span[data-current="true"] { background: rgba(229, 185, 69, .12); color: var(--cc-gold-soft); }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-action { position: relative; inset: auto; grid-column: 1 / -1; width: 100%; max-height: none; margin: 0; padding: 20px; transform: none; overflow: visible; }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-action > p { display: none; }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-action > span { max-width: none; }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-team-players { display: flex; flex-direction: column; }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player { flex: auto; grid-template-columns: 64px minmax(0, 1fr); min-height: 88px; transform: none; }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player-avatar { width: 64px; height: 64px; }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-table { padding: 10px; }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-table > .cc-log { margin: 0 0 14px; }
.cc-app[data-phase="route"] .cc-map-action { max-width: 1280px; justify-self: center; container-type: inline-size; padding: 8px 0 0; border: 0; background: transparent; box-shadow: none; }
.cc-app[data-phase="route"] .cc-map-action > h2 { width: fit-content; margin: 0; padding: 10px 16px 4px; border-radius: 8px 8px 0 0; background: var(--cc-paper-strong); }
.cc-app[data-phase="route"] .cc-map-action > span { width: fit-content; padding: 4px 16px 10px; border-radius: 0 8px 8px 8px; background: var(--cc-paper-strong); }
.cc-app[data-phase="event"] .cc-map-action { max-width: 880px; justify-self: center; }
.cc-app[data-phase="camp"] .cc-market-section { max-width: 1200px; justify-self: center; container-type: inline-size; }
.cc-app[data-phase="camp"] .cc-market-section > span { margin-bottom: 20px; }
.cc-app[data-phase="camp"] .cc-market-help { margin-top: 16px; border-top: 1px solid #bdc9b3; }
.cc-market-help > summary { display: flex; align-items: center; min-height: 44px; gap: 10px; font-size: 13px; color: var(--cc-muted); cursor: pointer; list-style: none; }
.cc-market-help > summary::before { content: '+'; font-size: 20px; color: var(--cc-forest); }
.cc-market-help[open] > summary::before { content: '−'; }
.cc-market-help > summary:focus-visible { outline: 2px solid var(--cc-forest); outline-offset: 2px; }
.cc-app[data-phase="camp"] .cc-command-bar { position: static; width: auto; margin-top: 12px; padding: 12px 0 0; border: 0; border-top: 1px solid #bdc9b3; border-radius: 0; background: transparent; box-shadow: none; justify-content: flex-end; }
.cc-app[data-phase="camp"] .cc-command-bar > button { flex: 0 1 auto; min-height: 44px; }
.cc-market-section .cc-card-row[data-context="market"] { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0 3px 4px 0; }
.cc-market-section .cc-card-row[data-context="market"]:has(> :nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cc-market-section .cc-card-row[data-context="market"] .cc-card { grid-template-columns: 80px minmax(0, 1fr); padding: 12px; }
.cc-market-section .cc-card-row[data-context="market"] .cc-card-art { width: 100%; height: auto; }
.cc-market-section .cc-card-row[data-context="market"] .cc-card-description { font-size: 12px; line-height: 1.5; }
.cc-recruit-shortage { grid-column: 1 / -1; margin: 0; color: #984730; font-size: 12px; line-height: 1.5; }
@container (max-width: 900px) {
    .cc-market-section .cc-card-row[data-context="market"] { grid-template-columns: minmax(0, 1fr); }
    .cc-market-section .cc-card-row[data-context="market"]:has(> :nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 620px) {
    .cc-market-section .cc-card-row[data-context="market"]:has(> :nth-child(4)) { grid-template-columns: minmax(0, 1fr); }
}
.cc-route-progress { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.cc-route-progress > span { font-weight: 750; white-space: nowrap; }
.cc-route-progress > small { font-size: 12px; line-height: 1.5; color: var(--cc-muted); }
.cc-route-option:has(.cc-route-select:focus-visible) { outline: 3px solid var(--cc-gold); outline-offset: 5px; }
.cc-route-option:has(.cc-route-select:active) { filter: brightness(.94); }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-card-table { grid-template-columns: minmax(0, 1fr); }
.cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-play-area { border-left: 0; padding-left: 0; }
.cc-play-area:not(:has(> section:not([hidden]))) { display: none; }
@media (min-width: 1051px) {
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-pile-buttons { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1050px) {
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-game { display: flex; flex-direction: column; gap: 12px; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-panel,
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-team-status,
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-table { width: 100%; min-width: 0; margin-top: 0; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-team-players { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player { grid-row: auto; }
}
@media (max-width: 760px) {
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-panel { min-height: 0; padding: 12px; gap: 12px; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-heading { padding: 10px 12px; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-heading h1 { font-size: 26px; }
    .cc-app:is([data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-action { padding: 14px; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-game { padding-bottom: 20px; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-team-status { order: -1; width: calc(100% - 16px); margin-top: 8px; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-team-players { grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; gap: 6px; padding: 7px; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player { grid-template-columns: 30px minmax(0, 1fr); gap: 5px; padding: 6px; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player-avatar { width: 30px; height: 30px; border-width: 1px; border-radius: 5px; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player-portrait > span { padding: 1px 2px; font-size: 6px; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player-info { display: contents; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player header { display: block; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player h3 { font-size: 11px; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player-score-row,
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player-vitals { grid-column: 1 / -1; margin: 0; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player-score-row { display: flex; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-player-coins strong { font-size: 16px; }
}
@media (max-width: 600px) {
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-panel { grid-template-columns: 1fr; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; width: 100%; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-map-heading h1 { margin: 0; }
    .cc-app:is([data-phase="route"], [data-phase="event"], [data-phase="bridge"], [data-phase="camp"]) .cc-region-track { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cc-app *, .cc-app *::before, .cc-app *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation: none !important; }
}

.cc-app[data-phase="camp"] #ccActionGuide { display: none; }


/* Opponents share the route backdrop, with full portraits and individual state. */
.cc-route-enemies { font-size: 12px; line-height: 1.5; color: var(--cc-coral); }
.cc-enemy-formation { display: flex; gap: 10px; margin-top: 14px; }
.cc-enemy-unit {
    --cc-enemy-edge: #865232; --cc-enemy-metal: #d5ab6c; --cc-enemy-wash: #e8c795; --cc-enemy-deep: #603920;
    flex: 1; min-width: 0; max-width: 280px; margin-inline: auto; padding: 10px 12px 10px;
    border: 2px solid var(--cc-enemy-edge); border-radius: 12px; text-align: center;
    background-color: #fff5df;
    background-image: radial-gradient(ellipse at 50% 22%, #fffdf4 0%, transparent 60%), linear-gradient(135deg, var(--cc-enemy-wash), transparent 48%, var(--cc-enemy-wash));
    box-shadow: inset 0 0 0 3px var(--cc-enemy-edge), inset 0 0 0 4px var(--cc-enemy-metal), inset 0 0 22px #b8893c20, 0 5px 10px #593c242b;
}
.cc-enemy-unit[data-tier="2"] { --cc-enemy-edge: #326e68; --cc-enemy-metal: #acd1b3; --cc-enemy-wash: #bdd8ca; --cc-enemy-deep: #204e48; }
.cc-enemy-unit[data-tier="3"] { --cc-enemy-edge: #725186; --cc-enemy-metal: #d4badf; --cc-enemy-wash: #decae7; --cc-enemy-deep: #513568; }
.cc-enemy-unit[data-tier="4"] { --cc-enemy-edge: #986922; --cc-enemy-metal: #ffe4a0; --cc-enemy-wash: #f1d38b; --cc-enemy-deep: #674315; }
.cc-enemy-unit[data-rank="boss"], .cc-enemy-unit[data-rank="king"] { border-width: 3px; box-shadow: inset 0 0 0 3px var(--cc-enemy-edge), inset 0 0 0 5px #e9c77a, 0 0 0 1px #c49c55, 0 6px 16px #93652238; }
.cc-enemy-unit[data-rank="king"] { --cc-enemy-edge: #823f35; --cc-enemy-deep: #6b2c28; --cc-enemy-wash: #f4d082; }
.cc-enemy-rank { position: absolute; z-index: 2; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; color: var(--cc-enemy-deep); pointer-events: none; }
.cc-enemy-tier { display: flex; align-items: center; gap: 4px; text-align: left; white-space: nowrap; padding: 3px; border-radius: 6px; background: #fff4dfe8; }
.cc-enemy-tier > b { display: grid; place-items: center; width: 32px; height: 36px; border: 1px solid var(--cc-enemy-metal); border-radius: 45% 45% 40% 40%; background: linear-gradient(145deg, var(--cc-enemy-edge), var(--cc-enemy-deep)); color: #fff8e6; box-shadow: 0 0 0 1px var(--cc-enemy-edge), inset 0 0 0 2px #fff4d92b, 0 2px 3px #3b242329; font: 700 25px/1 Georgia, serif; }
.cc-enemy-tier > span { font-size: 12px; line-height: 1.2; }
.cc-enemy-tier small { display: block; margin-top: 2px; font-size: 11px; }
.cc-enemy-rank-mark { display: grid; justify-items: center; gap: 1px; padding: 3px; border-radius: 5px; background: #fff4dfe8; font-size: 11px; line-height: 1.2; font-weight: 700; }
.cc-enemy-rank-mark svg { fill: #f3cc6b; stroke: var(--cc-enemy-deep); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cc-enemy-tier-gems { display: flex; gap: 5px; padding-inline: 2px; }
.cc-enemy-tier-gems i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid var(--cc-enemy-edge); background: linear-gradient(135deg, #fff8df, var(--cc-enemy-metal) 50%, var(--cc-enemy-edge)); box-shadow: 1px 1px 2px #4b302a26; }
.cc-enemy-unit[data-defeated="true"] .cc-enemy-rank { filter: grayscale(1); opacity: .65; }
.cc-enemy-unit[data-target="true"] .cc-enemy-unit-status { background: #a84330; color: #fff9e8; border-radius: 3px; padding: 2px 4px; }

/* A sliced engraving keeps the corner flourishes intact at every card width. */
.cc-enemy-unit::before { content: ""; position: absolute; z-index: 1; inset: 2px; border: 28px solid transparent; border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cdefs%3E%3Cg id='corner' fill='none' stroke='%23b88b45' stroke-width='1.15' stroke-linecap='round'%3E%3Cpath d='M2 32V7Q2 2 7 2H32M7 28V13Q7 7 13 7H28M9 25C17 25 25 17 25 9M10 22C7 17 11 12 16 14C21 16 17 22 14 19M22 10C17 7 12 11 14 16M17 24C25 27 30 20 25 16M24 17C27 25 20 30 16 25'/%3E%3Cpath d='M5 5L9 6L6 9Z M27 7Q30 2 33 5Q31 9 27 7 M7 27Q2 30 5 33Q9 31 7 27' fill='%23b88b45' stroke='none'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23corner'/%3E%3Cuse href='%23corner' transform='translate(120 0) scale(-1 1)'/%3E%3Cuse href='%23corner' transform='translate(0 120) scale(1 -1)'/%3E%3Cuse href='%23corner' transform='translate(120 120) scale(-1 -1)'/%3E%3C/svg%3E") 36 / 20px / 0 stretch; pointer-events: none; }
.cc-enemy-unit[data-target="true"] { border-color: var(--cc-coral); outline: 2px solid var(--cc-coral); outline-offset: 2px; }
/* The watercolor bleeds into the paper instead of reading as a pasted square. */
.cc-enemy-unit > img { display: block; width: auto; max-width: 100%; align-self: center; height: auto; aspect-ratio: 1; margin: 6px auto -14px; object-fit: contain; mix-blend-mode: multiply; mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22320%22%20height%3D%22320%22%20viewBox%3D%220%200%20320%20320%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22edge%22%3E%3Cstop%20stop-color%3D%22white%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%22.1%22%20stop-color%3D%22white%22%2F%3E%3Cstop%20offset%3D%22.9%22%20stop-color%3D%22white%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22white%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paper%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22white%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%22.06%22%20stop-color%3D%22white%22%2F%3E%3Cstop%20offset%3D%22.75%22%20stop-color%3D%22white%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22white%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3Cmask%20id%3D%22sides%22%3E%3Crect%20width%3D%22320%22%20height%3D%22320%22%20fill%3D%22url%28%23edge%29%22%2F%3E%3C%2Fmask%3E%3C%2Fdefs%3E%3Crect%20width%3D%22320%22%20height%3D%22320%22%20fill%3D%22url%28%23paper%29%22%20mask%3D%22url%28%23sides%29%22%2F%3E%3C%2Fsvg%3E"); mask-size: contain; mask-repeat: no-repeat; mask-position: center; }
.cc-enemy-unit h3, .cc-enemy-unit-status, .cc-enemy-unit-health, .cc-enemy-unit-numbers, .cc-enemy-intent { position: relative; z-index: 1; }
.cc-enemy-unit h3 { color: var(--cc-enemy-deep); margin: 5px 0 3px; font-family: "LXGW WenKai", serif; font-size: 19px; line-height: 1.3; }
.cc-enemy-unit .cc-enemy-unit-status { color: var(--cc-coral); font-weight: 750; }
.cc-enemy-unit[data-defeated="true"] img { filter: grayscale(1); opacity: .5; }
.cc-enemy-unit-health { height: 8px; margin: 5px 0; background: #ddc6ad; border: 1px solid #713c2d; border-radius: 3px; overflow: hidden; }
.cc-enemy-unit-health > span { display: block; height: 100%; background: #b94e3c; transition: width 300ms; }
.cc-enemy-unit .cc-enemy-unit-numbers { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--cc-ink); }
.cc-enemy-shield { color: var(--cc-forest); font-weight: 700; }
.cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-intent { margin: 6px 0 0; padding: 6px 8px 0; border-top: 1px solid #bfa582; font-size: 13px; line-height: 1.4; color: #713c2d; overflow-wrap: anywhere; }
.cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-mood {
    --cc-mood-ink: #4d6151; --cc-mood-paper: #e1e8d6;
    position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 2px 8px; margin: 3px 0 7px; padding: 5px 8px; border: 1px solid var(--cc-mood-ink); border-radius: 5px;
    color: var(--cc-mood-ink); background: var(--cc-mood-paper); line-height: 1.3; overflow-wrap: anywhere;
}
.cc-enemy-mood strong { font-size: 16px; font-weight: 750; }
.cc-enemy-personality { padding-left: 8px; border-left: 1px solid currentColor; font-size: 12px; }
.cc-enemy-mood-reason { flex-basis: 100%; font-size: 12px; }
.cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-mood[data-mood="愤怒"] { --cc-mood-ink: #952f23; --cc-mood-paper: #f9d4c5; }
.cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-mood[data-mood="警惕"] { --cc-mood-ink: #245b67; --cc-mood-paper: #d5e8e4; }
.cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-mood[data-mood="急躁"] { --cc-mood-ink: #865015; --cc-mood-paper: #ffe3aa; }
.cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-mood[data-mood="振奋"] { --cc-mood-ink: #5d467d; --cc-mood-paper: #e9dcf0; }
.cc-enemy-unit[data-mood-changed="true"] .cc-enemy-mood { outline: 2px solid var(--cc-mood-ink); outline-offset: 2px; animation: cc-enemy-mood-emphasis 600ms ease-out; }
.cc-enemy-mood-change { position: absolute; z-index: 3; left: 50%; top: 28%; transform: translate(-50%, -50%); width: max-content; max-width: calc(100% - 16px); padding: 7px 12px; border: 2px solid #fff5df; border-radius: 6px; color: #fff5df; background: #713c2d; font-size: 16px; font-weight: 750; pointer-events: none; }
@keyframes cc-enemy-mood-emphasis { 45% { transform: scale(1.04); } }
@media (max-width: 760px) {
    .cc-enemy-formation { gap: 5px; }
    .cc-enemy-unit { padding: 12px 7px 8px; }
    .cc-enemy-unit::before { border-image-width: 16px; }
    .cc-enemy-rank { top: 8px; left: 8px; right: 8px; gap: 2px; }
    .cc-enemy-tier { gap: 3px; padding: 2px; }
    .cc-enemy-tier > b { width: 26px; height: 32px; font-size: 23px; }
    .cc-enemy-tier-gems { gap: 3px; }
    .cc-enemy-tier-gems i { width: 5px; height: 5px; }
    .cc-enemy-rank-mark { font-size: 10px; }
    .cc-enemy-formation:has(> :nth-child(3)) .cc-enemy-tier { gap: 2px; }
    .cc-enemy-formation:has(> :nth-child(3)) .cc-enemy-tier > b { width: 22px; height: 28px; font-size: 20px; }
    .cc-enemy-formation:has(> :nth-child(3)) .cc-enemy-rank-mark { align-self: flex-end; padding: 2px 0; background: transparent; }
    .cc-enemy-formation:has(> :nth-child(3)) .cc-enemy-tier-gems { display: grid; grid-template-columns: repeat(2, 5px); gap: 3px; }
    .cc-enemy-unit > img { margin-top: 18px; }
    .cc-enemy-formation:has(> :nth-child(3)) .cc-enemy-unit > img { margin-top: 40px; }
    .cc-enemy-unit h3 { font-size: 16px; }
    .cc-enemy-unit p { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .cc-enemy-unit-health > span { transition: none; }
}

.cc-route-reward { display: flex; flex-direction: column; gap: 2px; }
.cc-route-reward + .cc-route-reward { padding-top: 7px; border-top: 1px solid rgba(23, 62, 53, .16); }
.cc-route-reward > small { font-weight: 650; }
.cc-choice-effects, .cc-route-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; }
.cc-route-stats { margin-top: 7px; }
.cc-app .cc-choice-select { position: static; isolation: auto; min-height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; box-shadow: none; color: inherit; font: inherit; cursor: pointer; touch-action: manipulation; }
.cc-choice-select::after { content: ""; position: absolute; z-index: 1; inset: 0; border-radius: 5px; }
.cc-choice-select:focus-visible { outline: none; }
.cc-choice-select:focus-visible::after { outline: 3px solid var(--cc-forest); outline-offset: 3px; }
.cc-route-option:has(.cc-choice-select:disabled) { opacity: .65; }
.cc-event-option { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; }
.cc-event-option::before, .cc-event-option::after { display: none; }
.cc-event-actions > .cc-event-option:last-child:nth-child(odd) { grid-column: 1 / -1; }
.cc-event-select { text-align: left; font-weight: 750 !important; }
.cc-player-coins .cc-resource-chip { min-width: 44px; min-height: 44px; gap: 2px; padding: 0; }
.cc-player-coins .cc-resource-icon { width: 22px; height: 22px; }
.cc-player-coins .cc-resource-chip b { font-size: 18px; color: #946015; }
.cc-enemy-unit-numbers { display: flex; flex-wrap: wrap; justify-content: center; }
.cc-enemy-unit-numbers .cc-resource-chip { gap: 2px; padding: 2px; }
.cc-enemy-unit-numbers .cc-resource-icon { width: 24px; height: 24px; }
.cc-enemy-unit-numbers .cc-resource-chip b { font-size: 12px; }

.cc-player-block { position: relative; padding: 0; border: 0; background: none; }
.cc-player-block .cc-resource-icon { width: 24px; height: 24px; }
.cc-player-block .cc-resource-chip { gap: 2px; padding: 0; }
.cc-player-block .cc-resource-chip b { font-size: 14px; }
.cc-block-change { position: absolute; z-index: 4; right: 6px; top: -8px; padding: 5px 8px; border: 1px solid var(--cc-forest); border-radius: 5px; color: var(--cc-paper-strong); background: var(--cc-forest); font-size: 12px; font-weight: 750; pointer-events: none; animation: cc-block-float 700ms ease-out both; }
.cc-player[data-block-change="loss"] .cc-block-change { background: #8f4b3a; border-color: #8f4b3a; }
.cc-player[data-block-change="gain"] .cc-player-block { border-radius: 5px; background: #c7e9c5; animation: cc-block-gain 700ms ease-out; }
.cc-player[data-block-change="loss"] .cc-player-block { border-radius: 5px; background: #f6d8c5; animation: cc-block-loss 550ms ease-out; }
@keyframes cc-block-float { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cc-block-gain { 40% { transform: scale(1.16); box-shadow: 0 0 0 5px #74ac7830; } }
@keyframes cc-block-loss { 25% { transform: translateX(-3px); } 55% { transform: translateX(3px); } }



/* Keep 44px symbol hit areas inside the existing compact team information. */
.cc-player .cc-resource-chip { margin-block: -7px; }
.cc-player-score-row { min-height: 30px; }
@media (max-width: 640px) {
    .cc-player-score-row { display: flex; flex-wrap: wrap; gap: 3px; }
}

/* The larger landmarks and enemy formation share document flow at every width. */
.cc-map-panel:has(.cc-combat:not([hidden])) { position: relative; top: auto; display: flex; flex-direction: column; height: auto; min-height: 0; max-height: none; padding: 16px; }
.cc-map-panel:has(.cc-combat:not([hidden])) .cc-map-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; width: 100%; margin: 0 0 12px; }
.cc-map-panel:has(.cc-combat:not([hidden])) .cc-map-heading h1 { margin: 0; font-size: 28px; }
.cc-map-panel:has(.cc-combat:not([hidden])) .cc-region-track { position: relative; inset: auto; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 14px; }
.cc-map-panel:has(.cc-combat:not([hidden])) .cc-combat { position: relative; inset: auto; transform: none; width: 100%; margin: 0; }
@media (min-width: 901px) {
    .cc-map-panel:has(.cc-combat:not([hidden])) { grid-row: 1 / span 2; align-self: start; position: sticky; top: 82px; height: calc(100dvh - 94px); padding: 12px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-map-heading { flex: 0 0 auto; margin-bottom: 8px; padding: 8px 12px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-region-track { flex: 0 0 auto; margin-bottom: 10px; padding: 4px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-region-track > span { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; column-gap: 6px; padding: 5px; text-align: left; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-region-track > span img { grid-row: 1 / span 2; width: 36px; height: 36px; margin: 0; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-region-track > span small { margin: 0; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-combat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-scene { flex: 0 0 clamp(20px, 3dvh, 36px); }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-details { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 18px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-details > :not(.cc-enemy-formation) { flex-shrink: 0; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-formation { flex: 1; min-height: 0; align-items: center; margin-top: 10px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit { display: flex; flex-direction: column; height: 100%; max-height: 420px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit > img { flex: 1; min-height: 140px; height: 0; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit > :not(img) { flex-shrink: 0; }
}
@media (min-width: 901px) and (max-height: 920px) {
    .cc-map-panel:has(.cc-combat:not([hidden])) { height: auto; min-height: calc(100dvh - 94px); }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit { height: auto; max-height: none; max-width: 360px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit > img { flex: none; height: 180px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-scene { display: none; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-details { padding: 8px 12px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-details h2 { font-size: 26px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-health-heading { margin-top: 8px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-health-heading strong { font-size: 20px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-hint { margin-top: 6px; font-size: 11px; }
}
@media (min-width: 901px) and (max-height: 640px) {
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit { display: grid; grid-template-columns: minmax(48px, .8fr) minmax(0, 1fr); column-gap: 6px; padding: 10px 8px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit > img { grid-column: 1; grid-row: 1 / span 4; height: 100%; margin-block: 24px -12px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit > :not(img) { grid-column: 2; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit > .cc-enemy-rank,
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit > .cc-enemy-intent { grid-column: 1 / -1; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit h3 { margin: 36px 0 0; font-size: 15px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit-status { font-size: 10px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit-numbers { flex-wrap: nowrap; }
}
/* Phone landscape cannot fit a whole battle in the desktop's fixed height. */
@media (orientation: landscape) and (max-height: 500px) {
    .cc-intro { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: start; gap: 16px; padding: 20px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
    .cc-intro .cc-record-board { position: relative; inset: auto; width: 100%; padding: 8px; }
    .cc-intro .cc-intro-menu { position: relative; inset: auto; transform: none; width: 100%; max-width: 900px; margin: 0 auto; grid-template-columns: minmax(0, 1fr) minmax(180px, .85fr); align-items: center; gap: 12px; }
    .cc-intro-copy { width: 100%; grid-column: 1; grid-row: 1 / span 2; padding: 8px 0; }
    .cc-intro h2 { font-size: 32px; line-height: 1.1; margin-bottom: 12px; }
    .cc-menu-crown { display: none; }
    .cc-intro-actions { grid-column: 2; width: 100%; }
    .cc-resume-note { grid-column: 2; margin: 0; }
    .cc-map-panel:has(.cc-combat:not([hidden])) { position: relative; top: auto; height: auto; min-height: 0; max-height: none; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-combat,
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-details,
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-formation { flex: 0 0 auto; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-scene { display: none; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit { height: auto; max-height: none; min-height: 120px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-enemy-unit > img { flex: 0 0 auto; height: 150px; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-region-track > span { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 2px 6px; align-items: center; text-align: left; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-region-track > span img { grid-row: 1 / span 2; width: 32px; height: 32px; margin: 0; }
    .cc-map-panel:has(.cc-combat:not([hidden])) .cc-region-track > span small { margin: 0; }
}
@media (max-width: 760px) {
    .cc-resource { display: grid; grid-template-columns: 28px max-content; column-gap: 6px; row-gap: 0; }
    .cc-resource > .cc-resource-icon, .cc-resource > b { grid-row: 1; }
    .cc-resource > small { grid-column: 1 / -1; grid-row: 2; }
}

/* Short portrait screens still fit saved progress and all menu actions. */
@media (max-width: 520px) and (max-height: 740px) {
    .cc-intro-menu { top: 124px; }
    .cc-intro-copy { padding: 6px 15px; }
    .cc-intro h2 { margin-bottom: 8px; font-size: 30px; }
    .cc-menu-crown { width: 50px; height: 40px; margin: 2px auto 6px; }
    .cc-menu-crown svg { width: 32px; height: 28px; }
    .cc-resume-note { margin-top: 6px; }
}

/* The menu links to a separate, readable introduction page. */
.cc-about-entry { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 10px; padding: 0 12px; border-radius: 4px; color: var(--cc-paper-strong); background: rgba(23, 62, 53, .84); font-size: 13px; text-underline-offset: 4px; }
.cc-about-entry:focus-visible { outline: 3px solid var(--cc-paper-strong); outline-offset: 2px; }
.cc-about-page::before, .cc-about-page::after { display: none; }
.cc-about-banner { display: block; width: 100%; height: clamp(160px, 25vw, 320px); object-fit: cover; object-position: center 48%; }
.cc-about-page .cc-about { position: relative; width: 100%; }
.cc-about h1 { margin: 0 0 20px; font-size: clamp(28px, 4vw, 40px); line-height: 1.3; }
.cc-about-play { display: inline-flex; margin-top: 24px; text-decoration: none; }
.cc-about { max-width: 1100px; margin: 0 auto; padding: clamp(32px, 5vw, 64px) clamp(20px, 4vw, 48px); color: var(--cc-forest); line-height: 1.8; }
.cc-about h2 { margin: 0 0 16px; font-size: clamp(22px, 3vw, 30px); line-height: 1.4; }
.cc-about h3 { margin: 0 0 10px; font-size: 18px; line-height: 1.5; }
.cc-about p { margin: 0; font-size: 16px; }
.cc-about-heading { max-width: 760px; }
.cc-about-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 36px 0; padding: 32px 0; border-block: 1px solid var(--cc-line); }
.cc-about-questions details { border-bottom: 1px solid var(--cc-line); }
.cc-about-questions summary { min-height: 48px; padding: 12px 4px; font-weight: 700; cursor: pointer; }
.cc-about-questions details p { padding: 0 4px 20px; }
.cc-about-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 28px; }
.cc-about-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--cc-forest); text-underline-offset: 4px; }
.cc-about a:focus-visible, .cc-about summary:focus-visible { outline: 3px solid var(--cc-forest); outline-offset: 4px; }
@media (max-width: 760px) {
    .cc-about-features { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

/* Accepted actions: ink claws, portrait recoil and a warmer finishing beat. */
.cc-card-row[data-context="hand"] .cc-card[data-accepted="true"] { animation: cc-card-release 220ms ease-in both; }
@keyframes cc-card-release { from { transform: none; opacity: 1; } 30% { transform: translateY(-7px) rotate(-2deg); opacity: 1; } to { transform: translateY(-22px) scale(.94) rotate(3deg); opacity: 0; } }
.cc-enemy-formation { position: relative; }
.cc-enemy-unit { position: relative; isolation: isolate; }
.cc-impact-art { position: absolute; z-index: 2; top: 4px; left: 0; width: 100%; height: 148px; color: #fff6db; filter: drop-shadow(2px 2px 0 #ad4935); pointer-events: none; }
.cc-impact-art svg { width: 100%; height: 100%; overflow: visible; }
.cc-impact-claws path { stroke-dasharray: 1; animation: cc-claw-stroke 370ms cubic-bezier(.15,.7,.3,1) both; }
.cc-impact-claws path:nth-child(2) { animation-delay: 25ms; }
.cc-impact-claws path:nth-child(3) { animation-delay: 50ms; }
.cc-impact-sparks { transform-origin: center; animation: cc-impact-sparks 460ms ease-out both; }
.cc-impact-amount { position: absolute; z-index: 3; top: 35px; right: 8px; color: #fff9e8; font-size: clamp(27px, 3vw, 40px); font-weight: 900; line-height: 1; text-shadow: 2px 2px 0 #913e2f, -1px -1px 0 #913e2f, 1px -1px 0 #913e2f, -1px 1px 0 #913e2f; pointer-events: none; animation: cc-impact-number 520ms ease-out both; }
.cc-enemy-unit[data-impact="hit"] { background-color: #f8d9b4; }
.cc-enemy-unit[data-impact="hit"] > img { animation: cc-portrait-impact 380ms ease-out both; }
.cc-enemy-unit[data-impact="defeat"] { border-color: #b98727; background-color: #f8e3a4; }
.cc-enemy-unit[data-impact="defeat"] > img { animation: cc-portrait-defeat 760ms cubic-bezier(.22,.7,.2,1) both; }
.cc-enemy-unit[data-impact="defeat"] .cc-enemy-unit-status { color: #704712; font-size: 15px; animation: cc-defeat-stamp 600ms ease-out both; }
.cc-enemy-unit[data-impact="defeat"] .cc-impact-art { color: #ffe5a0; filter: drop-shadow(2px 2px 0 #985220); }
.cc-combat[data-impact="clear"] { border-color: #d1a03c; box-shadow: 0 0 0 4px #e8bd5650, 7px 7px 0 #173e3540; }
.cc-combat-result { position: absolute; z-index: 3; top: -14px; left: 50%; translate: -50% 0; white-space: nowrap; padding: 6px 18px; border: 2px solid #71491d; border-radius: 4px; color: #5b3717; background: #ffe6a1; box-shadow: 3px 4px 0 #71491d60; font-size: 28px; line-height: 1.4; transform: rotate(-4deg); animation: cc-defeat-stamp 650ms ease-out both; }
.cc-impact-notice { position: fixed; z-index: 65; top: max(78px, calc(env(safe-area-inset-top) + 12px)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: min(370px, calc(100vw - 28px)); min-height: 90px; padding: 12px; border: 2px solid #9b5439; border-radius: 9px; color: var(--cc-ink); background: #fff3d9; box-shadow: 4px 5px 0 #173e3540; pointer-events: none; }
.cc-impact-notice > img { flex: none; width: 72px; height: 72px; object-fit: contain; mix-blend-mode: multiply; animation: cc-portrait-impact 380ms ease-out both; }
.cc-impact-notice > span:last-child { font-size: 15px; line-height: 1.55; font-weight: 750; }
.cc-impact-notice .cc-impact-art { top: 10px; left: 8px; width: 82px; height: 82px; }
.cc-impact-notice:is([data-impact="clear"], [data-impact="defeat"]) { border-color: #b98727; background: #ffeab4; }
.cc-impact-notice:is([data-impact="clear"], [data-impact="defeat"]) > img { animation: cc-portrait-defeat 760ms ease-out both; }
.cc-player[data-card-effect="heal"] { outline: 2px solid #7ea765; background-color: #e4f0d6; animation: cc-support-pulse 420ms ease-out; }
.cc-player[data-card-effect="defense"] { outline: 2px solid #81aaba; background-color: #e0edf0; animation: cc-support-pulse 420ms ease-out; }
@keyframes cc-claw-stroke { from { stroke-dashoffset: 1; opacity: 0; } 20% { opacity: 1; } 70% { stroke-dashoffset: 0; opacity: 1; } to { stroke-dashoffset: 0; opacity: 0; } }
@keyframes cc-impact-sparks { from { transform: scale(.5); opacity: 0; } 25% { opacity: 1; } to { transform: scale(1.2); opacity: 0; } }
@keyframes cc-impact-number { from { opacity: 0; transform: translateY(12px) scale(.7); } 24%, 70% { opacity: 1; transform: translateY(-4px) scale(1.1); } to { opacity: 0; transform: translateY(-20px); } }
@keyframes cc-portrait-impact { 0%, 15% { transform: scale(1.04); filter: brightness(1.25); } 30% { transform: translate(7px, 1px) rotate(4deg); } 52% { transform: translate(-4px, 0) rotate(-2deg); } to { transform: none; filter: none; } }
@keyframes cc-portrait-defeat { 0%, 15% { transform: scale(1.06); filter: brightness(1.4); opacity: 1; } 32% { transform: translate(8px, -4px) rotate(9deg); opacity: 1; } to { transform: translate(0, 13px) scale(.85) rotate(12deg); filter: grayscale(1); opacity: .35; } }
@keyframes cc-defeat-stamp { from { opacity: 0; scale: 1.35; } 35% { opacity: 1; scale: .96; } to { opacity: 1; scale: 1; } }
@keyframes cc-support-pulse { from { box-shadow: 0 0 0 7px #d9ceaa80; } to { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 760px) { .cc-enemy-unit .cc-impact-art { height: 112px; } .cc-combat-result { font-size: 23px; } }
@media (prefers-reduced-motion: reduce) {
    .cc-impact-art { display: none; }
    .cc-enemy-unit[data-impact="defeat"] > img { transform: none; filter: grayscale(1); opacity: .5; }
    .cc-combat-result { transform: none; }
    .cc-impact-amount { opacity: 1; }
}

/* 荣耀纪录：图标入口与可滚动的前十名榜单。 */
.cc-records .cc-global-record { gap: 2px; padding-block: 0; }
.cc-global-record > small { flex: 1; }
.cc-leaderboard-trigger { flex: 0 0 44px; display: grid; place-items: center; width: 44px; min-height: 44px; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: var(--cc-forest); cursor: pointer; }
.cc-leaderboard-trigger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cc-leaderboard-trigger:hover, .cc-leaderboard-trigger:focus-visible { background: var(--cc-gold); outline: 2px solid var(--cc-forest); outline-offset: -3px; }
.cc-leaderboard-detail.cc-modal { display: flex; flex-direction: column; width: min(520px, 100%); max-height: min(880px, 92dvh); overflow: hidden; padding: 20px; color: var(--cc-ink); background: var(--cc-paper-strong); }
/* The heading closes on a certificate double rule so the board reads as a printed record. */
.cc-leaderboard-detail .cc-card-detail-heading { flex: 0 0 auto; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(23, 62, 53, .3); box-shadow: 0 3px 0 rgba(23, 62, 53, .08); }
.cc-leaderboard-detail h2 { margin: 0; font-size: clamp(24px, 4vw, 30px); }
.cc-leaderboard-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#ccLeaderboardHint { margin: 0 0 14px; color: var(--cc-muted); font-size: 13px; line-height: 1.6; }
#ccLeaderboardStatus { margin: 0 0 14px; font-size: 14px; line-height: 1.6; }
#ccLeaderboardStatus[data-state="loading"] { color: var(--cc-muted); }
#ccLeaderboardStatus[data-state="error"] { color: #8d4c38; }
#ccLeaderboardStatus[data-state="empty"] { padding: 30px 16px; border: 2px dashed rgba(23, 62, 53, .26); border-radius: var(--cc-radius); background: rgba(245, 221, 160, .22); color: var(--cc-muted); text-align: center; }
#ccLeaderboardStatus[data-state="empty"]::before { content: ""; display: block; width: 46px; height: 38px; margin: 0 auto 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 56'%3E%3Cpath d='M7 17 22 31 35 7l13 24 15-14-5 31H12L7 17Z' fill='%23e5b945' stroke='%23173e35' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M14 48h43' fill='none' stroke='%23173e35' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.cc-leaderboard-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 16px; }
.cc-leaderboard-table th, .cc-leaderboard-table td { padding: 13px 10px; border-bottom: 1px solid rgba(23, 62, 53, .12); text-align: left; vertical-align: middle; }
.cc-leaderboard-table thead th { padding-block: 0 10px; border-bottom: 2px solid rgba(23, 62, 53, .3); color: var(--cc-muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.cc-leaderboard-table th:first-child { width: 52px; text-align: center; }
.cc-leaderboard-table th:last-child { width: 138px; text-align: right; }
.cc-leaderboard-table tbody tr:last-child td { border-bottom: 0; }
.cc-leaderboard-rank { text-align: center; font-variant-numeric: tabular-nums; }
.cc-leaderboard-rank b { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto; color: var(--cc-muted); font-size: 15px; font-weight: 800; }
.cc-leaderboard-table tr[data-medal] .cc-leaderboard-rank b { border: 2px solid; border-radius: 50%; font-size: 14px; box-shadow: inset 0 1px 0 rgba(255, 250, 240, .9), 0 2px 3px rgba(23, 62, 53, .16); }
.cc-leaderboard-table tr[data-medal="gold"] .cc-leaderboard-rank b { border-color: #a97c17; background: linear-gradient(160deg, #f8e5ac, #e5b945); color: #6b4408; }
.cc-leaderboard-table tr[data-medal="silver"] .cc-leaderboard-rank b { border-color: #8d9489; background: linear-gradient(160deg, #f4f3ec, #cdd1c5); color: #4c534b; }
.cc-leaderboard-table tr[data-medal="bronze"] .cc-leaderboard-rank b { border-color: #96603a; background: linear-gradient(160deg, #f0dac2, #d3a577); color: #6b3f21; }
.cc-leaderboard-name { font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; font-size: 17px; overflow-wrap: anywhere; }
.cc-leaderboard-name .cc-leaderboard-crown { display: inline-block; width: 16px; height: 13px; margin-right: 6px; vertical-align: -1px; fill: var(--cc-gold); stroke: var(--cc-ink); stroke-width: 7; stroke-linejoin: round; }
.cc-leaderboard-name small { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; color: var(--cc-paper-strong); background: var(--cc-forest); font-family: inherit; font-size: 11px; font-weight: 700; vertical-align: 2px; }
.cc-leaderboard-coins { text-align: right; white-space: nowrap; font-family: "LXGW WenKai", serif; font-size: 21px; font-variant-numeric: tabular-nums; }
.cc-leaderboard-coins small { margin-left: 5px; color: var(--cc-muted); font-size: 11px; }
/* Each medal keeps its own hue on a slim left bar plus a faint matching wash, so the top three never blur together. */
.cc-leaderboard-table tr[data-medal] { --cc-medal-color: transparent; }
.cc-leaderboard-table tr[data-medal] td:first-child { box-shadow: inset 4px 0 0 var(--cc-medal-color); }
.cc-leaderboard-table tr[data-medal="gold"] { --cc-medal-color: #c9992a; background: linear-gradient(90deg, rgba(229, 185, 69, .2), rgba(229, 185, 69, .04) 60%, transparent); }
.cc-leaderboard-table tr[data-medal="silver"] { --cc-medal-color: #8f978d; background: linear-gradient(90deg, rgba(120, 132, 122, .16), rgba(120, 132, 122, .03) 60%, transparent); }
.cc-leaderboard-table tr[data-medal="bronze"] { --cc-medal-color: #a9703f; background: linear-gradient(90deg, rgba(176, 118, 68, .16), rgba(176, 118, 68, .03) 60%, transparent); }
.cc-leaderboard-table tr[data-medal="gold"] td { border-bottom-color: rgba(201, 153, 42, .38); }
.cc-leaderboard-table tr[data-medal="silver"] td { border-bottom-color: rgba(143, 151, 141, .38); }
.cc-leaderboard-table tr[data-medal="bronze"] td { border-bottom-color: rgba(169, 112, 63, .38); }
.cc-leaderboard-table tr[data-medal="gold"] .cc-leaderboard-name { font-size: 18px; font-weight: 800; }
.cc-leaderboard-table tr[data-medal="silver"] .cc-leaderboard-name,
.cc-leaderboard-table tr[data-medal="bronze"] .cc-leaderboard-name { font-weight: 800; }
.cc-leaderboard-table tr[data-medal="gold"] .cc-leaderboard-coins { color: #8a5a0c; }
/* The player's own row uses forest green instead of sharing the medal gold. */
.cc-leaderboard-table tr[data-self="true"]:not([data-medal]) { background: linear-gradient(90deg, rgba(46, 116, 88, .13), transparent 60%); }
.cc-leaderboard-table tr[data-self="true"] .cc-leaderboard-name { font-weight: 800; }
.cc-leaderboard-table tr[data-self="true"] td:first-child { border-top-left-radius: 9px; border-bottom-left-radius: 9px; box-shadow: inset 4px 0 0 var(--cc-forest); }
.cc-leaderboard-table tr[data-self="true"] td:last-child { border-top-right-radius: 9px; border-bottom-right-radius: 9px; }
@media (max-width: 640px) {
    .cc-leaderboard-detail.cc-modal { padding: 16px 12px; }
    .cc-records .cc-global-record { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
    .cc-leaderboard-table th, .cc-leaderboard-table td { padding: 11px 7px; }
    .cc-leaderboard-table th:first-child { width: 46px; }
    .cc-leaderboard-table th:last-child { width: 112px; }
    .cc-leaderboard-name { font-size: 16px; }
    .cc-leaderboard-table tr[data-medal="gold"] .cc-leaderboard-name { font-size: 17px; }
    .cc-leaderboard-coins { font-size: 18px; }
    .cc-leaderboard-coins small { font-size: 10px; }
}

/* 历史记录复用已保存的正式成绩与战斗明细。 */
.cc-history-detail.cc-modal { display: flex; flex-direction: column; width: min(680px, 100%); max-height: min(800px, 100%); padding: 20px; overflow: hidden; color: var(--cc-ink); background: var(--cc-paper-strong); }
.cc-history-detail .cc-card-detail-heading { flex: 0 0 auto; margin-bottom: 12px; }
.cc-history-detail h2 { margin: 0; font-size: clamp(24px, 4vw, 30px); }
.cc-history-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 4px; }
.cc-history-hint, #ccHistoryStatus { margin: 0 0 12px; font-size: 14px; line-height: 1.6; }
.cc-history-detail .cc-history-list { display: block; padding: 0; margin: 0; list-style: none; }
.cc-history-detail .cc-history-list li { display: block; padding: 0; margin: 0; border-bottom: 1px solid rgba(23, 62, 53, .2); }
.cc-history-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; width: 100%; min-height: 80px; padding: 14px 8px; text-align: left; border: 0; border-radius: 0; background: transparent; color: var(--cc-ink); cursor: pointer; }
.cc-history-list button:hover, .cc-history-list button:focus-visible { background: rgba(245, 221, 160, .3); }
.cc-history-list time { font-size: 14px; }
.cc-history-list strong { font-size: 20px; font-family: "LXGW WenKai", serif; }
.cc-history-list small { font-size: 13px; color: var(--cc-muted); }
.cc-history-list small:last-child { text-align: right; }
.cc-history-back { align-self: flex-start; flex: 0 0 auto; margin: 0 0 12px; min-height: 44px; }
#ccHistoryMore { margin: 8px 0; min-height: 44px; }
@media (max-width: 640px) {
    .cc-history-detail.cc-modal { padding: 16px 12px; }
}

/* The saved outcome owns the main stage; the journal remains a secondary read. */
.cc-app[data-phase="complete"] .cc-game { grid-template-columns: minmax(0, 1.4fr) minmax(340px, 1fr); gap: 24px; padding: 24px; }
.cc-app[data-phase="complete"] .cc-map-panel { position: relative; top: auto; grid-row: 1; min-height: 0; height: auto; max-height: none; border: 1px solid #b5bca0; background: var(--cc-paper-strong); box-shadow: 0 8px 28px #173e3514; }
.cc-app[data-phase="complete"] .cc-map-panel > :is(picture, .cc-map-wash, .cc-map-heading, .cc-region-track, .cc-encounter),
.cc-app[data-phase="complete"] :is(.cc-team-status, .cc-table-heading, .cc-command-bar, .cc-receipt) { display: none; }
.cc-app[data-phase="complete"] .cc-table { display: flex; flex-direction: column; grid-row: 1; min-width: 0; padding: 24px; margin: 0; border: 1px solid #b5bca0; box-shadow: none; border-radius: 8px; }
.cc-result-review { order: -1; }
.cc-result-review > h2 { margin: 6px 0 20px; font: 400 28px "LXGW WenKai", serif; }
.cc-result-review .cc-report-advice { margin-top: 0; border-top: 0; padding-top: 0; }
.cc-result { position: relative; color: var(--cc-ink); scroll-margin-top: 90px; outline: none; }
.cc-result:focus-visible { outline: 3px solid var(--cc-gold); outline-offset: -4px; }
.cc-result-landscape { position: relative; height: clamp(145px, 19dvh, 230px); overflow: hidden; }
.cc-result-landscape img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.cc-result-landscape::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, var(--cc-paper-strong)); }
.cc-result-landscape > span { position: absolute; top: 18px; left: 24px; padding: 6px 10px; background: #fffaf0e8; color: #344c3b; font: 400 14px "LXGW WenKai", serif; }
.cc-result-body { position: relative; padding: 0 clamp(20px, 3vw, 52px) 30px; }
.cc-result-kicker { margin: 2px 0 12px; color: #806329; font-size: 13px; letter-spacing: .12em; }
.cc-result h2 { margin: 0; font: 400 clamp(28px, 2.8vw, 44px)/1.3 "LXGW WenKai", serif; text-wrap: balance; }
.cc-result-text { margin: 14px 0 22px; color: #526457; font-size: 14px; line-height: 1.8; text-wrap: pretty; }
.cc-result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0 0 18px; padding: 18px 0; border-block: 1px solid #c8c8ad; align-items: center; }
.cc-result-stats > div + div { padding-left: 24px; border-left: 1px solid #c8c8ad; }
.cc-result-stats dt { color: #596959; font-size: 12px; }
.cc-result-stats dd { margin: 6px 0 0; font: 400 clamp(23px, 2.5vw, 34px)/1.2 "LXGW WenKai", serif; }
.cc-result-stats strong { color: #927023; font-size: clamp(48px, 4.5vw, 68px); font-weight: 400; font-variant-numeric: tabular-nums; }
.cc-result-stats dd span { margin-left: 8px; font-size: 14px; }
.cc-result ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.cc-result li { display: grid; grid-template-columns: 72px 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 62px; padding: 8px 12px; border: 0; border-bottom: 1px solid #d4d6bf; background: transparent; font-size: 14px; }
.cc-result li[data-human="true"] { background: #eee2b8; border-radius: 5px; }
.cc-result li img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.cc-result li b { font-size: 12px; font-weight: 400; }
.cc-result li > span { overflow-wrap: anywhere; }
.cc-result li strong { font: 400 24px "LXGW WenKai", serif; font-variant-numeric: tabular-nums; }
.cc-result li small { margin-left: 6px; font-size: 11px; font-weight: 400; color: #53604d; }
.cc-result-note { margin: 12px 0 22px; font-size: 12px; color: #596959; line-height: 1.6; }
.cc-result-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cc-result-actions button { min-height: 48px; flex: 1; padding: 12px 16px; font-size: 15px; white-space: nowrap; }
.cc-result[data-tone="defeat"] .cc-result-kicker { color: #8d4c38; }
.cc-share-modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 16px; background: #102c24bd; }
.cc-share-sheet { display: flex; flex-direction: column; width: min(650px, 100%); min-width: 0; max-height: calc(100dvh - 32px); color: var(--cc-ink); background: var(--cc-paper-strong); border: 1px solid #b5bca0; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 70px #102c2450; }
.cc-share-sheet > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-bottom: 1px solid #c8c8ad; }
.cc-share-sheet h2 { margin: 0; font: 400 23px "LXGW WenKai", serif; }
.cc-share-sheet button { min-height: 44px; min-width: 44px; font-size: 14px; padding: 10px 18px; }
.cc-share-body { min-height: 0; overflow: auto; padding: 16px; background: #e5e7d7; }
.cc-share-preview { position: relative; width: min(100%, calc((100dvh - 260px) * .75)); margin: auto; aspect-ratio: 3 / 4; }
.cc-share-preview canvas { display: block; width: 100%; height: auto; box-shadow: 0 4px 18px #173e3520; }
.cc-share-loading { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; background: var(--cc-paper-strong); }
.cc-share-sheet > footer { padding: 12px 20px max(16px, env(safe-area-inset-bottom)); }
.cc-share-sheet > footer p { margin: 0 0 12px; font-size: 13px; color: #526457; }
.cc-share-sheet > footer > div { display: flex; gap: 12px; }
.cc-share-sheet > footer button { flex: 1; }
@media (max-width: 1024px) {
    .cc-app[data-phase="complete"] .cc-game { display: flex; flex-direction: column; gap: 16px; padding: 16px; }
    .cc-app[data-phase="complete"] :is(.cc-map-panel, .cc-table) { width: 100%; min-width: 0; max-width: none; }
    .cc-result h2 { font-size: 36px; }
}
@media (max-width: 640px) {
    .cc-app[data-phase="complete"] .cc-game { padding: 10px 10px 28px; gap: 14px; }
    .cc-app[data-phase="complete"] .cc-table { padding: 20px 16px; }
    .cc-result { scroll-margin-top: 76px; }
    .cc-result-landscape { height: 150px; }
    .cc-result-body { padding: 0 18px 22px; }
    .cc-result h2 { font-size: 28px; }
    .cc-result-text { margin: 10px 0 16px; font-size: 13px; }
    .cc-result-stats { gap: 10px; padding: 14px 0; }
    .cc-result-stats > div + div { padding-left: 14px; }
    .cc-result-stats dd { font-size: 23px; }
    .cc-result-stats strong { font-size: 48px; }
    .cc-result li { grid-template-columns: 62px 32px minmax(0, 1fr) auto; gap: 7px; padding: 8px; font-size: 13px; }
    .cc-result li img { width: 32px; height: 32px; }
    .cc-result li strong { font-size: 21px; }
    .cc-result li strong small { display: none; }
    .cc-result-actions { gap: 8px; }
    .cc-result-actions button { padding: 10px; font-size: 14px; }
    .cc-share-modal { padding: 10px; }
    .cc-share-sheet { max-height: calc(100dvh - 20px); }
    .cc-share-sheet > header { padding: 10px 14px; }
    .cc-share-body { padding: 12px; }
}

/* History details are one illustrated result sheet, with a single scroll area. */
.cc-history-detail.cc-modal { padding: 0; border: 1px solid #b5bca0; border-radius: 12px; box-shadow: 0 24px 80px #102c2440; }
#ccHistoryDialog[data-view="details"] .cc-history-detail { width: min(1080px, 100%); }
.cc-history-detail > .cc-card-detail-heading { margin: 0; padding: 18px 24px 12px; }
.cc-history-detail .cc-modal-kicker { color: #806329; }
.cc-history-back.cc-secondary { margin: 0 24px 8px; padding: 8px 0; border: 0; background: none; box-shadow: none; font-size: 13px; color: #526457; }
.cc-history-back::before, .cc-history-back::after { content: none; }
.cc-history-body { padding: 0; border-top: 1px solid #d4d6bf; }
#ccHistoryListView { padding: 12px 24px 20px; }
.cc-history-content { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.cc-history-result { min-width: 0; }
.cc-history-result .cc-result-landscape { height: 160px; }
.cc-history-result .cc-result-body { padding: 0 28px 28px; }
.cc-history-result .cc-result-kicker { margin: 0 0 8px; }
.cc-history-result .cc-history-result-title { margin: 0 0 8px; font: 400 clamp(28px, 3vw, 38px)/1.3 "LXGW WenKai", serif; text-wrap: balance; }
.cc-history-completed { display: block; margin-bottom: 20px; color: #697360; font-size: 12px; font-variant-numeric: tabular-nums; }
.cc-history-result .cc-result-stats strong { font-size: 58px; }
.cc-history-result .cc-result-stats dd { font-size: 28px; }
.cc-history-result .cc-result-note { margin-bottom: 18px; }
.cc-history-review { min-width: 0; min-height: 100%; padding: 24px 28px 28px; border-left: 1px solid #d4d6bf; background: #f5f0e0; }
.cc-history-review > h3:first-child { margin-top: 0; }
.cc-history-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; padding-bottom: 20px; border-bottom: 1px solid #d4d6bf; }
.cc-history-metrics dt { color: #697360; font-size: 12px; }
.cc-history-metrics dd { margin: 8px 0 0; font-size: 16px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.cc-history-review details > summary { padding: 10px 0; color: #2e7458; background: transparent; }
.cc-share-modal { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; }
.cc-share-modal::backdrop { background: transparent; }
@media (max-width: 800px) {
    .cc-history-content { grid-template-columns: minmax(0, 1fr); }
    .cc-history-review { border-left: 0; border-top: 1px solid #d4d6bf; }
}
@media (max-width: 640px) {
    .cc-history-detail > .cc-card-detail-heading { padding: 14px 16px 8px; }
    .cc-history-back.cc-secondary { margin-inline: 16px; }
    #ccHistoryListView { padding: 10px 16px 16px; }
    .cc-history-result .cc-result-landscape { height: 128px; }
    .cc-history-result .cc-result-body { padding: 0 18px 24px; }
    .cc-history-result .cc-history-result-title { font-size: 28px; }
    .cc-history-result .cc-result-stats strong { font-size: 48px; }
    .cc-history-result .cc-result-stats dd { font-size: 23px; }
    .cc-history-review { padding: 22px 18px; }
    .cc-history-metrics { gap: 8px; }
    .cc-history-metrics dd { font-size: 14px; }
}
.cc-history-notice { flex: 0 0 auto; margin: 0 24px 12px; padding: 10px 12px; border-left: 3px solid #bd5b45; color: #743526; background: #f8eadb; font-size: 13px; line-height: 1.5; }

/* Pointer Bridge: roles sit on the actual scene; the shared plan stays nearby. */
.cc-app[data-phase="bridge"] .cc-table-heading { display: none; }
.cc-pointer-bridge { color: var(--cc-ink); font-size: 15px; line-height: 1.6; }
.cc-bridge-story { margin: 12px 0 18px; max-width: 60ch; }
.cc-bridge-layout { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(280px, 1.1fr); align-items: start; gap: 22px; }
.cc-bridge-scene { position: sticky; top: 85px; margin: 0; min-width: 0; }
.cc-bridge-scene > img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 12px; }
.cc-bridge-scene figcaption { margin: 10px 0; font-size: 14px; text-align: center; }
.cc-app .cc-bridge-spot { position: absolute; min-width: 74px; min-height: 52px; padding: 5px 9px; color: var(--cc-ink); background: #fff7df; border: 2px solid #79613c; border-radius: 9px; font-size: 17px; line-height: 1.3; box-shadow: 0 3px 8px #30230f38; }
.cc-bridge-spot span { display: block; font-size: 11px; }
.cc-bridge-spot[data-bridge-role="scout"] { left: 8%; top: 73%; }
.cc-bridge-spot[data-bridge-role="brace"] { left: 12%; top: 42%; }
.cc-bridge-spot[data-bridge-role="haul"] { right: 12%; top: 25%; }
.cc-app .cc-bridge-spot[aria-pressed="true"] { background: #244f3d; color: #fff8e7; border-color: #efc55f; }
.cc-bridge-decision { min-width: 0; }
.cc-bridge-decision h3 { margin: 0 0 8px; color: var(--cc-ink); font-size: 19px; }
.cc-bridge-role-hint { min-height: 48px; margin: 0 0 12px; font-size: 14px; }
.cc-bridge-approaches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cc-app .cc-bridge-approaches button { min-height: 60px; padding: 8px; color: var(--cc-ink); background: #f5ead3; border: 1px solid #a89673; border-radius: 8px; font-size: 15px; }
.cc-bridge-approaches small { display: block; font-weight: 400; font-size: 11px; }
.cc-app .cc-bridge-approaches button[aria-pressed="true"] { border: 2px solid #315c45; background: #e4ead8; }
.cc-bridge-risk { margin: 14px 0; padding: 10px 0; border-block: 1px solid #bdaa7c; font-size: 14px; }
.cc-bridge-warning { color: #9d3025; font-weight: 700; }
.cc-bridge-members { display: grid; gap: 10px; padding: 0; margin: 14px 0; list-style: none; }
.cc-bridge-members li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid #bdaa7c66; }
.cc-bridge-members img { width: 48px; height: 48px; object-fit: contain; border-radius: 50%; }
.cc-bridge-members strong { display: block; font-size: 15px; }
.cc-bridge-members p { margin: 3px 0 0; font-size: 14px; line-height: 1.55; }
.cc-bridge-gains { display: block; color: #28543b; font-size: 14px; font-weight: 700; }
.cc-bridge-members [data-damaged="true"] .cc-bridge-gains { color: #94372c; }
.cc-bridge-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cc-app .cc-bridge-actions button { min-height: 48px; padding: 10px 16px; font-size: 15px; }
.cc-app .cc-bridge-actions .cc-bridge-skip { color: var(--cc-ink); background: transparent; border: 1px solid #a89673; box-shadow: none; }
.cc-pointer-bridge button:focus-visible { outline: 3px solid #356e50; outline-offset: 3px; }
@media (min-width: 1051px) and (max-width: 1300px), (max-width: 700px) {
    .cc-bridge-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .cc-bridge-scene { position: relative; top: auto; width: min(100%, 360px); justify-self: center; }
}
@media (max-width: 760px) {
    .cc-app[data-phase="bridge"] .cc-map-panel { order: -2; }
    .cc-bridge-actions { flex-direction: column; }
    .cc-bridge-actions button { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
    .cc-pointer-bridge[data-just-crossed="true"] .cc-bridge-members li { animation: cc-bridge-arrival .6s ease both; }
    .cc-pointer-bridge[data-just-crossed="true"] .cc-bridge-members li:nth-child(2) { animation-delay: .35s; }
    .cc-pointer-bridge[data-just-crossed="true"] .cc-bridge-members li:nth-child(3) { animation-delay: .7s; }
}
@keyframes cc-bridge-arrival {
    from { background-color: #e9ce85; transform: translateY(5px); }
    to { background-color: transparent; transform: translateY(0); }
}

.cc-toast--achievement { display: flex; align-items: center; gap: 12px; border-color: #af8939; color: var(--cc-forest-dark); background: var(--cc-paper); }
/* Companion conversations use the party's paper and portrait language. */
.cc-companion-plans { width: 100%; min-width: 0; margin-top: 10px; border-top: 1px solid #173e3533; background: #f5f1e2; }
.cc-companion-toggle { display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 10px 14px; cursor: pointer; list-style: none; }
.cc-companion-toggle::-webkit-details-marker { display: none; }
.cc-companion-toggle > svg { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cc-companion-toggle > span:first-of-type { font: 700 18px/1.4 "LXGW WenKai", serif; }
.cc-companion-toggle small { margin-left: auto; font-size: 12px; color: #586653; white-space: nowrap; }
.cc-companion-chevron { width: 8px; height: 8px; margin: 0 3px 4px; flex: 0 0 auto; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.cc-companion-plans[open] .cc-companion-chevron { transform: rotate(225deg); margin-bottom: -3px; }
.cc-companion-body { padding: 0 14px 4px; }
.cc-companion-help { margin: 0 0 14px; color: #586653; font-size: 13px; line-height: 1.7; }
.cc-companion-discussion { min-width: 0; padding: 14px 0; border-top: 1px solid #173e3526; overflow-wrap: anywhere; }
.cc-companion-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cc-companion-heading img { flex: 0 0 auto; width: 40px; height: 40px; object-fit: cover; border: 1px solid #8d9d7e; border-radius: 50%; }
.cc-companion-heading strong { min-width: 0; font: 700 17px/1.4 "LXGW WenKai", serif; }
.cc-companion-state { margin-left: auto; flex: 0 0 auto; font-size: 12px; color: #586653; }
.cc-companion-state[data-state="accepted"], .cc-companion-state[data-state="kept"] { color: #2d644c; }
.cc-companion-state[data-state="declined"], .cc-companion-state[data-state="changed"] { color: #925136; }
.cc-companion-request { min-width: 0; margin: 0; padding: 0; border: 0; }
.cc-companion-request legend { padding: 0; margin-bottom: 8px; color: #586653; font-size: 13px; }
.cc-companion-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.cc-companion-option { position: relative; min-width: 0; cursor: pointer; touch-action: manipulation; }
.cc-companion-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cc-companion-option > span { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 10px 4px; border: 1px solid #b6bea9; border-radius: 7px; color: #4e604f; background: #fffaf0; transition: background-color 160ms, border-color 160ms; }
.cc-companion-option svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cc-companion-option b { font-size: 14px; line-height: 1.4; font-weight: 600; }
.cc-companion-option i { position: absolute; top: 3px; right: 5px; visibility: hidden; font-style: normal; font-size: 12px; }
.cc-companion-option input:checked + span { border-color: #39634c; color: #234b38; background: #e3ead4; box-shadow: inset 0 0 0 1px #39634c; }
.cc-companion-option input:checked + span i { visibility: visible; }
.cc-companion-option input:disabled + span { opacity: .6; cursor: wait; }
.cc-companion-hint { min-height: 22px; margin: 8px 0 12px; color: #586653; font-size: 13px; line-height: 1.65; }
.cc-app .cc-companion-send { width: 100%; min-height: 44px; padding: 9px 12px; font-size: 14px; line-height: 1.5; box-shadow: inset 0 -2px 0 #173e3540; }
.cc-companion-answer { padding: 12px 14px; border-left: 3px solid #8eaa77; border-radius: 0 8px 8px 0; background: #e7ecd9; scroll-margin: 90px 0 100px; }
.cc-companion-requested { display: block; margin-bottom: 5px; color: #586653; font-size: 12px; }
.cc-companion-answer p { margin: 0; color: #234b38; font-size: 15px; line-height: 1.75; }
.cc-companion-answer small { display: block; margin-top: 7px; color: #586653; font-size: 12px; line-height: 1.6; }
.cc-companion-memory { margin-top: 4px; color: #586653; font-size: 13px; }
.cc-companion-memory summary { display: flex; align-items: center; gap: 7px; min-height: 44px; cursor: pointer; list-style: none; }
.cc-companion-memory summary::-webkit-details-marker { display: none; }
.cc-companion-memory summary::before { content: "＋"; }
.cc-companion-memory[open] summary::before { content: "−"; }
.cc-companion-memory p { margin: 0 0 7px; line-height: 1.7; }
.cc-companion-plans :focus-visible, .cc-companion-option input:focus-visible + span { outline: 2px solid #446e51; outline-offset: 3px; }
@media (hover: hover) {
    .cc-companion-toggle:hover, .cc-companion-memory summary:hover { color: #2e7458; }
    .cc-companion-option:hover input:not(:disabled) + span { border-color: #39634c; background: #eaf0df; }
}
@media (prefers-reduced-motion: reduce) {
    .cc-companion-option > span { transition: none; }
}
#ccEventDescription { white-space: pre-line; }

/* Landmarks stay on the illustrated map; only the selected place opens a card. */
.cc-app[data-phase="route"] .cc-route-map { height: clamp(330px, 51dvh, 590px); margin-top: 12px; }
.cc-app[data-phase="route"] .cc-route-list { position: absolute; inset: 0; display: block; width: 100%; height: 100%; margin: 0; padding: 0; }
.cc-app[data-phase="route"] .cc-route-origin { position: absolute; z-index: 2; left: 50%; bottom: 3%; width: 100px; margin: 0; transform: translateX(-50%); }
.cc-route-stop { position: absolute; width: 132px; transform: translate(-50%, -50%); }
.cc-route-stop:nth-child(1) { left: 18%; top: 68%; }
.cc-route-stop:nth-child(2) { left: 23%; top: 23%; }
.cc-route-stop:nth-child(3) { left: 53%; top: 16%; }
.cc-route-stop:nth-child(4) { left: 80%; top: 38%; }
.cc-route-stop:nth-child(5) { left: 79%; top: 79%; }
.cc-route-node { display: flex; align-items: center; flex-direction: column; width: 100%; padding: 0; border: 0; background: none; color: var(--cc-forest-dark); cursor: pointer; font: inherit; touch-action: manipulation; }
.cc-route-node img { width: clamp(64px, 7cqw, 104px); height: auto; aspect-ratio: 1; object-fit: cover; border: 4px solid var(--cc-paper-strong); border-radius: 48% 52% 45% 55%; outline: 2px solid #526a44; box-shadow: 0 5px 10px #173e3533; transition: transform 160ms ease, outline-color 160ms ease; }
.cc-route-node strong { position: relative; margin-top: -3px; padding: 4px 9px; border: 1px solid #a09168; border-radius: 3px 7px 4px 3px; background: var(--cc-paper-strong); box-shadow: 1px 2px 0 #173e3526; font-size: 17px; line-height: 1.3; white-space: nowrap; }
.cc-route-node small { margin-top: 3px; padding: 2px 6px; color: var(--cc-ink); background: #fffaf0e8; border-radius: 3px; font-size: 11px; }
.cc-route-node[data-kind="battle"] img { outline-color: #995846; }
.cc-route-node[data-completed="true"] { color: #565a52; }
.cc-route-node[data-completed="true"] img { filter: grayscale(1); opacity: .72; outline-color: #73786d; }
.cc-route-node[data-completed="true"] strong { background: #e2e1d9; }
.cc-route-node:focus-visible { outline: 3px solid var(--cc-gold); outline-offset: 6px; border-radius: 12px; }
.cc-route-node[aria-expanded="true"] img { outline: 3px solid var(--cc-gold); transform: translateY(-3px); }
.cc-route-roads .cc-road-edge { stroke: #705f3c; stroke-width: 14px; opacity: .7; }
.cc-route-roads .cc-road-paper { stroke: #f4dfad; stroke-width: 10px; }
.cc-route-roads .cc-road-trail { stroke: #aa9061; stroke-width: 2px; }
.cc-route-roads [data-completed="true"] { filter: grayscale(1); opacity: .5; }
.cc-route-preview { position: fixed; inset: auto; margin: 0; padding: 0; width: min(400px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow: auto; overscroll-behavior: contain; border: 2px solid var(--cc-forest-dark); border-radius: 12px; color: var(--cc-ink); background: var(--cc-paper-strong); box-shadow: 0 12px 36px #102d3450; font-family: "LXGW WenKai", serif; }
.cc-route-preview::backdrop { background: transparent; pointer-events: none; }
.cc-route-preview .cc-route-option { display: grid; align-items: stretch; justify-content: normal; text-align: left; grid-template-columns: 112px minmax(0, 1fr); min-height: 220px; margin: 0; padding: 0; border: 0; box-shadow: none; }
.cc-route-preview .cc-route-copy { padding: 14px 12px; }
.cc-route-preview .cc-route-kicker { padding-right: 28px; }
.cc-route-preview .cc-route-copy > strong { margin-top: 8px; font-size: 24px; }
.cc-route-close { position: absolute; z-index: 3; right: 2px; top: 2px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--cc-forest-dark); font: 26px/1 sans-serif; cursor: pointer; touch-action: manipulation; }
.cc-route-close:focus-visible, .cc-route-select:focus-visible { outline: 3px solid var(--cc-gold); outline-offset: -3px; }
.cc-route-select { min-height: 44px; padding: 0; border: 0; border-radius: 5px; background: var(--cc-forest-dark); color: var(--cc-paper-strong); cursor: pointer; touch-action: manipulation; }
.cc-route-select b { min-height: 44px; padding: 10px 16px; border: 0; font-size: 15px; }
.cc-route-select:disabled { opacity: .65; cursor: wait; }
@media (min-width: 1051px) and (min-height: 600px) {
    .cc-app[data-phase="route"] .cc-game { grid-template-columns: minmax(0, 1fr) clamp(300px, 24vw, 360px); }
    .cc-app[data-phase="route"] .cc-map-panel { position: sticky; top: 82px; height: calc(100dvh - 94px); min-height: 0; grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 14px; }
    .cc-app[data-phase="route"] .cc-map-heading { padding: 7px 10px; }
    .cc-app[data-phase="route"] .cc-map-heading h1 { font-size: 25px; }
    .cc-app[data-phase="route"] .cc-region-track { padding: 4px; }
    .cc-app[data-phase="route"] .cc-region-track > span { padding: 4px; }
    .cc-app[data-phase="route"] .cc-region-track img { width: 30px; height: 30px; }
    .cc-app[data-phase="route"] .cc-map-action { display: grid; grid-template-rows: auto auto minmax(0, 1fr); align-self: stretch; min-height: 0; padding: 0; }
    .cc-app[data-phase="route"] .cc-map-action > h2 { font-size: 25px; }
    .cc-app[data-phase="route"] .cc-route-map { height: auto; min-height: 0; }
}
@media (min-width: 1051px) and (max-width: 1400px) {
    .cc-app[data-phase="route"] .cc-resources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .cc-app[data-phase="route"] .cc-route-map { height: 360px; }
    .cc-route-stop { width: 104px; }
    .cc-route-stop:nth-child(1) { left: 18%; top: 70%; }
    .cc-route-stop:nth-child(2) { left: 20%; top: 26%; }
    .cc-route-stop:nth-child(3) { left: 58%; top: 15%; }
    .cc-route-stop:nth-child(4) { left: 81%; top: 48%; }
    .cc-route-stop:nth-child(5) { left: 70%; top: 79%; }
    .cc-route-node img { width: 64px; border-width: 3px; }
    .cc-route-node strong { padding: 4px 6px; font-size: 14px; }
    .cc-app[data-phase="route"] .cc-route-origin { left: 43%; bottom: 1%; width: 60px; }
    .cc-route-origin img { width: 40px; height: 40px; }
    .cc-route-origin span { padding: 3px 5px; font-size: 10px; }
    .cc-route-preview .cc-route-option { grid-template-columns: 88px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .cc-route-node img { transition: none; }
}

.cc-symbol-tooltip[popover] { inset: auto; margin: 0; }
