:root {
  --cream: #efe4c6; --cream2: #e2d3ad; --ink: #3a2c1b; --ink2: #8a7752;
  --glow: #ffb24a; --red: #d8322a; --brass: #c9a85c;
  --wood-a: #7a4b26; --wood-b: #4b2c15; --wood-c: #311b0c;
  --panel: #1c1512; --cloth-a: #a98d58; --cloth-b: #6f5733;
  --pad: 28px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at 50% 20%, #2b211a 0%, #14100d 55%, #0a0806 100%);
  color: #cdbfa3; font-family: 'PT Sans Narrow', 'Arial Narrow', sans-serif;
  display: flex; flex-direction: column; align-items: center; padding: 5vh 16px 48px;
}
a { color: inherit; }

/* ---------- корпус ---------- */
.radiola {
  width: min(1120px, 100%); border-radius: 16px; padding: 18px 22px 26px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.012 0.9' numOctaves='3' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    repeating-linear-gradient(91deg, rgba(0,0,0,.10) 0 1px, transparent 1px 9px, rgba(255,255,255,.03) 9px 10px, transparent 10px 23px),
    linear-gradient(180deg, var(--wood-a) 0%, #5e391c 38%, var(--wood-b) 70%, var(--wood-c) 100%);
  box-shadow: 0 50px 90px rgba(0,0,0,.65), 0 10px 20px rgba(0,0,0,.4),
    inset 0 2px 0 rgba(255,220,170,.18), inset 0 -4px 0 rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.35);
}
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 2px 6px 14px; }
.badge {
  font-family: 'Lobster', cursive; font-size: 30px; line-height: 1; color: transparent;
  background: linear-gradient(180deg, #fff8e8 0%, #d9c9a6 35%, #8a7752 50%, #f6ecd4 62%, #b9a67e 100%);
  -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 1px 0 rgba(0,0,0,.6));
}
.legend { font-family: 'Oswald', sans-serif; font-weight: 400; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: #d6c39b; opacity: .85; text-align: center; padding-top: 6px; }
.eye {
  --sig: 0; width: 40px; height: 40px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #0b1f10 0 29%, transparent 31%),
    conic-gradient(from calc(180deg - var(--sig) * 85deg), #9dffac 0 calc(var(--sig) * 170deg), #0f2d16 0);
  box-shadow: 0 0 0 3px #0e0b09, 0 0 0 5px #3a2a1c, 0 0 calc(var(--sig) * 18px) rgba(130,255,150,.75), inset 0 0 12px #000;
  transition: box-shadow .3s;
}

/* ---------- шкала ---------- */
.scale {
  position: relative; height: 204px; border-radius: 8px; overflow: hidden; cursor: crosshair; user-select: none;
  background: linear-gradient(180deg, #f4ebd3 0%, var(--cream) 50%, var(--cream2) 100%);
  box-shadow: inset 0 0 0 3px #15100c, inset 0 10px 30px rgba(60,40,10,.28), 0 0 0 5px #0d0a08, 0 2px 0 6px rgba(255,255,255,.06);
  touch-action: none;
}
.scale.on { background: linear-gradient(180deg, #f7eed6 0%, #f2e4bf 50%, #ecd9a8 100%); }
.lamp { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: radial-gradient(60% 70% at 50% 110%, rgba(255,170,70,.55), rgba(255,170,70,0) 70%); }
.scale.on .lamp { opacity: 1; }
.glass { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(104deg, rgba(255,255,255,0) 28%, rgba(255,255,255,.20) 42%, rgba(255,255,255,.05) 50%, rgba(255,255,255,0) 60%),
              linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 30%); }
.ends { position: absolute; left: 12px; right: 12px; top: 136px; display: flex; justify-content: space-between; font: 400 10px/1 'PT Sans Narrow', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--ink2); opacity: .8; }
.band { position: absolute; left: 12px; right: 12px; height: 1px; background: #8f7d57; opacity: .8; }
.band.b1 { top: 104px; } .band.b2 { top: 126px; opacity: .35; }
.marks { position: absolute; inset: 0; }
.city {
  position: absolute; transform: translateX(-50%); white-space: nowrap;
  font: 700 12px/1 'PT Sans Narrow', sans-serif; letter-spacing: .09em; text-transform: uppercase; color: var(--ink);
}
.city.approx { font-weight: 400; font-style: italic; color: var(--ink2); letter-spacing: .05em; }
.city.near { color: #000; text-shadow: 0 0 6px rgba(255,170,70,.6); }
.city::after { content: ''; position: absolute; left: calc(50% + var(--skew, 0px)); top: 100%; height: var(--lead, 10px); width: 1px; background: var(--ink2); opacity: .5; }
.tick { position: absolute; top: 96px; width: 2px; height: 16px; background: #43351f; transform: translateX(-50%); transition: background .2s, box-shadow .2s; }
.tick::after { content: ''; position: absolute; left: 50%; top: -5px; width: 5px; height: 5px; border-radius: 50%; background: #43351f; transform: translateX(-50%); }
.tick.lit, .tick.lit::after { background: #ff7a1a; box-shadow: 0 0 10px rgba(255,150,60,.9); }
.tick.dead, .tick.dead::after { background: #b9ab8e; }
.tick.offsite, .tick.offsite::after { background: #8d7f66; opacity: .55; }
.pointer { position: absolute; top: 0; bottom: 46px; left: 0; width: 2px; background: var(--red); box-shadow: 0 0 6px rgba(216,50,42,.55); will-change: transform; pointer-events: none; }
.pointer i { position: absolute; bottom: -4px; left: 50%; width: 14px; height: 8px; transform: translateX(-50%); background: linear-gradient(180deg, #e8cf8a, #a4863f); border-radius: 2px 2px 0 0; }
.display {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46px; padding: 0 18px 0 var(--pad);
  display: flex; align-items: center; gap: 16px; background: linear-gradient(180deg, #1a120d, #0f0a07);
  box-shadow: inset 0 2px 0 rgba(0,0,0,.6), inset 0 -1px 0 rgba(255,200,120,.08);
  font: 400 19px/1 'PT Sans Narrow', sans-serif; letter-spacing: .07em; text-transform: uppercase; color: #6d5a3a;
}
.scale.on .display { color: var(--glow); text-shadow: 0 0 8px rgba(255,178,74,.45); }
.display .st { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.display .where { font-size: 14px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.display .site { margin-left: auto; font-size: 13px; letter-spacing: .1em; text-decoration: none; border: 1px solid currentColor; padding: 4px 8px; border-radius: 3px; opacity: .8; }
.display .site:hover { opacity: 1; }
.display.scanning .st { opacity: .55; }

/* ---------- низ: динамик и панель ---------- */
.bottom { display: grid; grid-template-columns: 1fr 330px; gap: 18px; margin-top: 18px; }
.speaker {
  border-radius: 10px; min-height: 220px;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.22) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 45%, var(--cloth-a), var(--cloth-b) 80%);
  box-shadow: inset 0 0 0 3px #1d130b, inset 0 0 0 5px #6a4a2a, inset 0 14px 40px rgba(0,0,0,.45), 0 1px 0 rgba(255,255,255,.08);
}
.panel { border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  background: linear-gradient(180deg, #221914, var(--panel)); box-shadow: inset 0 0 0 3px #0e0a08, inset 0 1px 0 rgba(255,255,255,.06), inset 0 10px 30px rgba(0,0,0,.5); }
.keys { display: flex; gap: 6px; }
.key {
  flex: 1; height: 44px; border: 0; border-radius: 3px 3px 5px 5px; cursor: pointer;
  background: linear-gradient(180deg, #f6eedb 0%, #e6dabd 60%, #c9b995 100%);
  box-shadow: 0 5px 0 #8b7a58, 0 7px 6px rgba(0,0,0,.5), inset 0 1px 0 #fff;
  font: 500 12px/1 'Oswald', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #3b2f1f; transform: translateY(0); transition: transform .08s, box-shadow .08s;
}
.key:active, .key.on, .key[aria-pressed="true"] { transform: translateY(4px); box-shadow: 0 1px 0 #8b7a58, 0 2px 3px rgba(0,0,0,.5), inset 0 1px 0 #fff; }
.key.on, .key.power[aria-pressed="true"] { background: linear-gradient(180deg, #e8dcbd, #d3c39b); }
.key:disabled { cursor: not-allowed; color: #9b8c6b; background: linear-gradient(180deg, #e3d9c2, #cdbf9f); }
.key.power[aria-pressed="true"]::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 6px; background: #ff7a1a; box-shadow: 0 0 6px #ffb24a; vertical-align: middle; }
.knobs { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 0 6px; }
.knobwrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.knobwrap label { font: 400 11px/1 'Oswald', sans-serif; letter-spacing: .16em; text-transform: uppercase; color: #cdbfa3; opacity: .75; }
.knob {
  --rot: 0rad; width: 116px; height: 116px; border-radius: 50%; position: relative; cursor: grab; touch-action: none; outline-offset: 6px;
  background:
    radial-gradient(circle at 50% 50%, #2a2a2a 0 58%, transparent 59%),
    repeating-conic-gradient(from 0deg, #0e0e0e 0 4deg, #343434 4deg 8deg);
  box-shadow: 0 8px 14px rgba(0,0,0,.65), 0 0 0 2px #0a0a0a, inset 0 2px 2px rgba(255,255,255,.18), inset 0 -3px 6px rgba(0,0,0,.6);
  transform: rotate(var(--rot));
}
.knob::before { content: ''; position: absolute; inset: 24%; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #4a4a4a, #161616 70%); box-shadow: inset 0 1px 1px rgba(255,255,255,.2), 0 2px 4px rgba(0,0,0,.6); }
.knob .mark { position: absolute; top: 8px; left: 50%; width: 3px; height: 22px; margin-left: -1.5px; border-radius: 2px; background: #efe4c6; box-shadow: 0 0 2px #000; }
.knob.small { width: 80px; height: 80px; }
.knob.small .mark { height: 16px; top: 6px; }
.knob.grab { cursor: grabbing; }

.note { max-width: 1120px; margin: 22px 0 0; font-size: 14px; line-height: 1.5; letter-spacing: .02em; color: #8f8168; text-align: center; }
.note em { font-style: italic; color: #a89a7c; }

@media (max-width: 760px) {
  body { padding: 12px 10px 40px; }
  .radiola { padding: 12px 12px 18px; border-radius: 12px; }
  .top { grid-template-columns: auto 1fr auto; gap: 10px; padding-bottom: 10px; }
  .legend { display: none; }
  .badge { font-size: 24px; }
  :root { --pad: 22px; }
  .scale { height: 190px; }
  .city { font-size: 10px; letter-spacing: .05em; }
  .ends { display: none; }
  .display { font-size: 15px; padding-left: 12px; gap: 10px; }
  .display .where { display: none; }
  .bottom { grid-template-columns: 1fr; }
  .speaker { min-height: 70px; }
  .knob { width: 104px; height: 104px; }
}
