﻿/* ============================================================
 * 第二批游戏的样式。全部以 g2- / pn- / rf- / ot- / bj- / wk- 前缀，
 * 不与现有 games.css 的类名冲突。
 * ============================================================ */

.num { font-variant-numeric: tabular-nums; }

/* ---------------- 通用顶栏 ---------------- */
.g2-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 12px;
}
.g2-p {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: #7d8aa3;
}
.g2-p i {
  width: 9px; height: 9px; border-radius: 50%;
  background: #3ea6ff; box-shadow: 0 0 10px rgba(62,166,255,.7);
}
.g2-p.p2 i { background: #ff5c7c; box-shadow: 0 0 10px rgba(255,92,124,.7); }
.g2-p b { font-size: 17px; color: #e8edf7; }
.g2-range {
  font-size: 12px; color: #7d8aa3; letter-spacing: .6px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07);
}

/* ---------------- 1 数字炸弹 ---------------- */
.g2-stage {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center;
}
.g2-boom { font-size: 42px; filter: drop-shadow(0 6px 18px rgba(255,92,124,.35)); }
.g2-turn { font-size: 19px; font-weight: 700; color: #e8edf7; }
.g2-turn.p1 { color: #7cc4ff; }
.g2-turn.p2 { color: #ff9bb0; }
.g2-turn.boom { color: #ffb020; }
.g2-hint { font-size: 12.5px; color: #7d8aa3; min-height: 18px; }

.g2-pick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.g2-chip {
  min-width: 62px; padding: 11px 14px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  color: #cfd8ea; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent; cursor: pointer;
}
.g2-chip:active { transform: scale(.96); background: rgba(62,166,255,.18); }

.g2-input { display: flex; gap: 8px; width: 100%; max-width: 300px; }
.g2-input input {
  flex: 1 1 auto; min-width: 0;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  color: #e8edf7; font-size: 16px; outline: none;
  -webkit-user-select: auto; user-select: auto;
}
.g2-input input:focus { border-color: rgba(62,166,255,.55); }
.g2-go {
  flex: 0 0 auto; padding: 0 20px; border-radius: 12px; border: 0;
  background: linear-gradient(135deg, #3ea6ff, #2b7fd4); color: #04101f;
  font-size: 15px; font-weight: 800;
}

/* ---------------- 2 点球大战 ---------------- */
.pn-field {
  flex: 1 1 auto; min-height: 0;
  position: relative; display: flex; align-items: center; justify-content: center;
}
.pn-goal {
  position: relative;
  width: 100%; max-width: 340px; aspect-ratio: 3 / 2;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 10px; border-radius: 16px;
  background: linear-gradient(180deg, #10243a, #0c1a2b);
  border: 2px solid rgba(255,255,255,.12);
  overflow: hidden;
}
.pn-net {
  position: absolute; inset: 10px; border-radius: 10px; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 18px 18px;
}
.pn-zone {
  position: relative; z-index: 1;
  border: 1px dashed rgba(255,255,255,.14); border-radius: 10px;
  background: rgba(255,255,255,.02); color: #8fa2bd;
  font-size: 13px; font-weight: 700; letter-spacing: .5px;
  -webkit-tap-highlight-color: transparent;
}
.pn-goal.armed .pn-zone { border-color: rgba(62,166,255,.55); color: #cfe6ff; }
.pn-goal.armed .pn-zone:active { background: rgba(62,166,255,.2); }

.pn-ball {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #d7dde8 60%, #9aa6b8);
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  opacity: 0; transform: translate(-50%, -50%) scale(.4);
  transition: all .28s ease;
}
.pn-ball.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.pn-ball.left { left: 18%; top: 42%; }
.pn-ball.mid { left: 50%; top: 34%; }
.pn-ball.right { left: 82%; top: 42%; }

.pn-log { flex: 0 0 auto; min-height: 26px; text-align: center; font-size: 15px; font-weight: 700; }
.pn-log .goal { color: #34d399; }
.pn-log .save { color: #ffb020; }

/* ---------------- 3 反应对决 ---------------- */
.rf {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden;
  background: #131a29;
  /* 不做过渡：过渡会让「文字已变绿、底色还红」错开，这游戏靠颜色判断，必须瞬间切换 */
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.rf.wait { background: #3d1020; }
.rf.go { background: #0b5c36; }
.rf-half {
  flex: 1 1 50%; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; color: rgba(255,255,255,.45);
  -webkit-tap-highlight-color: transparent;
}
.rf-half b { font-size: 15px; color: rgba(255,255,255,.25); font-weight: 600; }
.rf-half.p2 { transform: rotate(180deg); }
.rf.go .rf-half b { color: rgba(255,255,255,.7); }
.rf-half:active { background: rgba(255,255,255,.05); }
.rf-mid {
  flex: 0 0 auto; text-align: center; padding: 8px 0;
  font-size: 18px; font-weight: 800; color: #e8edf7; letter-spacing: 1px;
}
.rf.wait .rf-mid { color: #ff8fa6; }
.rf.go .rf-mid { color: #4ade80; }
.rf-foot { flex: 0 0 auto; display: flex; gap: 10px; justify-content: center; padding-top: 12px; }

/* ---------------- 4 黑白棋 ---------------- */
.ot-board {
  flex: 0 0 auto;
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 2px; padding: 8px; border-radius: 14px;
  background: #0e1a13;
  border: 1px solid rgba(52,211,153,.18);
  align-self: center;
  width: min(100%, 360px);
  aspect-ratio: 1;
  box-sizing: border-box;
}
.ot-cell {
  position: relative; border-radius: 4px; border: 0;
  background: rgba(52,211,153,.07);
  display: flex; align-items: center; justify-content: center;
  padding: 0; -webkit-tap-highlight-color: transparent;
}
.ot-cell span {
  width: 78%; height: 78%; border-radius: 50%;
  transition: background .18s ease, box-shadow .18s ease;
}
.ot-cell.b span { background: radial-gradient(circle at 34% 30%, #4b5a70, #0d1119 70%); box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.ot-cell.w span { background: radial-gradient(circle at 34% 30%, #ffffff, #ccd4e0 72%); box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.ot-cell.can::after {
  content: ''; position: absolute; width: 22%; height: 22%;
  border-radius: 50%; background: rgba(62,166,255,.55);
  box-shadow: 0 0 8px rgba(62,166,255,.6);
}
.ot-tip { flex: 0 0 auto; text-align: center; font-size: 12px; color: #7d8aa3; padding: 10px 0 4px; }

/* ---------------- 5 二十一点 ---------------- */
.bj-table {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
}
.bj-hand {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07);
  transition: border-color .2s ease, background .2s ease;
}
.bj-hand.act { border-color: rgba(62,166,255,.5); background: rgba(62,166,255,.07); }
.bj-hand.p2.act { border-color: rgba(255,92,124,.5); background: rgba(255,92,124,.07); }
.bj-cards { flex: 1 1 auto; display: flex; gap: 6px; flex-wrap: wrap; min-height: 46px; align-items: center; }
.bj-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 36px; height: 48px; border-radius: 7px;
  background: #f5f7fb; color: #12192a;
  font-size: 12px; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  animation: bjIn .22s ease both;
}
.bj-card i { font-style: normal; font-size: 12px; }
.bj-card b { font-size: 15px; }
.bj-card.red { color: #d1332e; }
.bj-empty { color: #4b5568; }
@keyframes bjIn { from { opacity: 0; transform: translateY(-8px) scale(.9); } }
.bj-val {
  flex: 0 0 auto; min-width: 40px; text-align: center;
  font-size: 20px; font-weight: 800; color: #e8edf7;
  font-variant-numeric: tabular-nums;
}
.bj-res {
  flex: 0 0 auto; text-align: center; font-size: 13px; color: #7d8aa3;
  min-height: 20px;
}
.bj-res.show { font-size: 16px; font-weight: 800; color: #ffb020; }
.bj-res.show.push { color: #8fa2bd; }
.bj-acts { flex: 0 0 auto; display: flex; gap: 10px; justify-content: center; padding: 8px 0 4px; }

/* ---------------- 6 打地鼠 ---------------- */
.wk-wrap {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 6px;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.wk-half {
  flex: 1 1 0; min-height: 0;
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px; border-radius: 14px;
  background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.06);
}
.wk-half.p2 { transform: rotate(180deg); }
.wk-top {
  flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: #7d8aa3;
}
.wk-top b { font-size: 16px; color: #e8edf7; }
.wk-grid {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 5px;
}
.wk-cell {
  border: 0; border-radius: 9px; padding: 0;
  background: rgba(255,255,255,.045);
  -webkit-tap-highlight-color: transparent;
  transition: background .08s linear, transform .08s linear;
}
.wk-cell.up {
  background: radial-gradient(circle at 40% 34%, #ffd76a, #d98b1a 70%);
  box-shadow: 0 0 14px rgba(255,176,32,.45), inset 0 -3px 0 rgba(0,0,0,.18);
  transform: scale(.96);
}
.wk-mid {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 15px; font-weight: 700; color: #cfd8ea;
  font-variant-numeric: tabular-nums;
}
.wk-tools { flex: 0 0 auto; display: flex; justify-content: center; padding-top: 8px; }

/* ---------------- 交接遮罩（点球用：让对家转身） ---------------- */
#view-penalty .gx { position: relative; }
.g2-mask {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(8, 12, 20, 0.94);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.16s linear;
  border-radius: 18px;
}
.g2-mask.show { opacity: 1; pointer-events: auto; }
.g2-mask-in {
  text-align: center; max-width: 260px;
  padding: 22px 18px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.g2-mask-in h4 { margin: 0 0 8px; font-size: 18px; color: #e8edf7; }
.g2-mask-in p { margin: 0 0 16px; font-size: 13px; color: #8fa2bd; line-height: 1.5; }

/* 反应对决：上下两块之间要有分界，否则像一整块 */
.rf-half.p1 { border-bottom: 1px solid rgba(255, 255, 255, 0.07); }

/* 二十一点：爆牌要能一眼看出来 */
.bj-val.bust { color: #ff5c7c; }
.bj-hand.bust { border-color: rgba(255, 92, 124, 0.45); }

/* 打地鼠：光靠发光不够，给个图形 */
.wk-cell.up::after {
  content: '🐹';
  display: block; font-size: 20px; line-height: 1;
  animation: wkUp 0.12s ease-out;
}
@keyframes wkUp { from { transform: scale(0.6); opacity: 0; } }

/* 按需加载时给个反馈，别让人以为没点上 */
.game-card.loading { opacity: 0.55; }

/* ---------------- 黑白棋：把棋盘铺到可用宽度，并垂直居中 ---------------- */
#view-othello { padding-left: 8px; padding-right: 8px; }
#view-othello .gx { padding-left: 4px; padding-right: 4px; }
.ot-board {
  width: 100%;
  max-width: 560px;
  margin: auto;          /* flex 列里的 auto 外边距 = 垂直居中 */
}

