/* 连连看 · 专属样式（选择器统一 .g-onet 前缀） */

/* ---------------- 视图容器 ---------------- */
.g-onet .on-setup-view,
.g-onet .on-play,
.g-onet .on-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.g-onet .on-play { flex: 1; }
.g-onet .on-result { flex: 1; }

/* ---------------- 设置 ---------------- */
.g-onet .on-setup-view .panel { padding: 12px 13px; }
.g-onet .on-rules { padding: 12px 13px; }
.g-onet .on-rule-line {
  font-size: 12px;
  line-height: 1.8;
  color: var(--dim);
}
.g-onet .on-rule-line b { color: var(--text); font-weight: 600; }
.g-onet .on-setup-view .stats { margin-top: 10px; }
.g-onet .on-setup-view .stat { background: rgba(255, 255, 255, 0.028); }
.g-onet .on-setup-view .stat-v { font-size: 16px; }

/* ---------------- HUD ---------------- */
.g-onet .on-hud {
  display: flex;
  gap: 8px;
  flex: none;
}
.g-onet .on-hud-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 6px 7px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.g-onet .on-hud-k {
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--faint);
}
.g-onet .on-hud-item .num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.g-onet .on-combo { color: var(--dim); transition: color 0.15s, transform 0.15s; }
.g-onet .on-combo.hot {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(242, 209, 107, 0.55);
}

/* ---------------- 棋盘 ---------------- */
.g-onet .on-board-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-onet .on-board-wrap::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(242, 209, 107, 0.09), transparent 60%),
    rgba(255, 255, 255, 0.022);
  pointer-events: none;
}
.g-onet .on-board {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--gap, 4px);
}
.g-onet .on-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 6px -3px rgba(0, 0, 0, 0.5);
  font-size: calc(var(--tile, 44px) * 0.54);
  line-height: 1;
  color: var(--text);
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease,
    box-shadow 0.16s ease, opacity 0.18s ease;
  overflow: hidden;
}
.g-onet .on-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.09), transparent 58%);
  pointer-events: none;
}
.g-onet .on-sym {
  position: relative;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.38));
  pointer-events: none;
}
.g-onet .on-cell:active { transform: scale(0.95); }
.g-onet .on-cell.sel {
  background: linear-gradient(150deg, var(--accent), var(--accent2));
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 2px var(--accent), 0 10px 24px -10px var(--accent);
  transform: scale(1.04);
}
.g-onet .on-cell.hint { animation: onHint 0.7s ease-in-out 2; }
.g-onet .on-cell.flip { animation: onFlip 0.24s ease; }
.g-onet .on-cell.gone {
  transform: scale(0.24) rotate(9deg);
  opacity: 0;
}
.g-onet .on-cell.empty {
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.055);
  box-shadow: none;
  pointer-events: none;
}

@keyframes onHint {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(242, 209, 107, 0.6); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 3px rgba(242, 209, 107, 0.85), 0 0 22px rgba(242, 209, 107, 0.45); }
}
@keyframes onFlip {
  0% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(85deg) scale(0.92); }
  100% { transform: rotateY(0deg) scale(1); }
}

/* ---------------- 连线（SVG） ---------------- */
.g-onet .on-lines {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}
.g-onet .on-line-path {
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px var(--accent));
  stroke-dasharray: 640;
  stroke-dashoffset: 640;
  animation: onLineDraw 0.18s linear forwards, onLineFade 0.2s ease 0.27s forwards;
}
@keyframes onLineDraw { to { stroke-dashoffset: 0; } }
@keyframes onLineFade { to { opacity: 0; } }

/* ---------------- 工具按钮 ---------------- */
.g-onet .on-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex: none;
}
.g-onet .on-tools .btn { min-height: 44px; }

/* ---------------- 结算 ---------------- */
.g-onet .on-res-head { text-align: center; padding: 2px 0 0; }
.g-onet .on-res-big {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--accent), #ffe9a8 55%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.g-onet .on-res-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--faint);
}
.g-onet .on-res-best {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--dim);
  text-align: center;
}
.g-onet .on-res-best .badge { font-size: 10.5px; }

/* ---------------- 小屏 ---------------- */
@media (max-width: 359px) {
  .g-onet .on-tools .btn { min-height: 42px; font-size: 12px; }
  .g-onet .on-hud-item .num { font-size: 15px; }
}
