/* Car Brands' own look, after the shell every tool shares (../shell/shell.css: the brand, the name card, the score,
   the regions down the left with each region's countries under it, 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 middle of that column:
   a logo on a light plate (logos are drawn for light backgrounds), or the grid of logos in Explore, and the buttons
   under it. */
:root {
  --warn: #f0cf6a;
  --frame: #0c141b;
  --plate: #eef1f3;
  --plate-edge: #c9d1d7;
}

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

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

/* a country's flag beside its name (World Flags' files, at their real shapes) */
.flag { height: 0.95em; width: auto; max-width: 2em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(232, 237, 240, 0.18); flex: none; vertical-align: -0.12em; margin-inline-end: 0.4em; }
#pName .flag { height: 0.72em; vertical-align: 0; }
.rail .sb > span { display: inline-flex; align-items: center; min-width: 0; }

.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; }

/* ---------- the logo on its plate ---------- */
.show { display: grid; place-items: center; padding: clamp(14px, 4vw, 40px); min-height: 0; position: relative; }
.plate {
  box-sizing: border-box; width: min(100%, 520px); aspect-ratio: 4 / 3; max-height: 100%;
  background: radial-gradient(120% 100% at 50% 20%, #ffffff 0%, var(--plate) 70%);
  border: 1px solid var(--plate-edge); border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 -10px 30px rgba(20, 40, 55, 0.06);
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.plate img { position: absolute; inset: 13% 12%; width: 76%; height: 74%; object-fit: contain; display: block; opacity: 0; transition: opacity .18s; }
.plate img.is-in { opacity: 1; }
.plate .initial { font-weight: 800; font-size: clamp(40px, 9vw, 90px); color: #b5c0c8; }
.show .credit-line { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; }
.show .credit-line a { color: inherit; text-decoration: underline; text-decoration-color: rgba(141, 156, 169, 0.45); }
body.clean .show .credit-line { opacity: .5; }

/* ---------- explore: the grid of logos (class pcard: .card is the shell's windows) ---------- */
.grid { padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 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); }
.thumb { aspect-ratio: 4 / 3; background: var(--plate); display: grid; place-items: center; position: relative; }
.thumb img { position: absolute; inset: 14% 12%; width: 76%; height: 72%; object-fit: contain; display: block; }
.thumb .initial { font-weight: 800; font-size: 30px; color: #b5c0c8; }
.grid .pcard .lbl { padding: 7px 9px 8px; display: flex; align-items: center; min-width: 0; }
.grid .pcard .lbl b { font-weight: 650; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; flex: 1; min-width: 0; }   /* (a long name breaks where English would hyphenate it: Volks-wagen) */
.grid .pcard.is-known .lbl b::after { 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; display: flex; align-items: center; }

/* ---------- explore: one brand up close ---------- */
.detail { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 100%; }
.detail .show { padding-bottom: 26px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0 16px 16px; }
.facts span { font-family: var(--f-mono); font-size: 11.5px; color: var(--fg); background: rgba(10, 15, 20, 0.5); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.facts:empty { display: none; }

/* ---------- the end of a test: the misses, under the result in the name's place ---------- */
.summary { padding: 18px; display: grid; gap: 14px; justify-items: center; align-content: start; }
.misses { width: 100%; max-width: 620px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.misses button { font: inherit; cursor: pointer; padding: 0; overflow: hidden; display: grid; border-radius: 9px; background: var(--bg-lift); border: 1px solid var(--line); color: var(--fg); text-align: start; }
.misses button:hover { border-color: var(--scan); }
.misses .thumb { aspect-ratio: 16 / 9; }
.misses .thumb img { inset: 14% 15%; width: 70%; }
.misses .lbl { padding: 6px 9px 7px; display: grid; gap: 1px; }
.misses .lbl b { font-size: 12.5px; font-weight: 650; }
.misses .lbl small { font-size: 11px; color: var(--bad); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- the answers under the logo ---------- */
.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 .act { flex: none; }
.letters { font-size: 14px; letter-spacing: .06em; }

/* ---------- phones / narrow ---------- */
@media (max-width: 900px) {
  .view { border-radius: 14px; }
  .plate { border-radius: 16px; }
  .act { padding: 10px 11px; font-size: 14px; min-height: 44px; }
  .act kbd { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); padding: 10px; gap: 8px; }
  .grid .pcard .lbl { padding: 6px 7px 7px; }
  .grid .pcard .lbl b { font-size: 12px; }
}
