:root {
  /* Intentionally hideous palette. */
  --bg: #00ff00;
  --text: #ff00ff;
  --panel: #ffff00;
  --border: #00ffff;
  --danger: #ff0000;
  --weird: #0000ff;
}

/* Intentionally inconsistent spacing and sizing. */
* { box-sizing: content-box; }

html, body {
  height: auto;
  margin: 7px;
  font-family: "Comic Sans MS", "Papyrus", "Impact", cursive;
  background: repeating-linear-gradient(
    45deg,
    #00ff00,
    #00ff00 12px,
    #ff00ff 12px,
    #ff00ff 24px
  );
  color: var(--text);
}

.page {
  min-height: auto;
  display: block;
  padding: 3px;
}

.calc {
  width: 420px;
  border: 6px dotted var(--border);
  background: var(--panel);
  border-radius: 0;
  padding: 5px;
  box-shadow: none;
  transform: rotate(-0.25deg);
}

.calc__header {
  display: block;
}

.calc__title {
  margin: 1px;
  font-size: 28px;
  letter-spacing: -1.2px;
  text-decoration: underline wavy var(--weird);
  color: var(--weird);
}

.calc__subtitle {
  margin: 0 0 9px 17px;
  color: #000;
  font-size: 11px;
}

.calc__screen {
  margin-top: 3px;
  padding: 2px 11px 19px 4px;
  border: 4px inset #000;
  background: #fff;
  border-radius: 0;
}

.calc__output {
  font-size: 44px;
  font-weight: 400;
  letter-spacing: 6px;
  color: var(--danger);
  text-shadow: 2px 2px 0 #000;
}

.calc__hint {
  margin-top: 0;
  color: #0000ff;
  font-size: 12px;
}

.calc__controls {
  display: block;
  margin-top: 9px;
}

.calc__input {
  width: 98%;
  border-radius: 0;
  padding: 3px;
  background: #000;
  color: #00ff00;
  border: 5px double #ff00ff;
  outline: 6px dashed #ffff00;
  font-size: 19px;
}

.calc__input:focus {
  border-color: #ff0000;
  box-shadow: none;
}

.calc__btn {
  border-radius: 0;
  padding: 2px 25px;
  background: #ff00ff;
  color: #00ff00;
  border: 4px groove #0000ff;
  font-weight: 900;
  letter-spacing: 3px;
  cursor: crosshair;
  margin-top: 8px;
}

.calc__btn:active { transform: translateX(2px) translateY(2px) skewX(6deg); }

.calc__btn--ghost {
  background: #00ffff;
  color: #000;
  border: 3px ridge #ff0000;
}

.calc__details {
  margin-top: 10px;
  color: #000;
  background: #00ffff;
  border: 3px dashed #000;
  padding: 4px;
}

.calc__row {
  display: block;
  margin: 6px 0;
}

.calc__toggle {
  display: inline-block;
  margin: 2px 12px 2px 0;
  font-size: 12px;
  background: #ff00ff;
  color: #00ff00;
  border: 2px dotted #000;
  padding: 2px 6px;
}

.calc__toggle input {
  accent-color: #ff0000;
}

.calc__anger {
  border: 3px groove #000;
  background: #ffff00;
  padding: 6px;
}

.calc__angerLabel {
  font-weight: 900;
  letter-spacing: 2px;
  color: #0000ff;
}

.calc__angerBar {
  height: 18px;
  border: 4px inset #000;
  background: #fff;
  margin: 4px 0;
}

.calc__angerFill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(90deg, #ff0000, #ff0000 6px, #00ff00 6px, #00ff00 12px);
}

.calc__angerText {
  font-size: 12px;
  color: #000;
}

.calc__box {
  display: inline-block;
  vertical-align: top;
  width: 46%;
  min-height: 70px;
  background: #fff;
  border: 4px double #ff00ff;
  padding: 4px;
  margin-right: 6px;
}

.calc__boxTitle {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ff0000;
  text-decoration: underline wavy #0000ff;
  margin-bottom: 4px;
}

.calc__list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #000;
}

.hidden { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  display: block;
  z-index: 50;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 0, 0, 0.35);
  z-index: -1;
}

.modal__box {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 666px;
  border-radius: 0;
  padding: 6px;
  border: 6px outset #000;
  background: #ffff00;
  box-shadow: none;
  z-index: 1;
}

.modal__actions {
  display: block;
  margin-top: 6px;
}

@keyframes memeShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-3px, 2px) rotate(-1deg); }
  20% { transform: translate(4px, -1px) rotate(1deg); }
  30% { transform: translate(-5px, -2px) rotate(-2deg); }
  40% { transform: translate(5px, 3px) rotate(2deg); }
  50% { transform: translate(-2px, 4px) rotate(-1deg); }
  60% { transform: translate(3px, -4px) rotate(1deg); }
  70% { transform: translate(-4px, 1px) rotate(-2deg); }
  80% { transform: translate(4px, -2px) rotate(2deg); }
  90% { transform: translate(-2px, 3px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.shake67 {
  animation: memeShake 520ms linear infinite;
  outline: 8px dotted #ff0000;
}

.rageMode {
  animation: memeShake 180ms linear infinite;
  outline: 10px dashed #0000ff;
  filter: hue-rotate(160deg) saturate(6) contrast(1.2);
}
