/* Flagged — Slow AI brand styles */

/* ── Reset & Base ──────────────────────────────────────────── */

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: #F5F0E8;
  color: #5C5C5C;
  line-height: 1.6;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

/* ── Screens ───────────────────────────────────────────────── */

.screen {
  display: none;
  opacity: 0;
  transition: opacity 300ms ease;
  width: 100%;
  padding: 1rem 1.5rem;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: block;
}

.screen.visible {
  opacity: 1;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding-bottom: 4rem;
}

/* ── Typography ────────────────────────────────────────────── */

h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.5rem;
  color: #2A6B6B;
  margin-bottom: 0.25rem;
  font-weight: normal;
  letter-spacing: 0.02em;
}

h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.6rem;
  color: #2A6B6B;
  font-weight: normal;
  margin-bottom: 0.5rem;
}

h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  color: #2A6B6B;
  font-weight: normal;
}

.tagline {
  font-size: 0.95rem;
  color: #4F6E4F;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.intro {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
  color: #3D3D3D;
  margin-bottom: 0.5rem;
  line-height: 1.7;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.intro-emphasis {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  color: #2A6B6B;
  font-style: italic;
  margin-bottom: 2.5rem;
}

/* ── Flag Icon ─────────────────────────────────────────────── */

.flag-icon {
  margin-bottom: 1.5rem;
}

.flag-icon svg {
  display: inline-block;
}

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 200ms ease, transform 100ms ease;
  text-decoration: none;
  line-height: 1.4;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #2A6B6B;
  color: #F5F0E8;
}

.btn-primary:hover {
  background: #235959;
}

.btn-secondary {
  background: transparent;
  color: #2A6B6B;
  border: 1.5px solid #2A6B6B;
}

.btn-secondary:hover {
  background: rgba(42, 107, 107, 0.08);
}

/* ── Decision Buttons ──────────────────────────────────────── */

.decision-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.btn-pass {
  background: #F5F0E8;
  color: #2A6B6B;
  border: 2px solid #2A6B6B;
  padding: 0.85rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  min-width: 130px;
  letter-spacing: 0.03em;
}

.btn-pass:hover {
  background: #2A6B6B;
  color: #F5F0E8;
}

.btn-flag {
  background: #F5F0E8;
  color: #9A5F35;
  border: 2px solid #9A5F35;
  padding: 0.85rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  min-width: 130px;
  letter-spacing: 0.03em;
}

.btn-flag:hover {
  background: #9A5F35;
  color: #F5F0E8;
}

.keyboard-hint {
  font-size: 0.7rem;
  color: #5C5C5C;
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

.btn-pass:disabled,
.btn-flag:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ── Progress Bar ──────────────────────────────────────────── */

.progress-bar {
  margin-bottom: 1rem;
}

.progress-track {
  width: 100%;
  height: 4px;
  background: rgba(42, 107, 107, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #2A6B6B;
  border-radius: 2px;
  transition: width 300ms ease;
  width: 0%;
}

/* ── Case Header ───────────────────────────────────────────── */

.case-header {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  color: #5C5C5C;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.case-header .separator {
  margin: 0 0.5rem;
  opacity: 0.4;
}

/* ── Detection Panel ───────────────────────────────────────── */

.detection-panel {
  background: rgba(42, 107, 107, 0.04);
  border: 1px solid rgba(42, 107, 107, 0.12);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.detection-label {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.7rem;
  color: #5C5C5C;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.detection-score {
  font-family: 'Courier New', Courier, monospace;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.detection-score.high {
  color: #9A5F35;
}

.detection-score.low {
  color: #2A6B6B;
}

.tool-reasoning {
  font-size: 0.75rem;
  font-style: italic;
  color: #5C5C5C;
  line-height: 1.4;
  margin: 0;
}

/* ── Submission Text ───────────────────────────────────────── */

.submission-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #3D3D3D;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: 1rem 1.25rem;
  margin: 0 auto 1rem;
  text-align: left;
  max-width: 560px;
  border-radius: 2px;
}

/* ── Student Profile ───────────────────────────────────────── */

.btn-profile {
  background: transparent;
  color: #5C5C5C;
  border: 1px dashed rgba(92, 92, 92, 0.4);
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  margin-bottom: 0.75rem;
}

.btn-profile:hover {
  border-color: #2A6B6B;
  color: #2A6B6B;
}

.student-profile {
  background: #F9F3E6;
  border: 1px solid rgba(193, 123, 74, 0.2);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin: 0 auto 0.75rem;
  max-width: 560px;
  text-align: left;
  position: relative;
}

.student-profile.hidden {
  display: none;
}

.profile-tab {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.7rem;
  color: #8F5733;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.profile-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  color: #2A6B6B;
  margin-bottom: 0.25rem;
}

.profile-detail {
  font-size: 0.85rem;
  color: #5C5C5C;
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

.profile-circumstance {
  font-size: 0.85rem;
  color: #3D3D3D;
  font-style: italic;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ── Reveal Screen ─────────────────────────────────────────── */

.reveal-badge {
  display: inline-block;
  padding: 0.4rem 1.25rem;
  border-radius: 3px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0.5rem 0 1rem;
}

.reveal-badge.correct {
  background: rgba(122, 155, 122, 0.15);
  color: #5A7A5A;
}

.reveal-badge.incorrect {
  background: rgba(193, 123, 74, 0.15);
  color: #A0623A;
}

.reveal-badge.ambiguous {
  background: rgba(92, 92, 92, 0.1);
  color: #5C5C5C;
}

.truth-box {
  background: rgba(42, 107, 107, 0.04);
  border-radius: 4px;
  padding: 0.75rem 1.25rem;
  margin: 0 auto 0.75rem;
  max-width: 560px;
  text-align: left;
}

.truth-label {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.7rem;
  color: #5C5C5C;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.truth-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #3D3D3D;
}

.consequence-box {
  background: rgba(193, 123, 74, 0.06);
  border-left: 3px solid #C17B4A;
  border-radius: 0 4px 4px 0;
  padding: 0.75rem 1.25rem;
  margin: 0 auto 0.75rem;
  max-width: 560px;
  text-align: left;
}

.consequence-box.hidden {
  display: none;
}

.scoring-note {
  font-size: 0.8rem;
  font-style: italic;
  color: #5C5C5C;
  margin: 0.5rem auto;
  max-width: 560px;
}

.scoring-note.hidden {
  display: none;
}

.consequence-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #A0623A;
}

.reflection-box {
  background: rgba(42, 107, 107, 0.06);
  border-radius: 4px;
  padding: 0.75rem 1.25rem;
  margin: 0.75rem auto;
  max-width: 560px;
  text-align: left;
}

.reflection {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #3D3D3D;
}

/* ── Results Screen ────────────────────────────────────────── */

.results-heading {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.results-stats {
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(42, 107, 107, 0.1);
}

.stat-label {
  font-size: 0.9rem;
  color: #5C5C5C;
}

.stat-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2A6B6B;
}

.consequences-section {
  max-width: 560px;
  margin: 0 auto 1.25rem;
  text-align: left;
}

.consequences-section.hidden {
  display: none;
}

.consequences-heading {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.consequences-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.consequence-item {
  background: rgba(193, 123, 74, 0.06);
  border-left: 3px solid #C17B4A;
  border-radius: 0 4px 4px 0;
  padding: 0.6rem 1rem;
}

.consequence-item-name {
  font-weight: 600;
  color: #3D3D3D;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.consequence-item-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #A0623A;
}

.missed-item {
  background: rgba(42, 107, 107, 0.04);
  border-left: 3px solid #2A6B6B;
  border-radius: 0 4px 4px 0;
  padding: 0.6rem 1rem;
}

.missed-item-name {
  font-weight: 600;
  color: #3D3D3D;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.missed-item-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #5C5C5C;
}

.profile-stat {
  margin: 1rem auto;
  max-width: 400px;
}

.profile-stat p {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.9rem;
  color: #5C5C5C;
  font-style: italic;
}

.results-reflection-box {
  background: rgba(42, 107, 107, 0.06);
  border-radius: 4px;
  padding: 0.75rem 1.25rem;
  margin: 1rem auto 1.5rem;
  max-width: 560px;
  text-align: left;
}

.results-reflection {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #3D3D3D;
}

/* ── Share ──────────────────────────────────────────────────── */

.share-box {
  background: rgba(42, 107, 107, 0.06);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 0 auto 1rem;
  max-width: 320px;
}

.share-label {
  font-size: 0.8rem;
  color: #5C5C5C;
  margin-bottom: 0.4rem;
}

#share-canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

#btn-casebook {
  margin-bottom: 0.5rem;
}

#btn-replay {
  margin-bottom: 1rem;
}

/* ── Casebook ──────────────────────────────────────────────── */

.casebook-heading {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.casebook-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 560px;
  margin: 0 auto 1.5rem;
  text-align: left;
}

.casebook-entry {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  padding: 1rem 1.25rem;
}

.casebook-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.casebook-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  color: #2A6B6B;
  font-weight: normal;
}

.casebook-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

.casebook-badge.source-human {
  background: rgba(122, 155, 122, 0.15);
  color: #5A7A5A;
}

.casebook-badge.source-ai {
  background: rgba(193, 123, 74, 0.15);
  color: #A0623A;
}

.casebook-badge.source-ai-assisted {
  background: rgba(92, 92, 92, 0.1);
  color: #5C5C5C;
}

.casebook-meta {
  font-size: 0.8rem;
  color: #5C5C5C;
  margin-bottom: 0.5rem;
}

.casebook-decision {
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.casebook-decision .correct {
  color: #5A7A5A;
}

.casebook-decision .incorrect {
  color: #A0623A;
}

.casebook-decision .ambiguous {
  color: #5C5C5C;
}

.casebook-reflection {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #5C5C5C;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ── Debrief ───────────────────────────────────────────────── */

.debrief {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(42, 107, 107, 0.12);
  text-align: left;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.debrief h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.debrief-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #3D3D3D;
  margin-bottom: 0.75rem;
}

.debrief-text:last-child {
  margin-bottom: 0;
}

.debrief-text a {
  color: #2A6B6B;
  text-decoration: none;
}

.debrief-text a:hover {
  text-decoration: underline;
}

/* ── What Next ─────────────────────────────────────────────── */

.what-next {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(42, 107, 107, 0.12);
  text-align: left;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.what-next h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.what-next-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #3D3D3D;
  margin-bottom: 0.5rem;
}

.what-next .btn {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  padding: 0.6rem 1.5rem;
}

/* ── Footer ────────────────────────────────────────────────── */

.brand-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(42, 107, 107, 0.12);
}

.brand-footer a {
  font-size: 0.85rem;
  color: #2A6B6B;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.brand-footer a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid #C17B4A;
  outline-offset: 2px;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 480px) {
  .screen {
    padding: 0.75rem 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .tagline {
    margin-bottom: 1.25rem;
  }

  .flag-icon {
    margin-bottom: 1rem;
  }

  .intro {
    font-size: 0.95rem;
  }

  .intro-emphasis {
    margin-bottom: 1.5rem;
  }

  .detection-score {
    font-size: 1.6rem;
  }

  .submission-text {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }

  .decision-buttons {
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .btn-pass,
  .btn-flag {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    min-width: 110px;
  }

  .btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
  }

  .reflection-box {
    padding: 0.6rem 1rem;
    margin: 0.5rem auto;
  }

  .reflection {
    font-size: 0.85rem;
    line-height: 1.55;
  }

  .brand-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
  }

  #share-canvas {
    display: none;
  }

  .share-label {
    display: none;
  }

  .share-box {
    padding: 0.75rem 1rem;
    margin: 0 auto 1rem;
  }

  #btn-download {
    font-size: 0.9rem;
  }

  .keyboard-hint {
    display: none;
  }

  .btn-pass,
  .btn-flag {
    min-height: 44px;
  }
}

/* ── Accessibility ─────────────────────────────────────────── */

.btn:focus-visible {
  outline: 2px solid #C17B4A;
  outline-offset: 2px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .screen {
    transition: none;
  }

  .progress-fill {
    transition: none;
  }

  .btn {
    transition: none;
  }
}
