/* 五子棋（ADR-0174）：木头棋盘、黑白棋子、两边的人。网站和原型 web/ 里是同一份 */
.gm-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  margin: 4px 0 8px;
  font-size: 15px;
}

.gm-head span { color: var(--muted); font-size: 13px; }

.gm-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  transition: box-shadow 150ms ease, border-color 150ms ease;
}

.gm-player.turn {
  border-color: #e0a640;
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.gm-face {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
}

.gm-face .avatar { width: 44px; height: 44px; }

.gm-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--paper), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.gm-dot.black { background: radial-gradient(circle at 35% 30%, #6b6660, #141210 70%); }
.gm-dot.white { background: radial-gradient(circle at 35% 30%, #fff, #d6cfc2 75%); }

.gm-cpu {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.gm-name {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.gm-name b {
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.gm-color {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.gm-color.black { background: var(--ink); color: #fff; }
.gm-color.white { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px #d9d1c3; }

.gm-side {
  display: grid;
  flex: none;
  justify-items: end;
  gap: 2px;
  font-size: 13px;
}

.gm-wins { color: var(--muted); }
.gm-clock { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.gm-clock.hurry { color: var(--red); }

/* 下棋的桌面：暖灯照着的一张矮桌，棋盘放在中间 */
.gm-wrap {
  position: relative;
  margin: 12px -4px;
  padding: 16px 14px 24px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 80% 70% at 50% 35%, rgba(255, 244, 222, 0.9), rgba(255, 244, 222, 0) 70%),
    linear-gradient(#e9cfa6, #d9b583);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 22px rgba(90, 55, 20, 0.18);
}

/* 木头棋盘：厚厚的一块，边上看得到木头的侧面 */
.gm-goban {
  position: relative;
  padding: 3.4%;
  border-radius: 8px;
  background: #e2b26b center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 210, 0.55), inset 0 -2px 3px rgba(120, 70, 20, 0.25),
    0 3px 0 #c38c47, 0 7px 0 #a26d33, 0 11px 0 #7f5124, 0 14px 3px rgba(60, 30, 10, 0.5), 0 24px 30px rgba(60, 30, 10, 0.35);
}

.gm-board {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  overflow: visible;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.gm-wrap.can .gm-board { cursor: pointer; }

.gm-lines line { stroke: rgba(48, 28, 10, 0.78); stroke-width: 0.75; }
.gm-lines .gm-edge { fill: none; stroke: rgba(48, 28, 10, 0.85); stroke-width: 1.4; }
.gm-star { fill: #2f1e0e; }

/* 棋子：底下一圈软影子，黑子有一点光，白子像贝壳 */
.gm-shade { fill: rgba(50, 26, 6, 0.32); }
.gm-stone.w .gm-top > circle { stroke: rgba(120, 104, 80, 0.35); stroke-width: 0.4; }
.gm-gloss { fill: rgba(255, 255, 255, 0.34); }
.gm-shell path { fill: none; stroke: rgba(150, 136, 110, 0.18); stroke-width: 0.5; }
.gm-mark { fill: #e0543f; }
.gm-aim { stroke: rgba(178, 69, 47, 0.45); stroke-width: 1; stroke-dasharray: 3 3; }
.gm-stone.ghost { opacity: 0.5; }
.gm-ghost { fill: none; stroke: #e0543f; stroke-width: 1.3; stroke-dasharray: 3 2; }
.gm-winline { stroke: #f2b33d; stroke-width: 3.4; stroke-linecap: round; opacity: 0.95; filter: drop-shadow(0 0 3px rgba(255, 200, 80, 0.9)); }
.gm-ring { fill: none; stroke: #f2b33d; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: gm-ring 1.1s ease-in-out infinite; }

@keyframes gm-ring {
  50% { transform: scale(1.18); opacity: 0.6; }
}

/* 落子：从上面「嗒」地落下来，影子从远变近 */
.gm-stone.drop .gm-top { animation: gm-drop 260ms cubic-bezier(.3, .0, .4, 1.4) both; }
.gm-stone.drop .gm-shade { animation: gm-shadow 260ms ease-out both; }

@keyframes gm-drop {
  from { transform: translate(-3px, -7px) scale(1.25); }
  to { transform: none; }
}

@keyframes gm-shadow {
  from { transform: translate(3px, 4px) scale(1.25); opacity: 0.2; }
  to { transform: none; opacity: 1; }
}

/* 两边的人：形象、名字、木头棋罐 */
.gm-who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.gm-who b { min-width: 0; }
.gm-face .gx-face, .gm-face .ofit { width: 44px; height: 44px; }

.gm-bowl {
  position: relative;
  flex: none;
  width: 38px;
  height: 30px;
  border-radius: 50% 50% 46% 46% / 40% 40% 60% 60%;
  background: linear-gradient(#b27a43, #7f5124);
  box-shadow: inset 0 3px 0 rgba(255, 220, 170, 0.35), 0 2px 3px rgba(60, 30, 10, 0.35);
}

.gm-bowl::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 3px;
  height: 11px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 45%, var(--s1) 0 3.5px, transparent 4px),
    radial-gradient(circle at 55% 35%, var(--s2) 0 3.5px, transparent 4px),
    radial-gradient(circle at 76% 55%, var(--s1) 0 3.5px, transparent 4px),
    #5a3818;
}

.gm-bowl.black { --s1: #2b2a29; --s2: #4a4846; }
.gm-bowl.white { --s1: #f6f2ea; --s2: #ddd5c6; }

@media (prefers-reduced-motion: reduce) {
  .gm-stone.drop .gm-top, .gm-stone.drop .gm-shade, .gm-ring { animation: none; }
  .gm-player { transition: none; }
}

.gm-status {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.gm-status.done { font-size: 18px; font-weight: 600; }

.gm-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.gbar .act-btns.two { grid-template-columns: 1fr 1.4fr; }
.gbar .act-btns.two .bar-status { align-self: center; text-align: left; }
.gbar > .btn.wide { min-height: 48px; }

/* 开一盘：电脑几档 */
.gm-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gm-level {
  display: grid;
  gap: 2px;
  justify-items: center;
  min-height: 72px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  font-size: 13px;
  cursor: pointer;
}

.gm-level b { font-size: 17px; }
.gm-level span { color: var(--muted); font-size: 12px; line-height: 1.4; text-align: center; }
.gm-level[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.gm-who button { flex: 1; }

/* 大厅里的五子棋卡片 */
.gm-icon {
  position: relative;
  background:
    repeating-linear-gradient(90deg, rgba(60, 38, 18, 0.55) 0 1px, transparent 1px 11px),
    repeating-linear-gradient(0deg, rgba(60, 38, 18, 0.55) 0 1px, transparent 1px 11px),
    #ddb06a;
  background-position: 5px 5px;
}

.gm-icon i {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.gm-icon i.b { left: 8px; top: 8px; background: radial-gradient(circle at 35% 30%, #6b6660, #141210 70%); }
.gm-icon i.w { right: 8px; bottom: 8px; background: radial-gradient(circle at 35% 30%, #fff, #d6cfc2 75%); }

.gc-more {
  flex: none;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.gc-actions {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.gc-actions .btn { flex: 1; }

/* 满屏大棋盘（2026-11-06 老板定）：进了一盘棋，整页是暖灯下的木桌，棋盘边到边铺满；
   竖着放不下时按高度放到最大（留出上面一行、两边的人、下面的按钮），宽屏最大 860 像素。
   木桌是浅色的，深色模式下这一页也用深色字 */
body.gm-full {
  --ink: #1a1814;
  --muted: #6b5a45;
  --paper: rgba(255, 250, 240, 0.82);
  --line: rgba(90, 60, 30, 0.22);
  background:
    radial-gradient(ellipse 90% 55% at 50% 42%, rgba(255, 244, 222, 0.95), rgba(255, 244, 222, 0) 72%),
    linear-gradient(#e9cfa6, #d2a974);
  background-attachment: fixed;
  color: var(--ink);
}

body.gm-full main {
  width: 100%;
  max-width: none;
  padding-top: calc(4px + env(safe-area-inset-top));
  padding-right: 0;
  padding-left: 0;
}

body.gm-full #view-gomoku {
  --gm-size: max(280px, min(100vw, calc(100dvh - 400px), 860px));
  align-items: center;
  /* 剩下的高度让两边的人和棋盘在中间，不全堆在上面（下面留出操作条） */
  min-height: calc(100dvh - 150px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

body.gm-full #view-gomoku > .top,
body.gm-full #view-gomoku > .gm-head {
  width: min(calc(100% - 24px), var(--gm-size));
}

body.gm-full #view-gomoku > .gm-head { margin: 0 0 6px; }

body.gm-full #gm-root {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

body.gm-full #gm-root .gm-player,
body.gm-full #gm-root .gm-status,
body.gm-full #gm-root .gm-note {
  width: min(calc(100% - 16px), var(--gm-size));
}

body.gm-full #gm-root .gm-player {
  min-height: 52px;
  padding: 6px 10px;
  box-shadow: 0 2px 6px rgba(90, 55, 20, 0.12);
}

body.gm-full #gm-root .gm-player.turn {
  border-color: #e0a640;
  box-shadow: 0 0 0 3px var(--gold-soft);
}

body.gm-full .gm-wrap {
  width: var(--gm-size);
  margin: 8px 0;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

body.gm-full .gm-goban {
  padding: 2.4%;
  border-radius: 6px;
}

body.gm-full .gm-status { margin-top: 8px; }
