/* 迷宫 Maze · 独立样式（选择器统一前缀 .g-maze） */

.g-maze {
  justify-content: flex-start;
}

/* ---------------- 顶部 ---------------- */

.g-maze .maze-head {
  align-items: center;
  min-height: 44px;
}

.g-maze .maze-head .grow { width: 100%; }
.g-maze .maze-head .seg { width: 100%; padding: 4px; }
.g-maze .maze-head .seg-item { min-height: 38px; font-size: 12px; }

/* ---------------- 数据 ---------------- */

.g-maze .stats { gap: 8px; }
.g-maze .stat { padding: 8px 6px; }
.g-maze .stat-v { font-size: 16.5px; }
.g-maze .stat-v.ok { color: #ffd166; }

/* ---------------- 棋盘 ---------------- */

.g-maze .maze-boardwrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.g-maze .maze-board {
  position: relative;
  width: min(100%, clamp(236px, calc(100dvh - 358px), 460px));
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(95, 224, 200, 0.09), transparent 58%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 22px 54px -32px rgba(0, 0, 0, 0.95);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.g-maze .maze-board canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------------- 操作行 ---------------- */

.g-maze .maze-toolbar .btn { min-height: 44px; }
.g-maze .btn:focus { outline: none; }
.g-maze .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.g-maze .maze-toolbar .btn.on {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* ---------------- 底部信息 ---------------- */

.g-maze .maze-meta { padding: 9px 12px 10px; }
.g-maze .maze-meta-head { align-items: baseline; gap: 8px; }
.g-maze .maze-meta-head .hint:first-child { color: var(--dim); font-variant-numeric: tabular-nums; }
.g-maze .maze-meta-head .hint:last-child { flex: none; color: var(--dim); font-variant-numeric: tabular-nums; }
.g-maze .maze-tip {
  margin-top: 6px;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--faint);
}

/* ---------------- 结算覆盖层 ---------------- */

.g-maze .maze-over {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 11, 18, 0.85);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s;
}

.g-maze .maze-over.show { opacity: 1; visibility: visible; }

.g-maze .maze-over-card {
  width: 100%;
  max-width: 254px;
  text-align: center;
}

.g-maze .maze-over-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.g-maze .maze-over-sub {
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--dim);
}

.g-maze .maze-over-stats {
  display: flex;
  gap: 8px;
  margin: 13px 0;
}

.g-maze .maze-ostat {
  flex: 1;
  min-width: 0;
  padding: 7px 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.g-maze .maze-ostat span {
  display: block;
  font-size: 10px;
  color: var(--faint);
  margin-bottom: 2px;
}

.g-maze .maze-ostat b {
  display: block;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-maze .maze-over .btn { min-height: 44px; }
.g-maze .maze-over-row2 { margin-top: 8px; }
.g-maze .maze-over-row2 .btn { min-height: 38px; font-size: 12.5px; }

/* ---------------- 窄屏 / 动效偏好 ---------------- */

@media (max-width: 359px) {
  .g-maze .maze-head .seg-item { font-size: 11px; }
  .g-maze .stat-v { font-size: 15.5px; }
  .g-maze .maze-tip { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .g-maze .maze-over { transition: none; }
}
