/* ============================================================
   联机房间：入口卡片 / 大厅 / 等待 / 五子棋 / 你画我猜
   ============================================================ */

.net-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 16px;
  border: 1px solid rgba(62, 166, 255, 0.32);
  background: linear-gradient(135deg, rgba(62, 166, 255, 0.18), rgba(255, 92, 124, 0.12));
  color: #eef3ff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ne-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 18px;
}
.ne-text b { display: block; font-size: 15px; }
.ne-text em {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-style: normal;
  color: #9aa6c0;
}
.ne-go { margin-left: auto; color: rgba(255, 255, 255, 0.4); font-size: 20px; }

/* ------------------------------ 外壳 */
.net {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px 16px 16px;
  box-sizing: border-box;
}
.net-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  flex: 0 0 auto;
}
.net-back {
  border: 0;
  background: none;
  color: #9aa6c0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.net-status { font-size: 11px; color: #7ee0b8; max-width: 62%; text-align: right; }
.net-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 8px; }

/* ------------------------------ 大厅 */
.nl { margin-top: auto; margin-bottom: auto; }
.nl-title { margin: 0 0 6px; font-size: 24px; color: #eef3ff; }
.nl-sub { margin: 0 0 20px; font-size: 12px; color: #77839c; line-height: 1.6; }
.nl-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #eef3ff;
  font: inherit;
  font-size: 15px;
  margin-bottom: 10px;
}
.nl-name { letter-spacing: 0; }
.nl-join { display: flex; gap: 8px; }
.nl-join .nl-input { margin-bottom: 0; letter-spacing: 4px; text-transform: uppercase; }
.nl-or { text-align: center; font-size: 11px; color: #5d6780; margin: 16px 0; }
.nl-note { margin: 16px 0 0; font-size: 11px; color: #5d6780; line-height: 1.6; }

/* ------------------------------ 等待 */
.nw { display: flex; flex-direction: column; flex: 1; justify-content: center; gap: 18px; }
.nw-code { text-align: center; }
.nw-label { display: block; font-size: 11px; color: #77839c; margin-bottom: 4px; }
.nw-code-v {
  font-size: 40px;
  letter-spacing: 8px;
  color: #ffd166;
  font-family: ui-monospace, Menlo, monospace;
}
.nw-players {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.nw-p {
  flex: 1;
  max-width: 130px;
  padding: 14px 10px;
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
  color: #77839c;
  border: 1px dashed rgba(255, 255, 255, 0.12);
}
.nw-p.in { color: #eef3ff; border-style: solid; border-color: rgba(62, 166, 255, 0.4); }
.nw-vs { font-size: 11px; color: #5d6780; }
.nw-actions { display: flex; flex-direction: column; gap: 10px; }
.nw-tip { text-align: center; font-size: 12px; color: #77839c; }
.nw-foot { display: flex; gap: 8px; justify-content: center; }

/* ------------------------------ 五子棋 */
.ng { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; gap: 10px; }
.ng-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  flex: 0 0 auto;
}
.ng-tag { color: #9aa6c0; }
.ng-tag.p1 { color: #3ea6ff; }
.ng-tag.p2 { color: #ff5c7c; }
.ng-turn { color: #ffd166; font-size: 12px; }
.nb-wrap {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
}
/* 尺寸由 JS 按容器短边写死，保证格子是正方形 —— 否则棋子会被拉成椭圆 */
.nb {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  gap: 0;
  background: linear-gradient(160deg, #6b4a2c, #4a3220);
  border-radius: 10px;
  padding: 0;
  margin: 0 auto;
  overflow: hidden;
}
.nb-cell {
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.nb-cell::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(0, 0, 0, 0.35);
}
.nb-cell::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 1px;
  background: rgba(0, 0, 0, 0.35);
}
.nb-stone {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82%;
  height: 82%;
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  transition: transform 0.14s ease;
  z-index: 2;
}
.nb-cell.s1 .nb-stone {
  transform: translate(-50%, -50%) scale(1);
  background: radial-gradient(circle at 34% 30%, #6fc0ff, #1c6fb8 62%, #0d4a80);
}
.nb-cell.s2 .nb-stone {
  transform: translate(-50%, -50%) scale(1);
  background: radial-gradient(circle at 34% 30%, #ff9db0, #d63b57 62%, #8d1c30);
}
.nb-cell.last .nb-stone { box-shadow: 0 0 0 2px #ffd166; }
.nb-cell.win .nb-stone { box-shadow: 0 0 10px 3px rgba(255, 209, 102, 0.9); }
.ng-foot { display: flex; gap: 8px; justify-content: center; flex: 0 0 auto; }

/* ------------------------------ 你画我猜 */
.nd { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 8px; }
.nd-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #9aa6c0;
  flex: 0 0 auto;
}
.nd-score { color: #eef3ff; font-size: 13px; }
.nd-time { color: #7ee0b8; font-size: 13px; }
.nd-time.urgent { color: #ff5c7c; }
.nd-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}
.nd-canvas {
  background: #0f1626;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  touch-action: none;
}
.nd-mask {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 12, 22, 0.88);
  border-radius: 14px;
}
.ndm-card { text-align: center; padding: 20px; }
.ndm-label { font-size: 11px; color: #77839c; margin: 0 0 6px; }
.ndm-word { font-size: 30px; color: #ffd166; margin: 0 0 16px; letter-spacing: 2px; }
.ndm-card h3 { margin: 0 0 10px; font-size: 20px; color: #eef3ff; }
.ndm-card h3.hit { color: #7ee0b8; }
.ndm-card h3.miss { color: #ff8fa3; }
.ndm-card p { font-size: 12px; color: #9aa6c0; margin: 4px 0; }
.nd-tools { display: flex; gap: 8px; justify-content: center; flex: 0 0 auto; }
.nd-ask { display: flex; gap: 8px; flex: 0 0 auto; }
.nd-ask .nl-input { margin-bottom: 0; }
.nd-ask.shake { animation: ndShake 0.35s; }
@keyframes ndShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* hidden 属性必须压过作者样式的 display，否则遮罩关不掉 */
[hidden] {
  display: none !important;
}

/* ------------------------------ 记忆翻牌（联机） */
.nw-mem {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.nw-mem-label { font-size: 11px; color: #77839c; margin-right: auto; }
.nw-chip {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cfd8ea;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.nw-chip:disabled { opacity: 0.4; }

.nm { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 10px; }
.nm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #9aa6c0;
  flex: 0 0 auto;
}
.nm-score { color: #eef3ff; font-size: 15px; }
.nm-turn { color: #ffd166; font-size: 12px; }
.nm-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 7px;
  align-content: center;
}
.nm-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.nm-grid.cols-5 { grid-template-columns: repeat(5, 1fr); gap: 5px; }
.nm-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  perspective: 500px;
}
.nm-inner {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: block;
  transform-style: preserve-3d;
  transition: transform 0.32s ease;
}
.nm-card.flip .nm-inner { transform: rotateY(180deg); }
.nm-face {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  backface-visibility: hidden;
  font-size: 22px;
}
.nm-back {
  background: linear-gradient(150deg, #223055, #141c30);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.25);
  font-weight: 700;
}
.nm-front {
  transform: rotateY(180deg);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.nm-card.matched .nm-front {
  border-color: rgba(126, 224, 184, 0.6);
  background: rgba(126, 224, 184, 0.12);
}
.nm-grid.cols-5 .nm-back,
.nm-grid.cols-5 .nm-front { font-size: 17px; }
.nm-foot { display: flex; gap: 8px; justify-content: center; flex: 0 0 auto; }

/* ------------------------------ 计费 */
.net-bal {
  margin-left: auto;
  margin-right: 10px;
  font-size: 11px;
  color: #7ee0b8;
  font-variant-numeric: tabular-nums;
}
.net-bal.out { color: #ff5c7c; }
.nl-bill {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.nl-bill-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  color: #9aa6c0;
}
.nl-bill-head b { color: #ffd166; font-size: 13px; }
.nw-warn {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 92, 124, 0.12);
  border: 1px solid rgba(255, 92, 124, 0.32);
  color: #ffb3c1;
  font-size: 11px;
  line-height: 1.5;
}
