@layer reset, base, components, responsive;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    min-width: 320px;
    background: #f1eddf;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body,
  h1,
  h2,
  p,
  dl,
  dd,
  ol {
    margin: 0;
  }

  button,
  input {
    font: inherit;
  }

  button {
    color: inherit;
  }
}

@layer base {
  :root {
    color-scheme: light;
    --ink: #173c32;
    --ink-deep: #102d27;
    --ink-soft: #547068;
    --paper: #f7f3e8;
    --paper-deep: #ebe3d1;
    --line: rgba(23, 60, 50, 0.18);
    --gold: #c39a5e;
    --gold-bright: #dfbd80;
    --red: #a84935;
    --board: #ddb979;
    --board-deep: #bf8d4e;
    --shadow: 0 28px 80px rgba(42, 45, 31, 0.12);
    font-family:
      Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
      "PingFang SC", "Microsoft YaHei", sans-serif;
    font-synthesis: none;
    color: var(--ink);
    background: #f1eddf;
  }

  body {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 10% 5%, rgba(255, 255, 255, 0.88), transparent 31rem),
      radial-gradient(circle at 90% 22%, rgba(210, 190, 145, 0.25), transparent 28rem),
      #f1eddf;
  }

  body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    opacity: 0.27;
    pointer-events: none;
    background-image:
      linear-gradient(rgba(23, 60, 50, 0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(23, 60, 50, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
  }

  button,
  input {
    outline-color: var(--gold);
    outline-offset: 3px;
    -webkit-tap-highlight-color: transparent;
  }

  button {
    cursor: pointer;
    touch-action: manipulation;
  }

  button:disabled {
    cursor: not-allowed;
  }

  ::selection {
    color: var(--paper);
    background: var(--ink);
  }
}

@layer components {
  .site-shell {
    width: min(100%, 1220px);
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    margin: 0 auto;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-left: max(20px, env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
  }

  .site-shell.has-mobile-action {
    padding-bottom: calc(94px + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 88px;
    padding-top: env(safe-area-inset-top);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
  }

  .brand-mark {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background:
      linear-gradient(rgba(221, 183, 121, 0.35) 1px, transparent 1px),
      linear-gradient(90deg, rgba(221, 183, 121, 0.35) 1px, transparent 1px),
      var(--ink);
    background-size: 12px 12px;
    box-shadow: 0 8px 20px rgba(23, 60, 50, 0.15);
  }

  .mini-stone {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
  }

  .mini-stone-black {
    top: 8px;
    left: 8px;
    background: #101513;
  }

  .mini-stone-white {
    right: 7px;
    bottom: 7px;
    background: #f8f3e7;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  }

  .brand strong {
    display: block;
    font-family: ui-serif, "Songti SC", STSong, serif;
    font-size: 21px;
    letter-spacing: 0.18em;
  }

  .brand small {
    display: block;
    margin-top: 2px;
    color: var(--ink-soft);
    font-size: 8px;
    letter-spacing: 0.23em;
  }

  .preview-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border: 1px solid rgba(23, 60, 50, 0.12);
    border-radius: 999px;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.35);
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6f957e;
    box-shadow: 0 0 0 4px rgba(111, 149, 126, 0.14);
  }

  .topbar-note,
  .topbar > .text-button {
    justify-self: end;
  }

  .topbar-note {
    color: var(--ink-soft);
    font-size: 12px;
    letter-spacing: 0.06em;
  }

  .main-content {
    flex: 1;
  }

  .home-grid {
    min-height: 610px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.65fr);
    align-items: center;
    gap: clamp(56px, 8vw, 112px);
    padding: 70px 3vw 48px;
  }

  .eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
  }

  .eyebrow > span {
    width: 34px;
    height: 1px;
    background: currentColor;
  }

  .eyebrow.centered {
    justify-content: center;
  }

  .hero-copy h1,
  .lobby-stage h1 {
    margin-top: 25px;
    font-family: ui-serif, "Songti SC", STSong, serif;
    font-size: clamp(48px, 6.2vw, 78px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.045em;
  }

  h1 em {
    color: var(--gold);
    font-style: normal;
  }

  .hero-lead {
    max-width: 590px;
    margin-top: 27px;
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1.85;
  }

  .hero-actions {
    margin-top: 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }

  .button {
    min-height: 46px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: 160ms ease;
  }

  .button:not(:disabled):hover {
    transform: translateY(-2px);
  }

  .button-large {
    min-height: 54px;
    padding-inline: 25px;
  }

  .button-primary {
    color: #f8f3e8;
    background: var(--ink);
    box-shadow: 0 14px 34px rgba(23, 60, 50, 0.18);
  }

  .button-primary:hover,
  .button-dark:hover {
    background: var(--ink-deep);
  }

  .button-quiet {
    border-color: var(--line);
    color: var(--ink);
    background: rgba(255, 255, 255, 0.28);
  }

  .button-dark {
    color: var(--paper);
    background: var(--ink);
  }

  .button-outline {
    border-color: rgba(23, 60, 50, 0.28);
    color: var(--ink);
    background: transparent;
  }

  .button-accent {
    color: #fff9ef;
    background: var(--red);
  }

  .button-danger {
    color: white;
    background: var(--red);
  }

  .button-block {
    width: 100%;
  }

  .button:disabled {
    opacity: 0.45;
    transform: none;
  }

  .text-button {
    padding: 8px 0;
    border: 0;
    color: var(--ink-soft);
    background: transparent;
    font-size: 13px;
    text-decoration: underline;
    text-decoration-color: rgba(23, 60, 50, 0.28);
    text-underline-offset: 4px;
  }

  .promise-row {
    margin-top: 46px;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    color: var(--ink-soft);
    font-size: 11px;
  }

  .promise-row span {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .promise-row i {
    color: var(--gold);
    font-family: ui-serif, Georgia, serif;
    font-size: 10px;
    font-style: normal;
  }

  .paper-card {
    position: relative;
    border: 1px solid rgba(23, 60, 50, 0.14);
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.54), transparent 55%),
      var(--paper);
    box-shadow: var(--shadow);
  }

  .join-card {
    min-height: 445px;
    padding: 44px 40px 37px;
  }

  .card-corner {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-top: 1px solid var(--gold);
    border-right: 1px solid var(--gold);
  }

  .card-index,
  .section-kicker {
    color: var(--gold);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.24em;
  }

  .join-card h2 {
    margin-top: 16px;
    font-family: ui-serif, "Songti SC", STSong, serif;
    font-size: 31px;
    font-weight: 600;
  }

  .join-card > p:not(.card-index) {
    margin-top: 9px;
    color: var(--ink-soft);
    font-size: 13px;
  }

  .join-card form {
    margin-top: 32px;
  }

  .join-card label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
  }

  .key-input-wrap {
    position: relative;
  }

  .key-input-wrap input {
    width: 100%;
    height: 58px;
    padding: 0 58px 0 17px;
    border: 1px solid rgba(23, 60, 50, 0.22);
    border-radius: 2px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.45);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .key-input-wrap input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(195, 154, 94, 0.12);
  }

  .input-count {
    position: absolute;
    top: 50%;
    right: 15px;
    color: #87948f;
    font-family: ui-monospace, monospace;
    font-size: 10px;
    transform: translateY(-50%);
  }

  .field-error {
    min-height: 28px;
    padding-top: 7px;
    color: var(--red);
    font-size: 11px;
  }

  .form-hint {
    margin-top: 15px;
    color: #849089;
    font-size: 10px;
    line-height: 1.6;
    text-align: center;
  }

  .seal {
    position: absolute;
    right: -17px;
    bottom: 25px;
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: rgba(255, 255, 255, 0.83);
    background: var(--red);
    font-family: ui-serif, "Songti SC", serif;
    font-size: 12px;
    line-height: 1.05;
    text-align: center;
    transform: rotate(4deg);
  }

  .how-it-works {
    display: grid;
    grid-template-columns: 0.55fr 1.45fr;
    gap: 60px;
    padding: 44px 3vw 70px;
    border-top: 1px solid var(--line);
  }

  .how-it-works h2 {
    margin-top: 10px;
    font-family: ui-serif, "Songti SC", STSong, serif;
    font-size: 25px;
    font-weight: 600;
  }

  .steps-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    list-style: none;
    padding: 0;
  }

  .steps-list li {
    position: relative;
    min-height: 94px;
    padding-left: 44px;
  }

  .steps-list li + li::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: -10px;
    width: 1px;
    content: "";
    background: var(--line);
  }

  .steps-list span {
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(195, 154, 94, 0.45);
    border-radius: 50%;
    color: var(--gold);
    font-family: ui-serif, "Songti SC", serif;
    font-size: 11px;
  }

  .steps-list strong,
  .steps-list small {
    display: block;
  }

  .steps-list strong {
    padding-top: 3px;
    font-family: ui-serif, "Songti SC", serif;
    font-size: 16px;
  }

  .steps-list small {
    margin-top: 9px;
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.6;
  }

  .lobby-layout {
    min-height: calc(100vh - 154px);
    min-height: calc(100dvh - 154px);
    display: grid;
    grid-template-columns: 1fr 410px;
    align-items: center;
    gap: clamp(60px, 10vw, 140px);
    padding: 64px 7vw 80px;
  }

  .lobby-stage {
    text-align: center;
  }

  .lobby-stage h1 {
    margin-top: 17px;
  }

  .lobby-copy {
    max-width: 390px;
    margin: 24px auto 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.8;
  }

  .waiting-orbit {
    position: relative;
    width: 155px;
    height: 155px;
    margin: 0 auto 34px;
  }

  .orbit-ring {
    position: absolute;
    border: 1px solid rgba(23, 60, 50, 0.15);
    border-radius: 50%;
  }

  .ring-one {
    inset: 8px;
    animation: orbit 14s linear infinite;
  }

  .ring-one::after {
    position: absolute;
    top: 18px;
    right: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    content: "";
    background: var(--gold);
  }

  .ring-two {
    inset: 31px;
    border-style: dashed;
    animation: orbit 18s linear reverse infinite;
  }

  .waiting-stone {
    position: absolute;
    top: 50%;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    transform: translateY(-50%);
  }

  .waiting-stone.black {
    left: 24px;
    background: radial-gradient(circle at 32% 28%, #46504c, #151b19 63%, #080a09);
    box-shadow: 0 11px 20px rgba(16, 25, 22, 0.28);
  }

  .waiting-stone.ghost {
    right: 24px;
    border: 1px dashed rgba(23, 60, 50, 0.32);
    background: rgba(255, 255, 255, 0.28);
  }

  .invite-panel {
    padding: 40px;
  }

  .room-key-display {
    margin: 22px 0 27px;
    padding: 19px 12px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 31px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-align: center;
  }

  .room-key-display span,
  .room-card strong span {
    margin-left: 0.26em;
  }

  .invite-panel .button + .button {
    margin-top: 10px;
  }

  .waiting-line {
    margin-top: 27px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
  }

  .waiting-line strong,
  .waiting-line small {
    display: block;
  }

  .waiting-line strong {
    font-size: 12px;
  }

  .waiting-line small {
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 10px;
  }

  .spinner {
    width: 27px;
    height: 27px;
    border: 1px solid rgba(23, 60, 50, 0.15);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: orbit 1.4s linear infinite;
  }

  .prototype-box {
    margin-top: 4px;
    padding: 17px;
    border: 1px dashed rgba(168, 73, 53, 0.34);
    background: rgba(168, 73, 53, 0.045);
  }

  .prototype-box > span,
  .demo-title span {
    display: inline-block;
    padding: 3px 6px;
    color: white;
    background: var(--red);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.14em;
  }

  .prototype-box p {
    margin: 9px 0 13px;
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.6;
  }

  .character-stage {
    min-height: calc(100vh - 154px);
    min-height: calc(100dvh - 154px);
    padding: 52px 3vw 64px;
  }

  .character-heading {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
  }

  .character-heading h1 {
    margin-top: 17px;
    font-family: ui-serif, "Songti SC", STSong, serif;
    font-size: clamp(42px, 5vw, 64px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.04em;
  }

  .character-heading > p:last-child {
    max-width: 590px;
    margin: 17px auto 0;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.75;
  }

  .character-grid {
    width: min(100%, 850px);
    margin: 36px auto 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .character-card {
    position: relative;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(23, 60, 50, 0.16);
    border-radius: 18px;
    color: var(--ink);
    background: rgba(248, 244, 234, 0.74);
    box-shadow: 0 18px 42px rgba(42, 45, 31, 0.08);
    text-align: left;
    transform: translateY(0);
    transition: 180ms ease;
  }

  .character-card:hover,
  .character-card:focus-visible {
    border-color: rgba(195, 154, 94, 0.68);
    transform: translateY(-4px);
  }

  .character-card.selected {
    border-color: var(--gold);
    box-shadow:
      0 0 0 3px rgba(195, 154, 94, 0.14),
      0 24px 55px rgba(42, 45, 31, 0.14);
    transform: translateY(-6px);
  }

  .character-art {
    position: relative;
    height: 286px;
    display: block;
    overflow: hidden;
  }

  .character-taotao .character-art,
  .character-taotao.player-avatar,
  .character-taotao.turn-character,
  .character-taotao.move-avatar,
  .character-taotao.result-avatar {
    background:
      radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.92), transparent 45%),
      #ead3ca;
  }

  .character-amo .character-art,
  .character-amo.player-avatar,
  .character-amo.turn-character,
  .character-amo.move-avatar,
  .character-amo.result-avatar {
    background:
      radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.72), transparent 45%),
      #bfd0c7;
  }

  .character-art::after {
    position: absolute;
    right: 18px;
    bottom: 16px;
    width: 66px;
    height: 66px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 50%;
    content: "";
  }

  .character-art img {
    position: absolute;
    inset: 8px 0 0;
    width: 100%;
    height: calc(100% - 8px);
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 16px 18px rgba(42, 36, 25, 0.14));
    transform: scale(1.02);
    transition: 220ms ease;
  }

  .character-card:hover .character-art img,
  .character-card.selected .character-art img {
    transform: scale(1.06);
  }

  .character-art > i {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--ink-soft);
    background: rgba(250, 247, 238, 0.84);
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.08em;
    backdrop-filter: blur(8px);
  }

  .character-card.selected .character-art > i {
    color: var(--paper);
    background: var(--ink);
  }

  .character-meta {
    min-height: 148px;
    display: block;
    padding: 20px 22px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.46);
  }

  .character-labels {
    display: flex;
    gap: 7px;
  }

  .character-labels i,
  .character-labels em {
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 8px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.09em;
  }

  .character-labels i {
    color: var(--paper);
    background: var(--ink);
  }

  .character-labels em {
    border: 1px solid rgba(23, 60, 50, 0.14);
    color: var(--ink-soft);
  }

  .character-meta > strong,
  .character-meta > small {
    display: block;
  }

  .character-meta > strong {
    margin-top: 10px;
    font-family: ui-serif, "Songti SC", STSong, serif;
    font-size: 29px;
    font-weight: 600;
  }

  .character-meta > small {
    margin-top: 7px;
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.65;
  }

  .character-confirm-bar {
    width: min(100%, 850px);
    margin: 22px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    background: rgba(247, 243, 232, 0.74);
    box-shadow: 0 16px 38px rgba(42, 45, 31, 0.08);
    backdrop-filter: blur(14px);
  }

  .seat-preview {
    display: flex;
    align-items: center;
    gap: 11px;
  }

  .seat-stone {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
    box-shadow: 0 6px 14px rgba(23, 39, 33, 0.2);
  }

  .seat-preview small,
  .seat-preview strong {
    display: block;
  }

  .seat-preview small {
    color: var(--ink-soft);
    font-size: 8px;
    letter-spacing: 0.1em;
  }

  .seat-preview strong {
    margin-top: 3px;
    font-family: ui-serif, "Songti SC", STSong, serif;
    font-size: 15px;
  }

  .game-heading {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 0 18px;
  }

  .game-heading h1 {
    margin-top: 8px;
    font-family: ui-serif, "Songti SC", STSong, serif;
    font-size: 34px;
    font-weight: 600;
  }

  .turn-announcer {
    min-width: 210px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.25);
  }

  .turn-character {
    position: relative;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(23, 60, 50, 0.12);
    border-radius: 50%;
  }

  .turn-character img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 12%;
    transform: scale(1.23);
  }

  .turn-character .turn-stone {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 13px;
    height: 13px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 4px rgba(12, 25, 21, 0.24);
  }

  .turn-announcer.paused {
    border-color: rgba(168, 73, 53, 0.3);
  }

  .turn-announcer small,
  .turn-announcer strong {
    display: block;
  }

  .turn-announcer small {
    color: var(--ink-soft);
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .turn-announcer strong {
    margin-top: 4px;
    font-family: ui-serif, "Songti SC", serif;
    font-size: 15px;
  }

  .turn-stone,
  .player-stone,
  .dialog-stone {
    flex: 0 0 auto;
    border-radius: 50%;
  }

  .turn-stone {
    width: 29px;
    height: 29px;
  }

  .black {
    background: radial-gradient(circle at 32% 28%, #4d5752, #161b19 62%, #080b0a);
  }

  .white {
    border: 1px solid rgba(23, 60, 50, 0.17);
    background: radial-gradient(circle at 30% 24%, #fff, #f3eee2 67%, #d9d2c4);
  }

  .offline-banner {
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border: 1px solid rgba(168, 73, 53, 0.28);
    color: #704335;
    background: rgba(255, 246, 232, 0.72);
  }

  .offline-icon {
    font-size: 24px;
  }

  .offline-banner strong,
  .offline-banner small {
    display: block;
  }

  .offline-banner strong {
    font-size: 12px;
  }

  .offline-banner small {
    margin-top: 3px;
    font-size: 10px;
  }

  .offline-banner button {
    padding: 7px 10px;
    border: 1px solid currentColor;
    color: inherit;
    background: transparent;
    font-size: 10px;
  }

  .game-layout {
    display: grid;
    grid-template-columns: minmax(0, 760px) minmax(260px, 1fr);
    align-items: start;
    gap: clamp(24px, 4vw, 50px);
    padding-bottom: 58px;
  }

  .player-strip {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 14px;
  }

  .board-column {
    position: relative;
  }

  .player-summary {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    border: 1px solid transparent;
    transition: 160ms ease;
  }

  .player-summary:last-child {
    flex-direction: row-reverse;
    text-align: right;
  }

  .player-summary.active {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.28);
  }

  .player-stone {
    width: 34px;
    height: 34px;
    box-shadow: 0 5px 12px rgba(23, 39, 33, 0.17);
  }

  .player-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    overflow: visible;
    border: 1px solid rgba(23, 60, 50, 0.12);
    border-radius: 50%;
  }

  .player-avatar img {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    object-fit: cover;
    object-position: center 12%;
    transform: scale(1.2);
    clip-path: circle(50% at 50% 50%);
  }

  .player-avatar .player-stone {
    position: absolute;
    right: -2px;
    bottom: -1px;
    width: 15px;
    height: 15px;
    border: 1px solid rgba(255, 255, 255, 0.72);
  }

  .player-summary strong em {
    margin-left: 4px;
    color: var(--gold);
    font-family: inherit;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
  }

  .player-summary strong,
  .player-summary small {
    display: block;
  }

  .player-summary strong {
    font-family: ui-serif, "Songti SC", serif;
    font-size: 14px;
  }

  .player-summary small {
    margin-top: 3px;
    color: var(--ink-soft);
    font-size: 9px;
  }

  .turn-tag {
    margin-left: auto;
    padding: 3px 6px;
    color: var(--paper);
    background: var(--ink);
    font-size: 8px;
    letter-spacing: 0.1em;
  }

  .move-reaction {
    position: absolute;
    top: 68px;
    right: 14px;
    z-index: 4;
    max-width: 230px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 12px 7px 7px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    color: var(--ink);
    background: rgba(250, 247, 238, 0.9);
    box-shadow: 0 13px 30px rgba(42, 36, 25, 0.18);
    backdrop-filter: blur(12px);
    pointer-events: none;
    animation: reaction-in 220ms ease-out;
  }

  .move-reaction img {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 12%;
  }

  .move-reaction strong,
  .move-reaction small {
    display: block;
  }

  .move-reaction strong {
    font-family: ui-serif, "Songti SC", STSong, serif;
    font-size: 11px;
  }

  .move-reaction small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player-summary:last-child .turn-tag {
    margin-right: auto;
    margin-left: 0;
  }

  .round-mark {
    min-width: 58px;
    text-align: center;
  }

  .round-mark span,
  .round-mark strong {
    display: block;
  }

  .round-mark span {
    color: var(--gold);
    font-family: ui-serif, "Songti SC", serif;
    font-size: 10px;
  }

  .round-mark strong {
    margin-top: 2px;
    font-family: ui-monospace, monospace;
    font-size: 14px;
  }

  .board-frame {
    padding: clamp(12px, 2vw, 21px);
    border: 1px solid rgba(77, 48, 20, 0.34);
    background: #7b5835;
    box-shadow:
      0 28px 60px rgba(56, 42, 24, 0.2),
      inset 0 0 0 3px rgba(255, 255, 255, 0.06);
  }

  .board-surface {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    background:
      radial-gradient(circle at 30% 20%, rgba(255, 236, 178, 0.35), transparent 38%),
      linear-gradient(135deg, #e2bd7b, #d3a763);
    box-shadow: inset 0 0 34px rgba(89, 52, 17, 0.18);
  }

  .board-surface::before {
    position: absolute;
    inset: 0;
    content: "";
    opacity: 0.2;
    pointer-events: none;
    background-image: repeating-linear-gradient(
      4deg,
      transparent 0,
      transparent 7px,
      rgba(90, 53, 22, 0.12) 8px,
      transparent 9px
    );
  }

  .board-lines {
    position: absolute;
    inset: calc(100% / 30);
    border: 1px solid rgba(54, 39, 22, 0.69);
    background-image:
      linear-gradient(to right, rgba(54, 39, 22, 0.56) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(54, 39, 22, 0.56) 1px, transparent 1px);
    background-size: calc(100% / 14) calc(100% / 14);
    pointer-events: none;
  }

  .star-point {
    position: absolute;
    z-index: 1;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(55, 37, 18, 0.78);
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  .board-points {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
  }

  .board-point {
    position: relative;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    touch-action: manipulation;
  }

  .board-point[aria-disabled="true"] {
    cursor: default;
  }

  .stone,
  .hover-stone,
  .candidate-stone {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
  }

  .stone {
    animation: stone-in 160ms ease-out;
  }

  .candidate-stone {
    z-index: 2;
    opacity: 0.72;
    box-shadow:
      0 0 0 3px rgba(168, 73, 53, 0.95),
      0 7px 12px rgba(55, 36, 17, 0.26);
    animation: candidate-pulse 1.15s ease-in-out infinite;
  }

  .candidate-stone .candidate-mark {
    position: absolute;
    top: 8%;
    right: 8%;
    width: 19%;
    height: 19%;
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: 50%;
    background: var(--red);
  }

  .stone-decoration {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    display: block;
    pointer-events: none;
  }

  .stone.black.character-taotao,
  .candidate-stone.black.character-taotao {
    --petal: #efb4aa;
    --deco-center: #d9ad63;
  }

  .stone.white.character-taotao,
  .candidate-stone.white.character-taotao {
    --petal: #b95750;
    --deco-center: #a77735;
  }

  .stone.character-taotao .stone-decoration,
  .candidate-stone.character-taotao .stone-decoration {
    width: 46%;
    height: 46%;
    border-radius: 50%;
    background:
      radial-gradient(circle at 50% 16%, var(--petal) 0 15%, transparent 17%),
      radial-gradient(circle at 82% 40%, var(--petal) 0 15%, transparent 17%),
      radial-gradient(circle at 70% 78%, var(--petal) 0 15%, transparent 17%),
      radial-gradient(circle at 30% 78%, var(--petal) 0 15%, transparent 17%),
      radial-gradient(circle at 18% 40%, var(--petal) 0 15%, transparent 17%),
      radial-gradient(circle at 50% 50%, var(--deco-center) 0 16%, transparent 18%);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
    transform: translate(-50%, -50%);
  }

  .stone.black.character-amo,
  .candidate-stone.black.character-amo {
    --bamboo: #c8a66d;
  }

  .stone.white.character-amo,
  .candidate-stone.white.character-amo {
    --bamboo: #397565;
  }

  .stone.character-amo .stone-decoration,
  .candidate-stone.character-amo .stone-decoration {
    width: 43%;
    height: 54%;
    border-left: max(1px, 0.08em) solid var(--bamboo);
    transform: translate(-42%, -50%) rotate(-25deg);
  }

  .stone.character-amo .stone-decoration::before,
  .stone.character-amo .stone-decoration::after,
  .candidate-stone.character-amo .stone-decoration::before,
  .candidate-stone.character-amo .stone-decoration::after {
    position: absolute;
    width: 76%;
    height: 28%;
    border-radius: 100% 0 100% 0;
    content: "";
    background: var(--bamboo);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.14);
  }

  .stone.character-amo .stone-decoration::before,
  .candidate-stone.character-amo .stone-decoration::before {
    top: 12%;
    left: 8%;
    transform: rotate(10deg);
  }

  .stone.character-amo .stone-decoration::after,
  .candidate-stone.character-amo .stone-decoration::after {
    right: 10%;
    bottom: 10%;
    transform: rotate(185deg);
  }

  .stone.black {
    box-shadow:
      0 7px 8px rgba(55, 36, 17, 0.3),
      inset -2px -3px 5px rgba(0, 0, 0, 0.4),
      inset 2px 2px 5px rgba(255, 255, 255, 0.16);
  }

  .stone.white {
    box-shadow:
      0 7px 8px rgba(55, 36, 17, 0.25),
      inset -2px -3px 5px rgba(78, 62, 39, 0.16),
      inset 2px 2px 5px rgba(255, 255, 255, 0.8);
  }

  .stone .last-mark {
    position: absolute;
    top: 7%;
    right: 7%;
    z-index: 2;
    width: 20%;
    height: 20%;
    border: 2px solid var(--red);
    border-radius: 50%;
    background: rgba(247, 243, 232, 0.72);
    box-shadow: 0 1px 2px rgba(55, 36, 17, 0.18);
  }

  .board-point.winning .stone {
    box-shadow:
      0 0 0 3px rgba(168, 73, 53, 0.8),
      0 8px 14px rgba(55, 36, 17, 0.32);
  }

  .hover-stone {
    opacity: 0;
    background: rgba(23, 31, 28, 0.22);
    transform: translate(-50%, -50%) scale(0.72);
    transition: 120ms ease;
  }

  .board-point:not([aria-disabled="true"]):focus-visible .hover-stone {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  @media (hover: hover) and (pointer: fine) {
    .board-point:not([aria-disabled="true"]):hover .hover-stone {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }

  .board-surface.is-disabled .board-points {
    opacity: 0.84;
  }

  .board-caption {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding-top: 11px;
    color: var(--ink-soft);
    font-size: 9px;
    letter-spacing: 0.06em;
  }

  .board-caption strong {
    color: var(--ink);
    font-family: ui-monospace, monospace;
  }

  .touch-hint,
  .orientation-hint,
  .mobile-move-bar {
    display: none;
  }

  .game-sidebar {
    display: grid;
    gap: 13px;
    padding-top: 72px;
  }

  .side-card {
    padding: 20px;
    border: 1px solid var(--line);
    background: rgba(250, 247, 238, 0.62);
  }

  .side-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .side-card-header small,
  .side-card-header strong {
    display: block;
  }

  .side-card-header small {
    color: var(--gold);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.18em;
  }

  .side-card-header strong {
    margin-top: 5px;
    font-family: ui-monospace, monospace;
    font-size: 18px;
    letter-spacing: 0.08em;
  }

  .icon-button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    color: var(--ink);
    background: transparent;
  }

  .room-card > p {
    margin-top: 16px;
    color: var(--ink-soft);
    font-size: 10px;
    line-height: 1.65;
  }

  .rules-card dl {
    margin-top: 13px;
  }

  .rules-card dl > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-top: 1px solid rgba(23, 60, 50, 0.09);
    font-size: 10px;
  }

  .rules-card dt {
    color: var(--ink-soft);
  }

  .rules-card dd {
    font-weight: 700;
  }

  .action-card {
    text-align: center;
  }

  .button.danger {
    color: var(--red);
  }

  .centered-button {
    display: block;
    margin: 10px auto 0;
  }

  .demo-console {
    padding: 17px;
    border: 1px dashed rgba(168, 73, 53, 0.3);
    color: #704335;
    background: rgba(255, 248, 237, 0.48);
  }

  .demo-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 800;
  }

  .demo-console p {
    margin-top: 8px;
    font-size: 9px;
    line-height: 1.6;
  }

  .demo-actions {
    margin-top: 11px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .demo-actions button {
    min-height: 32px;
    padding: 5px;
    border: 1px solid rgba(112, 67, 53, 0.28);
    color: inherit;
    background: transparent;
    font-size: 9px;
  }

  .result-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(18, 38, 31, 0.59);
    backdrop-filter: blur(3px);
  }

  .result-card {
    position: relative;
    width: min(100%, 350px);
    padding: 34px 34px 27px;
    background: var(--paper);
    box-shadow: 0 28px 70px rgba(12, 25, 21, 0.35);
    text-align: center;
  }

  .result-chop {
    width: 47px;
    height: 47px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.26);
    color: white;
    background: var(--red);
    font-family: ui-serif, "Songti SC", serif;
    font-size: 22px;
    transform: rotate(-3deg);
  }

  .result-avatar {
    position: relative;
    width: 88px;
    height: 88px;
    margin: -9px auto 17px;
    display: block;
    border: 3px solid var(--paper);
    border-radius: 50%;
    box-shadow: 0 14px 28px rgba(23, 39, 33, 0.18);
  }

  .result-avatar img {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    object-fit: cover;
    object-position: center 12%;
  }

  .result-avatar .result-chop {
    position: absolute;
    right: -11px;
    bottom: -8px;
    width: 38px;
    height: 38px;
    margin: 0;
    font-size: 17px;
  }

  .result-card h2 {
    margin-top: 10px;
    font-family: ui-serif, "Songti SC", serif;
    font-size: 26px;
    font-weight: 600;
  }

  .result-card > p:not(.card-index) {
    margin: 10px 0 22px;
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.7;
  }

  .modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding:
      max(20px, env(safe-area-inset-top))
      max(20px, env(safe-area-inset-right))
      max(20px, env(safe-area-inset-bottom))
      max(20px, env(safe-area-inset-left));
    background: rgba(10, 28, 23, 0.58);
    backdrop-filter: blur(5px);
  }

  .confirm-dialog {
    width: min(100%, 410px);
    padding: 38px;
    background: var(--paper);
    box-shadow: 0 30px 90px rgba(8, 18, 15, 0.35);
    text-align: center;
  }

  .dialog-stone {
    width: 42px;
    height: 42px;
    display: block;
    margin: 0 auto 18px;
    box-shadow: 0 7px 12px rgba(23, 39, 33, 0.18);
  }

  .confirm-dialog h2 {
    margin-top: 10px;
    font-family: ui-serif, "Songti SC", serif;
    font-size: 28px;
    font-weight: 600;
  }

  .confirm-dialog > p:not(.card-index) {
    margin-top: 12px;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.7;
  }

  .dialog-actions {
    margin-top: 25px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .toast {
    position: fixed;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 40;
    max-width: min(340px, calc(100vw - 40px));
    padding: 12px 18px;
    color: var(--paper);
    background: var(--ink);
    box-shadow: 0 16px 38px rgba(15, 39, 32, 0.25);
    font-size: 12px;
    opacity: 0;
    transform: translateY(12px);
    transition: 180ms ease;
    pointer-events: none;
  }

  .toast.visible {
    opacity: 1;
    transform: translateY(0);
  }

  footer {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 9px;
    letter-spacing: 0.07em;
    padding-bottom: env(safe-area-inset-bottom);
  }

  @keyframes orbit {
    to {
      transform: rotate(360deg);
    }
  }

  @keyframes stone-in {
    from {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.72);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }

  @keyframes candidate-pulse {
    0%,
    100% {
      opacity: 0.64;
      transform: translate(-50%, -50%) scale(0.92);
    }
    50% {
      opacity: 0.84;
      transform: translate(-50%, -50%) scale(1);
    }
  }

  @keyframes reaction-in {
    from {
      opacity: 0;
      transform: translateY(-8px) scale(0.94);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

@layer responsive {
  @media (max-width: 920px) {
    .home-grid,
    .lobby-layout {
      grid-template-columns: 1fr;
    }

    .home-grid {
      gap: 52px;
      padding: 64px 5vw;
    }

    .join-card {
      width: min(100%, 520px);
    }

    .how-it-works {
      grid-template-columns: 1fr;
      gap: 30px;
    }

    .lobby-layout {
      gap: 55px;
      padding: 60px 8vw 75px;
    }

    .invite-panel {
      width: min(100%, 500px);
      margin: auto;
    }

    .game-layout {
      grid-template-columns: minmax(0, 1fr);
    }

    .game-sidebar {
      grid-template-columns: repeat(2, 1fr);
      padding-top: 0;
    }

    .demo-console,
    .action-card {
      min-height: 145px;
    }
  }

  @media (max-width: 640px) {
    .site-shell {
      width: 100%;
      padding-right: max(12px, env(safe-area-inset-right));
      padding-left: max(12px, env(safe-area-inset-left));
    }

    .topbar {
      min-height: 72px;
      grid-template-columns: 1fr auto;
    }

    .topbar > .text-button,
    .brand {
      min-height: 44px;
    }

    .text-button,
    .icon-button,
    .offline-banner button,
    .demo-actions button {
      min-height: 44px;
    }

    .icon-button {
      width: 44px;
      height: 44px;
    }

    .preview-pill {
      display: none;
    }

    .topbar-note {
      display: none;
    }

    .home-grid {
      min-height: auto;
      gap: 42px;
      padding: 52px 0 48px;
    }

    .key-input-wrap input {
      font-size: 18px;
    }

    .hero-copy h1,
    .lobby-stage h1 {
      font-size: clamp(43px, 14vw, 62px);
    }

    .hero-actions {
      display: grid;
    }

    .promise-row {
      display: grid;
      gap: 10px;
    }

    .join-card,
    .invite-panel {
      padding: 32px 24px;
    }

    .seal {
      right: 12px;
      bottom: -21px;
    }

    .how-it-works {
      padding: 38px 0 58px;
    }

    .steps-list {
      grid-template-columns: 1fr;
      gap: 22px;
    }

    .steps-list li + li::before {
      display: none;
    }

    .lobby-layout {
      padding: 50px 0 68px;
    }

    .character-stage {
      min-height: calc(100dvh - 72px);
      padding: 32px 0 38px;
    }

    .character-heading h1 {
      margin-top: 12px;
      font-size: clamp(34px, 10.5vw, 46px);
    }

    .character-heading > p:last-child {
      margin-top: 12px;
      font-size: 11px;
    }

    .character-grid {
      margin-top: 24px;
      gap: 9px;
    }

    .character-card,
    .character-card.selected {
      border-radius: 12px;
      transform: none;
    }

    .character-art {
      height: clamp(165px, 48vw, 210px);
    }

    .character-art::after {
      right: 9px;
      bottom: 9px;
      width: 42px;
      height: 42px;
    }

    .character-art > i {
      top: 8px;
      right: 8px;
      padding: 5px 7px;
      font-size: 7px;
    }

    .character-meta {
      min-height: 108px;
      padding: 12px;
    }

    .character-labels {
      gap: 4px;
    }

    .character-labels i,
    .character-labels em {
      padding: 3px 5px;
      font-size: 7px;
      letter-spacing: 0.04em;
    }

    .character-meta > strong {
      margin-top: 8px;
      font-size: 23px;
    }

    .character-meta > small {
      margin-top: 4px;
      display: -webkit-box;
      overflow: hidden;
      font-size: 9px;
      line-height: 1.45;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
    }

    .character-confirm-bar {
      position: sticky;
      bottom: max(9px, env(safe-area-inset-bottom));
      z-index: 8;
      margin-top: 14px;
      gap: 10px;
      padding: 10px;
      border-radius: 10px;
      background: rgba(247, 243, 232, 0.92);
    }

    .seat-stone {
      width: 30px;
      height: 30px;
    }

    .seat-preview strong {
      font-size: 12px;
    }

    .character-confirm-bar .button {
      min-height: 46px;
      padding-inline: 14px;
      font-size: 11px;
    }

    .game-heading {
      align-items: flex-end;
      min-height: 94px;
      padding: 18px 0 14px;
    }

    .game-heading .eyebrow {
      font-size: 9px;
    }

    .turn-announcer {
      min-width: 0;
      padding: 9px 11px;
    }

    .turn-announcer strong {
      font-size: 12px;
    }

    .offline-banner {
      grid-template-columns: auto 1fr;
    }

    .offline-banner button {
      grid-column: 1 / -1;
    }

    .player-summary {
      min-height: 50px;
      padding: 6px;
    }

    .player-stone {
      width: 27px;
      height: 27px;
    }

    .player-avatar {
      width: 36px;
      height: 36px;
    }

    .player-avatar .player-stone {
      width: 13px;
      height: 13px;
    }

    .player-summary strong em {
      display: block;
      margin: 1px 0 0;
      font-size: 8px;
    }

    .turn-tag {
      display: none;
    }

    .board-frame {
      margin-inline: -6px;
      padding: 9px;
    }

    .board-point {
      min-height: 0;
    }

    .star-point {
      width: 4px;
      height: 4px;
    }

    .board-caption {
      display: grid;
      grid-template-columns: 1fr 1fr;
    }

    .board-caption span:last-child {
      grid-column: 1 / -1;
    }

    .board-caption .touch-hint {
      grid-column: 1 / -1;
      display: block;
      padding: 9px 11px;
      border: 1px solid rgba(23, 60, 50, 0.12);
      color: var(--ink);
      background: rgba(255, 255, 255, 0.34);
      font-size: 10px;
      text-align: center;
    }

    .game-sidebar {
      grid-template-columns: 1fr;
    }

    .demo-console,
    .action-card {
      min-height: 0;
    }

    .result-card {
      padding: 27px 22px 22px;
    }

    .confirm-dialog {
      padding: 30px 22px;
    }

    .dialog-actions {
      grid-template-columns: 1fr;
    }

    .dialog-actions .button {
      min-height: 48px;
    }

    .mobile-move-bar {
      position: fixed;
      right: max(10px, env(safe-area-inset-right));
      bottom: max(10px, env(safe-area-inset-bottom));
      left: max(10px, env(safe-area-inset-left));
      z-index: 30;
      min-height: 74px;
      display: grid;
      grid-template-columns: auto 1fr auto auto;
      align-items: center;
      gap: 10px;
      padding: 11px;
      border: 1px solid rgba(221, 183, 121, 0.24);
      color: var(--paper);
      background: rgba(16, 45, 39, 0.96);
      box-shadow: 0 20px 55px rgba(8, 26, 21, 0.32);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
    }

    .move-avatar {
      position: relative;
      width: 42px;
      height: 42px;
      border-radius: 50%;
    }

    .move-avatar img {
      width: 100%;
      height: 100%;
      overflow: hidden;
      border-radius: inherit;
      object-fit: cover;
      object-position: center 12%;
    }

    .move-preview {
      position: absolute;
      right: -2px;
      bottom: -2px;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      border: 1px solid rgba(255, 255, 255, 0.72);
      box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
    }

    .move-copy small,
    .move-copy strong {
      display: block;
    }

    .move-copy small {
      color: rgba(247, 243, 232, 0.64);
      font-size: 8px;
      letter-spacing: 0.08em;
    }

    .move-copy strong {
      margin-top: 4px;
      font-family: ui-serif, "Songti SC", serif;
      font-size: 14px;
    }

    .move-cancel,
    .move-confirm {
      min-width: 48px;
      min-height: 46px;
      padding: 0 11px;
      border: 0;
      font-size: 11px;
      font-weight: 700;
    }

    .move-cancel {
      color: rgba(247, 243, 232, 0.72);
      background: transparent;
    }

    .move-confirm {
      color: var(--ink);
      background: var(--gold-bright);
    }

    .toast {
      right: max(12px, env(safe-area-inset-right));
      bottom: max(12px, env(safe-area-inset-bottom));
      left: max(12px, env(safe-area-inset-left));
      max-width: none;
      text-align: center;
    }

    footer {
      align-items: flex-start;
      flex-direction: column;
      justify-content: center;
      gap: 5px;
    }
  }

  @media (orientation: landscape) and (max-height: 500px) and (max-width: 920px) {
    .topbar {
      min-height: 58px;
    }

    .brand-mark {
      width: 32px;
      height: 32px;
    }

    .game-heading {
      min-height: 76px;
      padding-block: 10px;
    }

    .orientation-hint {
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 12px;
      border: 1px solid rgba(195, 154, 94, 0.38);
      background: rgba(255, 250, 239, 0.76);
    }

    .orientation-hint > span {
      color: var(--gold);
      font-size: 22px;
    }

    .orientation-hint strong,
    .orientation-hint small {
      display: block;
    }

    .orientation-hint strong {
      font-size: 11px;
    }

    .orientation-hint small {
      margin-top: 2px;
      color: var(--ink-soft);
      font-size: 9px;
    }

    footer {
      display: none;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
    }
  }
}
