/* Zora Genetics Clinic theme. Loaded after zora.css on every game page.
   The art in clinic/ is pixel art drawn at 1x by art/ (see art/README.md); pages show it at
   --px CSS pixels per art pixel. Colours match art/palette.px.js. */

:root {
  --px: 3px;                 /* size of one art pixel on screen */
  --ink: #1a1c2c;            /* darkest: outlines, text on light buttons */
  --wall: #1d2b3a;           /* panel fill */
  --wall-2: #25394a;         /* raised fill: cards, table stripes */
  --wall-3: #2f4f5f;
  --edge: #3f6b73;           /* quiet borders and rules */
  --teal: #2e8c7a;
  --mint-bright: #4fc4a0;
  --mint: #90e0c0;           /* categories: trait names, column labels */
  --ice: #d0f0f0;            /* links, secondary highlights */
  --sage: #90c080;
  --tan: #c09080;
  --wood: #7a5238;
  --cream: #f4f1e4;          /* body text */
  --dim: #b9c4c9;            /* quieter body text */
  --gold: #ffd36b;           /* headings */
  --pink: #f08fb0;           /* warnings, "did not survive" */
  --violet: #a78bde;
  --heading-font: "Silkscreen", "Pixelify Sans", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html { background: var(--wall); }
body {
  color: var(--cream);
  background: var(--wall) url(clinic/wall_tile.png) 0 0 / calc(32 * var(--px)) repeat;
  image-rendering: pixelated;
}
/* Only the art is pixelated: text and the zora pictures stay smooth. */
body * { image-rendering: auto; }
.px, .px-art, .zora-box, .stage, .platform, .px-icon { image-rendering: pixelated; }
.zora-box img, .stage .zora img, .zora-box svg { image-rendering: auto; }

/* ---- Text colours: headings gold, categories mint, body cream ---- */
h1, h2, h3, h4 {
  font-family: var(--heading-font);
  color: var(--gold);
  letter-spacing: 0.02em;
  background: none;
  -webkit-text-fill-color: currentColor;
}
h1 { text-transform: uppercase; text-shadow: var(--px) var(--px) 0 var(--ink); }
h3, h4 { color: var(--ice); }
.cat, th, dt, label, .picker-gene, .picker-chr, .chr-head, .col-head, .hint, .feature-list .hint,
.picker-geno, .picker-pheno { color: var(--mint); }
a { color: var(--ice); }
.dim { color: var(--dim); }
.warn { color: var(--pink); }

/* ---- Frames ---- */
.panel, .px-panel {
  background: none;
  border: calc(8 * var(--px)) solid transparent;
  border-image: url(clinic/panel.png) 8 fill / calc(8 * var(--px)) stretch;
  border-radius: 0;
  box-shadow: none;
  padding: 4px 8px;
  image-rendering: pixelated;
}
.px-card {
  border: calc(8 * var(--px)) solid transparent;
  border-image: url(clinic/card.png) 8 fill / calc(8 * var(--px)) stretch;
  image-rendering: pixelated;
}
.px-chip {
  display: inline-block;
  border: solid transparent; border-width: calc(2 * var(--px)) calc(4 * var(--px));
  border-image: url(clinic/chip.png) 4 fill / calc(4 * var(--px)) stretch;
  image-rendering: pixelated;
  line-height: 16px; font-size: 0.85rem;
}

/* ---- Buttons: tan by default, mint for the main action ---- */
a.px-btn { display: inline-flex; align-items: center; text-decoration: none; }
button, .px-btn {
  font: 700 0.9rem/1.1 var(--heading-font);
  color: var(--cream);
  background: none;
  /* the button art keeps its decoration in its outer 4 pixels, so a 44px button fits */
  border: calc(4 * var(--px)) solid transparent;
  border-image: url(clinic/btn2.png) 4 fill / calc(4 * var(--px)) stretch;
  border-radius: 0;
  padding: 0 12px 3px;      /* 3px lifts the label above the button's bottom lip */
  min-height: 44px;
  cursor: pointer;
  image-rendering: pixelated;
  text-shadow: 1px 1px 0 var(--ink);
}
button:hover:not(:disabled), a.px-btn:hover { border-image-source: url(clinic/btn2_hover.png); color: var(--ink); text-shadow: none; }
button:active:not(:disabled), button[aria-pressed="true"] { border-image-source: url(clinic/btn2_down.png); color: var(--cream); padding: 3px 12px 0; }
button.primary { border-image-source: url(clinic/btn.png); color: var(--ink); text-shadow: none; }
button.primary:hover:not(:disabled) { border-image-source: url(clinic/btn_hover.png); }
button.primary:active:not(:disabled), button.primary[aria-pressed="true"] { border-image-source: url(clinic/btn_down.png); color: var(--cream); }
button:disabled { border-image-source: url(clinic/btn_off.png); color: #c5cad4; cursor: not-allowed; text-shadow: none; }
button.small { min-height: 34px; font-size: 0.8rem; }
button.link { border: 0; border-image: none; min-height: 0; padding: 0; color: var(--ice); text-decoration: underline; text-shadow: none; font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

select, input[type="text"], input[type="number"] {
  color: var(--cream); background: var(--wall-2); border: 2px solid var(--edge); border-radius: 0;
  padding: 4px 6px; font: inherit;
}

/* ---- Icons ---- */
.px-icon { width: calc(16 * 2px); height: calc(16 * 2px); vertical-align: middle; image-rendering: pixelated; }
.px-icon.big { width: calc(16 * var(--px)); height: calc(16 * var(--px)); }

/* ---- Small zora pictures stand on a little platform instead of a checkerboard ---- */
.zora-box {
  border-radius: 0;
  background: var(--wall) url(clinic/mini_stage.png) center / 100% 100% no-repeat;
  outline: var(--px) solid var(--ink);
  outline-offset: calc(-1 * var(--px));
}

/* ---- The stage: big zoras on display platforms in front of the lab ----
   <div class="stage">
     <div class="pedestal"><div class="zora-box">…zora layers…</div><p class="plate">Parent 1: Donor A</p></div>
   </div>
   Give the stage a height (or let a grid cell stretch it). Each pedestal is a square as tall as
   86% of the stage; the platform is drawn behind the zora, under its feet (a zora's feet are
   about 94% of the way down its square picture and a little left of centre). */
/* (zora-meiosis-view.js also calls each row of a meiosis board ".stage": those are left alone) */
.stage:not(.board .stage) {
  position: relative; overflow: hidden;
  background: var(--wall) url(clinic/lab_stage.gif) center bottom / cover no-repeat;
  outline: var(--px) solid var(--ink); outline-offset: calc(-1 * var(--px));
  display: flex; align-items: flex-end; justify-content: space-evenly; gap: 8px;
  padding-bottom: 3%;
}
@media (prefers-reduced-motion: reduce) { .stage:not(.board .stage) { background-image: url(clinic/lab_stage.png); } }
.stage .pedestal { position: relative; flex: 0 1 auto; height: 86%; aspect-ratio: 1 / 1; max-width: 46%; }
.stage .pedestal::before {           /* the platform */
  content: ''; position: absolute; left: 48%; top: 84%; width: 72%; aspect-ratio: 72 / 22;
  transform: translateX(-50%);
  background: url(clinic/platform.png) center / 100% 100% no-repeat;
  image-rendering: pixelated;
}
.stage .pedestal .zora-box { position: relative; width: 100%; height: 100%; background: none; outline: 0; }
.stage .plate {                       /* name plate in front of a platform */
  position: absolute; left: 48%; bottom: -1%; transform: translateX(-50%); margin: 0;
  font: 700 0.8rem var(--heading-font); color: var(--ink); background: var(--gold);
  padding: 2px 8px; box-shadow: 0 0 0 2px var(--ink); white-space: nowrap;
}
.stage .empty { color: var(--cream); background: var(--wall); box-shadow: 0 0 0 2px var(--ink); padding: 4px 10px;
  font: 700 0.85rem var(--heading-font); text-align: center; }   /* own backing: the lab floor is white */

/* ---- Pop-up windows ---- */
dialog.px-popup {
  color: var(--cream);
  background: none;
  border: calc(8 * var(--px)) solid transparent;
  border-image: url(clinic/popup.png) 8 fill / calc(8 * var(--px)) stretch;
  image-rendering: pixelated;
  padding: 6px 10px;
  max-width: min(1100px, 94vw); max-height: 92vh; overflow: auto;
  margin: auto;
}
dialog.px-popup::backdrop { background: rgba(10, 12, 22, 0.72); }
.px-popup .popup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.px-popup .popup-head h2 { margin: 0; }
.px-popup p { margin-bottom: 8px; line-height: 1.4; }

/* ---- Bits shared by the older page styles ---- */
.note-callout { background: var(--wall-2); border: 2px solid var(--gold); border-radius: 0; color: var(--cream); }
.note-callout h2 { color: var(--gold); }
.try-this { color: var(--ice); }

/* ---- The PEEBEDU link, top left of every page: a brushed-steel nameplate in the clinic sign's
   style (art: art/ui/ui.px.js), linking to peebedu.com. The lettering lights mint on hover. ---- */
.peebedu-link { display: inline-flex; flex: none; line-height: 0; }
.peebedu-link img { width: calc(70px * 2); height: calc(22px * 2); image-rendering: pixelated; }
.peebedu-link .plate-hover { display: none; }
@media (hover: hover) and (pointer: fine) {
  .peebedu-link:hover .plate-idle { display: none; }
  .peebedu-link:hover .plate-hover { display: block; }
}
.lobby .brand { position: absolute; top: 12px; left: 16px; }
@media (max-width: 899px) { .lobby .brand { position: static; display: flex; justify-content: center; margin-bottom: 8px; } }
