/* 「异口同声」联机版样式 · 复用单机版设计令牌（:root 变量取自 theme.css） */
:root {
  --bg: #fff4ec;
  --bg-soft: #fdeee2;
  --card: #ffffff;
  --ink: #4a3b34;
  --ink-soft: #8a766b;
  --primary: #ff7a9c;
  --primary-deep: #ef5f88;
  --primary-soft: #ffe3ec;
  --accent: #ffb86b;
  --line: #f2ddcf;
  --ok: #46b39a;
  --warn: #e8895b;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(190, 120, 110, 0.14);
  --shadow-soft: 0 4px 14px rgba(190, 120, 110, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: radial-gradient(120% 80% at 50% 0%, #fff9f4 0%, var(--bg) 55%, var(--bg-soft) 100%);
  color: var(--ink);
  line-height: 1.5;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button { font-family: inherit; cursor: pointer; border: none; }
input { font-family: inherit; }

.ol-app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* 顶栏 */
.ol-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 8px;
}
.ol-brand { display: flex; align-items: center; gap: 10px; }
.ol-logo { font-size: 30px; }
.ol-brand-text h1 { font-size: 20px; letter-spacing: 1px; }
.ol-brand-text p { font-size: 12px; color: var(--ink-soft); }
.ol-btn-ghost {
  background: transparent; color: var(--ink-soft); font-size: 13px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
}
.ol-btn-ghost:active { background: var(--bg-soft); }

.ol-main { flex: 1; padding: 12px 18px 28px; }

/* 视图切换 */
.ol-view { display: none; animation: ol-fade 0.28s ease; }
.ol-view-active { display: block; }
@keyframes ol-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ol-hidden { display: none !important; }

/* 卡片 */
.ol-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 20px; margin-top: 14px;
}
.ol-card-center { text-align: center; }
.ol-card-title { font-size: 18px; margin-bottom: 8px; }
.ol-card-desc { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }

/* 表单 */
.ol-field { display: block; margin-bottom: 16px; text-align: left; }
.ol-field-label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 7px; }
.ol-input {
  width: 100%; padding: 13px 15px; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px; outline: none;
  transition: border-color .15s, background .15s;
}
.ol-input:focus { border-color: var(--primary); background: #fff; }
.ol-input-code { letter-spacing: 6px; text-align: center; font-weight: 700; font-size: 20px; text-transform: uppercase; }

/* 按钮 */
.ol-btn-primary {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  border-radius: 14px; box-shadow: 0 6px 16px rgba(239, 95, 136, 0.32);
  transition: transform .1s, opacity .15s;
}
.ol-btn-primary:active { transform: scale(0.98); }
.ol-btn-primary:disabled { opacity: .55; box-shadow: none; }
.ol-btn-secondary {
  width: 100%; padding: 13px; font-size: 15px; font-weight: 600; color: var(--primary-deep);
  background: var(--primary-soft); border-radius: 14px; margin-top: 4px;
}
.ol-btn-secondary:active { background: #ffd3e0; }
.ol-btn-mini {
  padding: 5px 12px; font-size: 12px; color: var(--primary-deep);
  background: var(--primary-soft); border-radius: 999px;
}
.ol-lobby-actions { margin-bottom: 4px; }

.ol-divider { display: flex; align-items: center; text-align: center; margin: 22px 0 18px; color: var(--ink-soft); font-size: 12px; }
.ol-divider::before, .ol-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ol-divider span { padding: 0 12px; }
.ol-foot-note { text-align: center; font-size: 11px; color: var(--ink-soft); margin-top: 22px; opacity: .8; }

/* 等待视图 */
.ol-roomcode-box { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 8px; }
.ol-roomcode {
  font-size: 38px; font-weight: 800; letter-spacing: 8px; color: var(--primary-deep);
  background: var(--primary-soft); padding: 10px 18px; border-radius: 16px;
}
.ol-wait-pulse { display: flex; justify-content: center; gap: 6px; margin: 22px 0 10px; }
.ol-wait-pulse span {
  width: 9px; height: 9px; border-radius: 50%; background: var(--primary);
  animation: ol-bounce 1.2s infinite ease-in-out;
}
.ol-wait-pulse span:nth-child(2) { animation-delay: .18s; }
.ol-wait-pulse span:nth-child(3) { animation-delay: .36s; }
@keyframes ol-bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.ol-wait-status { font-size: 13px; color: var(--ink-soft); }

/* 对局 */
.ol-play-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 0; }
.ol-round-info { font-size: 15px; font-weight: 700; }
.ol-round-now { color: var(--primary-deep); font-size: 18px; }
.ol-round-sep { color: var(--ink-soft); margin: 0 3px; }
.ol-round-max { color: var(--ink-soft); }
.ol-room-inline { font-size: 12px; color: var(--ink-soft); background: var(--card); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }

.ol-players { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0; }
.ol-player {
  flex: 1; background: var(--card); border-radius: 16px; box-shadow: var(--shadow-soft);
  padding: 14px 10px; text-align: center;
}
.ol-player-name { display: block; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.ol-player-state { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.ol-state-wait { background: var(--bg-soft); color: var(--ink-soft); }
.ol-state-done { background: rgba(70, 179, 154, .14); color: var(--ok); }
.ol-state-me { background: var(--primary-soft); color: var(--primary-deep); }
.ol-vs { font-size: 13px; font-weight: 800; color: var(--accent); }

/* 揭晓 */
.ol-badge {
  display: inline-block; padding: 6px 18px; border-radius: 999px; font-size: 14px; font-weight: 700;
  margin-bottom: 18px;
}
.ol-badge.rb-exact, .ol-badge.rb-high, .ol-badge.rb-medium { background: rgba(70, 179, 154, .15); color: var(--ok); }
.ol-badge.rb-far, .ol-badge.rb-off { background: rgba(232, 137, 91, .16); color: var(--warn); }
.ol-reveal-words { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; }
.ol-reveal-word { flex: 1; background: var(--bg); border-radius: 16px; padding: 16px 8px; }
.ol-reveal-name { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.ol-reveal-text { display: block; font-size: 22px; font-weight: 800; color: var(--ink); word-break: break-all; }
.ol-reveal-heart { font-size: 24px; }
.ol-reveal-narration { font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; }
.ol-punish {
  background: #fff5e8; border: 1px dashed var(--accent); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 18px; text-align: left;
}
.ol-punish-label { display: block; font-size: 12px; color: var(--warn); font-weight: 700; margin-bottom: 4px; }
.ol-punish-text { font-size: 14px; color: var(--ink); }

/* 结算 */
.ol-result-emoji { font-size: 54px; margin-bottom: 6px; }
.ol-round-list { margin: 18px 0; text-align: left; }
.ol-round-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; font-size: 14px;
}
.ol-round-item .ol-rr-tag { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.ol-rr-win { background: rgba(70, 179, 154, .15); color: var(--ok); }
.ol-rr-lose { background: rgba(232, 137, 91, .16); color: var(--warn); }
.ol-round-item .ol-rr-words { color: var(--ink-soft); font-size: 13px; }
.ol-round-list .ol-btn-secondary { margin-top: 10px; }

/* Toast */
.ol-toast {
  position: fixed; left: 50%; bottom: 12%; transform: translateX(-50%) translateY(20px);
  background: rgba(74, 59, 52, .92); color: #fff; font-size: 14px; padding: 11px 20px;
  border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 84%; text-align: center; z-index: 99;
}
.ol-toast.ol-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ol-toast.ol-toast-error { background: rgba(214, 84, 84, .95); }
