/* ═══════════════════════════════════════════════════════
   MOBILE LAYOUT 9:16 — только для mobile.html
   ═══════════════════════════════════════════════════════ */

@media screen and (max-width: 767px) {

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: #0d0d0d;
}

#terminal {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  border-radius: 0;
  border: none;
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

#inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
}

/* ── 1. ТАБЛИЧКА ── */
.nameplate-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}
.nameplate-img {
  width: 100%;
  height: auto;
  max-height: 15dvh;
  object-fit: contain;
}

/* ── 2. РАДИО: шкала сверху / динамик слева от тюнера снизу ── */
.radio-row {
  display: grid;
  grid-template-areas:
    "scale   scale"
    "speaker tuner";
  grid-template-columns: auto 1fr;
  gap: 6px 8px;
  width: 100%;
  align-items: center;
}
.speaker-wrap {
  grid-area: speaker;
  width: clamp(50px, 12.5vw, 74px);  /* +20% */
  height: clamp(50px, 12.5vw, 74px);
  flex-shrink: 0;
  justify-self: end;
  margin-left: 30px;
}
.radio-wrap {
  grid-area: scale;
  height: clamp(28px, 7dvh, 46px);
  margin: 10px auto 0;
  width: 100%;
}
.tuner-wrap {
  grid-area: tuner;
  width: clamp(91px, 24vw, 130px);
  height: clamp(91px, 24vw, 130px);
  justify-self: center;
}

/* ── 3. ТАЙМЕР ── */
.timer-panel { padding: 4px 10px; }
#timer {
  font-size: clamp(0.85rem, 3.8vw, 1.3rem);
  justify-content: center;
  gap: 3px;
}

/* ── 4. ГЛАВНАЯ СТРОКА — перестраиваем:
        center-col наверху (order:1), лампы внизу рядом (order:2) ── */
.main-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

/* CENTER-COL — занимает всю ширину сверху */
.center-col {
  order: 1;
  width: 100%;
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
}

/* СЧЁТЧИК — большой, на всю ширину */
.counter-panel { padding: 6px 8px; }
#counter {
  font-size: clamp(2.2rem, 11vw, 4rem);
  justify-content: center;
  letter-spacing: 1px;
  overflow: hidden;
}
.digit-slot { width: 0.65em; }

/* КНОПКИ */
.btn-row {
  justify-content: space-around;
  gap: 10px;
}
.btn-img {
  width: clamp(100px, 36vw, 158px);
  height: clamp(40px, 13vw, 64px);
}

/* НИЖНЯЯ СТРОКА — убираем из потока, вешаем между лампами */
.bottom-row {
  position: absolute;
  bottom: 28px; /* выше бегущей строки */
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 60;
  padding: 4px 0;
  width: 22vw;
}
.lamp-wrap {
  width: clamp(42px, 10.5vw, 66px);   /* +50% */
  height: clamp(42px, 10.5vw, 66px);
  margin-bottom: 144px; /* 94px + 50px выше */
}
.tumbler-wrap {
  width: clamp(95px, 25.5vw, 146px);  /* +70% */
  height: clamp(41px, 11vw, 68px);
}

/* ЛАМПЫ — идут ниже center-col, рядом, по 50% ширины */
.tube-col {
  order: 2;
  width: 50%;
  flex-basis: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  box-sizing: border-box;
  position: relative;
  overflow: visible;
}

.tube-wrap {
  position: relative;
  width: clamp(88px, 23vw, 158px);
  height: clamp(141px, 32dvh, 246px);
}

/* Бейджи — к центру между лампами, на уровне середины */
.tube-badge {
  position: absolute;
  top: 42%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Красный (левая лампа) — раздвинут от центра на 20px, поднят на 30px */
.main-row > .tube-col:first-child .tube-badge {
  right: 4px;
  left: auto;
  top: auto;
  bottom: 84px;  /* +30px */
  transform: none;
}

/* Зелёный (правая лампа) — раздвинут от центра на 20px, поднят на 30px */
.main-row > .tube-col:last-child .tube-badge {
  left: 4px;
  right: auto;
  top: auto;
  bottom: 84px;  /* +30px */
  transform: none;
}

.tube-badge-bg {
  width: clamp(62px, 16.8vw, 101px);  /* +40% */
  height: clamp(31px, 7.7vw, 48px);
  object-fit: contain;
  display: block;
}
.tube-badge-text {
  font-size: clamp(0.85rem, 2.6vw, 1.2rem);
}

/* ── 5. БЕГУЩАЯ СТРОКА ── */
.marquee-panel { padding: 3px 0; }
#marquee { font-size: clamp(0.55rem, 2.4vw, 0.8rem); }

/* ── Болты ── */
.screw {
  width: clamp(16px, 4vw, 24px);
  height: clamp(16px, 4vw, 24px);
}
.screw-tl { top: 5px;  left: 5px;  }
.screw-tr { top: 5px;  right: 5px; }
.screw-bl { bottom: 5px; left: 5px;  }
.screw-br { bottom: 5px; right: 5px; }

} /* end @media */
