/* ======================================================
   同词相遇 · 样式
   风格：柔和紫罗兰 · 玻璃卡片 · 轻盈留白
   ====================================================== */

:root {
  --ink:        #1c1a2e;
  --ink-2:      #4a4666;
  --ink-3:      #8b86a8;
  --line:       rgba(96, 84, 168, 0.12);
  --line-2:     rgba(96, 84, 168, 0.2);

  --brand:      #6d5efc;
  --brand-2:    #a855f7;
  --brand-soft: #f1efff;
  --accent:     #ff8fb1;
  --ok:         #16b981;

  --card:       rgba(255, 255, 255, 0.74);
  --card-solid: rgba(255, 255, 255, 0.95);

  --radius:     26px;
  --radius-sm:  14px;

  --shadow:     0 24px 60px -32px rgba(72, 55, 158, 0.45),
                0 2px 10px -4px rgba(72, 55, 158, 0.14);
  --shadow-sm:  0 10px 26px -16px rgba(72, 55, 158, 0.5);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: #f7f5ff;
  background-image:
    radial-gradient(1200px 700px at 12% -10%, #efe9ff 0%, transparent 60%),
    radial-gradient(1000px 600px at 92% 0%, #e8f4ff 0%, transparent 55%),
    radial-gradient(900px 700px at 50% 110%, #fff0f6 0%, transparent 60%),
    linear-gradient(180deg, #fbfaff 0%, #f6f4ff 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 背景光斑 */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  animation: float 22s ease-in-out infinite;
}
.bg-blob.b1 { width: 380px; height: 380px; top: -120px; left: -80px; background: #c8bcff; }
.bg-blob.b2 { width: 320px; height: 320px; top: 12%; right: -100px; background: #b9e2ff; animation-delay: -7s; }
.bg-blob.b3 { width: 420px; height: 420px; bottom: -180px; left: 35%; background: #ffd3e6; animation-delay: -13s; }

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(0, 30px, 0) scale(1.06); }
}

/* ---------------- 布局 ---------------- */

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  padding: 0 4px;
}

.brand { display: flex; align-items: center; gap: 13px; }

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 12px 26px -12px rgba(109, 94, 252, 0.9);
  letter-spacing: 0;
  padding-bottom: 1px;
}

.brand-text h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.brand-text p {
  margin: 2px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.net {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
  backdrop-filter: blur(10px);
  transition: color 0.2s;
}
.net i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #c9c4dd;
  box-shadow: 0 0 0 0 rgba(22, 185, 129, 0.4);
}
.net.on { color: var(--ok); }
.net.on i { background: var(--ok); animation: pulseDot 2s infinite; }

@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(22, 185, 129, 0.35); }
  70%  { box-shadow: 0 0 0 8px rgba(22, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 185, 129, 0); }
}

.view { flex: 1; animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hidden { display: none !important; }

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

/* ---------------- 卡片 ---------------- */

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--line);
  pointer-events: none;
}

/* ---------------- 大厅 ---------------- */

.lobby-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 18px;
  align-items: stretch;
}

.hero { padding: 32px 30px 26px; }

.hero-glow {
  position: absolute;
  width: 260px; height: 260px;
  top: -140px; right: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.22), transparent 68%);
  pointer-events: none;
}

.hero h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3.4vw, 31px);
  line-height: 1.34;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, #2b2450 20%, #6d5efc 70%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .sub {
  margin: 0 0 24px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-3);
}

.field { display: block; margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 7px;
  padding-left: 3px;
}

/* ---------------- 输入 & 按钮 ---------------- */

input[type="text"] {
  width: 100%;
  min-width: 0;
  border: 1.5px solid var(--line-2);
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
input[type="text"]::placeholder { color: #b6b1cc; }
input[type="text"]:focus {
  border-color: #a99dff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(139, 123, 255, 0.14);
}
input[type="text"]:disabled {
  background: rgba(246, 245, 252, 0.8);
  color: var(--ink-3);
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #6d5efc 0%, #8f5cf9 52%, #a855f7 100%);
  box-shadow: 0 14px 28px -14px rgba(109, 94, 252, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 20px 34px -14px rgba(109, 94, 252, 1), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn.primary:active { transform: translateY(0) scale(0.985); }
.btn.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.btn.big { width: 100%; padding: 15px 22px; font-size: 16px; margin-top: 4px; }

.btn.ghost {
  background: rgba(255, 255, 255, 0.95);
  color: #574ad6;
  border: 1.5px solid rgba(109, 94, 252, 0.28);
  box-shadow: var(--shadow-sm);
}
.btn.ghost:hover { border-color: rgba(109, 94, 252, 0.55); transform: translateY(-1px); }
.btn.ghost:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: rgba(109, 94, 252, 0.08);
  color: #5d4fe0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}
.mini:hover { background: rgba(109, 94, 252, 0.16); transform: translateY(-1px); }
.mini.quiet { background: transparent; color: var(--ink-3); border: 1px solid var(--line-2); }
.mini.quiet:hover { background: rgba(0, 0, 0, 0.03); color: var(--ink-2); }

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--ink-3);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}
.or::before, .or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}

.join-row { display: flex; gap: 10px; }
.code-input {
  flex: 1;
  letter-spacing: 0.42em !important;
  font-size: 19px !important;
  font-weight: 600;
  text-align: center;
  padding-left: 0.42em !important;
  font-variant-numeric: tabular-nums;
}
.join-row .btn { flex: 0 0 auto; }

.hint {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
  min-height: 0;
}
.hint.tiny { font-size: 11.5px; }
.hint.error { color: #e05b7d; }
.hint.ok { color: var(--ok); }

/* ---------------- 房间列表 ---------------- */

.rooms {
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.section-head.tight { margin-bottom: 10px; }
.section-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.section-head h4 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}

.room-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.room-list::-webkit-scrollbar { width: 5px; }
.room-list::-webkit-scrollbar-thumb { background: rgba(109, 94, 252, 0.2); border-radius: 99px; }

.room-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.16s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
  animation: fadeUp 0.35s ease both;
}
.room-item:hover {
  background: #fff;
  border-color: rgba(109, 94, 252, 0.32);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.room-item.full {
  opacity: 0.55;
  cursor: not-allowed;
}
.room-item.full:hover { transform: none; box-shadow: none; border-color: var(--line); background: rgba(255, 255, 255, 0.72); }

.r-code {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #574ad6;
  font-variant-numeric: tabular-nums;
}
.r-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.r-name {
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r-sub {
  font-size: 11px;
  color: var(--ink-3);
}
.r-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22, 185, 129, 0.12);
  color: #0e9e6e;
  white-space: nowrap;
}
.r-tag.playing { background: rgba(109, 94, 252, 0.12); color: #5d4fe0; }
.r-tag.closed { background: rgba(0, 0, 0, 0.05); color: var(--ink-3); }

.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0;
  min-height: 180px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.9;
}
.empty svg {
  color: #cfc9e8;
  animation: spinSlow 26s linear infinite;
}
@keyframes spinSlow {
  to { transform: rotate(360deg); }
}
.empty-emoji {
  display: block;
  font-size: 26px;
  margin-bottom: 6px;
  color: #cdc7e6;
}
.lobby-foot {
  margin: 16px 0 0;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
  font-size: 11px;
  color: #a9a4c4;
  text-align: center;
  letter-spacing: 0.04em;
}

/* ---------------- 房间页 ---------------- */

.room-card { padding: 24px 26px 22px; }

.room-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line-2);
}

.room-id { display: flex; flex-direction: column; gap: 1px; }
.room-id .label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}
.room-id strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #574ad6, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.round-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #574ad6;
  font-size: 11.5px;
  letter-spacing: 0.08em;
}
.round-chip b {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0 1px;
}

/* 两位玩家 */
.players {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 26px 4px 20px;
}

.player {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.avatar {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, #7c6bff, #a855f7);
  box-shadow: 0 14px 28px -14px rgba(109, 94, 252, 0.95), inset 0 2px 0 rgba(255, 255, 255, 0.3);
  transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative;
}
.avatar.idle {
  background: #ece9f8;
  color: #b3aed0;
  box-shadow: inset 0 0 0 1.5px rgba(150, 140, 200, 0.2);
}
.avatar.thinking { animation: breathe 2.2s ease-in-out infinite; }
.avatar.ready {
  background: linear-gradient(140deg, #16b981, #34d399);
  box-shadow: 0 14px 28px -14px rgba(22, 185, 129, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}
.avatar.win { animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.avatar.offline {
  filter: grayscale(0.85);
  opacity: 0.55;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.045); }
}
@keyframes pop {
  0%   { transform: scale(0.85); }
  55%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.pname {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px;
}
.pstate {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  min-height: 16px;
}
.pstate.on { color: #0e9e6e; }
.pstate.off { color: #d4839c; }

.link {
  flex: 0 0 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-bottom: 26px;
}
.link .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cbc5e4;
  animation: blink 1.6s infinite;
}
.link .dot:nth-child(2) { animation-delay: 0.22s; }
.link .dot:nth-child(3) { animation-delay: 0.44s; }

@keyframes blink {
  0%, 100% { opacity: 0.28; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.1); }
}

/* 舞台 */
.stages {
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(246, 244, 255, 0.85), rgba(255, 255, 255, 0.6));
  border: 1px solid var(--line);
  padding: 22px 20px;
  min-height: 178px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage {
  width: 100%;
  text-align: center;
  animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stage h3 {
  margin: 8px 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.waiting-emoji {
  font-size: 30px;
  color: #b7aef5;
  line-height: 1;
  animation: breathe 3s ease-in-out infinite;
}

.share-box {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  margin: 16px auto 0;
  padding: 7px 8px 7px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line-2);
}
.share-box code {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* 输入词 */
.prompt {
  margin: 4px 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.word-row {
  display: flex;
  gap: 10px;
  max-width: 430px;
  margin: 0 auto;
}
.word-row input {
  flex: 1;
  font-size: 17px;
  text-align: center;
  padding: 14px 16px;
  letter-spacing: 0.06em;
}
.word-row input:disabled { text-align: center; }

/* 未相遇 */
.pair {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  margin: 0 0 14px;
  animation: pairIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes pairIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.pair-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 42%;
}
.pair-label {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}
.pair-word {
  padding: 10px 20px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pair-item.mine .pair-word {
  background: rgba(109, 94, 252, 0.11);
  color: #574ad6;
}
.pair-item.theirs .pair-word {
  background: rgba(255, 143, 177, 0.16);
  color: #c2557a;
}
.pair-vs {
  padding-top: 24px;
  font-size: 15px;
  color: #c9c4dd;
  line-height: 1;
}
.result-title { color: #c2557a !important; }
.result-text {
  margin: 4px 0 14px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.8;
}
.progress {
  max-width: 200px;
  height: 3px;
  margin: 0 auto 10px;
  border-radius: 99px;
  background: rgba(109, 94, 252, 0.14);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #9b8bff, #d09bff);
  transform-origin: left center;
  animation: shrink 3s linear forwards;
}
@keyframes shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* 相遇 */
.win-label {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}
.win-word {
  margin: 8px 0 4px;
  font-size: clamp(38px, 8vw, 56px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, #6d5efc 0%, #a855f7 50%, #ff8fb1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: winPop 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  word-break: break-all;
}
@keyframes winPop {
  0%   { opacity: 0; transform: scale(0.78); filter: blur(3px); }
  55%  { opacity: 1; transform: scale(1.05); filter: blur(0); }
  100% { opacity: 1; transform: scale(1); }
}
.win-title {
  margin: 0 0 6px !important;
  font-size: 15px !important;
  letter-spacing: 0.28em;
  color: #0e9e6e !important;
}
#stageWon { position: relative; }
#stageWon .btn { margin-top: 6px; }

.confetti {
  position: absolute;
  top: -10px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  pointer-events: none;
  animation-name: fall;
  animation-timing-function: cubic-bezier(0.3, 0.6, 0.5, 1);
  animation-fill-mode: forwards;
}
@keyframes fall {
  0%   { opacity: 0; transform: translateY(0) rotate(0); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(190px) rotate(420deg); }
}

/* 历史 */
.history {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-2);
}
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.history-list::-webkit-scrollbar { width: 5px; }
.history-list::-webkit-scrollbar-thumb { background: rgba(109, 94, 252, 0.2); border-radius: 99px; }

.history-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  font-size: 12.5px;
  animation: fadeUp 0.3s ease both;
}
.history-row.matched {
  background: rgba(22, 185, 129, 0.08);
  border-color: rgba(22, 185, 129, 0.28);
}
.h-round {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  min-width: 46px;
}
.chip {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip.mine { background: rgba(109, 94, 252, 0.11); color: #574ad6; }
.chip.theirs { background: rgba(255, 143, 177, 0.16); color: #c2557a; }
.chip.theirs.same { background: rgba(22, 185, 129, 0.13); color: #0e9e6e; }
.h-arrow {
  flex: 0 0 auto;
  font-size: 11px;
  color: #cfc9e8;
  line-height: 1;
}
.h-empty {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: #b3aed0;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(28, 26, 46, 0.92);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 99;
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 40px -20px rgba(28, 26, 46, 0.8);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot {
  margin-top: 26px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #b8b3cd;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 820px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .hero { padding: 26px 22px 22px; }
  .app { padding: 20px 14px 36px; }
  .card { padding: 22px; }
  .room-card { padding: 20px 18px; }
  .room-list { max-height: 240px; }
}

@media (max-width: 420px) {
  .brand-text p { display: none; }
  .players { gap: 0; }
  .avatar { width: 58px; height: 58px; font-size: 21px; }
  .link { flex: 0 0 44px; }
  .word-row { flex-direction: column; }
  .word-row .btn { width: 100%; }
  .join-row { flex-direction: column; }
  .share-box code { font-size: 11px; }
}

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