[data-classic="wykreslanki"] {
  --ws-ink:#173d3c;
  --ws-green:#256759;
  --ws-stitch:#aebda9;
  --ws-paper:#fffbed;
}
[data-classic="wykreslanki"] .classic-table {
  background:#c7d9c9;
  border:1px solid #849e8c;
  border-radius:14px;
  padding:clamp(6px,1.05vw,15px);
  box-shadow:inset 0 0 0 3px #deeadb;
  background-image:repeating-linear-gradient(120deg,transparent 0 4px,#496d5709 4px 5px);
}
.ws-sheet {
  position:relative; min-width:0;
  color:var(--ws-ink);
  padding:clamp(9px,1.4vw,19px);
  border-radius:9px;
  border:1px solid #b6bea7;
  background:linear-gradient(100deg,#faf8e9,var(--ws-paper) 36%,#f9f2dd);
  box-shadow:0 2px 2px #2a4f402b;
}
.ws-heading,.ws-layout { width:100%; max-width:850px; margin-inline:auto; }
.ws-heading {
  display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:4px 12px;
  border-bottom:1px solid #c5c6af; padding-bottom:7px; margin-bottom:9px;
}
.ws-heading h2 { margin:0; font:850 clamp(1.1rem,1.8vw,1.52rem)/1.15 var(--head,system-ui); letter-spacing:-.025em; }
.ws-progress { color:#466257; font-size:.79rem; white-space:nowrap; }
.ws-progress b { padding-left:3px; color:var(--ws-ink); font-variant-numeric:tabular-nums; }
.ws-layout { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(170px,.8fr); gap:clamp(12px,2.5vw,34px); align-items:start; }
.ws-work,.ws-scroll { min-width:0; }
.ws-scroll { overflow:auto; overscroll-behavior-x:contain; padding:2px; }
.ws-frame {
  display:grid; grid-template-columns:1.25rem minmax(0,1fr); grid-template-rows:1.1rem auto;
  max-width:var(--ws-board-size,470px); margin-inline:auto;
}
.ws-axis { display:grid; text-align:center; align-items:center; color:#566b5b; font:650 .63rem/1 system-ui,sans-serif; }
.ws-cols { grid-area:1/2; grid-template-columns:repeat(var(--ws-count),minmax(0,1fr)); }
.ws-rows { grid-area:2/1; grid-template-rows:repeat(var(--ws-count),minmax(0,1fr)); }
.ws-grid {
  position:relative; isolation:isolate; grid-area:2/2; display:grid; grid-template-columns:repeat(var(--ws-count),minmax(0,1fr));
  grid-template-rows:repeat(var(--ws-count),minmax(0,1fr)); aspect-ratio:1; min-width:0;
  background:#fffdf4; border:1px solid #526f64; border-radius:4px; box-shadow:0 2px 0 #7a90832b;
  user-select:none; touch-action:pan-y pinch-zoom; container-type:inline-size;
}
.ws-traces { position:absolute; width:100%; height:100%; inset:0; z-index:-1; pointer-events:none; stroke-linecap:round; stroke-width:.64; }
.ws-ghost { stroke:#90a9db; opacity:.8; stroke-dasharray:.18 .09; stroke-width:.48; }
.ws-grid .ws-cell {
  appearance:none; position:relative; display:grid; place-items:center; min-width:0; width:100%; height:100%; min-height:0; margin:0; padding:0;
  color:#172e35; background:transparent; border:0; border-right:1px dotted #b0bbaa80; border-bottom:1px dotted #b0bbaa80;
  border-radius:0; box-shadow:none; font:750 clamp(.8rem,calc(53cqw / var(--ws-count)),1.6rem)/1 Portal,system-ui,sans-serif;
}
.ws-grid .ws-cell:disabled { opacity:1; color:var(--ws-ink); }
.ws-grid .ws-cell[aria-pressed="true"] { color:#fffbee; background:#28685e; box-shadow:inset 0 0 0 2px #123c38; border-radius:4px; }
.ws-grid .ws-cell:focus-visible { outline:3px solid #223d92; outline-offset:-3px; z-index:1; }
@media(hover:hover) {
  .ws-grid .ws-cell:not(:disabled):not([aria-pressed="true"]):hover { background:#5d8a7233; }
}
.ws-clues { margin-top:1.15rem; padding-left:clamp(9px,1.4vw,19px); border-left:2px solid #d8b1a1; min-width:0; }
.ws-clues h3 { margin:0 0 9px; font:800 1.02rem/1.15 var(--head,system-ui); }
.ws-words { display:grid; gap:0; list-style:none; padding:0; margin:0; }
.ws-words li { display:flex; gap:7px; align-items:center; min-width:0; min-height:28px; padding:3px 2px; border-bottom:1px solid #9aaf9938;
  font:740 clamp(.75rem,1vw,.92rem)/1.25 Portal,system-ui,sans-serif; letter-spacing:.04em; overflow-wrap:anywhere; }
.ws-check { flex:none; display:grid; place-items:center; height:.92em; width:.92em; color:#16594b; border:1.3px solid #97a898; border-radius:2px; font-size:1.12em; line-height:1; }
.ws-found .ws-check { border-color:#668977; background:#dcebd6; }
.ws-found .ws-check+span { text-decoration:line-through; text-decoration-color:#527765; color:#435e50; }
.ws-legend,.ws-instruction { margin:10px 0 0; color:#405d50; font-size:.79rem; line-height:1.4; }
.ws-legend b { display:block; color:var(--ws-green); font:750 1.05rem/1.1 system-ui; letter-spacing:.1em; }
.ws-cancel,.ws-zoom summary { min-height:44px; }
.ws-cancel { margin-top:6px; }
.ws-zoom { margin-top:1px; }
.ws-zoom summary { padding:4px; display:flex; align-items:center; justify-content:center; gap:5px; font-size:.79rem; font-weight:650; color:#2c5f50; text-decoration:underline; text-underline-offset:.16em; cursor:pointer; }
.ws-zoom summary::-webkit-details-marker { display:none; }
.ws-zoom summary span+span,.ws-zoom[open] summary span:first-child { display:none; }
.ws-zoom[open] summary span+span { display:inline; }
.ws-work:has(.ws-zoom[open]) .ws-frame { min-width:calc(1.25rem + 46px * var(--ws-count)); }
.ws-work:has(.ws-zoom[open]) .ws-grid { touch-action:pan-x pan-y pinch-zoom; }
@media(min-width:840px) and (min-height:540px) {
  .ws-frame { --ws-board-size:clamp(282px,calc(100svh - 396px),483px); }
  .play-room.is-expanded .ws-frame { --ws-board-size:clamp(335px,calc(100dvh - 267px),650px); }
  .play-room.is-expanded .ws-layout,.play-room.is-expanded .ws-heading { max-width:1010px; }
}
@media(max-width:650px) {
  [data-classic="wykreslanki"] .classic-table { padding:4px; border-radius:10px; }
  .ws-sheet { padding:7px; border-radius:6px; }
  .ws-layout { grid-template-columns:minmax(0,1fr); gap:0; }
  .ws-heading { padding:4px 2px 7px; margin-bottom:3px; }
  .ws-heading h2 { font-size:1.09rem; }
  .ws-clues { border-left:0; border-top:1px solid var(--ws-stitch); padding:9px 3px 3px; margin-top:0; }
  .ws-words { grid-template-columns:repeat(3,minmax(0,1fr)); column-gap:6px; }
  .ws-clues h3 { margin-bottom:3px; font-size:.95rem; }
  .ws-words li { font-size:.72rem; letter-spacing:.015em; min-height:28px; gap:4px; }
  .ws-legend { display:inline-flex; align-items:center; gap:5px; margin:6px 0 0; }
  .ws-instruction { margin:3px 0; }
}
@media (max-width:365px) { .ws-words { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(forced-colors:active) {
  .ws-grid,.ws-check,.ws-cell { border-color:CanvasText; }
  .ws-grid .ws-cell[aria-pressed="true"] { outline:3px solid Highlight; outline-offset:-3px; }
  .ws-traces line { stroke:GrayText; stroke-width:.22; }
}

/* Measure the first paper sheet against its actual column. On phones the
   word list sits below the letter square in the hydrated view. */
@media (max-width:650px) {
  .game-wykreslanki [data-classic="wykreslanki"] { container-type:inline-size; }
  .game-wykreslanki [data-board-load].loading-table {
    --ws-boot-space:460px;
    min-height:calc(100cqw + var(--ws-boot-space));
    grid-template-rows:94px auto 1fr;
  }
  .game-wykreslanki .loading-table-surface {
    padding:19px; border-color:#c6cec0; background:#f3f2e4;
  }
  .game-wykreslanki .loading-table-surface::after {
    content:""; display:block; aspect-ratio:1; border:1px solid #a5b5a7; border-radius:4px;
    background-color:#fffbed;
    background-image:linear-gradient(90deg,#d5ddc9 1px,transparent 1px),linear-gradient(#d5ddc9 1px,transparent 1px);
    background-size:12.5% 12.5%;
  }
}
.ws-heading { display:grid; grid-template-columns:minmax(0,1fr) auto auto; }
.ws-themes summary {
  display:flex; align-items:center; justify-content:center; gap:6px;
  min-height:44px; padding:4px 9px; font-weight:700; font-size:.87rem;
  color:#215649; background:#e6efe5; border-radius:9px; cursor:pointer;
}
.ws-themes summary::-webkit-details-marker { display:none; }
.ws-themes summary::after { content:""; width:6px; height:6px; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:translateY(-2px) rotate(45deg); }
.ws-themes[open] { grid-column:1/-1; }
.ws-themes[open] summary { justify-self:start; width:max-content; }
.ws-themes[open] summary::after { transform:translateY(2px) rotate(225deg); }
.ws-themes form { display:flex; gap:8px; align-items:end; margin-top:8px; }
.ws-themes label { display:grid; gap:3px; flex:1; min-width:0; font-size:.88rem; color:var(--ws-ink); }
.ws-themes select,.ws-themes button { min-height:44px; border-radius:8px; font-size:1rem; }
.ws-themes select { min-width:0; width:100%; color:var(--ws-ink); background:#fff; border:1px solid var(--ws-stitch); }
.ws-themes button { padding:6px 15px; color:white; background:#256759; border:1px solid #256759; }
@media (max-width:650px) {
  .ws-heading { grid-template-columns:minmax(0,1fr) auto; gap:2px 8px; }
  .ws-heading h2 { grid-column:1; }
  .ws-heading .ws-progress { grid-column:1; }
  .ws-heading .ws-themes:not([open]) { grid-column:2; grid-row:1 / 3; }
  .ws-words li { font-size:.82rem; }
}
@media (max-width:365px) {
  .game-wykreslanki [data-board-load].loading-table { --ws-boot-space:488px; }
}
