/* ============================================================
   AI 棋室 · 样式
   ============================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, system-ui, sans-serif;
  background: linear-gradient(180deg, #eaf4f9 0%, #f0f7fa 45%, #f4faf7 100%);
  color: #1e3346;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============================================================
   顶部栏
   ============================================================ */
.chead {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(20px) saturate(1.7);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
  border-bottom: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 2px 18px rgba(70,130,180,.08);
}

.cback {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(79,179,232,.22);
  color: #4a6278;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .28s cubic-bezier(.23,1,.32,1);
  white-space: nowrap;
  flex-shrink: 0;
}

.cback:hover {
  background: #fff;
  color: #3a9bd4;
  border-color: #4fb3e8;
  transform: translateX(-3px);
}

.ctitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: #1e3346;
  min-width: 0;
}

.cico { font-size: 19px; }

.chead-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cbadge {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(74,232,160,.14);
  color: #1a9e63;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.cbadge.off {
  background: rgba(255,107,107,.14);
  color: #e05c5c;
}

.cbtn-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(79,179,232,.22);
  background: rgba(255,255,255,.75);
  color: #4a6278;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all .25s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.cbtn-icon:hover {
  background: #fff;
  color: #3a9bd4;
  border-color: #4fb3e8;
  transform: scale(1.06);
}

/* ============================================================
   大厅
   ============================================================ */
.lobby {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 18px 70px;
}

.lobby-hero {
  text-align: center;
  margin-bottom: 34px;
}

.lobby-hero h1 {
  font-size: clamp(23px, 5.5vw, 34px);
  font-weight: 900;
  letter-spacing: -.03em;
  margin: 0 0 10px;
  background: linear-gradient(135deg, #4fb3e8, #4ae8a0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lobby-hero p {
  margin: 0;
  font-size: 14px;
  color: #8aa0b5;
}

.game-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}

.game-card {
  position: relative;
  padding: 24px 16px;
  border-radius: 22px;
  background: rgba(255,255,255,.66);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 8px 30px rgba(70,130,180,.1);
  cursor: pointer;
  transition: all .38s cubic-bezier(.23,1,.32,1);
  text-align: center;
  overflow: hidden;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(79,179,232,.13), transparent 68%);
  opacity: 0;
  transition: opacity .38s;
  pointer-events: none;
}

.game-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 20px 50px rgba(70,130,180,.2);
  border-color: #fff;
}

.game-card:hover::before { opacity: 1; }

.game-card:active { transform: translateY(-2px) scale(.985); }

.gc-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(79,179,232,.3));
}

.gc-name {
  font-size: 17px;
  font-weight: 800;
  color: #1e3346;
  margin-bottom: 4px;
}

.gc-desc {
  font-size: 12px;
  color: #8aa0b5;
  margin-bottom: 12px;
}

.gc-tags {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
}

.gc-tags span {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(79,179,232,.12);
  color: #3a9bd4;
  font-size: 10.5px;
  font-weight: 700;
}

.lobby-row {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.lbtn {
  flex: 1;
  min-width: 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 24px;
  border-radius: 16px;
  border: 1px solid rgba(79,179,232,.25);
  background: rgba(255,255,255,.8);
  color: #4a6278;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .32s cubic-bezier(.23,1,.32,1);
}

.lbtn:hover {
  background: #fff;
  color: #3a9bd4;
  border-color: #4fb3e8;
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(79,179,232,.18);
}

.lbtn:active { transform: scale(.98); }

.lbtn-primary {
  background: linear-gradient(135deg, #4fb3e8, #4ae8a0);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 26px rgba(79,179,232,.32);
}

.lbtn-primary:hover {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 38px rgba(79,179,232,.42);
  filter: brightness(1.05);
}

.lobby-note {
  text-align: center;
  font-size: 12.5px;
  color: #8aa0b5;
  padding: 14px;
  border-radius: 14px;
  background: rgba(79,179,232,.06);
  border: 1px solid rgba(79,179,232,.14);
}

/* ============================================================
   弹窗
   ============================================================ */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15,28,42,.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-mask.show {
  display: flex;
  animation: maskIn .28s ease;
}

@keyframes maskIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: #fff;
  border-radius: 24px;
  padding: 26px 22px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 70px rgba(20,50,80,.3);
  animation: boxIn .34s cubic-bezier(.34,1.4,.64,1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes boxIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #1e3346;
  margin-bottom: 6px;
  text-align: center;
}

.modal-sub {
  text-align: center;
  font-size: 13px;
  color: #8aa0b5;
  margin: 0 0 18px;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(79,179,232,.25);
  background: rgba(240,247,250,.7);
  color: #1e3346;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all .25s;
  margin-bottom: 12px;
}

.modal-input:focus {
  border-color: #4fb3e8;
  box-shadow: 0 0 0 4px rgba(79,179,232,.13);
  background: #fff;
}

.modal-confirm {
  width: 100%;
  margin-top: 6px;
  flex: none;
  min-width: 0;
}

.modal-cancel {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: none;
  background: rgba(138,160,181,.12);
  color: #8aa0b5;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .25s;
}

.modal-cancel:hover {
  background: rgba(138,160,181,.2);
  color: #4a6278;
}

/* 模式选择列表 */
.mode-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 6px;
}

.mode-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  border-radius: 16px;
  border: 1px solid rgba(79,179,232,.2);
  background: rgba(240,247,250,.5);
  cursor: pointer;
  transition: all .3s cubic-bezier(.23,1,.32,1);
  text-align: left;
  font-family: inherit;
  width: 100%;
}

.mode-item:hover {
  background: rgba(79,179,232,.1);
  border-color: #4fb3e8;
  transform: translateX(4px);
}

.mode-item:active { transform: scale(.985); }

.mi-icon {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
}

.mi-text { flex: 1; min-width: 0; }

.mi-name {
  font-size: 15px;
  font-weight: 700;
  color: #1e3346;
  margin-bottom: 2px;
}

.mi-desc {
  font-size: 12px;
  color: #8aa0b5;
}

/* 口令输入 */
.code-input-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.code-input {
  width: 100%;
  max-width: 240px;
  padding: 16px;
  border-radius: 18px;
  border: 2px solid rgba(79,179,232,.28);
  background: rgba(240,247,250,.7);
  color: #1e3346;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: .35em;
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  outline: none;
  transition: all .28s;
  text-indent: .35em;
}

.code-input:focus {
  border-color: #4fb3e8;
  box-shadow: 0 0 0 5px rgba(79,179,232,.15);
  background: #fff;
}

/* 结果弹窗 */
.result-box { text-align: center; }

.result-icon {
  font-size: 58px;
  margin-bottom: 12px;
  animation: resultPop .5s cubic-bezier(.34,1.56,.64,1);
}

@keyframes resultPop {
  0% { transform: scale(0) rotate(-30deg); }
  70% { transform: scale(1.15) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}

.result-title {
  font-size: 24px;
  font-weight: 900;
  color: #1e3346;
  margin-bottom: 6px;
}

.result-sub {
  font-size: 13.5px;
  color: #8aa0b5;
  margin-bottom: 20px;
}

/* 帮助 */
.help-box { max-width: 480px; }

.help-body {
  font-size: 13.5px;
  color: #4a6278;
  line-height: 1.85;
  margin: 16px 0 6px;
}

.help-body h4 {
  font-size: 14px;
  font-weight: 800;
  color: #1e3346;
  margin: 16px 0 7px;
}

.help-body h4:first-child { margin-top: 0; }

.help-body ul {
  margin: 0;
  padding-left: 20px;
}

.help-body li { margin-bottom: 5px; }

.help-body p { margin: 0 0 8px; }

.help-body b { color: #3a9bd4; }

/* ============================================================
   对局界面
   ============================================================ */
.game {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 14px 40px;
}

.game-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 14px;
  flex-wrap: wrap;
}

/* 创建房间：内联棋种选择 */
.pick-game {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(79,179,232,.08);
  border: 1px dashed rgba(79,179,232,.4);
}

.pick-title {
  font-size: 13px;
  font-weight: 700;
  color: #2874a6;
  margin-bottom: 10px;
}

.pick-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pick-btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(79,179,232,.35);
  background: #fff;
  color: #1e3346;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}

.pick-btn:hover,
.pick-btn:active {
  background: rgba(79,179,232,.16);
  border-color: #4fb3e8;
}

.pick-cancel {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #8aa0b5;
  font-size: 14px;
  cursor: pointer;
}

/* 当前棋种 · 模式 标签栏 */
.game-modebar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 8px;
}

.gm-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: #2874a6;
  background: rgba(79,179,232,.13);
  border: 1px solid rgba(79,179,232,.28);
}

.gm-tag.gm-mode {
  color: #1a9e63;
  background: rgba(74,232,160,.14);
  border-color: rgba(74,232,160,.32);
}

.gbar-btn {
  padding: 8px 15px;
  border-radius: 12px;
  border: 1px solid rgba(79,179,232,.22);
  background: rgba(255,255,255,.78);
  color: #4a6278;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .25s;
  white-space: nowrap;
}

.gbar-btn:hover {
  background: #fff;
  color: #3a9bd4;
  border-color: #4fb3e8;
}

.gbar-btn:active { transform: scale(.96); }

.gbar-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.gbar-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.turn-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(79,179,232,.22);
  font-size: 13.5px;
  font-weight: 700;
  color: #1e3346;
  box-shadow: 0 3px 14px rgba(70,130,180,.08);
  transition: all .3s;
}

.turn-indicator.my-turn {
  border-color: #4fb3e8;
  box-shadow: 0 0 0 4px rgba(79,179,232,.15), 0 3px 14px rgba(70,130,180,.1);
  animation: turnPulse 2s infinite;
}

@keyframes turnPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(79,179,232,.12), 0 3px 14px rgba(70,130,180,.1); }
  50% { box-shadow: 0 0 0 7px rgba(79,179,232,.2), 0 3px 14px rgba(70,130,180,.12); }
}

.turn-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 2px 7px rgba(0,0,0,.28);
  flex-shrink: 0;
  transition: background .3s;
}

.turn-dot.white { background: #fff; border-color: #c5d3de; }
.turn-dot.red   { background: #e23b3b; }
.turn-dot.black { background: #1a1a1a; }

/* 房间信息条 */
.room-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(79,179,232,.12), rgba(74,232,160,.09));
  border: 1px solid rgba(79,179,232,.24);
  margin-bottom: 14px;
  flex-wrap: wrap;
  font-size: 13px;
}

.ri-code {
  color: #4a6278;
  font-weight: 600;
}

.ri-code b {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 18px;
  letter-spacing: .12em;
  color: #3a9bd4;
  margin-left: 5px;
}

.ri-copy {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(79,179,232,.3);
  background: rgba(255,255,255,.8);
  color: #3a9bd4;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .22s;
}

.ri-copy:hover { background: #fff; border-color: #4fb3e8; }
.ri-copy.copied { background: rgba(74,232,160,.16); color: #1a9e63; border-color: #4ae8a0; }

.ri-players {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #4a6278;
  flex-wrap: wrap;
}

.player-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(79,179,232,.2);
  font-weight: 600;
  white-space: nowrap;
}

.player-tag .pd {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   棋盘
   ============================================================ */
.board-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  padding: 8px;
}

.board-inner {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 46px rgba(70,130,180,.22),
              0 3px 12px rgba(70,130,180,.12);
  background: #f7ead2;
  touch-action: none;
  transition: box-shadow .3s;
}

.board-inner.thinking {
  box-shadow: 0 14px 46px rgba(79,179,232,.4),
              0 0 0 3px rgba(79,179,232,.3);
}

#boardCanvas {
  display: block;
  cursor: pointer;
  touch-action: none;
}

.game-status {
  text-align: center;
  font-size: 13.5px;
  color: #4a6278;
  min-height: 24px;
  margin-bottom: 12px;
  font-weight: 600;
  transition: color .3s;
}

.game-status.warn { color: #e0a03c; }
.game-status.err  { color: #e05c5c; }

.game-actions {
  display: flex;
  gap: 9px;
  justify-content: center;
  flex-wrap: wrap;
}

.gbtn {
  padding: 11px 20px;
  border-radius: 14px;
  border: 1px solid rgba(79,179,232,.22);
  background: rgba(255,255,255,.82);
  color: #4a6278;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .28s cubic-bezier(.23,1,.32,1);
  white-space: nowrap;
}

.gbtn:hover {
  background: #fff;
  color: #3a9bd4;
  border-color: #4fb3e8;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(79,179,232,.16);
}

.gbtn:active { transform: scale(.97); }

.gbtn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}

.gbtn-ai {
  background: linear-gradient(135deg, #4fb3e8, #4ae8a0);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(79,179,232,.3);
}

.gbtn-ai:hover {
  color: #fff;
  border-color: transparent;
  filter: brightness(1.05);
}

/* AI 控制条 */
.ai-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  padding: 13px;
  border-radius: 16px;
  background: rgba(79,179,232,.07);
  border: 1px solid rgba(79,179,232,.18);
  flex-wrap: wrap;
}

.ai-auto {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #4a6278;
  cursor: pointer;
  user-select: none;
}

.ai-auto input {
  width: 17px;
  height: 17px;
  accent-color: #4fb3e8;
  cursor: pointer;
}

/* ============================================================
   AI 指导面板
   ============================================================ */
.hint-panel {
  margin-top: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(79,179,232,.24);
  box-shadow: 0 8px 30px rgba(70,130,180,.12);
  overflow: hidden;
  animation: hintIn .32s cubic-bezier(.23,1,.32,1);
}

@keyframes hintIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

.hint-head {
  display: flex;
  align-items: center;
  padding: 12px 17px;
  background: linear-gradient(135deg, rgba(79,179,232,.13), rgba(74,232,160,.1));
  border-bottom: 1px solid rgba(79,179,232,.18);
  font-size: 13.5px;
  font-weight: 800;
  color: #3a9bd4;
}

.hint-close {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.7);
  color: #8aa0b5;
  font-size: 13px;
  cursor: pointer;
  transition: all .22s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.hint-close:hover { background: #fff; color: #e05c5c; }

.hint-body {
  padding: 15px 17px;
  font-size: 13.5px;
  line-height: 1.85;
  color: #4a6278;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
}

/* ============================================================
   加载遮罩
   ============================================================ */
.loading-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(240,247,250,.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-box {
  text-align: center;
  padding: 26px 34px;
  border-radius: 20px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 18px 50px rgba(70,130,180,.2);
}

.spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 14px;
  border: 3.5px solid rgba(79,179,232,.18);
  border-top-color: #4fb3e8;
  border-radius: 50%;
  animation: spin .85s linear infinite;
}

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

.loading-text {
  font-size: 13.5px;
  font-weight: 700;
  color: #4a6278;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 640px) {
  .chead { padding: 10px 13px; gap: 9px; }
  .cback { padding: 6px 12px; font-size: 12px; }
  .ctitle { font-size: 14.5px; }
  .cico { font-size: 17px; }
  .cbadge { padding: 3px 9px; font-size: 10.5px; }

  .lobby { padding: 26px 13px 54px; }
  .lobby-hero { margin-bottom: 24px; }

  .game-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .game-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    text-align: left;
  }

  .gc-icon { font-size: 32px; margin: 0; }
  .gc-name { font-size: 15.5px; }
  .gc-desc { margin-bottom: 0; }

  .game-card .gc-tags { display: none; }

  .lobby-row { gap: 10px; }
  .lbtn { min-width: 0; padding: 14px 18px; font-size: 14px; }

  .game { padding: 10px 10px 34px; }

  .game-bar {
    gap: 7px;
    padding: 8px 0 11px;
  }

  .gbar-btn { padding: 7px 12px; font-size: 12px; }

  .turn-indicator {
    order: -1;
    width: 100%;
    justify-content: center;
    padding: 9px 14px;
    font-size: 13px;
  }

  .gbar-right { margin-left: 0; width: 100%; }
  .gbar-right .gbar-btn { flex: 1; }

  .board-wrap { padding: 4px; }

  .gbtn { padding: 10px 15px; font-size: 12.5px; }

  .game-actions { gap: 7px; }

  .modal-box { padding: 22px 17px; border-radius: 20px; }
  .modal-title { font-size: 16.5px; }

  .code-input {
    font-size: 32px;
    padding: 14px;
    max-width: 210px;
  }

  .hint-body { font-size: 13px; padding: 13px 14px; }
}

@media (max-width: 380px) {
  .gbtn { padding: 9px 12px; font-size: 12px; }
  .gbar-btn { padding: 6px 10px; font-size: 11.5px; }
}

/* 横屏时棋盘不该太大 */
@media (orientation: landscape) and (max-height: 560px) {
  .board-wrap { max-width: 68vh; margin-left: auto; margin-right: auto; }
}

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