/* Follow browser chrome changes without fixing the footer over the content. */
.page-shell {
  min-height: 100vh;
  min-height: 100dvh;
}
.page-shell > .site-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* The editor is a standalone grid cell, not an input nested inside a button. */
.board .cell-letter-input {
  width: var(--cell);
  height: var(--cell);
  display: block;
  padding: 0;
  border: 1px solid var(--primary);
  border-radius: clamp(6px,calc(var(--cell) * .24),14px);
  background: #fff;
  font-size: clamp(16px,calc(var(--cell) * .54),34px);
  line-height: normal;
  text-align: center;
  appearance: none;
  transform: none !important;
}
.board .cell-letter-input:focus {
  border-color: var(--primary-dark);
  box-shadow: inset 0 0 0 1px var(--primary);
}

/* Avoid automatic input zoom on phones without disabling pinch-to-zoom. */
@media (max-width: 980px), (pointer: coarse) {
  .settings-card input,
  .settings-card .party-word-field input,
  .settings-card .player-row input {
    font-size: 16px;
  }
}
@media (hover: none) {
  .board .cell:hover { transform: none; }
}

@media (max-width: 620px) {
  .board-wrap {
    min-width: 0;
    padding-inline: 10px;
    overflow-x: clip;
  }
  .board {
    max-width: 100%;
    gap: 3px;
  }
  .board .cell {
    min-width: 0;
    font-size: clamp(9px, calc(var(--cell) * .62), 20px);
  }

  #startGameBtn,
  #resetGameBtn,
  #historyToggle {
    display: grid;
    place-items: center;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    line-height: 1;
    transform: none !important;
  }
  #historyToggle {
    font-size: 0;
  }
}

/* A vector icon avoids platform-dependent clock glyphs and baseline offsets. */
#historyToggle::before {
  content: none;
  display: none;
}
#historyToggle .history-icon,
#resetGameBtn .reset-icon,
#startGameBtn .play-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  pointer-events: none;
}

#startGameBtn.is-ready {
  background: #315f91;
  box-shadow: 0 0 0 4px rgba(82,119,160,.3), 0 12px 28px rgba(49,95,145,.42);
  animation: startGameReady 1.25s ease-in-out infinite;
  transform-origin: center;
}
@keyframes startGameReady {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
    box-shadow: 0 0 0 3px rgba(82,119,160,.3), 0 10px 24px rgba(49,95,145,.38);
  }
  50% {
    transform: scale(1.09);
    filter: brightness(1.18);
    box-shadow: 0 0 0 10px rgba(82,119,160,.16), 0 16px 36px rgba(49,95,145,.55);
  }
}
@media (prefers-reduced-motion: reduce) {
  #startGameBtn.is-ready { animation: none; }
}

/* Keep unavailable actions visually subordinate to controls that can be used. */
button:disabled,
button.is-disabled {
  opacity: .28 !important;
  filter: saturate(.4) !important;
  box-shadow: none !important;
}
