/* ==========================================================================
   页面层样式：排行榜 / 昵称 / 成绩上报 / 提示条
   --------------------------------------------------------------------------
   这一层是 Node 项目新增的"社交壳"，游戏内部样式在 scene.css 与 scores.css，
   两边互不干扰：这里只负责 #hud-extra、#board-*、#nickname、#submit-btn 等新元素。
   ========================================================================== */

/* ---------------------------- 左上角站点名 ---------------------------- */
.site-tag {
  position: absolute;
  top: 1.6cqw;
  left: 1.8cqw;
  z-index: 29;                 /* 在场景之上、HUD 之下，不挡操作 */
  font-size: clamp(10px, 1.25cqw, 14px);
  font-weight: 900;
  letter-spacing: 0.16em;
  color: rgba(234, 243, 232, 0.9);
  background: rgba(10, 18, 12, 0.55);
  border: 1px solid rgba(203, 185, 148, 0.22);
  border-radius: 9px;
  padding: 0.4cqw 0.9cqw;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* ---------------------------- 顶栏右侧：班级 + 昵称 ---------------------------- */
#hud-extra {
  position: absolute;
  top: 1.6cqw;
  right: 1.8cqw;
  z-index: 31;
  display: flex;
  align-items: center;
  gap: 0.8cqw;
}

#nickname-wrap {
  display: flex;
  align-items: center;
  gap: 0.5cqw;
  background: rgba(10, 18, 12, 0.72);
  border: 1px solid rgba(203, 185, 148, 0.3);
  border-radius: 11px;
  padding: 0.4cqw 0.7cqw;
  backdrop-filter: blur(6px);
}
#nickname-wrap .tag {
  font-size: clamp(9px, 1.1cqw, 12px);
  letter-spacing: 0.12em;
  color: var(--khaki);
  white-space: nowrap;
}
#nickname {
  width: clamp(72px, 11cqw, 150px);
  font-family: inherit;
  font-size: clamp(11px, 1.35cqw, 15px);
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0.35cqw 0.6cqw;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
#nickname:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 213, 74, 0.2);
}
#nickname::placeholder { color: rgba(255, 255, 255, 0.4); }

.board-link {
  font-size: clamp(10px, 1.25cqw, 14px);
  font-weight: 800;
  color: #eaf3e8;
  text-decoration: none;
  background: rgba(10, 18, 12, 0.72);
  border: 1px solid rgba(203, 185, 148, 0.3);
  border-radius: 11px;
  padding: 0.55cqw 0.95cqw;
  backdrop-filter: blur(6px);
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.12s ease;
}
.board-link:hover { background: rgba(30, 50, 34, 0.92); transform: translateY(-1px); }

/* ---------------------------- 开始页：迷你排行榜 ---------------------------- */
.start-cols {
  margin-top: 2.2cqw;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 1.6cqw;
  text-align: left;
  align-items: start;
}
@media (max-aspect-ratio: 1/1) {
  .start-cols { grid-template-columns: 1fr; }
}

.board-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(203, 185, 148, 0.24);
  border-radius: 14px;
  padding: 1.3cqw 1.4cqw;
}
.board-card h3 {
  margin: 0 0 0.9cqw;
  font-size: clamp(12px, 1.6cqw, 17px);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.5cqw;
}
#board-stats {
  margin-top: 0.9cqw;
  font-size: clamp(9px, 1.15cqw, 12.5px);
  color: #9fb39c;
  line-height: 1.6;
}
#board-stats b { color: #eaf3e8; }

.board-list { list-style: none; margin: 0; padding: 0; }
.board-row {
  display: grid;
  grid-template-columns: 2.1em 1fr auto auto;
  align-items: center;
  gap: 0.7cqw;
  padding: 0.42cqw 0.5cqw;
  border-radius: 8px;
  font-size: clamp(10px, 1.3cqw, 14px);
  color: #d8e6d6;
  transition: background 0.16s ease;
}
.board-row:nth-child(odd) { background: rgba(255, 255, 255, 0.035); }
.board-row.is-me {
  background: rgba(255, 213, 74, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 213, 74, 0.4);
}
.board-row .pos { font-weight: 900; text-align: center; color: #9fb39c; font-variant-numeric: tabular-nums; }
.board-row .pos.p1 { color: #ffd54a; }
.board-row .pos.p2 { color: #d9dee6; }
.board-row .pos.p3 { color: #e0a066; }
.board-row .who {
  font-weight: 800; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.board-row .sc {
  font-weight: 900; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.board-row .tm {
  color: #8b97ad; font-variant-numeric: tabular-nums;
  font-size: 0.92em; min-width: 3.6em; text-align: right;
}
.board-empty {
  font-size: clamp(10px, 1.3cqw, 14px);
  color: #8b97ad;
  padding: 1.2cqw 0.4cqw;
  text-align: center;
}

/* ---------------------------- 结算页：上报区块 ---------------------------- */
#submit-block {
  margin-top: 1.8cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9cqw;
}
#submit-btn {
  font-family: inherit;
  font-size: clamp(12px, 1.7cqw, 18px);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #10200f;
  background: linear-gradient(180deg, #b6f7c9, var(--ok) 55%, #35b96e);
  border: none;
  border-radius: 999px;
  padding: 1.1cqw 3cqw;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(93, 220, 143, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
#submit-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(93, 220, 143, 0.42); }
#submit-btn:active:not(:disabled) { transform: translateY(1px) scale(0.985); }
#submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.submit-state {
  font-size: clamp(10px, 1.3cqw, 14px);
  line-height: 1.6;
  padding: 0.7cqw 1.2cqw;
  border-radius: 10px;
  border: 1px solid transparent;
  text-align: center;
  max-width: 46ch;
}
.submit-state b { color: var(--gold); }
.submit-state.idle { color: #9fb39c; background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.1); }
.submit-state.busy { color: #ffe9a8; background: rgba(255, 213, 74, 0.1); border-color: rgba(255, 213, 74, 0.3); }
.submit-state.ok   { color: #b6f7c9; background: rgba(93, 220, 143, 0.12); border-color: rgba(93, 220, 143, 0.36); }
.submit-state.warn { color: #ffd9d5; background: rgba(255, 59, 48, 0.12); border-color: rgba(255, 59, 48, 0.34); }

.mini-btn {
  font-family: inherit;
  font-size: 0.92em;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 0.2em 0.8em;
  margin-left: 0.4em;
  cursor: pointer;
}
.mini-btn:hover { background: rgba(255, 255, 255, 0.24); }

/* ---------------------------- 全局提示条 ---------------------------- */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #202a3d;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.22s ease both;
  max-width: min(88vw, 520px);
  text-align: center;
}
.toast-success { background: linear-gradient(135deg, #0f9c74, #12a37a); }
.toast-error   { background: linear-gradient(135deg, #c8263a, #dc3a4c); }
.toast-out { opacity: 0; transform: translateY(8px); transition: all 0.24s ease; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
}

/* ---------------------------- 页脚 ---------------------------- */
.page-foot {
  position: absolute;
  left: 50%;
  bottom: 0.6cqw;
  transform: translateX(-50%);
  z-index: 31;
  font-size: clamp(9px, 1.1cqw, 12px);
  color: rgba(214, 228, 212, 0.55);
  white-space: nowrap;
  pointer-events: none;
}
.page-foot a { color: rgba(214, 228, 212, 0.8); pointer-events: auto; }

/* ---------------------------- 独立排行榜页 ---------------------------- */
body.board-page {
  overflow: auto;
  background:
    radial-gradient(1000px 520px at 15% -10%, #1b3a26, transparent 60%),
    radial-gradient(900px 480px at 88% 4%, #2a2140, transparent 62%),
    #0b1410;
}
.board-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}
.board-head {
  text-align: center;
  margin-bottom: 20px;
}
.board-head h1 {
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff5cf, var(--gold) 55%, #d59b1b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.board-head p { color: #9fb39c; font-size: 13.5px; margin-top: 6px; }
.board-head .back {
  display: inline-block;
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 800;
  color: #eaf3e8;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 8px 18px;
}
.board-head .back:hover { background: rgba(255, 255, 255, 0.16); }

.board-table {
  background: var(--panel);
  border: 1px solid rgba(203, 185, 148, 0.24);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
}
.board-table .row {
  display: grid;
  grid-template-columns: 3em 1fr 5em 5em 5em 5em;
  gap: 10px;
  align-items: center;
  padding: 9px 8px;
  border-radius: 10px;
  font-size: 14px;
  color: #d8e6d6;
}
.board-table .row.head {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--khaki);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding-bottom: 10px;
}
.board-table .row:not(.head):nth-child(even) { background: rgba(255, 255, 255, 0.035); }
.board-table .row.is-me { background: rgba(255, 213, 74, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 213, 74, 0.4); }
.board-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.board-table .who { font-weight: 800; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-table .pos { font-weight: 900; text-align: center; color: #9fb39c; }
.board-table .pos.p1 { color: #ffd54a; }
.board-table .pos.p2 { color: #d9dee6; }
.board-table .pos.p3 { color: #e0a066; }
.board-table .sc { color: var(--gold); font-weight: 900; }
@media (max-width: 640px) {
  .board-table .row { grid-template-columns: 2.4em 1fr 4em 4em; font-size: 13px; }
  .board-table .row .hide-sm { display: none; }
}
