    :root {
      --bg-1: #f8edcf;
      --bg-2: #d38f49;
      --palette-glow: rgba(255, 190, 92, 0.17);
      --palette-glow-alt: rgba(255, 214, 123, 0.16);
      --panel: rgba(47, 30, 18, 0.9);
      --board-shell-bg: var(--panel);
      --panel-border: rgba(255, 241, 214, 0.16);
      --text: #fff9ec;
      --soft: rgba(255, 249, 236, 0.72);
      --gold: #ffd67b;
      --accent-soft: rgba(255, 214, 123, 0.16);
      --danger: #ea6767;
      --action-top: #ffdf96;
      --action-bottom: #f2b348;
      --action-text: #4a2c05;
      --control-height: 44px;
      --radius-control: 12px;
      --radius-card: 20px;
      --radius-shell: 28px;
      --frame: #be8343;
      --frame-shine: rgba(255, 249, 228, 0.12);
      --frame-shade: rgba(122, 66, 17, 0.16);
      --board: #d8a159;
      --line: rgba(76, 43, 12, 0.58);
      --star: rgba(73, 39, 9, 0.68);
      --coordinate: #2f1806;
      --shadow: 0 26px 64px rgba(43, 20, 2, 0.26);
      --black-stone:
        radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.42) 0 4%, rgba(255, 255, 255, 0.13) 9%, transparent 16%),
        radial-gradient(circle at 44% 35%, #454545 0%, #202020 42%, #080808 75%, #010101 100%);
      --white-stone:
        radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 1) 0 9%, rgba(255, 255, 255, 0.55) 15%, transparent 23%),
        radial-gradient(circle at 46% 36%, #fffefa 0%, #f9f0df 50%, #e4d1b3 76%, #b99060 100%);
      --ghost-black: rgba(20, 20, 20, 0.28);
      --ghost-white: rgba(255, 255, 255, 0.48);
      --win: #69e09a;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
      color: var(--text);
      background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.48), transparent 26%),
        radial-gradient(circle at 82% 84%, rgba(118, 56, 10, 0.2), transparent 24%),
        linear-gradient(155deg, var(--bg-1), var(--bg-2));
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 18px;
      position: relative;
      overflow-x: hidden;
    }

    body::before,
    body::after {
      content: "";
      position: fixed;
      pointer-events: none;
      z-index: 0;
      filter: blur(8px);
    }

    body::before {
      width: 260px;
      height: 260px;
      left: -40px;
      top: 40px;
      background: radial-gradient(circle, var(--palette-glow, rgba(255, 190, 92, 0.17)), transparent 70%);
    }

    body::after {
      width: 320px;
      height: 320px;
      right: -60px;
      bottom: -10px;
      background: radial-gradient(circle, var(--palette-glow-alt, rgba(255, 214, 123, 0.16)), transparent 72%);
    }

    .app {
      --board-size: min(760px, calc(100vw - 48px), max(320px, calc(100dvh - 250px)));
      width: min(920px, 100%);
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 22px;
      align-items: start;
      position: relative;
      z-index: 1;
    }

    .app.focus-mode {
      width: min(max(calc(var(--board-size) + 46px), 820px), 100%);
      grid-template-columns: minmax(320px, 1fr);
      justify-content: center;
    }

    .app:not(.focus-mode) > .board-shell,
    .app:not(.focus-mode) > .board-tools,
    .app.focus-mode > .panel {
      display: none;
    }

    .panel,
    .board-shell {
      background: var(--panel);
      border: 1px solid var(--panel-border);
      border-radius: var(--radius-shell);
      box-shadow: var(--shadow);
      backdrop-filter: blur(8px);
    }

    .board-shell {
      background: var(--board-shell-bg, var(--panel));
    }

    .panel {
      padding: 22px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .app:not(.focus-mode) .hero {
      justify-items: center;
      text-align: center;
      padding: 4px 8px 8px;
    }

    .hero {
      display: grid;
      gap: 7px;
      justify-items: start;
    }

    .eyebrow {
      margin: 0;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 12px;
      border-radius: 999px;
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      color: var(--gold);
      background: rgba(255, 214, 123, 0.12);
      border: 1px solid rgba(255, 214, 123, 0.26);
    }

    h1 {
      margin: 0;
      font-size: clamp(1.6rem, 5vw, 2.1rem);
      line-height: 1.12;
      letter-spacing: 0.04em;
    }

    .hero-title {
      background: linear-gradient(118deg, #fff3d6 0%, #ffd67b 40%, #f0a95a 78%, #ffe9b8 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      filter: drop-shadow(0 6px 18px rgba(255, 180, 94, 0.22));
    }

    .subtitle {
      margin: 2px 0 0;
      line-height: 1.6;
      color: var(--soft);
      font-size: 0.92rem;
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip: rect(0 0 0 0);
      white-space: nowrap;
    }

    .card {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: var(--radius-card);
      padding: 16px;
    }

    .card-title {
      margin: 0 0 12px;
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.16em;
      color: var(--soft);
    }

    .status-main {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 12px;
    }

    .turn-pill {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 12px 16px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.08);
      min-height: 46px;
    }

    .stone-preview,
    .stone,
    .history-stone {
      border-radius: 50%;
      flex-shrink: 0;
    }

    .stone-preview {
      width: 22px;
      height: 22px;
      box-shadow:
        inset 2px 3px 5px rgba(255, 255, 255, 0.14),
        inset -4px -5px 8px rgba(0, 0, 0, 0.32),
        0 4px 8px rgba(0, 0, 0, 0.24);
    }

    .black,
    .history-stone.black,
    .stone.black { background: var(--black-stone); }

    .white,
    .history-stone.white,
    .stone.white {
      background: var(--white-stone);
      box-shadow:
        inset 3px 4px 7px rgba(255, 255, 255, 0.62),
        inset -5px -6px 10px rgba(119, 94, 55, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.18);
    }

    .red,
    .history-stone.red {
      background: radial-gradient(circle at 35% 25%, #ffd1c9 0 10%, #d73d32 48%, #8d1712 100%);
    }

    .blue,
    .history-stone.blue {
      background: radial-gradient(circle at 35% 25%, #d1ecff 0 10%, #2d7fdb 48%, #124683 100%);
    }

    .status-grid,
    .score-grid,
    .mode-strip {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .score-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .board-tools .score-grid {
      grid-template-columns: 1fr;
      gap: 8px;
    }

    .metric,
    .mode-card,
    .step-item {
      padding: 14px;
      border-radius: var(--radius-control);
      background: rgba(0, 0, 0, 0.14);
      border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .metric .label,
    .code-label {
      display: block;
      font-size: 0.8rem;
      color: var(--soft);
      margin-bottom: 6px;
      letter-spacing: 0.06em;
    }

    .metric .value {
      display: block;
      font-size: 1.02rem;
      font-weight: 700;
      line-height: 1.4;
      word-break: break-word;
    }

    .metric .value.small { font-size: 0.94rem; }

    .mode-card strong,
    .step-item strong {
      display: block;
      margin-bottom: 6px;
      font-size: 1rem;
    }

    .mode-card span,
    .step-item span,
    .hint,
    .tips {
      color: var(--soft);
      line-height: 1.56;
      font-size: 0.92rem;
    }

    .step-list {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .step-no {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      margin-bottom: 8px;
      background: var(--accent-soft);
      color: var(--gold);
      font-weight: 700;
    }

    .game-select-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .game-card {
      display: flex;
      align-items: center;
      gap: 11px;
      text-align: left;
      border-radius: var(--radius-control);
      padding: 12px 13px;
      color: var(--text);
      background: rgba(0, 0, 0, 0.14);
      border: 1px solid rgba(255, 255, 255, 0.06);
      transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
      min-height: 72px;
    }

    .resume-game-card {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 18px;
      padding: 16px 18px;
      border-radius: var(--radius-card);
      border: 1px solid rgba(255, 214, 123, 0.34);
      background: linear-gradient(135deg, rgba(255, 214, 123, 0.2), rgba(255, 255, 255, 0.06));
      box-shadow: 0 14px 34px rgba(60, 28, 4, 0.18);
    }

    .resume-game-card[hidden] { display: none; }

    .resume-game-copy {
      min-width: 0;
      display: grid;
      gap: 4px;
    }

    .resume-game-kicker {
      color: var(--gold);
      font-size: 0.76rem;
      font-weight: 800;
      letter-spacing: 0.14em;
    }

    .resume-game-copy strong {
      font-size: 1.2rem;
    }

    .resume-game-copy > span:last-child {
      color: var(--soft);
      font-size: 0.88rem;
      line-height: 1.45;
    }

    #resumeGameBtn {
      min-height: var(--control-height);
      padding: 0 18px;
      white-space: nowrap;
    }

    .game-card:hover {
      transform: translateY(-2px);
      border-color: rgba(255, 214, 123, 0.34);
      background: rgba(255, 255, 255, 0.06);
      box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
    }

    .game-card.active {
      color: var(--gold);
      border-color: rgba(255, 214, 123, 0.48);
      background: rgba(255, 214, 123, 0.14);
      box-shadow: 0 10px 24px rgba(255, 214, 123, 0.1);
    }

    .game-ico {
      flex-shrink: 0;
      width: 42px;
      height: 42px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      font-style: normal;
      font-weight: 900;
      font-size: 1.12rem;
      font-family: "KaiTi", "STKaiti", "Microsoft YaHei", serif;
      border: 1px solid rgba(0, 0, 0, 0.26);
      box-shadow: inset 0 3px 6px rgba(255, 255, 255, 0.3), inset 0 -4px 7px rgba(0, 0, 0, 0.22), 0 5px 10px rgba(0, 0, 0, 0.24);
    }

    .ico-gomoku { background: radial-gradient(circle at 35% 28%, #575757, #161616 66%); color: var(--gold); }
    .ico-go { background: radial-gradient(circle at 35% 28%, #ffffff, #e9dfca 68%); color: #40301a; }
    .ico-xiangqi { background: radial-gradient(circle at 35% 25%, #fff7df, #ecd49e 58%, #c08a4a); color: #c1121f; }
    .ico-ludo { background: radial-gradient(circle at 35% 25%, #d8f0ff, #3aa5ee 55%, #145baf); color: #ffffff; }
    .ico-monopoly { background: radial-gradient(circle at 35% 25%, #fff0b8, #f0b62e 56%, #b57708); color: #5c3a00; }

    .game-card.active .game-ico {
      box-shadow: 0 0 0 2px rgba(255, 214, 123, 0.65), inset 0 3px 6px rgba(255, 255, 255, 0.3), inset 0 -4px 7px rgba(0, 0, 0, 0.22), 0 5px 12px rgba(0, 0, 0, 0.28);
    }

    .game-info {
      flex: 1;
      min-width: 0;
      display: block;
    }

    .game-info strong,
    .game-info span {
      display: block;
    }

    .game-info span {
      margin-top: 4px;
      color: var(--soft);
      font-size: 0.8rem;
      line-height: 1.45;
    }

    .actions,
    .top-actions,
    .code-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .view-switch {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
    }

    .current-game-chip {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 36px;
      padding: 7px 12px;
      border-radius: 999px;
      border: 1px solid rgba(255, 214, 123, 0.28);
      background: rgba(255, 214, 123, 0.12);
      color: var(--gold);
      font-size: 0.82rem;
      font-weight: 800;
      letter-spacing: 0.06em;
      white-space: nowrap;
    }

    .view-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .match-score-strip {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      min-width: 0;
    }

    .match-score-strip .score-caption {
      color: var(--soft);
      font-size: 0.72rem;
      letter-spacing: 0.1em;
    }

    .match-score-strip .metric {
      display: inline-flex;
      align-items: baseline;
      gap: 5px;
      min-width: 0;
      padding: 7px 10px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.07);
    }

    .match-score-strip .metric .label {
      display: inline;
      margin: 0;
      color: var(--soft);
      font-size: 0.7rem;
      letter-spacing: 0;
      white-space: nowrap;
    }

    .match-score-strip .metric strong {
      color: var(--gold);
      font-size: 0.96rem;
      font-variant-numeric: tabular-nums;
    }

    button {
      appearance: none;
      border: none;
      border-radius: 999px;
      cursor: pointer;
      font: inherit;
      font-weight: 700;
      transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
    }

    button:focus-visible,
    a:focus-visible {
      outline: 3px solid rgba(255, 214, 123, 0.78);
      outline-offset: 3px;
    }

    button:hover { transform: translateY(-1px); }
    button:active { transform: translateY(1px); }
    button:disabled { cursor: not-allowed; opacity: 0.5; transform: none; }

    .gold-btn {
      min-height: var(--control-height);
      padding: 0 16px;
    }

    .primary-btn,
    .ghost-btn,
    .resign-btn,
    .danger-btn {
      min-height: var(--control-height);
      padding: 0 16px;
    }

    .primary-btn {
      background: linear-gradient(180deg, var(--action-top), var(--action-bottom));
      color: var(--action-text);
      box-shadow: 0 10px 24px rgba(242, 179, 72, 0.32);
    }

    .gold-btn {
      background: rgba(255, 214, 123, 0.12);
      color: var(--gold);
      border: 1px solid rgba(255, 214, 123, 0.3);
      box-shadow: 0 8px 20px rgba(65, 31, 7, 0.2);
    }

    .room-entry-card #createRoomBtn {
      flex: 1 1 100%;
      order: -1;
      font-size: 1rem;
    }

    .room-entry-card .top-actions > button:not(#createRoomBtn) {
      flex: 1 1 calc(50% - 4px);
      min-width: 0;
    }

    .ghost-btn {
      background: rgba(255, 255, 255, 0.1);
      color: var(--text);
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .danger-btn {
      background: rgba(234, 103, 103, 0.18);
      color: #ffd5d5;
      border: 1px solid rgba(234, 103, 103, 0.26);
    }

    .resign-btn {
      background: rgba(166, 74, 45, 0.18);
      color: #ffd8c9;
      border: 1px solid rgba(255, 145, 105, 0.24);
    }

    .resign-btn:hover {
      box-shadow: 0 10px 24px rgba(166, 74, 45, 0.16);
    }

    .room-entry-card {
      display: grid;
      gap: 10px;
      padding: 14px;
    }

    .room-entry-intro {
      margin: -4px 0 2px;
      color: var(--soft);
      font-size: 0.9rem;
      line-height: 1.55;
    }

    .connection-banner {
      display: flex;
      align-items: center;
      gap: 10px;
      min-height: var(--control-height);
      padding: 10px 12px;
      border-radius: var(--radius-control);
      color: var(--soft);
      background: rgba(0, 0, 0, 0.14);
      border: 1px solid rgba(255, 255, 255, 0.06);
      line-height: 1.45;
    }

    .connection-banner::before {
      content: "";
      width: 9px;
      height: 9px;
      flex: 0 0 9px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.42);
      box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
    }

    .app[data-server-state="waking"] .connection-banner {
      color: #fff0c5;
      border-color: rgba(255, 214, 123, 0.3);
      background: rgba(255, 214, 123, 0.1);
    }

    .app[data-server-state="waking"] .connection-banner::before {
      background: var(--gold);
      animation: statusPulse 0.9s ease-in-out infinite alternate;
    }

    .app[data-server-state="error"] .connection-banner {
      color: #ffd5d5;
      border-color: rgba(234, 103, 103, 0.28);
      background: rgba(234, 103, 103, 0.1);
    }

    .app[data-server-state="error"] .connection-banner::before {
      background: var(--danger);
    }

    @keyframes statusPulse {
      to { opacity: 0.45; transform: scale(0.82); }
    }

    .room-entry-card .top-actions,
    .room-entry-card .code-actions {
      gap: 8px;
    }

    .room-entry-card button,
    .board-actions button,
    .view-actions button {
      min-height: var(--control-height);
      padding: 0 12px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 0;
      line-height: 1.2;
    }

    .room-entry-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .room-entry-card input,
    .room-entry-card select {
      height: var(--control-height);
      border-radius: var(--radius-control);
    }

    .music-btn.active {
      background: rgba(255, 214, 123, 0.2);
      color: var(--gold);
      border-color: rgba(255, 214, 123, 0.38);
      box-shadow: 0 10px 24px rgba(255, 214, 123, 0.12);
    }

    .support-btn {
      width: 100%;
      border-radius: 18px;
      padding: 13px 16px;
      background: rgba(255, 214, 123, 0.13);
      color: var(--gold);
      border: 1px solid rgba(255, 214, 123, 0.22);
    }

    input,
    select {
      width: 100%;
      height: var(--control-height);
      border-radius: var(--radius-control);
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(0, 0, 0, 0.16);
      color: var(--text);
      font: inherit;
      padding: 0 14px;
      outline: none;
    }

    select {
      cursor: pointer;
    }

    .link-box {
      display: grid;
      gap: 8px;
    }

    .app[data-ui-state="lobby"] .room-state-card,
    .app[data-ui-state="lobby"] .link-box,
    .app[data-ui-state="lobby"] #leaveRoomBtn,
    .app[data-ui-state="lobby"] #focusLeaveBtn,
    .app[data-ui-state="link-pending"] .room-state-card,
    .app[data-ui-state="link-pending"] .link-box,
    .app[data-ui-state="link-pending"] #leaveRoomBtn,
    .app[data-ui-state="link-pending"] #focusLeaveBtn,
    .app[data-ui-state="link-pending"] #aiRoomBtn,
    .app[data-ui-state="link-pending"] #createRoomBtn,
    .app[data-ui-state="waiting"] .game-picker-card,
    .app[data-ui-state="waiting"] .room-entry-grid,
    .app[data-ui-state="waiting"] #aiRoomBtn,
    .app[data-ui-state="waiting"] #createRoomBtn,
    .app[data-ui-state="waiting"] #joinRoomBtn,
    .app[data-ui-state="playing"] .game-picker-card,
    .app[data-ui-state="playing"] .room-entry-grid,
    .app[data-ui-state="playing"] #aiRoomBtn,
    .app[data-ui-state="playing"] #createRoomBtn,
    .app[data-ui-state="playing"] #joinRoomBtn,
    .app[data-ui-state="finished"] .game-picker-card,
    .app[data-ui-state="finished"] .room-entry-grid,
    .app[data-ui-state="finished"] #aiRoomBtn,
    .app[data-ui-state="finished"] #createRoomBtn,
    .app[data-ui-state="finished"] #joinRoomBtn {
      display: none;
    }

    .app[data-ui-state="waiting"] .room-entry-card,
    .app[data-ui-state="playing"] .room-entry-card,
    .app[data-ui-state="finished"] .room-entry-card {
      border-color: rgba(255, 214, 123, 0.26);
      background: rgba(255, 214, 123, 0.08);
    }

    .link-value {
      width: 100%;
      min-height: 62px;
      border-radius: var(--radius-control);
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(0, 0, 0, 0.16);
      color: var(--text);
      font: inherit;
      padding: 12px 14px;
      resize: none;
    }

    .history-list {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      max-height: 230px;
      overflow: auto;
      padding-right: 4px;
    }

    .history-item,
    .history-empty {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      border-radius: 16px;
      background: rgba(0, 0, 0, 0.14);
      font-size: 0.9rem;
    }

    .history-empty {
      grid-column: 1 / -1;
      justify-content: center;
      color: var(--soft);
    }

    .history-stone {
      width: 16px;
      height: 16px;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    .tips {
      margin: 0;
      padding-left: 18px;
    }

    .board-shell {
      position: relative;
      padding: clamp(14px, 2vw, 22px);
      overflow: hidden;
      display: grid;
      gap: 16px;
      min-width: 0;
    }

    .match-status-strip {
      width: var(--board-size);
      max-width: 100%;
      margin: 0 auto;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto auto;
      align-items: stretch;
      gap: 10px;
    }

    .board-play-area {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      place-items: center;
    }

    .board-main {
      position: relative;
      z-index: 1;
      min-width: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 10px;
      justify-items: center;
      width: 100%;
    }

    .board-tools {
      position: fixed;
      z-index: 18;
      top: 18px;
      right: 18px;
      bottom: auto;
      width: min(360px, calc(100vw - 36px));
      max-height: calc(100dvh - 36px);
      display: flex;
      flex-direction: column;
      gap: 14px;
      min-width: 0;
      padding: 18px;
      border-radius: var(--radius-shell);
      border: 1px solid var(--panel-border);
      background: rgba(47, 30, 18, 0.98);
      box-shadow: 0 24px 70px rgba(32, 12, 0, 0.42);
      transform: translateX(calc(100% + 44px));
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: transform 0.22s ease, opacity 0.18s ease, visibility 0s linear 0.22s;
      overflow-x: hidden;
      overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: rgba(255, 214, 123, 0.38) rgba(255, 255, 255, 0.05);
    }

    .app.tools-open > .board-tools {
      transform: translateX(0);
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
      transition-delay: 0s;
    }

    .tools-backdrop {
      position: fixed;
      inset: 0;
      z-index: 17;
      border-radius: 0;
      background: rgba(24, 10, 3, 0.38);
      -webkit-backdrop-filter: blur(3px);
      backdrop-filter: blur(3px);
    }

    .tools-backdrop[hidden] { display: none; }

    .tools-drawer-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding-bottom: 12px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .tools-drawer-header > div {
      min-width: 0;
      display: grid;
      gap: 4px;
    }

    .tools-drawer-header span {
      color: var(--gold);
      font-size: 0.76rem;
      font-weight: 800;
      letter-spacing: 0.12em;
    }

    .tools-drawer-header strong {
      color: var(--soft);
      font-size: 0.82rem;
      font-weight: 600;
    }

    #toolsCloseBtn {
      min-height: var(--control-height);
      padding: 0 14px;
      flex: 0 0 auto;
    }

    .board-tools::-webkit-scrollbar { width: 6px; }
    .board-tools::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 999px; }
    .board-tools::-webkit-scrollbar-thumb { background: rgba(255, 214, 123, 0.38); border-radius: 999px; }

    .board-tools button:hover,
    .board-tools button:active {
      transform: none;
    }

    .board-tools .board-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .board-tools .board-actions button {
      width: 100%;
    }

    .match-focus,
    .timer-card,
    .result-card {
      border-radius: var(--radius-card);
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(255, 255, 255, 0.08);
      padding: 9px 10px;
    }

    .match-focus {
      min-height: 68px;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .board-eyebrow {
      margin: 0;
      color: var(--gold);
      font-size: 0.66rem;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      white-space: nowrap;
    }

    .board-status-main {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex: 1;
      min-width: 0;
      margin-bottom: 0;
    }

    .board-status-main .turn-pill,
    .board-status-main strong {
      min-width: 0;
      box-sizing: border-box;
    }

    .board-status-main .turn-pill {
      width: auto;
      flex: 1 1 auto;
    }

    .board-status-main strong {
      width: auto;
      max-width: 42%;
      flex: 0 1 auto;
    }

    .board-status-main .turn-pill span:last-child,
    .board-status-main strong {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .board-status-main strong {
      min-height: 1.35em;
      line-height: 1.35;
    }

    .timer-card,
    .result-card {
      display: grid;
      align-content: center;
      gap: 6px;
    }

    .timer-card {
      min-width: 104px;
      min-height: 68px;
      padding-inline: 16px;
    }

    .match-status-strip #variantActionBtn {
      min-height: 68px;
      padding: 0 18px;
    }

    .timer-card .label,
    .result-card .label {
      color: var(--soft);
      font-size: 0.66rem;
      letter-spacing: 0.1em;
    }

    .timer-card strong {
      color: var(--gold);
      display: inline-block;
      font-size: clamp(1rem, 2vw, 1.45rem);
      font-variant-numeric: tabular-nums;
      line-height: 0.95;
      min-width: 3.5ch;
    }

    .timer-card.warning {
      border-color: rgba(255, 214, 123, 0.5);
      box-shadow: 0 0 22px rgba(255, 214, 123, 0.12);
    }

    .timer-card.danger {
      border-color: rgba(234, 103, 103, 0.78);
      background: rgba(234, 103, 103, 0.12);
      box-shadow: 0 0 26px rgba(234, 103, 103, 0.24);
    }

    .timer-card.danger strong {
      color: #ff8a8a;
    }

    .result-card strong {
      font-size: 0.98rem;
      line-height: 1.25;
    }

    .result-card span:last-child {
      color: var(--soft);
      font-size: 0.72rem;
    }

    .board-frame {
      position: relative;
      width: min(100%, 920px);
      max-width: 100%;
      margin: 0 auto;
      aspect-ratio: 1;
      padding: 18px;
      border-radius: 30px;
      background:
        linear-gradient(145deg, var(--frame-shine), var(--frame-shade)),
        var(--frame);
      box-shadow: inset 0 2px 12px rgba(255, 255, 255, 0.16), inset 0 -8px 18px rgba(85, 38, 4, 0.15), 0 18px 40px rgba(40, 18, 2, 0.24);
    }

    .app:not(.focus-mode) .board-frame {
      width: var(--board-size);
      max-width: 100%;
    }

    .app.focus-mode .board-frame {
      width: var(--board-size);
      max-width: 100%;
    }

    .compact-card {
      padding: 12px;
      border-radius: var(--radius-card);
    }

    .compact-card .metric {
      padding: 9px 10px;
      border-radius: var(--radius-control);
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
    }

    .compact-card .card-title {
      margin-bottom: 8px;
    }

    .compact-card select {
      height: var(--control-height);
      border-radius: var(--radius-control);
      padding: 0 12px;
      font-size: 0.92rem;
    }

    .background-palette {
      display: block;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .background-palette summary {
      min-height: var(--control-height);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 0 12px;
      border: 1px solid rgba(255, 214, 123, 0.2);
      border-radius: var(--radius-control);
      background: rgba(255, 214, 123, 0.08);
      color: var(--gold);
      font-size: 0.82rem;
      cursor: pointer;
      list-style: none;
    }

    .background-palette summary::-webkit-details-marker { display: none; }
    .background-palette summary::after { content: '＋'; font-size: 1rem; }
    .background-palette[open] summary::after { content: '－'; }
    .background-palette summary span { margin-left: auto; color: rgba(255, 249, 236, 0.5); font-size: 0.68rem; }
    .background-palette[open] summary { margin-bottom: 10px; }
    .background-palette:not([open]) > :not(summary) { display: none; }
    .background-palette > :not(summary) { margin-top: 8px; }

    .palette-swatches {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 7px;
    }

    .palette-swatch {
      position: relative;
      min-width: 0;
      height: 32px;
      padding: 0;
      border: 2px solid rgba(255, 255, 255, 0.18);
      border-radius: 10px;
      background: var(--swatch, #d38f49);
      cursor: pointer;
      box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 3px 8px rgba(0, 0, 0, 0.2);
      transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
    }

    .palette-swatch[data-bg-color="#d38f49"] { --swatch: #d38f49; }
    .palette-swatch[data-bg-color="#3f6f8f"] { --swatch: #3f6f8f; }
    .palette-swatch[data-bg-color="#486b58"] { --swatch: #486b58; }
    .palette-swatch[data-bg-color="#665080"] { --swatch: #665080; }
    .palette-swatch[data-bg-color="#454b58"] { --swatch: #454b58; }

    .palette-swatch:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.58); }
    .palette-swatch.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 214, 123, 0.22), inset 0 1px 2px rgba(255, 255, 255, 0.2); }

    .palette-color-row,
    .palette-range-label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      color: var(--soft);
      font-size: 0.78rem;
    }

    .palette-color-input {
      width: 52px;
      height: 32px;
      padding: 3px;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 9px;
      background: rgba(0, 0, 0, 0.16);
      cursor: pointer;
    }

    .palette-range-label output { color: var(--gold); font-variant-numeric: tabular-nums; }
    .palette-range { width: 100%; height: 22px; accent-color: var(--gold); cursor: pointer; }
    .palette-reset { height: var(--control-height); border: 1px solid rgba(255, 214, 123, 0.22); border-radius: var(--radius-control); background: rgba(255, 214, 123, 0.08); color: var(--gold); cursor: pointer; }
    .palette-reset:hover { background: rgba(255, 214, 123, 0.16); }
    .palette-hint { margin: 0; color: rgba(255, 249, 236, 0.48); font-size: 0.68rem; line-height: 1.45; }

    .board-actions {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      padding: 12px;
      border-radius: var(--radius-card);
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(255, 255, 255, 0.07);
    }

    .board-grid {
      position: relative;
      width: 100%;
      height: 100%;
      border-radius: 20px;
      background: var(--board);
      overflow: hidden;
      touch-action: none;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .board-grid::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 0;
      background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 18%, rgba(90, 42, 9, 0.06) 42%, transparent 72%),
        repeating-linear-gradient(8deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 14px);
      opacity: 0.36;
      mix-blend-mode: soft-light;
      pointer-events: none;
    }

    .board-grid.playable-board {
      cursor: crosshair;
    }

    .board-grid.variant-board {
      display: block;
      padding: 18px;
    }

    .board-grid.variant-board::before {
      display: none;
    }

    .board-grid.variant-board::after {
      display: none;
    }

    .go-board,
    .xiangqi-board {
      position: relative;
      width: 100%;
      height: 100%;
      border-radius: 18px;
      overflow: hidden;
    }

    .go-board {
      --go-edge: 7%;
      background:
        radial-gradient(circle at 50% 50%, rgba(84, 47, 16, 0.15) 0 2px, transparent 2.5px),
        linear-gradient(135deg, rgba(255, 237, 187, 0.95), rgba(202, 137, 65, 0.88));
      box-shadow: inset 0 0 0 2px rgba(91, 49, 17, 0.32), inset 0 18px 30px rgba(255, 255, 255, 0.18);
    }

    .go-board::before {
      content: "";
      position: absolute;
      inset: var(--go-edge);
      background:
        linear-gradient(to right, rgba(68, 38, 12, 0.72) 1.5px, transparent 1.5px) 0 0 / calc(100% / 8) 100%,
        linear-gradient(to bottom, rgba(68, 38, 12, 0.72) 1.5px, transparent 1.5px) 0 0 / 100% calc(100% / 8);
      border-right: 1.5px solid rgba(68, 38, 12, 0.72);
      border-bottom: 1.5px solid rgba(68, 38, 12, 0.72);
      pointer-events: none;
    }

    .go-board::after {
      content: "";
      position: absolute;
      inset: 0;
      background: radial-gradient(circle at 50% 50%, rgba(54, 31, 10, 0.58) 0 3px, transparent 3.5px);
      pointer-events: none;
    }

    .xiangqi-board {
      --xiangqi-edge-x: 7%;
      --xiangqi-edge-y: 5.2%;
      background: #e2b565;
      border: 2px solid rgba(66, 38, 16, 0.72);
      box-shadow: inset 0 0 0 4px rgba(255, 238, 188, 0.38), inset 0 0 0 8px rgba(95, 55, 20, 0.22);
    }

    .xiangqi-board::before {
      content: "";
      position: absolute;
      inset: 8px;
      border: 2px solid rgba(66, 38, 16, 0.62);
      pointer-events: none;
    }

    .xiangqi-lines {
      position: absolute;
      inset: var(--xiangqi-edge-y) var(--xiangqi-edge-x);
      width: calc(100% - var(--xiangqi-edge-x) * 2);
      height: calc(100% - var(--xiangqi-edge-y) * 2);
      overflow: visible;
      pointer-events: none;
    }

    .xiangqi-river {
      position: absolute;
      left: var(--xiangqi-edge-x);
      right: var(--xiangqi-edge-x);
      top: 45.5%;
      height: 9%;
      display: flex;
      align-items: center;
      justify-content: space-around;
      color: rgba(28, 24, 22, 0.88);
      font-family: "KaiTi", "STKaiti", serif;
      font-size: clamp(1.35rem, 4vw, 2.75rem);
      font-weight: 900;
      letter-spacing: 0.32em;
      text-shadow: 0 1px 0 rgba(255, 236, 186, 0.7);
      pointer-events: none;
    }

    .game-cell {
      color: #2b1606;
      display: grid;
      place-items: center;
      min-width: 0;
      min-height: 0;
      padding: 0;
      pointer-events: auto;
    }

    .go-point,
    .xiangqi-cell {
      position: absolute;
      z-index: 2;
      border: none;
      background: transparent;
      transform: translate(-50%, -50%);
    }

    .go-point:hover,
    .go-point:active,
    .go-point:focus-visible {
      transform: translate(-50%, -50%);
    }

    .go-point {
      width: 9.2%;
      height: 9.2%;
      border-radius: 50%;
    }

    .xiangqi-cell {
      width: 13%;
      height: 11%;
      border-radius: 50%;
    }

    .xiangqi-cell:hover,
    .xiangqi-cell:active,
    .xiangqi-cell:focus-visible {
      transform: translate(-50%, -50%);
    }

    .xiangqi-cell.selected .xiangqi-piece {
      transform: translateY(-8px) scale(1.04);
      box-shadow: 0 17px 24px rgba(0, 0, 0, 0.34), inset 0 5px 8px rgba(255, 248, 222, 0.6), inset 0 -7px 10px rgba(94, 59, 23, 0.32);
    }

    .game-cell.selected {
      outline: 3px solid rgba(255, 214, 123, 0.9);
      outline-offset: -3px;
      background: rgba(255, 246, 209, 0.2);
    }

    .xiangqi-cell.selected {
      outline: none;
      background: transparent;
    }

    .game-cell.pending-move {
      outline: 3px solid rgba(255, 214, 123, 0.95);
      outline-offset: 2px;
      box-shadow: 0 0 0 6px rgba(255, 214, 123, 0.16);
    }

    .xiangqi-cell.pending-move {
      outline: none;
      box-shadow: none;
    }

    .game-cell.pending-source {
      opacity: 0.18;
    }

    .go-stone {
      width: 78%;
      height: 78%;
      border-radius: 50%;
      box-shadow: 0 9px 14px rgba(0, 0, 0, 0.28), inset 0 8px 10px rgba(255, 255, 255, 0.24), inset 0 -8px 12px rgba(0, 0, 0, 0.18);
    }

    .go-stone.black { background: radial-gradient(circle at 38% 30%, #50565a, #101416 58%, #030405); }
    .go-stone.white { background: radial-gradient(circle at 35% 30%, #ffffff, #ece5d7 58%, #cfc2ac); }

    .xiangqi-piece {
      position: relative;
      width: min(88%, 54px);
      height: min(88%, 54px);
      border-radius: 50%;
      display: grid;
      place-items: center;
      background: radial-gradient(circle at 35% 25%, #fff7df 0 20%, #ead19c 56%, #b88347 100%);
      border: 2px solid rgba(50, 27, 10, 0.94);
      color: #d11212;
      font-family: "KaiTi", "STKaiti", serif;
      font-size: clamp(1rem, 2.45vw, 1.42rem);
      font-weight: 900;
      text-shadow: 0 1px 0 rgba(255, 236, 196, 0.55);
      box-shadow: 0 8px 13px rgba(0, 0, 0, 0.28), inset 0 5px 8px rgba(255, 240, 200, 0.48), inset 0 -7px 10px rgba(76, 45, 18, 0.34);
    }

    .xiangqi-piece::before {
      content: "";
      position: absolute;
      inset: 13%;
      border-radius: 50%;
      border: 1.5px solid currentColor;
      opacity: 0.48;
      pointer-events: none;
    }

    .xiangqi-piece.black {
      color: #050505;
    }

    .xiangqi-piece.pending-preview {
      opacity: 0.84;
      transform: translateY(-2px) scale(0.98);
      box-shadow: 0 13px 20px rgba(0, 0, 0, 0.26), inset 0 5px 8px rgba(255, 248, 222, 0.6), inset 0 -7px 10px rgba(94, 59, 23, 0.32);
    }

    .ludo-board {
      position: relative;
      width: 100%;
      height: 100%;
      border-radius: 20px;
      padding: 5px;
      background: radial-gradient(circle at 50% 50%, rgba(255, 250, 240, 0.9), transparent 36%), linear-gradient(145deg, #f4efe1, #e3d6c0);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), inset 0 -8px 16px rgba(70, 50, 20, 0.12), inset 0 0 0 2px rgba(0, 0, 0, 0.03);
    }

    .ludo-map {
      position: relative;
      width: 100%;
      height: 100%;
      border-radius: 22px;
      overflow: hidden;
      background: linear-gradient(90deg, rgba(48, 65, 95, 0.04) 1px, transparent 1px) 0 0 / calc(100% / 15) calc(100% / 15), linear-gradient(0deg, rgba(48, 65, 95, 0.04) 1px, transparent 1px) 0 0 / calc(100% / 15) calc(100% / 15), radial-gradient(ellipse at 50% 50%, #fdf7ed 0%, #efe3cd 100%);
      border: 2px solid rgba(70, 55, 35, 0.18);
      box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.04), 0 14px 28px rgba(30, 20, 10, 0.15);
    }

    .ludo-home-panel {
      position: absolute;
      width: 34.5%;
      height: 34.5%;
      border-radius: 24px;
      display: grid;
      place-items: center;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5), inset 0 0 0 5px rgba(0, 0, 0, 0.05), inset 0 6px 12px rgba(0, 0, 0, 0.08);
    }

    .ludo-home-panel.green { left: 3.2%; top: 3.2%; background: linear-gradient(145deg, #6ccf80, #2d8e46); }
    .ludo-home-panel.red { right: 3.2%; top: 3.2%; background: linear-gradient(145deg, #f5837a, #c73c3c); }
    .ludo-home-panel.yellow { left: 3.2%; bottom: 3.2%; background: linear-gradient(145deg, #f5cd60, #d4961a); }
    .ludo-home-panel.blue { right: 3.2%; bottom: 3.2%; background: linear-gradient(145deg, #68b8f7, #1e6bb8); }

    .ludo-home-panel::before {
      content: attr(data-label);
      position: absolute;
      inset: auto 14px 12px;
      color: rgba(255, 255, 255, 0.9);
      font-size: clamp(1.15rem, 3vw, 2.1rem);
      font-weight: 900;
      letter-spacing: 0.08em;
      text-align: center;
      text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
    }

    .ludo-home-dots {
      width: 58%;
      height: 58%;
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 18%;
      padding: 14%;
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.7);
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .ludo-home-dots span {
      border-radius: 50%;
      background: rgba(40, 40, 50, 0.08);
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* 已到达终点的架数点亮 */
    .ludo-home-panel.red .ludo-home-dots span.done { background: radial-gradient(circle at 35% 30%, #ffb3a8, #c73c3c); box-shadow: 0 0 6px rgba(199, 60, 60, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.3); }
    .ludo-home-panel.blue .ludo-home-dots span.done { background: radial-gradient(circle at 35% 30%, #a4d8ff, #1e6bb8); box-shadow: 0 0 6px rgba(30, 107, 184, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.3); }

    /* 棋子已出征在外：停机位空着，虚圈提示 */
    .ludo-home-dots span.out {
      background: rgba(32, 38, 48, 0.03);
      box-shadow: inset 0 0 0 1px rgba(32, 38, 48, 0.08);
    }

    /* 本局没有玩家的两个机场：整体降饱和淡化，避免误以为是四人局 */
    .ludo-home-panel.idle {
      filter: saturate(0.15) brightness(0.85) contrast(0.9);
      opacity: 0.4;
    }

    /* 主环四色循环格：四色实色填满（经典飞行棋配色），高光+色边保持精致；落己方色格可飞跃 4 格 */
    .ludo-cell.tint {
      filter: none;
      opacity: 1;
      box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), inset 0 -3px 5px rgba(0, 0, 0, 0.15), 0 1px 4px rgba(0, 0, 0, 0.1);
    }
    .ludo-cell.tint.red { background: linear-gradient(160deg, rgba(245, 131, 122, 0.85), rgba(199, 60, 60, 0.9)); border: 1px solid rgba(150, 40, 40, 0.4); }
    .ludo-cell.tint.blue { background: linear-gradient(160deg, rgba(104, 184, 247, 0.85), rgba(30, 107, 184, 0.9)); border: 1px solid rgba(10, 60, 120, 0.4); }
    .ludo-cell.tint.green { background: linear-gradient(160deg, rgba(108, 207, 128, 0.85), rgba(45, 142, 70, 0.9)); border: 1px solid rgba(20, 100, 30, 0.4); }
    .ludo-cell.tint.yellow { background: linear-gradient(160deg, rgba(245, 205, 96, 0.85), rgba(212, 150, 26, 0.9)); border: 1px solid rgba(140, 90, 10, 0.4); }

    .ludo-cell {
      position: absolute;
      width: 6.55%;
      height: 6.55%;
      transform: translate(-50%, -50%);
      border-radius: 24%;
      background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(235, 240, 250, 0.9));
      border: 1px solid rgba(80, 70, 50, 0.18);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
      display: grid;
      place-items: center;
    }

    /* 起飞格：白色小飞机，安全格身份一目了然 */
    .ludo-cell.safe::after {
      content: "✈";
      color: #ffffff;
      font-size: clamp(0.72rem, 2vw, 1.25rem);
      line-height: 1;
      text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    }

    .ludo-cell.finish {
      box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), inset 0 -2px 4px rgba(0, 0, 0, 0.1);
    }

    /* 跑道中线灯：白色圆点标记终点跑道，与环道一眼区分 */
    .ludo-cell.finish::after {
      content: "";
      width: 30%;
      height: 30%;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.9);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .ludo-cell.red { color: #a83232; background: linear-gradient(145deg, #ffb3a8, #e66767); }
    .ludo-cell.blue { color: #1e5ca8; background: linear-gradient(145deg, #a4d8ff, #4a90d9); }
    .ludo-cell.green { color: #1e6b3a; background: linear-gradient(145deg, #8ed99a, #3a9e5c); }
    .ludo-cell.yellow { color: #b88a1a; background: linear-gradient(145deg, #ffe08a, #e6b422); }

    /* 虚线飞行航线：压在格子上、棋子和骰子下 */
    .ludo-flight-lines {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
      pointer-events: none;
    }

    .ludo-center {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 20%;
      height: 20%;
      transform: translate(-50%, -50%) rotate(45deg);
      border-radius: 18px;
      /* 四个三角与四条跑道同向同色：顶红 / 右蓝 / 底黄 / 左绿（元素被转了 45°，扇区起点相应偏移） */
      background: conic-gradient(from 0deg, #2c7dc5 0 25%, #e6a822 0 50%, #2d9e4e 0 75%, #d64045 0 100%);
      border: 3px solid rgba(255, 255, 255, 0.85);
      box-shadow: 0 8px 18px rgba(30, 20, 10, 0.2), inset 0 0 0 2px rgba(255, 255, 255, 0.5);
    }

    .ludo-center::after {
      content: "";
      position: absolute;
      inset: 22%;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.8);
      box-shadow: inset 0 0 0 2px rgba(50, 40, 30, 0.1), 0 0 6px rgba(0, 0, 0, 0.05);
    }

    /* 中央大骰子：可直接点击掷骰，边框色 = 当前回合玩家色 */
    .ludo-dice {
      position: absolute;
      z-index: 8;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      width: 12.5%;
      height: 12.5%;
      border-radius: 24%;
      background: linear-gradient(150deg, #fffef5, #ece3cc);
      border: 3px solid #c8a24b;
      color: #3e2e18;
      font-weight: 900;
      font-size: clamp(1.35rem, 3.6vw, 2.3rem);
      display: grid;
      place-items: center;
      cursor: pointer;
      user-select: none;
      box-shadow: 0 6px 16px rgba(20, 15, 5, 0.25), inset 0 2px 3px rgba(255, 255, 255, 0.8), inset 0 -3px 4px rgba(0, 0, 0, 0.1);
    }

    .ludo-dice.waiting {
      cursor: default;
      opacity: 0.8;
    }

    .ludo-dice .ludo-dice-cap {
      position: absolute;
      top: 106%;
      left: 50%;
      transform: translateX(-50%);
      padding: 3px 12px;
      border-radius: 999px;
      background: rgba(255, 245, 230, 0.92);
      color: #5a4632;
      font-size: clamp(0.66rem, 1.5vw, 0.85rem);
      font-weight: 700;
      white-space: nowrap;
      box-shadow: 0 2px 8px rgba(20, 15, 5, 0.12);
    }

    /* 兵形棋子（SVG 本体带色），底座立在格心：translate Y = 底座在 viewBox 中的位置 ≈81% */
    .ludo-token {
      position: absolute;
      z-index: 9;
      width: 5.6%;
      height: 7.4%;
      min-width: 0;
      min-height: 0;
      padding: 0;
      background: none;
      border: none;
      transform: translate(-50%, -81%);
      pointer-events: auto;
      font-size: 0;
      filter: drop-shadow(0 2px 3px rgba(10, 8, 5, 0.3));
    }

    .ludo-token svg {
      display: block;
      width: 100%;
      height: 100%;
    }

    /* 选中待确认：金光聚焦 */
    .ludo-token.pending-move {
      filter: drop-shadow(0 0 6px rgba(255, 215, 80, 0.9)) drop-shadow(0 0 10px rgba(255, 205, 60, 0.4)) drop-shadow(0 2px 3px rgba(10, 8, 5, 0.3));
    }

    .ludo-token:not(:disabled) {
      cursor: pointer;
    }

    .ludo-token:disabled {
      cursor: not-allowed;
      /* 覆盖全局 button:disabled 的 opacity:0.5 和 transform:none——
         棋子任何时候都必须实心可见且待在原位，否则未轮到走时整体偏移半个棋子 */
      opacity: 1;
      transform: translate(-50%, -81%);
    }

    /* 掷完骰子后可走的棋子：金光脉冲呼吸，告诉玩家"点我" */
    .ludo-token.movable {
      animation: ludoMovable 0.85s ease-in-out infinite;
      filter: drop-shadow(0 0 4px rgba(255, 215, 80, 0.85)) drop-shadow(0 2px 3px rgba(10, 8, 5, 0.3));
    }

    @keyframes ludoMovable {
      0%, 100% { transform: translate(-50%, -81%) scale(1.02); }
      50% { transform: translate(-50%, -88%) scale(1.1); }
    }

    /* ===== 飞行棋趣味动画（只作用于 ludo，不影响其他棋类） ===== */
    .ludo-dice.rolling {
      color: #8b6914;
      animation: ludoDiceShake 0.14s linear infinite;
    }

    @keyframes ludoDiceShake {
      0% { transform: translate(-50%, -50%) rotate(-4deg) scale(1.05); }
      50% { transform: translate(-50%, -50%) rotate(4deg) scale(0.97); }
      100% { transform: translate(-50%, -50%) rotate(-4deg) scale(1.05); }
    }

    .ludo-token.hop {
      animation: ludoHop 0.27s ease-out;
    }

    @keyframes ludoHop {
      0% { transform: translate(-50%, -81%) scale(1); }
      45% { transform: translate(-50%, -108%) scale(1.12); }
      100% { transform: translate(-50%, -81%) scale(1); }
    }

    .ludo-token.captured {
      animation: ludoCaptured 0.65s ease-in forwards;
      pointer-events: none;
    }

    @keyframes ludoCaptured {
      0% { transform: translate(-50%, -81%) scale(1); opacity: 1; filter: brightness(1); }
      25% { transform: translate(-50%, -81%) scale(1.24); opacity: 1; filter: brightness(2.4); }
      50% { transform: translate(-50%, -81%) scale(0.92); opacity: 0.8; filter: brightness(0.7); }
      70% { transform: translate(-50%, -81%) scale(1.05); opacity: 0.9; filter: brightness(1.8); }
      100% { transform: translate(-50%, -81%) scale(0.08); opacity: 0; }
    }

    /* ===== 飞行棋专属皮肤：霓虹夜光（全部规则锁在 .ludo-skin-neon 下，只作用于 ludo 元素，其他棋类零影响） ===== */
    .ludo-skin-neon .ludo-board {
      background: radial-gradient(circle at 50% 50%, rgba(0, 255, 255, 0.05), transparent 45%), radial-gradient(circle at 20% 30%, rgba(255, 0, 128, 0.08), transparent 35%), radial-gradient(circle at 80% 70%, rgba(0, 255, 128, 0.06), transparent 40%), linear-gradient(145deg, #0a0c12 0%, #13172b 50%, #0a0c12 100%);
      box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15), inset 0 -12px 24px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 180, 255, 0.1);
    }

    .ludo-skin-neon .ludo-map {
      background: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / calc(100% / 15) calc(100% / 15), linear-gradient(0deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / calc(100% / 15) calc(100% / 15), #0a0d16;
      border: 2px solid rgba(255, 255, 255, 0.25);
      box-shadow: 0 18px 34px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 200, 255, 0.08), inset 0 0 20px rgba(255, 255, 255, 0.02);
    }

    .ludo-skin-neon .ludo-home-panel {
      box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.1), inset 0 0 0 2px rgba(0, 0, 0, 0.3), 0 0 25px rgba(0, 0, 0, 0.5);
    }
    .ludo-skin-neon .ludo-home-panel.green { background: linear-gradient(145deg, rgba(57, 255, 20, 0.3), rgba(0, 200, 83, 0.08)); box-shadow: 0 0 20px rgba(57, 255, 20, 0.5), inset 0 0 0 8px rgba(57, 255, 20, 0.15), inset 0 0 0 2px rgba(255, 255, 255, 0.3); }
    .ludo-skin-neon .ludo-home-panel.red { background: linear-gradient(145deg, rgba(255, 42, 42, 0.35), rgba(216, 47, 53, 0.1)); box-shadow: 0 0 20px rgba(255, 42, 42, 0.55), inset 0 0 0 8px rgba(255, 42, 42, 0.15), inset 0 0 0 2px rgba(255, 255, 255, 0.3); }
    .ludo-skin-neon .ludo-home-panel.yellow { background: linear-gradient(145deg, rgba(255, 225, 60, 0.4), rgba(255, 174, 0, 0.12)); box-shadow: 0 0 20px rgba(255, 220, 0, 0.6), inset 0 0 0 8px rgba(255, 225, 60, 0.16), inset 0 0 0 2px rgba(255, 255, 255, 0.3); }
    .ludo-skin-neon .ludo-home-panel.blue { background: linear-gradient(145deg, rgba(0, 229, 255, 0.3), rgba(40, 135, 219, 0.1)); box-shadow: 0 0 20px rgba(0, 229, 255, 0.55), inset 0 0 0 8px rgba(0, 229, 255, 0.15), inset 0 0 0 2px rgba(255, 255, 255, 0.3); }

    .ludo-skin-neon .ludo-home-panel::before {
      color: rgba(255, 255, 255, 0.95);
      text-shadow: 0 0 10px currentColor, 0 2px 8px rgba(0, 0, 0, 0.8);
    }

    .ludo-skin-neon .ludo-home-dots {
      background: rgba(0, 0, 0, 0.45);
      box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25), 0 0 10px rgba(0, 0, 0, 0.5);
    }
    .ludo-skin-neon .ludo-home-dots span {
      background: rgba(255, 255, 255, 0.08);
      box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.6), 0 0 4px rgba(255, 255, 255, 0.1);
    }
    .ludo-skin-neon .ludo-home-panel.red .ludo-home-dots span.done { background: radial-gradient(circle at 35% 30%, #ff6b6b, #ff0040); box-shadow: 0 0 12px #ff0040, 0 0 4px rgba(255, 0, 64, 0.8); }
    .ludo-skin-neon .ludo-home-panel.blue .ludo-home-dots span.done { background: radial-gradient(circle at 35% 30%, #6ed4ff, #0077ff); box-shadow: 0 0 12px #0077ff, 0 0 4px rgba(0, 119, 255, 0.8); }
    .ludo-skin-neon .ludo-home-dots span.out {
      background: rgba(32, 38, 48, 0.15);
      box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15), 0 0 4px rgba(0, 0, 0, 0.3);
    }
    .ludo-skin-neon .ludo-home-panel.idle {
      filter: saturate(0.2) brightness(0.7);
      opacity: 0.5;
    }

    /* 霓虹玻璃砖：主环四色格自带光晕 */
    .ludo-skin-neon .ludo-cell.tint {
      box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), inset 0 -3px 5px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.6);
    }
    .ludo-skin-neon .ludo-cell.tint.red { background: linear-gradient(160deg, rgba(255, 84, 84, 0.92), rgba(255, 22, 22, 0.55)); border: 1px solid rgba(255, 40, 40, 0.9); box-shadow: 0 0 15px rgba(255, 0, 0, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.5), inset 0 -3px 5px rgba(0, 0, 0, 0.5); }
    .ludo-skin-neon .ludo-cell.tint.blue { background: linear-gradient(160deg, rgba(0, 206, 255, 0.92), rgba(0, 124, 255, 0.55)); border: 1px solid rgba(0, 180, 255, 0.9); box-shadow: 0 0 15px rgba(0, 180, 255, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.5), inset 0 -3px 5px rgba(0, 0, 0, 0.5); }
    .ludo-skin-neon .ludo-cell.tint.green { background: linear-gradient(160deg, rgba(74, 255, 42, 0.92), rgba(0, 205, 86, 0.55)); border: 1px solid rgba(57, 255, 20, 0.9); box-shadow: 0 0 15px rgba(57, 255, 20, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.5), inset 0 -3px 5px rgba(0, 0, 0, 0.5); }
    .ludo-skin-neon .ludo-cell.tint.yellow { background: linear-gradient(160deg, rgba(255, 228, 64, 0.95), rgba(255, 174, 0, 0.62)); border: 1px solid rgba(255, 220, 60, 0.95); box-shadow: 0 0 16px rgba(255, 214, 0, 0.75), inset 0 2px 4px rgba(255, 255, 255, 0.5), inset 0 -3px 5px rgba(0, 0, 0, 0.5); }

    .ludo-skin-neon .ludo-cell {
      background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
      border: 1px solid rgba(255, 255, 255, 0.15);
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
    .ludo-skin-neon .ludo-cell.safe::after {
      text-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 0 20px rgba(0, 200, 255, 0.7), 0 1px 3px rgba(0, 0, 0, 0.8);
    }
    .ludo-skin-neon .ludo-cell.finish {
      box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8), inset 0 -3px 5px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 255, 255, 0.4);
    }
    .ludo-skin-neon .ludo-cell.finish::after {
      background: rgba(255, 255, 255, 0.95);
      box-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.5);
    }
    .ludo-skin-neon .ludo-cell.red { color: #ff2a2a; background: linear-gradient(145deg, rgba(255, 42, 42, 0.6), rgba(229, 58, 66, 0.3)); box-shadow: 0 0 12px rgba(255, 0, 0, 0.45); }
    .ludo-skin-neon .ludo-cell.blue { color: #00e5ff; background: linear-gradient(145deg, rgba(0, 229, 255, 0.6), rgba(40, 135, 219, 0.3)); box-shadow: 0 0 12px rgba(0, 200, 255, 0.45); }
    .ludo-skin-neon .ludo-cell.green { color: #39ff14; background: linear-gradient(145deg, rgba(57, 255, 20, 0.6), rgba(33, 175, 72, 0.3)); box-shadow: 0 0 12px rgba(57, 255, 20, 0.45); }
    .ludo-skin-neon .ludo-cell.yellow { color: #ffe600; background: linear-gradient(145deg, rgba(255, 228, 64, 0.65), rgba(255, 178, 32, 0.32)); box-shadow: 0 0 12px rgba(255, 220, 0, 0.5); }

    .ludo-skin-neon .ludo-flight-lines {
      opacity: 0.7;
      filter: drop-shadow(0 0 2px rgba(0, 255, 255, 0.3));
    }

    .ludo-skin-neon .ludo-center {
      background: conic-gradient(from 0deg, rgba(0, 180, 255, 0.8) 0 25%, rgba(255, 200, 0, 0.8) 0 50%, rgba(0, 255, 100, 0.8) 0 75%, rgba(255, 40, 40, 0.8) 0 100%);
      border: 3px solid rgba(255, 255, 255, 0.8);
      box-shadow: 0 0 25px rgba(255, 255, 255, 0.3), 0 9px 18px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.1);
    }
    .ludo-skin-neon .ludo-center::after {
      background: rgba(0, 0, 0, 0.6);
      box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3), 0 0 15px rgba(0, 0, 0, 0.8);
    }

    .ludo-skin-neon .ludo-dice {
      background: linear-gradient(150deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
      border: 3px solid rgba(0, 255, 255, 0.9);
      color: #ffffff;
      box-shadow: 0 0 20px rgba(0, 255, 255, 0.6), 0 10px 24px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.1);
      text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    }
    /* 骰子霓虹呼吸灯（掷骰摇晃时让位给原动画） */
    .ludo-skin-neon .ludo-dice:not(.rolling) {
      animation: ludoNeonBreath 2.6s ease-in-out infinite;
    }
    @keyframes ludoNeonBreath {
      0%, 100% { box-shadow: 0 0 16px rgba(0, 255, 255, 0.45), 0 10px 24px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.1); }
      50% { box-shadow: 0 0 34px rgba(0, 255, 255, 0.95), 0 0 60px rgba(0, 200, 255, 0.35), 0 10px 24px rgba(0, 0, 0, 0.8), inset 0 0 14px rgba(255, 255, 255, 0.18); }
    }
    .ludo-skin-neon .ludo-dice.waiting {
      opacity: 0.7;
    }
    .ludo-skin-neon .ludo-dice .ludo-dice-cap {
      background: rgba(0, 0, 0, 0.7);
      color: #ffffff;
      box-shadow: 0 0 10px rgba(0, 255, 255, 0.4), 0 4px 10px rgba(0, 0, 0, 0.5);
    }
    .ludo-skin-neon .ludo-dice.rolling {
      color: #ffffff;
      text-shadow: 0 0 10px #00ffff;
    }

    .ludo-skin-neon .ludo-token {
      filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6)) drop-shadow(0 3px 3px rgba(0, 0, 0, 0.6));
    }
    .ludo-skin-neon .ludo-token.pending-move {
      filter: drop-shadow(0 0 8px rgba(255, 255, 0, 1)) drop-shadow(0 0 20px rgba(255, 255, 0, 0.8)) drop-shadow(0 3px 3px rgba(0, 0, 0, 0.6));
    }
    .ludo-skin-neon .ludo-token.movable {
      filter: drop-shadow(0 0 8px rgba(255, 255, 0, 0.9)) drop-shadow(0 0 20px rgba(255, 255, 0, 0.6)) drop-shadow(0 3px 3px rgba(0, 0, 0, 0.6));
    }

    /* 全屏庆祝横幅（飞行棋胜利用） */
    .fun-banner {
      position: fixed;
      inset: 0;
      z-index: 60;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
      transition: opacity 0.45s ease;
    }

    .fun-banner.leaving { opacity: 0; }

    .fun-banner span {
      max-width: 86vw;
      padding: 18px 30px;
      border-radius: 24px;
      background: rgba(24, 10, 3, 0.85);
      border: 2px solid rgba(255, 214, 123, 0.55);
      color: var(--gold);
      font-size: clamp(1.25rem, 4.5vw, 2.1rem);
      font-weight: 900;
      text-align: center;
      box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
      animation: funBannerPop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
    }

    .fun-banner.board-win {
      align-items: flex-start;
      padding-top: max(18px, env(safe-area-inset-top));
    }

    .fun-banner.board-win span {
      padding: 11px 20px;
      border-radius: var(--radius-control);
      border-width: 1px;
      font-size: clamp(1rem, 2.8vw, 1.35rem);
      box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
    }

    @keyframes funBannerPop {
      0% { transform: scale(0.4); opacity: 0; }
      60% { transform: scale(1.08); opacity: 1; }
      100% { transform: scale(1); opacity: 1; }
    }

    /* 大厅“更多小游戏”导流胶囊 */
    .more-games {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .more-game-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 9px 16px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.14);
      color: var(--text);
      text-decoration: none;
      font-size: 0.92rem;
      font-weight: 700;
    }

    .more-game-pill:hover {
      background: rgba(255, 214, 123, 0.16);
      border-color: rgba(255, 214, 123, 0.4);
      color: var(--gold);
    }

    .board-grid::before {
      content: none;
    }

    .board-line {
      position: absolute;
      z-index: 1;
      background: var(--line);
      pointer-events: none;
    }

    .board-line.vertical {
      width: 1.5px;
      transform: translateX(-50%);
    }

    .board-line.horizontal {
      height: 1.5px;
      transform: translateY(-50%);
    }

    .board-coordinate {
      position: absolute;
      z-index: 1;
      color: var(--coordinate);
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-size: clamp(0.5rem, 0.72vw, 0.68rem);
      font-weight: 800;
      line-height: 1;
      font-variant-numeric: tabular-nums;
      text-shadow: 0 1px 1px rgba(255, 245, 215, 0.34);
      pointer-events: none;
      user-select: none;
    }

    .board-coordinate.top,
    .board-coordinate.bottom {
      transform: translateX(-50%);
    }

    .board-coordinate.top { top: 0.7%; }
    .board-coordinate.bottom { bottom: 0.7%; }

    .board-coordinate.left,
    .board-coordinate.right {
      transform: translateY(-50%);
    }

    .board-coordinate.left { left: 0.8%; }
    .board-coordinate.right { right: 0.8%; }

    .intersection {
      position: absolute;
      z-index: 2;
      width: 7.4%;
      height: 7.4%;
      transform: translate(-50%, -50%);
      border: none;
      background: transparent;
      border-radius: 50%;
      padding: 0;
      display: grid;
      place-items: center;
      pointer-events: none;
    }

    .board-19 .intersection,
    .go-board-19 .intersection {
      width: 5.8%;
      height: 5.8%;
    }

    .intersection::before,
    .intersection::after {
      content: "";
      position: absolute;
      border-radius: 50%;
      transition: opacity 0.14s ease, transform 0.14s ease, background 0.14s ease;
      pointer-events: none;
    }

    .intersection::before {
      width: 72%;
      height: 72%;
      opacity: 0;
      transform: scale(0.88);
    }

    .board-grid[data-turn="black"] .intersection.playable:not(.filled):hover::before,
    .board-grid[data-turn="black"] .intersection.playable:not(.filled):focus-visible::before {
      opacity: 1;
      background: var(--ghost-black);
      transform: scale(1);
    }

    .board-grid[data-turn="white"] .intersection.playable:not(.filled):hover::before,
    .board-grid[data-turn="white"] .intersection.playable:not(.filled):focus-visible::before {
      opacity: 1;
      background: var(--ghost-white);
      transform: scale(1);
    }

    .intersection::after {
      width: 28%;
      height: 28%;
      background: transparent;
    }

    .intersection.playable:not(.filled):hover::after,
    .intersection.playable:not(.filled):focus-visible::after {
      background: rgba(73, 39, 9, 0.18);
      transform: scale(1.14);
    }

    .intersection.pending::before,
    .intersection.pending::after {
      opacity: 0;
    }

    .intersection:focus-visible {
      outline: 2px solid rgba(255, 244, 194, 0.94);
      outline-offset: 2px;
    }

    .stone {
      width: 78%;
      height: 78%;
      position: relative;
      border: 1.5px solid rgba(0, 0, 0, 0.2);
      box-shadow:
        inset 3px 4px 5px rgba(255, 255, 255, 0.14),
        inset -7px -8px 11px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.1),
        0 3px 2px rgba(0, 0, 0, 0.34),
        0 10px 12px rgba(0, 0, 0, 0.28);
      transition: transform 0.14s ease, box-shadow 0.14s ease;
      transform: translateZ(0);
    }

    .board-19 .stone,
    .go-board-19 .stone {
      width: 84%;
      height: 84%;
    }

    .stone::before {
      content: "";
      position: absolute;
      left: 16%;
      top: 12%;
      width: 32%;
      height: 22%;
      border-radius: 50%;
      background: radial-gradient(ellipse, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.09) 52%, transparent 76%);
      pointer-events: none;
    }

    .stone::after {
      content: "";
      position: absolute;
      inset: 7%;
      border-radius: 50%;
      background: radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.04), transparent 48%);
      box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.08),
        inset 0 -5px 8px rgba(0, 0, 0, 0.1);
      pointer-events: none;
      opacity: 0.58;
    }

    .stone.black {
      border-color: rgba(0, 0, 0, 0.42);
    }

    .stone.white {
      border-color: rgba(115, 86, 43, 0.22);
      box-shadow:
        inset 4px 5px 7px rgba(255, 255, 255, 0.82),
        inset -7px -8px 11px rgba(108, 80, 39, 0.28),
        0 1px 0 rgba(255, 255, 255, 0.26),
        0 2px 1px rgba(101, 63, 19, 0.16),
        0 9px 12px rgba(0, 0, 0, 0.22);
    }

    .stone.white::after {
      background: radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.16), transparent 44%);
      border-color: rgba(122, 93, 46, 0.09);
    }

    .stone.black::before {
      background: radial-gradient(ellipse, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06) 48%, transparent 72%);
    }

    .stone.pending-stone {
      opacity: 0.82;
      transform: translateY(-4px) scale(0.96);
      filter: saturate(0.96);
      box-shadow:
        0 0 0 3px rgba(255, 214, 123, 0.68),
        inset 3px 5px 8px rgba(255, 255, 255, 0.12),
        inset -8px -10px 15px rgba(0, 0, 0, 0.36),
        0 14px 18px rgba(0, 0, 0, 0.22);
    }

    .stone.white.pending-stone {
      box-shadow:
        0 0 0 3px rgba(255, 214, 123, 0.68),
        inset 5px 6px 10px rgba(255, 255, 255, 0.7),
        inset -9px -10px 15px rgba(108, 80, 39, 0.2),
        0 14px 18px rgba(0, 0, 0, 0.2);
    }

    .intersection.last .stone {
      box-shadow:
        0 0 0 3px rgba(234, 103, 103, 0.92),
        inset 3px 4px 7px rgba(255, 255, 255, 0.1),
        inset -7px -8px 13px rgba(0, 0, 0, 0.36),
        0 3px 0 rgba(0, 0, 0, 0.2),
        0 10px 14px rgba(0, 0, 0, 0.26);
    }

    .stone.stone-enter {
      animation: stoneEnter 0.22s cubic-bezier(0.2, 0.86, 0.32, 1.28) both;
    }

    @keyframes stoneEnter {
      from { opacity: 0.32; transform: translateY(-18%) scale(0.58); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .intersection.win .stone {
      box-shadow:
        0 0 0 4px rgba(105, 224, 154, 0.92),
        0 0 22px rgba(105, 224, 154, 0.58),
        inset 3px 4px 7px rgba(255, 255, 255, 0.1),
        inset -7px -8px 13px rgba(0, 0, 0, 0.36),
        0 3px 0 rgba(0, 0, 0, 0.2),
        0 10px 14px rgba(0, 0, 0, 0.26);
      transform: scale(1.08);
    }

    .star-point {
      position: absolute;
      z-index: 1;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: rgba(73, 39, 9, 0.68);
      background: var(--star);
      transform: translate(-50%, -50%);
      pointer-events: none;
    }

    .overlay {
      position: fixed;
      inset: 0;
      z-index: 20;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(24, 10, 3, 0.54);
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.2s ease, visibility 0s linear 0.2s;
      padding: 20px;
      overflow-y: auto;
    }

    .overlay.show {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
      transition-delay: 0s;
    }

    .overlay-card {
      position: relative;
      z-index: 21;
      width: min(430px, 100%);
      text-align: center;
      padding: 28px;
      border-radius: 24px;
      background: rgba(53, 26, 5, 0.96);
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow: 0 20px 42px rgba(0, 0, 0, 0.32);
    }

    .overlay-card h2 {
      margin: 0 0 8px;
      font-size: clamp(1.8rem, 4vw, 2.5rem);
    }

    .overlay-card p {
      margin: 0 0 18px;
      color: var(--soft);
      line-height: 1.6;
    }

    .overlay-actions {
      display: flex;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .overlay-actions button {
      flex: 1 1 128px;
      max-width: 168px;
      min-height: 48px;
      min-width: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1.2;
    }

    .overlay[data-busy="true"] .overlay-actions button:disabled {
      cursor: wait;
      opacity: 0.72;
    }

    /* ===== 视觉细节：聚焦光环 / 入场与弹窗动效 / 背景光斑漂移 ===== */
    input:focus,
    select:focus,
    .link-value:focus {
      border-color: rgba(255, 214, 123, 0.55);
      box-shadow: 0 0 0 3px rgba(255, 214, 123, 0.13);
    }

    .support-btn:hover {
      background: rgba(255, 214, 123, 0.22);
      box-shadow: 0 12px 26px rgba(255, 214, 123, 0.16);
    }

    .score-card .value {
      color: var(--gold);
      font-size: 1.28rem;
      font-variant-numeric: tabular-nums;
    }

    .overlay {
      -webkit-backdrop-filter: blur(5px);
      backdrop-filter: blur(5px);
    }

    .overlay.show .overlay-card {
      animation: pop 0.24s ease;
    }

    @keyframes pop {
      from { transform: scale(0.94) translateY(6px); opacity: 0.5; }
    }

    @keyframes rise {
      from { opacity: 0; transform: translateY(16px); }
    }

    .panel { animation: rise 0.55s ease both; }
    .board-shell { animation: rise 0.55s ease 0.1s both; }

    @keyframes drift {
      50% { transform: translate3d(26px, -20px, 0) scale(1.07); }
    }

    body::before { animation: drift 16s ease-in-out infinite; }
    body::after { animation: drift 20s ease-in-out infinite reverse; }

    @media (prefers-reduced-motion: reduce) {
      .panel,
      .board-shell,
      body::before,
      body::after,
      .overlay.show .overlay-card,
      .stone.stone-enter,
      .fun-banner,
      .fun-banner span,
      .app[data-server-state="waking"] .connection-banner::before { animation: none; }

      .fun-banner { transition: none; }
    }

    @media (max-width: 980px) {
      .app { grid-template-columns: 1fr; }
      .app.focus-mode { grid-template-columns: 1fr; }
    }

    @media (max-width: 760px) {
      .view-switch {
        grid-template-columns: minmax(0, 1fr) auto;
      }
      .match-score-strip {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
      }
    }

    @media (max-width: 620px) {
      .app {
        --board-size: min(760px, calc(100vw - 52px), max(280px, calc(100dvh - 300px)));
      }
      body { padding: 12px; }
      .panel, .board-shell { border-radius: 22px; }
      .panel { padding: 18px; }
      .game-select-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .resume-game-card {
        grid-template-columns: 1fr;
        gap: 12px;
      }
      #resumeGameBtn { width: 100%; }
      .status-grid, .score-grid, .mode-strip { grid-template-columns: 1fr 1fr; }
      .room-entry-grid { grid-template-columns: 1fr; }
      .board-tools {
        top: auto;
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-height: min(78dvh, 680px);
        border-radius: 22px;
        transform: translateY(calc(100% + 28px));
      }
      .app.tools-open > .board-tools { transform: translateY(0); }
      .step-list { grid-template-columns: 1fr; }
      .board-frame { padding: 12px; border-radius: 20px; }
      /* 手机上给棋盘多让点空间（围棋/象棋/飞行棋通用，纯视觉不改逻辑） */
      .board-grid.variant-board { padding: 10px; }
      .star-point { width: 7px; height: 7px; }
      .panel > * { order: 4; }
      .panel .hero { order: 0; }
      .panel .resume-game-card { order: 1; }
      .panel .game-picker-card { order: 2; }
      .panel .room-entry-card { order: 3; }
      .panel .room-state-card { order: 4; }
    }

    @media (max-width: 430px) {
      .score-grid, .actions, .code-actions, .mode-strip { grid-template-columns: 1fr; }
      .actions, .top-actions, .code-actions { display: grid; }
      .top-actions { grid-template-columns: 1fr 1fr; }
      .room-entry-card #createRoomBtn {
        grid-column: 1 / -1;
        width: 100%;
      }
      .app[data-ui-state="link-pending"] #joinRoomBtn,
      .app[data-ui-state="waiting"] #leaveRoomBtn,
      .app[data-ui-state="playing"] #leaveRoomBtn,
      .app[data-ui-state="finished"] #leaveRoomBtn {
        grid-column: 1 / -1;
        width: 100%;
      }
      .view-switch { grid-template-columns: 1fr; }
      .current-game-chip { justify-content: center; }
      .match-score-strip {
        grid-column: 1;
        grid-row: auto;
        justify-content: center;
        flex-wrap: wrap;
      }
      .view-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
      }
      .view-actions button {
        width: 100%;
        padding: 0 6px;
      }
      .match-status-strip {
        grid-template-columns: minmax(0, 1fr) auto;
      }
      .match-focus {
        grid-column: 1 / -1;
      }
      .board-eyebrow { display: none; }
      .board-status-main strong { max-width: 38%; }
      .board-tools .board-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 360px) {
      .game-select-grid { grid-template-columns: 1fr; }
    }
