:root {
  --page-blue: #000080;
  --page-blue-2: #00004f;
  --link-blue: #0000ee;
  --visited: #551a8b;
  --hot-red: #ff0000;
  --acid: #00ff00;
  --yellow: #ffff00;
  --cyan: #00ffff;
  --magenta: #ff00ff;
  --silver: #c0c0c0;
  --white: #ffffff;
  --black: #000000;
  --table-bg: #ffffcc;
  --panel-bg: #eeeeee;
  --shadow: #404040;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow: auto;
  color: var(--black);
  font-family: "Times New Roman", Times, serif;
  background:
    radial-gradient(circle, rgba(255, 255, 255, .95) 0 1px, transparent 2px) 0 0 / 32px 32px,
    radial-gradient(circle, rgba(255, 255, 0, .9) 0 1px, transparent 2px) 16px 17px / 52px 52px,
    linear-gradient(135deg, var(--page-blue), var(--page-blue-2));
}

body::before {
  content: "ДОБРО ПОЖАЛОВАТЬ В СТАРЫЙ ИНТЕРНЕТ  •  БЕСПЛАТНАЯ ЗАГРУЗКА  •  ОСТАВЬТЕ ЗАПИСЬ В ГОСТЕВОЙ  •  ВОЗВРАТОВ НЕТ  •";
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  height: 24px;
  overflow: hidden;
  color: var(--yellow);
  background: var(--black);
  border-top: 3px ridge var(--silver);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 21px;
  text-align: center;
}

button {
  font: inherit;
}

.ticker {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  display: grid;
  grid-template-columns: 126px 1fr;
  align-items: center;
  height: 32px;
  overflow: hidden;
  color: var(--yellow);
  background: var(--black);
  border-bottom: 4px ridge var(--silver);
  font-family: Arial, Helvetica, sans-serif;
}

.ticker__label {
  align-self: stretch;
  display: grid;
  place-items: center;
  color: var(--black);
  background: var(--yellow);
  border-right: 4px ridge var(--silver);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

#tickerText {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  animation: ticker 15s linear infinite;
}

@keyframes ticker {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

.museum-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1040px);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(360px, 1fr) 292px;
  gap: 8px;
  margin: 0 auto;
  padding: 88px 8px 46px;
}

.panel,
.stage-panel {
  min-width: 0;
  color: var(--black);
  background: var(--panel-bg);
  border: 5px ridge var(--silver);
  box-shadow: 7px 7px 0 rgba(0, 0, 0, .45);
}

.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel__header {
  padding: 8px;
  color: var(--white);
  background: var(--page-blue);
  border-bottom: 5px ridge var(--silver);
  font-family: Arial, Helvetica, sans-serif;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h2,
h3 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.1;
}

.stamp,
.badge,
.exhibit-tag {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  padding: 2px 6px;
  color: var(--black);
  background: var(--yellow);
  border: 3px outset var(--silver);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge::before,
.exhibit-tag::before {
  content: "[НОВОЕ] ";
  color: var(--hot-red);
}

.box {
  padding: 8px;
  background: var(--table-bg);
  border-bottom: 4px ridge var(--silver);
}

.box:nth-child(odd) {
  background: #ffffff;
}

.box:last-child {
  border-bottom: 0;
}

.stat-box {
  background:
    repeating-linear-gradient(0deg, #ffffff 0 20px, #e8e8ff 20px 40px);
}

.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.value {
  min-width: 66px;
  color: var(--hot-red);
  background: var(--black);
  border: 2px inset var(--silver);
  font-family: "Courier New", Courier, monospace;
  font-weight: 900;
  text-align: right;
  padding: 1px 3px;
}

.bar {
  height: 18px;
  margin-top: 10px;
  overflow: hidden;
  background: var(--black);
  border: 3px inset var(--silver);
}

.fill {
  width: 0;
  height: 100%;
  background:
    repeating-linear-gradient(90deg, var(--acid) 0 8px, var(--yellow) 8px 16px, var(--hot-red) 16px 24px);
  transition: width .2s steps(5);
}

.note,
.fineprint,
.microcopy,
.sub,
.item p,
.modal p,
.toast .muted {
  line-height: 1.35;
}

.note {
  margin-top: 8px;
  color: #000066;
  font-size: 12px;
}

.fineprint {
  margin-top: 8px;
  color: #333333;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
}

.offer-slip {
  position: relative;
  background:
    linear-gradient(45deg, rgba(255, 0, 0, .18), transparent 45%),
    #ffff99;
}

.offer-slip::after {
  content: "ХАЛЯВА!";
  position: absolute;
  right: 8px;
  top: 10px;
  color: var(--hot-red);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 34px;
  font-weight: 900;
  transform: rotate(12deg);
  text-shadow: 2px 2px 0 var(--yellow);
}

.offer-slip h3 {
  max-width: 170px;
  margin-top: 8px;
  margin-bottom: 8px;
  color: var(--hot-red);
  font-size: 17px;
  text-decoration: underline;
}

.red-dot {
  display: inline-block;
  min-width: 24px;
  min-height: 14px;
  margin-left: 5px;
  vertical-align: middle;
  background: var(--hot-red);
  border: 2px outset var(--silver);
  color: var(--yellow);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
}

.red-dot::before {
  content: "НОВОЕ";
}

.log {
  max-height: 190px;
  overflow: auto;
  white-space: pre-wrap;
  padding: 6px;
  color: var(--acid);
  background: var(--black);
  border: 4px inset var(--silver);
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  line-height: 1.35;
}

.stage-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  gap: 8px;
  padding: 10px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .86), rgba(255, 255, 204, .88)),
    var(--panel-bg);
}

.stage-panel::before {
  content: "Этот сайт всегда на ремонте";
  position: absolute;
  right: -56px;
  top: 42px;
  z-index: 2;
  width: 260px;
  padding: 4px;
  color: var(--black);
  background: var(--yellow);
  border: 3px outset var(--silver);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  transform: rotate(28deg);
}

.headline {
  color: var(--hot-red);
  font-family: Impact, "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 56px;
  line-height: .9;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    3px 3px 0 var(--yellow),
    6px 6px 0 var(--link-blue);
}

.sub {
  max-width: 660px;
  color: #000066;
  font-size: 16px;
}

.sub::first-letter {
  color: var(--hot-red);
  font-size: 28px;
  font-weight: 900;
}

.artifact-stage {
  position: relative;
  min-height: 330px;
  display: grid;
  place-items: center;
  isolation: isolate;
  background: #000000;
  border: 5px inset var(--silver);
}

.retro-portal {
  position: absolute;
  inset: 8px;
  z-index: -1;
  overflow: hidden;
  color: var(--yellow);
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 255, 0, .2), transparent 32%),
    repeating-linear-gradient(0deg, rgba(0, 255, 255, .12) 0 2px, transparent 2px 8px),
    var(--page-blue);
  border: 4px ridge var(--silver);
  font-family: "Courier New", Courier, monospace;
}

.retro-portal::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, #ffffff 0 1px, transparent 2px) 12px 18px / 46px 48px,
    radial-gradient(circle, var(--yellow) 0 1px, transparent 2px) 22px 6px / 72px 64px;
}

.retro-portal__top,
.retro-portal__badge,
.retro-portal__counter,
.retro-portal__webring,
.retro-portal__stars {
  position: absolute;
  z-index: 1;
  border: 3px outset var(--silver);
  background: var(--black);
  font-weight: 900;
}

.retro-portal__top {
  top: 14px;
  left: 16px;
  right: 16px;
  padding: 6px;
  color: var(--cyan);
  text-align: center;
}

.retro-portal__badge {
  left: 20px;
  bottom: 62px;
  width: 118px;
  padding: 8px;
  color: var(--black);
  background: var(--yellow);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  text-align: center;
  transform: rotate(-8deg);
}

.retro-portal__counter {
  right: 22px;
  bottom: 72px;
  padding: 6px 10px;
  color: var(--acid);
  font-size: 22px;
  letter-spacing: 2px;
}

.retro-portal__webring {
  right: 28px;
  left: 28px;
  bottom: 18px;
  padding: 5px;
  color: var(--white);
  background: #660066;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  text-align: center;
}

.retro-portal__stars {
  top: 80px;
  left: 50%;
  padding: 4px 10px;
  color: var(--yellow);
  background: transparent;
  border: 0;
  font-size: 30px;
  transform: translateX(-50%);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { visibility: hidden; }
}

.clicker {
  position: relative;
  z-index: 2;
  width: 210px;
  height: 118px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--white);
  cursor: pointer;
  background:
    linear-gradient(180deg, #ff6666, var(--hot-red) 48%, #990000);
  border: 6px outset var(--silver);
  box-shadow: 0 0 0 4px var(--yellow), 0 0 32px rgba(255, 255, 0, .75);
  font-family: Impact, "Arial Black", Arial, Helvetica, sans-serif;
  text-transform: uppercase;
}

.clicker:active {
  border-style: inset;
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 3px var(--yellow), 0 0 18px rgba(255, 255, 0, .62);
}

.clicker__shine {
  display: none;
}

.clicker__word,
.clicker__small {
  display: block;
  text-align: center;
}

.clicker__word {
  margin-top: 10px;
  color: var(--white);
  font-size: 42px;
  line-height: .9;
  text-shadow: 2px 2px 0 var(--black);
}

.clicker__small {
  margin-top: -38px;
  color: var(--yellow);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 900;
  animation: blink .8s steps(1) infinite;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.microcopy {
  color: #000066;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
}

.button {
  min-height: 36px;
  padding: 7px 10px;
  color: var(--black);
  cursor: pointer;
  background: var(--silver);
  border: 4px outset var(--silver);
  border-radius: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.button:hover {
  color: var(--hot-red);
  background: var(--yellow);
}

.button:active {
  border-style: inset;
}

.button:focus-visible,
.tab:focus-visible,
.fake-x:focus-visible,
.notification-permission button:focus-visible {
  outline: 3px dotted var(--hot-red);
  outline-offset: 2px;
}

.button--red {
  color: var(--white);
  background: var(--hot-red);
}

.button--ink {
  color: var(--yellow);
  background: var(--page-blue);
}

.button--paper {
  color: var(--link-blue);
  background: #ffffff;
}

.button--shame {
  color: var(--visited);
}

.control-panel {
  display: flex;
  flex-direction: column;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 5px;
  background: var(--black);
  border-bottom: 5px ridge var(--silver);
}

.tab {
  min-width: 0;
  min-height: 34px;
  padding: 5px;
  color: var(--link-blue);
  cursor: pointer;
  background: var(--silver);
  border: 3px outset var(--silver);
  border-radius: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 900;
  text-decoration: underline;
}

.tab.is-active {
  color: var(--black);
  background: var(--yellow);
  text-decoration: none;
}

.shop {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 7px;
  overflow: auto;
  background: #ccccff;
}

.item {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 8px;
  background: #ffffff;
  border: 4px ridge var(--silver);
}

.item::before {
  content: ">";
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--hot-red);
  font-family: "Courier New", Courier, monospace;
  font-weight: 900;
}

.item h4 {
  margin: 0;
  padding-right: 20px;
  color: var(--link-blue);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.15;
  text-decoration: underline;
}

.item p {
  color: #333333;
  font-size: 12px;
}

.item .button {
  justify-self: start;
}

.toast-stack {
  position: fixed;
  right: 12px;
  bottom: 38px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  width: min(330px, calc(100vw - 24px));
  padding: 8px;
  color: var(--black);
  background: var(--yellow);
  border: 5px ridge var(--silver);
  box-shadow: 5px 5px 0 var(--shadow);
  font-family: Arial, Helvetica, sans-serif;
  animation: toast-in .15s ease both;
}

.toast b {
  display: block;
  margin-bottom: 3px;
  color: var(--hot-red);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 0, .25) 0 8px, rgba(255, 0, 255, .22) 8px 16px),
    rgba(0, 0, 0, .72);
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  color: var(--black);
  background: var(--silver);
  border: 6px ridge var(--silver);
  box-shadow: 9px 9px 0 rgba(0, 0, 0, .65);
}

.modal::before {
  content: "ВСПЛЫВАШКА";
  position: absolute;
  right: 52px;
  top: 8px;
  color: var(--hot-red);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 900;
  animation: blink 1s steps(1) infinite;
}

.modal-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 28px 14px 14px;
  background: var(--table-bg);
  border: 3px inset var(--silver);
}

.modal h2 {
  max-width: 430px;
  color: var(--hot-red);
  font-family: Impact, "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 34px;
  line-height: .95;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--yellow);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.fake-x {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 28px;
  height: 24px;
  color: var(--black);
  cursor: pointer;
  background: var(--silver);
  border: 3px outset var(--silver);
  border-radius: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.fake-x:hover {
  color: var(--hot-red);
}

.checkrow {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: #000066;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.25;
}

input[type="checkbox"] {
  accent-color: var(--hot-red);
  transform: scale(1.15);
}

.slot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 4px 0;
}

.reel {
  min-height: 68px;
  display: grid;
  place-items: center;
  color: var(--acid);
  background: var(--black);
  border: 4px inset var(--silver);
  font-family: "Courier New", Courier, monospace;
  font-size: 26px;
  font-weight: 900;
}

.floating-choice {
  position: fixed;
  top: 42px;
  left: 50%;
  z-index: 60;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--silver);
  border: 5px ridge var(--silver);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .45);
  transform: translateX(-50%);
}

.hidden {
  display: none !important;
}

.notification-permission {
  position: fixed;
  left: 12px;
  bottom: 38px;
  z-index: 70;
  display: none;
  width: min(350px, calc(100vw - 24px));
  padding: 10px;
  color: var(--black);
  background: var(--silver);
  border: 5px ridge var(--silver);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .55);
  font-family: Arial, Helvetica, sans-serif;
}

.notification-permission h4 {
  margin: 0 0 6px;
  color: var(--hot-red);
}

.notification-permission p {
  margin: 0 0 10px;
  color: #000066;
  font-size: 12px;
  line-height: 1.3;
}

.permission-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.notification-permission button {
  padding: 6px 10px;
  cursor: pointer;
  border: 3px outset var(--silver);
  font-weight: 800;
}

.deny {
  color: var(--black);
  background: var(--silver);
}

.allow {
  color: var(--yellow);
  background: var(--page-blue);
}

.shake {
  animation: shake .25s;
}

@keyframes shake {
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

@media (max-width: 1080px) {
  .museum-shell {
    grid-template-columns: 1fr;
    width: min(100%, 740px);
  }

  .stage-panel {
    min-height: 610px;
    order: 1;
  }

  .dossier-panel {
    order: 2;
  }

  .control-panel {
    min-height: 480px;
    order: 3;
  }
}

@media (max-width: 640px) {
  .ticker {
    grid-template-columns: 90px 1fr;
  }

  .museum-shell {
    gap: 8px;
    padding: 118px 6px 44px;
  }

  .floating-choice {
    right: 6px;
    left: 6px;
    width: auto;
    transform: none;
  }

  .floating-choice .button {
    flex: 1;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 11px;
  }

  .stage-panel {
    min-height: 560px;
    padding: 8px;
  }

  .stage-panel::before {
    display: none;
  }

  .headline {
    font-size: 40px;
  }

  .sub {
    font-size: 14px;
  }

  .artifact-stage {
    min-height: 280px;
  }

  .clicker {
    width: 180px;
    height: 108px;
  }

  .clicker__word {
    font-size: 34px;
  }

  .clicker__small {
    margin-top: -34px;
  }

  .action-row .button {
    width: 100%;
  }

  .tabs {
    gap: 2px;
  }

  .tab {
    font-size: 10px;
  }

  .modal h2 {
    font-size: 28px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-actions .button {
    width: 100%;
  }
}
