:root {
  --bg1: #fff7e6;
  --bg2: #ffe9c7;
  --ink: #3a2b1a;
  --brand: #ff8a3d;
  --brand-dark: #f06b1f;
  --green: #34c759;
  --red: #ff5a5a;
  --card: #ffffff;
  --shadow: 0 8px 0 rgba(0,0,0,.08), 0 14px 24px rgba(0,0,0,.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(120% 120% at 50% 0%, var(--bg1), var(--bg2));
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) 16px 16px;
  overflow-x: hidden;
}

#app { width: 100%; max-width: 880px; }
.screen { animation: fade .25s ease; }
.hidden { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 顶部星星条 */
.topbar { display: flex; justify-content: flex-end; padding: 8px 4px; }
#star-bar { background: #fff; border-radius: 999px; padding: 6px 16px; font-weight: 800;
  font-size: clamp(18px, 2.6vw, 24px); box-shadow: var(--shadow); }

/* 卡片 */
.card { background: var(--card); border-radius: 28px; box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 40px); text-align: center; }

h1 { font-size: clamp(28px, 6vw, 52px); margin: 8px 0 4px; color: var(--brand-dark); }
.subtitle { font-size: clamp(16px, 3vw, 22px); opacity: .8; margin-top: 0; }

/* 大按钮 */
.big-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: none; cursor: pointer; user-select: none;
  background: var(--brand); color: #fff; font-weight: 800;
  font-size: clamp(20px, 3.4vw, 28px);
  padding: 18px 34px; border-radius: 999px;
  box-shadow: 0 6px 0 var(--brand-dark);
  transition: transform .08s, box-shadow .08s; margin: 8px;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--brand-dark); }
.big-btn.secondary { background: #ffd8a8; color: var(--brand-dark); box-shadow: 0 6px 0 #f3b66a; }
.big-btn:disabled { opacity: .45; box-shadow: none; transform: none; cursor: default; }

/* 主持人 */
.host { display: flex; align-items: flex-start; gap: 14px; text-align: left; margin-bottom: 14px; }
.host .avatar { font-size: clamp(40px, 8vw, 64px); flex: 0 0 auto;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.15)); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.bubble { background: #fff4e0; border-radius: 20px; padding: 14px 18px; flex: 1;
  font-size: clamp(16px, 3vw, 22px); line-height: 1.5; box-shadow: inset 0 0 0 2px #ffe0b3; min-height: 2em; }

/* 打乱的诗句 */
#poem-area { margin: 14px 0 18px; }
.poem-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0; }
.tile {
  display: inline-flex; align-items: center; justify-content: center;
  width: clamp(44px, 11vw, 66px); height: clamp(44px, 11vw, 66px);
  background: #fff; border-radius: 14px; box-shadow: var(--shadow);
  font-size: clamp(24px, 6vw, 40px); font-weight: 800; color: var(--brand-dark);
}
.tile.rolling { animation: roll .15s linear infinite alternate; }
@keyframes roll { from { transform: translateY(-5px) rotate(-4deg); } to { transform: translateY(5px) rotate(4deg); } }
.tile.settled { animation: pop .3s ease; }
.poem-line.revealed .tile { background: #eafff0; color: #1f9d4d; box-shadow: inset 0 0 0 2px #b6f0c8; }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }

#reveal { font-size: clamp(18px, 3.2vw, 26px); font-weight: 800; color: #1f9d4d; margin: 6px 0 14px; }

/* 选项 */
#options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 16px; }
.option-btn {
  border: none; cursor: pointer; background: #eef3ff; color: #2b3a67; font-weight: 800;
  font-size: clamp(20px, 4vw, 30px); padding: 18px 10px; border-radius: 18px;
  box-shadow: 0 5px 0 #c9d6f5; transition: transform .08s, box-shadow .08s;
}
.option-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #c9d6f5; }
.option-btn.correct { background: #d8ffe5; color: #1f9d4d; box-shadow: 0 5px 0 #9fe7b8; }
.option-btn.wrong { background: #ffe0e0; color: var(--red); box-shadow: 0 5px 0 #f3b3b3; }

/* 控制行 */
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.controls .big-btn { font-size: clamp(16px, 2.8vw, 22px); padding: 14px 22px; }
#btn-mic { background: var(--green); box-shadow: 0 6px 0 #28a046; }
#btn-mic.listening { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.progress { opacity: .7; font-weight: 700; margin: 4px 0 10px; }

/* 家长确认 */
.consent label { display: flex; align-items: center; gap: 10px; justify-content: center;
  font-size: clamp(15px, 2.6vw, 19px); margin: 12px 0; }
.consent input { width: 24px; height: 24px; }
.fine { font-size: 13px; opacity: .6; line-height: 1.5; margin-top: 14px; }

.ptt-btn {
  width: 100%; max-width: 380px; margin: 16px auto 8px;
  background: var(--green); box-shadow: 0 6px 0 #28a046;
  touch-action: none;
}
.ptt-btn.ptt-active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #28a046;
  background: #2dd855;
}

/* 横屏：选项一行四个 */
@media (orientation: landscape) and (min-width: 700px) {
  #options { grid-template-columns: repeat(4, 1fr); }
}
