:root {
  --bg: #0c1118;
  --panel: #151c27;
  --panel-2: #1c2433;
  --ink: #e9e6dc;
  --ink-dim: #9aa3b2;
  --accent: #c9a24b;
  --accent-2: #8a1a1a;
  --radius: 22px;
  --shadow: 0 10px 40px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  background:
    radial-gradient(1200px 800px at 20% -10%, #1e2638 0%, transparent 60%),
    radial-gradient(900px 700px at 120% 110%, #2a1818 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.stage {
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) 28px max(20px, env(safe-area-inset-bottom));
  max-width: 1200px;
  margin: 0 auto;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--ink-dim); font-size: 18px; letter-spacing: 2px;
  text-transform: uppercase;
}
.brand { color: var(--accent); font-weight: 700; }
.status { font-style: italic; text-transform: none; letter-spacing: 0; }

.clock { text-align: center; padding: 8px 0 4px; }
.time {
  font-size: clamp(80px, 14vw, 180px);
  font-weight: 700;
  letter-spacing: -4px;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.date { margin-top: 8px; font-size: clamp(18px, 2.4vw, 28px); color: var(--ink-dim); }

.transcript {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-y: auto;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0;
}
.bubble {
  padding: 14px 18px; border-radius: 16px;
  max-width: 85%; line-height: 1.4; font-size: 22px;
  white-space: pre-wrap; word-wrap: break-word;
}
.bubble.user { align-self: flex-end; background: #263346; color: #fff; }
.bubble.frasier { align-self: flex-start; background: #2a1e10; color: var(--ink); border-left: 3px solid var(--accent); }
.bubble.pending { opacity: 0.6; font-style: italic; }

.controls { display: grid; gap: 12px; }
.ptt {
  height: 96px; border-radius: 999px; border: none;
  background: linear-gradient(180deg, #b42121, #5f0d0d);
  color: #fff; font-size: 26px; font-weight: 700; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  box-shadow: 0 8px 24px rgba(180,33,33,0.35), inset 0 -4px 10px rgba(0,0,0,0.3);
  transition: transform 0.08s ease, filter 0.1s ease;
  touch-action: manipulation;
}
.ptt:active, .ptt.active { transform: scale(0.98); filter: brightness(1.15); }
.ptt-dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,0.7); }
.ptt.active .ptt-dot { animation: pulse 1s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.7); }
  70% { box-shadow: 0 0 0 18px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.row { display: flex; justify-content: space-between; align-items: center; }
.toggle { display: flex; align-items: center; gap: 10px; color: var(--ink-dim); font-size: 18px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent); }
.secondary {
  background: transparent; color: var(--ink-dim);
  border: 1px solid #2d3747; padding: 10px 16px; border-radius: 12px;
  font-size: 16px;
}
.secondary:active { background: #1b2230; }

.textForm { display: flex; gap: 8px; }
.textForm input {
  flex: 1; padding: 14px 18px; font-size: 20px;
  background: var(--panel); color: var(--ink);
  border: 1px solid #2d3747; border-radius: 14px; outline: none;
  font-family: inherit;
}
.textForm input:focus { border-color: var(--accent); }
.textForm button {
  padding: 0 20px; font-size: 18px; font-weight: 600;
  background: var(--accent); color: #1a140a; border: none;
  border-radius: 14px; font-family: inherit;
}
