.med4 {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-block-size: max(35rem, calc(100vh - 9rem));
  min-block-size: max(35rem, calc(100svh - 9rem));
  padding: clamp(21px, 4vh, 38px) 15px;
  border: 1px solid #b29a664e;
  border-radius: clamp(13px, 2vw, 24px);
  background:
    radial-gradient(ellipse 46% 43% at 50% 41%, #30463d80, transparent 98%),
    radial-gradient(ellipse 72% 90% at 50% 36%, #202a25, #171a17 59%, #111211);
  color: #f1e7d6;
  text-align: center;
}

.med4-landscape {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.med4-landscape::before,
.med4-landscape::after {
  position: absolute;
  inset: auto 0 0;
  height: 54%;
  content: "";
}

.med4-landscape::before {
  background: linear-gradient(180deg, #57675b31, #20292454 50%, transparent 93%);
  clip-path: polygon(0 48%, 7% 33%, 13% 46%, 20% 21%, 26% 49%, 36% 52%, 43% 71%, 54% 65%, 64% 72%, 73% 37%, 80% 30%, 86% 55%, 92% 36%, 100% 51%, 100% 100%, 0 100%);
}

.med4-landscape::after {
  height: 46%;
  background: linear-gradient(180deg, #131813b3, #0f1210 90%);
  clip-path: polygon(0 40%, 9% 22%, 17% 42%, 23% 28%, 30% 51%, 37% 43%, 49% 69%, 60% 59%, 70% 43%, 82% 54%, 90% 32%, 100% 24%, 100% 100%, 0 100%);
}

.med4-inner {
  display: grid;
  justify-items: center;
  width: min(100%, 34rem);
  min-width: 0;
}

.med4-kicker {
  color: #d6bd94;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .30em;
}

.med4-header h1 {
  margin-block: 5px 4px;
  color: #f1e6d2;
  font-family: var(--display, serif);
  font-size: clamp(35px, 6vw, 61px);
  font-weight: 650;
  letter-spacing: .10em;
  line-height: 1.17;
}

.med4-intro, .med4-guide { color: #d6cbb8; font-size: 14px; }

.med4-scene {
  --med4-diameter: clamp(127px, 23vw, 204px);
  display: grid;
  place-items: center;
  isolation: isolate;
  width: min(100%, 33rem);
  min-height: clamp(195px, 29vw, 300px);
  margin-top: clamp(4px, 1vh, 12px);
}

.med4-field, .med4-readout { grid-area: 1 / 1; }

.med4-field {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--med4-diameter);
  height: var(--med4-diameter);
}

.med4-halo, .med4-wave, .med4-orb {
  grid-area: 1 / 1;
  border-radius: 50%;
  pointer-events: none;
}

.med4-halo {
  width: 165%;
  height: 165%;
  border: 1px solid #d9c69221;
  background: radial-gradient(circle, transparent 50%, #8ba99b0d 65%, transparent 75%);
  box-shadow: 0 0 40px #92ac9630 inset;
}

.med4-wave {
  width: 141%;
  height: 141%;
  border: 1px solid #d1c6a377;
  opacity: var(--med4-wave-opacity, .44);
  transform: scale(var(--med4-wave-scale, .86));
}

.med4-orb {
  width: 100%;
  height: 100%;
  border: 1px solid #ded3acb3;
  background:
    radial-gradient(ellipse at 38% 24%, #dce0b474, #7999841a 42%, transparent 68%),
    radial-gradient(circle at 57% 56%, #304c42, #2a443b 57%, #162b24 87%);
  box-shadow:
    0 0 44px #8bb39b5a,
    0 0 18px #d9cc9e35 inset,
    0 0 4px #efe3b868;
  transform: scale(var(--med4-orb-scale, .76));
}

.med4-readout {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.med4-phase {
  color: #fbf3e0;
  font-family: var(--display, serif);
  font-size: clamp(18px, 3.5vw, 29px);
  font-weight: 700;
  line-height: 1.45;
  text-shadow: 0 1px 5px #0e2018;
}

.med4-phase-detail {
  color: #e9e4cf;
  font-size: 11px;
  line-height: 1.5;
  text-shadow: 0 1px 5px #0e2018;
}

.med4-clock { display: grid; justify-items: center; gap: 4px; }

.med4-timer {
  color: #f0dfbc;
  font-size: clamp(37px, 7.5vw, 60px);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: .05em;
  line-height: 1;
}

.med4-options, .med4-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.med4-options { margin-top: clamp(12px, 2.1vh, 22px); }
.med4-actions { margin-top: 9px; }

.med4-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px clamp(10px, 2.3vw, 18px);
  border: 1px solid #a08d6d85;
  border-radius: 7px;
  background: #222923;
  color: #eee2cd;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.med4-button:hover { background: #303b30; }
.med4-button:focus-visible { outline: 2px solid #e2c995; outline-offset: 3px; }
.med4-button[aria-pressed="true"] { border-color: #dbc397; background: #354238; color: #faeccf; }
.med4-button svg { width: 16px; height: 16px; flex-shrink: 0; }

.med4-primary {
  min-width: 100px;
  border-color: #e2c597;
  background: #dbc196;
  color: #211a12;
}

.med4-primary:hover { background: #ecd4aa; }

@media (max-width: 410px) {
  .med4 { padding-inline: 10px; }
  .med4-scene { min-height: 190px; }
  .med4-guide { font-size: 13px; }
  .med4-options, .med4-actions { gap: 6px; }
  .med4-button { padding-inline: 9px; }
  .med4-primary { min-width: 86px; }
}

@media (prefers-reduced-motion: reduce) {
  .med4-orb { transform: scale(.91); }
  .med4-wave { transform: scale(.98); opacity: .28; }
}

