:root {
  color-scheme: light;
  --page: #f6f5ef;
  --surface: #fffefb;
  --ink: #293f35;
  --muted: #8b9185;
  --green: #365d49;
  --green-soft: #edf1e6;
  --line: #e5e7dd;
  --orange: #b96d42;
  --orange-soft: #faeddd;
  --blue: #527584;
  --blue-soft: #e8f0f0;
  --animal-fill: #efd7ae;
  --animal-accent: #ddb980;
  --animal-muzzle: #fff6e7;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button { touch-action: manipulation; }
button:disabled { cursor: default; }
button, a, input { outline-offset: 4px; }
button:focus-visible, a:focus-visible { outline: 3px solid #8da88d; }
button:disabled { opacity: .38; }
button:not(:disabled), a, label > span { transition: background .18s, color .18s, border-color .18s, box-shadow .18s; }
button svg, .brand svg { pointer-events: none; }
button > span[data-icon], span[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon { width: 20px; height: 20px; display: block; flex-shrink: 0; }
.animal-art { display: block; width: 100%; height: 100%; }
.animal-photo { object-fit: cover; user-select: none; -webkit-user-drag: none; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }

.page-shell { max-width: 1192px; padding: 0 28px; margin: 0 auto; }
.site-header { height: 85px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { display: block; width: 45px; height: 45px; padding: 3px; color: #674a31; background: linear-gradient(145deg, #f6d797, #a17843); border-radius: 14px; box-shadow: 0 2px 3px #58472925; transform: rotate(-4deg); }
.brand-mark .animal-photo { border-radius: 11px; }
.brand-wordmark { display: flex; flex-direction: column; gap: 1px; }
.brand-wordmark strong { font-size: 23px; font-weight: 750; letter-spacing: 2px; line-height: 1.2; }
.brand-dot { color: var(--orange); font-size: 28px; margin-left: 2px; }
.brand-wordmark > span { font-size: 9px; letter-spacing: 2.5px; font-weight: 600; color: #899381; }
.header-actions { display: flex; align-items: center; gap: 13px; }
.slow-note { font-size: 12px; color: #838b7b; display: flex; align-items: center; gap: 8px; margin-right: 16px; }
.tiny-dot { width: 5px; height: 5px; background: #77936b; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 37px; height: 37px; border-radius: 50%; border: 1px solid var(--line); background: transparent; }
.icon-button:hover { background: #eaece3; }
.sound-button { border-color: transparent; color: #7a8574; }
.sound-button[aria-pressed="true"] { background: var(--green-soft); color: var(--green); }
.rules-button { border: 1px solid #dbe0d2; background: transparent; border-radius: 8px; display: flex; gap: 8px; align-items: center; padding: 9px 13px; font-size: 12px; }
.rules-button .icon { width: 16px; height: 16px; }
.rules-button:hover { background: var(--green-soft); border-color: #acbca6; }
.intro { display: flex; align-items: center; justify-content: space-between; padding: 29px 0 31px; }
.eyebrow { display: flex; align-items: center; gap: 6px; color: #7b886d; font-size: 9px; font-weight: 650; letter-spacing: 2px; line-height: 1.5; }
.eyebrow .icon { width: 14px; height: 14px; }
h1 { font-family: "STZhongsong", "Songti SC", "Noto Serif CJK SC", "SimSun", serif; font-size: 31px; font-weight: 600; letter-spacing: 2px; margin: 8px 0 9px; line-height: 1.3; }
.intro-description { color: #858b7e; font-size: 12px; letter-spacing: .6px; }
.intro-decoration { display: flex; align-items: center; gap: 10px; color: #8e9d7a; padding-right: 14px; }
.intro-decoration > span { writing-mode: vertical-rl; font-family: "SimSun", serif; font-size: 12px; letter-spacing: 3px; opacity: .85; }
.sprig { width: 108px; height: 85px; transform: rotate(-8deg); }
.sprig svg { width: 100%; height: 100%; }
.game-layout { display: grid; grid-template-columns: 244px minmax(0, 1fr) 248px; align-items: start; gap: 28px; }
.settings-column, .info-column { display: flex; flex-direction: column; gap: 21px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 3px 0 #333e2810; }
.setup-panel { padding: 21px 19px 0; }
.section-heading { display: flex; align-items: center; gap: 8px; }
.section-heading h2 { font-size: 14px; font-weight: 650; letter-spacing: .5px; line-height: 22px; }
.heading-icon { color: #768966; }
.heading-icon .icon { width: 17px; height: 17px; }
.heading-aside { margin-left: auto; color: #95998e; font-size: 10px; white-space: nowrap; }
.setup-panel fieldset { margin-top: 22px; }
legend { width: 100%; display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 500; color: #828b79; padding: 0; margin-bottom: 10px; }
legend > span { font-size: 10px; color: #a4a798; font-weight: 400; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-choice, .difficulty-choice, .side-choice { position: relative; cursor: pointer; min-width: 0; }
.mode-choice input, .difficulty-choice input, .side-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; bottom: 0; left: 0; }
label input:focus-visible + span { outline: 3px solid #9caf90; outline-offset: 3px; }
.mode-content { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 15px 2px 12px; border: 1px solid #e3e6da; border-radius: 9px; color: #838b7b; min-height: 100px; }
.mode-content .icon { width: 25px; height: 25px; margin-bottom: 7px; stroke-width: 1.5; }
.mode-content strong { font-size: 12px; font-weight: 600; line-height: 22px; }
.mode-content small { font-size: 9px; color: #929b87; letter-spacing: .25px; }
.mode-choice:hover .mode-content { border-color: #adbda0; }
.mode-choice input:checked + .mode-content { border-color: #7b936d; background: #eff3e8; color: #47653d; box-shadow: inset 0 0 0 .4px #7b936d; }
.difficulty-options { display: flex; gap: 6px; }
.difficulty-choice { flex: 1; }
.difficulty-choice > span { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11px; min-height: 36px; border: 1px solid #e4e6dc; border-radius: 6px; color: #8a907f; }
.difficulty-choice input:checked + span { color: var(--green); background: #edf1e6; border-color: #b6c6a8; }
.level-bars { display: inline-flex; gap: 2px; align-items: end; height: 11px; }
.level-bars i { display: block; width: 2px; background: currentColor; opacity: .25; border-radius: 1px; }
.level-bars i:nth-child(1) { height: 4px; opacity: .9; }
.level-bars i:nth-child(2) { height: 7px; }
.level-bars i:nth-child(3) { height: 10px; }
[value="medium"] + span .level-bars i:nth-child(2), [value="hard"] + span .level-bars i { opacity: .9; }
.field-description { margin-top: 10px; color: #939987; font-size: 10px; line-height: 1.6; }
.side-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-choice > span { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 10px 7px; border-radius: 6px; border: 1px solid #e4e6dc; font-size: 11px; color: #8a9184; }
.side-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }
.orange .side-dot, .side-dot.orange { color: var(--orange); }
.blue .side-dot, .side-dot.blue { color: var(--blue); }
.choice-check { width: 11px; visibility: hidden; }
.choice-check .icon { width: 12px; height: 12px; }
.side-choice input:checked + span .choice-check { visibility: visible; }
.side-choice.orange input:checked + span { color: var(--orange); border-color: #d6b18c; background: #fcf1e6; }
.side-choice.blue input:checked + span { color: var(--blue); border-color: #a8bfc4; background: #edf4f4; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border-radius: 8px; padding: 12px 19px; border: 1px solid transparent; font-size: 12px; line-height: 20px; }
.primary-button { background: var(--green); color: #fffdf4; font-weight: 550; box-shadow: 0 2px 0 #254835; }
.primary-button:hover { background: #284d3d; }
.primary-button:active { transform: translateY(1px); box-shadow: none; }
.secondary-button { border-color: #dce1d2; background: transparent; color: #78836f; }
.secondary-button:hover { background: #eff2e8; }
.primary-button .icon { width: 16px; height: 16px; }
.start-button { width: 100%; justify-content: space-between; margin-top: 23px; padding: 11px 16px; }
.settings-note { color: #a0a591; text-align: center; font-size: 9px; min-height: 35px; padding-top: 11px; padding-bottom: 10px; line-height: 1.5; }
.settings-note.is-dirty { color: var(--orange); }
.autosave-note { margin: 0 -19px; padding: 12px 10px; border-top: 1px solid #ebeee3; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 9px; color: #8e9982; background: #f9faf5; border-radius: 0 0 15px 15px; }
.autosave-note .icon { width: 13px; height: 13px; }
.local-mode-note { padding: 25px 9px 12px; text-align: center; }
.local-mode-note > span .icon { width: 31px; height: 31px; color: #8c9b7b; margin-bottom: 12px; }
.local-mode-note strong { display: block; font-size: 14px; font-family: "SimSun", serif; }
.local-mode-note p { font-size: 11px; color: #87907e; line-height: 2; margin-top: 13px; }
.little-note { display: flex; position: relative; gap: 11px; align-items: center; padding: 25px 7px 18px; }
.note-animal { flex-shrink: 0; width: 56px; height: 56px; padding: 3px; border-radius: 50%; background: #d7c49a; transform: rotate(-8deg); box-shadow: 0 2px 4px #75623a25; }
.note-animal .animal-photo { border-radius: 50%; }
.little-note .eyebrow { font-size: 7px; letter-spacing: 1.1px; color: #a7a893; }
.little-note h3 { font-family: "SimSun", serif; font-weight: 600; font-size: 13px; color: #777e65; margin: 8px 0; }
.little-note p { font-size: 10px; color: #9a9e8c; line-height: 1.9; }
.note-star { position: absolute; top: 4px; right: 18px; font-size: 26px; color: #d0b579; transform: rotate(18deg); }

.arena { display: flex; flex-direction: column; align-items: center; min-width: 0; padding-top: 2px; }
.arena-heading { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 25px; }
.turn-label { display: flex; align-items: center; gap: 7px; }
.turn-label strong { font-weight: 600; font-size: 14px; letter-spacing: .5px; }
.turn-dot { width: 7px; height: 7px; background: var(--orange); border-radius: 50%; box-shadow: 0 0 0 4px #eac8a72e; }
.turn-dot.blue { background: var(--blue); box-shadow: 0 0 0 4px #9bb8c02e; }
.turn-dot.thinking { animation: pulse-dot 1.2s ease-in-out infinite; }
.round-counter { font-size: 10px; color: #909583; padding-left: 13px; border-left: 1px solid #dce1d2; font-variant-numeric: tabular-nums; }
.active-mode { padding: 3px 5px; background: none; border: 0; display: inline-flex; align-items: center; gap: 2px; color: #98a08d; font-size: 10px; margin: 1px 0 7px; line-height: 18px; }
.active-mode .icon { width: 11px; height: 11px; }
.active-mode:hover { color: var(--green); }
.player-bar, .board-frame, .board-toolbar { width: min(100%, clamp(398px, calc((100vh - 280px) * .78), 472px)); }
.player-bar { display: flex; align-items: center; gap: 8px; padding: 0 6px; min-height: 43px; }
.top-player { margin-bottom: 8px; }
.bottom-player { margin-top: 8px; }
.player-avatar { width: 33px; height: 33px; border-radius: 50%; padding: 3px; border: 1px solid #d2dfdf; background: #e8eeee; color: var(--blue); --animal-fill: #d4e2df; --animal-accent: #b3cbcb; --animal-muzzle: #f2f6ed; }
.player-avatar.orange { background: #f8ecdc; border-color: #e5cdb3; color: var(--orange); --animal-fill: #f4d7aa; --animal-accent: #e4ba7c; --animal-muzzle: #fff8e8; }
.player-avatar .animal-photo { border-radius: 50%; }
.player-identity { display: flex; flex-direction: column; gap: 3px; }
.player-identity { min-width: 0; }
.player-identity strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.player-identity strong { font-size: 11px; font-weight: 550; }
.player-identity small { font-size: 8px; color: #a0a492; }
.player-action { font-size: 9px; color: #82966f; background: #eaf0e1; border-radius: 4px; padding: 3px 7px; margin-left: 3px; opacity: 0; }
.player-bar.is-active .player-action { opacity: 1; }
.player-count { margin-left: auto; font-size: 10px; color: #969c8b; display: flex; align-items: center; gap: 5px; }
.player-count .icon { width: 12px; height: 12px; opacity: .7; }
.player-count strong { color: #728368; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }

.board-frame { position: relative; background: #e6dfc9; border: 1px solid #d9cfb4; border-radius: 13px; padding: 16px 15px 21px 22px; box-shadow: 0 4px 0 #cfc5aa, 0 11px 22px #504d3410, inset 0 0 0 4px #f0ead7; }
.board-grid { display: grid; grid-template-rows: repeat(9, 1fr); aspect-ratio: 7 / 9; border: 1px solid #c8c7a5; border-radius: 4px; overflow: hidden; background: #cfd1b8; gap: 1px; }
.board-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; min-height: 0; }
.square { display: flex; align-items: center; justify-content: center; position: relative; isolation: isolate; width: 100%; height: 100%; min-width: 0; min-height: 0; border: 0; padding: 0; border-radius: 0; background: #f0eedb; -webkit-user-select: none; user-select: none; }
.square.land-even { background: #e8e9d3; }
.square.water { background: #b9d8d3; }
.square.water.land-even { background: #b1d2cc; }
.square.trap { background: #f9d0ce; box-shadow: inset 0 0 0 2px #c54d4d; }
.square.den { background: #e0e3cd; }
.square::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0; transition: background .15s; }
.square:not(.water):hover::before { background: #71844c11; }
.square.water:hover::before { background: #408e8b12; }
.square.is-last-from::before { background: #e6bc5550; }
.square.is-last-to::before { background: #edc96355; }
.square.is-selected::before { background: #a9bb7070; }
.square:focus-visible { outline: 2px solid #49683f; outline-offset: -3px; z-index: 3; }
.square > .water-waves { width: 69%; height: 55%; position: absolute; opacity: .28; stroke-width: .85; color: #408e8a; }
.grass { position: absolute; width: 14px; height: 12px; bottom: 7px; right: 5px; color: #a2b187; opacity: .48; }
.terrain-mark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; color: #b0a486; opacity: .8; }
.terrain-mark .icon { width: 28px; height: 28px; stroke-width: 1.1; }
.terrain-mark small { font-size: 7px; letter-spacing: 2px; margin-left: 2px; }
.den-blue .terrain-mark { color: #8baba4; }
.den-orange .terrain-mark { color: #c6a26e; }
.square.trap .terrain-mark { color: #a62332; opacity: 1; gap: 1px; }
.square.trap .terrain-mark .icon { width: 25px; height: 25px; max-width: 60%; max-height: 55%; stroke-width: 2; }
.square.trap .terrain-mark small { font-size: 8px; line-height: 1.2; font-weight: 700; letter-spacing: 0; margin: 0; }
.square.trap.is-selected::before { background: #f0a5a544; }
.square.trap.is-last-to::before, .square.trap.is-last-from::before { background: #cc363622; }
.den .terrain-mark .icon { width: 28px; height: 28px; stroke-width: 1.3; }
.den .terrain-mark small { font-size: 8px; }
.piece { position: relative; z-index: 2; display: block; width: 89%; aspect-ratio: 1; border-radius: 50%; background: linear-gradient(145deg, #ffe6ac 3%, #dda654 30%, #985629 64%, #edc182); border: 1px solid #a36532; color: #fff8e8; box-shadow: 0 3px 0 #87582db3, 0 4px 6px #59412238, inset 0 0 0 1px #ffedbd; padding: 3px; transition: transform .18s, box-shadow .18s; }
.piece::after { content: ''; position: absolute; inset: 3px; border: 1px solid #ffefc957; border-radius: 50%; pointer-events: none; }
.piece.blue { background: linear-gradient(145deg, #e1f3f8 3%, #8ebaca 30%, #416579 64%, #b9d8e0); border-color: #4c7688; box-shadow: 0 3px 0 #3e6475b3, 0 4px 6px #29465238, inset 0 0 0 1px #d3edf8; }
.piece.blue::after { border-color: #dbf5ff57; }
.piece .animal-art { width: 100%; height: 100%; aspect-ratio: 1; border-radius: 50%; filter: saturate(1.12) contrast(1.09); }
.piece-name { position: absolute; z-index: 3; bottom: -3px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; line-height: 15px; min-width: 22px; padding: 0 5px; border-radius: 5px; color: #fff6da; background: linear-gradient(#a9753e, #6e4425); border: 1px solid #e0b071; box-shadow: 0 1px 2px #5036203b; }
.blue .piece-name { color: #f1fbff; background: linear-gradient(#5d8797, #2e5368); border-color: #9ac5d3; }
.piece-rank { position: absolute; z-index: 4; right: -3px; top: -3px; width: 15px; height: 15px; border: 1px solid #a87137; border-radius: 50%; background: linear-gradient(#fff4c4, #e8bd70); color: #63401f; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 750; line-height: 1; font-family: "Segoe UI", sans-serif; box-shadow: 0 1px 2px #4f382d38; }
.blue .piece-rank { border-color: #5b8394; color: #254958; background: linear-gradient(#e9fbff, #a8d0dd); }
.square:hover .piece { transform: translateY(-2px); }
.square.is-selected { z-index: 4; }
.square.is-selected .piece { transform: translateY(-3px); box-shadow: 0 0 0 3px #618552, 0 5px 9px #3e593c40; }
.move-dot { position: absolute; z-index: 1; width: 11px; height: 11px; background: #799756; box-shadow: 0 0 0 5px #86a76925; border-radius: 50%; pointer-events: none; }
.square.can-capture::after { content: ''; position: absolute; z-index: 3; inset: 4%; border: 2px dashed #c58c56; border-radius: 50%; pointer-events: none; }
.square.hint-target::after { content: ''; position: absolute; z-index: 3; inset: 4px; border: 2px dashed #728d3d; border-radius: 7px; pointer-events: none; }
.square.has-trapped-piece { background: #f3b2b3; }
.square.has-trapped-piece .terrain-mark { visibility: hidden; }
.square.has-trapped-piece .piece { width: 69%; margin-bottom: 18%; }
.square.has-trapped-piece .piece-rank { color: #fff; background: #b32638; border-color: #fff0ee; }
.square.has-trapped-piece .piece-name { bottom: -1px; font-size: 8px; line-height: 11px; min-width: 17px; padding: 0 3px; }
.trapped-label { position: absolute; bottom: 2px; left: 2px; right: 2px; z-index: 4; font-size: 8px; line-height: 12px; color: #fff; background: #b32638; letter-spacing: 0; font-weight: 700; pointer-events: none; }
.square.has-trapped-piece.can-capture::after { border-color: #a71f30; }
.trap-status { display: flex; align-items: flex-start; gap: 7px; width: 100%; max-width: 464px; min-height: 34px; padding: 8px 10px; margin: 8px auto 0; border-left: 3px solid #c74e53; background: #f9eeeb; color: #866363; font-size: 10px; line-height: 1.7; text-align: left; }
.trap-status .icon { width: 16px; height: 16px; color: #b32638; margin-top: 1px; }
.trap-status.is-danger { background: #fce2df; color: #a12433; border-color: #b32638; }
.trap-status > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.square.can-move:hover::before { background: #92b16066; }
.coordinate-y { position: absolute; top: 16px; left: 3px; bottom: 21px; width: 17px; display: grid; grid-template-rows: repeat(9, 1fr); align-items: center; justify-items: center; }
.coordinate-x { position: absolute; bottom: 4px; left: 22px; right: 15px; height: 14px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: center; justify-items: center; }
.coordinate-x span, .coordinate-y span { font-size: 8px; color: #9c997e; font-family: "Segoe UI", sans-serif; font-weight: 500; }
.board-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0 3px; gap: 4px; margin-top: 11px; }
.board-toolbar button { display: flex; align-items: center; justify-content: center; gap: 6px; background: transparent; border: 1px solid transparent; border-radius: 6px; font-size: 11px; padding: 9px 6px; color: #77866b; line-height: 20px; }
.board-toolbar button:not(:disabled):hover { background: #e8eddf; color: #48623e; }
.board-toolbar .icon { width: 16px; height: 16px; }
.board-message { font-size: 10px; line-height: 1.7; color: #a0a58e; text-align: center; min-height: 20px; margin: 9px 0 2px; padding: 0 3px; }
.board-message.is-hint { color: #738850; }

.animal-guide { padding: 18px 16px 0; }
.rank-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px 7px; margin: 18px -1px 15px; }
.rank-animal { display: flex; flex-direction: column; align-items: center; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 4px 2px 5px; color: #8a8269; --animal-fill: #eee3c5; --animal-accent: #d8c192; --animal-muzzle: #fff9ea; }
.rank-animal:hover { background: #f5f4e9; }
.rank-animal.is-active { background: #f3f1df; border-color: #e5e1c6; color: #967342; --animal-fill: #f2dbae; --animal-accent: #d7b073; }
.rank-art { position: relative; width: 43px; height: 43px; padding: 2px; background: linear-gradient(145deg, #f5e0af, #a88b54); border: 1px solid #c3ab7a; border-radius: 50%; box-shadow: 0 2px 2px #81704f29; }
.rank-art .animal-photo { border-radius: 50%; filter: saturate(1.1) contrast(1.08); }
.rank-art > small { position: absolute; top: -3px; right: -4px; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #d5c8a9; background: #fff7e1; color: #7a6341; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; }
.rank-animal > span:last-child { font-size: 11px; margin-top: 7px; color: #677455; }
.rank-animal.is-active > span:last-child { color: #87672f; font-weight: 600; }
.animal-detail { padding: 0; overflow: hidden; border-radius: 8px; background: #f6f6ed; min-height: 75px; }
.detail-portrait { position: relative; height: 112px; overflow: hidden; background: #384235; }
.detail-portrait > .animal-photo { object-position: 50% 42%; filter: saturate(1.08) contrast(1.05); }
.detail-portrait-label { position: absolute; inset: auto 0 0; min-height: 55px; padding: 20px 13px 10px; display: flex; align-items: flex-end; justify-content: space-between; background: linear-gradient(transparent, #16261ae6); color: #fff3d5; }
.detail-portrait-label > span { font-size: 9px; letter-spacing: 1.7px; font-weight: 600; }
.detail-portrait-label > strong { font-family: "SimSun", serif; font-size: 24px; line-height: 1; }
.detail-copy { padding: 12px; }
.animal-detail h3 { font-size: 11px; font-weight: 600; color: #677350; margin-bottom: 6px; display: flex; gap: 5px; align-items: center; }
.animal-detail h3 span { color: #c3c5b2; font-weight: 400; }
.animal-detail p { font-size: 11px; color: #899377; line-height: 1.8; }
.exception-note { display: flex; align-items: center; justify-content: center; gap: 6px; border-top: 1px solid #edeedf; padding: 13px 0; margin-top: 13px; color: #a6a58b; font-size: 9px; }
.exception-note .icon { width: 12px; height: 12px; }
.history-panel { padding: 18px 16px 0; }
.history-list { height: 154px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #dbe1d0 transparent; margin-top: 12px; padding-right: 2px; overscroll-behavior: contain; }
.empty-history { min-height: 144px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #acb4a0; }
.empty-history .icon { width: 30px; height: 30px; stroke-width: 1.2; color: #b7c2a7; margin-bottom: 13px; }
.empty-history strong { font-size: 11px; font-weight: 400; margin-bottom: 7px; }
.empty-history p { font-size: 9px; color: #b8bfac; }
.history-item { display: flex; align-items: center; gap: 7px; padding: 10px 0; border-bottom: 1px dashed #e8ebdf; }
.history-item:first-child { padding-top: 6px; }
.history-number { font-family: "Segoe UI", sans-serif; width: 15px; font-size: 9px; color: #b1b6a6; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.history-piece { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--orange); }
.history-piece.blue { color: var(--blue); }
.history-piece .side-dot { width: 4px; height: 4px; }
.history-coord { font-size: 10px; color: #8e9985; white-space: nowrap; font-variant-numeric: tabular-nums; }
.history-coord span { color: #b2b9a7; margin: 0 3px; }
.history-tag { font-size: 8px; color: #9faa92; margin-left: auto; white-space: nowrap; }
.history-tag.capture { color: #ad8057; background: #f7f0e2; padding: 3px 4px; border-radius: 3px; }
.history-tag.trap-event { color: #a12433; background: #fbe0dc; padding: 3px 4px; border-radius: 3px; }
.capture-summary { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid #e9edde; padding: 13px 0 14px; font-size: 9px; color: #9da28e; margin-top: 10px; }
.capture-summary > span { display: flex; align-items: center; gap: 5px; }
.capture-summary .side-dot { width: 5px; height: 5px; }
.capture-summary strong { font-weight: 500; color: #7c896d; margin-left: 1px; }
.win-note { display: flex; align-items: flex-start; gap: 11px; padding: 19px 15px; border-radius: 11px; background: #eaf0e2; color: #789067; }
.win-note-icon .icon { width: 24px; height: 24px; stroke-width: 1.3; margin-top: 1px; }
.win-note h3 { font-size: 12px; font-weight: 550; color: #6f855e; margin-bottom: 7px; }
.win-note p { font-size: 10px; color: #94a383; line-height: 1.6; }
.text-button { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; padding: 0; font-size: 10px; margin-top: 12px; color: #758e61; }
.text-button:hover { color: #3e653d; }
.text-button .icon { width: 13px; height: 13px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); padding: 21px 0 24px; margin-top: 30px; font-size: 9px; color: #a2a791; letter-spacing: .5px; }
.site-footer > span:last-child { display: flex; align-items: center; gap: 7px; }
.site-footer .tiny-dot { width: 4px; height: 4px; opacity: .65; }
.site-footer a { color: #8e9a7f; text-decoration: none; }
.site-footer a:hover { color: #48633c; text-decoration: underline; }
.footer-separator { margin: 0 4px; color: #c5c9b7; }

dialog { border: 1px solid #e1e5d5; border-radius: 20px; padding: 30px; color: var(--ink); background: var(--surface); box-shadow: 0 25px 100px #20382c35; max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); }
dialog::backdrop { background: #24372bb3; backdrop-filter: blur(4px); }
dialog[open] { animation: dialog-in .2s ease-out; }
.rules-dialog { width: 620px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; }
.dialog-heading h2 { font-family: "SimSun", serif; font-size: 25px; margin-top: 8px; letter-spacing: 1px; }
.dialog-heading .icon-button { border-color: transparent; margin-right: -9px; margin-top: -9px; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 23px 24px; }
.rule-item { display: flex; align-items: flex-start; gap: 10px; }
.full-width { grid-column: 1 / -1; }
.rule-number { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 25px; height: 25px; background: #edf2e5; color: #789364; border-radius: 50%; font-size: 9px; font-weight: 600; margin-top: 1px; }
.rule-item h3 { font-size: 13px; line-height: 26px; margin-bottom: 5px; font-weight: 600; }
.rule-item p { font-size: 11px; line-height: 1.9; color: #85917a; }
.rule-item p strong { font-weight: 500; color: #a9854c; }
.rules-ranks { display: flex; align-items: center; gap: 6px; margin: 8px 0 12px; }
.rules-rank { width: 40px; flex-shrink: 1; text-align: center; color: #8c7953; --animal-fill: #ecdcba; --animal-accent: #d2b989; }
.rules-rank .animal-art { width: 100%; aspect-ratio: 1; height: auto; border-radius: 50%; border: 2px solid #d4be8f; margin-bottom: 4px; }
.rules-rank small { font-size: 10px; }
.rules-rank-arrow { color: #c2c9b4; font-size: 11px; }
.draw-note { display: flex; align-items: flex-start; gap: 8px; background: #f3f5ec; padding: 13px; border-radius: 9px; margin-top: 24px; color: #93a281; }
.draw-note .icon { width: 16px; height: 16px; }
.draw-note p { font-size: 10px; line-height: 1.8; }
.dialog-primary { display: flex; margin: 23px auto 0; }
.confirm-dialog, .result-dialog { text-align: center; width: 375px; padding: 33px 28px 27px; }
.confirm-illustration { display: inline-flex !important; align-items: center; justify-content: center; background: #f2ecd9; color: #b19862; padding: 17px; border-radius: 50%; margin-bottom: 18px; }
.confirm-illustration .icon { width: 27px; height: 27px; }
.confirm-dialog h2, .result-dialog h2 { font-family: "SimSun", serif; font-size: 25px; line-height: 1.45; margin-bottom: 11px; }
.confirm-dialog > p, .result-dialog > p:not(.eyebrow) { font-size: 12px; color: #8f9a82; line-height: 1.9; }
.dialog-actions { display: flex; align-items: center; justify-content: center; gap: 11px; margin-top: 25px; }
.dialog-actions > button { flex: 1; padding: 10px; gap: 7px; }
.result-illustration { position: relative; width: 92px; height: 92px; margin: 3px auto 24px; background: #f4e5c2; border-radius: 50%; padding: 9px; color: #a07a43; }
.result-illustration > .icon { width: 30px; height: 30px; position: absolute; top: -14px; right: 4px; transform: rotate(18deg); color: #b59449; fill: #f5e6b8; }
.result-illustration.blue { background: #e4efea; color: var(--blue); --animal-fill: #d2e2d9; --animal-accent: #a9c7c0; }
.result-illustration > .animal-photo { border-radius: 50%; }
.result-dialog .eyebrow { justify-content: center; margin-bottom: 8px; }
.result-stats { margin-top: 19px; background: #f4f5ec; padding: 12px; font-size: 11px; color: #92a07f; border-radius: 7px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 30px; max-width: calc(100vw - 32px); transform: translate(-50%, 12px); padding: 12px 19px; background: #344f3fec; color: #fcfff0; border: 1px solid #69805c; border-radius: 10px; font-size: 12px; text-align: center; box-shadow: 0 7px 28px #233b292b; pointer-events: none; opacity: 0; transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.noscript-message { position: fixed; left: 20px; right: 20px; bottom: 20px; padding: 18px; background: #fff0d4; border: 1px solid #dbc495; border-radius: 10px; text-align: center; }

@keyframes pulse-dot { 50% { opacity: .35; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

@media (min-width: 1400px) and (min-height: 950px) {
  .page-shell { max-width: 1240px; padding: 0 32px; }
  .game-layout { grid-template-columns: 256px minmax(0, 1fr) 256px; gap: 32px; }
  .setup-panel { padding-left: 21px; padding-right: 21px; }
  .autosave-note { margin-left: -21px; margin-right: -21px; }
  .setup-panel fieldset { margin-top: 25px; }
  .player-bar, .board-frame, .board-toolbar { width: min(100%, 464px); }
  .history-list { height: 172px; }
}

@media (max-width: 1090px) {
  .page-shell { max-width: 960px; padding: 0 23px; }
  .game-layout { grid-template-columns: 226px minmax(0, 1fr); gap: 28px; }
  .info-column { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 21px; }
  .win-note { display: none; }
  .animal-guide { padding-top: 17px; }
  .rank-list { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; margin-bottom: 12px; }
  .rank-art { width: 46px; height: 46px; }
  .animal-detail { min-height: 64px; }
  .exception-note { margin-top: 11px; }
  .history-list { height: 179px; }
  .board-frame, .player-bar, .board-toolbar { width: min(100%, 429px); }
  .intro-decoration { padding-right: 32px; }
  .little-note { padding-left: 0; gap: 8px; }
  .little-note h3 { font-size: 12px; }
  .site-footer { margin-top: 27px; }
}

@media (max-width: 760px) {
  .page-shell { max-width: 560px; padding: 0 20px; }
  .site-header { height: 75px; }
  .brand-mark { width: 39px; height: 39px; border-radius: 12px; }
  .brand-wordmark strong { font-size: 20px; }
  .brand-wordmark > span { font-size: 7px; letter-spacing: 2px; }
  .brand { gap: 9px; }
  .header-actions { gap: 6px; }
  .slow-note { display: none; }
  .rules-button { padding: 8px 10px; font-size: 11px; gap: 6px; }
  .rules-button .icon { width: 15px; height: 15px; }
  .intro { padding: 25px 0 27px; }
  h1 { font-size: 26px; letter-spacing: 1px; }
  .intro .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
  .intro-description { font-size: 11px; letter-spacing: 0; }
  .intro-decoration { display: none; }
  .game-layout { display: flex; flex-direction: column; gap: 25px; }
  .arena { order: 0; width: 100%; }
  .settings-column { order: 1; width: 100%; }
  .info-column { order: 2; width: 100%; display: flex; }
  .board-frame, .player-bar, .board-toolbar { width: 100%; max-width: 460px; }
  .player-bar { min-height: 44px; }
  .player-identity strong { font-size: 12px; }
  .player-identity small { font-size: 10px; }
  .player-count { font-size: 11px; }
  .player-action { font-size: 10px; }
  .board-frame { padding: 14px 13px 21px 21px; }
  .coordinate-y { top: 14px; left: 2px; width: 17px; }
  .coordinate-x { left: 21px; right: 13px; }
  .piece-name { font-size: 10px; }
  .piece-rank { font-size: 8px; }
  .board-toolbar { margin-top: 12px; }
  .board-toolbar button { font-size: 12px; min-height: 44px; padding: 8px; }
  .board-toolbar .icon { width: 17px; height: 17px; }
  .board-message { font-size: 11px; margin-top: 9px; }
  .arena-heading { gap: 12px; }
  .turn-label strong { font-size: 15px; }
  .round-counter { font-size: 11px; }
  .active-mode { font-size: 11px; margin-top: 3px; padding: 5px; }
  .setup-panel { padding: 23px 23px 0; scroll-margin-top: 20px; }
  .section-heading h2 { font-size: 15px; }
  .section-heading .icon { width: 19px; height: 19px; }
  .setup-panel fieldset { margin-top: 22px; }
  legend { font-size: 12px; margin-bottom: 11px; }
  legend > span { font-size: 11px; }
  .mode-content { padding: 15px; }
  .mode-content strong { font-size: 13px; }
  .mode-content small { font-size: 11px; }
  .difficulty-choice > span { min-height: 42px; font-size: 12px; }
  .side-choice > span { min-height: 43px; font-size: 12px; }
  .field-description { font-size: 11px; }
  .start-button { padding: 13px 18px; font-size: 13px; margin-top: 23px; }
  .settings-note { font-size: 10px; }
  .autosave-note { margin: 0 -23px; font-size: 10px; padding: 13px; }
  .little-note { display: none; }
  .animal-guide, .history-panel { padding-left: 20px; padding-right: 20px; padding-top: 20px; }
  .rank-list { margin-top: 20px; margin-bottom: 17px; gap: 4px; }
  .rank-art { width: 50px; height: 50px; }
  .rank-animal > span:last-child { font-size: 11px; }
  .animal-detail { padding: 0; min-height: 70px; }
  .detail-portrait { height: 165px; }
  .animal-detail h3 { font-size: 12px; }
  .animal-detail p { font-size: 11px; }
  .exception-note { font-size: 10px; margin-top: 15px; padding: 15px 0; }
  .history-list { height: 163px; }
  .history-item { gap: 12px; padding: 12px 0; }
  .history-coord, .history-piece { font-size: 12px; }
  .history-tag { font-size: 10px; }
  .empty-history strong { font-size: 12px; }
  .empty-history p, .capture-summary { font-size: 10px; }
  .win-note { display: none; }
  .site-footer { flex-direction: column; text-align: center; font-size: 10px; gap: 11px; line-height: 1.7; padding: 23px 0 27px; }
  .rules-grid { grid-template-columns: 1fr; gap: 19px; }
  dialog { padding: 25px 21px; }
  .rules-dialog { max-height: calc(100dvh - 24px); }
  .dialog-heading { margin-bottom: 23px; }
  .dialog-heading h2 { font-size: 23px; }
  .rules-ranks { gap: 3px; }
  .rules-rank { width: 32px; }
  .rules-rank-arrow { font-size: 9px; }
  .rule-item p { font-size: 12px; }
  .draw-note p { font-size: 11px; }
  .dialog-primary { width: 100%; padding: 13px; }
}

@media (max-width: 390px) {
  .page-shell { padding: 0 14px; }
  .brand-mark { width: 35px; height: 35px; }
  .brand-wordmark strong { font-size: 19px; }
  .brand-wordmark > span { font-size: 6px; }
  .header-actions { gap: 2px; }
  .sound-button { width: 31px; height: 35px; }
  .rules-button { padding: 7px 8px; font-size: 10px; }
  .rules-button .icon { width: 13px; height: 13px; }
  h1 { font-size: 24px; }
  .intro { padding-top: 23px; }
  .board-frame { padding: 11px 10px 18px 18px; border-radius: 11px; }
  .coordinate-y { top: 11px; bottom: 18px; left: 0; }
  .coordinate-x { left: 18px; right: 10px; bottom: 2px; }
  .piece { width: 90%; border-width: 1px; padding: 2px; }
  .piece .animal-art { width: 100%; height: 100%; }
  .piece-name { font-size: 9px; line-height: 12px; min-width: 19px; padding: 0 3px; bottom: -2px; border-radius: 4px; }
  .piece-rank { width: 12px; height: 12px; font-size: 8px; right: -2px; top: -2px; }
  .terrain-mark .icon, .den .terrain-mark .icon { width: 23px; height: 23px; }
  .terrain-mark small { font-size: 6px; letter-spacing: 1px; }
  .den .terrain-mark small { font-size: 7px; }
  .board-toolbar button { font-size: 11px; gap: 5px; padding: 8px 4px; }
  .board-toolbar .icon { width: 15px; height: 15px; }
  .rank-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .rank-art { width: 46px; height: 46px; }
  .rules-ranks { gap: 2px; }
  .rules-rank { width: 26px; }
  .rules-rank-arrow { font-size: 7px; }
}

.online-pill { display: flex; align-items: center; gap: 6px; border: 1px solid #dce4d5; border-radius: 20px; padding: 7px 11px; font-size: 11px; color: #698261; background: #edf2e7; white-space: nowrap; }
.online-pill strong { font-variant-numeric: tabular-nums; color: #365d49; }
.online-pill.is-offline { opacity: .65; }
.online-panel { margin-top: 22px; }
.online-panel-heading { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.online-panel-heading strong { font-weight: 500; }
.online-panel-heading button { margin-left: auto; font-size: 10px; }
.live-dot { display: inline-block; width: 6px; height: 6px; background: #7e9687; border-radius: 50%; flex-shrink: 0; }
.live-dot.is-live { background: #68964c; box-shadow: 0 0 0 3px #8baa631c; }
.online-stats { display: grid; grid-template-columns: 1fr 1fr; padding: 15px 0; margin: 12px 0; border-radius: 9px; background: #f0f3e9; }
.online-stats > div { display: flex; flex-direction: column; gap: 5px; text-align: center; }
.online-stats > div + div { border-left: 1px solid #dce3d2; }
.online-stats strong { font-size: 25px; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; }
.online-stats span { color: #829072; font-size: 10px; }
.online-identity { font-size: 11px; color: #65745e; margin-bottom: 9px; }
.online-help { color: #7a8471; font-size: 10px; line-height: 1.9; }
.online-fineprint { color: #a0a692; font-size: 9px; line-height: 1.7; margin-top: 9px; }
.connection-banner { font-size: 11px; line-height: 1.8; background: #fcf0d9; color: #927344; padding: 9px 12px; border: 1px solid #eedebd; border-radius: 8px; margin: 8px auto 4px; max-width: 464px; }
.lobby-overlay { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 18px; background: #e8ede0bd; backdrop-filter: blur(5px); border-radius: inherit; }
.lobby-card { width: 100%; max-width: 310px; text-align: center; background: #fffef9f5; padding: 28px 23px 21px; border: 1px solid #fff; border-radius: 18px; box-shadow: 0 18px 65px #263d2924, 0 3px 0 #ffffff66; }
.lobby-card > .eyebrow { justify-content: center; font-size: 8px; letter-spacing: 1.6px; }
.match-portraits { display: flex; align-items: center; justify-content: center; gap: 15px; margin: 22px 0 19px; }
.match-avatar { display: block; width: 73px; height: 73px; border-radius: 50%; padding: 4px; background: linear-gradient(140deg, #f9d08e, #945d32); box-shadow: 0 4px 0 #855633, 0 9px 15px #38271526; transform: rotate(-8deg); }
.match-avatar.blue { background: linear-gradient(140deg, #c0d9d9, #406a81); box-shadow: 0 4px 0 #426175, 0 9px 15px #26384626; transform: rotate(8deg); }
.match-avatar img { border-radius: 50%; }
.match-versus { font: italic 700 15px Georgia, serif; color: #9ca58e; }
.lobby-card h2 { font-family: "STZhongsong", "Songti SC", "SimSun", serif; font-size: 23px; letter-spacing: 1px; font-weight: 600; }
.lobby-description { font-size: 11px; line-height: 1.9; color: #85907a; margin: 10px 0 15px; min-height: 42px; }
.lobby-live { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 10px; color: #799464; background: #f0f5e9; border-radius: 20px; padding: 6px 11px; }
.lobby-card > .primary-button { width: 100%; margin-top: 18px; justify-content: center; gap: 18px; padding: 13px 10px; }
.lobby-practice { margin: 13px auto 0; display: flex; justify-content: center; gap: 4px; font-size: 10px; }
.lobby-footnote { margin-top: 19px; font-size: 8px; color: #a2aa95; letter-spacing: 1px; }
.match-portraits.is-searching .match-avatar { animation: match-pulse 1.6s ease-in-out infinite alternate; }
.match-portraits.is-searching .match-avatar.blue { animation-delay: -.8s; }
@keyframes match-pulse { to { transform: translateY(-5px) rotate(0); box-shadow: 0 4px 0 #527459, 0 0 0 8px #b1c39122; } }
@media (max-width: 760px) {
  .online-pill { padding: 6px 8px; font-size: 10px; gap: 4px; margin-right: 3px; }
  .online-stats strong { font-size: 30px; }
  .online-panel-heading, .online-identity, .online-help { font-size: 12px; }
  .online-fineprint { font-size: 10px; }
  .lobby-card { max-width: 300px; }
}
@media (max-width: 390px) {
  .online-pill { font-size: 9px; padding: 5px 6px; gap: 3px; }
  .square.trap .terrain-mark small { font-size: 7px; }
  .trapped-label { font-size: 7px; line-height: 10px; }
  .square.has-trapped-piece .piece { width: 62%; margin-bottom: 30%; }
  .square.has-trapped-piece .piece-rank { right: -2px; top: -2px; }
  .mode-content small { font-size: 9px; white-space: nowrap; }
  .lobby-card { padding: 19px 17px 15px; }
  .lobby-card h2 { font-size: 21px; }
  .match-portraits { margin: 16px 0; gap: 12px; }
  .match-avatar { width: 61px; height: 61px; }
  .lobby-description { font-size: 10px; margin-bottom: 11px; }
  .lobby-footnote { margin-top: 12px; }
}
@media (max-width: 350px) {
  .lobby-card { padding: 16px 13px 13px; }
  .match-portraits { margin: 13px 0; }
  .match-avatar { width: 53px; height: 53px; }
  .lobby-description { min-height: 34px; margin: 8px 0 10px; }
  .lobby-card > .primary-button { margin-top: 12px; padding: 11px 8px; }
  .lobby-practice { margin-top: 10px; }
  .lobby-footnote { margin-top: 10px; font-size: 7px; letter-spacing: .5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Image attribution page */
.credits-page{max-width:850px;margin:50px auto;padding:0 24px}.credits-page>h1{margin:24px 0 14px}.credits-intro{font-size:13px;line-height:2;color:#7c896e;margin-bottom:28px}.credits-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.credit{display:flex;gap:16px;align-items:center;padding:18px;border:1px solid #e1e5d6;border-radius:12px;background:#fffef9}.credit img{width:78px;height:78px;border-radius:50%;object-fit:cover;border:3px solid #d8c294}.credit h2{font-size:19px;margin-bottom:8px}.credit h2 small{font-size:10px;font-weight:400;letter-spacing:1px;color:#8c9a7b}.credit p{font-size:12px;color:#7d896e;margin-bottom:7px}.credit a,.credit span{font-size:11px;color:#5a7549}.back-link{font-size:13px;color:#547647;text-decoration:none}.credits-footer{margin:28px 0;font-size:12px;color:#8a957d;line-height:1.9}@media(max-width:650px){.credits-grid{grid-template-columns:1fr}.credits-page{margin-top:28px}}
