.test-room-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px;
  width: 100%;
}

.test-header-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.test-part-badge {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.q-card-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
}

.rec-ctrl-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  flex-wrap: wrap;
}

.btn-rec {
  background: #e11d48;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  min-height: 46px;
}

.btn-rec:hover {
  background: #be123c;
}

.btn-stop {
  background: #475569;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-stop:hover {
  background: #334155;
}

.timer-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  white-space: nowrap;
}

.scoring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.score-input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.score-input-group select {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  outline: none;
  font-size: 0.95rem;
}

.speaking-textarea {
  width: 100%;
  min-height: 90px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 12px;
  color: #ffffff;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.98rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
  margin-top: 10px;
}

.speaking-textarea:focus {
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .test-room-wrap {
    padding: 16px 12px;
  }

  .test-header-card {
    padding: 18px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .test-header-card > div:last-child {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
  }

  .q-card-box {
    padding: 20px 16px;
    border-radius: 14px;
  }

  .rec-ctrl-bar {
    padding: 16px 14px;
    gap: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .rec-ctrl-bar .btn-rec,
  .rec-ctrl-bar .btn-stop {
    width: 100%;
  }

  .rec-ctrl-bar audio {
    width: 100%;
  }

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

@media (max-width: 480px) {
  #testTitleDisplay {
    font-size: 1.2rem !important;
  }

  .test-part-badge {
    font-size: 0.74rem;
    padding: 4px 10px;
  }

  .timer-badge {
    font-size: 1rem;
    padding: 4px 10px;
  }
}
