/* XWords – Spielstile (12×12 Wortgitter) */

.xw-game { margin: 10px 0 30px; }

.xw-topbar { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 12px; }

.xw-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

.stat.diff-tile { min-width: 160px; padding: 10px 14px; }
.stat.diff-tile .num { font-size: 1rem; }
.stat.diff-tile .small { font-weight: 600; }

.progress { height: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--turkis), var(--neon)); transition: width .25s ease; }

.xw-body { display: flex; gap: 20px; flex-wrap: wrap; }

.xw-grid {
  --s: 40px;
  display: grid;
  grid-template-columns: repeat(12, var(--s));
  gap: 2px;
  background: var(--panel);
  border: 2px solid var(--turkis);
  border-radius: 10px;
  padding: 8px;
  user-select: none;
  touch-action: none;
}
.xw-grid .cell {
  width: var(--s);
  height: var(--s);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg2);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.xw-grid .cell.highlighted { background: rgba(167,139,250,.35); border-color: var(--neon); }
.xw-grid .cell.found { background: rgba(74,222,128,.18); color: var(--green); }
.xw-grid .cell.wrong { background: rgba(255,95,109,.25); }

.xw-side { flex: 1; min-width: 220px; }

.word-list { list-style: none; margin: 0; padding: 0; max-height: 480px; overflow-y: auto; }
.word-list li {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: 1px;
}
.word-list li.found { color: var(--green); text-decoration: line-through; opacity: .8; }
.word-list li:last-child { border-bottom: 0; }

.xw-grid .cell:nth-child(n+1) { }

@media (max-width: 640px) {
  .xw-game { display: flex; flex-direction: column; }
  .xw-body {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    order: -1;
    width: 100%;
    max-width: 100%;
  }
  .xw-grid {
    width: 100%;
    max-width: 430px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 2px;
    padding: 5px;
  }
  .xw-grid .cell {
    width: auto;
    height: auto;
    aspect-ratio: 1 / 1;
    min-width: 0;
    border-radius: 5px;
    font-size: clamp(.6rem, 3.2vw, .95rem);
  }
  .xw-side { width: 100%; min-width: 0; order: 0; }
  .xw-head { order: 1; }
  .xw-game > .panel { order: 2; }
  .word-list { max-height: 220px; }
}