@font-face {
  font-family: Fraunces;
  src: url("../../assets/fraunces.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans";
  src: url("../../assets/source-sans.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans";
  src: url("../../assets/source-sans-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #fff7e8;
  --ink: #192342;
  --blue: #2645cd;
  --coral: #f25d49;
  --cream: #fffefa;
  --lilac: #e9dcfa;
  --yellow: #fae575;
  --mint: #d3eedc;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.45 "Source Sans", system-ui, sans-serif;
}

.game { max-width: 820px; padding: clamp(10px, 3vw, 24px) .8rem 1.2rem; margin-inline: auto; }

.panel {
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  overflow-wrap: anywhere;
}

.panel-intro {
  background: var(--lilac);
  border-bottom: 2px solid var(--ink);
  padding: clamp(19px, 5vw, 36px);
}

#playing .panel-intro { background: var(--yellow); }
#results .panel-intro { background: var(--mint); }

h1, p { margin: 0; }
h1 { font: 800 clamp(1.6rem, 5vw, 2.8rem)/1.05 Fraunces, Georgia, serif; letter-spacing: -.045em; }
.panel-intro p:not(.round-count) { max-width: 54ch; margin-top: .62em; }
.round-count { font-weight: 700; font-size: .9rem; margin-bottom: .45rem; }
.panel > :is(form, .handoff) { padding: clamp(19px, 5vw, 36px); }

label { display: block; margin-bottom: .28rem; font-weight: 700; }
:is(select, input, button) { font: inherit; }
:is(select, input) {
  width: min(100%, 39rem);
  min-height: 45px;
  padding: .55em .68em;
  border: 1px solid var(--ink);
  color: inherit;
  background: #fff;
  border-radius: 5px;
}

select { text-overflow: ellipsis; }
#custom-field { padding-top: 1rem; }
#answer-tip { margin-top: .35rem; }

.button {
  display: flex;
  align-items: center;
  gap: .6em;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  margin-top: .9rem;
  padding: .48em .82em;
  color: var(--ink);
  background: var(--coral);
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.button:hover { background: #ff7b6b; }
.button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.text-button {
  margin-top: .64rem;
  min-height: 44px;
  padding: .3em 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.word-tiles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .7em;
  padding: clamp(19px, 5vw, 36px);
  padding-bottom: 1em;
}

.word-tile {
  background: var(--yellow);
  border: 1px solid var(--ink);
  border-radius: 5px;
  padding: .34em .52em;
  max-width: 100%;
  box-shadow: 2px 2px 0 var(--ink);
  font: 800 1.1rem/1.1 Fraunces, Georgia, serif;
}
.word-tile:nth-child(4n + 2) { background: var(--lilac); }
.word-tile:nth-child(4n + 3) { color: #fff; background: var(--blue); }
.word-tile:nth-child(4n) { background: var(--mint); }
.word-tile[data-emphasis="1"] { font-size: clamp(1.3rem, 4vw, 1.7rem); }
.word-tile[data-emphasis="2"] { font-size: clamp(1.5rem, 5vw, 2.2rem); }

.counts { margin: 0 clamp(19px, 5vw, 36px); }
.counts summary { cursor: pointer; font-weight: 700; text-underline-offset: .16em; }
.counts summary:hover { text-decoration: underline; }
.counts ol { padding-left: 1.5rem; margin: .55rem 0; }
.counts li + li { margin-top: .22rem; }
#reset { margin: 1rem clamp(19px, 5vw, 36px) clamp(19px, 5vw, 36px); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
