/* ============================================================
   Robotgames Player Support — voice console.
   Dark military-sci-fi look, matched to the admin console palette.
   ============================================================ */
:root {
  --bg:        #0b0e12;
  --bg-2:      #11161d;
  --panel:     #151b24;
  --panel-2:   #1b232e;
  --line:      #263141;
  --text:      #e7edf4;
  --muted:     #8b98a9;
  --dim:       #5f6c7d;
  --accent:    #f6a723;   /* amber */
  --accent-2:  #35c2f5;   /* cyan  */
  --safe:      #3fb950;
  --danger:    #f4523b;
  --shadow:    0 10px 30px rgba(0,0,0,.45);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 50% -10%, #16202b 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
b { color: var(--text); }

.wrap {
  max-width: 560px; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 20px 40px; gap: 22px;
}

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: 12px; align-self: flex-start; }
.brand-mark { font-size: 26px; filter: drop-shadow(0 0 8px rgba(246,167,35,.5)); }
.brand-title { font-weight: 800; letter-spacing: .14em; font-size: 15px; }
.brand-sub { color: var(--muted); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }

/* ---- stage ---- */
.stage {
  width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
  padding: 34px 26px 26px; display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* ---- orb ---- */
.orb {
  position: relative; width: 168px; height: 168px; display: grid; place-items: center;
  margin: 6px 0 4px;
}
.orb-core {
  position: absolute; inset: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a3646, #121820 70%);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 30px rgba(0,0,0,.6);
  transition: box-shadow .2s ease, transform .2s ease;
}
.orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(139,152,169,.25);
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.orb-icon { position: relative; font-size: 46px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }

.orb.idle .orb-ring { border-color: rgba(139,152,169,.28); }
.orb.off .orb-ring { border-color: rgba(244,82,59,.4); }
.orb.off .orb-core { box-shadow: inset 0 0 30px rgba(244,82,59,.15); }

.orb.connecting .orb-ring {
  border-color: rgba(53,194,245,.55);
  animation: spin 1.4s linear infinite, pulsering 1.4s ease-in-out infinite;
  border-top-color: var(--accent-2);
}
.orb.live .orb-ring { border-color: rgba(63,185,80,.55); box-shadow: 0 0 22px rgba(63,185,80,.25); }
.orb.live .orb-core { box-shadow: inset 0 0 30px rgba(63,185,80,.14); }

/* agent speaking pulse */
.orb.speaking .orb-core { transform: scale(1.05); box-shadow: inset 0 0 26px rgba(246,167,35,.22), 0 0 34px rgba(246,167,35,.28); }
.orb.speaking .orb-ring { border-color: rgba(246,167,35,.7); box-shadow: 0 0 30px rgba(246,167,35,.35); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulsering { 50% { opacity: .55; } }

.state-label { font-size: 20px; font-weight: 700; letter-spacing: .01em; text-align: center; }
.sub-label { color: var(--muted); font-size: 13px; text-align: center; min-height: 1.2em; }

/* ---- meters ---- */
.meters { width: 100%; max-width: 320px; display: grid; gap: 8px; margin-top: 4px; }
.meter { display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 10px; }
.meter-tag { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.meter-bar { height: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--safe)); transition: width .12s linear; }
.meter-bar.agent i { background: linear-gradient(90deg, var(--accent), #ffcf6b); }

/* ---- controls ---- */
.controls { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 6px; }
.btn-call {
  background: linear-gradient(180deg, #f6b23a, #e0910f); color: #1a1204;
  border: 0; border-radius: 999px; padding: 14px 30px; font-weight: 800; letter-spacing: .03em;
  font-size: 16px; box-shadow: 0 6px 18px rgba(224,145,15,.35);
}
.btn-call:disabled { opacity: .45; cursor: default; box-shadow: none; }
.live-controls { display: flex; gap: 12px; }
.btn-ghost, .btn-end {
  border-radius: 999px; padding: 11px 20px; font-weight: 700; font-size: 14px; border: 1px solid var(--line);
}
.btn-ghost { background: var(--panel-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent-2); }
.btn-ghost.active { background: rgba(244,82,59,.14); border-color: rgba(244,82,59,.5); color: #ffb3a8; }
.btn-end { background: rgba(244,82,59,.15); border-color: rgba(244,82,59,.45); color: #ff9d90; }
.btn-end:hover { background: rgba(244,82,59,.25); }

.err { color: var(--danger); font-size: 13px; min-height: 1.2em; text-align: center; }

/* ---- feed ---- */
.feed-wrap { width: 100%; }
.feed-wrap h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.feed li {
  font-size: 13px; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px;
}
.feed li.warn { border-color: rgba(246,167,35,.4); color: #ffd98a; }
.feed .t { color: var(--dim); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; margin-right: 6px; }

.foot { color: var(--dim); font-size: 12px; text-align: center; max-width: 480px; line-height: 1.5; }

@media (max-width: 480px) {
  .orb { width: 148px; height: 148px; }
  .orb-icon { font-size: 40px; }
  .stage { padding: 26px 16px 20px; }
}
