
  .wordfall-game .header h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 900;
    font-size: clamp(2.4rem, 6vw, 4rem);
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--ink);
  }

  .wordfall-game .header h1 span { color: var(--accent); }

  /* ── GRID ── */
.wordfall-game .grid-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: max-content;
  gap: 14px;
}

.wordfall-game .grid-wrap {
  background: #ffffff;
  padding: 6px;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--accent);
  user-select: none;
  position: relative;
  width: max-content;
}


  .wordfall-game .grid {
    display: grid;
    gap: 3px;
  }

  .wordfall-game .cell {
    width: var(--cell);
    height: var(--cell);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--ink);
    background: var(--paper);
    border: 2px solid rgba(36,22,27,0.18);
    cursor: pointer;
    transition: background 0.12s ease, transform 0.12s ease, opacity 0.18s ease;
    position: relative;
    letter-spacing: 0;
    touch-action: none;
  }

  .wordfall-game .cell:hover:not(.empty):not(.found-flash) {
    background: var(--cream);
  }

  .wordfall-game .cell.selected {
    background: var(--clue-bg);
    border-color: var(--clue-border);
    z-index: 2;
  }

  .wordfall-game .cell.invalid-flash {
    background: var(--invalid-bg) !important;
    border-color: #d40000 !important;
    animation: shake 0.35s ease;
  }

  .wordfall-game .cell.found-flash {
    background: var(--found-bg) !important;
    border-color: var(--found-border) !important;
    animation: pop 0.35s ease;
  }

  .wordfall-game .cell.falling {
    animation: fall 0.28s ease;
  }

  .wordfall-game .cell.empty {
    background: #fffacd;
    border-color: rgba(36,22,27,0.06);
    cursor: default;
    pointer-events: none;
  }

  @keyframes shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
  }

  @keyframes pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.15); }
    100% { transform: scale(1); }
  }

  @keyframes fall {
    0%   { transform: translateY(-14px); opacity: 0.4; }
    100% { transform: translateY(0); opacity: 1; }
  }

  /* ── SELECTION BAR ── */
  .wordfall-game .selection-bar {
    display: flex;
    align-items: left;
    gap: 10px;
    min-height: 40px;
    flex-wrap: wrap;
  }


  .wordfall-game .btn-submit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 2px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
  }
  .wordfall-game .btn-submit:hover { background: var(--accent); border-color: var(--accent); }
  .wordfall-game .btn-submit:disabled { opacity: 0.35; cursor: default; }

  .wordfall-game .btn-clear-sel {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 2px solid var(--ink);
    background: transparent;
    color: var(--ink);
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.12s;
  }
  .wordfall-game .btn-clear-sel:hover { background: var(--cream); }

  .wordfall-game .btn-icon {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid var(--ink);
    background: transparent;
    color: var(--ink);
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    line-height: 1;
  }

  .wordfall-game .btn-icon:hover {
    background: var(--cream);
  }

  /* ── MESSAGE ── */
.wordfall-game .message-bar {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  min-height: 20px;
  white-space: normal;
}

  

  /* ── WORD LIST ── */
  .wordfall-game .word-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .wordfall-game .word-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid rgba(36,22,27,0.12);
    background: var(--paper);
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: background 0.15s;
  }

  .wordfall-game .word-item.found {
    background: var(--found-bg);
    border-color: var(--found-border);
    color: var(--clue-ink);
    text-decoration: line-through;
    text-decoration-color: var(--clue-border);
    opacity: 0.82;
  }

  .wordfall-game .word-item .tick {
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.2s;
  }
  .wordfall-game .word-item.found .tick { opacity: 1; }

  .wordfall-game .word-item .len {
    margin-left: auto;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
  }

  /* ── CONTROLS ── */
  .wordfall-game .controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .wordfall-game .btn {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 2px solid var(--ink);
    padding: 10px 14px;
    cursor: pointer;
    width: 100%;
    transition: background 0.12s, color 0.12s, opacity 0.12s;
    text-align: left;
  }


  .wordfall-game .btn-secondary { background: transparent; color: var(--ink); }
  .wordfall-game .btn-secondary:hover { background: var(--cream); }
  .wordfall-game .btn:disabled { opacity: 0.45; cursor: default; }

  /* ── WIN OVERLAY ── */
  .wordfall-game .overlay {
    position: fixed;
    inset: 0;
    background: rgba(36,22,27,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadein 0.3s ease;
  }

  @keyframes fadein { from { opacity:0; } to { opacity:1; } }

  .wordfall-game .overlay-box {
    background: var(--paper);
    border: 3px solid var(--ink);
    box-shadow: 8px 8px 0 var(--accent);
    padding: 40px 48px;
    text-align: center;
    max-width: 380px;
    width: 90%;
  }

  .wordfall-game .overlay-box h2 {
    font-family: Georgia, serif;
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 10px;
    line-height: 1.1;
  }

  .wordfall-game .overlay-box h2 span { color: var(--accent); }

  .wordfall-game .overlay-box p {
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 28px;
  }

  /* ── HOW TO PLAY ── */
  .wordfall-game .rules {
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--ink);
    opacity: 0.8;
  }

  .wordfall-game .rules li { margin-left: 14px; margin-bottom: 3px; }

  /* ── GENERATING OVERLAY ── */
  .wordfall-game .gen-overlay {
    position: fixed; inset: 0;
    background: rgba(251,241,244,0.88);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px; z-index: 200;
  }
  .wordfall-game .gen-overlay p {
    font-family: Georgia, serif; font-size: 1.4rem; font-weight: 700;
    color: var(--ink);
  }
  .wordfall-game .gen-overlay small {
    font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--accent);
  }
  .wordfall-game .spinner {
    width: 34px; height: 34px;
    border: 3px solid var(--accent-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ── RESPONSIVE ── */
  @media (max-width: 680px) {

  .wordfall-game .grid-panel {
    width: 100%;
  }
}