/* Dog Breeds' own look, after the shell every tool shares (../shell/shell.css: the brand, the name card, the score,
   the list down the left, the settings and their "i", the windows, the result, the phone layout, and the wide middle
   column every trainer has). What is here is the photos in that column and the buttons under them. */
:root {
  --warn: #f0cf6a;
  --frame: #0c141b;
}

a { color: var(--scan); }

.ptip .tell { display: block; margin-top: 5px; color: var(--fg); }
.ptip .tell::before { content: "↔ "; color: var(--warn); }

.prompt.is-warn { border-color: var(--warn); }

.prompt.is-warn .eyebrow { color: var(--warn); }

.view {
  flex: 1; min-height: 0; overflow: auto; box-sizing: border-box; position: relative;
  background: radial-gradient(90% 70% at 50% 0%, #13222c 0%, var(--frame) 70%);
  border: 1px solid var(--line-strong); border-radius: 18px;
  display: grid; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.stage.flash-ok .view { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.stage.flash-bad .view { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.note { color: var(--muted); font-size: 13.5px; line-height: 1.55; max-width: 56ch; text-align: center; margin: 0; text-wrap: pretty; }
.note b { color: var(--fg); font-weight: 600; }

/* ---------- the photo ---------- */
.photo { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0; transition: opacity .2s; }
.photo img.is-in { opacity: 1; }
.photo .wait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; pointer-events: none; }
.photo .credit-line {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 7px; text-align: end;
  font-size: 11px; color: rgba(232, 237, 240, 0.78); background: linear-gradient(transparent, rgba(5, 9, 12, 0.78));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.photo .credit-line a { color: inherit; text-decoration: underline; text-decoration-color: rgba(232, 237, 240, 0.35); pointer-events: auto; }
.photo .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(10, 15, 20, 0.7); color: var(--fg); font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.photo .nav.prev { inset-inline-start: 10px; } .photo .nav.next { inset-inline-end: 10px; }
.photo .nav:hover { border-color: var(--scan); }
.photo .count { position: absolute; top: 10px; inset-inline-end: 12px; font-family: var(--f-mono); font-size: 11px; color: var(--muted); background: rgba(10, 15, 20, 0.7); border-radius: 6px; padding: 2px 7px; }
.photo.empty { color: var(--muted); }
.nophoto { display: grid; place-items: center; gap: 8px; text-align: center; padding: 20px; }
.nophoto b { font-size: clamp(28px, calc(6vw / var(--room, 1)), 54px); font-weight: 800; font-stretch: 110%; color: var(--bone); line-height: 1.05; }
.nophoto span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }

/* ---------- study: the grid of breeds (class pcard: .card is the shell's windows) ---------- */
.grid { padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; align-content: start; }
.grid .pcard {
  font: inherit; color: var(--fg); text-align: start; cursor: pointer; padding: 0; overflow: hidden;
  background: var(--bg-lift); border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-rows: auto 1fr;
}
.grid .pcard:hover { border-color: var(--scan); }
.grid .pcard .thumb { aspect-ratio: 4 / 3; background: #0b1218 center / cover no-repeat; position: relative; }
.grid .pcard .thumb.none::after { content: attr(data-initial); position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 34px; color: var(--line-strong); }
.grid .pcard .lbl { padding: 7px 9px 8px; display: grid; gap: 2px; }
.grid .pcard .lbl b { font-weight: 650; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; } /* a long one-word name (Swedish Newfoundlandshund) breaks instead of running out of its card */
.grid .pcard .lbl small { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); }
.grid .pcard.is-known .lbl small::before { content: "✓ "; color: var(--ok); }
.grid .head { grid-column: 1 / -1; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--scan); margin: 6px 2px -2px; }

/* ---------- study: one breed up close ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); min-height: 100%; }
.detail .photo { border-inline-end: 1px solid var(--line); min-height: 280px; }
.info { padding: 16px 18px; display: grid; gap: 12px; align-content: start; overflow: auto; }
.info h2 { margin: 0; font-weight: 800; font-stretch: 110%; font-size: 24px; line-height: 1.1; color: var(--bone); }
.info .aka { font-size: 12.5px; color: var(--muted); margin: -6px 0 0; line-height: 1.45; }
.facts { display: flex; flex-wrap: wrap; gap: 5px; }
.facts span { font-family: var(--f-mono); font-size: 11px; color: var(--fg); background: rgba(10, 15, 20, 0.5); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; }
.info .look { font-size: 14px; line-height: 1.55; margin: 0; color: var(--fg); }
.info h3 { margin: 4px 0 0; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.alikes { display: grid; gap: 8px; }
.alike { display: grid; gap: 4px; padding: 9px 10px; border-radius: 9px; background: rgba(10, 15, 20, 0.45); border: 1px solid rgba(232, 237, 240, 0.07); }
.alike .who { display: flex; flex-wrap: wrap; gap: 5px; }
.alike .who button { font: inherit; font-size: 12px; font-weight: 600; color: var(--scan); background: none; border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 7px; cursor: pointer; }
.alike .who button:hover { border-color: var(--scan); }
.alike p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.info .links { font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; }
.parents { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 650; }
.parents i { font-style: normal; color: var(--muted); }

/* ---------- the end of a test ---------- */
.summary { padding: 18px; display: grid; gap: 14px; justify-items: center; align-content: start; }
.tiles { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip { background: rgba(10, 15, 20, 0.55); border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px 22px; display: grid; gap: 1px; min-width: 110px; text-align: center; }
.chip b { font-family: var(--f-mono); font-weight: 600; font-size: clamp(28px, calc(6vw / var(--room, 1)), 44px); line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--bone); }
.chip small { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.chip.good { border-color: var(--ok); } .chip.good b { color: var(--ok); }
.misses { width: 100%; max-width: 560px; display: grid; gap: 4px; font-size: 13px; }
.misses button { font: inherit; text-align: start; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 7px; background: rgba(10, 15, 20, 0.4); border: 1px solid transparent; color: var(--muted); }
.misses button:hover { border-color: var(--line-strong); }
.misses b { color: var(--fg); font-weight: 600; }

.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
.actions:empty { display: none; }
.actions.row { display: flex; flex-wrap: wrap; justify-content: center; }
.act {
  font: inherit; font-weight: 700; font-stretch: 102%; font-size: 15px; color: var(--fg); cursor: pointer; text-align: start;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 14px; min-height: 46px;
  display: flex; align-items: center; gap: 10px; position: relative; line-height: 1.2;
}
.act kbd { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; flex: none; }
.act .txt { flex: 1; min-width: 0; }
.actions.row .act { justify-content: center; text-align: center; flex: 0 1 auto; min-width: 110px; }
.act:hover:not(:disabled) { border-color: var(--scan); }
.act:disabled { opacity: .32; cursor: default; }
.act.primary { background: var(--bone); color: #1b1610; border-color: var(--bone); }
.act.primary kbd { color: #5d5345; border-color: #a99c84; }
.act.is-right { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); opacity: 1; }
.act.is-wrong { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); opacity: 1; }
.typebox { width: 100%; display: flex; gap: 6px; }
.typebox input {
  flex: 1; min-width: 0; font: inherit; font-size: 17px; font-weight: 600; color: var(--fg); background: var(--bg-lift);
  border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 14px; outline: none;
}
.typebox input:focus { border-color: var(--scan); }
.typebox input.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.typebox .act { flex: none; }

/* ---------- phones / narrow ---------- */
@media (max-width: 900px) {
  .view { border-radius: 14px; }
  .act { padding: 10px 11px; font-size: 14px; min-height: 44px; }
  .act kbd { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); padding: 10px; gap: 8px; }
  .detail { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(220px, 46vh) auto; }
  .detail .photo { border-inline-end: 0; border-bottom: 1px solid var(--line); min-height: 220px; }
  .info { padding: 12px 14px; overflow: visible; }
  .info h2 { font-size: 21px; }
}

/* Right to left (Arabic, Persian, Hebrew), a breed's notes stay English: each takes its direction from its own first
   letter, so its full stop stays at its end */
[dir="rtl"] :is(.info .look, .alike > p, #pTip, #pTip .tell) { unicode-bidi: plaintext; }
