/* The control deck: pictures in place of forms. Left click one for more of something, right click
   for less; a line at the foot of the panel says what the picture under the pointer does. A
   settlement of your own is a wheel of jobs over a page for whichever job you are looking into.
   Loaded after style.css and additions.css. */

/* ---------------------------------------------------------------- tiles */

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.tiles > .wide { grid-column: 1 / -1; }

.tile {
  appearance: none;
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: 7px 4px 7px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 241, 208, 0.11), rgba(255, 241, 208, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 2px 5px rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.tile:hover { border-color: var(--gold); background: linear-gradient(180deg, rgba(255, 241, 208, 0.2), rgba(255, 241, 208, 0.07)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 14px rgba(239, 198, 107, 0.2); }
.tile:active { transform: translateY(1px) scale(0.97); }
.tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tile[hidden] { display: none; }

.tile-ic { width: 48px; height: 48px; display: block; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); transition: transform 0.12s ease, filter 0.12s ease; }
.tile:hover .tile-ic { transform: translateY(-1px) scale(1.06) rotate(-2deg); }
.tile-cap { font-size: 11px; line-height: 1.15; color: var(--ink-2); max-width: 100%; overflow-wrap: break-word; pointer-events: none; }
.tile-cap small { display: block; font-size: 10.5px; line-height: 1.2; }
.tile-cap small.warn { color: var(--bad); font-weight: 700; }

/* The number on a tile sits on a brass stud at its corner. */
.tile-n {
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 21px;
  padding: 0 5px;
  border-radius: 999px;
  font: 700 12.5px/20px var(--sans);
  font-variant-numeric: tabular-nums;
  background: var(--brass);
  color: var(--ink-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 3px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.tile-n:empty { display: none; }

/* Nobody doing this job: the picture dozes. */
.tile.zero .tile-ic { filter: grayscale(0.65) brightness(0.8) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); opacity: 0.78; }
.tile.zero .tile-n { background: rgba(0, 0, 0, 0.5); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.tile.zero:hover .tile-ic { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); opacity: 1; }

/* Chosen, or with people in hand. */
.tile.on { border-color: #fff1c4; background: var(--brass); color: var(--ink-dark); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 16px rgba(239, 198, 107, 0.35); }
.tile.on .tile-cap { color: #4d3c12; }
.tile.on .tile-cap small { color: #5d4a16; }
.tile.on .tile-n { background: var(--ink-dark); color: #ffe9a8; box-shadow: none; }

.tile.primary { border-color: rgba(232, 104, 60, 0.75); background: linear-gradient(180deg, rgba(232, 104, 60, 0.34), rgba(232, 104, 60, 0.12)); }
.tile.primary:hover { border-color: #ffb08f; background: linear-gradient(180deg, rgba(232, 104, 60, 0.5), rgba(232, 104, 60, 0.2)); }
.tile.danger { border-color: rgba(255, 122, 102, 0.6); background: linear-gradient(180deg, rgba(120, 20, 20, 0.5), rgba(60, 10, 14, 0.5)); }
.tile.danger:hover { border-color: var(--bad); box-shadow: 0 0 16px rgba(255, 90, 70, 0.35); }
/* The monument: gold, because of course it is. */
.tile.gold { border-color: #ffe08f; background: linear-gradient(180deg, rgba(255, 214, 110, 0.32), rgba(255, 214, 110, 0.1)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 16px rgba(255, 214, 110, 0.3); }
.tile.gold:hover { border-color: #fff1c4; background: linear-gradient(180deg, rgba(255, 214, 110, 0.46), rgba(255, 214, 110, 0.18)); }
.tile.poor { opacity: 0.5; }
.tile.poor:hover { opacity: 0.8; }
.tile[aria-disabled='true'] { cursor: default; }
.tile.still { cursor: default; border-style: dashed; background: transparent; box-shadow: none; }
.tile.still:hover { border-color: var(--line-2); box-shadow: none; }
.tile.still:hover .tile-ic { transform: none; }
.tile.still:active { transform: none; }

/* Progress along the foot of a tile. */
.tile-bar { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 4px; border-radius: 3px; background: rgba(0, 0, 0, 0.5); overflow: hidden; pointer-events: none; }
.tile-bar > i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(180deg, #ffe08f, #dba63c); transition: width 0.2s linear; }

/* The work the builders have in hand: one long tile. */
.tile.wide { grid-template-columns: 52px 1fr; justify-items: start; align-items: center; text-align: left; gap: 10px; padding: 8px 10px 12px; }
.tile.wide .tile-cap { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.tile.wide .tile-cap small { font-weight: 400; color: var(--ink-2); margin-top: 2px; }
.tile.wide .tile-bar { height: 6px; left: 10px; right: 10px; bottom: 5px; }
.tiles > .note.wide { padding: 2px 0; }

/* Small tiles: gear to choose from, things to do with a party. */
.tray { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.tile.mini { padding: 4px; border-radius: 10px; flex: none; }
.tile.mini .tile-ic { width: 34px; height: 34px; }
.tile.mini .tile-cap { display: none; }
.tile.mini .tile-n { top: -6px; right: -6px; min-width: 17px; padding: 0 4px; font-size: 11px; line-height: 17px; }
.garrison .tile.mini { margin-left: auto; }
.party .tile.mini .tile-ic { width: 28px; height: 28px; }

/* A touch screen has no right button, so tiles that have a "less" grow a little minus. */
.tile-less { display: none; }
@media (pointer: coarse) {
  .tile-less {
    display: grid;
    place-items: center;
    position: absolute;
    left: 3px;
    top: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font: 700 17px/1 var(--sans);
    background: rgba(8, 14, 22, 0.82);
    color: var(--ink);
    border: 1px solid var(--line-2);
  }
  .tile.zero .tile-less, .tile.still .tile-less { display: none; }
  .tile-ic { width: 44px; height: 44px; }
}

/* ---------------------------------------------------------------- the wheel */

/* A settlement of your own: the people at rest in the middle, a job at the end of each spoke. */
.hub { position: relative; height: 288px; max-width: 320px; margin: 12px auto 0; --node: 58px; --mid: 78px; }
.hub.few { height: 136px; }
/* The dial it is all mounted on. */
.hub::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 46.2%;
  width: 256px;
  height: 256px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 150, 0.11), rgba(255, 226, 150, 0.035) 46%, transparent 71%);
  border: 1px solid rgba(232, 197, 118, 0.18);
  box-shadow: inset 0 0 0 27px rgba(0, 0, 0, 0.13), inset 0 0 0 28px rgba(232, 197, 118, 0.1);
  pointer-events: none;
}
.hub.few::before { display: none; }

/* The spokes: dotted while nobody is doing the job at the end, lit once somebody is. */
.hub-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.hub-lines line { stroke: rgba(232, 197, 118, 0.42); stroke-width: 2; stroke-dasharray: 1 5; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: stroke 0.25s ease; }
.hub-lines line.live { stroke: #f0cb72; stroke-width: 3; stroke-dasharray: none; filter: drop-shadow(0 0 3px rgba(239, 198, 107, 0.7)); }

/* Where a job sits on the wheel: its picture, and its name-plate underneath. */
.spot { position: absolute; width: 0; height: 0; }
.spot .tile.node { position: absolute; left: 0; top: 0; width: var(--node); height: var(--node); margin: calc(var(--node) / -2) 0 0 calc(var(--node) / -2); }
.spot .tile.node.mid { width: var(--mid); height: var(--mid); margin: calc(var(--mid) / -2) 0 0 calc(var(--mid) / -2); }
.tile.node {
  padding: 0;
  gap: 0;
  place-content: center;
  border-radius: 50%;
  border: 2px solid #b98a2e;
  background: radial-gradient(circle at 50% 30%, #35485f, #131d2b 72%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.13), inset 0 -7px 11px rgba(0, 0, 0, 0.35), 0 4px 9px rgba(0, 0, 0, 0.55);
}
.tile.node:hover { border-color: #ffe08f; background: radial-gradient(circle at 50% 30%, #435b78, #18263a 72%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), 0 0 16px rgba(239, 198, 107, 0.4), 0 4px 9px rgba(0, 0, 0, 0.55); }
.tile.node .tile-ic { width: calc(var(--node) - 16px); height: calc(var(--node) - 16px); }
.tile.node.mid .tile-ic { width: calc(var(--mid) - 20px); height: calc(var(--mid) - 20px); }
.tile.node .tile-cap { display: none; }
.tile.node .tile-n { top: -6px; right: -9px; z-index: 1; }
.tile.node.mid .tile-n { top: -3px; right: -6px; min-width: 25px; font-size: 14px; line-height: 24px; }
.tile.node.locked { border-style: dashed; border-color: var(--line-2); opacity: 0.55; }
.tile.node.locked .tile-n { display: none; }
.tile.node.busy { border-color: #fff1c4; box-shadow: 0 0 18px rgba(239, 198, 107, 0.55), 0 4px 9px rgba(0, 0, 0, 0.55); }

/* The ring round a job fills as its work gets done. Round the middle, it is how full the place is. */
.tile-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(#ffd66e calc(var(--p, 0) * 1%), rgba(255, 241, 208, 0.08) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
}
.tile.node.mid .tile-ring { background: conic-gradient(#8ad873 calc(var(--p, 0) * 1%), rgba(255, 241, 208, 0.08) 0); }

.plate {
  appearance: none;
  /* It hangs off the foot of its picture like a label, leaving the spoke in view. */
  position: absolute;
  left: 0;
  top: calc(var(--node) / 2 - 8px);
  transform: translateX(-50%);
  z-index: 1;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 22, 0.88);
  color: var(--ink-2);
  font: 700 10px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.tile.node.mid ~ .plate { top: calc(var(--mid) / 2 - 9px); }
.plate::after { content: '\203A'; margin-left: 4px; font-size: 13px; line-height: 0; }
.plate:hover { border-color: var(--gold); color: var(--ink); }
.plate:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.plate.on { background: var(--brass); border-color: #fff1c4; color: var(--ink-dark); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 12px rgba(239, 198, 107, 0.35); }
.plate.locked { opacity: 0.5; }
/* People standing about with nothing to do: the plate says so. */
.plate.wants:not(.on) { border-color: var(--bad); color: #ffd3c9; animation: plate-nag 0.9s ease-in-out infinite alternate; }
@keyframes plate-nag { from { box-shadow: 0 0 0 0 rgba(255, 122, 102, 0); } to { box-shadow: 0 0 0 4px rgba(255, 122, 102, 0.35); } }

/* Somebody going off to a job, or coming back from one. */
.bead { position: absolute; z-index: 2; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #fff3b0; box-shadow: 0 0 10px 2px rgba(255, 214, 110, 0.85); pointer-events: none; }

/* ---------------------------------------------------------------- the page under the wheel */

.page { margin-top: 12px; padding: 1px 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, 0.22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.page > * { animation: page-in 0.22s ease-out both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-head h3 { margin: 12px 0 0; }
.page .tiles, .page .tray { margin-top: 10px; }
.page .popline { margin-top: 8px; }
.page .fits, .page > .note { margin-top: 8px; }
.page .tray > .note { flex: 1; min-width: 0; }
.page-what { margin-top: 8px; display: grid; gap: 1px; }
.page-what b { font: 600 15px/1.2 var(--serif); color: #fff7e2; }

/* A sum in pictures: these people, at this, come to that. */
.eq { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 10px 0 2px; padding: 9px 6px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.55); }
.eq-op { font: 700 19px/1 var(--serif); font-style: normal; color: var(--gold); opacity: 0.85; }
.eq .tile.mini { padding: 3px; }
.eq .tile.mini .tile-ic { width: 40px; height: 40px; }
.eq-pic { position: relative; flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; border: 1px dashed var(--line-2); }
.eq-pic img { width: 40px; height: 40px; display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
.eq-pic img:not([src]), .eq-out img:not([src]) { visibility: hidden; }
.eq-pic.who { border-style: solid; border-color: var(--line); background: linear-gradient(180deg, rgba(255, 241, 208, 0.11), rgba(255, 241, 208, 0.03)); }
.eq-pic.who .tile-n { top: -7px; right: -8px; }
.eq-out { display: inline-flex; align-items: center; gap: 5px; flex: 0 1 auto; min-width: 0; padding: 4px 11px 4px 5px; border-radius: 999px; background: var(--brass); color: var(--ink-dark); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 5px rgba(0, 0, 0, 0.45); }
.eq-out img { width: 30px; height: 30px; flex: none; display: block; }
.eq-out b { font: 700 13.5px/1.1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-out.idle { background: rgba(255, 241, 208, 0.08); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); }
.eq-out.idle img { filter: grayscale(0.7); opacity: 0.7; }
.r-now .eq { margin: 0 0 8px; padding: 6px; }

/* What lies in the ground, seam by seam. */
.lodes { display: grid; gap: 5px; margin-top: 10px; }
/* Each row begins with the material's picture. Where it can be worked the picture is a tile that
   counts the gatherers on it (more with one button, fewer with the other, as on the wheel). */
.lode { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 40px; gap: 8px; align-items: center; padding: 5px 8px 5px 5px; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); }
.lode .lode-pic { width: 26px; height: 26px; padding: 2px; border-radius: 50%; background: var(--parchment); display: block; justify-self: center; }
.lode .tile.dig { justify-self: center; }
.lode .tile.dig .tile-ic { width: 32px; height: 32px; }
.lode .tile.dig .tile-n { top: -5px; right: -7px; min-width: 19px; font-size: 12px; line-height: 19px; }
.lode b { display: block; line-height: 1.15; }
.lode small { display: block; font-size: 11px; line-height: 1.25; }
.lode .lode-rate { text-align: right; font-size: 13px; color: var(--good); }
.lode.locked { opacity: 0.5; }
.lode.out { border-style: dashed; background: transparent; }
.lode.out .lode-pic { filter: grayscale(1); opacity: 0.6; }
.lode.deep { border-color: var(--gold); }
/* What lies on the surface is picked up by the people at rest: nobody is set to it, so its row has no number to change. */
.lode.lying { background: transparent; }
.lode.lying .lode-pic { background: transparent; border: 1px solid var(--line); }

/* Walls and turrets: a row to each building. Its picture lays walling on it; the bar is how its
   walls stand; the picture at the end counts the defenders in its turrets. */
.works { display: grid; gap: 5px; margin-top: 8px; }
.work { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: center; padding: 5px 8px 5px 5px; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); }
.work .tile.mini { justify-self: center; }
.work .tile.mini .tile-ic { width: 32px; height: 32px; }
.work .tile.mini .tile-n { top: -5px; right: -9px; min-width: 19px; font-size: 11px; line-height: 18px; }
.work-what { display: block; min-width: 0; }
.work-what b { display: block; line-height: 1.15; }
.work-what small { display: block; font-size: 11px; line-height: 1.25; color: var(--ink-2); }
.work-what .meter { display: block; margin-top: 4px; }

/* ---------------------------------------------------------------- discoveries */

.r-tile { padding-bottom: 10px; }
.r-tile .tile-ic { width: 42px; height: 42px; }
.r-tile .r-tag {
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font: 700 12px/1 var(--sans);
  color: var(--ink-3);
  pointer-events: none;
}
.r-tile .r-tag .ic { width: 14px; height: 14px; }
.r-tile.is-known { border-style: dashed; background: transparent; box-shadow: none; }
.r-tile.is-known .tile-ic { filter: grayscale(0.4) brightness(0.9) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); opacity: 0.85; }
.r-tile.is-known .r-tag { color: var(--good); }
/* Lit while anybody in the tribe is working on it; the number is how many of them are here. */
.r-tile.is-queued { border-color: var(--accent); background: linear-gradient(180deg, rgba(232, 104, 60, 0.3), rgba(232, 104, 60, 0.1)); box-shadow: 0 0 14px rgba(232, 104, 60, 0.25); }
.r-tile .tile-n { top: -6px; right: -6px; background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.r-tile.is-locked { opacity: 0.5; }
.r-tile.is-age { border-color: var(--line-2); }
.r-tile.is-strike:not(.is-known) { border-color: rgba(255, 122, 102, 0.6); }
.r-tile .tile-bar > i { background: linear-gradient(180deg, #ff9a6c, #e25c30); }
/* Made of something your people have never had in their hands: it goes at a third of the pace. */
.r-slow { position: absolute; top: 4px; left: 5px; min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font: 700 12px/1 var(--sans); background: rgba(8, 14, 22, 0.88); color: #ffcfa3; border: 1px solid rgba(255, 160, 100, 0.65); pointer-events: none; }
/* Made of stand-ins here (the ground has not got what it is properly made of): a little duller, with a mark. */
.r-tile.is-blind .tile-ic { filter: saturate(0.6) brightness(0.92) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
/* Cannot be begun yet: its materials are not in store here, or it needs an Academy. */
.r-tile.is-short { border-style: dashed; }
.r-tile.is-short .tile-ic { opacity: 0.6; }
/* The board, pointed at from a settlement's Study page. */

/* ---------------------------------------------------------------- the line that explains */

.tipline {
  position: sticky;
  bottom: -14px;
  z-index: 2;
  margin: 14px -14px -14px;
  padding: 9px 14px 10px;
  min-height: 4.6em;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--glass-solid);
  border-top: 1px solid var(--line-2);
  box-shadow: 0 -8px 14px rgba(1, 9, 16, 0.35);
}
/* Keep it at the foot of the panel even when there is little above it. */
#panel-right { display: flex; flex-direction: column; }
#panel-right > * { flex: none; }
#selection { margin-bottom: 14px; }
.side > .tipline { margin-top: auto; }
.tipline b { color: var(--gold); font-family: var(--serif); font-size: 13.5px; margin-right: 2px; }
.tipline.idle { color: var(--ink-3); font-style: italic; }

/* ---------------------------------------------------------------- monuments going up */

.omens { position: absolute; top: 48px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; max-width: 100%; pointer-events: none; z-index: 1; }
.omen {
  appearance: none;
  pointer-events: auto;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 250px;
  max-width: 100%;
  padding: 5px 12px 6px 7px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid rgba(255, 122, 102, 0.7);
  border-left: 6px solid var(--who, var(--gold));
  background: var(--glass-solid);
  box-shadow: var(--shadow), var(--edge);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.omen.mine { border-color: var(--line-2); border-left-color: var(--who, var(--gold)); }
.omen:hover { border-color: var(--gold); }
.omen img { width: 36px; height: 36px; display: block; }
.omen b { display: block; font: 600 14px/1.2 var(--serif); color: #fff7e2; }
.omen small { display: block; font-size: 11.5px; line-height: 1.25; }
.omen em { font: 700 15px/1 var(--sans); font-style: normal; font-variant-numeric: tabular-nums; color: var(--bad); }
.omen.mine em { color: var(--gold); }
.omen-bar { display: block; height: 5px; margin-top: 4px; border-radius: 3px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.omen-bar > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(180deg, #ff9484, #e44a37); transition: width 0.3s linear; }
.omen.mine .omen-bar > i { background: linear-gradient(180deg, #ffe08f, #dba63c); }
.omen.near { animation: omen-near 0.8s ease-in-out infinite alternate; }
@keyframes omen-near { from { box-shadow: var(--shadow), 0 0 0 0 rgba(255, 122, 102, 0); } to { box-shadow: var(--shadow), 0 0 0 5px rgba(255, 122, 102, 0.4); } }
.omen.mine.near { animation-name: omen-mine; }
@keyframes omen-mine { from { box-shadow: var(--shadow), 0 0 0 0 rgba(239, 198, 107, 0); } to { box-shadow: var(--shadow), 0 0 0 5px rgba(239, 198, 107, 0.45); } }

/* ---------------------------------------------------------------- settlement header */

.sel-name .pill.age { margin-left: auto; cursor: help; flex: none; }
.pill.age.behind { background: linear-gradient(180deg, #ffb39d, #e2644a); color: #2a0d07; animation: age-behind 1.6s ease-in-out infinite alternate; }
@keyframes age-behind { from { box-shadow: 0 0 0 0 rgba(255, 122, 102, 0); } to { box-shadow: 0 0 0 4px rgba(255, 122, 102, 0.35); } }

/* The rules in force and the voyage code, under the leader on the chart. */
.rules-strip {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px 14px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
}
.rules-strip small { display: block; }
.rules-strip.news { border-color: var(--gold-2, #c9a24a); }
.rules-strip.ended { grid-template-columns: 1fr; border-color: rgba(200, 213, 228, 0.35); background: rgba(3, 6, 12, 0.55); }
.rules-strip.ended small { max-width: 70ch; text-wrap: pretty; }
.rules-strip.news small { max-width: 62ch; text-wrap: pretty; }
.rules-strip .code { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.rules-strip .code b { font: 700 15px/1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.08em; color: var(--gold); margin-left: 4px; user-select: all; -webkit-user-select: all; }
.voyages .foot { gap: 6px; flex-wrap: wrap; }
.code-form { display: flex; gap: 8px; margin-top: 14px; }
.code-form input {
  flex: 1;
  min-width: 0;
  font: 700 22px/1.2 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 10px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-2);
  border-radius: 10px;
}
.code-form input::placeholder { color: rgba(239, 198, 107, 0.3); }

/* The same pictures, beside what they mean on the How to play sheet. */
.help-ic { width: 40px; height: 40px; flex: none; display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }

@media (max-width: 640px) {
  .rules-strip { grid-template-columns: 1fr auto; }
  .rules-strip .code { grid-column: 1 / -1; }
  .hub { --node: 52px; --mid: 70px; height: 268px; }
  .hub.few { height: 124px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .tile-ic { transition: none; }
  .pill.age.behind { animation: none; }
}

.help div { grid-template-columns: 42px 1fr; }

/* Warriors who have their weapons and are not ready to use them yet: the number wears amber, and
   the ring round the job counts them down. */
.tile.arming .tile-n { background: #6b4a12; color: #ffe9a8; box-shadow: inset 0 0 0 1px #ffd66e; }
.tile.node.arming .tile-ring { background: conic-gradient(#ffb347 calc(var(--p, 0) * 1%), rgba(255, 241, 208, 0.08) 0); }
.arming-note { margin-top: 6px; color: #ffcf7a; font-weight: 600; font-variant-numeric: tabular-nums; }

/* The alarm over the wheel of a settlement somebody is coming for: what is happening, and the
   quick ways of answering it. Afterwards it stays, quietly, until whoever was called up is sent home. */
.alarm { margin: 10px 0 2px; padding: 9px 10px 10px; border: 1px solid rgba(255, 122, 102, 0.75); border-left-width: 4px; border-radius: 10px; background: linear-gradient(180deg, rgba(232, 74, 55, 0.24), rgba(232, 74, 55, 0.08)); animation: alarm-on 0.9s ease-in-out infinite alternate; }
.alarm[hidden] { display: none; }
.alarm p { margin: 0; font-size: 13px; line-height: 1.4; color: #ffe9e2; font-variant-numeric: tabular-nums; }
.alarm .tiles { margin-top: 8px; }
.alarm.calm { border-color: var(--line-2); background: var(--paper-2); animation: none; }
.alarm.calm p { color: var(--ink-2); }
@keyframes alarm-on { from { box-shadow: 0 0 0 0 rgba(255, 122, 102, 0); } to { box-shadow: 0 0 0 4px rgba(255, 122, 102, 0.28); } }
@media (prefers-reduced-motion: reduce) { .alarm { animation: none; } }

/* An attack on the way, in the strip over the map. */
.omen.raid em { min-width: 34px; text-align: right; }
.omen .shield { width: 15px; height: 18px; display: inline-block; }

/* Whatever is in hand rides on the pointer: whose it is, what it is, how many, and what putting
   it down here would do. */
.hand { position: fixed; left: 0; top: 0; z-index: 60; display: flex; align-items: center; gap: 5px; padding: 3px 10px 3px 5px; border-radius: 999px; border: 1px solid #fff1c4; background: var(--glass-solid); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55); pointer-events: none; white-space: nowrap; will-change: transform; }
.hand[hidden] { display: none; }
.hand .shield { width: 15px; height: 18px; vertical-align: 0; }
.hand .hand-ic { width: 24px; height: 24px; display: block; }
.hand b { font: 700 15px/1 var(--sans); font-variant-numeric: tabular-nums; color: #fff7e2; }
.hand span { margin-left: 3px; padding-left: 8px; border-left: 1px solid var(--line-2); font: 600 12.5px/1.2 var(--sans); color: var(--gold); }
.hand span.no { color: var(--ink-3); font-weight: 400; }
/* On the Army page, a picture with people of its kind in hand. */
.page[data-page='send'] .tile .tile-cap small { color: var(--ink-3); }

/* The top of the map: the sector map (and the first island's guide) down the left, and whatever
   needs saying across the middle, clear of both it and the camera buttons. */
.stage-left { position: absolute; top: 6px; left: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 100%; pointer-events: none; }
.stage-left > * { pointer-events: auto; }
.stage-left .guide { position: static; }
.stage-mid { position: absolute; top: 6px; left: 200px; right: 52px; display: grid; gap: 6px; justify-items: center; pointer-events: none; }
.stage-mid .banner { position: static; transform: none; white-space: normal; text-align: center; border-radius: 16px; padding: 6px 14px; font-size: 13.5px; }
.stage-mid .banner[hidden], .stage-mid .omens[hidden] { display: none; }
.stage-mid .omens { position: static; transform: none; }

/* The sector map: a flat plan of the island, and under it the shields with each tribe's warriors
   in the territory being looked at. */
.sector { width: 190px; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--glass-solid); box-shadow: var(--shadow), var(--edge); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.sector canvas { display: block; margin: 0 auto; border-radius: 7px; background: #0b2a3a; touch-action: none; }
.sector-who { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 3px; margin-top: 5px; }
.sector-shield { appearance: none; display: grid; justify-items: center; gap: 1px; padding: 3px 0 2px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink); font: 700 13px/1.1 var(--sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.sector-shield img { width: 18px; height: 21px; display: block; }
.sector-shield:hover { border-color: var(--gold); }
.sector-shield.me { cursor: default; }
.sector-shield.me:hover { border-color: transparent; }
.sector-shield.pact { background: rgba(138, 216, 115, 0.16); }
.sector-shield.out { opacity: 0.4; }
@media (max-width: 760px) {
  .sector { width: 132px; padding: 4px; }
  .stage-mid { left: 140px; right: 46px; }
  .stage-mid .omen { min-width: 0; width: 100%; }
  .sector-shield { font-size: 12px; }
  .sector-shield img { width: 15px; height: 18px; }
}
.page[data-page='send'] .tile.on .tile-cap small { color: #5d4a16; }
/* Where the middle of the map's top edge is narrow, what is said there is said in less room. */
.stage-mid .omen > span { min-width: 0; }
.stage-mid .omen b, .stage-mid .omen small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .stage-mid .omen { grid-template-columns: minmax(0, 1fr) auto; padding: 4px 9px 5px 8px; }
  .stage-mid .omen > img { display: none; }
  .stage-mid .banner { font-size: 12.5px; padding: 5px 10px; }
}

/* A shield says who its tribe is bound to: a pip in the colour of each tribe it has a pact with.
   A wash of green means the pact is with you, of red that it is running out. */
.sector-shield .pips { display: flex; justify-content: center; gap: 2px; height: 5px; }
.sector-shield .pips i { width: 5px; height: 5px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(8, 14, 22, 0.8); }
.sector-shield.ending { background: rgba(255, 122, 102, 0.2); }

/* What the scholars are at, on the top bar: the thing itself, and how long it has to go. */
.study-chip { appearance: none; display: inline-flex; align-items: center; gap: 7px; max-width: 250px; padding: 2px 11px 2px 4px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper-2); color: var(--ink); font: 600 13px/1.2 var(--sans); cursor: pointer; }
.study-chip[hidden] { display: none; }
.study-chip:hover { border-color: var(--gold); }
.study-chip img { width: 26px; height: 26px; display: block; flex: none; }
.study-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.study-chip b { flex: none; font: 700 13px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--gold); }
.study-chip b:empty { display: none; }
.study-chip.warn { border-color: rgba(255, 122, 102, 0.7); background: rgba(255, 122, 102, 0.14); }
.study-chip.warn b { color: var(--bad); }

/* The weather of the moment, on the top bar, and what is coming. */
.weather-chip { appearance: none; display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 2px 11px 2px 4px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper-2); color: var(--ink); font: 600 13px/1.2 var(--sans); cursor: pointer; white-space: nowrap; }
.weather-chip[hidden] { display: none; }
.weather-chip:hover { border-color: var(--gold); }
.weather-chip img { width: 26px; height: 26px; display: block; flex: none; }
.weather-chip b { font: 600 12px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.weather-chip b:empty { display: none; }
.weather-chip.bad { border-color: rgba(134, 190, 240, 0.75); background: rgba(96, 156, 214, 0.2); }
.weather-chip.soon b { color: #9fd0ff; animation: wx-soon 1s ease-in-out infinite alternate; }
@keyframes wx-soon { from { opacity: 0.55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .weather-chip.soon b { animation: none; } }
/* The time of day sits beside the weather, and is made the same way: the sun or the moon, and a count. */
.day-chip { padding-right: 9px; }
.day-chip b { color: var(--ink-2); }
.day-chip.bad { border-color: rgba(150, 160, 230, 0.7); background: rgba(70, 80, 150, 0.28); }
/* A word for the kind of ground a place stands on, with what it means behind it. */
.land-word { border-bottom: 1px dotted var(--line-2); cursor: help; }
.land-note { margin-top: 8px; }
/* On a phone there is no room for the forecast in words: the chip glows when bad weather is close, and a tap says the rest. */
@media (max-width: 640px) {
  .weather-chip { padding-right: 9px; }
  .weather-chip b { display: none; }
  .weather-chip.soon { border-color: #9fd0ff; box-shadow: 0 0 0 2px rgba(159, 208, 255, 0.35); }
  .study-chip { flex: 0 1 auto; min-width: 0; max-width: 200px; }
}
/* What the weather is doing to the work on a page. */
.wx-note { margin: 8px 0 0; padding: 5px 9px; border-radius: 9px; border: 1px solid rgba(134, 190, 240, 0.45); background: rgba(96, 156, 214, 0.16); color: #cfe6fb; font-style: normal; }
.wx-note[hidden] { display: none; }

/* The discoveries, on the Scholars' page. */
.board { margin-top: 0; }
.board + .eq { margin-top: 12px; }
.board-head { margin: 12px 0 0; font: 600 11px/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.board .tiles { margin-top: 8px; }
/* The designs stand in three columns, a kind to each, with the ages in order down them. */
.board-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; font: 600 10px/1.2 var(--sans); letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-2); text-align: center; }
.board-cols + .board-head { margin-top: 8px; }
.board-head small { margin-left: 7px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.board-head.is-ahead { color: var(--ink-3); }
.board .board-row { margin-top: 6px; }
/* The tribes, in the overview. */
.tribes { display: grid; gap: 2px; }
