/* Brighter — visual identity
   Warm sunshine palette: amber/marigold primary, soft cream surfaces, deep navy ink.
   The vibe: school-club friendly, encouraging, never childish.
*/

:root {
  --brand: #FFB627;          /* marigold sun */
  --brand-dark: #E89500;
  --brand-soft: #FFE6B5;
  --ink: #1E2A44;            /* deep navy */
  --ink-soft: #4A5470;
  --paper: #FFFAF1;          /* cream */
  --paper-warm: #FFF4DD;
  --line: #ECE4D2;
  --ok: #2DA86C;
  --warn: #E4572E;
  --shadow: 0 1px 2px rgba(30, 42, 68, 0.08), 0 8px 24px rgba(30, 42, 68, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--brand-dark); }

h1, h2, h3 { color: var(--ink); margin-top: 0; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }

p { margin: 0 0 0.75rem; }

/* ===== Top bar ===== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.brand-text { letter-spacing: -0.01em; }
.brand img { display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-link:hover { background: var(--paper-warm); color: var(--ink); }
.nav-link-quiet { color: var(--ink-soft); opacity: 0.7; }

/* ===== Layout ===== */

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.container-narrow { max-width: 480px; }

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--paper-warm); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ink);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: white; }

.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-quiet:hover { background: var(--paper-warm); color: var(--ink); }

.btn-block { width: 100%; }

/* ===== Cards ===== */

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-pad { padding: 1.25rem; }

/* ===== Forms ===== */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.field label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: white;
  color: var(--ink);
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.help { color: var(--ink-soft); font-size: 0.85rem; }
.error { color: var(--warn); font-size: 0.9rem; margin-top: 0.25rem; }

/* ===== Tiles for situation browse ===== */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.tile {
  display: block;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  color: var(--ink);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--paper-warm);
}
.tile-body { padding: 0.7rem 0.8rem 0.85rem; }
.tile-task { font-size: 0.9rem; line-height: 1.35; margin: 0; }
.tile-meta { font-size: 0.75rem; color: var(--ink-soft); margin-top: 0.35rem; }

/* ===== Level pill / tag ===== */

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.pill-ok { background: #d8f0e3; color: var(--ok); }
.pill-warn { background: #fde0d6; color: var(--warn); }

/* ===== Level switcher ===== */

.level-switch {
  display: inline-flex;
  background: var(--paper-warm);
  border-radius: 999px;
  padding: 4px;
  border: 1px solid var(--line);
}
.level-switch a {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.level-switch a.active { background: var(--brand); color: var(--ink); }

/* ===== Briefing panel ===== */

.briefing {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}
@media (min-width: 720px) {
  .briefing { grid-template-columns: 1fr 1fr; }
}
.briefing-img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--paper-warm);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.brief-task {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.brief-section { margin-top: 1rem; }
.brief-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ===== Speaking page ===== */

.speak-wrap {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
  padding-bottom: 0;
}
.speak-task {
  background: var(--paper-warm);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
  border: 1px solid var(--line);
}
.speak-task summary { cursor: pointer; font-weight: 600; }
.speak-task[open] summary { margin-bottom: 0.5rem; }

.transcript-feed {
  flex: 1;
  overflow-y: auto;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.bubble {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  max-width: 85%;
}
.bubble-self { background: var(--brand-soft); border-color: var(--brand-soft); align-self: flex-end; }
.bubble-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 0.25rem;
  letter-spacing: 0.04em;
}
.bubble-score { float: right; font-weight: 700; color: var(--brand-dark); }

/* PTT button — big, friendly, glows when pressed */

.ptt-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  bottom: 0;
}
.ptt-btn {
  flex: 1;
  height: 76px;
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--brand);
  color: var(--ink);
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--brand-dark);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}
.ptt-btn:active, .ptt-btn.recording {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--brand-dark);
  background: var(--brand-dark);
  color: white;
}
.ptt-btn:disabled {
  background: var(--paper-warm);
  color: var(--ink-soft);
  box-shadow: 0 4px 0 var(--line);
  cursor: not-allowed;
}

.tip-btn {
  position: relative;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.tip-btn.has-new {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
  animation: tip-glow 1.6s ease-in-out infinite;
}
@keyframes tip-glow {
  0%, 100% { box-shadow: 0 0 0 4px var(--brand-soft); }
  50% { box-shadow: 0 0 0 8px var(--brand-soft); }
}
.tip-count {
  background: var(--brand);
  color: var(--ink);
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

/* ===== Member chips ===== */

.member-chips {
  display: flex;
  gap: 0.4rem;
  margin: 0.5rem 0 0.75rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  background: var(--paper-warm);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.chip-speaking { background: var(--brand); color: var(--ink); }
.chip-exited { opacity: 0.4; text-decoration: line-through; }

/* ===== Stats / dashboard ===== */

.stat-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.stat {
  flex: 1;
  min-width: 140px;
  background: var(--paper-warm);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
}
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--brand-dark); }
.stat-label { font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== Room code display ===== */

.code-display {
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand-dark);
  background: var(--brand-soft);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  display: inline-block;
}

/* ===== Tables ===== */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== Empty/hero states ===== */

.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.hero-sun {
  width: 80px;
  height: 80px;
  display: block;
  margin: 0 auto 1rem;
}
.hero h1 { margin-bottom: 0.35rem; }
.hero .lede { color: var(--ink-soft); max-width: 30rem; margin: 0 auto 1.5rem; }
