/* Fill-Ins — compact header + timer + grid without chrome (scoped --fill-ins) */

/* Shell: blends with page; no heavy card frame */
.word-search-game-shell.word-search-game-shell--fill-ins {
  width: min(960px, 100%);
  max-width: 100%;
  height: auto;
  min-height: 0;
  flex-shrink: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

@media (min-width: 1025px) {
  .word-search-game-shell.word-search-game-shell--fill-ins {
    min-height: 0;
    height: auto;
    max-width: min(880px, 100%);
    margin-inline: auto;
  }

  .word-search-page:not(.word-search-page--play-focus):has(.word-search-game-shell--fill-ins) {
    flex: 0 0 auto;
  }

  .word-search-page:not(.word-search-page--play-focus)
    .word-search-scale-outer:has(.word-search-game-shell--fill-ins) {
    flex: 0 0 auto;
    align-items: flex-start;
  }

  .word-search-game-shell--fill-ins .word-search-game-shell__body--fill-ins {
    flex: 0 0 auto;
  }

  .word-search-game-shell--fill-ins .fill-ins__board-cluster {
    flex: 0 0 auto;
    width: 100%;
    justify-content: center;
  }

  .word-search-game-shell--fill-ins .fill-ins__delete-btn--outside {
    align-self: center;
    margin: 0;
  }

  .word-search-game-shell--fill-ins .fill-ins__grid {
    --fi-cell-track: clamp(1rem, 1.45vw, 2.05rem);
    --fi-gutter-col: minmax(8px, 12px);
    --fi-gutter-row: minmax(8px, 12px);
  }

  .word-search-game-shell--fill-ins .fill-ins__word-bank--below-grid {
    max-height: min(22vh, 210px);
  }
}

.word-search-game-shell--fill-ins .fill-ins-header {
  flex: 0 0 auto;
  position: relative;
  padding: 0.42rem clamp(0.35rem, 2vw, 0.85rem) 0.42rem;
  margin: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ws-border);
}

.word-search-game-shell--fill-ins .fill-ins-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.word-search-game-shell--fill-ins .fill-ins-header__title {
  margin: 0;
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ws-text);
}

.word-search-game-shell--fill-ins .fill-ins-header__controls {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.word-search-game-shell--fill-ins .fill-ins-header__timer {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  border: 1px solid var(--ws-border-strong);
  background: color-mix(in srgb, var(--ws-board) 75%, transparent);
  font-variant-numeric: tabular-nums;
}

.word-search-game-shell--fill-ins .fill-ins-header__timer-icon {
  font-size: 0.82rem;
  opacity: 0.85;
}

.word-search-game-shell--fill-ins .fill-ins-header__timer-digits {
  font-size: clamp(0.74rem, 2.4vw, 0.84rem);
  font-weight: 700;
  color: var(--ws-text);
}

.word-search-game-shell--fill-ins .fill-ins-header__new-game {
  appearance: none;
  padding: 0.26rem 0.55rem;
  margin: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ws-accent) 45%, var(--ws-border-strong));
  background: color-mix(in srgb, var(--ws-accent) 12%, var(--ws-surface-2));
  color: var(--ws-accent);
  font-size: clamp(0.68rem, 2.4vw, 0.76rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.08s ease;
}

.word-search-game-shell--fill-ins .fill-ins-header__new-game:hover {
  background: color-mix(in srgb, var(--ws-accent) 22%, var(--ws-surface-2));
}

.word-search-game-shell--fill-ins .fill-ins-header__new-game:focus-visible {
  outline: 2px solid var(--ws-focus);
  outline-offset: 2px;
}

/* Live game messages: available to assistive tech only (no strip above the grid). */
.word-search-game-shell--fill-ins .fill-ins-header__status--visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.word-search-game-shell--fill-ins .word-search-game-shell__body--fill-ins {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  gap: 0;
  grid-template-columns: unset !important;
  grid-template-rows: unset;
  align-items: stretch;
}

.word-search-game-shell--fill-ins .word-search-game-shell__body--fill-ins > .word-search-game-shell__play,
.word-search-game-shell--fill-ins .word-search-game-shell__body--fill-ins > .word-search-game-shell__play.word-search-page__main {
  order: 1;
}

.word-search-game-shell--fill-ins .word-search-game-shell__body--fill-ins > .fill-ins-word-panel {
  order: 2;
}

.word-search-game-shell--fill-ins .fill-ins__play {
  position: relative;
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: visible;
  align-items: center;
}

.word-search-game-shell--fill-ins .fill-ins-word-panel {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.55rem clamp(0.55rem, 2.4vw, 1rem) max(0.75rem, env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--ws-surface) 92%, transparent);
  border-top: 1px solid var(--ws-border);
}

[data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins-word-panel {
  background: color-mix(in srgb, var(--ws-surface) 92%, #020617);
}

.word-search-game-shell--fill-ins .fill-ins-word-panel__head {
  flex: 0 0 auto;
  margin-bottom: 0.4rem;
}

.word-search-game-shell--fill-ins .fill-ins-word-panel__title {
  margin: 0 0 0.15rem;
  font-size: clamp(0.7rem, 2vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ws-muted);
}

.word-search-game-shell--fill-ins .fill-ins-word-panel__tip--below {
  margin: 0.65rem 0 0;
  padding: 0;
  font-size: clamp(0.72rem, 2.2vw, 0.84rem);
  line-height: 1.45;
  color: var(--ws-muted);
  text-align: center;
}

.word-search-game-shell--fill-ins .fill-ins-word-panel__tip--cross {
  margin-top: 0.45rem;
}

/* Win celebration card (matches Zip .zip-solved-overlay) */
.word-search-game-shell--fill-ins .fill-ins-win-panel[hidden] {
  display: none !important;
}

.word-search-game-shell--fill-ins .fill-ins-win-panel--overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem;
  box-sizing: border-box;
  border-radius: 6px;
  background: transparent;
  pointer-events: none;
}

.word-search-game-shell--fill-ins .fill-ins-win-panel__modal {
  position: relative;
  width: min(86%, 450px);
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(115, 76, 226, 0.36);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 224, 143, 0.32) 0 24px, transparent 25px),
    radial-gradient(circle at 88% 18%, rgba(255, 170, 226, 0.24) 0 20px, transparent 21px),
    radial-gradient(circle at 84% 82%, rgba(132, 214, 255, 0.22) 0 22px, transparent 23px),
    rgba(255, 255, 255, 0.92);
  color: #22133f;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 12px 34px rgba(36, 24, 85, 0.18);
  backdrop-filter: blur(1.5px);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  overflow: hidden;
  pointer-events: auto;
}

.word-search-game-shell--fill-ins .fill-ins-win-panel:not([hidden]) .fill-ins-win-panel__modal {
  animation: fill-ins-win-pop 0.55s ease-out;
}

.word-search-game-shell--fill-ins .fill-ins-win-panel__modal::before,
.word-search-game-shell--fill-ins .fill-ins-win-panel__modal::after {
  content: "✦";
  position: absolute;
  color: rgba(116, 75, 232, 0.7);
  font-size: 1rem;
  pointer-events: none;
  animation: fill-ins-win-sparkle-float 1.8s ease-in-out infinite;
}

.word-search-game-shell--fill-ins .fill-ins-win-panel__modal::before {
  left: 0.85rem;
  top: 0.5rem;
}

.word-search-game-shell--fill-ins .fill-ins-win-panel__modal::after {
  right: 0.85rem;
  bottom: 0.5rem;
  animation-delay: 0.45s;
}

@keyframes fill-ins-win-pop {
  0% { opacity: 0; transform: scale(0.94); filter: saturate(0.7) brightness(0.95); }
  100% { opacity: 1; transform: scale(1); filter: saturate(1.08) brightness(1); }
}

@keyframes fill-ins-win-sparkle-float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.65; }
  50% { transform: translateY(-4px) rotate(10deg); opacity: 1; }
}

.word-search-game-shell--fill-ins .fill-ins-win-panel__title,
.word-search-game-shell--fill-ins .fill-ins-win-panel__detail {
  margin: 0;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: normal;
  opacity: 1;
}

.word-search-game-shell--fill-ins .fill-ins-win-panel__btn {
  margin-top: 0.55rem;
  width: 100%;
  min-height: 36px;
  padding: 0.2rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(115, 76, 226, 0.36);
  font: inherit;
  font-weight: 700;
  font-size: inherit;
  cursor: pointer;
  color: #22133f;
  background: var(--surface-strong);
}

.word-search-game-shell--fill-ins .fill-ins-win-panel__btn:focus-visible {
  outline: 2px solid rgba(115, 76, 226, 0.5);
  outline-offset: 2px;
}

[data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins-win-panel__modal {
  border-color: rgba(185, 160, 255, 0.62);
  color: #f2f5ff;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 224, 143, 0.24) 0 24px, transparent 25px),
    radial-gradient(circle at 88% 18%, rgba(255, 170, 226, 0.18) 0 20px, transparent 21px),
    radial-gradient(circle at 84% 82%, rgba(132, 214, 255, 0.18) 0 22px, transparent 23px),
    rgba(20, 24, 48, 0.9);
  box-shadow: 0 14px 36px rgba(4, 6, 18, 0.5);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins-win-panel__title,
[data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins-win-panel__detail {
  color: #f2f5ff;
}

.word-search-game-shell--fill-ins .fill-ins__word-bank--below-grid {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  align-content: flex-start;
  justify-content: center;
  max-height: min(30dvh, 280px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.2rem 0.15rem 0.45rem;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ws-text) 18%, transparent) transparent;
}

/* Grid area: no outer card — only letter cells */
.word-search-game-shell--fill-ins .fill-ins__board-cluster {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  align-content: flex-start;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  padding: clamp(0.4rem, 1.8vw, 0.55rem) 0 clamp(0.55rem, 2vw, 0.75rem);
  box-sizing: border-box;
}

.word-search-game-shell--fill-ins .fill-ins__grid-wrap {
  position: relative;
  width: fit-content;
  max-width: 100%;
  max-height: none;
  overflow: visible;
  border-radius: 0;
  padding: 2px 0;
  margin: 0 auto;
  background: transparent;
  border: none;
  box-sizing: border-box;
}

.word-search-game-shell--fill-ins .fill-ins__grid {
  /* Opaque mix only (no translucent tokens) so voids stay flat under scale() — no faux gradient. */
  --fi-void: color-mix(in srgb, var(--ws-accent) 24%, var(--ws-board));
  --fi-cell: #fffdff;
  --fi-select: color-mix(in srgb, var(--ws-accent) 16%, var(--ws-surface-2));
  --fi-select-ring: color-mix(in srgb, var(--ws-focus) 45%, transparent);
  --fi-gutter-col: minmax(8px, 15px);
  --fi-gutter-row: minmax(9px, 15px);
  --fi-cell-track: clamp(1.22rem, 8.5vmin, 2.65rem);

  display: grid;
  width: fit-content;
  max-width: none;
  margin: 0 auto;
  box-sizing: border-box;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--fi-void);
  background-image: none;
}

[data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins__grid {
  /* Keep strong separation between playable tiles and void tiles in dark theme. */
  --fi-cell: color-mix(in srgb, #f8fafc 18%, var(--ws-surface-2));
  --fi-void: color-mix(in srgb, #020617 82%, var(--ws-board));
}

.word-search-game-shell--fill-ins .fill-ins__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Helvetica,
    Arial,
    sans-serif;
  font-weight: 700;
  font-size: clamp(0.74rem, 4vmin, 1.28rem);
  line-height: 1;
  text-transform: uppercase;
  border: none;
  box-sizing: border-box;
}

.word-search-game-shell--fill-ins .fill-ins__cell--void {
  background-color: var(--fi-void);
  background-image: none;
  box-shadow: none;
  pointer-events: none;
}

.word-search-game-shell--fill-ins .fill-ins__cell--void.fill-ins__cell--gutter {
  background-color: var(--fi-void);
  background-image: none;
  box-shadow: none;
}

.word-search-game-shell--fill-ins .fill-ins__cell--play {
  box-sizing: border-box;
  touch-action: manipulation;
  background: var(--fi-cell);
  color: var(--ws-text);
  border: 1px solid color-mix(in srgb, var(--ws-border-strong) 80%, transparent);
  box-shadow:
    1px 1px 0 color-mix(in srgb, var(--ws-border-strong) 35%, transparent),
    0 1px 2px rgba(47, 38, 80, 0.06);
  cursor: pointer;
  transition:
    background 0.12s ease,
    box-shadow 0.12s ease;
}

[data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins__cell--play {
  border-color: color-mix(in srgb, #cbd5e1 30%, transparent);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 1px 2px rgba(2, 6, 23, 0.45);
}

.word-search-game-shell--fill-ins .fill-ins__cell--play:hover {
  background: color-mix(in srgb, var(--ws-accent) 8%, var(--fi-cell));
}

.word-search-game-shell--fill-ins .fill-ins__cell--play:focus-visible {
  outline: 2px solid var(--ws-focus);
  outline-offset: 1px;
  z-index: 1;
}

.word-search-game-shell--fill-ins .fill-ins__cell--highlight {
  background: var(--fi-select) !important;
  box-shadow: inset 0 0 0 2px var(--fi-select-ring);
  color: var(--ws-text);
}

.word-search-game-shell--fill-ins .fill-ins__cell--play.fill-ins__cell--slot-sep-h {
  box-shadow:
    inset 6px 0 0 0 var(--fi-void),
    1px 1px 0 color-mix(in srgb, var(--ws-border-strong) 35%, transparent),
    0 1px 2px rgba(47, 38, 80, 0.06);
}

.word-search-game-shell--fill-ins .fill-ins__cell--play.fill-ins__cell--slot-sep-v {
  box-shadow:
    inset 0 4px 0 0 var(--fi-void),
    1px 1px 0 color-mix(in srgb, var(--ws-border-strong) 35%, transparent),
    0 1px 2px rgba(47, 38, 80, 0.06);
}

.word-search-game-shell--fill-ins .fill-ins__cell--play.fill-ins__cell--slot-sep-h.fill-ins__cell--slot-sep-v {
  box-shadow:
    inset 6px 0 0 0 var(--fi-void),
    inset 0 4px 0 0 var(--fi-void),
    1px 1px 0 color-mix(in srgb, var(--ws-border-strong) 35%, transparent),
    0 1px 2px rgba(47, 38, 80, 0.06);
}

.word-search-game-shell--fill-ins .fill-ins__delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: clamp(42px, 11vmin, 48px);
  height: clamp(42px, 11vmin, 48px);
  padding: 0;
  margin: 0 0 4px 0;
  border-radius: 999px;
  border: 1px solid var(--ws-border-strong);
  background: color-mix(in srgb, var(--ws-surface-2) 88%, transparent);
  color: var(--ws-accent);
  cursor: pointer;
  box-shadow: none;
  transition:
    background 0.15s ease,
    transform 0.08s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

[data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins__delete-btn {
  box-shadow: none;
}

.word-search-game-shell--fill-ins .fill-ins__delete-btn:hover {
  background: color-mix(in srgb, var(--ws-accent) 12%, var(--ws-surface-2));
  border-color: color-mix(in srgb, var(--ws-accent) 35%, transparent);
}

.word-search-game-shell--fill-ins .fill-ins__delete-btn:focus-visible {
  outline: 2px solid var(--ws-focus);
  outline-offset: 2px;
}

.word-search-game-shell--fill-ins .fill-ins__delete-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.word-search-game-shell--fill-ins .fill-ins__word {
  font-family:
    ui-sans-serif,
    system-ui,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Helvetica,
    Arial,
    sans-serif;
  font-size: clamp(0.74rem, 2.8vw, 0.92rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
  margin: 0;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--ws-surface-2) 75%, transparent);
  transition:
    opacity 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.word-search-game-shell--fill-ins .fill-ins__word--idle {
  color: var(--ws-text);
  border-color: color-mix(in srgb, var(--ws-border-strong) 40%, transparent);
}

.word-search-game-shell--fill-ins .fill-ins__word--used {
  color: var(--ws-muted);
  background: transparent;
  border-color: transparent;
  opacity: 0.88;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--ws-muted) 65%, transparent);
}

.word-search-game-shell--fill-ins .fill-ins__word--fits {
  cursor: pointer;
  color: var(--ws-accent);
  background: color-mix(in srgb, var(--ws-accent) 10%, var(--ws-surface-2));
  border-color: color-mix(in srgb, var(--ws-accent) 38%, transparent);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--ws-accent) 14%, transparent);
}

.word-search-game-shell--fill-ins .fill-ins__word--fits:hover {
  background: color-mix(in srgb, var(--ws-accent) 18%, var(--ws-surface-2));
}

.word-search-game-shell--fill-ins .fill-ins__word--fits:focus-visible {
  outline: 2px solid var(--ws-focus);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  /* Stop shared word-search shell rules from stretching Fill-Ins vertically. */
  .word-search-page:has(.word-search-game-shell--fill-ins) {
    flex: 0 0 auto;
    min-height: 0;
  }

  .word-search-scale-outer:has(.word-search-game-shell--fill-ins) {
    flex: 0 0 auto;
    min-height: 0;
    align-items: flex-start;
    align-self: flex-start;
    width: 100%;
  }

  .word-search-game-shell.word-search-game-shell--fill-ins {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none;
  }

  .word-search-game-shell--fill-ins .word-search-game-shell__body--fill-ins {
    flex: 0 0 auto;
    min-height: 0;
  }

  .word-search-game-shell--fill-ins .fill-ins__play {
    flex: 0 0 auto;
    min-height: 0;
    max-height: var(--fill-ins-play-fit, none);
    overflow: visible;
    align-items: center;
    justify-content: flex-start;
  }

  .word-search-game-shell--fill-ins .fill-ins-header {
    border-bottom: none;
    padding-bottom: 0.2rem;
  }

  .word-search-game-shell--fill-ins .fill-ins-header__row {
    justify-content: center;
    text-align: center;
  }

  .word-search-game-shell--fill-ins .fill-ins-header__title {
    flex: 1 1 100%;
    text-align: center;
    font-size: clamp(1.05rem, 4.5vw, 1.25rem);
  }

  .word-search-game-shell--fill-ins .fill-ins-header__controls {
    justify-content: center;
    width: 100%;
  }

  .word-search-game-shell--fill-ins .fill-ins-header__timer,
  .word-search-game-shell--fill-ins .fill-ins-header__new-game {
    background: #ffffff;
  }

  [data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins-header__timer,
  [data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins-header__new-game {
    background: color-mix(in srgb, var(--ws-surface-2) 92%, #ffffff);
  }

  /* Grid stacked above delete (matches mobile reference layout). */
  .word-search-game-shell--fill-ins .fill-ins__board-cluster {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    flex: 0 0 auto;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding: clamp(0.35rem, 2vw, 0.55rem) 0 clamp(0.25rem, 1.5vw, 0.4rem);
    box-sizing: border-box;
  }

  .word-search-game-shell--fill-ins .fill-ins__grid-wrap {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    overflow: visible;
    box-sizing: border-box;
  }

  .word-search-game-shell--fill-ins .fill-ins__grid {
    max-width: 100%;
  }

  .word-search-game-shell--fill-ins .fill-ins__delete-btn--outside {
    flex-shrink: 0;
    margin: 0.15rem auto 0;
    background: #ffffff;
    border-color: color-mix(in srgb, var(--ws-accent) 42%, var(--ws-border-strong));
    box-shadow: 0 1px 3px color-mix(in srgb, var(--ws-text) 8%, transparent);
  }

  [data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins__delete-btn--outside {
    background: color-mix(in srgb, var(--ws-surface-2) 94%, #ffffff);
  }

  .word-search-game-shell--fill-ins .fill-ins-word-panel {
    flex: 0 1 auto;
    min-height: 0;
    background: color-mix(in srgb, var(--ws-accent) 11%, var(--ws-board));
    border-top: none;
    padding-top: 0.65rem;
  }

  [data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins-word-panel {
    background: color-mix(in srgb, var(--ws-accent) 14%, var(--ws-board));
  }

  .word-search-game-shell--fill-ins .fill-ins-word-panel__head {
    margin-bottom: 0.35rem;
  }

  .word-search-game-shell--fill-ins .fill-ins__word-bank--below-grid {
    flex: 0 1 auto;
    max-height: min(32dvh, 240px);
    min-height: 0;
    overflow-y: auto;
    justify-content: center;
    padding: 0.15rem 0.1rem 0.35rem;
  }

  .word-search-game-shell--fill-ins .fill-ins__word {
    background: #ffffff;
    border-radius: 6px;
    border-color: color-mix(in srgb, var(--ws-border-strong) 35%, transparent);
  }

  [data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins__word {
    background: color-mix(in srgb, var(--ws-surface-2) 90%, #ffffff);
  }

  .word-search-game-shell--fill-ins .fill-ins-word-panel__tip--below {
    margin-top: 0.5rem;
    padding-inline: 0.25rem;
  }

  /* Full-screen: fill viewport — play area grows, grid centered, word list pinned below. */
  .word-search-page--play-focus:has(.word-search-game-shell--fill-ins) {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
  }

  .word-search-page--play-focus .word-search-scale-outer:has(.word-search-game-shell--fill-ins) {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    align-items: stretch;
    align-self: stretch;
  }

  .word-search-page--play-focus .word-search-game-shell.word-search-game-shell--fill-ins {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: none;
    display: flex;
    flex-direction: column;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins-header {
    flex: 0 0 auto;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .word-search-game-shell__body--fill-ins {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins__play {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins__board-cluster {
    flex: 0 0 auto;
    justify-content: center;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins-word-panel {
    flex: 0 0 auto;
    flex-shrink: 0;
    width: 100%;
    max-height: min(42dvh, 42vh);
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins__word-bank--below-grid {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(36dvh, 300px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 640px) {
  .word-search-game-shell--fill-ins .fill-ins-word-panel {
    padding-inline: 0.45rem;
  }
}
