/* The overlay has no page background, so OBS shows the stream underneath. */
:root {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #302f2a;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: transparent;
  min-height: 100%;
}
[hidden] {
  display: none !important;
}
.panel {
  --paper: #f3eddd;
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: min(520px, calc(100vw - 32px));
  padding: 22px;
  background: var(--paper);
  border: 1px solid #b9ae96;
  border-radius: 5px;
  box-shadow: 0 12px 40px #0003;
  overflow: hidden;
}
.panel:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    #b6aa8f 4px
  );
}
header,
.instrument,
.scale {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: relative;
}
header {
  font-size: 11px;
  border-bottom: 1px solid #b9ae9670;
  padding-bottom: 14px;
}
header strong {
  font-size: 19px;
  letter-spacing: -1px;
}
header strong span {
  color: #ce3d36;
}
#channel {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#status {
  font-size: 10px;
  text-transform: uppercase;
}
#status:before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #bd8742;
  border-radius: 50%;
  margin-right: 5px;
}
#status[data-state="connected"]:before {
  background: #519374;
}
.instrument {
  padding: 14px 0 10px;
}
small {
  font-size: 10px;
  letter-spacing: 0.7px;
}
.magnitude {
  font-size: 23px;
  color: #cf4039;
}
.magnitude span {
  font-size: 48px;
  letter-spacing: -3px;
}
.readings {
  display: flex;
  flex-direction: column;
  text-align: right;
  gap: 7px;
  font-size: 12px;
}
canvas {
  display: block;
  width: 100%;
  height: 140px;
  border-block: 1px solid #b9ae9670;
}
.scale {
  font-size: 9px;
  color: #827966;
  padding: 7px 0;
}
#quake {
  border-top: 2px solid #ce3d36;
  margin-top: 8px;
  padding-top: 12px;
}
.alert-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
#banner {
  font-size: clamp(19px, 4vw, 26px);
  letter-spacing: -1px;
  margin: 0;
  padding: 5px 7px;
  border: 3px double #c93833;
  color: #c93833;
  transform: rotate(-3deg);
}
#alert-magnitude {
  font-size: 47px;
  line-height: 1;
  color: #c93833;
  letter-spacing: -3px;
  font-variant-numeric: tabular-nums;
}
.epicenter {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: bold;
  overflow-wrap: anywhere;
}
.epicenter img {
  height: 30px;
}
.epicenter small {
  font-weight: normal;
  color: #9e423a;
}
#counts {
  font-size: 12px;
  margin: 8px 0;
}
.tag {
  font-size: 10px;
  color: #bd433a;
}
#felt {
  border-top: 1px solid #b9ae9670;
  margin-top: 12px;
  padding-top: 10px;
}
.felt-report {
  display: flex;
  gap: 12px;
  align-items: center;
}
#intensity {
  font-size: 36px;
  min-width: 55px;
  color: #b73b33;
  line-height: 1.1;
}
#felt-label {
  display: block;
  font-size: 13px;
  font-weight: bold;
}
#felt-text {
  display: block;
  margin-top: 4px;
}
#felt-cta {
  margin-left: auto;
  font-size: 11px;
  max-width: 115px;
  line-height: 1.5;
}
.meter {
  height: 6px;
  background: #c9bfa9;
  margin: 10px 0 2px;
}
.meter i {
  display: block;
  height: 100%;
  background: #ce3d36;
  width: 0;
  transition: width 0.3s;
}
#recent {
  margin-top: 14px;
  border-top: 1px solid #b9ae9670;
}
#recent h2 {
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 12px 0 6px;
}
#recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
#recent-list li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto 28px;
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid #b9ae9640;
  padding: 8px 0;
  font-size: 12px;
}
#recent-list .epicenter {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
}
#recent-list .epicenter img {
  height: 20px;
  vertical-align: middle;
  margin-right: 4px;
}
#recent-list small {
  font-size: 9px;
  letter-spacing: 0;
}
.magnitude-badge {
  border-radius: 2px;
  padding: 5px;
  text-align: center;
  color: #fff7e8;
}
.magnitude-badge.minor {
  background: #687662;
}
.magnitude-badge.moderate {
  background: #b46d2e;
}
.magnitude-badge.major {
  background: #bd3b32;
}
.recent-intensity {
  text-align: right;
  font-weight: bold;
  color: #a74236;
}
footer {
  border-top: 1px solid #b9ae9670;
  margin-top: 12px;
  padding-top: 10px;
  font-size: 10px;
  line-height: 1.7;
}
footer span {
  display: block;
}
#live-status {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
#forecast {
  margin-top: 5px;
}
#gap {
  color: #c93833;
}
.night {
  --paper: #192326;
  color: #e5e2d5;
  border-color: #486064;
}
.night small,
.night .scale {
  color: #a6b5b4;
}
.size-s {
  width: min(400px, calc(100vw - 32px));
  padding: 18px;
}
.size-s canvas {
  height: 120px;
}
.size-s #banner {
  font-size: 20px;
}
.size-s #alert-magnitude {
  font-size: 39px;
}
.size-l {
  width: min(680px, calc(100vw - 32px));
  padding: 26px;
}
.size-l canvas {
  height: 180px;
}
.size-l #banner {
  font-size: 34px;
}
.size-l #alert-magnitude {
  font-size: 60px;
}
.pos-bl {
  left: 28px;
  right: auto;
}
.pos-tl {
  left: 28px;
  right: auto;
  top: 28px;
  bottom: auto;
}
.pos-tr {
  top: 28px;
  bottom: auto;
}
.shaking {
  animation: quake 0.16s infinite;
}
.arriving {
  animation: stamp-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.ticked {
  animation: tick-up 0.25s ease-out;
}
@keyframes quake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(var(--shake), -1px);
  }
  75% {
    transform: translate(calc(var(--shake) * -1), 2px);
  }
}
@keyframes stamp-in {
  from {
    opacity: 0;
    transform: translateY(-18px) scale(1.08);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes tick-up {
  from {
    transform: translateY(4px) scale(1.15);
  }
  to {
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .shaking,
  .arriving,
  .ticked {
    animation: none;
  }
  .meter i {
    transition: none;
  }
}
@media (max-width: 480px) {
  .panel {
    right: 16px;
    bottom: 16px;
  }
  .pos-bl,
  .pos-tl {
    left: 16px;
  }
  .pos-tl,
  .pos-tr {
    top: 16px;
  }
}
/* Embedded preview keeps the complete panel inside a narrow stream frame. */
.preview .panel {
  position: relative;
  inset: auto;
  margin: 12px auto;
  width: calc(100% - 24px);
  max-width: 400px;
}
.preview {
  overflow: hidden;
  background: transparent;
}
.preview .instrument {
  padding: 8px 0;
}
.preview canvas {
  height: 100px;
}
.preview #recent-list li {
  padding: 6px 0;
}

@media (max-width: 360px) {
  .felt-report {
    flex-wrap: wrap;
  }
  #felt-cta {
    max-width: none;
  }
  header {
    gap: 6px;
  }
  #channel {
    max-width: 65px;
  }
}
