:root {
  color-scheme: light;
  --paper: #f8f5ec;
  --sheet: #fffdf6;
  --ink: #253e33;
  --muted: #526456;
  --line: #d6d8c9;
  --green: #2f5842;
  --serif: Georgia, "Times New Roman", serif;
  font: 100%/1.45 "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, select { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #a85217; outline-offset: 3px; }
.board-head, .clues-head, .result { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jump { display: none; }
h1, h2, h3, p { margin: 0; }
h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); letter-spacing: -.035em; }
.primary, .hint { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 9px; font-weight: 650; padding: 9px 17px; }
.primary { background: var(--green); border: 1px solid var(--green); color: white; }
.primary:hover { background: #1b4131; }
.primary span { font-size: 1.2em; }
.play-area { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(0, .86fr); gap: 20px; align-items: start; }
.sheet, .stats { background: var(--sheet); border: 1px solid var(--line); border-radius: 17px; }
.sheet { padding: clamp(16px, 2.3vw, 24px); }
.clock, .count { font-size: 0.9375rem; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.clock { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.board-panel { --size: 8; }
#board { container-type: inline-size; display: grid; grid-template-columns: repeat(var(--size), minmax(0, 1fr)); gap: 1px; background: #e3e6da; border: 1px solid #d5dccc; border-radius: 7px; overflow: hidden; touch-action: pinch-zoom; user-select: none; -webkit-user-select: none; margin-top: 15px; }
.cell { border: 0; padding: 0; margin: 0; border-radius: 0; background: #fffef8; color: #263e32; aspect-ratio: 1; font: 650 clamp(0.875rem, calc(54cqi / var(--size)), 2rem)/1 "Segoe UI", sans-serif; }
.cell.found { background: var(--found, #cee5c8); color: #243d30; }
.cell.hinted { background: #ffdf8d; box-shadow: inset 0 0 0 2px #966414; color: #493500; }
.cell.hint-direction { background: #f8ebba; box-shadow: inset 0 0 0 2px #a97c32; }
.cell.selected { background: #375f4c; color: white; box-shadow: inset 0 0 0 2px #214536; animation: none; }
@media (prefers-reduced-motion: no-preference) {
  .cell.hinted:not(.selected) { animation: hint-ring 1.7s ease-in-out infinite alternate; }
  @keyframes hint-ring { to { box-shadow: inset 0 0 0 4px #ae7b1a; } }
}
#clock-toggle { border: 1px solid var(--line); border-radius: 7px; background: var(--sheet); color: var(--green); min-height: 44px; padding: 5px 8px; font-size: .875rem; }
.cell:focus-visible { outline: 3px solid #8b500d; outline-offset: -3px; position: relative; }
#board-help, #clue-help, .message { font-size: 0.9375rem; }
#board-help { color: var(--muted); margin-top: 13px; }
.message { font-weight: 650; overflow-wrap: anywhere; margin-top: 6px; }
.message:empty { margin: 0; }
.count { border-radius: 99px; background: #edf1e6; color: #36513a; padding: 5px 12px; }
.track { height: 6px; background: #e6eadf; border-radius: 20px; margin-top: 13px; overflow: hidden; }
.track span { display: block; height: 100%; background: #6e9064; transition: width .18s ease-out; }
.mode { margin-top: 18px; display: inline-flex; gap: 3px; padding: 3px; background: #edf0e7; border: 1px solid #d7dfd1; border-radius: 9px; }
.mode button { border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 7px 13px; min-height: 39px; font-weight: 600; }
.mode button[aria-pressed=true] { border-color: #c4cfba; background: #fffef9; box-shadow: 0 1px 2px #21392b12; }
#clue-help { margin: 12px 0 9px; color: var(--muted); }
#clues { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; gap: 7px; }
.clue { display: flex; flex-wrap: wrap; align-content: center; justify-content: flex-start; align-items: center; gap: 5px 8px; border: 1px solid var(--line); border-radius: 9px; background: #faf9f1; padding: 6px 9px; min-height: 47px; width: 100%; text-align: left; }
button.clue:hover { border-color: #9caf93; background: #f4f6ea; }
.clue.done { background: #e8f0e1; border-color: #c2d2b7; }
.clue .icon { font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 1.4375rem; line-height: 1.15; }
.clue .art { width: 43px; height: 43px; border-radius: 5px; object-fit: cover; }
.clue .word { font-size: 0.875rem; font-weight: 650; max-width: 100%; overflow-wrap: anywhere; }
.clue .length { color: var(--muted); font-size: 0.875rem; }
.clue .tick { margin-inline-start: auto; color: #37603b; font-weight: 750; }
.flag { width: 29px; height: 20px; border-radius: 2px; outline: 1px solid #24392b24; }
.hint { width: 100%; margin-top: 15px; color: var(--green); background: #f2f4e8; border: 1px solid #c7d1bc; }
.hint:hover { background: #e5eddc; }
button:disabled { opacity: .55; cursor: default; }
.stats { margin-top: 18px; padding: 0 20px; }
.stats summary { padding: 13px 0; font-weight: 650; }
.stats dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 2px 0 15px; }
.stats dl div { background: #f2f4ec; border-radius: 8px; padding: 9px 12px; }
.stats dt { font-size: 0.875rem; color: var(--muted); }
.stats dd { margin: 3px 0 0; font-weight: 650; font-size: 1.25rem; }
.stats h3 { font-size: 1.375rem; }
#awards { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 9px 0 15px; }
#awards li { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 0.875rem; }
#awards .earned { background: #f6e5b4; border-color: #d7bd72; }
.result { background: #e5efdf; border: 1px solid #b8c9ae; border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.result p { margin-top: 6px; }
@media (min-width: 721px) and (max-height: 830px) {
  .sheet { padding: 17px; }
  .board-panel { --board-width: min(100%, clamp(350px, calc(100vh - 305px), 520px)); }
  .board-head, #board, #board-help, .message { width: var(--board-width); margin-inline: auto; }
  #board { margin-top: 12px; }
}
@media (max-width: 720px) {
  .board-head { flex-wrap: wrap; }
  .play-area { grid-template-columns: 1fr; gap: 13px; }
  .sheet { padding: 15px; }
  .jump { display: inline-flex; min-height: 36px; align-items: center; color: var(--green); font-weight: 600; margin-top: 4px; }
  .board-panel .jump + #board { margin-top: 3px; }
  .result { align-items: start; flex-direction: column; }
  #clues { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.625rem), 1fr)); }
  .stats dl { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .track span { transition: none; } }

/* Verzia 2.3: väčšie tlačidlá a čitateľnejšie drobné texty. */
.mode button, .jump { min-height: 44px; }
.clue .word, .clue .length { font-size: 0.9375rem; }
.clock, .count, #board-help, #clue-help, .message { font-size: 1rem; }
/* Vysoký tablet na výšku: mriežka na celú šírku, hľadané slová pod ňou. */
@media (min-width: 721px) and (orientation: portrait) and (min-height: 1100px) {
  .play-area { grid-template-columns: 1fr; gap: 12px; }
  .board-panel { --board-width: min(100%, calc(100vh - 690px)); }
  @supports (height: 1dvh) { .board-panel { --board-width: min(100%, calc(100dvh - 690px)); } }
  .board-head, #board, #board-help, .message { width: var(--board-width); margin-inline: auto; }
  .cell { font-size: clamp(1rem, calc(54cqi / var(--size)), 2.75rem); }
  #clues { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Verzia 2.5 – nízke okno na šírku: hľadané slová v troch stĺpcoch, aby sa zmestili vedľa mriežky. */
@media (min-width: 721px) and (orientation: landscape) and (max-height: 700px) {
  #clues { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .mode { margin-top: 10px; }
  #clue-help { margin: 6px 0; }
  .hint { margin-top: 8px; }
  .board-panel { --board-width: min(100%, clamp(330px, calc(100vh - 262px), 520px)); }
}
