body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font: 16px/1.5 Arial,sans-serif
}

.defs {
  position: absolute;
  width: 0;
  height: 0
}

header {
  background: var(--paper);
  border-bottom: 1px solid var(--line)
}

nav,main {
  max-width: 1184px;
  margin: auto;
  padding: 0 40px
}

nav {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between
}

.brand,.title,h2,.rankrow b {
  font-family: Georgia,serif
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  letter-spacing: -1.6px
}

.brand svg {
  width: 37px;
  height: 40px
}

button {
  background: var(--paper);
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: 600 14px Arial,sans-serif;
  padding: 13px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px
}

button:hover {
  filter: brightness(.96)
}

button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px
}

.help {
  background: none;
  border: 0;
  padding: 8px 0
}

.help span {
  border: 1.6px solid;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 16px
}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 44px 0 30px
}

.title {
  display: flex;
  align-items: center;
  gap: 13px
}

h1 {
  font-size: clamp(44px,5vw,71px);
  line-height: 1.13;
  letter-spacing: -4px;
  margin: 0
}

.flight {
  width: 128px;
  height: 68px
}

.intro p {
  margin: 8px 0 0;
  color: var(--muted)
}

.ico {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round
}

.layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 24px;
  padding-bottom: 38px
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px
}

.play,.stats,.found {
  padding: 24px 28px
}

.boardhead,.rankrow {
  display: flex;
  justify-content: space-between;
  align-items: center
}

h2 {
  font-size: 26px;
  letter-spacing: -1px;
  margin: 0;
  line-height: 1.3
}

.tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  background: var(--tint);
  border: 1px solid var(--pill);
  border-radius: 5px;
  padding: 4px 8px;
  color: var(--accentInk)
}

.play {
  text-align: center;
  position: relative
}

#entry {
  margin: 24px auto 16px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 2px;
  word-break: break-all
}

#entry i {
  height: 33px;
  width: 3px;
  background: var(--accent)
}

#notice {
  position: absolute;
  left: 8px;
  right: 8px;
  font-size: 13px;
  transform: translateY(-13px);
  color: var(--accentInk)
}

#hive {
  position: relative;
  width: 272px;
  height: 289px;
  margin: 13px auto 20px
}

.hex {
  border: 0;
  border-radius: 0;
  padding: 0;
  position: absolute;
  clip-path: polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);
  width: 103px;
  height: 90px;
  font-size: 38px;
  font-weight: 750;
  background: var(--soft)
}

.hex.center,.primary {
  background: var(--accent)
}

.controls {
  display: flex;
  gap: 13px;
  justify-content: center
}

.controls button {
  border-radius: 24px;
  min-width: 94px;
  height: 43px
}

.controls #mix {
  min-width: 46px;
  padding: 0
}

.primary {
  border-color: var(--accent)
}

.play small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 0
}

aside {
  display: flex;
  flex-direction: column;
  gap: 20px
}

.stats {
  background: var(--tint)
}

.rankrow {
  margin-top: 24px
}

.rankrow b {
  font-size: 22px
}

.rankrow span,#count {
  background: var(--pill);
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700
}

#track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 13px;
  height: 12px;
  background: linear-gradient(var(--pill),var(--pill)) center/100% 3px no-repeat
}

#track i {
  width: 9px;
  height: 9px;
  background: var(--pill);
  border-radius: 50%
}

#track .active {
  background: var(--ink);
  outline: 3px solid var(--accent)
}

#next,.empty p {
  color: var(--muted);
  font-size: 14px
}

.found {
  flex: 1;
  min-height: 246px
}

#count {
  background: var(--soft)
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 185px;
  line-height: 1.4
}

.empty svg {
  color: var(--muted);
  width: 38px;
  height: 38px;
  transform: rotate(-7deg);
  margin-bottom: 13px
}

.empty b {
  font-family: Georgia,serif;
  font-size: 19px
}

.empty p {
  margin: 5px 0
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px
}

.chips span {
  padding: 4px 11px;
  background: var(--soft);
  border-radius: 5px
}

dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px;
  background: var(--paper);
  color: inherit;
  width: min(420px,92vw)
}

dialog::backdrop {
  background: #22221966
}

.close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: 0;
  font-size: 24px;
  padding: 2px 8px
}

label {
  display: block;
  font-weight: 600;
  margin: 15px 0
}

input {
  display: block;
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font-size: 19px;
  text-transform: uppercase;
  letter-spacing: 4px
}

.error {
  color: var(--error);
  font-size: 14px
}

dialog p {
  color: var(--muted)
}

@media(max-width:750px) {
  nav,main {
    padding: 0 18px
  }
  .intro {
    align-items: flex-start;
    gap: 16px;
    flex-direction: column;
    padding: 28px 0 20px
  }
  .layout {
    grid-template-columns: 1fr;
    gap: 16px
  }
  .flight {
    width: 90px;
    height: 48px
  }
  h1 {
    letter-spacing: -2.5px
  }
  .intro p {
    font-size: 15px
  }
  .play,.stats,.found {
    padding: 20px
  }
  .play {
    padding-bottom: 24px
  }
  nav {
    height: 60px
  }
}

.puzzle-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap
}

#typed .invalid-letter {
  color: var(--error);
  text-decoration: underline;
  text-underline-offset: 4px
}

#enter:disabled {
  opacity: .55;
  cursor: not-allowed
}

#entry {
  position: relative
}

#reward {
  position: absolute;
  bottom: calc(100% + 3px);
  left: 0;
  right: 0;
  pointer-events: none;
  line-height: 1
}

.reward-label {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--tint);
  color: var(--accentInk);
  font: 700 14px/1.2 Arial,sans-serif;
  letter-spacing: normal;
  animation: points-rise 1.5s ease-out both
}

@keyframes points-rise {
  0% {
    opacity: 1;
    transform: translateY(0)
  }
  55% {
    opacity: 1
  }
  100% {
    opacity: 0;
    transform: translateY(-13px)
  }
}

@media(prefers-reduced-motion:reduce) {
  .reward-label {
    animation-name: points-fade
  }
}

@keyframes points-fade {
  0%,75% {
    opacity: 1
  }
  100% {
    opacity: 0
  }
}

.word-score {
  margin-left: 3px;
  color: var(--accentInk);
  font-size: .875rem;
  white-space: nowrap
}

.room {
  padding: 22px 26px
}

.room #connection {
  color: var(--muted);
  font-size: 14px
}

.room #leave {
  border: 0;
  background: transparent;
  padding: 6px;
  color: var(--muted)
}

.room #invite {
  margin-top: 15px
}

#players {
  display: grid;
  gap: 9px
}

.room-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--tint);
  padding: 11px 14px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 4px 10px
}

.room-row strong {
  overflow-wrap: anywhere
}

.room-row:first-child {
  background: var(--tint);
  border-color: var(--line)
}

.room-row output {
  grid-column: 1/-1;
  font-weight: 600;
  letter-spacing: 1px;
  overflow-wrap: anywhere;
  min-height: 1.5em
}

.room-row output:empty:after {
  content: '…';
  color: var(--muted)
}

.room-row b {
  color: var(--accentInk);
  background: var(--pill);
  padding: 3px 11px;
  border-radius: 999px;
  font-size: .875rem;
  white-space: nowrap
}

.room[hidden],button[hidden] {
  display: none
}

.finder {
  display: block;
  color: var(--muted);
  font-size: .81rem
}

#nickname {
  text-transform: none;
  letter-spacing: normal
}

#progress-heading[hidden]+.rankrow {
  margin-top: 0
}

#room-panel:not([hidden]) ~ .found {
  container-type: inline-size
}

#room-panel:not([hidden]) ~ .found #list {
  height: 14rem;
  overflow-y: auto;
  margin: 16px -18px 0 0
}

#team-history {
  width: 100cqi;
  max-width: 100%
}

#team-history {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 5px
}

#team-history li {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0,1fr) fit-content(62%);
  gap: 10px;
  padding: 7px 10px;
  background: var(--soft);
  border-radius: 5px
}

#team-history strong,#team-history span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.history-credit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 8px
}

#team-history b {
  font-size: .875rem;
  white-space: nowrap;
  color: var(--accentInk)
}

#team-history span {
  text-align: right;
  font-size: .875rem;
  color: var(--muted)
}

#team-history .new-discovery {
  animation: discovery-highlight 3.3s ease-out
}

@keyframes discovery-highlight {
  0%,35% {
    background: var(--discovery)
  }
  100% {
    background: var(--soft)
  }
}

.pangram-card {
  outline: 2px solid #c99713;
  outline-offset: -2px
}

.pangram-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  flex: none
}

.chips .pangram-icon {
  margin-left: 4px
}

.pangram-label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0
}

#finish {
  margin-top: 19px;
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--muted)
}

#finish:disabled {
  opacity: .55
}

dialog:has(#result-list) {
  width: min(560px,94vw);
  max-height: 88vh
}

.end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

#result-filter {
  font: inherit;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper)
}

.result-hint {
  font-size: .875rem
}

#result-list {
  max-height: 48vh;
  overflow: auto
}

#result-list details {
  background: var(--soft);
  border-radius: 6px;
  margin: 5px 0
}

#result-list summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer
}

#result-list summary strong {
  margin-right: auto;
  overflow-wrap: anywhere
}

#result-list summary span {
  font-size: .82rem
}

#result-list summary b {
  white-space: nowrap;
  font-size: .875rem
}

.result-found {
  color: var(--success)
}

.result-missed {
  color: var(--muted)
}

#result-list details p {
  padding: 0 10px 10px;
  margin: 0;
  font-size: .9rem
}

.hex.center,.primary {
  color: var(--on-accent)
}

input,select {
  background: var(--paper);
  color: var(--ink)
}

a {
  color: var(--accent)
}

#theme-toggle {
  background: var(--tint);
  color: var(--accentInk)
}

#round-complete:not([hidden]) {
  min-height: 350px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 12px
}

#round-complete h2 {
  font-size: clamp(34px,4vw,48px)
}

#round-complete p {
  color: var(--muted);
  margin: 8px 0 24px
}

#round-complete .end-actions {
  justify-content: center
}

.end-bee {
  width: 72px;
  margin-bottom: 12px
}

[hidden] {
  display: none!important
}

:root[data-theme="dark"] .flight,:root[data-theme="dark"] .end-bee {
  filter: drop-shadow(0 0 1px #e8cbff)
}

