/* 春晚抽签 H5 — 主样式（移动端优先 / 红金主题） */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --red:        #c8102e;
  --red-deep:   #8b0000;
  --gold:       #f3c33b;
  --gold-soft:  #ffd86b;
  --bg:         #fff5e8;
  --paper:      #ffffff;
  --ink:        #2a1410;
  --ink-soft:   #6b4f47;
  --gray-line:  #e9d8c4;
  --shadow:     0 6px 24px rgba(139, 0, 0, .12);
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, #ffe6c2 0%, transparent 40%),
    radial-gradient(circle at 80% 100%, #ffcdd2 0%, transparent 40%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 18px;       /* 老人友好：基础字号 16 → 18 */
  line-height: 1.6;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 80px;
  min-height: 100vh;
  position: relative;
}

/* ── 场次信息卡 ─────────────────────────────── */
.show-card {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.show-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 10%, rgba(243,195,59,.4) 0%, transparent 30%),
    radial-gradient(circle at 5% 90%, rgba(243,195,59,.2) 0%, transparent 30%);
  pointer-events: none;
}
.show-card .show-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
  position: relative;
}
.show-card .show-meta {
  margin-top: 8px;
  font-size: 16px;
  opacity: .92;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.show-card .show-meta span::before {
  content: "📅 ";
  margin-right: 2px;
}
.show-card .show-meta .show-loc::before {
  content: "📍 ";
}
.show-card .loading {
  text-align: center;
  color: rgba(255,255,255,.85);
  padding: 8px 0;
}

/* ── 进度条 ─────────────────────────────────── */
.progress-bar {
  margin-top: 14px;
  background: var(--paper);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.progress-text {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.progress-fill {
  height: 6px;
  background: var(--gray-line);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--red) 100%);
  width: 0%;
  transition: width .4s ease;
}

/* ── 主区通用 ─────────────────────────────── */
main { margin-top: 16px; }

.step-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  margin: 20px 0 12px;
}

.big-msg {
  background: var(--paper);
  border-radius: 16px;
  padding: 44px 22px;
  text-align: center;
  box-shadow: var(--shadow);
}
.big-msg .emoji { font-size: 64px; }
.big-msg .msg { font-size: 22px; font-weight: 600; margin-top: 14px; }
.big-msg .sub { font-size: 17px; color: var(--ink-soft); margin-top: 10px; }

/* ── 团队选择 ─────────────────────────────── */
.team-search input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--gray-line);
  border-radius: 12px;
  background: var(--paper);
  font-size: 17px;
  outline: none;
  transition: border-color .15s;
}
.team-search input:focus { border-color: var(--red); }

.team-list {
  margin-top: 10px;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  /* 不设 max-height / overflow — 让内容自然撑开，整页滚动 */
}
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-line);
  cursor: pointer;
  transition: background .15s;
}
.team-row:last-child { border-bottom: none; }
.team-row:active { background: #fff0e0; }
.team-row.selected { background: #fff4d6; }
.team-row.drawn {
  background: #fff8e8;        /* 淡金底色提示"已抽"，但不灰，仍可点击查询 */
}
.team-row .team-name {
  font-size: 17px;
  flex: 1;
  margin-right: 8px;
  word-break: break-all;
}
.team-row .team-perf {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 4px;
}
/* 两行 badge：上行状态、下行操作提示 */
.team-row .badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 84px;                 /* 固定宽度，两种 badge 大小一致 */
  padding: 7px 8px;
  border-radius: 10px;
  white-space: nowrap;
  text-align: center;
  line-height: 1.15;
  flex-shrink: 0;
}
.team-row .badge b {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
}
.team-row .badge span {
  font-size: 11px;
  opacity: .9;
}
/* 已完成 — 红色渐变（同顶部场次卡），金字 */
.team-row .badge.badge-done {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: var(--gold-soft);
  box-shadow: 0 1px 3px rgba(139, 0, 0, .2);
}
/* 未完成 — 金底 + 深红字（醒目邀请点击）*/
.team-row .badge.badge-pending {
  background: var(--gold-soft);
  color: var(--red-deep);
}

/* ── 口令输入 ─────────────────────────────── */
.password-area {
  margin-top: 18px;
  background: var(--paper);
  border-radius: 16px;
  padding: 18px 16px 22px;
  box-shadow: var(--shadow);
}
.password-area .step-title { margin-top: 0; }
.password-hint {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.password-area input {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--gray-line);
  border-radius: 12px;
  background: #fffbf2;
  font-size: 28px;
  text-align: center;
  letter-spacing: 10px;
  font-weight: 700;
  outline: none;
}
.password-area input:focus { border-color: var(--red); }

.primary-btn {
  margin-top: 18px;
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: var(--gold-soft);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 4px;
  box-shadow: 0 4px 16px rgba(200, 16, 46, .35);
  transition: transform .1s, box-shadow .1s;
  cursor: pointer;
}
.primary-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(200, 16, 46, .25);
}
.primary-btn:disabled {
  background: #c8c8c8;
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
}

.error-msg {
  margin-top: 12px;
  text-align: center;
  color: var(--red);
  font-size: 16px;
  min-height: 22px;
}

/* ── 结果页 ─────────────────────────────── */
.result-card {
  background: var(--paper);
  border-radius: 18px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.result-card::before {
  content: "🎉";
  position: absolute;
  top: -10px; right: -10px;
  font-size: 80px;
  opacity: .15;
  transform: rotate(15deg);
}
.result-team {
  font-size: 19px;
  color: var(--ink-soft);
  margin-bottom: 4px;
  font-weight: 600;
}
.result-perf {
  font-size: 16px;
  color: var(--ink-mute, var(--ink-soft));
  margin-bottom: 18px;
  opacity: .85;
}
.result-perf[hidden] { display: none; }
.result-label {
  font-size: 17px;
  color: var(--ink-soft);
  letter-spacing: 6px;
}
.result-number {
  font-size: 96px;
  font-weight: 900;
  line-height: 1;
  margin: 12px 0 20px;
  background: linear-gradient(135deg, var(--red) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 8px rgba(200,16,46,.15);
}
.result-disclaimer {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.8;
  text-align: left;
  background: #fff8e8;
  padding: 14px 16px;
  border-radius: 10px;
  border-left: 4px solid var(--gold);
  margin-top: 22px;
  white-space: pre-wrap;          /* 让 admin 输入的换行生效 */
  word-break: break-word;
}

.ghost-btn {
  margin-top: 18px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--red);
  border-radius: 12px;
  background: transparent;
  color: var(--red);
  font-size: 17px;
  cursor: pointer;
}
.ghost-btn:active { background: rgba(200,16,46,.06); }

/* ── 结束页（完整结果列表） ─────────────── */
.ended-title {
  font-size: 19px;
  font-weight: 600;
  text-align: center;
  margin: 18px 0 14px;
  color: var(--red-deep);
}
.result-list {
  list-style: none;
  background: var(--paper);
  border-radius: 14px;
  padding: 8px 0;
  box-shadow: var(--shadow);
}
.result-list li {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-line);
  font-size: 16px;
}
.result-list li:last-child { border-bottom: none; }
.result-list .pos {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--red-deep);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
}
/* 出场顺序不是金银铜奖，所有序号一视同仁，统一用默认金色 */
.result-list .pos.pos-none {
  background: var(--gray-line);
  color: var(--ink-mute);
}
.result-list .empty-tip {
  text-align: center;
  color: var(--ink-mute);
  padding: 32px 16px;
  font-size: 15px;
  list-style: none;
}
.result-list .row-team { flex: 1; }
.result-list .row-team .name { font-weight: 600; font-size: 17px; }
.result-list .row-team .perf { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }

/* ── 页脚 ─────────────────────────────── */
.footer {
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  padding: 28px 0 10px;
  opacity: .65;
  white-space: pre-wrap;
}

/* ── 礼花画布 ─────────────────────────── */
.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
}
