/* ==========================================================================
   快艇骰子（Yahtzee）
   --------------------------------------------------------------------------
   依赖全局变量与共享组件（.mode-tabs / .btn / .panel / .room-* / .pc-field 等），
   只补充本游戏自己的部分。前缀 yht-
   ========================================================================== */

.yht-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.yht {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(96vw, 880px);
}

.yht-slot:empty { display: none; }

/* ------------------------------ 座位配色 -------------------------------- */

.yht-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-mute);
}
.yht-dot.is-s0, .yht-chip.is-s0 .yht-dot { background: #8b5cf6; }
.yht-dot.is-s1, .yht-chip.is-s1 .yht-dot { background: #22d3ee; }
.yht-dot.is-s2, .yht-chip.is-s2 .yht-dot { background: #fb7185; }
.yht-dot.is-s3, .yht-chip.is-s3 .yht-dot { background: #34d399; }
.yht-dot.is-s4, .yht-chip.is-s4 .yht-dot { background: #fbbf24; }
.yht-dot.is-s5, .yht-chip.is-s5 .yht-dot { background: #60a5fa; }

/* ------------------------------ 状态栏 ---------------------------------- */

.yht-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--surface);
}

.yht-status-line { font-size: 13px; color: var(--text-dim); letter-spacing: .02em; }

.yht-players { display: flex; flex-wrap: wrap; gap: 8px; }

.yht-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  font-size: 12.5px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color .2s, background .2s;
}
.yht-chip b { font-weight: 600; color: var(--text); }
.yht-chip em {
  font-style: normal;
  font-weight: 700;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.yht-chip small { font-size: 11px; color: var(--text-mute); }
.yht-chip.is-turn {
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.14);
}
.yht-chip.is-win {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.12);
}
.yht-chip-tag {
  padding: 1px 7px;
  font-size: 11px;
  border-radius: 999px;
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
}

/* ------------------------------ 结果横幅 -------------------------------- */

.yht-banner {
  padding: 14px 16px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid rgba(139, 92, 246, 0.4);
  background: linear-gradient(120deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.1));
  animation: yht-banner-in .28s cubic-bezier(.2, .8, .3, 1);
}
.yht-banner[hidden] { display: none; }
.yht-banner-title { font-size: 17px; font-weight: 700; }
.yht-banner-detail { margin-top: 5px; font-size: 12.5px; line-height: 1.6; color: var(--text-dim); }
.yht-banner-detail:empty { display: none; }
.yht-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}
.yht-banner-actions:empty { display: none; margin-top: 0; }

@keyframes yht-banner-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.yht-score-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  margin: 6px 0 2px;
}
.yht-score-row {
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  font-variant-numeric: tabular-nums;
}
.yht-score-row b { margin-right: 5px; color: var(--text); font-weight: 600; }
.yht-score-row.is-win {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.12);
}
.yht-score-note { margin: 4px 0 0; font-size: 11.5px; color: var(--text-mute); }

/* ------------------------------ 骰子区 ---------------------------------- */

.yht-tray {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
}

.yht-dice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.yht-die {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 11px;
  font-family: inherit;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.22));
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.yht-die-face {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-items: center;
}
.yht-die-face.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-mute);
}
.yht-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}
.yht-pip.is-on { background: var(--text); }

.yht-die-tag {
  font-size: 11px;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-mute);
  border: 1px solid var(--border-soft);
}

button.yht-die { cursor: pointer; }
button.yht-die:hover { transform: translateY(-3px); border-color: rgba(139, 92, 246, 0.6); }

.yht-die.is-held {
  border-color: rgba(251, 191, 36, 0.85);
  background: linear-gradient(165deg, rgba(251, 191, 36, 0.26), rgba(251, 191, 36, 0.06));
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.6), 0 12px 22px -14px rgba(0, 0, 0, 0.95);
}
.yht-die.is-held .yht-die-tag {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.12);
}
.yht-die.is-static { opacity: .92; }

.yht-dice.is-five .yht-die {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35);
}

/* ------------------------------ 操作与提示 ------------------------------ */

.yht-action { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.yht-action-tip { margin: 0; font-size: 12.5px; color: var(--text-dim); text-align: center; }
.yht-action-tip.is-hot {
  color: #fcd34d;
  font-weight: 600;
}
.yht-action-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.yht-notice {
  padding: 10px 16px;
  font-size: 12.5px;
  text-align: center;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
  background: var(--surface);
}
.yht-notice[hidden] { display: none; }
.yht-notice.is-error {
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.12);
}

.yht-controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.yht-controls:empty { display: none; }

/* ------------------------------ 计分表 ---------------------------------- */

.yht-board-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--surface);
}

.yht-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.yht-table th,
.yht-table td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.yht-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 600;
}

.yht-cat-head,
.yht-cat {
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}
.yht-cat small {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-mute);
}

.yht-player-head { color: var(--text-dim); }
.yht-player-head.is-turn { color: #c4b5fd; }
.yht-player-head.is-me { color: var(--text); }

.yht-cell { color: var(--text-dim); }
.yht-cell.is-me { background: rgba(255, 255, 255, 0.03); }
.yht-cell.is-turn-col { background: rgba(139, 92, 246, 0.1); }
.yht-cell.is-last { box-shadow: inset 0 0 0 2px rgba(34, 211, 238, 0.5); }
.yht-cell.is-sub-cell { color: var(--text-dim); }

.yht-val { font-weight: 700; color: var(--text); }
.yht-val.is-zero { color: var(--text-mute); font-weight: 500; }
.yht-empty { color: var(--text-mute); }

.yht-pick {
  min-width: 40px;
  padding: 3px 9px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #e9d5ff;
  border: 1px dashed rgba(139, 92, 246, 0.55);
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  cursor: pointer;
  transition: transform .14s, background .14s, border-color .14s;
}
.yht-pick:hover {
  transform: translateY(-1px);
  border-style: solid;
  border-color: rgba(139, 92, 246, 0.9);
  background: rgba(139, 92, 246, 0.22);
}
.yht-pick.is-zero { color: var(--text-mute); border-color: var(--border-soft); background: transparent; }

.yht-row.is-lower-start .yht-cat,
.yht-row.is-lower-start .yht-cell { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.yht-row.is-sub .yht-cat,
.yht-row.is-sub .yht-cell { color: var(--text-mute); font-size: 12px; }
.yht-row.is-bonus .yht-cat { color: #fcd34d; }
.yht-row.is-bonus .yht-cell { color: #fcd34d; font-weight: 600; }

.yht-table tfoot .yht-cat,
.yht-table tfoot .yht-cell {
  border-bottom: none;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.yht-table tfoot .yht-row.is-bonus .yht-cat,
.yht-table tfoot .yht-row.is-bonus .yht-cell { color: #fcd34d; }
.yht-table tfoot .yht-row.is-total .yht-cell { color: #c4b5fd; }

/* ------------------------------- 战报 ----------------------------------- */

.yht-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--surface);
}
.yht-log-title {
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: .06em;
  margin-bottom: 2px;
}
.yht-log-row { font-size: 12.5px; line-height: 1.6; color: var(--text-dim); }
.yht-log-row b { color: var(--text); font-weight: 600; }
.yht-log-row.is-empty { color: var(--text-mute); }

/* ------------------------------ 单机人数 -------------------------------- */

.yht-local-top { display: flex; flex-direction: column; gap: 2px; }
.yht-local-hint { margin: 0 0 6px; font-size: 12.5px; line-height: 1.6; color: var(--text-mute); }

.yht-rules { width: 100%; }

/* ------------------------------ 房间座位 -------------------------------- */

.yht-lobby { width: min(94vw, 620px); }

.room-seat.is-s0 .room-seat-mark { color: #8b5cf6; background: rgba(139, 92, 246, 0.16); }
.room-seat.is-s1 .room-seat-mark { color: #22d3ee; background: rgba(34, 211, 238, 0.16); }
.room-seat.is-s2 .room-seat-mark { color: #fb7185; background: rgba(251, 113, 133, 0.16); }
.room-seat.is-s3 .room-seat-mark { color: #34d399; background: rgba(52, 211, 153, 0.16); }
.room-seat.is-s4 .room-seat-mark { color: #fbbf24; background: rgba(251, 191, 36, 0.16); }
.room-seat.is-s5 .room-seat-mark { color: #60a5fa; background: rgba(96, 165, 250, 0.16); }
.room-seat.is-offline { opacity: .55; }

/* ------------------------------ 响应式 ---------------------------------- */

@media (max-width: 640px) {
  .yht { gap: 10px; }
  .yht-status { padding: 10px 12px; }
  .yht-tray { padding: 10px 12px; }
  .yht-dice { gap: 7px; }
  .yht-die { padding: 7px 9px; border-radius: 12px; }
  .yht-die-face { width: 30px; height: 30px; }
  .yht-pip { width: 6.5px; height: 6.5px; }
  .yht-die-tag { font-size: 10px; padding: 2px 6px; }
  .yht-cat small { display: none; }
  .yht-table { font-size: 12px; }
  .yht-table th, .yht-table td { padding: 5px 6px; }
}
