/* ==========================================================================
   SUNO WAVE · «СОБАКА И ЗОЛОТЫЕ ЯЙЦА»
   Ретро-автомат в духе «Электроники»: шампанский корпус, ЖК-экран, сегменты.
   Только transform/opacity в анимациях, никаких backdrop-filter на движении.
   ========================================================================== */

:root {
  --swg-bg-0: #02040a;
  --swg-bg-1: #071427;
  --swg-gold: #ffc85c;
  --swg-gold-dim: rgba(255, 200, 92, .35);
  --swg-cream: #f5f0e2;
  --swg-ink: #1b2016;
  --swg-lcd: #c9d2b8;
  --swg-red: #c8321f;
  --swg-red-hi: #e65035;
  --swg-metal-hi: #f7f1e3;
  --swg-metal: #e3d7c0;
  --swg-metal-mid: #cdbd9f;
  --swg-metal-low: #b7a786;
  --swg-font: "Sora", "Segoe UI", Arial, sans-serif;
  --swg-mono: "Share Tech Mono", "Consolas", monospace;
  --swg-radius: clamp(16px, 1.7vw, 30px);
}

* { box-sizing: border-box; }

.swg-page [hidden] { display: none !important; }

html { height: 100%; }

body.swg-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(130% 105% at 50% -10%, #0d2440 0%, #071427 38%, #040a14 68%, #02040a 100%);
  color: var(--swg-cream);
  font-family: var(--swg-font);
  overflow: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

/* звёздная пыль */
.swg-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.5) 0 1px, transparent 1.4px),
    radial-gradient(circle at 72% 12%, rgba(255,220,160,.45) 0 1px, transparent 1.4px),
    radial-gradient(circle at 84% 68%, rgba(255,255,255,.32) 0 1px, transparent 1.4px),
    radial-gradient(circle at 31% 82%, rgba(255,210,150,.3) 0 1px, transparent 1.4px),
    radial-gradient(circle at 58% 46%, rgba(255,255,255,.22) 0 1px, transparent 1.4px),
    radial-gradient(circle at 9% 60%, rgba(255,255,255,.25) 0 1px, transparent 1.4px),
    radial-gradient(circle at 92% 34%, rgba(255,210,150,.28) 0 1px, transparent 1.4px);
  background-size: 420px 420px, 560px 560px, 380px 380px, 640px 640px, 500px 500px, 460px 460px, 720px 720px;
  opacity: .8;
}

.swg-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(46% 40% at 50% 52%, rgba(255, 184, 88, .12), transparent 72%),
    radial-gradient(30% 26% at 50% 52%, rgba(255, 210, 130, .07), transparent 76%);
}

/* ---------------------------------------------------------------- top bar */

.swg-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 6vh;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 6vw;
}

.swg-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #f3d99d;
  text-decoration: none;
  font-size: clamp(10px, .75vw, 13px);
  font-weight: 700;
  letter-spacing: .18em;
  white-space: nowrap;
  transition: color .18s ease, opacity .18s ease;
}
.swg-logo:hover { color: #ffe4a6; }
.swg-logo__mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 92, .45);
  background: radial-gradient(circle at 40% 35%, rgba(255,226,160,.22), rgba(255,180,70,.04));
  color: var(--swg-gold);
  box-shadow: 0 0 18px rgba(255, 180, 70, .18);
}
.swg-logo__mark svg { width: 14px; height: 14px; display: block; }

.swg-topbar__center {
  font-family: var(--swg-mono);
  font-size: 9px;
  letter-spacing: .34em;
  color: rgba(191, 210, 228, .46);
  text-transform: uppercase;
  white-space: nowrap;
}
.swg-topbar__center b { color: rgba(255, 200, 92, .8); font-weight: 400; }

.swg-tools { display: flex; align-items: center; gap: 8px; }
.swg-tool {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 92, .22);
  background: rgba(8, 17, 30, .48);
  color: rgba(214, 228, 241, .8);
  font-family: var(--swg-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.swg-tool:hover { color: #ffe1a0; border-color: rgba(255, 200, 92, .5); background: rgba(20, 31, 44, .7); }
.swg-tool:focus-visible { outline: 2px solid var(--swg-gold); outline-offset: 2px; }
.swg-tool__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff6a4f;
  box-shadow: 0 0 10px rgba(255, 90, 60, .8);
}
.swg-tool.is-off .swg-tool__dot { background: #5c6877; box-shadow: none; }
.swg-tool svg { width: 12px; height: 12px; display: block; }
@media (max-width: 780px) { .swg-tool__label { display: none; } }

/* ----------------------------------------------------------------- layout */

.swg-main {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 6vh 6vw;
}

/* корпус: на экране 16:9 занимает 88vw × 88vh */
.swg-device {
  position: relative;
  width: min(88vw, 2200px);
  height: min(88vh, 1200px);
  border-radius: var(--swg-radius);
  padding: clamp(9px, .95vw, 18px);
  display: flex;
  flex-direction: column;
  gap: clamp(5px, .55vw, 10px);
  background:
    linear-gradient(118deg,
      #fbf5e8 0%, #e9dfcb 13%, #d2c3a5 29%, #f2ebdb 44%,
      #dfd2b8 57%, #c3b191 73%, #e8dfcc 88%, #c8b795 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .92),
    inset 0 -2px 0 rgba(76, 58, 27, .38),
    inset 0 0 0 1px rgba(255, 255, 255, .30),
    0 0 0 1px rgba(255, 213, 140, .17),
    0 34px 90px -20px rgba(0, 0, 0, .86),
    0 0 90px rgba(255, 178, 66, .10);
  isolation: isolate;
}

/* тонкая золотая контурная линия + «щётка» металла */
.swg-device::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(84, 66, 35, .42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
}
.swg-device::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: .28;
  background: repeating-linear-gradient(96deg,
    rgba(255, 255, 255, .16) 0 1px,
    rgba(90, 72, 40, .05) 1px 3px,
    rgba(255, 255, 255, 0) 3px 7px);
}

.swg-device > * { position: relative; z-index: 1; }

/* винты */
.swg-screw {
  position: absolute;
  z-index: 3;
  width: clamp(5px, .55vw, 9px);
  height: clamp(5px, .55vw, 9px);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fffdf4, #b6a483 58%, #786747 100%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .65);
}
.swg-screw::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 46%;
  height: 1px;
  background: rgba(58, 46, 24, .8);
  transform: rotate(-28deg);
}
.swg-screw--tl { top: clamp(5px, .7vw, 12px); left: clamp(5px, .7vw, 12px); }
.swg-screw--tr { top: clamp(5px, .7vw, 12px); right: clamp(5px, .7vw, 12px); }
.swg-screw--bl { bottom: clamp(5px, .7vw, 12px); left: clamp(5px, .7vw, 12px); }
.swg-screw--br { bottom: clamp(5px, .7vw, 12px); right: clamp(5px, .7vw, 12px); }

/* ---------------------------------------------------------------- head bar */

.swg-head {
  flex: 0 0 auto;
  min-height: clamp(30px, 4.6vh, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(3px, .5vh, 7px) clamp(8px, 1.5vw, 22px) 0;
  color: #3d3526;
}

.swg-brand { display: flex; align-items: baseline; gap: clamp(8px, 1vw, 16px); flex-wrap: wrap; min-width: 0; }
.swg-brand__name {
  font-weight: 800;
  font-size: clamp(12px, 1.28vw, 23px);
  letter-spacing: .30em;
  color: #312a1c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .75);
  white-space: nowrap;
}
.swg-brand__sub {
  font-family: var(--swg-mono);
  font-size: clamp(7px, .62vw, 11px);
  letter-spacing: .24em;
  color: rgba(61, 53, 38, .62);
  text-transform: uppercase;
  white-space: nowrap;
}
.swg-head__right { display: flex; align-items: center; gap: clamp(8px, 1.2vw, 16px); white-space: nowrap; }
.swg-serial {
  font-family: var(--swg-mono);
  font-size: clamp(6px, .55vw, 9px);
  letter-spacing: .2em;
  color: rgba(61, 53, 38, .52);
  text-transform: uppercase;
}
.swg-led {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--swg-mono);
  font-size: clamp(7px, .6vw, 10px);
  letter-spacing: .18em;
  color: #5a4b31;
}
.swg-led i {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9c82, #d23a20 58%, #7e1608 100%);
  box-shadow: inset 0 0 1px #fff;
}
.swg-led i::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 70, 40, .45), transparent 66%);
  animation: swgLedPulse 3.6s ease-in-out infinite;
}
@keyframes swgLedPulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

/* ------------------------------------------------------------------ screen */

.swg-tube { flex: 1 1 auto; min-height: 0; display: flex; padding: 0 clamp(7px, .85vw, 15px); }

.swg-screen {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: clamp(5px, .55vw, 11px);
  background: var(--swg-lcd);
  border: clamp(4px, .45vw, 7px) solid #1d241f;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .10),
    inset 0 12px 34px rgba(0, 0, 0, .48),
    0 2px 0 rgba(255, 255, 255, .42),
    0 0 0 1px rgba(72, 61, 35, .55),
    0 9px 20px rgba(60, 46, 20, .18);
  touch-action: none;
  user-select: none;
}
#swgCanvas { display: block; width: 100%; height: 100%; background: var(--swg-lcd); outline: none; }

.swg-screen.is-invert #swgCanvas { filter: invert(1); }

.swg-screen__glass,
.swg-screen__scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}
.swg-screen__glass {
  z-index: 3;
  background:
    linear-gradient(122deg, rgba(255, 255, 255, .20) 0%, rgba(255, 255, 255, .05) 19%, transparent 36%),
    linear-gradient(0deg, rgba(24, 30, 18, .10), transparent 30%);
  opacity: .7;
}
.swg-screen__scan {
  z-index: 4;
  background: repeating-linear-gradient(0deg, rgba(20, 26, 16, .065) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  opacity: .6;
}
.swg-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 46px rgba(20, 26, 16, .26), inset 0 0 4px rgba(20, 26, 16, .3);
}

/* ------------------------------------------------ power eyes · 20261111
   Живые CSS-глаза героя (как у собаки-диджея и скрепки) на время чемоданчика. */
.swg-eyes {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.swg-eye {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 34px;
  opacity: 0;
  transform-origin: 50% 50%;
  transition: opacity .16s ease;
  will-change: transform;
}
.swg-eyes.is-on .swg-eye { opacity: 1; }
.swg-eye__ball {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #fffef6 0 58%, #efe9d4 78%, #d8d0b6 100%);
  border: 2px solid #1b2016;
  box-shadow: 0 1px 3px rgba(27, 32, 22, .35), inset 0 -2px 3px rgba(27, 32, 22, .10);
  overflow: hidden;
  animation: swgEyeBlink 5.8s ease-in-out infinite;
}
.swg-eye__ball i {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 46%;
  height: 56%;
  margin: -28% 0 0 -23%;
  border-radius: 50%;
  background: #14170f;
  animation: swgEyeWander 7.6s ease-in-out infinite;
}
.swg-eye__ball i::after {
  content: "";
  position: absolute;
  left: 20%;
  top: 14%;
  width: 30%;
  height: 26%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
}
@keyframes swgEyeBlink {
  0%, 91.5%, 95%, 100% { transform: scaleY(1); }
  93.2% { transform: scaleY(.06); }
}
@keyframes swgEyeWander {
  0%, 14% { transform: translate(0, 0); }
  22% { transform: translate(14%, -6%); }
  36% { transform: translate(20%, 8%); }
  50% { transform: translate(-10%, 10%); }
  64% { transform: translate(-20%, -4%); }
  78% { transform: translate(8%, 12%); }
  100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .swg-eye__ball, .swg-eye__ball i { animation: none; }
}

/* -------------------------------------------------------------- overlay card */

.swg-overlay {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.2%, 26px);
  background: radial-gradient(78% 82% at 50% 46%, rgba(201, 210, 184, .26), rgba(201, 210, 184, .74));
}
.swg-overlay[hidden] { display: none; }

.swg-card {
  width: min(580px, 96%);
  max-height: 100%;
  overflow: auto;
  padding: clamp(14px, 2.1vw, 30px);
  border: 2px solid var(--swg-ink);
  border-radius: 4px;
  color: var(--swg-ink);
  background: linear-gradient(180deg, rgba(228, 233, 216, .985), rgba(201, 211, 184, .985));
  box-shadow:
    10px 10px 0 rgba(27, 32, 22, .15),
    inset 0 0 0 1px rgba(255, 255, 255, .42);
  scrollbar-width: thin;
}

.swg-card__eyebrow {
  font-family: var(--swg-mono);
  font-size: clamp(8px, .62vw, 10px);
  letter-spacing: .30em;
  text-transform: uppercase;
  opacity: .55;
  margin-bottom: clamp(5px, .7vw, 9px);
}
.swg-card__title {
  margin: 0 0 clamp(7px, .9vw, 12px);
  font-size: clamp(19px, 2.05vw, 33px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: .015em;
  text-transform: uppercase;
}
.swg-card__title em { font-style: normal; color: #8b2a16; }
.swg-card__lead {
  margin: 0 0 clamp(9px, 1.2vw, 15px);
  font-size: clamp(11px, .9vw, 14px);
  line-height: 1.5;
  max-width: 48ch;
}
.swg-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(5px, .55vw, 9px);
  margin: 0 0 clamp(10px, 1.4vw, 18px);
}
.swg-rule {
  border: 1px solid rgba(27, 32, 22, .24);
  padding: clamp(6px, .65vw, 10px);
  font-family: var(--swg-mono);
  font-size: clamp(8px, .62vw, 10px);
  line-height: 1.35;
  letter-spacing: .02em;
}
.swg-rule b {
  display: block;
  margin-bottom: 2px;
  font-family: var(--swg-font);
  font-size: clamp(10px, .78vw, 12px);
  font-weight: 700;
  letter-spacing: .01em;
}
.swg-score {
  display: flex;
  align-items: flex-end;
  gap: clamp(16px, 2.4vw, 36px);
  margin: 2px 0 clamp(10px, 1.4vw, 16px);
  font-family: var(--swg-mono);
}
.swg-score > div { display: flex; flex-direction: column; gap: 3px; }
.swg-score span { font-size: clamp(8px, .6vw, 10px); letter-spacing: .24em; opacity: .55; }
.swg-score b { font-size: clamp(28px, 2.7vw, 46px); line-height: .95; font-weight: 400; letter-spacing: .06em; }
.swg-card__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swg-card__credit {
  margin: 8px 0 0;
  font-family: var(--swg-mono);
  font-size: clamp(8px, .58vw, 10px);
  line-height: 1.4;
  letter-spacing: .05em;
  opacity: .62;
}
.swg-card__credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.swg-card__foot {
  margin: clamp(9px, 1.2vw, 15px) 0 0;
  font-family: var(--swg-mono);
  font-size: clamp(7px, .58vw, 9px);
  letter-spacing: .12em;
  opacity: .5;
  text-transform: uppercase;
}

.swg-btn {
  appearance: none;
  min-height: 44px;
  padding: clamp(9px, 1vw, 13px) clamp(15px, 1.6vw, 22px);
  border: 2px solid var(--swg-ink);
  border-radius: 3px;
  background: transparent;
  color: var(--swg-ink);
  font-family: var(--swg-font);
  font-weight: 700;
  font-size: clamp(10px, .82vw, 13px);
  letter-spacing: .13em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(27, 32, 22, .16);
  transition: transform .06s ease, box-shadow .06s ease, background .15s ease;
}
.swg-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 rgba(27, 32, 22, .20); }
.swg-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(27, 32, 22, .18); }
.swg-btn:focus-visible { outline: 2px solid var(--swg-ink); outline-offset: 3px; }
.swg-btn--primary {
  color: #fff6e6;
  border-color: #3a170f;
  background: linear-gradient(180deg, #e6553b, #bc2e18 58%, #9d2110);
  box-shadow: 3px 3px 0 rgba(58, 23, 15, .45);
}
.swg-btn--primary:hover { box-shadow: 5px 5px 0 rgba(58, 23, 15, .5); }
.swg-btn--primary:active { box-shadow: 1px 1px 0 rgba(58, 23, 15, .4); }

/* ------------------------------------------------------------------- deck */

.swg-deck {
  flex: 0 0 auto;
  min-height: clamp(64px, 12.6vh, 132px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.2vw, 20px);
  padding: clamp(1px, .4vh, 6px) clamp(9px, 1.5vw, 23px) clamp(4px, .9vh, 12px);
}

.swg-deck__left, .swg-deck__right { display: flex; align-items: center; gap: clamp(8px, 1vw, 16px); }
.swg-dpad { display: flex; gap: clamp(5px, .65vw, 10px); }

.swg-key {
  appearance: none;
  width: clamp(48px, 5vw, 80px);
  height: clamp(42px, 6.2vh, 62px);
  display: grid;
  place-items: center;
  border: 1px solid #7d6c4c;
  border-radius: clamp(5px, .55vw, 9px);
  background: linear-gradient(180deg, #343a31 0%, #1b201a 55%, #0f120e 100%);
  color: #f3e8cf;
  box-shadow:
    0 4px 0 #6f5d3e,
    0 7px 12px rgba(40, 30, 12, .28),
    inset 0 1px 0 rgba(255, 255, 255, .16);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .05s ease, box-shadow .05s ease;
}
.swg-key:hover { color: #ffe0a0; }
.swg-key:active, .swg-key.is-down {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #6f5d3e, 0 2px 5px rgba(40, 30, 12, .25), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.swg-key:focus-visible { outline: 2px solid #5d4c2f; outline-offset: 2px; }
.swg-key svg { width: clamp(17px, 1.5vw, 24px); height: clamp(17px, 1.5vw, 24px); fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.swg-key, .swg-toss, .swg-small { position: relative; }
.swg-key::after, .swg-toss::after, .swg-small::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 2px solid rgba(255, 200, 92, .92);
  opacity: 0;
  transform: scale(.84);
  pointer-events: none;
}
.swg-key.is-pulse::after, .swg-toss.is-pulse::after, .swg-small.is-pulse::after {
  animation: swgTapPulse .42s ease-out;
}
.swg-key.is-down::after {
  animation: swgHoldPulse 1.1s ease-in-out infinite;
  opacity: .32;
  transform: scale(1);
}
@keyframes swgTapPulse {
  0% { opacity: .9; transform: scale(.82); }
  100% { opacity: 0; transform: scale(1.22); }
}
@keyframes swgHoldPulse {
  0%, 100% { opacity: .12; transform: scale(.98); }
  50% { opacity: .48; transform: scale(1.05); }
}

.swg-hint {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--swg-mono);
  font-size: clamp(7px, .62vw, 10px);
  line-height: 1.55;
  letter-spacing: .06em;
  color: #5b4d36;
  text-transform: uppercase;
}
.swg-hint kbd {
  font-family: inherit;
  font-size: .92em;
  border: 1px solid rgba(61, 53, 38, .35);
  border-radius: 2px;
  padding: 0 4px;
  background: rgba(255, 255, 255, .28);
}

.swg-speaker {
  display: grid;
  grid-template-columns: repeat(3, 3px);
  gap: 3px;
  padding: clamp(3px, .35vw, 6px) clamp(4px, .5vw, 8px);
  border-radius: 5px;
  background: linear-gradient(180deg, #d8ccb3, #b9a986);
  box-shadow: inset 0 1px 2px rgba(60, 46, 20, .3), 0 1px 0 rgba(255, 255, 255, .4);
}
.swg-speaker i { display: block; width: 3px; height: clamp(10px, 1.9vh, 18px); border-radius: 2px; background: #5d5139; opacity: .55; }

.swg-small {
  appearance: none;
  padding: clamp(6px, .68vw, 9px) clamp(7px, .8vw, 12px);
  border: 1px solid #8a7857;
  border-radius: 5px;
  background: linear-gradient(180deg, #ece3d1, #cabb9b);
  color: #413725;
  font-family: var(--swg-mono);
  font-size: clamp(8px, .62vw, 10px);
  letter-spacing: .13em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 0 #8a7857, inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: transform .05s ease, box-shadow .05s ease;
}
.swg-small:hover { color: #7a2413; }
.swg-small:active { transform: translateY(2px); box-shadow: 0 0 0 #8a7857, inset 0 1px 0 rgba(255, 255, 255, .5); }
.swg-small:focus-visible { outline: 2px solid #5d4c2f; outline-offset: 2px; }

.swg-toss {
  appearance: none;
  width: clamp(60px, 6.7vw, 102px);
  height: clamp(60px, 6.7vw, 102px);
  display: grid;
  place-items: center;
  border: 2px solid #5a1a10;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 27%, #f47a5c 0%, #df4a30 26%, #b22c17 62%, #7e1a0b 100%);
  color: #ffe9d2;
  font-family: var(--swg-font);
  font-weight: 800;
  font-size: clamp(8px, .9vw, 12px);
  line-height: 1.15;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  box-shadow:
    0 6px 0 #5c170c,
    0 12px 20px rgba(60, 20, 8, .34),
    inset 0 1px 2px rgba(255, 255, 255, .5);
  transition: transform .05s ease, box-shadow .05s ease;
  touch-action: manipulation;
}
.swg-toss span { padding: 0 6px; pointer-events: none; }
.swg-toss svg, .swg-key svg, .swg-tool svg, .swg-btn svg,
.swg-key span, .swg-tool span { pointer-events: none; }
.swg-toss:hover { filter: brightness(1.04); }
.swg-toss:active { transform: translateY(4px); box-shadow: 0 2px 0 #5c170c, 0 5px 10px rgba(60, 20, 8, .3), inset 0 1px 2px rgba(255, 255, 255, .4); }
.swg-toss:focus-visible { outline: 3px solid #7a2413; outline-offset: 3px; }

/* ------------------------------------------------------------------ footer */

.swg-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: 6vh;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6vw;
  font-family: var(--swg-mono);
  font-size: clamp(7px, .55vw, 9px);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(168, 190, 210, .42);
  pointer-events: none;
}
.swg-foot a { color: rgba(255, 200, 92, .66); text-decoration: none; pointer-events: auto; }
.swg-foot a:hover { color: #ffe2a3; }

.swg-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .swg-topbar__center { display: none; }
  .swg-brand__sub { display: none; }
  .swg-hint { display: none; }
}

@media (max-width: 780px) {
  body.swg-page { overflow: auto; display: flex; flex-direction: column; min-height: 100svh; }
  .swg-topbar {
    position: relative;
    height: auto;
    min-height: 0;
    flex: 0 0 auto;
    padding: 14px 4vw 6px;
  }
  .swg-main {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 3vw 12px;
  }
  .swg-device {
    width: 94vw;
    max-width: 560px;
    height: min(82svh, 165vw);
    aspect-ratio: auto;
    border-radius: 18px;
    padding: 8px;
    gap: 5px;
  }
  .swg-head { min-height: 28px; padding: 2px 8px 0; }
  .swg-brand__name { font-size: clamp(11px, 3.4vw, 14px); letter-spacing: .22em; }
  .swg-head__right .swg-serial { display: none; }
  .swg-led span { display: none; }
  .swg-deck { min-height: 98px; padding: 4px 8px 9px; gap: 8px; }
  .swg-deck__left, .swg-deck__right { gap: 8px; }
  .swg-key {
    width: clamp(58px, 15vw, 76px);
    height: clamp(52px, 13vw, 66px);
    border-radius: 11px;
  }
  .swg-key svg { width: 25px; height: 25px; }
  .swg-speaker { display: none; }
  .swg-small {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 11px;
    font-size: 10px;
  }
  .swg-toss {
    width: clamp(72px, 20vw, 94px);
    height: clamp(72px, 20vw, 94px);
    font-size: 11px;
  }
  .swg-foot {
    position: relative;
    height: auto;
    padding: 2px 4vw 14px;
    font-size: 7px;
    letter-spacing: .12em;
  }
  .swg-foot span { max-width: 60vw; }
  .swg-rules { grid-template-columns: 1fr; gap: 4px; }
  .swg-rule { display: flex; align-items: baseline; gap: 7px; padding: 5px 7px; }
  .swg-rule b { display: inline; margin: 0; }
  .swg-card__lead { font-size: 11.5px; }
  .swg-overlay { padding: 9px; }
}

@media (max-width: 780px) and (max-height: 700px) {
  .swg-device { height: min(82svh, 138vw); }
  .swg-rules { display: none; }
}

@media (max-height: 560px) and (min-width: 781px) {
  .swg-topbar { height: 34px; min-height: 34px; }
  .swg-main { padding: 3vh 3vw; }
  .swg-device { width: min(94vw, 174vh); }
  .swg-foot { height: 26px; min-height: 26px; }
  .swg-deck { min-height: 58px; }
  .swg-key { height: 40px; }
  .swg-toss { width: 58px; height: 58px; font-size: 9px; }
}

.swg-device:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
  padding: clamp(10px, 1vw, 18px);
}
.swg-device:fullscreen .swg-deck { min-height: clamp(64px, 13vh, 140px); }

/* ------------------------------------------------------------- embed mode */

/* В модалке на index.php: верхняя панель остаётся ради звука, но без
   логотипа-ссылки и полноэкранной кнопки; футер убираем. */
.swg-embed.swg-page { overflow: hidden; height: 100svh; }
.swg-embed .swg-logo { visibility: hidden; }
.swg-embed .swg-topbar__center { display: none !important; }
.swg-embed #swgFull { display: none !important; }
.swg-embed .swg-foot { display: none !important; }
.swg-embed .swg-topbar { pointer-events: none; }
.swg-embed .swg-tools { pointer-events: auto; }
.swg-embed .swg-main { padding: 9vh 6vw 3vh; }

@media (max-width: 780px) {
  .swg-embed .swg-main { padding: 6px 3vw 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .swg-led i::after { animation: none; opacity: .7; }
  .swg-btn, .swg-tool, .swg-key, .swg-toss, .swg-small { transition: none; }
  .swg-key.is-pulse::after, .swg-toss.is-pulse::after, .swg-small.is-pulse::after,
  .swg-key.is-down::after { animation: none; opacity: .35; transform: none; }
}
