:root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

body {
  margin: 0;
  background: #f5f6f8;
  color: #1a1a1a;
}

header {
  background: #1e3a5f;
  color: white;
  padding: 1rem 1.5rem;
}

header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.header-logo {
  display: inline-block;
  height: 44px;
  vertical-align: middle;
}

header .tagline {
  font-size: 0.8rem;
  opacity: 0.8;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: white;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 0.75rem 0 0.25rem;
}

input[type="text"],
select,
textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}

button {
  background: #1e3a5f;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 0.75rem;
}

button.secondary {
  background: #6c7a89;
}

button.danger {
  background: #b3261e;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#captions {
  height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.caption-line {
  background: #eef1f5;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
}

.caption-line .speaker {
  font-weight: 700;
  margin-right: 0.4rem;
}

.caption-line .time {
  float: right;
  font-size: 0.75rem;
  color: #888;
}

.hint {
  font-size: 0.8rem;
  color: #666;
}

.share-link {
  font-family: monospace;
  background: #eef1f5;
  padding: 0.5rem;
  border-radius: 6px;
  word-break: break-all;
  display: block;
  margin-top: 0.25rem;
}

.instructor-qr {
  width: 140px;
  height: 140px;
  display: block;
  margin-top: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  padding: 0.4rem;
}

#langStep {
  text-align: center;
}

.lang-icon {
  color: #1e3a5f;
  margin-bottom: 0.5rem;
}

#langStep select,
#langStep button {
  display: block;
  width: 100%;
}

#askButton {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}

#askButton.recording {
  background: #b3261e;
  animation: askButtonPulse 1.4s ease-in-out infinite;
}

@keyframes askButtonPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(179, 38, 30, 0); }
}

.join-body {
  margin: 0;
  background: #1e3a5f;
  color: white;
  overflow: hidden;
}

.join-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.join-cloud {
  position: absolute;
  inset: 0;
}

.join-word {
  position: absolute;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  animation-name: joinWordPulse;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  white-space: nowrap;
  /* Center the word on its assigned point rather than anchoring by the
     top-left corner — otherwise longer translations extend further right
     and are more likely to collide with their neighbors. */
  transform: translate(-50%, -50%);
}

@keyframes joinWordPulse {
  0%, 100% { opacity: 0.25; transform: translate(-50%, -50%) scale(0.9); }
  50% { opacity: 0.85; transform: translate(-50%, -50%) scale(1.1); }
}

.join-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  border-radius: 16px;
  padding: 2rem 2.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.join-instructor {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.join-qr {
  width: 260px;
  height: 260px;
  display: block;
}

.join-hint {
  margin-top: 0.75rem;
  font-size: 1rem;
  color: #555;
}
