:root {
  --hhmb-ink: #172033;
  --hhmb-muted: #667085;
  --hhmb-line: rgba(23, 32, 51, .12);
  --hhmb-purple: #7657e6;
  --hhmb-shadow: 0 22px 70px rgba(23, 32, 51, .28);
}

html.hhmb-modal-open,
body.hhmb-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.hhmb-tile {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 156px;
  margin: 0;
  padding: 18px;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255,255,255,.78) 0 7%, transparent 7.5%),
    radial-gradient(circle at 82% 30%, rgba(255,255,255,.5) 0 4%, transparent 4.5%),
    linear-gradient(145deg, #fff5b7 0%, #ffd982 38%, #ffb17d 100%);
  color: #4a2b09;
  text-align: left;
  box-shadow: 0 14px 34px rgba(180, 91, 25, .2);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.hhmb-tile::before {
  content: '';
  position: absolute;
  inset: auto -54px -82px auto;
  z-index: -1;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255,255,255,.34);
}

.hhmb-tile:active {
  transform: scale(.985);
}

.hhmb-tile:focus-visible {
  outline: 4px solid rgba(118, 87, 230, .35);
  outline-offset: 3px;
}

.hhmb-tile-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 25px;
  background: rgba(255,255,255,.76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 20px rgba(121, 67, 20, .12);
}

.hhmb-sun {
  position: absolute;
  top: 7px;
  left: 8px;
  font-size: 30px;
  filter: drop-shadow(0 4px 5px rgba(245, 158, 11, .22));
}

.hhmb-bounce {
  position: absolute;
  right: 8px;
  bottom: 5px;
  font-size: 39px;
  transform: rotate(-7deg);
}

.hhmb-sparkle {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #7657e6;
  font-size: 21px;
}

.hhmb-tile-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.hhmb-tile-eyebrow {
  color: rgba(74, 43, 9, .68);
  font-size: 10px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hhmb-tile-copy strong {
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1;
  font-weight: 950;
}

.hhmb-tile-copy > span:last-child {
  max-width: 410px;
  color: rgba(74, 43, 9, .8);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}

.hhmb-tile-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  font-size: 23px;
  font-weight: 900;
}

.hhmb-overlay {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 2147483590;
  display: none;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(12, 18, 32, .6);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: contain;
}

.hhmb-overlay.hhmb-open {
  display: grid !important;
}

.hhmb-shell {
  box-sizing: border-box;
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(980px, 96vw);
  height: min(760px, 94vh);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 29px;
  background: linear-gradient(180deg, #fffdf7, #fff 34%);
  color: var(--hhmb-ink);
  box-shadow: var(--hhmb-shadow);
}

.hhmb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--hhmb-line);
  background: linear-gradient(135deg, #fff7bd, #ffd4b6 62%, #e7ddff);
}

.hhmb-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hhmb-title-sun {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255,255,255,.75);
  font-size: 29px;
  box-shadow: 0 6px 14px rgba(147, 87, 18, .13);
}

.hhmb-header h2 {
  margin: 0;
  color: var(--hhmb-ink);
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1;
  font-weight: 950;
}

.hhmb-header p {
  margin: 5px 0 0;
  color: rgba(23, 32, 51, .65);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 700;
}

.hhmb-close {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(23, 32, 51, .12);
  border-radius: 50%;
  background: rgba(255,255,255,.84);
  color: var(--hhmb-ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.hhmb-categories {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  padding: 10px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--hhmb-line);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.hhmb-category {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 112px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--hhmb-line);
  border-radius: 14px;
  background: #f8f9fc;
  color: var(--hhmb-ink);
  font-size: 11px;
  cursor: pointer;
  touch-action: manipulation;
}

.hhmb-category span {
  font-size: 19px;
}

.hhmb-category strong {
  font-weight: 850;
}

.hhmb-category.hhmb-active {
  border-color: color-mix(in srgb, var(--hhmb-accent) 40%, white);
  background: color-mix(in srgb, var(--hhmb-accent) 12%, white);
  box-shadow: inset 0 -3px 0 var(--hhmb-accent);
}

.hhmb-content {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(230px, .72fr);
  gap: 13px;
  padding: 14px;
  overflow: hidden;
  background: #f6f7fb;
}

.hhmb-activity,
.hhmb-timer-card {
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--hhmb-line);
  border-radius: 20px;
  background: #fff;
}

.hhmb-activity {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 19px;
}

.hhmb-activity-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hhmb-accent) 13%, white);
  color: color-mix(in srgb, var(--hhmb-accent) 78%, #172033);
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.hhmb-activity h3 {
  margin: 0;
  color: var(--hhmb-ink);
  font-size: clamp(24px, 3.1vw, 38px);
  line-height: 1.06;
  font-weight: 950;
}

.hhmb-intro {
  margin: 9px 0 0;
  color: var(--hhmb-muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 650;
}

.hhmb-steps {
  display: grid;
  gap: 8px;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: hhmb-step;
}

.hhmb-steps li {
  counter-increment: hhmb-step;
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 11px 9px 49px;
  border: 1px solid rgba(23, 32, 51, .09);
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #f9fafc);
  color: var(--hhmb-ink);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 750;
}

.hhmb-steps li::before {
  content: counter(hhmb-step);
  position: absolute;
  left: 10px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  border-radius: 10px;
  background: #fff2be;
  color: #8a5200;
  font-size: 12px;
  font-weight: 950;
}

.hhmb-mix-details {
  margin-top: 14px;
  border: 1px solid var(--hhmb-line);
  border-radius: 14px;
  background: #fbfbfe;
  overflow: hidden;
}

.hhmb-mix-details summary {
  padding: 10px 12px;
  color: var(--hhmb-ink);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.hhmb-mix-details div {
  display: grid;
  gap: 2px;
  padding: 9px 12px;
  border-top: 1px solid var(--hhmb-line);
}

.hhmb-mix-details strong {
  font-size: 11px;
}

.hhmb-mix-details span {
  color: var(--hhmb-muted);
  font-size: 10px;
  line-height: 1.35;
}

.hhmb-joke-answer {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 17px;
  background: linear-gradient(135deg, #e7f7ff, #efe8ff);
  text-align: center;
}

.hhmb-joke-answer[hidden] {
  display: none !important;
}

.hhmb-joke-answer span {
  color: var(--hhmb-muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hhmb-joke-answer strong {
  font-size: clamp(18px, 2.6vw, 27px);
  line-height: 1.2;
}

.hhmb-answer-button {
  display: block;
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 0;
  border-radius: 14px;
  background: #e9e3ff;
  color: #4e37a4;
  font-weight: 900;
  cursor: pointer;
}

.hhmb-timer-card {
  display: grid;
  align-content: center;
  gap: 13px;
  padding: 17px;
  overflow-y: auto;
}

.hhmb-timer-copy {
  display: grid;
  gap: 4px;
  text-align: center;
}

.hhmb-timer-copy span {
  color: var(--hhmb-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hhmb-timer-copy strong {
  color: var(--hhmb-ink);
  font-size: clamp(39px, 6vw, 65px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.hhmb-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceef4;
}

.hhmb-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c5ce5, #ef6a84, #f59e0b);
  transition: width .2s linear;
}

.hhmb-timer-presets,
.hhmb-timer-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.hhmb-timer-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hhmb-timer-card button,
.hhmb-footer button {
  -webkit-appearance: none;
  appearance: none;
  min-height: 43px;
  padding: 8px 10px;
  border: 1px solid var(--hhmb-line);
  border-radius: 13px;
  background: #f8f9fc;
  color: var(--hhmb-ink);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
}

.hhmb-timer-card button.hhmb-active {
  border-color: rgba(118, 87, 230, .35);
  background: #eee9ff;
  color: #4f38a8;
}

.hhmb-primary {
  border-color: transparent !important;
  background: linear-gradient(135deg, #7657e6, #a263e8) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(118, 87, 230, .2);
}

.hhmb-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 11px 14px max(11px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--hhmb-line);
  background: #fff;
}

.hhmb-footer button {
  min-width: 130px;
}

.hhmb-shell.hhmb-finished {
  animation: hhmb-finish .7s ease both;
}

.hhmb-shell.hhmb-finished::after {
  content: '✨ Klaar! Goed gedaan! ✨';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  padding: 18px 24px;
  border-radius: 20px;
  background: rgba(255,255,255,.97);
  color: #6a43c9;
  box-shadow: 0 18px 50px rgba(23,32,51,.3);
  font-size: clamp(21px, 4vw, 35px);
  font-weight: 950;
  white-space: nowrap;
  animation: hhmb-pop 1.25s ease both;
}

@keyframes hhmb-finish {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.012); }
}

@keyframes hhmb-pop {
  0% { opacity: 0; transform: translate(-50%, -45%) scale(.75); }
  18%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -55%) scale(.92); }
}

@media (max-width: 760px) {
  .hhmb-shell {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .hhmb-overlay {
    padding: 0;
  }

  .hhmb-content {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .hhmb-activity {
    min-height: 330px;
  }

  .hhmb-timer-card {
    min-height: 250px;
  }
}

@media (max-width: 520px) {
  .hhmb-tile {
    grid-template-columns: 66px minmax(0, 1fr) 30px;
    min-height: 136px;
    padding: 14px;
  }

  .hhmb-tile-art {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }

  .hhmb-sun { font-size: 23px; }
  .hhmb-bounce { font-size: 31px; }
  .hhmb-tile-copy strong { font-size: 22px; }

  .hhmb-header {
    padding: 12px;
  }

  .hhmb-title-sun {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .hhmb-header p {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hhmb-tile,
  .hhmb-shell,
  .hhmb-shell::after,
  .hhmb-progress span {
    animation: none !important;
    transition: none !important;
  }
}
