/* ══════════════════════════════════════════════════════════════════
   Queendom Farm — guide videos (gd-) and the language layer (i18n-).

   Parchment is the guide's colour: app.css reserves it for "the guide's
   recorded words, which are this farm's archive", and a video of Feri
   showing how the hay goes in is exactly that. So the chip, the subtitles
   and the transcript's current line are parchment; everything else stays
   on the app's own panels.

   The i18n- rules live here too, because i18n.js has no stylesheet of its
   own and index.html already loads this one.
   ══════════════════════════════════════════════════════════════════ */

/* ─── the chip on a mission card ─────────────────────────────────── */

.gd-slot { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

.gd-chip, .gd-add {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  min-height: 34px; padding: 6px 12px 6px 7px; border-radius: 99px;
  border: 1px solid rgba(240,226,205,.28);
  background: linear-gradient(180deg, rgba(240,226,205,.10), rgba(240,226,205,.04));
  color: var(--parchment); font: inherit; font-size: 12.5px; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.gd-chip:active, .gd-add:active { transform: scale(.95); }
.gd-chip b { font-weight: 620; letter-spacing: .01em; }
.gd-chip .gd-dot { color: rgba(240,226,205,.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-chip .gd-dot::before { content: "·"; margin-right: 7px; color: rgba(240,226,205,.35); }
.gd-langs-mini { font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .03em; }
.gd-langs-mini em { font-style: normal; color: var(--parchment); }
.gd-langs-mini .me { color: var(--life); font-weight: 600; }
.gd-chip .gd-more { font: 600 10.5px/1 'JetBrains Mono', monospace; padding: 3px 5px; border-radius: 6px;
  background: rgba(240,226,205,.12); }
.gd-chip.bare { border-color: var(--line-2); color: var(--dim); background: var(--panel-2); }
.gd-chip.wait { border-style: dashed; }

/* the play mark: a disc with a triangle, drawn in CSS so it takes the
   chip's colour without a sprite entry of its own */
.gd-play {
  position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--parchment);
}
.gd-play::after {
  content: ""; position: absolute; left: 8.5px; top: 6px;
  border-left: 7.5px solid #231c12; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.gd-chip.bare .gd-play { background: var(--line-2); }

.gd-add { border-style: dashed; border-color: var(--line-2); background: transparent; color: var(--dim);
  padding-left: 10px; }
.gd-rec { width: 10px; height: 10px; border-radius: 50%; background: var(--now); flex: none;
  box-shadow: 0 0 0 3px rgba(215,109,93,.18); }

/* "on the way": a slow breathing dot rather than a spinner, which on a
   list of thirty cards would be thirty things moving */
.gd-spin::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%;
  background: currentColor; vertical-align: 1px; animation: gd-breathe 1.4s var(--ease) infinite;
}
@keyframes gd-breathe { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .gd-spin::after { animation: none; opacity: .7; } }

/* ─── the player ─────────────────────────────────────────────────── */

/* The player earns more of the screen than a form does. :has() keeps it
   off the shared .sheet element, which every other sheet reuses. */
.sheet:has(.gd-player) { max-height: 96%; }

.gd-kicker { display: block; font: 600 10.5px/1.3 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .12em; text-transform: uppercase; color: rgba(240,226,205,.62); margin-bottom: 4px; }
.gd-head h2 { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: 27px;
  line-height: 1.1; letter-spacing: -.01em; margin: 0 0 4px; }
.gd-meta { margin: 0 0 12px; color: var(--faint); font-size: 12.5px; }

.gd-stage {
  position: relative; margin: 0 -4px; border-radius: 18px; overflow: hidden;
  background: #070605; border: 1px solid var(--line);
  aspect-ratio: 16 / 10; max-height: 58vh;
  box-shadow: 0 18px 40px -22px rgba(0,0,0,.9);
}
.gd-stage video { display: block; width: 100%; height: 100%; object-fit: contain; background: #070605; }
.gd-stage video::cue { opacity: 0; } /* ours are drawn over it inline */

.gd-load { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; }
.gd-load i { display: block; height: 100%; width: 40%; background: var(--parchment); opacity: .6;
  animation: gd-sweep 1.2s var(--ease) infinite; }
.gd-stage.ready .gd-load { display: none; }
@keyframes gd-sweep { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.gd-cap {
  position: absolute; left: 10px; right: 10px; bottom: 52px; text-align: center;
  pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.gd-stage.broken .gd-cap { bottom: 16px; }
.gd-cap.on { opacity: 1; transform: none; }
.gd-cap span {
  display: inline; padding: 3px 8px; line-height: 1.62;
  background: rgba(10,8,6,.78); color: #fff8ec; border-radius: 6px;
  font-size: 16.5px; font-weight: 560; letter-spacing: .005em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.gd-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; padding: 18px 22px 64px; text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(240,226,205,.10), transparent 60%),
    repeating-linear-gradient(135deg, #15110c 0 14px, #120e0a 14px 28px);
  color: var(--dim); font-size: 12.5px;
}
.gd-fallback b { color: var(--parchment); font-weight: 560; font-size: 14px; }
.gd-reel { width: 34px; height: 34px; border-radius: 50%; border: 1.6px solid rgba(240,226,205,.5);
  position: relative; margin-bottom: 4px; }
.gd-reel::after { content: ""; position: absolute; left: 12.5px; top: 9px;
  border-left: 11px solid rgba(240,226,205,.7); border-top: 7.5px solid transparent; border-bottom: 7.5px solid transparent; }

.gd-note { margin: 10px 0 0; font-size: 12.5px; color: var(--dim); }
.gd-note.bad { color: var(--solar); }
.gd-note small { display: block; color: var(--faint); margin-top: 2px; }

.gd-lang-row { display: flex; gap: 6px; align-items: center; overflow-x: auto; margin: 12px -16px 0;
  padding: 2px 16px 4px; scrollbar-width: none; }
.gd-lang-row::-webkit-scrollbar { display: none; }
.gd-cc { flex: none; font: 700 10px/1 'JetBrains Mono', monospace; padding: 4px 5px; border-radius: 5px;
  border: 1.4px solid var(--faint); color: var(--faint); margin-right: 2px; }
.gd-lc {
  flex: none; min-height: 36px; padding: 6px 13px; border-radius: 99px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--dim); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.gd-lc:active { transform: scale(.94); }
.gd-lc i { font-style: normal; font-size: 10.5px; color: var(--faint); }
.gd-lc.on { border-color: var(--parchment); color: #231c12; background: var(--parchment); font-weight: 600; }
.gd-lc.on i { color: rgba(35,28,18,.6); }
.gd-lc.off.on { background: var(--panel-2); color: var(--ink); border-color: var(--line-2); }

.gd-tr { margin-top: 16px; }
.gd-tr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.gd-tr h3, .gd-others h3 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint); }
.gd-flip { background: none; border: 0; color: var(--parchment); font: inherit; font-size: 12.5px;
  padding: 8px 0; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(240,226,205,.35);
  text-underline-offset: 3px; }

.gd-cues { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.gd-cues li { border-bottom: 1px solid var(--line); }
.gd-cues button {
  width: 100%; display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: baseline;
  padding: 10px 4px 10px 12px; background: none; border: 0; color: var(--dim); font: inherit; font-size: 14px;
  text-align: start; cursor: pointer; line-height: 1.45;
}
.gd-cues time { font: 500 11px/1 'JetBrains Mono', monospace; color: var(--faint); }
.gd-cues li.now button { color: var(--ink); }
.gd-cues li.now time { color: var(--parchment); }
.gd-cues li.now { box-shadow: inset 2px 0 0 var(--parchment); }
.gd-cues .gd-none { padding: 12px 2px; color: var(--faint); font-size: 13px; }

.gd-others { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.gd-other { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 14px;
  text-align: start; cursor: pointer; }
.gd-other i { font-style: normal; color: var(--faint); margin-left: auto; font-size: 12px; }

.gd-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ─── the uploader ───────────────────────────────────────────────── */

.gd-up h2 { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: 26px; line-height: 1.12; }

.gd-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gd-list li { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 10px 12px; }
.gd-row-main { display: flex; gap: 10px; align-items: flex-start; width: 100%; background: none; border: 0;
  color: var(--ink); font: inherit; text-align: start; padding: 0; cursor: pointer; }
.gd-row-main > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gd-row-main b { font-weight: 600; font-size: 14px; }
.gd-row-main i { font-style: normal; font: 500 11px/1.5 'JetBrains Mono', monospace; color: var(--faint); }
.gd-st { font-style: normal; font-size: 12px; color: var(--parchment); }
.gd-st.bad { color: var(--now); }
.gd-row-act { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }

.gd-pick { display: flex; flex-direction: column; gap: 8px; }
.gd-big {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel-2);
  font-size: 16px; font-weight: 560; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease);
}
.gd-big:active { transform: scale(.97); }
.gd-big.go { background: var(--parchment); border-color: var(--parchment); color: #231c12; }
.gd-big.go .gd-rec { box-shadow: 0 0 0 3px rgba(215,109,93,.25); }
.gd-folder { width: 18px; height: 14px; border: 1.6px solid currentColor; border-radius: 2px 3px 3px 3px;
  position: relative; opacity: .8; }
.gd-folder::before { content: ""; position: absolute; left: -1.6px; top: -5px; width: 8px; height: 4px;
  border: 1.6px solid currentColor; border-bottom: 0; border-radius: 2px 2px 0 0; }
.gd-hint { margin: 2px 2px 0; font-size: 12.5px; color: var(--faint); }

.gd-file { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center;
  padding: 10px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.gd-file video { width: 112px; height: 72px; object-fit: cover; border-radius: 9px; background: #070605; display: block; }
.gd-file > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.gd-fname { font-size: 13.5px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-fmeta { font: 500 11.5px/1.4 'JetBrains Mono', monospace; color: var(--faint); }
.gd-warn { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; font-size: 12.5px;
  background: rgba(227,169,92,.12); color: var(--solar); border: 1px solid rgba(227,169,92,.3); }

.gd-field { display: flex; flex-direction: column; gap: 5px; margin: 14px 0 0; border: 0; padding: 0; min-width: 0; }
.gd-field > span, .gd-field > legend { font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint); padding: 0; margin-bottom: 5px; }
.gd-field input[type=text], .gd-field select {
  min-height: 46px; padding: 10px 12px; border-radius: 12px; font: inherit; font-size: 16px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); width: 100%;
}
.gd-targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gd-tg { position: relative; display: flex; }
.gd-tg input { position: absolute; opacity: 0; pointer-events: none; }
.gd-tg span { flex: 1; text-align: center; padding: 9px 4px; border-radius: 10px; font-size: 13px;
  border: 1px solid var(--line); background: var(--panel); color: var(--dim); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-tg input:checked + span { border-color: var(--parchment); color: var(--parchment); background: rgba(240,226,205,.08); font-weight: 600; }
.gd-tg input:checked + span::before { content: "✓ "; }
.gd-tg input:focus-visible + span { outline: 2px solid var(--parchment); outline-offset: 1px; }
.gd-tg.same span { opacity: .35; text-decoration: line-through; cursor: default; }

.gd-progress { margin-top: 16px; }
.gd-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.gd-bar i { display: block; height: 100%; background: var(--parchment); transform: scaleX(.03);
  transform-origin: left; transition: transform var(--dur) var(--ease); }
.gd-stage-txt { display: block; margin-top: 6px; font-size: 12.5px; color: var(--dim); }
.gd-send { width: 100%; min-height: 54px; margin-top: 16px; font-size: 15.5px; border-radius: var(--r); }

/* ─── languages (i18n.js) ────────────────────────────────────────── */

.i18n-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.i18n-lang {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 56px; padding: 10px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font: inherit; font-size: 16px; text-align: start; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.i18n-lang:active { transform: scale(.96); }
.i18n-lang b { font-weight: 560; }
.i18n-lang i { font-style: normal; font: 500 10.5px/1 'JetBrains Mono', monospace; color: var(--faint); }
.i18n-lang.on { border-color: var(--life); background: rgba(134,185,111,.09); }
.i18n-lang.on i { color: var(--life); }
.i18n-lang.on i::before { content: "✓ "; }
.i18n-foot { margin: 14px 2px 0; font-size: 12.5px; color: var(--faint); }

/* A machine translation carries a small mark that flips it back. */
.i18n-tx { position: relative; }
.i18n-flip {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-inline-start: 4px;
  vertical-align: -2px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent;
  color: var(--faint); font-size: 12px; line-height: 1; padding: 0; cursor: pointer;
}
.i18n-flip::before { content: ""; position: absolute; inset: -11px; } /* 44px target */
.i18n-flip { position: relative; }
.i18n-tx.orig .i18n-flip { color: var(--water); border-color: rgba(191,234,255,.4); }
.gd-tg.same input + span { border-color: var(--line); color: var(--dim); background: var(--panel); font-weight: 400; }
.gd-tg.same input + span::before { content: none; }

/* ─── the words, typed ───────────────────────────────────────────── */
.gd-words h2 { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: 26px; line-height: 1.12; margin: 0 0 4px; }
.gd-ta {
  display: block; width: 100%; min-height: 200px; resize: vertical; margin-top: 4px;
  padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--panel); color: var(--parchment);
  font: 15px/1.6 'JetBrains Mono', ui-monospace, monospace;
}
.gd-ta::placeholder { color: var(--faint); }
.gd-ta:focus { outline: none; border-color: rgba(240,226,205,.5); }
.gd-words .gd-hint { margin-top: 8px; }
