/* Табличка номера машины — как в стране аренды (холст 88, 88a2; владелец 15.11.2026;
 * Китай — холст 111, 111b, владелец 01.12.2026).
 * Вид решает сервер (`rules/plates.py`, признак `plate_look` у брони), здесь только
 * рисунок: `.plate` + `is-kr`, `is-kr-ev`, `is-cn`, `is-cn-ev`, `is-tw`, `is-tw-ev`,
 * `is-other`. Высота таблички — `font-size`, всё остальное в `em`: одна разметка
 * годится в любой размер.
 *
 * Цвета — свои, а не токены: это краска настоящей таблички, она не меняется
 * с темой и не означает состояния. Пропорции — по стандарту и фото: Корея 520×110 мм,
 * Китай 440×140 (зелёная 480×140), Тайвань 380×160 (знак 0,57 высоты, разделитель —
 * квадратная точка). Шрифты номеров — похожие, подмножествами, у Китая и Тайваня —
 * в одной клетке (`fonts.css`, «Plate …»): родных нет ни у одной страны. */

.plate {
  --plate-ink: #111;
  --plate-kr-blue: linear-gradient(165deg, #4b77d6 0%, #1d3d92 48%, #2f5bc0 100%);
  --plate-kr-sky: linear-gradient(180deg, #bfe4f2 0%, #a6d6ea 100%);
  --plate-kr-sky-ink: #2f6390;
  --plate-cn-blue: linear-gradient(180deg, #2450b4 0%, #173f9c 100%);
  --plate-cn-green: linear-gradient(180deg, #fff 0%, #f7fbf6 10%, #7fca88 84%, #74c37e 100%);
  --plate-tw-green: #17924a;
  --plate-tw-bloom: #3f86d6;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1em;
  flex: none;
  overflow: hidden;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  color: var(--plate-ink);
}
.plate.is-lift {
  box-shadow: 0 0.2em 0.24em -0.06em rgba(0, 0, 0, 0.35);
}
.plate-n {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.plate-gap {
  display: inline-block;
  width: 0.3em;
}

/* --- Корея: белая с синей полосой KOR и голубая электро -------------------- */

.plate.is-kr,
.plate.is-kr-ev {
  width: 4.727em;
  border-radius: 0.075em;
}
.plate.is-kr {
  padding-left: 0.6em;
  border: 0.026em solid #1c1c1c;
  background: #fff;
}
.plate.is-kr-ev {
  padding: 0 0.3em 0 0.46em;
  border: 0.026em solid #3b6a92;
  background: var(--plate-kr-sky);
}
.plate.is-kr .plate-n,
.plate.is-kr-ev .plate-n {
  font-family: "Plate Noto Condensed", "Plate Hangul", sans-serif;
  font-weight: 500;
  font-size: 0.86em;
}
.plate.is-kr-ev .plate-n {
  font-size: 0.84em;
}
.plate-hg {
  margin: 0 0.02em 0 0.01em;
  font-family: "Plate Hangul", sans-serif;
  font-weight: 500;
  font-size: 0.88em;
}
.plate.is-kr-ev .plate-hg {
  font-size: 0.9em;
}
.plate-band {
  position: absolute;
  left: 0.045em;
  top: 0.045em;
  bottom: 0.045em;
  width: 0.52em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.07em 0 0.06em;
  border-radius: 0.045em;
  background: var(--plate-kr-blue);
}
.plate-band svg {
  display: block;
  width: 0.4em;
  height: 0.4em;
}
.plate-band b,
.plate-evr {
  font-family: "Plate Barlow", sans-serif;
  font-style: italic;
  font-weight: 700;
}
.plate-band b {
  font-size: 0.21em;
  letter-spacing: 0.03em;
  color: #fff;
}
.plate-evl {
  position: absolute;
  left: 0.07em;
  top: 0.08em;
  bottom: 0.08em;
  width: 0.3em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.plate-evl svg {
  display: block;
  width: 0.3em;
  height: 0.3em;
}
.plate-evr {
  position: absolute;
  right: 0.08em;
  bottom: 0.2em;
  font-size: 0.27em;
  letter-spacing: -0.02em;
  color: var(--plate-kr-sky-ink);
}

/* --- Китай: синяя и зелёная новой энергии ---------------------------------- */

.plate.is-cn,
.plate.is-cn-ev {
  border-radius: 0.0714em;
}
.plate.is-cn {
  width: 3.143em;
  background: var(--plate-cn-blue);
  color: #fff;
}
.plate.is-cn-ev {
  width: 3.429em;
  background: var(--plate-cn-green);
}
.plate.is-cn::before,
.plate.is-cn-ev::before {
  content: "";
  position: absolute;
}
/* Рамка — у самого края, как на чертеже: отступ 2–3 мм, линия 3 мм. */
.plate.is-cn::before {
  inset: 0.02em;
  border: 0.021em solid #fff;
  border-radius: 0.054em;
}
.plate.is-cn-ev::before {
  inset: 0.016em;
  border: 0.021em solid #1a1a1a;
  border-radius: 0.056em;
}
/* Кегль «Plate China» — высота знака: 0,56 высоты таблички вместо 0,64 по GA 36, чтобы
 * поле вокруг номера было одинаковым (111b). Промежутки — в em этого кегля: 0,085
 * высоты таблички у синей, 0,07 у зелёной. */
.plate.is-cn .plate-n,
.plate.is-cn-ev .plate-n {
  font-family: "Plate China", sans-serif;
  font-weight: 400;
  font-size: 0.56em;
}
.plate.is-cn .plate-n {
  gap: 0.1518em;
}
.plate.is-cn-ev .plate-n {
  gap: 0.125em;
}
/* Клетка знака одна у любого, у Китая — полкегля: ширина ряда не зависит от номера. */
.plate-cell {
  width: 0.5em;
  text-align: center;
}
.plate-dot {
  width: 0.125em;
  height: 0.125em;
  border-radius: 50%;
  background: currentColor;
}
/* Между буквой и номером 0,31 высоты таблички, знак новой энергии в середине — 0,2:
 * промежуток ряда чуть шире нужного, лишнее забирают отрицательные поля. */
.plate-nev {
  width: 0.3571em;
  height: 0.3571em;
  margin: 0 -0.0268em;
}
.plate-nev svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.plate-slot {
  position: absolute;
  width: 0.164em;
  height: 0.057em;
  border-radius: 0.03em;
  background: #fff;
}
.plate.is-cn .plate-slot {
  background: rgba(255, 255, 255, 0.8);
}
/* На белом верху зелёной белая прорезь не видна — её обводит линия чертежа. */
.plate.is-cn-ev .plate-slot {
  box-shadow: 0 0 0 0.005em rgba(0, 0, 0, 0.5);
}
.plate-slot.at-t1 { top: 0.061em; left: 25%; }
.plate-slot.at-t2 { top: 0.061em; right: 25%; }
.plate-slot.at-b1 { bottom: 0.061em; left: 25%; }
.plate-slot.at-b2 { bottom: 0.061em; right: 25%; }
.plate.is-cn .plate-slot.at-t1,
.plate.is-cn .plate-slot.at-b1 { left: 22%; }
.plate.is-cn .plate-slot.at-t2,
.plate.is-cn .plate-slot.at-b2 { right: 22%; }

/* --- Тайвань: белая и электро образца 2014 с зелёными полосами ------------- */

.plate.is-tw,
.plate.is-tw-ev {
  width: 2.375em;
  border: 0.03em solid #161616;
  border-radius: 0.1em;
  background: #fff;
}
/* Знак 0,57 высоты таблички, клетка 0,475 его высоты, ряд семи знаков — 0,93 ширины:
 * как на фото после 2012 года. Кегль «Plate Taiwan» — высота знака. Ряд стоит чуть ниже
 * середины: сверху прорези. */
.plate.is-tw .plate-n,
.plate.is-tw-ev .plate-n {
  gap: 0.0664em;
  font-family: "Plate Taiwan", sans-serif;
  font-weight: 400;
  font-size: 0.565em;
  transform: translateY(0.0584em);
}
/* Между полосами электро знаки чуть ниже ростом: на образце они почти касаются полос,
 * и на малых размерах это читается как наплыв. */
.plate.is-tw-ev .plate-n {
  font-size: 0.533em;
  transform: translateY(0.0432em);
}
.plate.is-tw .plate-cell,
.plate.is-tw-ev .plate-cell {
  width: 0.475em;
}
.plate-sep {
  width: 0.102em;
  height: 0.107em;
  margin: 0 0.0265em;
  background: currentColor;
}
.plate.is-tw .plate-slot {
  top: 0.035em;
  width: 0.15em;
  height: 0.032em;
  background: #161616;
}
.plate.is-tw .plate-slot.at-t1 { left: 20%; }
.plate.is-tw .plate-slot.at-t2 { right: 20%; }
.plate-bloom {
  position: absolute;
  bottom: 0.07em;
  width: 0.07em;
  height: 0.07em;
  border-radius: 50%;
  background: var(--plate-tw-bloom);
}
.plate-bloom.at-l { left: 22%; }
.plate-bloom.at-r { right: 22%; }
.plate.is-tw-ev::before,
.plate.is-tw-ev::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  background: var(--plate-tw-green);
}
.plate.is-tw-ev::before {
  top: 0;
  height: 0.21em;
}
.plate.is-tw-ev::after {
  bottom: 0;
  height: 0.17em;
}
.plate-evt {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: 0.03em;
  padding-left: 0.6em;
  font-family: "Plate Hanzi TC", sans-serif;
  /* Подпись лежит в `<i>`, а он по умолчанию курсив: на настоящей табличке она прямая,
   * и приложение с ботом рисуют её прямой (владелец 15.11.2026). */
  font-style: normal;
  font-weight: 700;
  font-size: 0.15em;
  letter-spacing: 0.6em;
  text-align: center;
  color: #fff;
}

/* --- Другая страна: прежняя белая моноширинная ----------------------------- */

.plate.is-other {
  padding: 0 0.3em;
  border: 0.05em solid #171717;
  border-radius: 0.22em;
  background: #fbfbf8;
}
.plate.is-other .plate-n {
  font: 600 0.55em / 1 var(--mono);
  letter-spacing: 0.06em;
}
