:root {
  --ink: #111827;
  --ink-strong: #171727;
  --muted: #625b76;
  --muted-soft: #8a8399;
  --violet: #6947ed;
  --violet-deep: #6442ef;
  --violet-soft: #eee9ff;
  --line: #e5e0ef;
  --teal: #14778c;
  --teal-soft: #e2f8fb;
  --danger: #d84158;
  --card-bg: rgba(255, 255, 255, 0.84);
  --radius-card: 30px;
  --shadow-card: 0 28px 80px rgba(66, 43, 124, 0.11), inset 0 1px 0 #fff;
  --font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: #f7f7fb;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.shell {
  position: relative;
  min-height: 100vh;
  padding: 20px 28px 28px;
  background:
    radial-gradient(circle at 12% 8%, #f0e7ff 0, rgba(240, 231, 255, 0) 34%),
    radial-gradient(circle at 90% 82%, #dff7ff 0, rgba(223, 247, 255, 0) 30%),
    #f7f7fb;
  overflow-x: hidden;
}

.shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(116, 98, 162, 0.031) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116, 98, 162, 0.031) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0;
}

.frame {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  min-height: calc(100vh - 48px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

button { font: inherit; cursor: pointer; }

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(121, 89, 238, 0.45);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: 0.58; }
input { font: inherit; }

/* ---------- 顶部 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: #151525;
  box-shadow: 0 8px 24px rgba(29, 29, 53, 0.17);
  flex: none;
}

.logo-mark span {
  position: absolute;
  top: 12px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.logo-mark span:first-child { left: 7px; background: #9f78ff; }
.logo-mark span:last-child { right: 7px; background: #64d8ed; mix-blend-mode: screen; }

.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 18px; font-weight: 900; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: #8b8499; margin-top: 2px; }

.topbar-right { display: inline-flex; align-items: center; gap: 8px; }

.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #fff;
  box-shadow: 0 8px 22px rgba(79, 58, 134, 0.07);
  font-size: 12.5px;
  font-weight: 800;
  color: #4b455c;
  letter-spacing: 0.02em;
}

.room-chip svg { width: 14px; height: 14px; color: #7b6aa8; }

.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #e7f8ef;
  color: #17915c;
  font-size: 12px;
  font-weight: 800;
}

.conn i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(23, 145, 92, 0.14); }
.conn.is-reconnecting { background: #fff4dd; color: #b4790e; }
.conn.is-offline { background: #ffecef; color: var(--danger); }

/* ---------- 首页 ---------- */
.main { flex: 1; display: flex; flex-direction: column; }

.home {
  flex: 1;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  align-items: center;
  gap: 44px;
  padding: 44px 0 56px;
}

.hero-title {
  margin: 20px 0 0;
  font-size: clamp(2.5rem, 4.4vw, 3.6rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.045em;
  color: #0d0d19;
}

.gradient-text {
  background: linear-gradient(100deg, #6b45f4, #b25ce6 55%, #2699bc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  margin: 24px 0 0;
  max-width: 470px;
  font-size: 16.5px;
  line-height: 1.75;
  color: #5d576e;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--violet);
}

.eyebrow svg { width: 15px; height: 15px; }

.features { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

.feature {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #fff;
  box-shadow: 0 8px 25px rgba(79, 58, 134, 0.06);
  font-size: 12.5px;
  font-weight: 600;
  color: #57516a;
}

.feature svg { width: 15px; height: 15px; color: #6f5a9e; }

/* ---------- 卡片 ---------- */
.game-card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.lobby-card { padding: 30px 30px 26px; width: 100%; max-width: 408px; justify-self: end; }

.card-title { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -0.03em; }
.card-sub { margin: 8px 0 24px; font-size: 13px; color: #7c7688; line-height: 1.6; }

.field { margin-bottom: 18px; }

.field-label {
  display: block;
  margin-bottom: 9px;
  font-size: 12.5px;
  font-weight: 800;
  color: #514b63;
}

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segmented.two { grid-template-columns: repeat(2, 1fr); }

.seg-option {
  min-height: 44px;
  padding: 0 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 800;
  transition: all 0.18s ease;
}

.seg-option:hover { border-color: #cfc6e4; }

.seg-option.selected {
  color: #6245dc;
  background: #f1edff;
  border-color: #7959ee;
  box-shadow: 0 0 0 3px rgba(121, 89, 238, 0.086);
}

.custom-duration {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: #625b76;
}

.duration-input {
  width: 86px;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid #ded9ea;
  background: #fff;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: #28233a;
  outline: none;
  transition: all 0.18s ease;
}

.duration-input:focus { border-color: #7959ee; box-shadow: 0 0 0 4px rgba(121, 89, 238, 0.094); }

.hint { font-size: 11.5px; font-weight: 500; color: #a29caf; }
.hint-line { margin: 9px 0 0; font-size: 11.5px; color: #8a8399; }

.primary-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(110deg, #6442ef, #9060f4);
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  box-shadow: 0 11px 26px rgba(104, 69, 231, 0.23);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 15px 32px rgba(104, 69, 231, 0.3); }
.primary-btn:active:not(:disabled) { transform: translateY(0); }
.primary-btn svg { width: 18px; height: 18px; }

.create-btn { width: 100%; margin-top: 4px; }

.or {
  position: relative;
  margin: 20px 0 16px;
  text-align: center;
  font-size: 11.5px;
  color: #a8a2b4;
}

.or::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #ece8f3;
}

.or span { position: relative; padding: 0 10px; background: #fbfaff; }

.code-row { display: flex; gap: 8px; }

.code-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 15px;
  border-radius: 13px;
  border: 1px solid #ded9ea;
  background: #fff;
  color: #28233a;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  outline: none;
  transition: all 0.18s ease;
}

.code-input::placeholder { color: #c3bdcd; font-weight: 700; letter-spacing: 0.1em; }
.code-input:focus { border-color: #7959ee; box-shadow: 0 0 0 4px rgba(121, 89, 238, 0.094); }

.go-btn {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: #171727;
  color: #fff;
  transition: background 0.18s ease, transform 0.18s ease;
}

.go-btn:hover { background: #2b2540; transform: translateY(-1px); }
.go-btn svg { width: 18px; height: 18px; }

.closed-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 13px;
  background: #f2edff;
  color: #9b8fc4;
  font-size: 12.5px;
  font-weight: 700;
}

.closed-pill svg { width: 15px; height: 15px; }

.form-error {
  margin: 12px 0 0;
  min-height: 0;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--danger);
}

.form-error:empty { display: none; }

.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 4px;
  font-size: 11.5px;
  color: #9c96a8;
}

.foot-dot { opacity: 0.5; }

/* ---------- 加入房间 ---------- */
.join-view { flex: 1; display: grid; place-items: center; padding: 40px 0; }
.join-card { width: min(100%, 460px); padding: 34px 32px; text-align: center; }
.view-title { margin: 10px 0 0; font-size: 34px; font-weight: 900; letter-spacing: -0.03em; }
.view-sub { margin: 10px 0 24px; font-size: 14px; color: #6f687e; line-height: 1.7; }
.view-sub strong { color: #4b36b8; letter-spacing: 0.1em; }

/* ---------- 对局 ---------- */
.game-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 0 20px;
  gap: 22px;
}

#gameStage { width: 100%; display: flex; justify-content: center; }

.stage-card {
  width: min(100%, 760px);
  overflow: hidden;
  animation: rise 0.34s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

.stage-card.narrow { width: min(100%, 560px); }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.round-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  background: #f6f3ff;
  border-bottom: 1px solid #ebe6fa;
  font-size: 12.5px;
  font-weight: 900;
  color: #625b76;
  letter-spacing: 0.02em;
}

.timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #fff;
  font-variant-numeric: tabular-nums;
  color: #514b63;
}

.timer svg { width: 14px; height: 14px; }
.timer.urgent { color: var(--danger); animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.stage-body { padding: 30px 30px 32px; text-align: center; }

.stage-eyebrow {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--violet);
}

.stage-title {
  margin: 12px 0 0;
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: -0.035em;
  color: #141420;
}

.stage-sub {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: #7c7688;
}

/* 等待 */
.waiting-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 6px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #f7f4ff;
  border: 1px dashed #d9cff5;
}

.waiting-code .code {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.24em;
  color: #4b36b8;
  padding-left: 0.24em;
}

.waiting-code .code-label { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; color: #9b93ac; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  margin-top: 14px;
  border: 0;
  border-radius: 13px;
  background: #eee9ff;
  color: #5e42d6;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.18s ease;
}

.copy-btn:hover { background: #e5ddff; transform: translateY(-1px); }
.copy-btn svg { width: 15px; height: 15px; }

.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }

.slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #ece8f3;
  font-size: 12.5px;
  font-weight: 700;
  color: #6f687e;
}

.slot.filled { border-color: #ded4fb; background: #faf8ff; color: #4c3c8e; }
.slot .dot { width: 7px; height: 7px; border-radius: 50%; background: #d9d3e4; }
.slot.filled .dot { background: #7c5cf0; box-shadow: 0 0 0 3px rgba(124, 92, 240, 0.13); }
.slot .you { font-size: 10.5px; font-weight: 900; color: #7c5cf0; }

/* 思考 */
.word-input {
  width: 100%;
  height: 76px;
  margin-top: 24px;
  padding: 0 24px;
  border-radius: 20px;
  border: 1px solid #ded9ea;
  background: #fff;
  text-align: center;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: 900;
  color: #1c1630;
  outline: none;
  transition: all 0.18s ease;
}

.word-input::placeholder { color: #bdb6c9; font-weight: 700; }
.word-input:focus { border-color: #7959ee; box-shadow: 0 0 0 4px rgba(121, 89, 238, 0.094); }
.word-input:disabled { background: #faf9fd; color: #6d6582; }

.submit-btn { width: 100%; margin-top: 14px; }

.locked-box {
  margin-top: 22px;
  padding: 20px;
  border-radius: 18px;
  background: #f7f4ff;
  border: 1px solid #e9e2fb;
}

.locked-word {
  font-size: 30px;
  font-weight: 900;
  color: #4b36b8;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.locked-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #8b84a0;
}

.locked-hint svg { width: 14px; height: 14px; }
.locked-hint.ready { color: #17915c; }

.spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.last-words { margin-top: 20px; font-size: 12px; color: #9c96a8; }
.last-words b { color: #6a5f86; font-weight: 800; }

/* 揭晓 */
.reveal-grid {
  display: grid;
  grid-template-columns: 1fr 42px 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

.reveal-grid.three { grid-template-columns: 1fr 24px 1fr 24px 1fr; }

.reveal-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 128px;
  padding: 20px 12px;
  border-radius: 20px;
  background: #eee9ff;
  color: #5b3dda;
  animation: pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.reveal-player.tone-2 { background: var(--teal-soft); color: var(--teal); }
.reveal-player.tone-3 { background: #fff1df; color: #b56819; }
.reveal-player:nth-child(3) { animation-delay: 0.06s; }
.reveal-player:nth-child(5) { animation-delay: 0.12s; }

@keyframes pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.reveal-player .who { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; opacity: 0.62; }
.reveal-player .word {
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  word-break: break-word;
}

.meet-mark { font-size: 22px; font-weight: 900; color: #a29aaf; }

.reveal-prompt { margin: 22px 0 0; font-size: 12.5px; line-height: 1.7; color: #7c7688; }

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: #eee9ff;
  color: #5e42d6;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.18s ease;
}

.secondary-btn:hover:not(:disabled) { background: #e5ddff; transform: translateY(-1px); }
.secondary-btn svg { width: 16px; height: 16px; }

.actions .primary-btn { min-height: 48px; font-size: 13.5px; }

.match-strip { margin-top: 24px; }

.match-strip p { margin: 0 0 16px; font-size: 12.5px; line-height: 1.6; color: #7c7688; text-align: center; }
.match-strip .actions { margin-top: 0; }

/* 成功 */
.win-card { box-shadow: 0 28px 90px rgba(99, 65, 224, 0.2), 0 0 0 3px rgba(140, 109, 240, 0.15); }

.win-body { position: relative; }
.win-body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(154, 120, 255, 0.16), transparent 34%),
    radial-gradient(circle at 84% 88%, rgba(100, 216, 237, 0.16), transparent 32%);
}

.win-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eafaf2;
  color: #128b58;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.win-kicker svg { width: 15px; height: 15px; flex: none; }

.win-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 8px;
  border: 0;
  background: none;
  color: #8a83a0;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.link-btn:hover { color: #5f5780; }

/* 回合回顾 */
.trail { width: min(100%, 760px); }
.trail-title { font-size: 11px; font-weight: 900; letter-spacing: 0.16em; color: #9c96a8; text-align: center; }
.trail-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }

.trail-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #fff;
  font-size: 12px;
  font-weight: 700;
  color: #6f687e;
  box-shadow: 0 6px 18px rgba(79, 58, 134, 0.05);
}

.trail-item .num { color: #a29caf; font-weight: 800; }
.trail-item .sep { color: #cfc9da; }

/* 连接提示 */
.connection-banner {
  margin: 14px auto 0;
  width: min(100%, 760px);
  padding: 10px 16px;
  border-radius: 12px;
  background: #fff6e5;
  color: #9a6a10;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* ---------- 预览 ---------- */
.preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(23, 23, 39, 0.68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.preview-backdrop[hidden] { display: none; }

.preview-modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 680px);
  max-height: min(92vh, 900px);
  padding: 20px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 100px rgba(17, 24, 39, 0.3);
  overflow: hidden;
}

.preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.preview-head h3 { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: -0.02em; }
.preview-head p { margin: 5px 0 0; font-size: 12.5px; color: #7c7688; }

.preview-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: #f2f0f7;
  color: #59536b;
  font-size: 24px;
  line-height: 1;
}

.preview-image-wrap {
  flex: 1;
  min-height: 0;
  margin-top: 16px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #ebe7f3;
  background: #f3f1f7;
  overflow: auto;
  text-align: center;
}

.preview-image-wrap img { display: block; width: min(100%, 540px); height: auto; margin: 0 auto; border-radius: 10px; }

.preview-actions { display: flex; flex-direction: row-reverse; gap: 10px; margin-top: 16px; }
.preview-actions .primary-btn { min-height: 46px; font-size: 13.5px; }
.preview-actions .secondary-btn { margin-inline: 0; }
.preview-note { margin: 10px 0 0; font-size: 12px; color: #7c7688; text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  max-width: min(92vw, 460px);
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(23, 23, 39, 0.94);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
}

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

[hidden] { display: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .shell { padding: 16px 18px 22px; }
  .home { grid-template-columns: 1fr; gap: 30px; padding: 26px 0 40px; }
  .lobby-card { justify-self: stretch; max-width: none; }
  .hero-desc { font-size: 15px; }
  .hero-title { font-size: clamp(2.2rem, 8vw, 3rem); }
  .features { margin-top: 22px; }
}

@media (max-width: 380px) {
  .brand-sub { display: none; }
  .conn span { display: none; }
  .conn { padding: 8px; }
}

@media (max-width: 560px) {
  .shell { padding: 14px 14px 20px; }
  .frame { min-height: calc(100vh - 30px); }
  .brand-name { font-size: 16px; }
  .brand-sub { font-size: 9.5px; }
  .logo-mark { width: 34px; height: 34px; border-radius: 12px; }
  .logo-mark span { top: 11px; width: 12px; height: 12px; }
  .logo-mark span:first-child { left: 6px; }
  .logo-mark span:last-child { right: 6px; }
  .room-chip { padding: 7px 10px; font-size: 11.5px; }
  .conn { padding: 7px 9px; font-size: 11px; }
  .lobby-card { padding: 24px 20px 22px; border-radius: 24px; }
  .card-title { font-size: 23px; }
  .stage-body { padding: 24px 18px 26px; }
  .stage-title { font-size: 1.75rem; }
  .round-topbar { padding: 14px 16px; }
  .reveal-grid { grid-template-columns: 1fr 26px 1fr; gap: 4px; }
  .reveal-grid.three { grid-template-columns: 1fr; gap: 8px; }
  .reveal-grid.three .meet-mark { display: none; }
  .reveal-player { min-height: 100px; padding: 16px 8px; }
  .reveal-player .word { font-size: 1.55rem; }
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .actions .primary-btn, .actions .secondary-btn { width: 100%; }
  .waiting-code .code { font-size: 25px; }
  .win-actions { flex-direction: column; align-items: stretch; }
  .win-actions .primary-btn, .win-actions .secondary-btn { width: 100%; }
  .foot { flex-wrap: wrap; gap: 5px; font-size: 10.5px; }
  .preview-actions { flex-direction: column-reverse; }
  .preview-actions .primary-btn, .preview-actions .secondary-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
