:root {
  color-scheme: dark;
  --bg: #0d0c13;
  --panel: rgba(29, 27, 39, 0.9);
  --panel-2: #242130;
  --line: rgba(255,255,255,.1);
  --text: #f7f3eb;
  --muted: #aaa4b3;
  --accent: #e2b66f;
  --accent-2: #f3d9a6;
  --danger: #dc7777;
  --success: #85c59c;
  --shadow: 0 18px 60px rgba(0,0,0,.34);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(125, 81, 145, .24), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(180, 116, 61, .16), transparent 30%),
    var(--bg);
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(100%, 680px); min-height: 100vh; margin: 0 auto; padding: 22px 18px calc(34px + env(safe-area-inset-bottom)); }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.brand { display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.08em; }
.brand-mark { width:38px; height:38px; display:grid; place-items:center; border-radius:13px; background:linear-gradient(145deg,#f0c981,#9c6735); color:#1a120b; box-shadow:0 8px 30px rgba(226,182,111,.2); }
.ghost-button, .icon-button { border:1px solid var(--line); color:var(--text); background:rgba(255,255,255,.04); border-radius:12px; padding:10px 13px; cursor:pointer; }
.hero { padding:34px 8px 26px; }
.eyebrow { color:var(--accent); font-size:12px; letter-spacing:.22em; font-weight:800; text-transform:uppercase; }
h1 { font-size:clamp(34px,10vw,58px); line-height:1.05; margin:13px 0 17px; letter-spacing:-.045em; }
.hero p { margin:0; max-width:520px; color:var(--muted); font-size:16px; line-height:1.75; }
.hero-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:25px; }
.stat { padding:14px 8px; text-align:center; border:1px solid var(--line); background:rgba(255,255,255,.035); border-radius:15px; }
.stat strong { display:block; font-size:18px; color:var(--accent-2); }
.stat span { display:block; margin-top:4px; color:var(--muted); font-size:11px; }
.panel { border:1px solid var(--line); background:var(--panel); border-radius:22px; padding:18px; box-shadow:var(--shadow); backdrop-filter: blur(16px); }
.panel + .panel { margin-top:14px; }
.action-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.action-card { border:1px solid var(--line); min-height:152px; padding:18px; border-radius:19px; text-align:left; color:var(--text); cursor:pointer; background:linear-gradient(150deg,rgba(255,255,255,.08),rgba(255,255,255,.025)); }
.action-card.primary { background:linear-gradient(145deg,#e6bd78,#a86f3d); color:#1b130d; border:0; }
.action-icon { display:block; font-size:30px; margin-bottom:21px; }
.action-card strong { display:block; font-size:19px; }
.action-card span:last-child { display:block; margin-top:7px; font-size:12px; opacity:.72; line-height:1.5; }
.section-title { margin:8px 0 14px; font-size:20px; }
.form-group { margin-bottom:16px; }
.label { display:block; color:var(--muted); font-size:13px; margin-bottom:8px; }
.input { width:100%; border:1px solid var(--line); border-radius:14px; padding:14px 15px; color:var(--text); background:#15131d; outline:none; }
.input:focus { border-color:rgba(226,182,111,.7); box-shadow:0 0 0 3px rgba(226,182,111,.1); }
.room-code-input { text-align:center; font-size:28px; letter-spacing:.22em; font-weight:800; padding-left:calc(15px + .22em); }
.button { width:100%; border:0; border-radius:15px; padding:14px 16px; cursor:pointer; font-weight:800; color:#1c140d; background:linear-gradient(145deg,#f1cd8d,#bd8146); box-shadow:0 10px 28px rgba(190,129,70,.19); }
.button:disabled { opacity:.42; cursor:not-allowed; box-shadow:none; }
.button.secondary { color:var(--text); border:1px solid var(--line); background:rgba(255,255,255,.055); box-shadow:none; }
.button.danger { color:#ffeaea; background:rgba(220,119,119,.16); border:1px solid rgba(220,119,119,.35); box-shadow:none; }
.button-row { display:flex; gap:10px; }
.script-list { display:grid; gap:12px; }
.script-card { display:grid; grid-template-columns:58px 1fr auto; align-items:center; gap:12px; width:100%; color:var(--text); border:1px solid var(--line); background:rgba(255,255,255,.035); padding:13px; border-radius:17px; text-align:left; cursor:pointer; }
.script-card.selected { border-color:rgba(226,182,111,.7); background:rgba(226,182,111,.09); box-shadow:0 0 0 3px rgba(226,182,111,.07); }
.script-emoji { width:58px; height:58px; border-radius:16px; display:grid; place-items:center; font-size:28px; background:#15131d; }
.script-info strong { display:block; font-size:16px; }
.script-info p { margin:6px 0; color:var(--muted); font-size:12px; line-height:1.45; }
.tags { display:flex; flex-wrap:wrap; gap:5px; }
.tag { font-size:10px; color:var(--accent-2); border:1px solid rgba(226,182,111,.23); border-radius:999px; padding:4px 7px; background:rgba(226,182,111,.07); }
.check { font-size:20px; color:var(--accent); }
.room-head { text-align:center; padding:7px 0 20px; }
.room-label { color:var(--muted); font-size:12px; letter-spacing:.16em; }
.room-code { font-size:42px; font-weight:900; letter-spacing:.15em; margin:5px 0 6px; padding-left:.15em; }
.room-title { color:var(--accent-2); font-weight:700; }
.share-box { display:flex; gap:8px; }
.share-link { min-width:0; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border:1px solid var(--line); background:#15131d; border-radius:12px; padding:11px 12px; color:var(--muted); font-size:12px; }
.player-list { display:grid; gap:9px; }
.player { display:flex; align-items:center; gap:11px; padding:11px 12px; border-radius:14px; background:rgba(255,255,255,.035); border:1px solid transparent; }
.player.me { border-color:rgba(226,182,111,.28); }
.avatar { width:38px; height:38px; display:grid; place-items:center; border-radius:50%; background:linear-gradient(145deg,#373141,#1c1924); color:var(--accent-2); font-weight:800; }
.player-main { min-width:0; flex:1; }
.player-name { font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.player-meta { color:var(--muted); font-size:11px; margin-top:3px; }
.status-dot { width:9px; height:9px; border-radius:50%; background:#5e5965; }
.status-dot.ready { background:var(--success); box-shadow:0 0 10px rgba(133,197,156,.45); }
.notice { color:var(--muted); line-height:1.65; font-size:13px; padding:13px 14px; background:rgba(255,255,255,.035); border-radius:14px; border-left:3px solid var(--accent); }
.progress-track { height:4px; background:rgba(255,255,255,.08); border-radius:99px; overflow:hidden; margin:12px 0 18px; }
.progress-value { height:100%; background:linear-gradient(90deg,#a86f3d,#efd08f); }
.stage-head { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; }
.stage-kicker { color:var(--accent); font-weight:800; font-size:12px; }
.stage-title { margin:5px 0 0; font-size:28px; }
.timer { flex:0 0 auto; min-width:76px; padding:10px; border-radius:14px; text-align:center; background:#15131d; border:1px solid var(--line); }
.timer strong { display:block; font-size:20px; font-variant-numeric:tabular-nums; }
.timer span { color:var(--muted); font-size:10px; }
.story { white-space:pre-wrap; color:#d8d2dc; font-size:14px; line-height:1.8; }
.role-cover { text-align:center; padding:26px 12px; }
.role-seal { width:70px; height:70px; display:grid; place-items:center; margin:0 auto 15px; border-radius:50%; border:1px solid rgba(226,182,111,.32); background:rgba(226,182,111,.08); font-size:30px; }
.role-cover p { color:var(--muted); line-height:1.7; }
.role-name { color:var(--accent-2); font-size:30px; margin:0 0 5px; }
.role-identity { color:var(--muted); margin-bottom:19px; }
.secret-box { padding:15px; border-radius:15px; background:rgba(220,119,119,.08); border:1px solid rgba(220,119,119,.2); line-height:1.75; font-size:14px; }
.subheading { font-size:14px; color:var(--accent-2); margin:18px 0 9px; }
.timeline { margin:0; padding-left:20px; color:#d8d2dc; line-height:1.75; font-size:14px; }
.clue-list { display:grid; gap:10px; counter-reset:clue; }
.clue { position:relative; padding:14px 14px 14px 48px; background:rgba(255,255,255,.045); border:1px solid var(--line); border-radius:15px; line-height:1.7; font-size:14px; }
.clue::before { counter-increment:clue; content:counter(clue); position:absolute; left:14px; top:14px; width:24px; height:24px; border-radius:8px; display:grid; place-items:center; color:#1a120b; background:var(--accent); font-weight:900; font-size:12px; }
.vote-list { display:grid; gap:9px; }
.vote-option { display:flex; align-items:center; gap:12px; width:100%; color:var(--text); text-align:left; padding:12px; border-radius:15px; border:1px solid var(--line); background:rgba(255,255,255,.035); cursor:pointer; }
.vote-option.selected { border-color:var(--accent); background:rgba(226,182,111,.1); }
.vote-radio { width:20px; height:20px; border-radius:50%; border:2px solid #736c79; }
.vote-option.selected .vote-radio { border:6px solid var(--accent); }
.result-culprit { text-align:center; padding:22px 10px; }
.result-culprit .emoji { font-size:48px; }
.result-culprit h2 { margin:8px 0 5px; font-size:32px; color:var(--accent-2); }
.evidence-list { padding-left:20px; line-height:1.75; color:#d9d3dc; }
.vote-result { display:grid; gap:8px; }
.vote-row { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; padding:11px 12px; border-radius:13px; background:rgba(255,255,255,.035); }
.vote-row.culprit { border:1px solid rgba(220,119,119,.35); background:rgba(220,119,119,.08); }
.vote-count { color:var(--accent-2); font-weight:800; }
.sticky-actions { position:sticky; bottom:calc(10px + env(safe-area-inset-bottom)); margin-top:18px; padding:10px; border-radius:19px; background:rgba(13,12,19,.86); border:1px solid var(--line); backdrop-filter:blur(18px); box-shadow:0 14px 44px rgba(0,0,0,.35); }
.empty { text-align:center; color:var(--muted); padding:30px 10px; }
.toast { position:fixed; z-index:10; left:50%; bottom:calc(24px + env(safe-area-inset-bottom)); transform:translate(-50%,20px); max-width:calc(100vw - 34px); padding:11px 15px; border-radius:12px; background:#f5eee3; color:#21180f; opacity:0; pointer-events:none; transition:.22s ease; box-shadow:var(--shadow); font-size:13px; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.toast.error { background:#ffdddd; color:#431d1d; }
.small { font-size:12px; color:var(--muted); line-height:1.6; }
.divider { height:1px; background:var(--line); margin:17px 0; }
@media (max-width:420px) {
  .app-shell { padding-left:14px; padding-right:14px; }
  .action-grid { grid-template-columns:1fr; }
  .action-card { min-height:120px; }
  .action-icon { margin-bottom:12px; }
  .room-code { font-size:37px; }
}
.ai-panel { overflow:hidden; }
.ai-title { margin:4px 0 0; }
.ai-description { margin:10px 0 0; }
.ai-status-line { display:flex; justify-content:space-between; gap:12px; margin-bottom:16px; color:var(--muted); font-size:11px; }
.form-row { display:grid; grid-template-columns:1.5fr .8fr; gap:10px; }
.select-input { appearance:none; background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position:calc(100% - 18px) 50%,calc(100% - 13px) 50%; background-size:5px 5px,5px 5px; background-repeat:no-repeat; padding-right:38px; }
.textarea { min-height:92px; resize:vertical; line-height:1.6; }
.field-help { margin-top:7px; color:var(--muted); font-size:11px; line-height:1.55; }
.ai-tag { color:#a9c7ff; border-color:rgba(130,170,255,.28); background:rgba(130,170,255,.08); }
.ai-generate-button { display:flex; align-items:center; justify-content:center; gap:8px; }
.generation-note { margin-top:10px; text-align:center; color:var(--muted); font-size:11px; line-height:1.55; }
.spinner { width:16px; height:16px; border:2px solid rgba(28,20,13,.28); border-top-color:#1c140d; border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (max-width:420px) {
  .form-row { grid-template-columns:1fr; gap:0; }
  .ai-status-line { flex-direction:column; gap:4px; }
}
