#word-and-trivia {
  --game-ink: #243f40;
  --game-teal: #285453;
  --game-line: #a9c0b8;
  --game-paper: #fffefa;
  --game-mist: #edf3ee;
  color: var(--game-ink);
  padding-block: 1rem clamp(2.5rem, 5vw, 4rem);
  scroll-margin-top: 2rem;
}

.hg-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
  margin-bottom: 1rem;
}

.hg-tab {
  min-width: 0;
  display: grid;
  gap: .3rem;
  align-content: center;
  padding: .85rem 1.1rem;
  color: var(--game-ink);
  background: #f7faf6;
  border: 1px solid var(--game-line);
  border-radius: .6rem;
  font: inherit;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.hg-tab strong { font-size: 1.1rem; }
.hg-tab span { font-size: .95rem; }
.hg-tab[aria-selected="true"] {
  background: var(--game-teal);
  border-color: var(--game-teal);
  color: #fffdf6;
}
.hg-tab[aria-selected="true"] strong {
  text-decoration: underline;
  text-underline-offset: .2em;
}

.hg-panel, .hg-stage, .hg-card { min-width: 0; }
#word-and-trivia [hidden] { display: none !important; }
.hg-stage {
  background: var(--game-paper);
  border: 1px solid var(--game-line);
  border-radius: .9rem;
  padding: clamp(1rem, 4vw, 2.5rem);
}
.hg-card { max-width: 48rem; margin-inline: auto; }
.hg-card h3, .hg-panel > h3 {
  font: 400 clamp(1.85rem, 4vw, 2.6rem)/1.14 var(--serif);
  color: var(--game-ink);
  margin: 0 0 .75rem;
}
.hg-card p {
  font-size: 1rem;
  line-height: 1.55;
  margin-block: .6rem 1rem;
  max-width: 66ch;
}
.hg-card h4 { margin: .25rem 0 .75rem; font-size: 1.08rem; }
.hg-card input[type="text"], .hg-card input:not([type]) {
  width: 100%;
  min-width: 0;
  min-height: 2.85rem;
  padding: .5rem .7rem;
  border: 1px solid #6b8a81;
  border-radius: .45rem;
  color: var(--game-ink);
  background: #fff;
  font: inherit;
}
.hg-card label { font-weight: 650; }
.hg-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  min-width: 0;
  padding: .55rem 1rem;
  border: 1px solid var(--game-teal);
  border-radius: .5rem;
  font: 600 1rem/1.4 var(--sans);
  color: #fffdf6;
  background: var(--game-teal);
  cursor: pointer;
}
.hg-secondary {
  color: #294f48;
  border-color: #7f9e92;
  background: #f6faf4;
}
.hg-card button:disabled, .hg-card button[aria-disabled="true"] {
  cursor: default;
}
#word-and-trivia :is(button, a, summary, input):focus-visible {
  outline: 3px solid #214c69;
  outline-offset: 3px;
}
@media (hover: hover) {
  .hg-tab:hover, .hg-card .hg-button:enabled:hover {
    box-shadow: inset 0 0 0 2px currentColor;
  }
}
.hg-choices, .hg-trivia-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-block: .75rem;
}
.hg-card .hg-status {
  color: #2e514c;
  padding-block: .4rem;
  font-weight: 550;
}
.hg-status:empty { margin: 0; padding: 0; }
.hg-word-entry {
  display: grid;
  grid-template-columns: minmax(7rem, 16rem) auto;
  justify-content: start;
  align-items: stretch;
  gap: .55rem;
  margin-top: .3rem;
}
.hg-word-entry input { text-transform: uppercase; letter-spacing: .12em; }
.hg-word-history {
  list-style: none;
  padding: 0;
  display: grid;
  gap: .6rem;
  margin-block: 1rem;
}
.hg-word-history:empty { display: none; }
.hg-word-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(.2rem, 1.4vw, .5rem);
  max-width: 23rem;
}
.hg-word-tile {
  display: grid;
  justify-items: center;
  align-content: center;
  padding: .35rem .05rem;
  line-height: 1.2;
  min-height: 3.7rem;
  background: #edece6;
  color: #42463f;
  border: 1px solid #aaa99e;
  border-radius: .4rem;
}
.hg-word-tile strong { font-size: 1.28rem; }
.hg-word-tile small { font-size: .875rem; }
.hg-word-tile[data-match="right"] {
  background: #d8e9d6;
  border-color: #759371;
  color: #21482e;
}
.hg-word-tile[data-match="move"] {
  background: #f6e6bd;
  border-color: #a78c4e;
  color: #584118;
}
.hg-card .hg-word-clue {
  border-inline-start: .2rem solid #8cae9d;
  padding: .55rem .8rem;
  background: var(--game-mist);
}
.hg-word-clue:empty { display: none; }
.hg-trivia-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin-block: 1rem;
}
.hg-trivia-group {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: .45rem;
  padding: .7rem;
  border: 1px solid #b7c8bb;
  border-radius: .6rem;
  background: var(--game-mist);
}
.hg-trivia-group .hg-button { width: 100%; }
.hg-trivia-group :is(h4, legend) { margin: 0; }
@media (max-width: 40rem) {
  .hg-picker { grid-template-columns: 1fr; gap: .4rem; }
  .hg-tab { padding: .65rem .85rem; row-gap: .1rem; }
  .hg-trivia-board { grid-template-columns: 1fr; }
}
@media (max-width: 23rem) {
  .hg-word-entry { grid-template-columns: 1fr; }
}

.hg-phrase-board {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem 1rem;
  margin-block: 1rem;
  padding: clamp(.55rem, 2vw, 1.2rem);
  border: 1px solid #c0cec3;
  border-radius: .6rem;
  background: var(--game-mist);
}
.hg-phrase-word { display: inline-flex; gap: clamp(.08rem, .3vw, .17rem); }
.hg-phrase-letter {
  display: grid;
  place-items: center;
  width: clamp(1.16rem, 3vw, 1.75rem);
  min-height: 2.1rem;
  border-radius: .2rem;
  color: #294e48;
  background: #fffefa;
  border-bottom: 2px solid #678879;
  font: 650 1.07rem/1 var(--sans);
}
.hg-phrase-keys {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2.8rem, 1fr));
  gap: .35rem;
  max-width: 34rem;
  margin-block: .75rem;
}
.hg-phrase-key {
  padding: .35rem .1rem;
  border-color: #849e93;
  background: #f9fbf6;
  color: #244a43;
}
.hg-card .hg-phrase-key.is-used {
  background: #e3e8e2;
  color: #515e57;
  border-style: dashed;
  text-decoration: line-through;
}
.hg-phrase-solve { margin-block: 1rem; }
.hg-phrase-solve > summary {
  cursor: pointer;
  padding: .5rem .1rem;
  width: fit-content;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .18em;
}
.hg-phrase-form {
  display: flex;
  align-items: end;
  gap: .55rem;
  flex-wrap: wrap;
  padding-block: .5rem;
}
.hg-phrase-form label { flex: 0 1 19rem; min-width: 0; }
.hg-phrase-input { display: block; margin-top: .3rem; }
.hg-trivia .hg-trivia-topic {
  margin-bottom: .5rem;
  color: #456557;
  font-size: .95rem;
  font-weight: 650;
}
.hg-trivia .hg-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.hg-trivia .hg-choices .hg-button[aria-disabled="true"] {
  background: #e4e9e3;
  border-color: #83988a;
  border-style: dashed;
  color: #405549;
}
@media screen and (min-width: 901px) {
  .cr-jump-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 35rem) {
  .hg-trivia .hg-choices { grid-template-columns: 1fr; }
}
@media (forced-colors: active) {
  .hg-word-tile, .hg-phrase-letter, .hg-tab, .hg-button { border: 1px solid ButtonText; }
  .hg-tab[aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -4px; }
  #word-and-trivia :is(button, a, summary, input):focus-visible { outline-color: Highlight; }
}
.hg-word-draft { margin-block: .8rem; }
.hg-word-tile[data-match="draft"] {
  min-height: 2.5rem;
  background: #f9fbf6;
  border-color: #88a699;
  color: #294e48;
}
