html,body {
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

input, button {
  font-size: 16px;
}

#hintBtn {
  width: auto;
  padding: 9px 12px;
  color: #ffcb47;
}

header > div:nth-child(3) {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.tile.hinting {
  background: #7af0cf;
  color: #17152a;
  animation: hint-shake .42s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.tile.hinting::after {
  content: attr(data-hint-order);
  position: absolute;
  top: -5px;
  right: -4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffcb47;
  color: #17152a;
  font-size: 10px;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 1px 5px #1118;
}

.hint-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.hint-path polyline {
  fill: none;
  stroke: #ffcb47;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 8 7;
  animation: hint-flow .7s linear infinite;
}

.currentHistory {
  width: min(100%, 420px);
  max-height: 28vh;
  overflow: auto;
  margin: 8px 0 16px;
  padding: 12px;
  border-radius: 14px;
  background: #1c1930;
  color: #d8d3e8;
  line-height: 1.6;
}

.dangerButton {
  max-width: 300px;
  background: #63283a;
  color: #ffdce5;
}

.historyEntry {
  margin: 10px 0;
  border-radius: 16px;
  background: #1c1930;
  overflow: hidden;
}

.historyEntry summary {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.historyEntry summary::-webkit-details-marker { display: none; }
.historyEntry summary span { display: flex; flex-direction: column; }
.historyEntry[open] summary { background: #292541; }
.historyDetails { padding: 4px 18px 18px; }
.historyDetails h3 { margin-bottom: 10px; }

.wordHistoryGrid {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 0 12px;
  align-items: center;
}

.wordHistoryGrid > * {
  padding: 9px 0;
  border-bottom: 1px solid #312d49;
}

.wordHistoryGrid > span,
.wordHistoryGrid > small { color: #aaa5c0; }

@keyframes hint-shake {
  0%,100% { transform: rotate(-2deg) scale(1.02); }
  50% { transform: rotate(2deg) scale(1.08); }
}

@keyframes hint-flow {
  to { stroke-dashoffset: -15; }
}
