/* ═══════════════════════════════════════════════════════════════
   IELTS Speaking Simulator v4 — style.css
   Praxis Habiganj · Dark maroon / gold theme
   Font: Cormorant Garamond (display) + DM Sans (body)
═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Praxis Habiganj brand palette */
  --maroon:      #4a0a14;
  --maroon-mid:  #6b1020;
  --maroon-lite: #8b1a2e;
  --gold:        #c9a84c;
  --gold-lite:   #e8c87a;
  --gold-dim:    #7a6030;

  /* Dark backgrounds */
  --bg:          #0d0508;
  --bg2:         #130810;
  --bg3:         #1e0d18;
  --bg4:         #2a1220;

  /* Text */
  --text:        #f5ede8;
  --text2:       #b89aaa;
  --text3:       #6e5060;

  /* Status colours */
  --green:       #3dba84;
  --amber:       #e8a830;
  --red:         #d94060;

  --radius:      16px;
  --radius-sm:   10px;
  --border:      rgba(201,168,76,0.15);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ──────────────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
.screen.active { display: flex; }

/* ═══════════════════════════════════════════════════════════════
   START SCREEN
═══════════════════════════════════════════════════════════════ */
#screen-start {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(107,16,32,0.35) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(201,168,76,0.08) 0%, transparent 60%),
    var(--bg);
  padding: 40px 20px;
}

.start-wrap {
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-orb-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--gold-lite), var(--gold) 40%, var(--maroon) 80%);
  box-shadow: 0 0 14px rgba(201,168,76,0.4);
  flex-shrink: 0;
}

.start-wrap h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 52px;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 14px;
  background: linear-gradient(160deg, var(--text) 0%, var(--gold-lite) 60%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.start-wrap h1 em {
  font-style: italic;
  font-weight: 400;
}

.start-sub {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 36px;
}

.parts-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 24px;
}

.part-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(90deg, rgba(107,16,32,0.3) 0%, rgba(30,13,24,0.5) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  text-align: left;
}

.part-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  flex-shrink: 0;
  width: 36px;
}

.part-info { display: flex; flex-direction: column; gap: 2px; }
.part-info strong { font-size: 14px; font-weight: 500; color: var(--text); }
.part-info span   { font-size: 12px; color: var(--text2); }

.checklist {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
}

.check-icon {
  color: var(--gold);
  font-size: 14px;
  flex-shrink: 0;
}

.btn-begin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--maroon-mid) 0%, var(--maroon) 100%);
  border: 1px solid var(--gold-dim);
  color: var(--gold-lite);
  border-radius: var(--radius-sm);
  padding: 15px 36px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.04em;
  transition: all 0.2s;
  width: 100%;
  max-width: 280px;
  box-shadow: 0 4px 24px rgba(107,16,32,0.5);
  margin-bottom: 20px;
}
.btn-begin:hover {
  background: linear-gradient(135deg, var(--maroon-lite) 0%, var(--maroon-mid) 100%);
  border-color: var(--gold);
  box-shadow: 0 6px 32px rgba(201,168,76,0.2);
}
.btn-begin:active { transform: scale(0.98); }

.start-credit {
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════════════════════
   MIC SCREEN
═══════════════════════════════════════════════════════════════ */
#screen-mic {
  background: var(--bg);
  padding: 40px 20px;
}

.mic-wrap {
  max-width: 360px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.mic-icon-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  margin-bottom: 8px;
  box-shadow: 0 0 32px rgba(201,168,76,0.1);
}

.mic-wrap h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
}

.mic-wrap p {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.65;
}

.mic-pill {
  padding: 7px 20px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--text2);
  background: var(--bg3);
}
.mic-pill.granted { color: var(--green); border-color: rgba(61,186,132,0.3); background: rgba(61,186,132,0.08); }
.mic-pill.denied  { color: var(--red);   border-color: rgba(217,64,96,0.3);  background: rgba(217,64,96,0.08);  }

/* ═══════════════════════════════════════════════════════════════
   TEST SCREEN
═══════════════════════════════════════════════════════════════ */
#screen-test {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% 52%, rgba(30,20,70,0.35) 0%, transparent 68%),
    var(--bg);
}

/* Top bar */
.test-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(13,5,8,0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.bar-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 2px;
}

.bar-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.test-bar-brand {
  font-size: 12px;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.test-bar-timer { text-align: right; }

/* Orb stage */
.orb-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 0;
  position: relative;
}

#orb-canvas {
  width: min(340px, 80vw);
  height: min(340px, 80vw);
  display: block;
}

.orb-status {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text2);
  letter-spacing: 0.04em;
  text-align: center;
  min-height: 22px;
  transition: color 0.4s;
}

/* Cue card */
.cue-card {
  margin: 0 16px 16px;
  background: linear-gradient(135deg, rgba(201,168,76,0.08) 0%, rgba(107,16,32,0.15) 100%);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius);
  padding: 20px 22px;
  animation: slideUp 0.4s ease;
}

.cue-card.hidden { display: none; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cue-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 12px;
  font-weight: 600;
}

.cue-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-line;
}

.prep-bar-wrap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.prep-bar-wrap.hidden { display: none; }

.prep-bar-label {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 8px;
}

.prep-bar-label span {
  color: var(--gold);
  font-weight: 600;
}

.prep-track {
  height: 3px;
  background: var(--bg4);
  border-radius: 2px;
  overflow: hidden;
}

.prep-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-lite));
  border-radius: 2px;
  transition: width 1s linear;
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS SCREEN
═══════════════════════════════════════════════════════════════ */
#screen-results {
  align-items: stretch;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(107,16,32,0.2) 0%, transparent 60%),
    var(--bg);
  overflow-y: auto;
}

.results-orb-col {
  display: none; /* hidden on mobile, shown on desktop */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

#orb-canvas-results {
  width: 260px;
  height: 260px;
  display: block;
}

.results-overall-badge {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.res-overall-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 72px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.res-overall-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Results panel */
.results-panel {
  flex: 1;
  padding: 32px 20px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.results-header {
  margin-bottom: 28px;
}

.results-logo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-dim);
  margin-bottom: 10px;
}

.results-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 38px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 6px;
}

.results-sub { font-size: 14px; color: var(--text2); }

/* Mobile overall score (shown in panel on mobile) */
.mobile-overall {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(107,16,32,0.4) 0%, rgba(201,168,76,0.06) 100%);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.mobile-overall-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 64px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  flex-shrink: 0;
}

.mobile-overall-right {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-overall-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.mobile-overall-sub {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}

/* Score grid */
.score-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.score-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.score-label {
  font-size: 13px;
  color: var(--text2);
}

.score-bar-track {
  width: 80px;
  height: 4px;
  background: var(--bg4);
  border-radius: 2px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--maroon-mid), var(--gold));
  transition: width 1.4s cubic-bezier(0.4,0,0.2,1);
}

.score-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  text-align: right;
  min-width: 36px;
}

/* Feedback section */
.feedback-section {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.feedback-tab-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.ftab {
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.ftab.active {
  background: var(--maroon-mid);
  border-color: var(--maroon-lite);
  color: var(--gold-lite);
}

.feedback-text {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.8;
}

/* Mistakes section */
.mistakes-section {
  margin-bottom: 24px;
}

.mistakes-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.mistakes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mistake-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border-left: 3px solid var(--maroon-lite);
}

.mistake-card.fluency    { border-left-color: #4a8fcc; }
.mistake-card.vocabulary { border-left-color: var(--gold); }
.mistake-card.grammar    { border-left-color: var(--red); }
.mistake-card.pronunciation { border-left-color: var(--green); }

.mistake-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--text3);
  margin-bottom: 8px;
}

.mistake-card.fluency     .mistake-tag { color: #4a8fcc; }
.mistake-card.vocabulary  .mistake-tag { color: var(--gold-dim); }
.mistake-card.grammar     .mistake-tag { color: var(--red); }
.mistake-card.pronunciation .mistake-tag { color: var(--green); }

.mistake-said {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 4px;
}

.mistake-said span { color: var(--text); font-style: italic; }

.mistake-correction {
  font-size: 13px;
  color: var(--green);
  margin-bottom: 6px;
}

.mistake-correction span { font-weight: 500; }

.mistake-explanation {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.55;
}

/* Actions */
.results-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.btn-action {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-gold {
  background: linear-gradient(135deg, var(--maroon-mid), var(--maroon));
  border: 1px solid var(--gold-dim);
  color: var(--gold-lite);
  box-shadow: 0 4px 16px rgba(107,16,32,0.4);
}
.btn-gold:hover { border-color: var(--gold); box-shadow: 0 4px 20px rgba(201,168,76,0.2); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
}
.btn-ghost:hover { background: var(--bg3); }

.results-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.06em;
  padding-bottom: 24px;
}

/* ── Utilities ────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Desktop layout for results ──────────────────────────────── */
@media (min-width: 860px) {
  #screen-results {
    flex-direction: row;
    align-items: stretch;
    overflow-y: auto;
    height: 100vh;
  }

  .results-orb-col {
    display: flex;
    width: 340px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
  }

  .results-panel {
    overflow-y: auto;
    padding: 40px 36px;
  }

  /* Hide mobile overall on desktop (orb col has it) */
  .mobile-overall { display: none; }
}

@media (max-width: 859px) {
  .mobile-overall { display: flex; }
}

@media (max-width: 380px) {
  .start-wrap h1 { font-size: 40px; }
  .score-bar-track { width: 60px; }
}
