:root{
  /* 色票取自官網 global.css 的正式 token */
  --accent: #C9A962;        /* --gold */
  --accent-dim: rgba(201,169,98,.14);
  --bg-a: #081f16;          /* --forest-darkest */
  --bg-b: #0D3D2E;          /* --forest */
  --text: #FAF8F5;          /* --cream */
  --text-dim: rgba(250,248,245,.6);
}

*{ margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body{ height:100%; overflow:hidden; }
body{
  /* 與官網同語系:中文襯線 + Cormorant(標題另用 Cinzel) */
  font-family:"Noto Serif TC","Cormorant Garamond",Georgia,"Microsoft JhengHei",serif;
  color:var(--text);
  background: radial-gradient(120% 90% at 50% 18%, var(--bg-b), var(--bg-a) 72%);
  user-select:none;
}
/* 角色背後的光暈與舞台氛圍(金暈 + 官網的翡翠綠點綴) */
body::before{
  content:""; position:fixed; left:50%; top:34%;
  width:min(92vw,600px); aspect-ratio:1; transform:translate(-50%,-50%);
  background:
    radial-gradient(circle at 50% 42%, rgba(201,169,98,.18), transparent 60%),
    radial-gradient(circle at 48% 60%, rgba(42,147,111,.12), transparent 70%);
  pointer-events:none;
}
/* 四周暗角,聚焦角色 */
body::after{
  content:""; position:fixed; inset:0;
  background:radial-gradient(120% 100% at 50% 42%, transparent 55%, rgba(4,10,7,.55));
  pointer-events:none;
}

#stage{ position:fixed; inset:0; width:100%; height:100%; display:block; }

/* ---------- 品牌列 ---------- */
.brand{
  position:fixed; top:0; left:0; right:0;
  display:flex; justify-content:space-between; align-items:flex-start;
  padding: max(14px, env(safe-area-inset-top)) 18px 0;
  pointer-events:none;
}
.brand-left{ display:flex; align-items:center; gap:12px; }
.brand-home{ display:flex; align-items:center; gap:12px; pointer-events:auto; cursor:pointer; }
.brand-symbol{ height:32px; }
.brand-logo{ height:24px; }
.brand-sub{ font-family:"Cinzel",Georgia,serif; font-size:11px; letter-spacing:.28em; color:var(--accent); margin-left:4px; }
.brand-right{ display:flex; align-items:center; gap:10px; pointer-events:auto; }
.avatars{ display:flex; gap:6px; }
.avatar-btn{
  height:34px; padding:0 13px; border-radius:999px; cursor:pointer;
  border:1px solid rgba(201,169,98,.45); background:rgba(201,169,98,.1);
  color:var(--text); font-size:12.5px; font-family:inherit; letter-spacing:.05em;
  backdrop-filter:blur(6px);
}
.avatar-btn.on{ background:var(--accent); color:#1c1710; font-weight:700; border-color:var(--accent); }
#btn-fullscreen{
  width:38px; height:38px; border-radius:10px;
  border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.06);
  color:var(--text-dim); font-size:17px; cursor:pointer;
}

/* ---------- 對話面板 ---------- */
.panel{
  position:fixed; left:0; right:0; bottom:0;
  padding: 26px 16px max(14px, env(safe-area-inset-bottom));
  display:flex; flex-direction:column; gap:12px; align-items:center;
  background:linear-gradient(to top, rgba(5,16,11,.94) 30%, rgba(5,16,11,.55) 75%, transparent);
}
.panel > *{ width:100%; max-width:640px; }

.status{
  min-height:18px; text-align:center;
  font-size:13px; letter-spacing:.12em; color:var(--accent);
}
.subtitle{
  min-height:3.2em; text-align:center;
  font-size:clamp(16px, 2.3vh, 21px); line-height:1.65;
  text-shadow:0 1px 10px rgba(0,0,0,.7);
}

/* 題目瀏覽器:左分類選單、右題目清單 */
.qa-browser{
  display:flex; height:clamp(160px, 24vh, 250px);
  border:1px solid rgba(201,169,98,.25); border-radius:16px;
  background:rgba(5,16,11,.55); backdrop-filter:blur(10px);
  overflow:hidden;
}
.cats{
  flex:0 0 31%; min-width:100px; overflow-y:auto;
  display:flex; flex-direction:column;
  border-right:1px solid rgba(201,169,98,.2);
}
.cat{
  text-align:left; padding:11px 14px; cursor:pointer; flex:none;
  border:none; background:none; color:var(--text-dim);
  font-size:13.5px; font-family:inherit; letter-spacing:.06em;
  border-left:3px solid transparent;
  transition:background .12s, color .12s;
}
.cat.on{
  color:var(--accent); background:rgba(201,169,98,.1);
  border-left-color:var(--accent); font-weight:700;
}
.qlist{ flex:1; overflow-y:auto; display:flex; flex-direction:column; }
.q-item{
  text-align:left; padding:11px 16px; cursor:pointer; flex:none;
  border:none; background:none; color:var(--text);
  font-size:14.5px; font-family:inherit; line-height:1.5;
  border-bottom:1px solid rgba(250,248,245,.06);
}
.q-item:hover{ background:rgba(201,169,98,.08); }
.q-item:active{ background:rgba(201,169,98,.18); }
.cats::-webkit-scrollbar, .qlist::-webkit-scrollbar{ width:4px; }
.cats::-webkit-scrollbar-thumb, .qlist::-webkit-scrollbar-thumb{ background:rgba(201,169,98,.3); border-radius:2px; }

.ask{ display:flex; gap:8px; }
.ask input{
  flex:1; min-width:0; padding:12px 16px; border-radius:14px;
  border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.07);
  color:var(--text); font-size:16px; font-family:inherit; outline:none;
}
.ask input::placeholder{ color:var(--text-dim); }
.ask input:focus{ border-color:rgba(201,169,98,.6); }
.send{
  padding:0 20px; border-radius:14px; border:none; cursor:pointer;
  background:var(--accent); color:#221a10; font-size:15px; font-weight:700; font-family:inherit;
}
.mic{
  width:48px; height:48px; flex:none; border-radius:50%; cursor:pointer;
  border:1px solid rgba(255,255,255,.2); background:rgba(255,255,255,.08);
  font-size:19px; color:var(--text);
}
.mic.on{ background:#c0392b; border-color:#e74c3c; animation:pulse 1.1s infinite; }
@keyframes pulse{ 50%{ box-shadow:0 0 0 12px rgba(231,76,60,.18); } }

/* ---------- 角色載入提示 ---------- */
.drop-hint{
  position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
  padding:24px; pointer-events:none;
}
.drop-card{
  pointer-events:auto; text-align:center; line-height:1.8;
  padding:34px 38px; border-radius:22px;
  border:1.5px dashed rgba(201,169,98,.55); background:rgba(8,16,11,.72);
  backdrop-filter:blur(10px); color:var(--text-dim); font-size:15px;
}
.drop-title{ font-size:19px; font-weight:700; color:var(--text); margin-bottom:6px; }
.drop-note{ font-size:12.5px; margin-top:10px; opacity:.75; }
.btn-pick{
  display:inline-block; margin:10px 0 2px; padding:11px 22px; border-radius:12px;
  background:var(--accent); color:#221a10; font-weight:700; cursor:pointer;
}

.hidden{ display:none !important; }

/* ---------- 小螢幕調整 ---------- */
@media (max-height: 720px){
  .qa-browser{ height:clamp(140px, 21vh, 200px); }
  .subtitle{ min-height:2.6em; font-size:15px; }
}
@media (max-width: 420px){
  .cats{ flex-basis:34%; min-width:92px; }
  .cat{ font-size:12.5px; padding:10px 10px; }
  .q-item{ font-size:13.5px; padding:10px 12px; }
  .brand-sub{ display:none; } /* 窄螢幕收起副標,留空間給角色鈕 */
}
