.hwr, .hwr * { box-sizing: border-box; }
.hwr {
  --hwr-ink: #2b2212;
  --hwr-paper: #fffaf0;
  --hwr-line: #e7d6aa;
  --hwr-yellow: #ffd329;
  --hwr-muted: #655329;
  color: var(--hwr-ink);
  background: var(--hwr-paper);
  max-width: 980px;
  margin: 1.25rem auto;
  border: 1px solid var(--hwr-line);
  border-radius: 24px;
  overflow: hidden;
  font: 16px/1.45 system-ui, sans-serif;
  text-align: left;
}
.hwr [hidden] { display: none !important; }
.hwr :is(h2,h3,h4,p,ol) { margin: 0; color: inherit; }
.hwr :is(h2,h3,h4) { line-height: 1.08; letter-spacing: -.035em; font-weight: 800; }
.hwr button, .hwr summary { font: inherit; }
.hwr button:not(:disabled), .hwr summary { cursor: pointer; }
.hwr :is(button,a,summary,[tabindex]):focus-visible { outline: 3px solid #7b4d00; outline-offset: 3px; }
.hwr :is(.hwr-button,.hwr-quiet,.hwr-download) {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid #b98500;
  border-radius: 999px;
  color: #2b2212;
  font: 700 14px/1.25 system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
}
.hwr .hwr-button { background: var(--hwr-yellow); }
.hwr :is(.hwr-quiet,.hwr-download) { background: #fffdf4; border-color: #ae9660; }
.hwr :is(.hwr-button,.hwr-quiet,.hwr-download):hover { background: #ffdf58; }

.hwr-cover {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(260px, 35vw, 370px);
  isolation: isolate;
  background: #ffe89a;
}
.hwr-cover-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: 73% center;
  z-index: -2;
}
.hwr-cover::before {
  content: "";
  background: linear-gradient(90deg, #fff0b5 0 14%, #fff0b5ef 36%, #fff0b500 67%);
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hwr-cover-copy { width: min(55%, 480px); padding: clamp(21px, 4vw, 42px); }
.hwr .hwr-cover h2 { font-size: clamp(35px, 6vw, 65px); }
.hwr-cover-copy p { margin: 12px 0 18px; color: #3f3319; font-size: clamp(15px, 2vw, 18px); }

.hwr-play, .hwr-result { padding: clamp(14px, 3vw, 30px); }
.hwr-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.hwr .hwr-round { font-weight: 700; font-size: 13px; margin-bottom: 5px; color: var(--hwr-muted); }
.hwr-bar h3, .hwr-result h3 { font-size: clamp(24px, 4vw, 37px); }
.hwr-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 9px;
}
.hwr-hud > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #e3bd57;
  border-radius: 999px;
  background: #fff1bd;
  padding: 4px 10px;
  font-size: 13px;
  white-space: nowrap;
}
.hwr-hud > span:first-child { background: #ffdc61; }
.hwr-hud strong { font-variant-numeric: tabular-nums; }
.hwr-hud progress {
  align-self: center;
  flex: 1;
  min-width: 56px;
  height: 9px;
  accent-color: #b47611;
}
.hwr-field {
  position: relative;
  overflow: hidden;
  border: 2px solid #d9b75f;
  border-radius: 16px;
  background: #e0edf1;
}
.hwr-field canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 500;
}
.hwr-field canvas:focus-visible { outline-offset: -5px; }
.hwr-pause-panel {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  background: #2f220fc9;
  color: #fff8e6;
}
.hwr-pause-panel strong { font-size: clamp(23px, 5vw, 44px); }
.hwr-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 8px;
}
.hwr-controls > div { display: flex; gap: 8px; }
.hwr .hwr-controls button {
  min-width: 56px;
  min-height: 52px;
  padding: 6px 12px;
  border: 1px solid #a85c13;
  border-radius: 12px;
  background: #ffbc46;
  color: #352414;
  box-shadow: 0 3px 0 #b87622;
  font: 800 20px/1 system-ui,sans-serif;
  user-select: none;
  touch-action: none;
}
.hwr .hwr-controls button:active { transform: translateY(2px); box-shadow: 0 1px 0 #b87622; }
.hwr .hwr-controls .hwr-jump { min-width: 113px; font-size: 15px; }
.hwr .hwr-status, .hwr .hwr-instructions { margin-top: 10px; font-size: 13px; }
.hwr .hwr-status { min-height: 2.8em; color: #4e3912; font-weight: 700; }
.hwr .hwr-instructions { color: var(--hwr-muted); }
.hwr-play-actions, .hwr-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hwr .hwr-result { background: radial-gradient(ellipse at 20% 60%,#ffdf71,transparent 75%), #fff5d9; }
.hwr .hwr-result p { margin-top: 7px; }
.hwr-win { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: clamp(14px, 3vw, 30px); align-items: center; }
.hwr-prize { display: grid; gap: 8px; padding: 8px; text-align: center; border: 1px solid var(--hwr-line); border-radius: 18px; background: #fffdf6; }
.hwr :is(.hwr-prize,.hwr-card) img { display: block; aspect-ratio: 1; height: auto; width: 100%; object-fit: cover; border-radius: 12px; }
.hwr .hwr-stars { color: #825508; font-size: 25px; font-weight: 800; letter-spacing: .12em; margin: 0 0 4px; }
.hwr-collection { border-top: 1px solid var(--hwr-line); background: #fffbec; }
.hwr-collection > summary { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 14px 20px; font-weight: 750; }
.hwr-collection > summary::after { content: '＋'; }
.hwr-collection[open] > summary::after { content: '−'; }
.hwr-collection > summary [data-card-count] { margin-left: auto; color: var(--hwr-muted); font-size: 13px; }
.hwr-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 6px 14px 14px; }
.hwr-card { display: grid; align-content: start; gap: 6px; padding: 8px; border: 1px solid var(--hwr-line); border-radius: 15px; background: #fffdf7; text-align: center; overflow-wrap: anywhere; }
.hwr-card-locked { color: var(--hwr-muted); background: #fff4d6; padding: 12px 6px; }
.hwr-card-locked > span { font-size: 22px; }
.hwr-card button { justify-self: center; }
.hwr-card small { font-size: 12px; }

@media (max-width: 680px) {
  .hwr-cover { min-height: 280px; align-items: flex-end; }
  .hwr-cover-copy { width: 100%; padding: 15px; }
  .hwr-cover-art { object-position: 82% center; }
  .hwr-cover::before { background: linear-gradient(0deg,#fff0b5 0 40%,#fff0b5d9 57%,#fff0b500 100%); }
  .hwr .hwr-cover h2 { font-size: clamp(29px,8vw,45px); }
  .hwr-cover-copy p { max-width: 32ch; margin: 5px 0 12px; }
  .hwr-field canvas { aspect-ratio: 650 / 500; }
}
@media (max-width: 420px) {
  .hwr-play, .hwr-result { padding: 10px; }
  .hwr-win { grid-template-columns: 1fr; }
  .hwr-win-copy { grid-row: 1; }
  .hwr-prize { max-width: 300px; }
  .hwr-cards { grid-template-columns: 1fr; }
  .hwr-card img { max-width: 280px; justify-self: center; }
}
.hreda-game .hwr-collection > summary { display: flex; }
