/* Side cards: each kind of card has its own prehistoric material; camp card, layers, finds */
/* v23 side cards: each kind of card is made of its own prehistoric material, with a carved tag on top */
.card[data-tag]::before {
  content: attr(data-tag);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 800 10px/1 var(--body, inherit);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 8px 3px;
  border-radius: 7px 9px 6px 8px;
  margin: -2px 0 7px -2px;
  background: var(--tagbg, #7b6650);
  color: var(--tagfg, #fff6e4);
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.4);
}
.goal {
  --tagbg: #5f584e;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.35) 0 2px, transparent 3px) 0 0/23px 19px,
    radial-gradient(circle at 70% 60%, rgba(60, 50, 40, 0.1) 0 2px, transparent 3px) 0 0/31px 27px,
    linear-gradient(170deg, #e4ded2, #cfc7b8);
  border: 3px solid #8f877b;
  border-radius: 18px 12px 20px 10px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.45),
    inset 0 -6px 0 rgba(80, 70, 60, 0.12),
    0 5px 0 #6f675b;
}
.goal .lvl {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}
.goal .medal {
  flex: 0 0 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 400 24px/1 var(--display);
  color: #fff6dc;
  background: radial-gradient(circle at 35% 30%, #e8b04a, #a8691f 70%);
  border: 3px solid #6a4518;
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.25),
    0 2px 0 #4a3010;
  text-shadow: 0 2px 0 #6a4518;
}
.goal .lvl h3 {
  margin: 0;
  font-size: 18px;
}
.goal .bar {
  background: #b9b0a0;
  border: 1px solid #8f877b;
}
.story {
  --tagbg: #8a5a30;
  background: linear-gradient(175deg, #f1dcb0, #e2c590);
  border: 2px solid #8a5a30;
  border-radius: 10px 22px 12px 20px;
  box-shadow: 0 4px 0 #5a3a22;
  outline: 2px dashed rgba(110, 70, 30, 0.55);
  outline-offset: -7px;
}
.vip {
  --tagbg: #a87a12;
}
.event {
  --tagbg: #b4501f;
  background: repeating-linear-gradient(92deg, rgba(120, 70, 30, 0.1) 0 2px, transparent 2px 19px),
    linear-gradient(180deg, #f3d6a8, #e8bf86);
  border-radius: 8px 16px 8px 14px;
}
.tut {
  --tagbg: #3f7a26;
  background: linear-gradient(180deg, #e8f2d2, #d6e6b6);
}
.report {
  --tagbg: #9a4a2a;
  background: linear-gradient(180deg, #f2d8c4, #e6c0a4);
  border-color: #9a4a2a;
  box-shadow: 0 4px 0 #6a3018;
}
.layerCard {
  order: -1;
}
.resico {
  display: inline-block;
  vertical-align: -3px;
}
.resico svg,
.resico img {
  width: 100%;
  height: 100%;
  display: block;
}
/* v36: the painted icons are drawn a little larger than their box, so the outline does not eat the picture */
.resico img {
  transform: scale(1.25);
}
.reschip {
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
}
.reschip span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
/* build orders: «planks 12 (+30)»; a tap opens the stores sheet */
.reschip {
  cursor: pointer;
}
.reschip em {
  font-style: normal;
  font-weight: 400;
  opacity: 0.75;
}
/* build orders: a good of a site, "Rope 2/5" and where the rest comes from (a tap: Where to get) */
.row.bo-good {
  gap: 6px;
  align-items: baseline;
}
.row.bo-good > span {
  white-space: nowrap;
}
.row.bo-good .bo-from {
  text-align: right;
  cursor: pointer;
  text-decoration: underline dotted;
  color: var(--muted);
}
.row.bo-good .ok {
  color: #5ccf5a;
}
.wallet .rrow.bo-stock,
.wallet .rrow.bo-head {
  grid-template-columns: 24px minmax(0, 1fr) 40px 40px 34px 34px 34px;
  gap: 4px;
  font-size: 13px;
  padding: 3px 0;
}
.wallet .rrow.bo-head {
  border-bottom: none;
}
.wallet .rrow.bo-stock .bad {
  color: var(--bad);
  font-weight: 700;
}
.ctCard {
  --tagbg: #7a3a8a;
  background: linear-gradient(180deg, #f1e6f2, #e2d0e6);
  border-color: #7a3a8a;
  box-shadow: 0 4px 0 #4a1a5a;
}
.dig {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  max-width: 300px;
  margin: 6px auto;
}
.dig .dc {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid #6a4a2a;
  background: radial-gradient(circle at 40% 35%, #b8925a, #8a6a3a);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}
.dig .dc:hover:not([disabled]) {
  filter: brightness(1.12);
}
.dig .dc.o {
  cursor: default;
}
.dig .dc.h1 {
  background: #e0402a;
}
.dig .dc.h2 {
  background: #f09a2b;
}
.dig .dc.h3 {
  background: #f6dc40;
}
.dig .dc.h4 {
  background: #6aa8d8;
}
.dig .dc.f {
  background: #fff6dc;
}
.dig .dc.sh {
  background: #e8d8b0;
}
.dig img {
  width: 90%;
  height: auto;
}
.lgd {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.lgd span {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.lgd .h1 {
  background: #e0402a;
}
.lgd .h2 {
  background: #f09a2b;
}
.lgd .h3 {
  background: #f6dc40;
}
.lgd .h4 {
  background: #6aa8d8;
}
.gears {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 8px 0;
}
.gear {
  width: 56px;
  height: 56px;
  padding: 2px;
  border-radius: 50%;
  border: 2px solid #6a4a2a;
  background: #efe6d2;
  cursor: pointer;
}
.gear.ok {
  background: #d8f0c8;
}
.gear svg {
  width: 100%;
  height: 100%;
}
.campCard {
  --tagbg: #5a7a3a;
  order: -3;
  background: linear-gradient(180deg, #eef3dc, #dce8c2);
  border-color: #5a7a3a;
  box-shadow: 0 4px 0 #3a5a22;
  width: 340px;
  max-width: calc(100vw - 32px);
  margin-left: -70px;
}
.restab {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}
.rrow {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 54px 46px 70px 56px;
  align-items: center;
  gap: 3px;
  font-size: 12px;
}
.rrow > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rrow b small {
  color: var(--muted);
  font-weight: 400;
}
.rrow small.neg {
  color: var(--bad);
}
.rrow .pill {
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid #8a7a5a;
  background: #fffaf0;
  border-radius: 8px;
  padding: 1px 4px;
}
/* the camp's Store tab: a good on two lines. On one line the painted card's frame left the names 0-30px («Кам…») and
   the switches 17px tall: the name, the count and the rate on top; Keep / Sell and the keep-N pill below, finger-sized */
.restab.cstore {
  gap: 0;
}
.restab.cstore .rrow {
  /* (fixed widths: each row is a grid of its own, and auto ones did not line up from row to row) */
  grid-template-columns: 22px minmax(0, 1fr) 56px 30%;
  grid-template-areas:
    'ico name num rate'
    'ico ship ship keep';
  gap: 4px 6px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(90, 58, 30, 0.15);
  font-size: 13px;
}
.restab.cstore .rrow > :first-child {
  grid-area: ico;
}
.restab.cstore .rrow > span {
  grid-area: name;
  white-space: normal;
}
.restab.cstore .rrow > b {
  grid-area: num;
  text-align: right;
}
.restab.cstore .rrow > b + small {
  grid-area: rate;
  text-align: right;
}
.restab.cstore .rrow > [data-ship] {
  grid-area: ship;
}
.restab.cstore .rrow > :last-child {
  grid-area: keep;
}
.restab.cstore .rrow .pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 36px;
  padding: 4px 6px;
  font-size: 12px;
  white-space: nowrap;
}
.mkt {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
}
body.incamp .side {
  max-height: calc(100vh - var(--hudB, 64px) - 20px) !important;
  width: 340px;
}
body.incamp .campCard {
  margin-left: 0;
  width: auto;
}
body.incamp .dock,
body.incamp .side > .card:not(.campCard),
body.incamp #alerts,
body.incamp .hint {
  display: none !important;
}
#info {
  order: -2 !important;
  --tagbg: #6a4528;
  background: #fbf6ea;
  border: 2px solid #7a5232;
  border-top: 9px solid #7a5232;
  border-radius: 6px 6px 14px 16px;
  box-shadow: 0 4px 0 #4a3020;
}
.layerCard {
  --tagbg: #2f6a8a;
  background: linear-gradient(180deg, #e6f0f2, #cfe0e4);
  border-color: #2f6a8a;
  box-shadow: 0 4px 0 #1f4a62;
}
.layerCard h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.layerCard .lg {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 7px;
  align-items: center;
  font-size: 12px;
  margin-top: 4px;
}
.layerCard .lg i {
  width: 16px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.layerCard .nav {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.layerCard .nav .btn {
  flex: 1;
  padding: 4px 6px;
  font-size: 12px;
}

.fnd {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1px;
  padding: 6px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(90, 58, 34, 0.15);
  min-width: 0;
}
.fnd.lock {
  opacity: 0.6;
  background: rgba(90, 58, 34, 0.08);
}
.fnd img {
  width: 88px;
  height: 56px;
  object-fit: contain;
}
.fnd i {
  font-style: normal;
  font-size: 30px;
  line-height: 56px;
  color: #9a8a70;
  font-family: var(--disp, inherit);
}
.fnd b {
  font-size: 13px;
  line-height: 1.15;
}
.fnd small {
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
}
.vip {
  border-color: #d9a623;
  box-shadow: 0 4px 0 #8a6a12;
  background: linear-gradient(#fff8e0, #fbefc8);
}
.vip .bar {
  height: 6px;
  border-radius: 3px;
  background: #e8dcb8;
  overflow: hidden;
  margin: 4px 0;
}
.vip .bar i {
  display: block;
  height: 100%;
  background: #d9a623;
}
.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.charts canvas {
  width: 100%;
  height: 60px;
  display: block;
  background: #fffaf0;
  border-radius: 8px;
}
.charts b {
  font-size: 12px;
  color: var(--muted);
}
.slot.lockd {
  opacity: 0.55;
}
.fame {
  margin: 8px 0;
}
.fame b {
  font-size: 13px;
}
.fin2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 6px 0;
}
.fin2 b {
  font-size: 13px;
}
#money.neg {
  color: #ff9a8a;
}
#info {
  order: -1;
}
.alerts {
  position: absolute;
  left: max(12px, env(safe-area-inset-left, 0px));
  top: calc(var(--hudB, 64px) + 120px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
  z-index: 5;
}
.alerts .al {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--wood-lo);
  background: #fff7e6;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--wood-lo);
  animation: alPulse 1.6s ease-in-out infinite;
}
@keyframes alPulse {
  50% {
    transform: scale(1.08);
  }
}
.side {
  max-height: calc(var(--dockT, 100vh) - var(--hudB, 64px) - 10px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.ico {
  display: none;
}
.mob {
  display: none;
}
.menu .btn {
  flex: 1 1 40%;
  padding: 10px;
}
.side,
.panel,
.items,
.tabs,
.dev {
  touch-action: pan-x pan-y;
}

/* ---- the camp for a newcomer (js/camp/help.js) ---- */
/* in the camp the bottom bar's Park button is the way back: «To the park» */
.cmdbar #btnPark .pkc {
  display: none;
}
body.incamp .cmdbar #btnPark .pk {
  display: none;
}
body.incamp .cmdbar #btnPark .pkc {
  display: revert;
}
/* a good's chain down to its raw goods, Show on every link */
.chain {
  margin: 4px 0 6px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(90, 58, 30, 0.08);
}
.chain .chT {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}
.chL {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 2px 0;
}
.chL > span {
  flex: 1;
  min-width: 0;
}
.chL .chSt {
  color: var(--bad);
  font-weight: 700;
}
.chL .chSt.ok {
  color: #3d7a22;
}
.chL .chGo,
.hutHint .btn,
.ctasks.goals .gHelp .btn {
  min-height: 40px;
  padding: 4px 10px;
  font-size: 13px;
}
/* «Buy what is missing»: the price on the button, what it buys under it */
.buyMissA {
  margin-top: 4px;
}
.buyMissL {
  margin: 2px 0 4px;
  color: var(--muted);
}
.ctasks.goals li.hasHelp {
  flex-wrap: wrap;
}
.gHelp {
  flex-basis: 100%;
  padding-left: 20px;
  color: #3a2a1a;
}
.gHelp p {
  margin: 2px 0;
}
/* the camp level's next step (a hut when the villagers have no room) */
.hutHint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(240, 176, 48, 0.18);
}
.hutHint small {
  flex: 1;
}
/* the stores sheet: a "bring N to the park" goal's good and what happens to it */
.wallet .rrow.bo-stock.focus {
  background: rgba(240, 176, 48, 0.3);
  border-radius: 6px;
}
.bo-focus {
  padding: 4px 6px 8px;
  border-radius: 8px;
  background: rgba(240, 176, 48, 0.15);
  font-size: 13px;
}
.bo-focus p {
  margin: 2px 0;
}
/* the camp store's keep pill in words, on two lines: «in the park 34 / keep 5» */
.restab.cstore .rrow .pill.keepn {
  white-space: normal;
  line-height: 1.15;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
}
/* the goods chip: «49 +29 at the camp» (a phone: the camp's icon) on one line */
.reschip em {
  white-space: nowrap;
}
.reschip em .uin {
  width: 1em;
  height: 1em;
  margin: 0 0 0 1px;
}

/* ---- v44 (stage 1A, newbie review): lessons and hints ---- */
/* the long goals' own card at the end of the Quests sheet, hidden while there are none */
.qbody .goal[hidden] {
  display: none !important;
}
/* the day report folded to its main line in the Quests sheet: the title opens it */
.report .repFold {
  min-height: 40px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.report .repLine {
  margin: 0;
}
/* a build card the shells do not reach yet: dimmed, with what is missing */
.item.poor img {
  opacity: 0.45;
  filter: saturate(0.5);
}
.item.poor .price {
  color: var(--muted);
}
.item .short {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--bad, #c2412d);
  white-space: nowrap;
}
/* the lesson card: "Turn off all lessons" is the quieter of its two choices */
#coach .cbub .coff {
  font-size: 12.5px;
  opacity: 0.85;
}
/* phones: a building's card and the morning card are never on top of each other (the day card waits) */
@media (max-width: 700px) {
  body.iopen .daycard {
    display: none;
  }
}
