/* 同频 · 样式
   清新简洁：浅色极光底 + 白卡片 + 天蓝/雾紫点缀。 */

:root {
  --ink: #16233b;
  --muted: #5c6b84;
  --faint: #93a1b8;
  --accent: #0ea5e9;
  --accent-deep: #0284c7;
  --violet: #8b5cf6;
  --rose: #fb7185;
  --line: #e4eaf3;
  --soft: #f4f8fd;
  --card-r: 30px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "LXGW WenKai Screen", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, "Segoe UI", sans-serif;
  background: linear-gradient(168deg, #edf6ff 0%, #f5f3ff 52%, #fdf0f5 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- 背景：色块更饱和，透过毛玻璃看是虚化的光斑 ---- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .8; }
.blob-a { width: 52vmax; height: 52vmax; left: -16vmax; top: -18vmax; background: #7dd3fc; }
.blob-b { width: 44vmax; height: 44vmax; right: -14vmax; top: 12vh; background: #a78bfa; }
.blob-c { width: 40vmax; height: 40vmax; left: 18vw; bottom: -20vmax; background: #f9a8d4; }
.blob-d { width: 30vmax; height: 30vmax; right: 22vw; bottom: -6vmax; background: #fcd34d; opacity: .55; }

/* ---- 布局 ---- */
.wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 20px;
}

.card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, .66);
  backdrop-filter: blur(26px) saturate(1.6);
  -webkit-backdrop-filter: blur(26px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: var(--card-r);
  box-shadow: 0 30px 80px -30px rgba(30, 90, 180, .3), inset 0 1px 0 rgba(255, 255, 255, .9);
  padding: 34px 30px 30px;
  text-align: center;
}

.foot {
  margin: 18px 4px 0;
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--faint);
}

/* ---- 文本 ---- */
.brand {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .26em;
  color: var(--accent-deep);
}

.title {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.62;
  font-weight: 700;
  letter-spacing: .02em;
}

.h2 { margin: 0 0 10px; font-size: 21px; font-weight: 700; }

.sub { margin: 0 0 20px; font-size: 15px; line-height: 1.75; color: var(--muted); }
.sub b { color: var(--ink); }

.hint { margin: 16px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.7; }

.prompt { margin: 16px 0 14px; font-size: 14.5px; color: var(--muted); line-height: 1.7; }
.prompt b { color: var(--accent-deep); }

/* ---- 面板 & 表单 ---- */
.panel { display: grid; gap: 16px; text-align: left; }

.label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--soft);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.input::placeholder { color: #aab6c8; }

.input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, .14);
}

.input-code {
  text-transform: uppercase;
  letter-spacing: .3em;
  font-weight: 800;
  text-align: center;
}

.input-word { text-align: center; font-weight: 700; }

.joinrow { display: flex; gap: 10px; }
.joinrow .input { flex: 1; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 12px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- 按钮 ---- */
.btn {
  display: inline-block;
  padding: 13px 22px;
  font-size: 15.5px;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, opacity .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
  border: none;
  box-shadow: 0 14px 30px -12px rgba(79, 105, 235, .65);
}

.btn-primary:hover:not(:disabled) { box-shadow: 0 18px 34px -12px rgba(79, 105, 235, .8); }

.btn-ghost { width: 100%; background: #fff; }

.btn-line {
  width: 100%;
  background: transparent;
  border-color: transparent;
  color: var(--accent-deep);
  text-decoration: none;
}

.btn-line:hover { border-color: var(--line); background: #fff; }

.btn-slim { width: auto; padding: 9px 18px; font-size: 14px; }

.linklike {
  display: inline-block;
  margin-top: 18px;
  padding: 4px 6px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent-deep);
  background: none;
  border: none;
  cursor: pointer;
}

/* ---- 房间码 ---- */
.codebox { margin: 4px 0 20px; }

.code {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .24em;
  text-indent: .24em;
  padding: 16px 10px;
  background: var(--soft);
  border: 1.5px dashed #c9d8ea;
  border-radius: 20px;
  color: var(--accent-deep);
  user-select: all;
}

.codeacts { display: flex; gap: 10px; margin-top: 12px; }
.codeacts .btn { flex: 1; }

/* ---- 玩家列表 ---- */
.players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 6px;
}

.player {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 700;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
}

.player.empty { color: var(--faint); font-weight: 500; }

.player .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .18);
}

.player.off .dot { background: #cbd5e1; box-shadow: none; }

.player .tag {
  font-size: 11px;
  color: var(--accent-deep);
  background: #e0f2fe;
  padding: 2px 7px;
  border-radius: 999px;
}

/* ---- 顶栏 & 计时 ---- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.roundtag {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-deep);
  background: #e0f2fe;
  padding: 6px 13px;
  border-radius: 999px;
}

.timertext { font-size: 15px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.timertext.warn { color: var(--rose); }

.timer {
  height: 6px;
  border-radius: 999px;
  background: #eaf0f8;
  overflow: hidden;
  margin-bottom: 6px;
}

.timer i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  transition: width .18s linear;
}

.timer.warn i { background: linear-gradient(90deg, #fb7185, #f43f5e); }

/* ---- 词板 ---- */
.board {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  justify-content: center;
  align-items: center;
  margin: 14px 0;
}

.mult { color: #b6c2d4; font-weight: 700; font-size: 14px; margin: 0 1px; }

.chip {
  --chip-bg: #f1f5f9;
  --chip-fg: #334155;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 16px;
  background: var(--chip-bg);
  border-radius: 18px;
  transition: transform .18s, box-shadow .18s;
}

.chip .chip-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--chip-fg);
  opacity: .62;
}

.chip .chip-word {
  font-size: 17px;
  font-weight: 700;
  color: var(--chip-fg);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip .chip-empty { font-size: 14px; color: var(--chip-fg); opacity: .45; font-weight: 500; }

.board.big .chip { padding: 13px 20px; border-radius: 22px; }
.board.big .chip .chip-word { font-size: 22px; max-width: 180px; }
.board.big .chip .chip-plus { font-size: 13.5px; }

.chip.hit {
  box-shadow: 0 0 0 2.5px var(--chip-fg), 0 10px 22px -10px rgba(30, 60, 120, .4);
  transform: translateY(-2px) scale(1.04);
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1);
}

/* 淡淡的加分：跟在词后面的小字，不用浮层 */
.chip-line {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
}

.chip-plus {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--chip-fg);
  opacity: .45;
  white-space: nowrap;
}

@keyframes pop {
  0% { transform: scale(.86); }
  60% { transform: scale(1.09); }
  100% { transform: translateY(-2px) scale(1.04); }
}

/* 每个玩家的粉彩配色（chip-0 是自己） */
.chip-0, .chip-me { --chip-bg: #e0f2fe; --chip-fg: #075985; }
.chip-1 { --chip-bg: #ede9fe; --chip-fg: #5b21b6; }
.chip-2 { --chip-bg: #ffe4e6; --chip-fg: #9f1239; }
.chip-3 { --chip-bg: #fef3c7; --chip-fg: #92400e; }
.chip-4 { --chip-bg: #d1fae5; --chip-fg: #065f46; }
.chip-5 { --chip-bg: #e0e7ff; --chip-fg: #3730a3; }
.chip-6 { --chip-bg: #ccfbf1; --chip-fg: #115e59; }
.chip-7 { --chip-bg: #fae8ff; --chip-fg: #86198f; }

/* ---- 状态 ---- */
.verdict {
  display: inline-block;
  margin: 10px 0 4px;
  padding: 9px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .14em;
  text-indent: .14em;
}

.verdict.miss { background: #eef2f7; color: #64748b; }

.verdict.hit {
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
  box-shadow: 0 16px 36px -12px rgba(99, 102, 241, .65);
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1);
}

/* 长句判定语（赢家的专属发言） */
.verdict.long {
  font-size: 13.5px;
  letter-spacing: .03em;
  text-indent: .03em;
  padding: 10px 22px;
}

.bigword {
  font-size: 27px;
  font-weight: 700;
  margin: 18px 0 6px;
  word-break: break-all;
}

.waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 4px;
  font-size: 14.5px;
  color: var(--muted);
  font-weight: 600;
}

.dots { display: inline-flex; gap: 4px; }
.dots i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s infinite;
}
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }

@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.statuses { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 12px; }

.pill {
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--faint);
}

.pill.on { background: #e0f2fe; border-color: #bae6fd; color: var(--accent-deep); }

.notice {
  margin: 14px 0 0;
  padding: 10px 14px;
  font-size: 13px;
  color: #92400e;
  background: #fef3c7;
  border-radius: 14px;
}

/* ---- 倒计时 ---- */
.count {
  font-size: 84px;
  font-weight: 700;
  line-height: 1;
  margin: 20px 0 10px;
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pop .4s cubic-bezier(.2, 1.6, .4, 1);
}

/* ---- 历史 ---- */
.history { margin-top: 24px; text-align: left; }

.history h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--faint);
  text-align: center;
}

.hrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 15px;
  margin-bottom: 6px;
  background: var(--soft);
}

.hrow .n { flex: 0 0 58px; font-size: 12px; font-weight: 800; color: var(--faint); }

.hrow .words {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.hrow .words .x { color: #b6c2d4; font-weight: 500; font-size: 12px; }

.hrow.hit {
  background: linear-gradient(90deg, rgba(14, 165, 233, .1), rgba(139, 92, 246, .1));
  border: 1px solid rgba(14, 165, 233, .18);
}

.hrow.hit .n { color: var(--accent-deep); }

/* ---- 大局排行榜 ---- */
.ranks { display: grid; gap: 8px; margin: 16px 0 4px; text-align: left; }

.rank-cap {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--faint);
  text-align: center;
  margin-bottom: 2px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.rank-n {
  flex: 0 0 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.rank-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
}

.rank-score { font-size: 13px; font-weight: 700; color: var(--accent-deep); white-space: nowrap; }

/* ---- 揭晓/结束 ---- */
.roundbtns { display: grid; gap: 10px; margin-top: 16px; }

/* ---- 快捷表情 ---- */
/* 表情用 Google 安卓那套（官方 64px PNG 图片渲染，所有设备风格一致） */
.reactbar {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.reactbar button {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 23px;
  line-height: 1;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: transform .12s, border-color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}

.reactbar button:hover { transform: translateY(-2px) scale(1.06); border-color: #bae6fd; }
.reactbar button:active { transform: scale(.88); }

.react-img { width: 25px; height: 25px; display: block; }

#floats {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 55;
  overflow: hidden;
}

.float-react {
  position: absolute;
  bottom: -70px;
  display: flex;
  align-items: center;
  gap: 7px;
  transform: rotate(var(--tilt, 0deg));
  animation: floatUp 2.6s ease-out forwards;
  will-change: transform, opacity;
}

.float-react .fr-img { width: 42px; height: 42px; display: block; }

.float-react .fr-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(.7) rotate(var(--tilt)); opacity: 0; }
  10% { transform: translateY(-5vh) scale(1.08) rotate(var(--tilt)); opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translateY(-74vh) scale(1) rotate(var(--tilt)); opacity: 0; }
}

/* ---- Toast ---- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  max-width: min(86vw, 420px);
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(23, 32, 54, .92);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 60;
  text-align: center;
}

#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- 战报弹层 ---- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .2s;
}

.sheet.on { opacity: 1; }

.sheet-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: min(92vw, 420px);
  max-height: 88vh;
  overflow: auto;
  padding: 18px;
  background: #fff;
  border-radius: 24px;
}

.sheet-card img { width: 100%; border-radius: 14px; box-shadow: 0 10px 30px -12px rgba(2, 60, 120, .35); }
.sheet-tip { margin: 0; font-size: 12.5px; color: var(--faint); }

/* ---- 撒花画布 ---- */
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ---- 小屏 ---- */
@media (max-width: 420px) {
  .card { padding: 28px 20px 24px; border-radius: 24px; }
  .title { font-size: 28px; }
  .code { font-size: 32px; }
  .count { font-size: 76px; }
}
