/* NammaMeet (codename) web client — dark glass theme, fleet visual standard. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: radial-gradient(1200px 800px at 20% -10%, #2b2a6e 0%, #131327 55%, #0b0b18 100%);
  color: #eef0ff;
  min-height: 100vh;
}
button {
  font: inherit; cursor: pointer; border: 1px solid #3d3d6e; border-radius: 10px;
  background: #23233f; color: #eef0ff; padding: 10px 14px;
}
button:hover { background: #2d2d52; }
button.primary {
  background: linear-gradient(135deg, #6d5cff, #9b5cff); border: none; font-weight: 600;
  width: 100%; padding: 13px;
}
button.accent { background: linear-gradient(135deg, #0e7a5f, #12a37c); border: none; width: 100%; font-weight: 600; }
button.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
input, select {
  font: inherit; width: 100%; padding: 11px 12px; margin: 4px 0 12px;
  border-radius: 10px; border: 1px solid #3d3d6e; background: #17172c; color: #eef0ff;
}
label { font-size: 13px; color: #b9bce0; }
.hidden { display: none !important; }
.error { color: #ff8f8f; font-size: 14px; }
.fineprint { color: #9a9dc4; font-size: 12.5px; line-height: 1.45; }
.center { text-align: center; }

/* Lobby */
#lobby { max-width: 460px; margin: 0 auto; padding: 40px 18px 30px; }
.hero { text-align: center; margin-bottom: 22px; }
.logo { font-size: 52px; filter: drop-shadow(0 8px 22px rgba(109,92,255,.55)); }
.hero h1 { margin: 6px 0 4px; font-size: 34px; letter-spacing: .3px; }
.badge {
  font-size: 11px; vertical-align: super; background: #3d3d6e; color: #cfd2ff;
  border-radius: 20px; padding: 3px 9px; font-weight: 600;
}
.tagline { color: #b9bce0; font-size: 14.5px; line-height: 1.5; }
.card {
  background: rgba(28, 28, 52, .82); border: 1px solid #3a3a68; border-radius: 18px;
  padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.5); backdrop-filter: blur(8px);
}
.card button { width: 100%; margin: 2px 0 8px; }
.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: #8b8eb4; font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #3a3a68; }
.room-info {
  background: #14281f; border: 1px solid #1f5c40; border-radius: 10px;
  padding: 10px 12px; margin: 0 0 14px; font-size: 14px;
}

/* Meeting layout */
#meeting { display: flex; flex-direction: column; height: 100vh; }
#meeting-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; background: rgba(20,20,38,.9); border-bottom: 1px solid #2c2c50;
}
.bar-left { display: flex; flex-direction: column; min-width: 0; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.sub { color: #9a9dc4; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#room-code-chip { background: #23233f; border: 1px solid #3d3d6e; padding: 5px 10px; border-radius: 8px; font-family: ui-monospace, monospace; font-size: 13px; }
#stage-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 12px; gap: 12px; }
#stage {
  position: relative; flex: 0 0 58%; background: #000; border-radius: 16px; overflow: hidden;
  border: 1px solid #34345e; box-shadow: 0 18px 44px rgba(0,0,0,.55);
}
#stage-media, #stage-media video { width: 100%; height: 100%; object-fit: contain; background: #000; }
#stage-label {
  position: absolute; z-index: 3; left: 12px; top: 10px; background: rgba(10,10,24,.72);
  padding: 5px 10px; border-radius: 8px; font-size: 13px;
}
#grid {
  flex: 1; display: grid; gap: 12px; min-height: 0;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-content: start;
}
.tile {
  position: relative; background: #17172c; border-radius: 14px; overflow: hidden;
  aspect-ratio: 16 / 9; border: 2px solid #2c2c50;
}
.tile.speaking { border-color: #12a37c; box-shadow: 0 0 0 3px rgba(18,163,124,.35); }
.tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile .avatar {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: #8f93c4; background: linear-gradient(160deg, #26264a, #17172c);
}
.tile .name {
  position: absolute; left: 8px; bottom: 8px; background: rgba(8,8,20,.72); padding: 3px 8px;
  border-radius: 7px; font-size: 12.5px; max-width: 85%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .hand { position: absolute; right: 8px; top: 8px; font-size: 18px; }

#device-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #4a2b16; border-bottom: 1px solid #8a5a24; color: #ffd9a8;
  padding: 9px 16px; font-size: 14px;
}
.tile .remove {
  position: absolute; right: 8px; bottom: 8px; z-index: 4; width: auto;
  padding: 3px 8px; font-size: 12px; border-radius: 7px; background: rgba(120,20,40,.85);
}

/* Panels */
#chat-panel, #stats-panel {
  position: fixed; top: 64px; right: 12px; bottom: 92px; width: min(340px, 92vw); z-index: 20;
  background: rgba(22,22,42,.97); border: 1px solid #3a3a68; border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.chat-head { padding: 12px 14px; font-weight: 600; border-bottom: 1px solid #2c2c50; }
#chat-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.msg { font-size: 14px; line-height: 1.4; }
.msg .who { color: #a99dff; font-weight: 600; margin-right: 6px; }
.msg.system { color: #8b8eb4; font-style: italic; }
#chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #2c2c50; }
#chat-form input { margin: 0; flex: 1; }
#stats-panel { padding-bottom: 10px; }
#stats-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#stats-table th, #stats-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid #26264a; }
#stats-panel .fineprint { padding: 8px 12px 0; }

/* Controls */
#controls {
  display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px; background: rgba(20,20,38,.92); border-top: 1px solid #2c2c50;
}
.ctl { min-width: 52px; height: 48px; border-radius: 14px; font-size: 19px; padding: 0 12px; }
.ctl.wide { font-size: 15px; font-weight: 600; }
.ctl.off { background: #5c2434; border-color: #8c3550; }
.ctl.active { background: linear-gradient(135deg, #6d5cff, #9b5cff); border: none; }
.ctl.danger { background: #a4263c; border: none; font-size: 15px; font-weight: 600; }
.react-wrap { position: relative; }
#react-menu {
  position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; background: #1c1c34; border: 1px solid #3a3a68; border-radius: 30px; padding: 6px 8px;
}
#react-menu button { border: none; background: none; font-size: 21px; padding: 4px; width: auto; }

/* Floating reactions + toasts */
#reaction-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.floater { position: absolute; bottom: 90px; font-size: 34px; animation: float-up 2.6s ease-out forwards; }
@keyframes float-up { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-46vh); opacity: 0; } }
#toasts { position: fixed; left: 14px; bottom: 92px; z-index: 40; display: flex; flex-direction: column; gap: 8px; }
.toast { background: rgba(24,24,46,.95); border: 1px solid #3a3a68; padding: 9px 13px; border-radius: 10px; font-size: 13.5px; }
