/* Приёмник: клавиши диапазонов, стеклянная шкала со стрелкой, табло с вариантами. Разметку строит js/tuner.js. */

.radio { position: relative; }
.radio-face {
  position: relative; display: grid; grid-template-columns: 210px 1fr; gap: 28px;
  padding: 26px; border-radius: var(--r-plate); background: var(--plate); box-shadow: var(--shadow-plate);
}
/* винты по углам */
.radio-face::before, .radio-face::after {
  content: ""; position: absolute; top: 12px; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 18%, var(--line) 20% 60%, var(--ink-2) 62%);
  box-shadow: 0 0 0 1px rgba(15,42,39,.15);
}
.radio-face::before { left: 12px; }
.radio-face::after { right: 12px; }

/* решётка динамика с табличкой */
.grille { position: relative; display: grid; align-items: end; justify-items: center; padding: 0 0 22px;
  border-radius: 16px; background: var(--alu-2);
  background-image: radial-gradient(circle, var(--ink) 0 2.2px, transparent 2.6px);
  background-size: 12px 12px; background-position: 6px 6px; opacity: .9;
  box-shadow: inset 0 2px 6px rgba(15,42,39,.25);
}
.plate-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 10px;
  background: linear-gradient(180deg, #f7f9f7, #cfd8d2); box-shadow: 0 0 0 2px #9fb0a8, 0 6px 10px -6px rgba(0,0,0,.6); color: var(--glass); }
.plate-badge svg { width: 30px; height: 30px; }
.plate-badge b { font: 800 26px/1 var(--f-display); letter-spacing: .02em; }
.radio-main { min-width: 0; display: grid; gap: 18px; }
.radio-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* клавиши диапазонов */
.keys { display: flex; gap: 8px; padding: 6px; border-radius: 12px; background: var(--alu-2); box-shadow: inset 0 2px 5px rgba(15,42,39,.18); }
.key {
  position: relative; min-width: 104px; min-height: 48px; padding: 0 16px 0 30px; border: 0; border-radius: var(--r-key);
  font: 700 22px/1 var(--f-display); letter-spacing: .02em; color: var(--ink); cursor: pointer;
  background: linear-gradient(#fbfcfb, #e9eeea); box-shadow: 0 4px 0 #b4bfb8, 0 6px 10px -6px rgba(15,42,39,.5);
  transition: transform .09s ease, box-shadow .09s ease;
}
.key i { position: absolute; left: 12px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: #9aa69f; box-shadow: inset 0 1px 1px rgba(0,0,0,.35); }
.key[aria-selected="true"] { transform: translateY(3px); box-shadow: 0 1px 0 #b4bfb8, inset 0 2px 4px rgba(15,42,39,.18); background: linear-gradient(#e9eeea, #f6f8f6); }
.key[aria-selected="true"] i { background: var(--amber); box-shadow: 0 0 8px 2px rgba(255,178,63,.75); }
:root[data-theme="dark"] .key, :root:not([data-theme="light"]) .key { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .key { background: linear-gradient(#1d302c, #15241f); box-shadow: 0 4px 0 #050c0a, 0 6px 10px -6px #000; }
  :root:not([data-theme="light"]) .key[aria-selected="true"] { background: linear-gradient(#15241f, #1a2b27); box-shadow: 0 1px 0 #050c0a, inset 0 2px 4px #000; } }
:root[data-theme="dark"] .key { background: linear-gradient(#1d302c, #15241f); box-shadow: 0 4px 0 #050c0a, 0 6px 10px -6px #000; }
:root[data-theme="dark"] .key[aria-selected="true"] { background: linear-gradient(#15241f, #1a2b27); box-shadow: 0 1px 0 #050c0a, inset 0 2px 4px #000; }

.seek { flex: 1 1 200px; max-width: 320px; position: relative; }
.seek input {
  width: 100%; height: 48px; padding: 0 14px 0 40px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--plate); color: var(--ink); font: 400 16px var(--f-text);
}
.seek input:focus { outline: none; border-color: var(--enamel); }
.seek svg { position: absolute; left: 13px; top: 14px; width: 20px; height: 20px; color: var(--ink-2); }

/* «магический глаз» */
.eye { margin-left: auto; width: 46px; height: 46px; border-radius: 50%; background: #06120f; box-shadow: 0 0 0 4px var(--alu-2), inset 0 2px 6px #000; display: grid; place-items: center; }
.eye svg { width: 38px; height: 38px; }
.eye .fan { fill: var(--eye); opacity: .9; transform-origin: 50% 50%; transition: transform .45s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 3px var(--eye)); }
.eye .fan.l { transform: rotate(-38deg); }
.eye .fan.r { transform: rotate(38deg); }
.radio.locked .eye .fan.l { transform: rotate(-8deg); }
.radio.locked .eye .fan.r { transform: rotate(8deg); }

/* шкала */
.scale {
  position: relative; height: 112px; border-radius: 14px; overflow: hidden; cursor: grab; touch-action: pan-y;
  background: linear-gradient(180deg, var(--glass-2), var(--glass) 55%, #020605);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 10px 24px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.7);
  user-select: none; -webkit-user-select: none;
}
.scale:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.scale.drag { cursor: grabbing; }
/* блик на стекле */
.scale::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: linear-gradient(176deg, rgba(255,255,255,.10) 0 18%, transparent 19%), linear-gradient(90deg, rgba(10,23,21,.95), transparent 14%, transparent 86%, rgba(10,23,21,.95)); }
.scale-track { position: absolute; left: 0; top: 0; bottom: 0; display: flex; align-items: stretch; will-change: transform; }
.scale-track .tick-row { position: absolute; left: 0; right: 0; bottom: 10px; height: 16px; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255,178,63,.55) 0 1px, transparent 1px 12px), repeating-linear-gradient(90deg, rgba(255,178,63,.9) 0 2px, transparent 2px 60px);
  background-size: auto 7px, auto 14px; background-repeat: repeat-x; background-position: 0 100%, 0 100%; }
.st { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 0 26px 18px; white-space: nowrap; color: var(--amber); opacity: .62; transition: opacity .2s ease; cursor: pointer; }
.st b { font: 600 30px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 0 10px rgba(255,178,63,.45), 0 0 2px var(--glass), 0 0 4px var(--glass); }
.st small { font: 400 17px/1 var(--f-led); letter-spacing: .04em; opacity: .8; }
.st[aria-selected="true"] { opacity: 1; }
.st[aria-selected="true"] b { text-shadow: 0 0 14px rgba(255,178,63,.8); }
.needle { position: absolute; z-index: 2; top: 8px; bottom: 6px; left: 50%; width: 3px; margin-left: -1.5px; border-radius: 2px;
  background: var(--needle); box-shadow: 0 0 10px 1px rgba(229,67,44,.75); pointer-events: none; }
.tune { position: absolute; z-index: 5; top: 50%; width: 40px; height: 40px; margin-top: -26px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,178,63,.12); color: var(--amber); font: 600 26px/1 var(--f-display); }
.tune:hover { background: rgba(255,178,63,.22); }
.tune.prev { left: 8px; } .tune.next { right: 8px; }

/* табло */
.readout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: end; }
.ro-head { min-width: 0; }
.ro-name { font-size: clamp(34px, 3.4vw, 46px); }
.ro-note { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.ro-opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.opt {
  display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 2px 12px; min-width: 150px; padding: 12px 16px;
  border: 2px solid var(--line); border-radius: 14px; background: transparent; color: var(--ink); cursor: pointer; text-align: left;
  font: 500 15px/1.2 var(--f-text);
}
.opt .v { font: 700 24px/1 var(--f-display); }
.opt .p { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: 500 30px/1 var(--f-led); color: var(--enamel); }
.opt[aria-checked="true"] { border-color: var(--enamel); background: rgba(14,92,88,.08); box-shadow: inset 0 0 0 1px var(--enamel); }
.opt .flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; display: inline-block; vertical-align: -2px; margin-right: 6px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.ro-buy { grid-column: 2; grid-row: 1; display: flex; gap: 10px; align-items: center; }
.ro-empty { grid-column: 1 / -1; color: var(--ink-2); }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 12px; height: 52px; }
.qty button { width: 40px; height: 100%; border: 0; background: none; color: var(--ink); font: 600 24px/1 var(--f-display); cursor: pointer; }
.qty output { min-width: 34px; text-align: center; font: 500 26px/1 var(--f-led); }

@media (max-width: 900px) {
  .radio-face { grid-template-columns: 1fr; padding: 18px 14px 16px; gap: 16px; }
  .grille { display: none; }
  .key { min-width: 0; flex: 1; padding: 0 10px 0 26px; font-size: 20px; }
  .keys { flex: 1 1 100%; }
  .seek { max-width: none; }
  .eye { display: none; }
  .scale { height: 96px; }
  .st b { font-size: 25px; } .st { padding: 0 18px 16px; }
  .readout { grid-template-columns: 1fr; }
  .ro-buy { grid-column: 1; grid-row: auto; order: 3; }
  .ro-opts { order: 2; }
  .ro-buy .btn { flex: 1; }
  .opt { flex: 1 1 calc(50% - 10px); min-width: 0; }
}

/* флаг рядом с названием страны на табло */
.ro-name .ro-flag { display: inline-block; width: .82em; height: .615em; margin: 0 .28em .06em 0; border-radius: 3px; object-fit: cover; vertical-align: baseline; box-shadow: 0 0 0 1px rgba(15,42,39,.14); }
/* пока каталог грузится, место под приёмник уже занято, чтобы страница не прыгала */
.tuner-slot:empty { min-height: 430px; border-radius: var(--r-plate); background: var(--plate); box-shadow: var(--shadow-plate); }
@media (max-width: 900px) { .tuner-slot:empty { min-height: 560px; } }

/* узкий экран: цена под объёмом, иначе четырёхзначные цены не помещаются в кнопку варианта */
@media (max-width: 480px) {
  .opt { grid-template-columns: minmax(0, 1fr); padding: 10px 12px 11px; }
  .opt .p { grid-column: 1; grid-row: 3; margin-top: 6px; font-size: 26px; }
  /* количество и кнопка покупки в два ряда, чтобы сумма помещалась в кнопку целиком */
  .ro-buy { flex-wrap: wrap; }
  .ro-buy .qty { flex: 1 1 100%; justify-content: space-between; }
  .ro-buy .qty button { width: 64px; }
  .ro-buy .btn { flex: 1 1 100%; }
}
