.farflung {
  --ink: #39362a;
  --paper: #eee4ca;
  --muted: #716b59;
  --line: #b5aa8f;
  --red: #a64e3b;
  --green: #49604c;
  --soft: #dedcc6;
}
.farflung {
  background: #e9dfc5;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background-image: radial-gradient(#6e5b3520 0.6px, transparent 0.6px);
  background-size: 5px 5px;
  height: 700px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.farflung button,
.farflung input {
  font-family: inherit;
}
.farflung button:focus-visible,
.farflung a:focus-visible,
.farflung input:focus-visible {
  outline: 3px solid #a64e3b;
  outline-offset: 4px;
}
.farflung button:disabled {
  opacity: 0.45;
  cursor: default;
}
.farflung [hidden] {
  display: none !important;
}
.farflung .masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--line);
}
.farflung .wordmark {
  display: grid;
  grid-template-columns: 40px auto;
  column-gap: 12px;
  align-items: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
}
.farflung .wordmark svg {
  grid-row: span 2;
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--red);
  stroke-width: 1.2;
}
.farflung .wordmark span {
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1.5px;
  margin-top: 3px;
}
.farflung .header-actions {
  display: flex;
  gap: 18px;
}
.farflung .quiet {
  background: none;
  border: 0;
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.farflung .atlas-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 26px;
  max-width: 1560px;
  margin: 26px auto;
  padding-inline: 30px;
  align-items: start;
}
.farflung .map-panel {
  min-width: 0;
  position: sticky;
  top: 20px;
}
.farflung .map-rim {
  position: relative;
  overflow: hidden;
  border: 1px solid #96876a;
  outline: 1px solid #bfb194;
  outline-offset: 5px;
  min-height: 650px;
  background: #cbd0bc;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 44px, #77836b22 44px 45px),
    repeating-linear-gradient(90deg, transparent 0 44px, #77836b22 44px 45px);
}
.farflung #atlas {
  display: block;
  width: 100%;
  height: 650px;
  touch-action: none;
  cursor: crosshair;
}
.farflung .land {
  fill: #e9dfbd;
  stroke: #8a886c;
  stroke-width: 0.65;
  vector-effect: non-scaling-stroke;
  transition: fill 0.15s;
}
.farflung .land.selectable:hover {
  fill: #d7bf80;
}
.farflung .land.selected {
  fill: #b97754;
  stroke: #693e2d;
  stroke-width: 1.5;
}
.farflung .land.correct {
  fill: #8b9d70;
}
.farflung .land.miss {
  fill: #b77a66;
}
.farflung .graticule {
  fill: none;
  stroke: #77836b44;
  stroke-width: 0.6;
  pointer-events: none;
}
.farflung .map-pin {
  fill: #a64e3b;
  stroke: #fff4d8;
  stroke-width: 2;
  pointer-events: none;
}
.farflung .sea-label {
  pointer-events: none;
  position: absolute;
  font:
    italic 14px/1.5 Georgia,
    serif;
  text-align: center;
  letter-spacing: 4px;
  color: #596b5d80;
}
.farflung .atlantic {
  left: 35%;
  top: 52%;
}
.farflung .indian {
  left: 73%;
  top: 67%;
}
.farflung .map-tools {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  gap: 5px;
}
.farflung .map-tools button {
  background: #f5eed9;
  border: 1px solid #a39676;
  width: 34px;
  height: 34px;
  font: 22px Georgia;
  cursor: pointer;
  box-shadow: 2px 2px 0 #86775920;
}
.farflung .compass {
  position: absolute;
  right: 18px;
  bottom: 42px;
  width: 76px;
  pointer-events: none;
  color: #676c54;
}
.farflung .compass span {
  display: block;
  text-align: center;
  font:
    11px ui-monospace,
    monospace;
}
.farflung .compass svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}
.farflung .map-caption {
  position: absolute;
  left: 20px;
  bottom: 18px;
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 2px;
  color: #5b624f;
}
.farflung .map-credit {
  position: absolute;
  right: 16px;
  bottom: 14px;
  font:
    8px ui-monospace,
    monospace;
  letter-spacing: 1px;
  color: #66705c;
}
.farflung #map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #e5ddc5;
  font:
    13px ui-monospace,
    monospace;
  letter-spacing: 2px;
}
.farflung .panel {
  border: 1px solid #ac9d7e;
  outline: 1px solid #c7bda4;
  outline-offset: 4px;
  padding: 28px 25px;
  background: #f5eedb;
  box-shadow: 5px 7px 0 #8c78581a;
  min-height: 650px;
}
.farflung .eyebrow {
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 1.8px;
  color: var(--red);
  line-height: 1.6;
  margin-bottom: 18px;
}
.farflung .panel h1,
.farflung .panel h2,
.farflung dialog h2 {
  font-family: Georgia, serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -1.4px;
}
.farflung .lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  margin: 16px 0 0;
}
.farflung .clock-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 26px 0 22px;
}
.farflung .clock-options button {
  padding: 12px 7px;
  border: 1px solid #b5a78b;
  background: transparent;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.farflung .clock-options button[aria-pressed="true"] {
  background: #e0e1c8;
  border-color: #687653;
}
.farflung .clock-options strong {
  display: block;
  font: 14px Georgia;
}
.farflung .clock-options span {
  display: block;
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
  margin-top: 6px;
}
.farflung .primary,
.farflung .secondary {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid #455944;
  background: var(--green);
  color: #fff9e9;
  font: 600 15px Georgia;
  cursor: pointer;
}
.farflung .primary:hover {
  background: #364c3a;
}
.farflung .secondary {
  background: transparent;
  color: var(--ink);
  border-color: #a89b7c;
  margin-top: 12px;
}
.farflung .secondary:hover {
  background: #e9e0c8;
}
.farflung .fine {
  font:
    10px/1.6 ui-monospace,
    monospace;
  color: var(--muted);
  margin: 10px 0;
}
.farflung .prototype-note {
  border-top: 1px solid #c7bca2;
  margin-top: 22px;
  padding-top: 16px;
  font:
    10px/1.6 ui-monospace,
    monospace;
  color: #897b66;
}
.farflung .round-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.farflung .round-top .eyebrow {
  margin: 0;
}
.farflung .timer {
  font:
    25px ui-monospace,
    monospace;
  font-variant-numeric: tabular-nums;
}
.farflung .timer.urgent {
  color: var(--red);
}
.farflung .progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin: 18px 0 25px;
}
.farflung .progress span {
  height: 5px;
  background: #d4cbb2;
}
.farflung .progress span.done {
  background: #7e9566;
}
.farflung .progress span.active {
  background: #a64e3b;
}
.farflung .category {
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 2px;
  color: var(--red);
  margin-bottom: 12px;
}
.farflung .panel #question {
  font-size: 29px;
  letter-spacing: -0.8px;
}
.farflung .scope {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 16px 0 25px;
}
.farflung .search-label {
  display: block;
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
  margin-bottom: 8px;
}
.farflung input[type="search"] {
  width: 100%;
  border: 1px solid #b7aa8c;
  background: #fff9e9;
  padding: 12px;
  font-size: 15px;
  border-radius: 0;
}
.farflung .suggestions {
  display: grid;
  gap: 0;
  max-height: 180px;
  overflow: auto;
  border: 1px solid #b7aa8c;
  border-top: 0;
}
.farflung .suggestions button {
  background: #fff9e9;
  padding: 9px 12px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #e0d7c0;
  font-size: 13px;
  cursor: pointer;
}
.farflung .suggestions button:hover {
  background: #e6dec3;
}
.farflung .selection {
  padding: 19px 0 22px;
}
.farflung .selection span {
  display: block;
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.farflung .selection strong {
  display: block;
  font-size: 22px;
  margin-top: 6px;
}
.farflung .score-reveal {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 0 23px;
  border-top: 1px solid var(--line);
}
.farflung .score-reveal > strong {
  font-size: 56px;
  color: var(--green);
  line-height: 1;
}
.farflung .score-reveal > div > span {
  font-weight: 700;
}
.farflung .score-reveal p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.farflung .answer-caption {
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.farflung .answer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 24px;
  max-height: 190px;
  overflow: auto;
}
.farflung .answer-chips button {
  border: 1px solid #c0b393;
  background: transparent;
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
}
.farflung .answer-chips button:hover {
  background: #dfdec4;
}
.farflung .total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 23px 0;
}
.farflung .total strong {
  font-size: 80px;
  line-height: 1;
  color: var(--green);
}
.farflung .total span {
  font:
    14px ui-monospace,
    monospace;
  color: var(--muted);
}
.farflung .stamp {
  width: 150px;
  height: 150px;
  border: 3px double #9e523e;
  outline: 1px solid #9e523e;
  outline-offset: -9px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  color: #9e523e;
  font: 700 18px/1.3 Georgia;
  letter-spacing: 1px;
  transform: rotate(-9deg);
  margin: 18px auto 26px;
}
.farflung .summary-rows {
  margin-bottom: 22px;
}
.farflung .summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #d8cdb5;
  padding: 8px 0;
  font-size: 12px;
}
.farflung .summary-row small {
  color: var(--muted);
}
.farflung footer {
  max-width: 1560px;
  margin: 24px auto 0;
  padding: 18px 30px 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font:
    9px/1.5 ui-monospace,
    monospace;
  border-top: 1px solid #b5aa8f;
}
.farflung footer a {
  text-decoration: underline;
}
.farflung dialog {
  max-width: 520px;
  width: calc(100% - 32px);
  border: 1px solid #958368;
  background: #f5eedb;
  color: var(--ink);
  padding: 32px;
}
.farflung dialog::backdrop {
  background: #25271999;
}
.farflung dialog p:not(.eyebrow) {
  font-size: 15px;
  line-height: 1.7;
  margin: 18px 0;
}
.farflung #close {
  position: absolute;
  right: 12px;
  top: 8px;
  background: none;
  border: 0;
  font: 26px Georgia;
  cursor: pointer;
}
@media (max-width: 900px) {
  .farflung .masthead {
    padding: 16px 20px;
  }
  .farflung .wordmark {
    font-size: 19px;
  }
  .farflung .wordmark span {
    font-size: 7px;
  }
  .farflung .header-actions {
    gap: 12px;
  }
  .farflung .header-actions .quiet {
    font-size: 11px;
  }
  .farflung .atlas-shell {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 20px;
    margin-top: 20px;
  }
  .farflung .map-panel {
    position: relative;
    top: auto;
  }
  .farflung .map-rim {
    min-height: 380px;
  }
  .farflung #atlas {
    height: 380px;
  }
  .farflung .panel {
    min-height: 0;
    padding: 25px;
  }
  .farflung .panel h1 br {
    display: none;
  }
  .farflung .panel h1 {
    font-size: 36px;
  }
  .farflung .map-credit {
    font-size: 7px;
    bottom: 9px;
  }
  .farflung .map-caption {
    bottom: 30px;
    max-width: 150px;
    font-size: 8px;
  }
  .farflung .compass {
    width: 56px;
    bottom: 35px;
  }
  .farflung .sea-label {
    font-size: 10px;
  }
  .farflung .lead {
    margin-block: 14px 0;
  }
  .farflung .clock-options {
    margin-block: 20px;
  }
  .farflung .panel #question {
    font-size: 28px;
  }
}
@media (max-width: 480px) {
  .farflung .masthead {
    gap: 10px;
    align-items: flex-start;
  }
  .farflung .header-actions {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 110px;
  }
  .farflung .wordmark {
    font-size: 16px;
    grid-template-columns: 28px auto;
    gap: 7px;
    letter-spacing: 1px;
  }
  .farflung .wordmark svg {
    width: 28px;
    height: 28px;
  }
  .farflung .wordmark span {
    font-size: 6px;
    letter-spacing: 0.8px;
  }
  .farflung .atlas-shell {
    padding: 0 14px;
  }
  .farflung .map-rim {
    min-height: 310px;
  }
  .farflung #atlas {
    height: 310px;
  }
  .farflung .panel {
    padding: 24px 20px;
  }
  .farflung .map-tools {
    top: 12px;
    left: 12px;
  }
  .farflung .map-tools button {
    width: 30px;
    height: 30px;
  }
  .farflung .compass {
    width: 46px;
  }
  .farflung .indian {
    display: none;
  }
  .farflung .map-credit {
    font-size: 6px;
  }
  .farflung .map-caption {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .farflung .header-actions .quiet {
    padding: 0;
    font-size: 10px;
  }
  .farflung .clock-options strong {
    font-size: 14px;
  }
  .farflung footer {
    padding-inline: 18px;
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .farflung * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.farflung .mobile-clue {
  display: none;
}
@media (max-width: 900px) {
  .farflung.is-playing .atlas-shell {
    gap: 16px;
  }
  .farflung.is-playing .mobile-clue {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 8px;
    z-index: 5;
    padding: 14px;
    border: 1px solid #a39676;
    background: #f5eedb;
    box-shadow: 0 3px 12px #443b2520;
    font-size: 17px;
    line-height: 1.4;
  }
  .farflung #mobile-time {
    font:
      21px ui-monospace,
      monospace;
    white-space: nowrap;
  }
  .farflung.is-playing .panel .round-top,
  .farflung.is-playing .panel .progress,
  .farflung.is-playing .panel #question {
    display: none;
  }
  .farflung.is-playing .panel .scope {
    margin-block: 0 18px;
  }
  .farflung.is-playing .panel .category {
    margin-top: 0;
  }
}

/* Host chrome uses The Dles shared styles; map styling stays in the game. */
.farflung-player .game-shell-stage {
  padding: 0;
  background: #e9dfc5;
}
.farflung-player .game-shell-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.farflung-player .game-shell-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.game-page-heading {
  width: 100%;
  max-width: none;
}
.farflung .play-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.farflung .atlas-shell {
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, 1fr);
  gap: 18px;
  margin: 0;
  padding: 20px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
.farflung .map-rim {
  height: 100%;
  min-height: 0;
}
.farflung #atlas {
  height: 100%;
}
.farflung .panel {
  padding: 22px;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.farflung .panel h2 {
  font-size: 32px;
}
.farflung .map-panel {
  position: relative;
  top: auto;
  min-height: 0;
}
.farflung-guide {
  margin: 32px auto 0;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.farflung-guide h2 {
  margin: 10px 0 20px;
}
.farflung-guide h3 {
  margin: 24px 0 12px;
}
.farflung-guide p,
.farflung-guide li {
  color: var(--muted);
  line-height: 1.8;
}
.farflung-guide p {
  margin: 12px 0;
}
.farflung-guide ol {
  padding-left: 22px;
}
.farflung-guide .eyebrow {
  color: #65735e;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.guide-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}
.guide-columns h2 {
  font-size: 22px;
  margin: 12px 0 12px;
}
.farflung-guide .inline-link {
  display: inline-block;
  margin: 16px 24px 0 0;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.guide-faq details {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.guide-faq summary {
  cursor: pointer;
  font-weight: 600;
}
.game-breadcrumbs {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.game-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.game-breadcrumbs li + li::before {
  content: "/";
  margin-right: 8px;
  opacity: 0.5;
}
.site-footer {
  margin-top: 12px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}
.site-footer p {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 1100px) {
  .farflung .atlas-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }
  .farflung .map-rim {
    min-height: 0;
  }
  .farflung #atlas {
    height: 100%;
  }
}
@media (max-width: 700px) {
  .guide-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .farflung .play-header {
    padding: 14px;
  }
  .farflung .play-header > .eyebrow {
    font-size: 8px;
  }
  .farflung .atlas-shell {
    padding: 16px;
  }
  .farflung .map-rim {
    min-height: 0;
  }
  .farflung #atlas {
    height: 100%;
  }
}

/* The mobile clue is outside the map/panel grid so it cannot add a grid row. */
@media (max-width: 900px) {
  .farflung.is-playing .mobile-clue {
    position: static;
    flex-shrink: 0;
    margin: 12px 16px 0;
    max-height: 100px;
    overflow-y: auto;
  }
}
