* {
  box-sizing: border-box;
}

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

body {
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  transition: background 400ms ease, color 400ms ease;
}

.game {
  width: min(360px, calc(100vw - 32px));
  margin: 64px auto 0;
  text-align: center;
}

h1 {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}

.stats {
  min-height: 15px;
  margin: 0 0 14px;
  color: #333;
  font-variant-numeric: tabular-nums;
}

button {
  background: #fff;
  color: #111;
  border: 1px solid #111;
  border-radius: 0;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  color: #999;
  border-color: #bbb;
  cursor: default;
}

.main-button {
  width: 116px;
  height: 40px;
  display: block;
  margin: 0 auto 12px;
  transition: border-color 250ms ease, box-shadow 250ms ease, transform 250ms ease, border-radius 250ms ease;
}

.main-button.gone {
  visibility: hidden;
  pointer-events: none;
}

.main-button:active {
  transform: translateY(1px);
}

.loser-text {
  margin: -2px 0 12px;
  font-size: clamp(48px, 18vw, 92px);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: 0;
}

.upgrade-toggle {
  width: 88px;
  height: 26px;
  margin: 0 2px;
}

.upgrade-toggle.active {
  background: #111;
  color: #fff;
}

.upgrade-panel {
  margin-top: 18px;
  text-align: left;
  max-height: min(420px, 52vh);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}

.upgrade-list {
  display: grid;
  gap: 7px;
}

.upgrade-item {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  line-height: 1.35;
}

.upgrade-item:hover {
  text-decoration: underline;
}

.upgrade-item small {
  color: #666;
}

.big-upgrade {
  padding: 14px 0;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.05;
  text-transform: lowercase;
}

.big-upgrade small {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}

.empty {
  color: #777;
  text-align: center;
}

.message {
  min-height: 15px;
  margin: 16px 0 0;
  color: #555;
}

body[data-layer="1"] .main-button {
  border-color: #333;
  box-shadow: 0 0 0 1px #f3f3f3;
}

body[data-layer="2"] {
  background: #fefefe;
}

body[data-layer="2"] .main-button {
  box-shadow: 0 0 0 2px #f6f6f6;
}

body[data-layer="3"] .main-button {
  border-style: dashed;
}

body[data-layer="4"] .main-button {
  box-shadow: 0 0 0 1px #eee, 0 0 16px #f7f7f7;
}

body[data-layer="5"] h1 {
  font-style: italic;
}

body[data-layer="6"] .main-button {
  letter-spacing: 0.03em;
}

body[data-layer="7"] .main-button {
  border-radius: 2px 0 3px 1px;
  transform: skewX(-0.4deg);
}

body[data-layer="8"] .upgrade-item:nth-child(7n) {
  color: #333;
}

body[data-layer="9"] .main-button {
  width: 120px;
}

body[data-layer="10"] .game {
  transform: translateY(1px);
}
