/* ============ DGT 3000 Simulator ============ */
:root {
  --bg: #14161a;
  --bg-soft: #1c1f24;
  --ink: #e9e7e1;
  --ink-dim: #9aa0a8;
  --line: #2c3037;
  --dgt-red: #c8102e;
  --lcd-bg: #ccd1d0;
  --lcd-ink: #22252a;
  --body-hi: #d92b3d;
  --body-mid: #c01d30;
  --body-lo: #8e0f1f;
  --font-display: "Futura", "Avenir Next", "Century Gothic", "Trebuchet MS", sans-serif;
  --font-body: "Avenir Next", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ---------- language ---------- */
[data-lang="uz"] .lang-en, [data-lang="uz"] .lang-ru,
[data-lang="en"] .lang-uz, [data-lang="en"] .lang-ru,
[data-lang="ru"] .lang-uz, [data-lang="ru"] .lang-en { display: none !important; }
.lang-switch {
  position: fixed;
  top: 14px; right: 14px;
  z-index: 50;
  display: flex;
  gap: 2px;
  background: rgba(20, 22, 26, .78);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.lang-switch button {
  border: none;
  background: transparent;
  color: var(--ink-dim);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-switch button.active { background: var(--dgt-red); color: #fff; }

html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(120% 90% at 50% 0%, #23272e 0%, var(--bg) 55%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
}

/* ---------- header ---------- */
.page-head {
  max-width: 1060px;
  margin: 0 auto;
  padding: 48px 20px 8px;
  text-align: center;
}
.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 11px;
  color: var(--dgt-red);
  margin-bottom: 10px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.page-head h1 span { color: var(--ink-dim); font-weight: 400; }
.lede {
  max-width: 560px;
  margin: 10px auto 0;
  color: var(--ink-dim);
  font-size: 15px;
}

/* ---------- stage ---------- */
.stage {
  max-width: 1060px;
  margin: 28px auto 0;
  padding: 0 12px;
}

.clock {
  position: relative;
  max-width: 940px;
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.55));
}

/* ---------- lever (white rocker) ---------- */
.lever { position: relative; height: 40px; z-index: 2; }
.lever-track {
  position: absolute;
  left: 10%; right: 10%; bottom: -8px; height: 20px;
  background: linear-gradient(#7a0d1b, #5d0a15);
  border-radius: 10px 10px 0 0;
}
.lever-bar {
  position: absolute;
  left: 11%; right: 11%; bottom: 4px; height: 24px;
  background: linear-gradient(#fbf9f2 0%, #ece9df 55%, #d4d1c5 100%);
  border-radius: 7px;
  box-shadow: 0 3px 6px rgba(0,0,0,.45), inset 0 1px 0 #fff;
  transition: transform .09s ease-out;
  transform-origin: 50% 100%;
}
.lever-bar::after { /* centre pivot seam */
  content: "";
  position: absolute;
  left: 50%; top: 3px; bottom: 3px; width: 2px;
  margin-left: -1px;
  background: rgba(0,0,0,.18);
  border-radius: 1px;
}
.lever-bar.up-left  { transform: rotate(2.2deg); }
.lever-bar.up-right { transform: rotate(-2.2deg); }
.lever-end {
  position: absolute;
  top: -10px; bottom: -4px; width: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
}
.lever-end.left { left: 0; }
.lever-end.right { right: 0; }

/* ---------- body ---------- */
.body {
  position: relative;
  background: linear-gradient(178deg, var(--body-hi) 0%, var(--body-mid) 45%, var(--body-lo) 100%);
  border-radius: 22px 22px 26px 26px;
  padding: clamp(10px, 2.4vw, 22px) clamp(12px, 3vw, 30px) 0;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.28),
    inset 0 -4px 10px rgba(0,0,0,.35);
}

/* one dark faceplate: LCD + brand + key strip */
.display-bezel {
  background: linear-gradient(#141517, #202124 60%, #17181b);
  border-radius: 18px;
  padding: clamp(12px, 2.2vw, 24px) clamp(14px, 2.6vw, 28px) clamp(8px, 1.4vw, 14px);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,.9),
    inset 0 -1px 0 rgba(255,255,255,.06),
    0 1px 0 rgba(255,255,255,.35);
}
.bezel-brand {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(13px, 1.9vw, 21px);
  letter-spacing: .05em;
  color: #fff;
  margin: clamp(4px, .9vw, 10px) 4px clamp(3px, .7vw, 8px);
}
.bezel-brand span { font-weight: 400; color: rgba(255,255,255,.6); margin-left: 3px; }

.lcd-wrap {
  position: relative;
  background:
    linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,0) 35%),
    var(--lcd-bg);
  border-radius: 6px;
  box-shadow: inset 0 2px 10px rgba(20,30,20,.45);
  overflow: hidden;
}
#lcd { display: block; width: 100%; height: auto; }
#lcd polygon, #lcd rect, #lcd path, #lcd line { fill: var(--lcd-ink); }
#lcd line { stroke: var(--lcd-ink); fill: none; stroke-linecap: round; }
#lcd .lcd-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: .02em;
  fill: var(--lcd-ink);
}
#lcd .lcd-ico { font-size: 26px; fill: var(--lcd-ink); }
#lcd .lcd-ico.big { font-size: 32px; }
#lcd .lcd-king { font-size: 44px; fill: var(--lcd-ink); }

.lcd-off {
  position: absolute; inset: 0;
  background: rgba(120, 128, 108, .18);
}
.lcd-off.hidden { display: none; }

/* ---------- clock buttons: key strip attached to the faceplate ---------- */
.btn-row {
  display: flex;
  justify-content: center;
  gap: clamp(5px, 1vw, 9px);
  margin: 0;
  padding: 0;
}
.cbtn {
  flex: 1 1 0;
  height: clamp(46px, 7vw, 60px);
  border-radius: 7px;
  border: none;
  cursor: pointer;
  background: linear-gradient(#33363b, #1d1f23 70%);
  box-shadow:
    0 2px 3px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.16);
  color: #f2f2ee;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, .8vw, 9px);
  transition: transform .05s;
  touch-action: manipulation;
}
.cbtn:active, .cbtn.pressed {
  transform: translateY(1px);
  background: linear-gradient(#26282c, #17181b 70%);
  box-shadow: 0 0 1px rgba(0,0,0,.5), inset 0 1px 3px rgba(0,0,0,.5);
}
.cbtn svg { display: block; }
.cbtn .ic { height: clamp(15px, 2.3vw, 21px); width: auto; fill: #f3f3ef; }
.cbtn .ic2 { height: clamp(11px, 1.7vw, 15px); width: auto; fill: #c9cdd3; color: #c9cdd3; }

/* ---------- body foot ---------- */
.body-foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(8px, 1.4vw, 12px) 4px 12px;
}
.power {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #d4d6d2, #a9aca8 70%);
  color: #45484c;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.6);
}
.power svg { width: 17px; height: 17px; display: block; }
.power:active { transform: translateY(1px); }

/* ---------- coach line ---------- */
.coach {
  max-width: 760px;
  margin: 22px auto 0;
  text-align: center;
  font-size: 14px;
  color: var(--ink-dim);
  min-height: 3em;
  padding: 0 10px;
}
.coach::before { content: "▸ "; color: var(--dgt-red); }

/* ---------- reference cards ---------- */
.ref {
  max-width: 1060px;
  margin: 46px auto 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 28px;
  min-width: 0; /* let the scroll wrapper, not the card, absorb wide tables */
}
.card:first-child { grid-column: 1 / -1; }
.card h2 {
  font-family: var(--font-display);
  font-size: 19px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 14px;
}
.card h2 .num { color: var(--dgt-red); margin-right: 8px; }
.card h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-dim);
  margin: 18px 0 8px;
}
.card h3:first-child { margin-top: 0; }
.card p { margin-bottom: 10px; font-size: 14.5px; color: #cfd2d6; }
.card ul, .card ol { padding-left: 20px; font-size: 14.5px; color: #cfd2d6; }
.card li { margin-bottom: 5px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cols > div { min-width: 0; }

kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #2a2e35;
  border: 1px solid #3b404a;
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--ink);
  white-space: nowrap;
}

table.keys { border-collapse: collapse; font-size: 14px; color: #cfd2d6; }
table.keys td { padding: 4px 14px 4px 0; }

.table-scroll { overflow-x: auto; }
table.options {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
table.options th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
  padding: 6px 10px 6px 0;
}
table.options td {
  padding: 4px 10px 4px 0;
  border-bottom: 1px solid #23262c;
  color: #c6c9ce;
  white-space: nowrap;
}
table.options tr.hl td { color: var(--ink); }
table.options tr.hl td:first-child { color: var(--dgt-red); }
.fineprint { font-size: 12px; color: var(--ink-dim); margin-top: 10px; }

dl.methods dt {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--dgt-red);
  margin-top: 12px;
}
dl.methods dt:first-child { margin-top: 0; }
dl.methods dd { font-size: 14px; color: #cfd2d6; }

/* ---------- footer ---------- */
.page-foot {
  max-width: 720px;
  margin: 44px auto 0;
  padding: 0 20px 48px;
  text-align: center;
  font-size: 12.5px;
  color: #6d737b;
}
.page-foot .author {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-dim);
}
.page-foot .author strong { color: var(--ink); font-weight: 600; }
.page-foot .author a { color: var(--dgt-red); text-decoration: none; }
.page-foot .author a:hover { text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .ref { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 560px) {
  body { overflow-x: hidden; }
  .page-head { padding: 58px 14px 0; } /* room for the fixed language switch */
  .page-head h1 { font-size: clamp(30px, 9vw, 40px); }
  .lede { font-size: 14px; }
  .stage { padding: 0 4px; margin-top: 18px; }
  .clock { filter: drop-shadow(0 16px 22px rgba(0,0,0,.5)); }
  .body { border-radius: 14px 14px 18px 18px; padding-left: 8px; padding-right: 8px; }
  .display-bezel { border-radius: 12px; padding: 8px 9px 6px; }
  .btn-row { gap: 3px; }
  .cbtn { height: 48px; border-radius: 6px; gap: 5px; }
  .cbtn .ic { height: 16px; }
  .cbtn .ic2 { height: 10px; }
  .lever { height: 34px; }
  .lever-bar { left: 9%; right: 9%; height: 20px; }
  .power { width: 34px; height: 34px; }
  .power svg { width: 14px; height: 14px; }
  .bezel-brand { font-size: 13px; margin: 5px 2px 4px; }
  .body-foot { padding-bottom: 9px; }
  .coach { font-size: 13px; margin-top: 14px; }
  .ref { margin-top: 28px; padding: 0 10px; gap: 12px; }
  .card { padding: 20px 16px; }
  .card h2 { font-size: 16px; }
  #lcd .lcd-label { font-size: 20px; }
  .page-foot { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .lever-bar, .cbtn { transition: none; }
}
