* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #111313 0%, #181a20 48%, #191613 100%);
  color: #ffffff;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

h1 {
  margin-bottom: 30px;
}

/* ---- Home page ---- */

.home-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 32px 20px;
}

.home-hero {
  width: min(760px, 100%);
  margin: 0 auto;
  display: block;
}

.home-copy {
  text-align: left;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background-color: #2e9e44;
  box-shadow: 0 18px 40px rgba(46, 158, 68, 0.22);
  margin-bottom: 24px;
}

.brand-mark svg,
.btn-ghost svg,
.join-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.eyebrow {
  margin: 0 0 10px;
  color: #91d6a0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-copy h1 {
  margin: 0;
  max-width: 560px;
  font-size: 72px;
  line-height: 0.95;
}

.home-subtitle {
  max-width: 460px;
  margin: 18px 0 0;
  color: #c8ccd2;
  font-size: 18px;
  line-height: 1.55;
}

.home-box {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-top: 34px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background-color: rgba(24, 26, 30, 0.82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.home-box label {
  color: #d7dbe0;
  font-size: 13px;
  font-weight: 700;
}

.room-input-row {
  display: block;
}

#roomCodeInput {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  font-size: 20px;
  letter-spacing: 0.12em;
  border-radius: 6px;
  border: 1px solid #3c4249;
  background-color: #101214;
  color: #ffffff;
  text-align: left;
  text-transform: uppercase;
  outline: none;
}

#roomCodeInput:focus {
  border-color: #70c47e;
  box-shadow: 0 0 0 3px rgba(112, 196, 126, 0.18);
}

.btn-ghost {
  height: 52px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #3c4249;
  background-color: #252a30;
  color: #ffffff;
}

.btn-ghost:hover {
  background-color: #333940;
}

.join-button {
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.home-message {
  min-height: 18px;
  margin: 0;
  color: #aeb6bf;
  font-size: 13px;
}

.home-message.success {
  color: #91d6a0;
}

.home-message.error {
  color: #ff8a80;
}

.history-link {
  display: inline-flex;
  justify-content: center;
  color: #91d6a0;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.history-link:hover {
  color: #b7e8c1;
}

button {
  padding: 12px 24px;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.btn-primary {
  background-color: #2e9e44;
  color: white;
}

.btn-primary:hover {
  background-color: #257a35;
}

.btn-danger {
  background-color: #c0392b;
  color: white;
}

.btn-danger:hover {
  background-color: #992d22;
}

.btn-secondary {
  background-color: #444444;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a5a5a;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.icon-control {
  width: 76px;
  min-height: 86px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #ffffff;
  border-radius: 6px;
}

.icon-wrap {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #444444;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.icon-control:hover {
  background: transparent;
}

.icon-control:hover .icon-wrap {
  transform: translateY(-1px);
}

.icon-control.btn-secondary:hover .icon-wrap {
  background-color: #5a5a5a;
}

.icon-control.btn-danger .icon-wrap {
  background-color: #c0392b;
}

.icon-control.btn-danger:hover .icon-wrap {
  background-color: #992d22;
}

.icon-control.is-off .icon-wrap {
  background-color: #6a3131;
}

.control-icon {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.icon-camera-off,
.icon-mic-off,
.icon-control.is-off .icon-camera-on,
.icon-control.is-off .icon-mic-on {
  display: none;
}

.icon-control.is-off .icon-camera-off,
.icon-control.is-off .icon-mic-off {
  display: block;
}

.control-label {
  display: block;
  width: 100%;
  color: #d7d7d7;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.error-banner {
  background-color: #3a1f1f;
  border: 1px solid #c0392b;
  color: #ff8a80;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
  text-align: left;
}

.video-box {
  position: relative;
}

.stats-bar {
  margin-top: 6px;
  font-size: 12px;
  font-family: "Courier New", monospace;
  letter-spacing: 0.3px;
}

.stats-good {
  color: #2ecc71;
}

.stats-fair {
  color: #f1c40f;
}

.stats-poor {
  color: #e74c3c;
}

/* ---- History page ---- */

.history-page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 24px;
}

.history-header h1 {
  margin: 0;
  font-size: 46px;
  line-height: 1;
}

.nav-link {
  min-height: 42px;
  text-decoration: none;
  border-radius: 6px;
}

.status-panel,
.history-section {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background-color: rgba(24, 26, 30, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.status-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

.status-panel p {
  margin: 4px 0 0;
  color: #aeb6bf;
  font-size: 14px;
}

.status-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 50%;
  background-color: #c0392b;
  box-shadow: 0 0 0 5px rgba(192, 57, 43, 0.14);
}

.status-dot.connected {
  background-color: #2e9e44;
  box-shadow: 0 0 0 5px rgba(46, 158, 68, 0.14);
}

.history-section {
  overflow: hidden;
  margin-top: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.section-heading span {
  color: #aeb6bf;
  font-size: 13px;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

th {
  color: #91d6a0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: #dfe3e8;
  font-size: 14px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ---- Call page ---- */

.call-body {
  background: #101214;
}

.call-shell {
  width: min(1380px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.call-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.call-header h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
}

.call-meta {
  min-width: 230px;
  text-align: right;
}

#roomLabel {
  font-size: 14px;
  color: #c8ccd2;
  margin-bottom: 6px;
}

#status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background-color: rgba(241, 196, 15, 0.1);
  color: #f1c40f;
  font-size: 13px;
  font-weight: 700;
}

.video-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 22px;
}

.video-box {
  position: relative;
  min-width: 0;
  min-height: 440px;
  overflow: hidden;
  border-radius: 8px;
  background-color: #050607;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background-color: #000000;
  border: 0;
  border-radius: 0;
  aspect-ratio: 16 / 9;
}

.video-label {
  position: absolute;
  left: 16px;
  bottom: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.58);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.stats-bar {
  position: absolute;
  right: 16px;
  bottom: 14px;
  margin-top: 0;
  padding: 7px 11px;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.58);
}

@media (max-width: 700px) {
  .home-page {
    align-items: flex-start;
    padding-top: 28px;
  }

  .home-copy h1 {
    font-size: 44px;
  }

  .history-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-header h1 {
    font-size: 40px;
  }

  .video-box {
    min-height: 260px;
  }

  .call-shell {
    padding: 18px 12px;
  }

  .call-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .call-meta {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
