/* ─────────────────────────────────────────────────────────────────────────────
   FULDFØR CITATET — Editorial game screen
   All classes namespaced .fc-* to avoid collision with existing styles.
───────────────────────────────────────────────────────────────────────────── */

/* ── Custom properties (light mode default) ─────────────────────────────── */
:root {
  --fc-paper:          #f5f2ed;
  --fc-ink:            #1c1714;
  --fc-ink-dim:        #7a706a;
  --fc-blank-color:    #9a7318;
  --fc-blank-bg:       rgba(154, 115, 24, 0.08);
  --fc-correct-color:  var(--bs-danger);
  --fc-correct-bg:     rgba(233, 48, 54, 0.08);
  --fc-wrong-color:    #9b1c1c;
  --fc-wrong-bg:       rgba(155, 28, 28, 0.08);
  --fc-rule:           rgba(28, 23, 20, 0.15);
  --fc-input-rule:     rgba(28, 23, 20, 0.35);
}

[data-bs-theme="dark"] {
  --fc-paper:          #110f0e;
  --fc-ink:            #ede7df;
  --fc-ink-dim:        #7a7068;
  --fc-blank-color:    #c9a040;
  --fc-blank-bg:       rgba(201, 160, 64, 0.1);
  --fc-correct-color:  var(--bs-danger);
  --fc-correct-bg:     rgba(233, 48, 54, 0.12);
  --fc-wrong-color:    #e06060;
  --fc-wrong-bg:       rgba(224, 96, 96, 0.1);
  --fc-rule:           rgba(237, 231, 223, 0.12);
  --fc-input-rule:     rgba(237, 231, 223, 0.3);
}

/* ── Page background ─────────────────────────────────────────────────────── */
body[data-page="fuldfoer"] {
  background-color: var(--fc-paper);
  /* override Bootstrap default so the whole page has the paper tone */
}

/* ── Main layout ─────────────────────────────────────────────────────────── */
.fc-main {
  display: flex;
  flex-direction: column;
}

.fc-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.fc-topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem 0 0;
}

.fc-round-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fc-ink-dim);
}

/* ── Game container ──────────────────────────────────────────────────────── */
.fc-game {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Quote area ──────────────────────────────────────────────────────────── */
.fc-quote-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 2rem 0 1.5rem;
}

/* The quote itself — Playfair Display for a bookish, editorial feel */
.fc-quote {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: clamp(1.45rem, 3.5vw + 0.5rem, 2.1rem);
  font-weight: 700;
  font-style: italic;
  line-height: 1.5;
  color: var(--fc-ink);

  margin: 0 0 1.75rem;
  padding: 0;
  border: none;

  /* Soft transition when quote changes */
  transition: opacity 0.18s ease;
}

/* The blanked word — rendered inline in the quote flow.
   Uses monospace so underscores are consistent width,
   amber-gold colour so it reads as "a slot to fill", not an error.
   Bottom border anchors it visually without wrapping the whole quote. */
.fc-blank {
  display: inline;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82em;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.15em;

  color: var(--fc-blank-color);
  border-bottom: 2.5px solid var(--fc-blank-color);
  background-color: var(--fc-blank-bg);
  padding: 0 3px 2px;

  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.fc-blank.state-correct {
  color: var(--fc-correct-color);
  border-color: var(--fc-correct-color);
  background-color: var(--fc-correct-bg);
}

.fc-blank.state-wrong {
  color: var(--fc-wrong-color);
  border-color: var(--fc-wrong-color);
  background-color: var(--fc-wrong-bg);
}

.fc-blank.state-revealed {
  /* After 2 wrong attempts: show correct answer in danger color */
  color: var(--bs-danger);
  border-color: var(--bs-danger);
  background-color: rgba(233, 48, 54, 0.08);
  font-style: italic;
}

/* Attribution block */
.fc-attribution {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

/* Character name — small-caps treatment via letter-spacing + uppercase */
.fc-character {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fc-ink);
  opacity: 0.75;
}

.fc-character::before {
  content: "— ";
}

.fc-meta {
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--fc-ink-dim);
}

/* ── Rule divider between quote and input ────────────────────────────────── */
.fc-divider {
  width: 40px;
  height: 1px;
  background: var(--fc-rule);
  margin: 0 auto 1.5rem;
}

/* ── Input zone ──────────────────────────────────────────────────────────── */
.fc-input-zone {
  padding-bottom: 2rem;
  text-align: center;
}

/* Input row: text field + submit button share one bottom-border rule.
   Feels like you are writing into the quote rather than filling a form. */
.fc-input-row {
  display: flex;
  align-items: stretch;
  max-width: 460px;
  margin: 0 auto;
  border-bottom: 2px solid var(--fc-input-rule);
  transition: border-color 0.18s ease;
}

.fc-input-row:focus-within {
  border-bottom-color: var(--fc-blank-color);
}

/* Input field */
.fc-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;

  font-family: 'Source Sans Pro', sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--fc-ink);
  caret-color: var(--fc-blank-color);

  padding: 0.6rem 0.5rem 0.6rem 0;
}

.fc-input::placeholder {
  color: var(--fc-ink-dim);
  opacity: 0.6;
}

/* Submit button — secondary affordance. Uppercase, spare, no pill. */
.fc-btn-submit {
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-left: 1px solid var(--fc-rule);
  color: var(--fc-ink-dim);
  cursor: pointer;

  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  padding: 0.6rem 0.9rem;
  min-height: 44px;

  transition: color 0.15s ease;
}

.fc-btn-submit:hover:not(:disabled) {
  color: var(--fc-ink);
}

.fc-btn-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Char hint: "6 bogstaver" — small, secondary, below the input */
.fc-char-hint {
  margin-top: 0.45rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fc-ink-dim);
  min-height: 1rem;
}

/* Feedback line: correct/wrong messages */
.fc-feedback {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 1.25rem;
  color: var(--fc-ink-dim);
  transition: color 0.12s ease;
}

.fc-feedback.state-correct {
  color: var(--fc-correct-color);
}

.fc-feedback.state-wrong {
  color: var(--fc-wrong-color);
}

/* ── Loading state ───────────────────────────────────────────────────────── */
.fc-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

/* ── Animations ──────────────────────────────────────────────────────────── */

/* Input row shake on wrong answer — only the input row moves */
@keyframes fc-shake {
  0%   { transform: translateX(0); }
  18%  { transform: translateX(-7px); }
  36%  { transform: translateX(7px); }
  54%  { transform: translateX(-5px); }
  72%  { transform: translateX(5px); }
  90%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.fc-input-row.shake {
  animation: fc-shake 0.32s ease;
}

/* Quote area fade for question transitions */
@keyframes fc-appear {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fc-quote-area.transitioning,
.fc-input-zone.transitioning {
  opacity: 0;
  transition: opacity 0.18s ease;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .fc-topbar {
    padding-top: 0.875rem;
  }

  .fc-quote-area {
    padding: 1.5rem 0 1rem;
  }

  .fc-quote {
    font-size: clamp(1.25rem, 5vw, 1.6rem);
  }

  .fc-input-zone {
    padding-bottom: 1.25rem;
  }

  /* On mobile, pin input zone to visible bottom when keyboard is open.
     The JS visualViewport handler in main.js handles the actual scroll. */
  .fc-input-zone {
    position: relative;
  }
}

/* Min tap target for submit on touch devices */
@media (hover: none) {
  .fc-btn-submit {
    min-height: 48px;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
}

/* ── End screen ──────────────────────────────────────────────────────────── */

/* Hides round counter when end screen is active */
.fc-topbar.hidden {
  visibility: hidden;
}

.fc-end {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 0 3rem;
}

/* Tiny eyebrow label above the score */
.fc-end-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fc-ink-dim);
  margin-bottom: 0.5rem;
}

/* The big number — Playfair Display, danger-red, dominant */
.fc-end-score {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(5.5rem, 20vw, 8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--bs-danger);
  margin: 0;
}

/* "point ud af 20" — small, secondary */
.fc-end-score-context {
  font-size: 0.875rem;
  color: var(--fc-ink-dim);
  margin: 0.4rem 0 2rem;
  letter-spacing: 0.04em;
}

/* Verdict — Casper voice. Italic serif for a slightly theatrical feel. */
.fc-end-verdict {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.6;
  color: var(--fc-ink);
  max-width: 400px;
  margin: 0 auto 2.5rem;
  opacity: 0.9;
}

/* Two-button row. Square corners, no pill. */
.fc-end-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.fc-end-btn {
  min-height: 44px;
  padding: 0.6rem 1.6rem;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  border: 2px solid var(--bs-danger);
  background: transparent;
  color: var(--fc-ink);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.fc-end-btn:hover {
  background-color: var(--bs-danger);
  color: #fff;
}

/* "Spil igen" — filled primary */
.fc-end-btn.fc-btn-primary {
  background-color: var(--bs-danger);
  color: #fff;
}

.fc-end-btn.fc-btn-primary:hover {
  background-color: rgba(233, 48, 54, 0.85);
}

/* Clipboard toast — fixed, appears at bottom briefly */
.fc-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--fc-ink);
  color: var(--fc-paper);
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.6rem 1.25rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 9999;
}

.fc-toast.visible {
  opacity: 1;
}
