.fd {
  --metal: #d49b35;
  --signal: #e85d3f;
  --lamp: #ffbc69;
  --dim: #c2d2c9;
  --engrave: #9caa90;
  --case: #0e3834;
  --case-edge: #254840;
  --letter: #fff7de;
  --machine-mono: Consolas, "Courier New", monospace;
  font-family: var(--sans);
  width: min(1040px, 100%);
  margin-inline: auto;
  color: var(--letter);
  text-align: left;
}
.fd[data-mode="rare"] { --signal: #6d28d9; --lamp: #adf2d7; }
.fd *, .fd *::before, .fd *::after { box-sizing: border-box; }
.fd [hidden] { display: none !important; }
.fd button, .fd input, .fd select { font: inherit; }
.fd button, .fd select, .fd summary { cursor: pointer; }
.fd button:disabled { cursor: default; }
.fd .fd-icon { display: inline-block; flex: none; vertical-align: middle; }
.fd :is(button,select,input,summary,a):focus-visible { outline: 3px solid #ffcb6d; outline-offset: 2px; }
.fd .fd-layout {
  display: block;
  position: relative;
  border: 1px solid #7c6b42;
  background: linear-gradient(100deg, #ead6a7, #ae8e51 29%, #eadbb7 66%, #b99754);
  padding: 5px;
  border-radius: 17px;
  box-shadow: 0 4px 0 #685d3c, 0 8px 0 -2px #d0c7b5, 0 16px 26px -14px #4a453c66;
}
.fd .fd-machine {
  position: relative;
  border: 1px solid #12342b;
  border-radius: 12px;
  background: var(--case);
  box-shadow: inset 0 0 0 2px #5f7560;
}
.fd-machine::before, .fd-machine::after {
  content: ""; position: absolute; width: 6px; height: 6px; top: 7px;
  border: 1px solid #a8884f; border-radius: 50%; z-index: 2;
  background: linear-gradient(135deg,#d5b77c 40%,#7e683e 42% 55%,#d5b77c 57%);
}
.fd-machine::before { left: 7px; } .fd-machine::after { right: 7px; }
.fd .fd-controls {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 20px; padding: 14px 24px;
  border-radius: 11px 11px 0 0; border-bottom: 1px solid #9f9769;
  background: linear-gradient(175deg,#264b40,#163c34);
  box-shadow: inset 0 1px 0 #759072, 0 2px 0 #0b2b26;
}
.fd-mode, .fd-knobs, .fd-progress, .fd-card-top, .fd-category,
.fd-card-foot, .fd-spectrum-head, .fd-board-foot, .fd-entry, .fd-log-head { display: flex; align-items: center; }
.fd-mode { justify-self: start; padding: 3px; gap: 3px; background: #092c27; border: 1px solid #74826b; border-radius: 7px; }
.fd-mode button {
  height: 39px; min-width: 99px; display: flex; align-items: center; justify-content: center; gap: 8px;
  color: #c8d8c7; background: transparent; border: 1px solid transparent; border-radius: 4px; line-height: 1;
}
.fd-mode b, .fd-mode small { display: block; text-align: left; }
.fd-mode b { font: 700 13px/16px var(--machine-mono); letter-spacing: .09em; text-transform: uppercase; }
.fd-mode small { font-size: 11px; line-height: 13px; }
.fd-mode button[aria-pressed="true"] {
  background: var(--signal); color: #fff7e8; border-color: #efa178;
  box-shadow: inset 0 1px 0 #ffd2b388,0 2px 1px #091d16;
}
.fd[data-mode="rare"] .fd-mode button[aria-pressed="true"] { border-color: #b490ed; }
.fd-progress { gap: 10px; justify-content: center; }
.fd-progress i { display: grid; justify-items: center; font: 10px/12px var(--machine-mono); color: #bcc7ac; letter-spacing: .06em; }
.fd-progress i span { display: none; }
.fd-progress i::before {
  content: ""; width: 11px; height: 11px; border-radius: 50%; margin-bottom: 4px;
  border: 2px solid #827c58; background: #405647; box-shadow: 0 0 0 2px #0e3028;
}
.fd-progress [data-state="active"]::before { background: var(--lamp); border-color: var(--signal); box-shadow: 0 0 7px var(--signal); }
.fd-progress [data-state="done"]::before { background: #a8d6ac; }
.fd-knobs { justify-self: end; gap: 7px; }
.fd-select { position: relative; display: inline-flex; align-items: center; color: #f0ecda; }
.fd-select select {
  appearance: none; border: 1px solid #82927b; border-radius: 23px; color: inherit; background: #1c4239;
  height: 35px; font: 600 13px/1 var(--sans); width: 106px; padding: 0 17px 0 24px;
  box-shadow: inset 0 1px 0 #627c69;
}
.fd-select:last-child select { width: 95px; }
.fd-select > svg { position: absolute; pointer-events: none; width: 13px; left: 8px; color: #ecddad; }
.fd-select > svg:last-child { left: auto; right: 6px; width: 10px; }
.fd .fd-seed-form {
  position: absolute; top: calc(100% + 4px); right: 10px; z-index: 4; width: min(365px,calc(100% - 20px));
  padding: 16px; border-radius: 7px; background: #f6f1df; color: #132a28; box-shadow: 0 5px 18px #092b2966; border: 1px solid #9c885a;
}
.fd-seed-form > div { display: flex; gap: 4px; }
.fd-seed-form input { min-width: 0; width: 100%; }
.fd-seed-form small { display: block; margin-top: 6px; }
.fd-seed-form label, .fd-history-inner label, .fd-log-tools label { display: block; font-weight: 650; margin-bottom: 5px; }
.fd-seed-form input, .fd-history-inner input, .fd-log-tools :is(input,select) { background: #fffdf6; border: 1px solid #918d74; border-radius: 4px; padding: 8px; min-height: 42px; color: #132a28; }
.fd-seed-form button, .fd-history-inner button, .fd-log-tools button {
  border: 1px solid #728575; border-radius: 5px; padding: 7px 13px;
  min-height: 42px; background: #194237; color: #fff9e8; font-weight: 650;
}
.fd-console { display: grid; grid-template-columns: minmax(0,1fr) 216px; gap: clamp(22px,4vw,52px); align-items: center; padding: 20px 28px 8px; }
.fd-card { min-width: 0; container-type: inline-size; }
.fd-card-top { gap: 12px; min-height: 24px; }
.fd-kicker, .fd-category, .fd-clock, .fd-sequence, #board-count { font: 600 11px/15px var(--machine-mono); text-transform: uppercase; letter-spacing: .06em; }
.fd-category { gap: 6px; background: #edf1d1; color: #234338; border-radius: 3px; padding: 3px 8px; }
.fd-category .fd-icon { width: 14px; }
.fd-sequence, .fd-clock { color: #e6d4a8; }
.fd #question {
  margin: 4px 0; display: flex; align-items: center; font: 600 clamp(33px,3.15vw,49px)/.98 var(--serif);
  letter-spacing: -.025em; height: 96px; color: #fff6dd;
}
.fd #question[data-long] { font-size: clamp(29px,5.4cqi,41px); }
.fd #scope { margin: 0; height: 36px; color: #d4dfd3; font: 15px/18px var(--sans); }
.fd #answer-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.fd-entry { gap: 8px; }
.fd #answer {
  min-width: 0; flex: 1; height: 48px; background: #fbf8ec; border: 1px solid #a39b79; border-radius: 5px;
  box-shadow: inset 0 2px 3px #4b4a3d26; color: #172e28; font-size: 17px; padding: 0 15px;
}
.fd #answer::placeholder { color: #60736a; opacity: 1; }
.fd #record, .fd .fd-action { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 45px;
  color: #fff; background: var(--signal); border: 1px solid #f7ae7a; border-radius: 5px; padding: 0 16px;
  box-shadow: inset 0 1px 0 #ffd5ae66,0 3px 0 #803c21; font: 700 16px/1 var(--sans); }
.fd[data-mode="rare"] #record, .fd[data-mode="rare"] .fd-action { border-color: #bc99ee; box-shadow: inset 0 1px 0 #ddd0ff77,0 3px 0 #462a6c; }
.fd[data-mode="crowd"] :is(#record, .fd-action, .fd-mode button[aria-pressed="true"]) { color: #182019; }
.fd #record:hover, .fd .fd-action:hover { filter: brightness(1.09); }
.fd #record:disabled { opacity: .65; }
.fd-card-foot { align-items: start; justify-content: space-between; gap: 8px; }
.fd-card-foot summary, .fd-card-foot button, #reveal-board, .fd-history > summary {
  display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0; background: none;
  border: 0; font: 500 13px/1.3 var(--sans); color: #d9e1d4; list-style: none;
}
.fd summary::-webkit-details-marker { display: none; }
.fd-card-foot button:hover, .fd-card-foot summary:hover, #reveal-board:hover { text-decoration: underline; }
.fd #skip { flex: none; }
.fd #eligible { font-size: 15px; }
.fd-signal:not(:empty) { font-weight: 650; color: #ffdb99; margin: 5px 0; }
.fd-signal[data-status="accepted"] { color: #b8f5d2; }
.fd-instruments {
  overflow: hidden; border-radius: 9px; border: 2px solid #ac955f; background: #173c34;
  box-shadow: 0 0 0 3px #092e27,inset 0 0 0 1px #cfb77f;
}
.fd-sky { height: 108px; position: relative; overflow: hidden; border-bottom: 1px solid #a5966b; background: #17382e; }
.fd .fd-landscape { position: absolute; width: 240%; height: 215%; max-width: none; left: 0; top: -72%; object-fit: fill; }
.fd .fd-balloon { position: absolute; width: 70px; height: 94px; left: 50%; top: 8px; transform: translateX(-50%); overflow: visible; }
.fd-sky::after {
  content: ""; position: absolute; right: 7px; top: 8px; bottom: 8px; width: 7px;
  border-right: 1px solid #dcc79b; background: repeating-linear-gradient(to bottom,#dcc79b 0 1px,transparent 1px 9px);
}
.fd-telemetry { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 6px; }
.fd-dial-link { display: block; flex: none; line-height: 0; border-radius: 50%; }
.fd-gauge { display: block; width: 61px; height: 61px; }
.fd-alt-label { color: #d5ddcb; font-size: 9px; }
.fd-reading { font: 500 29px/1 var(--machine-mono); color: #f6daa1; margin: 3px 0 2px; }
.fd-reading span:last-child { font: italic 17px var(--serif); }
.fd-gain { color: #c2d2bb; font-size: 11px; line-height: 14px; }
.fd #spectrum { border-top: 1px solid #6d7f65; padding: 10px 26px 0; background: #153d34; border-radius: 0 0 11px 11px; }
.fd-spectrum-head { gap: 12px; margin-bottom: 10px; }
.fd-spectrum-head h3 { color: #f9edcd; font: 600 27px/1.1 var(--serif); margin: 0; }
.fd-rack-rule { flex: 1; height: 4px; border-block: 1px solid #9eaa8666; }
.fd #board-count { color: #d3d8bc; font-size: 10px; }
.fd #bars {
  background: #082e29; border: 1px solid #74816a; border-radius: 6px; box-shadow: inset 0 2px 4px #071b17;
  padding: 6px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(5,auto); grid-auto-flow: column; gap: 5px 9px;
}
.fd-flap {
  display: grid; position: relative; min-width: 0; min-height: 30px; align-items: center; padding: 0 8px 0 0;
  grid-template-columns: 43px minmax(0,1fr); gap: 9px; isolation: isolate;
  border-radius: 3px; border: 1px solid #596756; border-bottom-color: #192d24;
  background: linear-gradient(to bottom,#41584a 0%,#354f42 48%,#182e26 49%,#5e715b 52%,#345042 56%,#30483b 100%);
  box-shadow: 0 2px 1px #061f1c; color: #ebe7cf;
}
.fd-flap::before {
  content: attr(data-rank); display: grid; place-items: center; align-self: stretch;
  font: 600 14px/1 var(--machine-mono); letter-spacing: .05em; border-right: 1px solid #777e65;
  color: #edd49f; background: linear-gradient(180deg,#455646 48%,#283b2e 49%,#52634e 54%,#394d3d 56%);
}
.fd-blanks { justify-self: center; width: 56px; height: 6px;
  background: radial-gradient(circle at center,#d0c49c 1.25px,transparent 1.6px) 0 0/8px 6px repeat-x; }
.fd-flap[data-spare] { opacity: .5; }
.fd-flap[data-spectrum-row] {
  background: #365844; grid-template-columns: 43px minmax(0,1fr) minmax(32px,24%) 37px;
  font: 600 15px/1.1 var(--sans); animation: fd-flip .28s ease-out both; animation-delay: calc(var(--flip-order) * 45ms);
}
.fd-flap[data-selected] { background: #fae3a3; color: #24402c; border-color: #deb35c; }
.fd-flap[data-spectrum-row] > :last-child { text-align: right; font: 600 12px var(--machine-mono); }
.fd-track { display: block; height: 5px; background: #1d3b30; border-radius: 1px; }
.fd-track i { display: block; height: 100%; background: #e6bd79; }
.fd[data-mode="rare"] .fd-track i { background: #a0dec6; }
.fd-board-foot { justify-content: space-between; gap: 8px; min-height: 40px; }
.fd-board-foot .fd-kicker { color: #b9c8ac; font-size: 9px; letter-spacing: .14em; }
.fd #next { min-height: 32px; font-size: 14px; margin: 6px 0 8px; }
.fd .fd-history { margin: 9px 4px 0; }
.fd-history > summary { width: fit-content; color: #315549; }
.fd-history-inner { max-width: 560px; background: #faf6e8; border: 1px solid #b4b39a; color: #223d32; padding: 16px; border-radius: 6px; }
.fd-history-inner input { width: 100%; margin-bottom: 7px; }
.fd-history-inner p { font-size: 14px; overflow-wrap: anywhere; }
.fd #flight-log {
  scroll-margin-top: 93px; background: #e9ddba; background-image: linear-gradient(110deg,transparent,#f1e7c9 47%,#dbceb0);
  border: 1px solid #a59160; border-radius: 9px; box-shadow: 0 4px 0 #ab9f80,0 9px 20px #4b493022;
  padding: clamp(18px,3vw,32px); margin: 16px 0; color: #1b352e; animation: fd-open .38s ease-out;
}
.fd-log-head { justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.fd-log-head h2 { font: 600 clamp(30px,3.2vw,45px)/1.15 var(--serif); margin: 4px 0 0; }
.fd #log-total { font: 600 clamp(20px,2.6vw,32px)/1 var(--machine-mono); white-space: nowrap; }
.fd-log-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(250px,1fr); gap: 24px; }
.fd-log-preview { perspective: 950px; }
.fd-log-preview > svg { display: block; width: 100%; height: auto; box-shadow: 3px 5px 10px #64583f44; transform-origin: left center; animation: fd-page .5s ease-out both; }
.fd-log-preview svg g[transform='rotate(-3 1040 723)'] { transform-origin: 1040px 723px; animation: fd-stamp .35s .24s ease-out backwards; }
.fd-log-tools { display: flex; flex-direction: column; gap: 8px; }
.fd-log-tools label { margin: 0; }
.fd-log-tools input { width: 100%; }
.fd-log-tools small { margin-bottom: 8px; }
.fd-export { display: flex; flex-wrap: wrap; gap: 7px; }
.fd-export button { flex: auto; }
.fd #log-message:empty, .fd #history-message:empty { display: none; }
@keyframes fd-flip { from { transform: perspective(350px) rotateX(-82deg); opacity: .4; } to { transform: rotateX(0); } }
@keyframes fd-page { from { transform: rotateY(-26deg); opacity: .2; } to { transform: rotateY(0); } }
@keyframes fd-stamp { from { scale: 1.3; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes fd-open { from { opacity: .3; } to { opacity: 1; } }
@media (min-width: 920px) {
  .fd-progress { gap: 15px; } .fd-progress i { display: block; text-align: center; }
  .fd-progress i span { display: inline; }
  .fd-progress i::before { display: block; margin: 0 auto 4px; }
}
@media (max-width: 760px) {
  .fd .fd-controls { grid-template-columns: auto 1fr; padding: 11px 12px; gap: 10px 8px; }
  .fd-mode button { min-width: 79px; height: 36px; gap: 5px; }
  .fd-knobs { grid-column: 2; grid-row: 1; }
  .fd-progress { grid-column: 1 / -1; grid-row: 2; gap: 12px; }
  .fd-progress i { display: flex; align-items: center; gap: 3px; }
  .fd-progress i span { display: inline; }
  .fd-progress i::before { width: 8px; height: 8px; margin: 0 3px 0 0; }
  .fd-console { grid-template-columns: minmax(0,1fr) 150px; padding: 14px 15px 8px; gap: 16px; }
  .fd #question { font-size: 32px; height: 104px; }
  .fd #question[data-long] { font-size: 26px; }
  .fd-telemetry { gap: 6px; }
  .fd-gauge { width: 42px; height: 42px; }
  .fd .fd-gain { font-size: 10px; }
  .fd #spectrum { padding: 9px 14px 0; }
  .fd-log-grid { grid-template-columns: 1fr; }
}
@media (min-width: 571px) and (max-width: 920px) {
  .fd #scope { height: 42px; }
}
@media (max-width: 570px) {
  .fd .fd-layout { padding: 3px; border-radius: 12px; }
  .fd .fd-machine { border-radius: 9px; }
  .fd .fd-controls { border-radius: 8px 8px 0 0; padding: 10px 8px 9px; gap: 8px 4px; }
  .fd-mode button { min-width: 65px; padding: 0 4px; }
  .fd-mode b { font-size: 12px; }
  .fd-mode small { font-size: 10px; }
  .fd-mode button > svg { display: none; }
  .fd-select select { width: 85px; padding-left: 9px; font-size: 12px; height: 33px; }
  .fd-select:last-child select { width: 77px; }
  .fd-select > svg:first-child { display: none; }
  .fd-knobs { gap: 3px; }
  .fd-console { grid-template-columns: minmax(0,1fr); gap: 1px; padding: 12px 13px 10px; }
  .fd #question { height: 100px; font-size: 32px; }
  .fd #question[data-long] { font-size: 26px; }
  .fd #scope { font-size: 14px; line-height: 17px; height: 37px; }
  .fd-instruments { display: flex; align-items: stretch; height: 57px; }
  .fd-sky { height: 100%; width: 38%; flex: none; border-bottom: 0; border-right: 1px solid #a5966b; }
  .fd .fd-balloon { height: 44px; width: 36px; top: 5px; }
  .fd-telemetry { flex: auto; gap: 8px; padding: 3px; }
  .fd-reading { font-size: 18px; margin: 0; }
  .fd-alt-label { font-size: 8px; line-height: 9px; }
  .fd-gain { line-height: 11px; }
  .fd .fd-entry { gap: 5px; }
  .fd #answer { font-size: 16px; padding: 0 10px; }
  .fd #record { padding: 0 11px; font-size: 14px; gap: 4px; }
  .fd #spectrum { padding: 9px 10px 0; }
  .fd #bars { gap: 4px 5px; padding: 4px; }
  .fd-spectrum-head { margin-bottom: 7px; gap: 8px; }
  .fd-spectrum-head h3 { font-size: 24px; }
  .fd-flap { grid-template-columns: 32px minmax(0,1fr); gap: 4px; min-height: 27px; }
  .fd-flap::before { font-size: 11px; }
  .fd-flap[data-spectrum-row] { grid-template-columns: 26px minmax(0,1fr) 26px; font-size: 12px; min-height: 38px; padding-right: 4px; gap: 3px; }
  .fd-flap[data-spectrum-row] > :first-child { overflow-wrap: anywhere; }
  .fd-flap[data-spectrum-row] > :last-child { font-size: 10px; }
  .fd-track { position: absolute; left: 30px; right: 6px; bottom: 1px; height: 2px; }
  .fd-board-foot .fd-kicker { font-size: 8px; letter-spacing: .04em; }
  .fd-history > summary { font-size: 12px; }
}
@media (max-width: 375px) {
  .fd-mode button { min-width: 56px; }
  .fd-select select { width: 77px; } .fd-select:last-child select { width: 64px; }
  .fd .fd-controls { padding-inline: 6px; }
  .fd-console { padding-inline: 10px; }
  .fd #question { font-size: 29px; height: 96px; }
  .fd #question[data-long] { font-size: 23px; }
  .fd #scope { height: 51px; }
  .fd .fd-answer-word { display: none; }
  .fd-progress { gap: 8px; }
  .fd-progress i { font-size: 9px; }
}
@media (max-width: 570px) {
  .fd .fd-controls { grid-template-columns: minmax(0,1fr) auto; gap: 7px; padding: 9px 10px; }
  .fd-mode { grid-column: 1 / -1; justify-self: stretch; }
  .fd-mode button { flex: 1; min-width: 0; height: 31px; }
  .fd-mode button > span { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
  .fd .fd-mode button > svg { display: none; }
  .fd-progress { grid-column: 1; grid-row: 2; justify-content: space-between; gap: 0; max-width: 155px; width: 100%; }
  .fd-progress i { display: grid; gap: 2px; line-height: 10px; }
  .fd-progress i span { display: none; }
  .fd-progress i::before { margin: 0 auto; }
  .fd-knobs { grid-row: 2; }
  .fd-select select { width: 83px; } .fd-select:last-child select { width: 72px; }
  .fd-spectrum-head h3, .fd #board-count { white-space: nowrap; }
  .fd #board-count { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .fd *, .fd *::before, .fd *::after { animation: none !important; transition: none !important; }
}
