/* Гараж (editor/garage.js): экран планшета экспедиции справа от багги на витрине (#showcase.garage).
   Шапка, вкладки и низ с «Готово» стоят на месте, прокручивается только середина — «Готово» всегда в экране.
   Цвета и кнопки — как у окон планшета (editor/tablet-ui.css): лесное стекло, кремовый текст, янтарь — выбор и действие. */
#showcase {
  --gr-w: min(372px, 40vw);            /* ширина панели — от неё же считается место подсказки слева */
  --gr-gap: max(14px, 2.4vw);
}
#showcase .sc-garage {
  --ink: #f7efd9; --muted: #bfd0bc; --line: rgba(160, 203, 163, .25); --gold: #ffc43d; --gold-soft: rgba(255, 196, 61, .14);
  --field: rgba(3, 15, 10, .55);
  --factory: #d9481a; --factory-accent: #e8761c;   /* заводские цвета модели — для кружков «Can-Am» */
  position: absolute; right: var(--gr-gap); top: 50%; transform: translateY(-50%);
  display: none; flex-direction: column; width: var(--gr-w); height: min(800px, calc(100vh - 32px)); height: min(800px, calc(100dvh - 32px));   /* постоянная высота: панель не прыгает при смене вкладки */
  box-sizing: border-box; overflow: hidden; pointer-events: auto; color: var(--ink); border-radius: 14px;
  background: radial-gradient(ellipse at 0 80%, rgba(47, 104, 58, .16), transparent 65%),
    repeating-linear-gradient(135deg, transparent 0 23px, rgba(175, 213, 161, .018) 24px 25px), #071b12;
  box-shadow: inset 0 0 0 1px var(--line), 0 0 0 6px #1f1d1a, 0 0 0 7px #4a453e, 0 18px 40px rgba(0, 0, 0, .45);
  font: 400 14px/1.4 "Play", sans-serif;
}
#showcase.garage .sc-garage { display: flex; }
#showcase .sc-garage :is(button, input, label) { -webkit-tap-highlight-color: transparent; }
#showcase .sc-garage :is(button, input):focus-visible { outline: 2px solid #ffe7a1; outline-offset: 2px; }

/* шапка: название и сколько наград открыто */
#showcase .gr-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none;
  padding: 12px 16px 10px; border-bottom: 1px solid var(--line); background: rgba(3, 15, 10, .76); }
#showcase .gr-top small { display: block; font: 700 11px/1.2 "Tektur", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #ffc15a; }
#showcase .gr-top b { display: block; font: 700 22px/1.1 "Tektur", sans-serif; color: #fff2d6; }
#showcase .gr-count { flex: none; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font: 400 12px/1.2 "Play", sans-serif; white-space: nowrap; }
#showcase .gr-count b { display: inline; font: 700 13px/1 "Tektur", sans-serif; color: var(--ink); }

/* вкладки: что меняю */
#showcase .gr-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; flex: none; border-bottom: 1px solid var(--line); background: rgba(3, 15, 10, .4); }
#showcase .gr-tabs button { min-height: 44px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer;
  color: var(--muted); font: 700 12px/1 "Tektur", sans-serif; letter-spacing: .03em; text-transform: uppercase; }
#showcase .gr-tabs button:hover { color: var(--ink); }
#showcase .gr-tabs button[aria-selected="true"] { color: #ffda88; border-bottom-color: var(--gold); background: var(--gold-soft); }

/* середина: прокручивается одна она */
#showcase .gr-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 16px;
  scrollbar-width: thin; scrollbar-color: rgba(160, 203, 163, .35) transparent; }
#showcase .gr-page[hidden] { display: none; }
#showcase .gr-group + .gr-group, #showcase .gr-group + .gr-cards, #showcase .gr-page > .gr-cards + .gr-cards:not([hidden]) { margin-top: 16px; }
#showcase .gr-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px;
  font: 700 11px/1.2 "Tektur", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
#showcase .gr-label em { font: 400 13px/1.2 "Play", sans-serif; font-style: normal; letter-spacing: 0; text-transform: none; color: var(--ink); text-align: right; }
#showcase .gr-note { margin: 14px 0 0; font: 400 13px/1.4 "Play", sans-serif; color: var(--muted); }

/* краска: кружки цвета 44 px */
#showcase .gr-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
#showcase .gr-swatch { position: relative; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), inset 0 -6px 10px rgba(0, 0, 0, .22); }
#showcase .gr-swatch:hover { transform: scale(1.06); }
#showcase .gr-swatch.on { box-shadow: 0 0 0 2px #071b12, 0 0 0 4px var(--gold); }
#showcase .gr-swatch.on::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); border-radius: 50%;
  background: #071b12 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffc43d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; }
#showcase .gr-swatch.locked { filter: saturate(.35) brightness(.55); }
#showcase .gr-swatch.locked::after { content: ""; position: absolute; inset: 0; background: #fff; -webkit-mask: var(--ico-lock) center / 16px no-repeat; mask: var(--ico-lock) center / 16px no-repeat; }

/* готовые сочетания: кружок «кузов / акцент» и название */
#showcase .gr-presets { display: flex; flex-wrap: wrap; gap: 6px; }
#showcase .gr-preset { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 9px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--field); color: var(--ink); cursor: pointer; font: 400 13px/1.15 "Play", sans-serif; }
#showcase .gr-preset i { flex: none; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .45); }
#showcase .gr-preset:hover { border-color: rgba(255, 196, 61, .5); }
#showcase .gr-preset.on { border-color: var(--gold); background: var(--gold-soft); color: #ffda88; }
#showcase .gr-preset.locked { color: var(--muted); }
#showcase .gr-preset.locked i { filter: saturate(.35) brightness(.55); }
#showcase .gr-preset.locked::after { content: ""; width: 14px; height: 14px; margin-left: -2px; background: var(--gold); -webkit-mask: var(--ico-lock) center / contain no-repeat; mask: var(--ico-lock) center / contain no-repeat; }

/* карточки: узор, колёса, обвес, балка, антенна, номер — значок слева, название и пояснение */
#showcase .gr-cards { display: grid; gap: 6px; }
#showcase .gr-card { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; align-items: center; width: 100%; min-height: 52px; box-sizing: border-box;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); text-align: left; cursor: pointer; }
#showcase .gr-card:hover { border-color: rgba(255, 196, 61, .5); }
#showcase .gr-card > span { display: grid; gap: 3px; min-width: 0; }
#showcase .gr-card b { font: 700 14px/1.15 "Tektur", sans-serif; }
#showcase .gr-card small { font: 400 12.5px/1.3 "Play", sans-serif; color: var(--muted); }
#showcase .gr-card.on { border-color: var(--gold); background: var(--gold-soft); }
#showcase .gr-card.on b { color: #ffda88; }
#showcase .gr-card.locked { background: rgba(3, 15, 10, .3); border-style: dashed; }
#showcase .gr-card.locked b { color: #d9ddcf; }
#showcase .gr-card.locked small { color: #e6c98a; }
/* значок выбора: кружок — одно из списка, квадрат — ставится отдельно; галочка — выбрано, замок — закрыто */
#showcase .gr-mark { justify-self: center; width: 20px; height: 20px; box-sizing: border-box; border: 2px solid rgba(191, 208, 188, .6); border-radius: 50%; }
#showcase .gr-toggle .gr-mark { border-radius: 5px; }
#showcase .gr-card.on .gr-mark:not(.gr-tire) { border-color: var(--gold); background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23071b12' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat; }
#showcase .gr-card.locked .gr-mark { border: 0; border-radius: 0; background: var(--gold); -webkit-mask: var(--ico-lock) center / 18px no-repeat; mask: var(--ico-lock) center / 18px no-repeat; }
/* колёса: рисунок протектора вместо кружка */
#showcase .gr-tire { width: 28px; height: 28px; border: 0; border-radius: 50%; background: radial-gradient(circle, #6b6f76 0 30%, #1b1b1d 31% 100%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
#showcase .gr-tire-mud { background: radial-gradient(circle, #6b6f76 0 30%, #1b1b1d 31% 74%, transparent 75%), repeating-conic-gradient(#1b1b1d 0 14deg, transparent 14deg 26deg); }
#showcase .gr-tire-race { background: radial-gradient(circle, #6b6f76 0 30%, #1b1b1d 31% 60%, #3a3c40 61% 63%, #1b1b1d 64% 80%, #3a3c40 81% 83%, #1b1b1d 84%); }
#showcase .gr-card.on .gr-tire { box-shadow: 0 0 0 2px #071b12, 0 0 0 4px var(--gold); }

/* номер: переключатель — настоящий флажок внутри карточки; поле надписи */
#showcase .gr-card input[type="checkbox"] { justify-self: center; width: 20px; height: 20px; margin: 0; accent-color: var(--gold); cursor: pointer; }
#showcase .gr-field { display: block; margin-top: 16px; }
#showcase .gr-field input { display: block; width: 100%; min-height: 48px; box-sizing: border-box; padding: 0 14px; border: 1px solid rgba(160, 203, 163, .4); border-radius: 10px;
  background: #e9e4d6; color: #15130f; font: 700 20px/1 "Tektur", sans-serif; letter-spacing: .14em; text-transform: uppercase; }
#showcase .gr-field input::placeholder { color: #8b8676; letter-spacing: .04em; text-transform: none; font-weight: 600; }
#showcase .gr-field input:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

/* низ: строка «что это / как открыть» и «Готово» — всегда видны */
#showcase .gr-foot { flex: none; display: grid; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid var(--line); background: rgba(3, 15, 10, .76); }
#showcase .gr-info { min-height: 2.8em; margin: 0; font: 400 13px/1.4 "Play", sans-serif; color: var(--muted); }
#showcase .gr-info svg { width: 14px; height: 14px; margin-right: 3px; vertical-align: -2px; fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#showcase .gr-done { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 18px;
  border: 1px solid #ffda68; border-radius: 11px; cursor: pointer; color: #1d1709; background: linear-gradient(#ffdb53, #ffb413);
  box-shadow: inset 0 1px 0 #fff0a1, 0 3px 0 #a26b05; font: 700 16px/1 "Tektur", sans-serif; }
#showcase .gr-done:hover { filter: brightness(1.06); }
#showcase .gr-done:active { transform: translateY(2px); box-shadow: inset 0 1px 0 #fff0a1, 0 1px 0 #a26b05; }
#showcase .gr-done kbd { padding: 3px 6px; border: 1px solid rgba(29, 23, 9, .35); border-radius: 5px; font: 700 11px/1 "Tektur", sans-serif; color: #5a4310; }

/* подсказка витрины («осмотреть по кругу») — посередине свободной части экрана, слева от панели */
#showcase.garage .sc-hint { left: calc((100vw - var(--gr-w) - var(--gr-gap)) / 2); max-width: calc(100vw - var(--gr-w) - 3 * var(--gr-gap));
  box-sizing: border-box; white-space: normal; text-align: center; line-height: 1.35; }
#showcase.garage .sc-hint b:last-child { color: #ffb020; }
body.touch #showcase.garage .sc-hint-start { display: none; }   /* в гараже ключа нет — выход кнопкой «Готово» */

/* низкий экран (телефон лёжа, 390 px): шапка в строку, «Готово» справа от пояснения */
@media (max-height: 520px) {
  #showcase { --gr-gap: 10px; }
  #showcase .sc-garage { height: calc(100vh - 20px); height: calc(100dvh - 20px); border-radius: 12px; }
  /* готовые сочетания — одной лентой с прокруткой вбок: цвета кузова видны без прокрутки */
  #showcase .gr-presets { flex-wrap: nowrap; overflow-x: auto; margin-right: -12px; padding-right: 12px; scrollbar-width: none; }
  #showcase .gr-preset { flex: none; white-space: nowrap; }
  #showcase .gr-top { padding: 7px 12px; }
  #showcase .gr-top small { display: none; }
  #showcase .gr-top b { font-size: 17px; }
  #showcase .gr-body { padding: 10px 12px 12px; }
  #showcase .gr-group + .gr-group { margin-top: 12px; }
  #showcase .gr-foot { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 8px 10px 8px 12px; }
  #showcase .gr-info { min-height: 0; font-size: 12px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  #showcase .gr-done { width: auto; min-width: 116px; }
}
@media (prefers-reduced-motion: reduce) { #showcase .gr-swatch:hover { transform: none; } }
