:root{
  --bg:#003;
  --fg:#d7d7ff;
  --panel:#001a33;
  --line:#9cf;
  --panel2:#00162b;
}

/* === КЛЮЧЕВОЕ: фикс мобильного Chrome/Android и iOS === */
html{
  -webkit-text-size-adjust: 100%; /* гасим авто-увеличение текста в Chrome/Safari mobile */
  text-size-adjust: 100%;
}

/* base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.04) 25%, rgba(0,0,0,0) 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.04) 25%, rgba(0,0,0,0) 25%),
    linear-gradient(45deg, rgba(0,0,0,0) 75%, rgba(255,255,255,0.04) 75%),
    linear-gradient(-45deg, rgba(0,0,0,0) 75%, rgba(255,255,255,0.04) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  image-rendering: pixelated;
  line-height: 1.45;
  font-size: clamp(14px, 1.9vw, 16px);
}

/* ещё немного страховки от переполнений на мобилках */
body, .container, main, .side, .box, .forum td, .forum th {
  overflow-wrap: anywhere;
  word-break: break-word;
}

a { color: #66ffea; }
a:hover { color: #fff48a; }

.container {
  max-width: 980px;
  margin: 16px auto;
  border: 3px double var(--line);
  box-shadow: 0 0 0 4px #001a33, 0 0 20px #002b66 inset;
  background: var(--panel);
}

.header {
  background: linear-gradient(#013, #025);
  border-bottom: 3px ridge var(--line);
  padding: 8px 12px;
  color: #cfe8ff;
}
.header h1 {
  margin: 0;
  font-size: clamp(20px, 3.6vw, 22px);
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 #000;
}
.sub {
  font-size: clamp(11px, 2.5vw, 12px);
  opacity: .9;
}

.ticker {
  border-top: 2px groove #7ad;
  border-bottom: 2px ridge #7ad;
  background: #002247;
}

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.forum {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  table-layout: fixed;         /* фикс ширины колонок, меньше шанс разъезда */
}
.forum th, .forum td {
  border: 1px solid #2a4f7a;
  padding: 8px;
  vertical-align: top;
}
.forum th {
  background: #0a2a55;
  color: #dff3ff;
  text-align: left;
}
.forum tr:nth-child(even) td { background: #052244; }
.forum tr:nth-child(odd) td { background: #071f3d; }

.box {
  border: 2px outset #7ad;
  padding: 10px;
  background: #032548;
  margin: 10px 0;
}

/* counter */
.counter {
  display: inline-block;
  padding: 4px 8px;
  background: #000;
  border: 2px inset #aaa;
  color: #0f0;
  font-family: "Courier New", monospace;
  letter-spacing: 2px;
  font-size: 14px;
  line-height: 1;
  min-width: 96px;
  text-align: right;
  user-select: none;
  border-radius: 2px;
}
.counter.skeleton{
  color:#0a0;
  position:relative;
}
.counter.skeleton::after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.15) 50%, transparent 100%);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer{ 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }

.blink {
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

.buttons { display:flex; gap:8px; flex-wrap: wrap; }
.btn88 {
  width: 88px; height: 31px; border: 1px solid #99c;
  display: inline-flex; align-items:center; justify-content:center;
  background: linear-gradient(#113,#334);
  font-size: 10px; text-transform: uppercase; text-align:center;
  box-shadow: 0 0 0 1px #223 inset;
}

code, pre {
  background: #021630;
  border: 1px solid #284f82;
  padding: 6px 8px;
  display: block;
  color: #e0ffe0;
  overflow-x: auto;
  font-family: "Courier New", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* чтобы длинные URL/код не выламывали сетку на узких экранах */
a, code { overflow-wrap: anywhere; word-break: break-word; }

.footer {
  padding: 10px;
  font-size: 11px;
  color: #9cc;
  border-top: 3px ridge var(--line);
  background: var(--panel2);
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  padding: 12px;
}
.side .box { margin-top: 0; }
.nav a { display:block; padding:6px 8px; border-bottom:1px dashed #356; text-decoration:none; }
.nav a:hover { background:#07305c; }

.badge {
  display:inline-block; padding:1px 4px; font-size:10px; border:1px solid #f6a;
  background:#600; color:#fff; margin-left:6px;
}

/* формам — адекватные размеры и отсутствие авто-зума на мобилках */
input, select, textarea, button {
  font: inherit;
  max-width: 100%;
}
@media (max-width: 600px) {
  input, select, textarea { font-size: 16px; } /* анти-зум в iOS/Android */
}

/* mobile tweaks */
@media (max-width: 840px) {
  .layout { grid-template-columns: 1fr; }
}

/* ========= НОВОЕ: бесшовная бегущая строка (замена <marquee>) ========= */
.ticker {
  overflow: hidden;            /* скрываем выходящее за границы */
  position: relative;
}

.ticker__track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: ticker-scroll 20s linear infinite; /* скорость движа */
}

.ticker__chunk {
  padding-right: 60px;         /* расстояние между повторами */
  white-space: nowrap;
  font-size: 12px;             /* соответствовало старому marquee */
  line-height: 1;
  padding-top: 4px;            /* как было у marquee: padding: 4px 0 */
  padding-bottom: 4px;
}

/* Пауза при наведении — читаемо */
.ticker:hover .ticker__track {
  animation-play-state: paused;
}

/* Бесшовный цикл (два одинаковых куска → сдвиг на -50%) */
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Уважение к системной настройке "меньше анимаций" */
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; transform: none; }
}

/* Мобилки — как у тебя было: меньше шрифт */
@media (max-width: 600px) {
  .ticker__chunk { font-size: 11px; }
}
