/* Oslí sudoku: jedna scéna, shodný výřez obou témat, společné základní CSS. */
html { background: #080d1d; }
body[data-game="sudoku"] {
  --scene-image: url("assets/sudoku-bg-wizard.opt12.webp");
  background: linear-gradient(rgba(8,13,29,.25),rgba(8,13,29,.25)), var(--scene-image) center / cover no-repeat;
}
body[data-symbol-theme="gems"],
body[data-symbol-theme="rings"] { --scene-image: url("assets/sudoku-bg-crystals.opt12.webp"); }
body[data-game="sudoku"] #game-page { isolation:isolate; background:transparent; }
body[data-game="sudoku"] #game-page::before,
body[data-game="sudoku"] #game-page::after { content:none; }
.sudoku-layout {
  position:relative; z-index:2; width:min(1680px,100%); height:100%; margin:0 auto;
  padding:8px 18px; display:grid;
  grid-template-columns:clamp(300px,27vw,450px) minmax(0,610px) minmax(230px,255px);
  gap:clamp(12px,1.4vw,22px); justify-content:center; align-items:center;
}
.sudoku-scene-space { min-width:0; min-height:1px; align-self:stretch; display:flex; justify-content:flex-start; align-items:flex-start; padding-top:clamp(5px,2vh,26px); }
.sudoku-quick-panel {
  width:min(240px,100%); box-sizing:border-box; display:flex; flex-direction:column; align-items:stretch; gap:8px;
  padding:16px 15px; border:1px solid rgba(238,199,121,.60); border-radius:16px;
  background:linear-gradient(145deg,rgba(12,30,58,.91),rgba(6,19,42,.89));
  box-shadow:0 13px 28px #0008,inset 0 1px 0 #ffffff22;
  color:#f9f4e7;
}
.sudoku-quick-overline { font-size:10px; font-weight:900; letter-spacing:.1em; color:#f3cc78; }
.sudoku-quick-status { font-size:17px; font-weight:900; color:#fff4d7; }
.sudoku-quick-progress { font-size:12px; color:#bbd1ef; margin-top:-5px; margin-bottom:5px; }
.sudoku-quick-button {
  display:flex; align-items:center; justify-content:center; gap:7px; min-height:40px;
  width:100%; box-sizing:border-box; padding:8px 10px; border:1px solid #6686b4;
  border-radius:10px; font:inherit; font-size:13px; font-weight:800; text-decoration:none;
  color:#f5f8ff; background:linear-gradient(180deg,#27517d,#18365e); cursor:pointer;
  box-shadow:inset 0 1px 0 #ffffff22;
}
.sudoku-quick-button:hover:not(:disabled) { filter:brightness(1.15); border-color:#f9d480; }
.sudoku-quick-button:focus-visible { outline:3px solid #ffe29a; outline-offset:3px; }
.sudoku-quick-button:disabled { opacity:.55; cursor:default; }
.sudoku-continue { color:#142740; border-color:#ffdf9b; background:linear-gradient(180deg,#ffe1a2,#e1aa52); }
.sudoku-restart { color:#ffe8ae; border-color:#b98f4b; }
.sudoku-exit { background:linear-gradient(180deg,#28405e,#152b47); }
/* DESKA */
.sudoku-board-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sudoku-board {
  position: relative;
  width: min(100%, calc(100dvh - var(--footer-h) - env(safe-area-inset-top, 0px) - 48px));
  max-width: 610px;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  grid-template-rows: repeat(5, minmax(0,1fr));
  gap: 4px;
  padding: 10px;
  border: 2px solid #f2cc6a;
  border-radius: 22px;
  background: linear-gradient(135deg, #f3c85d 0%, #8b4d24 18%, #3c2119 49%, #995a27 78%, #f1c45c 100%);
  box-shadow:
    0 18px 40px rgba(0,0,0,.47),
    0 0 0 5px rgba(44,26,20,.88),
    0 0 32px rgba(255,205,88,.11),
    inset 0 1px 0 rgba(255,255,255,.32);
}

.sudoku-board::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 5;
  pointer-events: none;
  border: 1px solid rgba(255,232,166,.33);
  border-radius: 16px;
}

.sudoku-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5%;
  border: 1px solid #bea06d;
  border-radius: 9px;
  background:
    radial-gradient(circle at 32% 22%, rgba(255,255,255,.82), transparent 27%),
    linear-gradient(145deg, #fff5dc, #ead9ba);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.42), inset 0 -8px 16px rgba(111,79,41,.08);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
}

.sudoku-cell.fixed {
  cursor: default;
  border-color: #34558c;
  background: radial-gradient(circle at 30% 20%, rgba(96,157,255,.18), transparent 30%), linear-gradient(145deg, #183765, #10284f 55%, #0b1d3c);
  box-shadow: inset 0 0 0 1px rgba(128,181,255,.12), inset 0 -10px 18px rgba(0,0,0,.22);
}

.sudoku-cell:not(.fixed):hover {
  transform: translateY(-1px);
  background:
    radial-gradient(circle at 32% 22%, rgba(255,255,255,.95), transparent 29%),
    linear-gradient(145deg, #fffbed, #f4e4bd);
  box-shadow: 0 0 0 2px rgba(255,205,88,.45), 0 5px 12px rgba(0,0,0,.14);
}

.sudoku-cell:focus-visible { outline: 3px solid #ffdb6d; outline-offset: -3px; }

.sudoku-cell img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 5px 5px rgba(0,0,0,.19));
}

.sudoku-cell.fixed img { width: 88%; height: 88%; filter: drop-shadow(0 4px 4px rgba(0,0,0,.28)); }

.empty-dot {
  width: 11px;
  height: 11px;
  border: 2px solid rgba(103,78,45,.22);
  border-radius: 50%;
  background: rgba(103,78,45,.07);
}

.sudoku-cell.bad {
  animation: sudoku-shake .24s ease-in-out 1;
  box-shadow: inset 0 0 0 4px #dc444c, 0 0 15px rgba(220,68,76,.38);
}

.sudoku-cell.bad::after {
  content: "!";
  position: absolute;
  right: 5px;
  top: 5px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid #ffd0d3;
  border-radius: 50%;
  background: #b72731;
  color: white;
  font-size: 14px;
  font-weight: 900;
}

.sudoku-cell.hinted::after {
  content: "✦";
  position: absolute;
  right: 5px;
  bottom: 4px;
  color: #ffd95c;
  font-size: 20px;
  text-shadow: 0 0 8px rgba(255,214,72,.8);
  animation: hint-spark .7s ease-out 1;
}

@keyframes sudoku-shake { 0%,100% { transform: translateX(0); } 35% { transform: translateX(-3px); } 70% { transform: translateX(3px); } }
@keyframes hint-spark { 0% { opacity: 0; transform: scale(.4) rotate(-20deg); } 55% { opacity: 1; transform: scale(1.3) rotate(12deg); } 100% { opacity: .85; transform: scale(1); } }

.sudoku-board.completed {
  border-color: #ffe389;
  box-shadow: 0 18px 40px rgba(0,0,0,.47), 0 0 0 5px rgba(44,26,20,.88), 0 0 36px rgba(255,218,96,.35);
}

#sudoku-status {
  min-height: 28px;
  margin-top: 5px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  background: rgba(8,10,18,.38);
  color: #e8ebf2;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  max-width: 650px;
  box-shadow: 0 5px 16px rgba(0,0,0,.20);
}
#sudoku-status.ok { color: #ffe07a; border-color: rgba(255,218,92,.22); }
#sudoku-status.bad { color: #ffb4ad; border-color: rgba(255,104,104,.20); }

/* PRAVÝ PANEL */
.sudoku-options {
  position: relative;
  padding: 13px 11px 12px;
  border: 1px solid rgba(94,145,225,.50);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12,29,61,.90), rgba(6,16,37,.90));
  box-shadow: 0 16px 34px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.06), 0 0 0 3px rgba(69,42,23,.28);
}

.sudoku-options::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(255,205,88,.12);
  border-radius: 12px;
}

.sudoku-options h2 {
  position: relative;
  margin: 0 0 10px;
  color: #ffdc72;
  font-size: 13px;
  letter-spacing: .7px;
  text-align: center;
}

.sudoku-palette {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 7px;
}

.sudoku-pick {
  position: relative;
  min-height: 78px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.015));
  color: #fff;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.sudoku-pick:hover:not(:disabled) { background: rgba(255,205,88,.08); border-color: rgba(255,205,88,.38); }
.sudoku-pick.selected { border: 2px solid #ffd65c; padding: 3px; background: rgba(255,205,88,.10); box-shadow: 0 0 15px rgba(255,205,88,.18), inset 0 0 0 1px rgba(255,255,255,.05); }
.sudoku-pick:disabled { opacity: .48; cursor: default; }
.sudoku-pick img { width: 58px; height: 58px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
.sudoku-pick .potion-name { display: none; }

.potion-count {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 31px;
  height: 23px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,231,155,.72);
  border-radius: 999px;
  background: #10284f;
  color: #f4f8ff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(0,0,0,.35);
}
.potion-count.zero { background: #334235; color: #c9f7c6; border-color: #6a9a69; }

.sudoku-actions { position: relative; display: grid; gap: 7px; margin-top: 10px; }

.game-action {
  position: relative;
  min-height: 46px;
  width: 100%;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(43,53,73,.95), rgba(24,31,49,.95));
  color: #edf2ff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 4px 10px rgba(0,0,0,.18);
}
.game-action:hover:not(:disabled) { filter: brightness(1.08); }
.game-action:disabled { opacity: .45; cursor: default; filter: grayscale(.45); }
.game-action[aria-pressed="true"] { border-color: #ffd65c; background: linear-gradient(180deg, #5c4b28, #2d291f); color: #ffe28b; }
.action-icon { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.book-icon { width: 39px; height: 39px; }

.hint-action { justify-content: flex-start; padding-right: 45px; color: #ffe18a; border-color: rgba(255,205,88,.32); }
.hint-count {
  position: absolute;
  right: 8px;
  min-width: 34px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #6a3b1c;
  border: 1px solid #d8a558;
  color: #fff1c0;
  font-size: 12px;
}
.check-action { background: linear-gradient(180deg, #3f9e3d, #176b25); border-color: #8ddb6f; color: white; }
.check-mark { font-size: 22px; font-weight: 900; }

.hint-note {
  position: relative;
  margin: 9px 2px 0;
  color: #aeb8c8;
  font-size: 10.5px;
  line-height: 1.35;
  text-align: center;
}

.sudoku-top-stats { display: none; }

/* Výherní popup */
.sudoku-result-dialog {
  max-width: 390px;
}
.sudoku-result-dialog #dialog-title {
  text-align: center;
  color: #ffdc72;
}
.result-reward {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 6px 4px 2px;
}
.result-reward strong {
  color: #ffd65f;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.05;
}
.result-reward span {
  color: #d9dfeb;
  font-size: 13px;
}
.result-coin {
  width: 118px;
  height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.35));
  animation: coin-pop .42s ease-out 1;
}
.result-book {
  width: 95px;
  height: 95px;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(0,0,0,.3));
}
.result-big-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #236f36;
  color: white;
  font-size: 42px;
  font-weight: 900;
}
.result-no-coin strong { font-size: 23px; }
.result-silver strong { color:#f5d597; font-size:22px; text-align:center; }
.result-silver-icon { width:98px; height:98px; object-fit:contain; filter: drop-shadow(0 6px 10px #0008); }
@keyframes coin-pop {
  0% { opacity: 0; transform: scale(.55) rotate(-12deg); }
  70% { opacity: 1; transform: scale(1.08) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}


.erase-pick { background:linear-gradient(180deg,rgba(56,95,151,.20),rgba(21,45,83,.20)); border-color:rgba(111,159,229,.35); }
.erase-badge { display:none !important; }
.erase-pick img { width:62px; height:62px; }
/* Nastavení hry přesunuto z patičky přímo na pravý spodní okraj hrací plochy. */
body[data-game="sudoku"] #new-game-btn,
body[data-game="sudoku"] #settings-btn,
body[data-game="sudoku"] #settings-popup { display:none !important; }

.sudoku-settings-trigger {
  position: fixed;
  z-index: 30;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--footer-h, 75px) + 14px + env(safe-area-inset-bottom, 0px));
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #f7e6b3;
  border: 2px solid #d9b269;
  border-radius: 50%;
  background: linear-gradient(145deg, #1e4678, #10244a 68%, #091a36);
  box-shadow: 0 8px 20px #0009, inset 0 1px 0 #ffffff30, 0 0 0 3px #14213899;
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease;
}
.sudoku-settings-trigger:hover { transform: rotate(24deg); filter: brightness(1.15); }
.sudoku-settings-trigger:focus-visible { outline: 3px solid #ffde83; outline-offset: 3px; }
.sudoku-settings-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  box-sizing: border-box;
  width: min(480px, calc(100vw - 28px));
  max-width: none;
  max-height: min(720px, calc(100dvh - 28px));
  overflow-y: auto;
  padding: 0;
  border: 2px solid #dfbe7d;
  border-radius: 21px;
  color: #f1f6ff;
  background: linear-gradient(165deg,#17375e,#0e2343 55%,#08172e);
  box-shadow: 0 25px 70px #000b, inset 0 1px 0 #ffffff25;
  font: inherit;
}
.sudoku-settings-dialog::backdrop { background: rgba(2,8,19,.78); backdrop-filter: blur(4px); }
.sudoku-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 21px 22px 16px;
  border-bottom: 1px solid #ffffff24;
  background: linear-gradient(120deg,#1a4778,#132e56);
}
.sudoku-settings-overline { font-size: 10px; font-weight: 800; letter-spacing: .13em; color: #a9c6e5; }
.sudoku-settings-head h2 { margin: 6px 0 0; font-size: 24px; color: #ffde92; line-height: 1.18; }
.sudoku-settings-close {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid #ffffff50;
  border-radius: 50%;
  background: #102c53;
  color: white;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
.sudoku-settings-close:hover { background:#265385; }
.sudoku-settings-content { padding: 21px 22px 24px; }
.sudoku-settings-group-label { margin: 0 0 7px; color: #f8d989; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.sudoku-settings-description { margin: 0 0 15px; color: #b7cce5; font-size: 12px; line-height: 1.45; }
.sudoku-theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.sudoku-settings-dialog .theme-choice {
  min-width: 0;
  min-height: 129px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 5px;
  border: 1px solid #426184;
  border-radius: 13px;
  background: linear-gradient(170deg, #1a3c69, #112748);
  color: #f4f7ff;
  cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 800; line-height: 1.2;
  box-shadow: inset 0 1px 0 #ffffff16;
}
.sudoku-settings-dialog .theme-choice:hover { border-color: #e7c27e; }
.sudoku-settings-dialog .theme-choice.active {
  border: 2px solid #ffd27c;
  padding: 9px 4px;
  background: linear-gradient(170deg,#2c5483,#12315b);
  box-shadow: 0 0 16px #e0ab3e30, inset 0 0 0 1px #ffffff14;
}
.sudoku-settings-dialog .theme-choice img { width: 70px; height: 70px; object-fit: contain; filter: drop-shadow(0 3px 5px #0008); }
.sudoku-settings-dialog .theme-choice span { font-size: 12px; }
.sudoku-settings-divider { margin: 22px 0 19px; border-top: 1px solid #ffffff27; }
.sudoku-settings-row {
  width: 100%;
  min-height: 51px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  margin-top: 8px;
  border: 1px solid #476181;
  border-radius: 11px;
  background: #16365d;
  color: #f1f6ff;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.sudoku-settings-row:hover { background: #23507e; }
.sudoku-settings-row-label { font-size: 13px; font-weight: 800; }
.sudoku-settings-status { font-size: 12px; font-weight: 800; color: #b8ebbf; }
.sudoku-settings-row[aria-pressed="false"] .sudoku-settings-status { color: #ffb6b6; }
.sudoku-settings-new-game { border-color:#bf9b58; color:#ffe0a3; }
@media (max-width: 620px) {
 .sudoku-settings-trigger { width:46px; height:46px; right:10px; bottom:calc(var(--footer-h, 75px) + 10px + env(safe-area-inset-bottom, 0px)); }
 .sudoku-settings-trigger svg { width:25px; height:25px; }
 .sudoku-settings-head { padding:15px 16px 13px; }
 .sudoku-settings-content { padding:16px; }
 .sudoku-settings-dialog .theme-choice { min-height:105px; }
 .sudoku-settings-dialog .theme-choice img { width:57px; height:57px; }
}
@media (max-width:1180px) and (orientation:landscape) {
  .sudoku-layout { grid-template-columns:minmax(180px,26vw) minmax(0,1fr) 205px; gap:10px; padding:7px 10px; }
  .sudoku-quick-panel { width:min(215px,100%); padding:12px; gap:6px; }
  .sudoku-quick-button { min-height:34px; font-size:12px; }
  .sudoku-quick-status { font-size:15px; }
  .sudoku-board { max-width:570px; }
  .sudoku-pick { min-height:62px; }
  .sudoku-pick img { width:46px; height:46px; }
  .game-action { min-height:39px; font-size:11px; }
  .book-icon { width:32px; height:32px; }
  .hint-note { font-size:9px; }
}
@media (max-height:650px) and (orientation:landscape) {
  .sudoku-layout { grid-template-columns:minmax(90px,22vw) minmax(0,1fr) 190px; padding:4px 8px; gap:8px; }
  .sudoku-quick-panel { padding:9px; gap:5px; }
  .sudoku-quick-overline { font-size:9px; }
  .sudoku-quick-status { font-size:13px; }
  .sudoku-quick-progress { font-size:10px; margin-bottom:1px; }
  .sudoku-quick-button { min-height:30px; padding:4px; font-size:11px; }
  .sudoku-board { width:min(100%,calc(100dvh - var(--footer-h) - 40px)); max-width:540px; gap:3px; padding:7px; border-radius:17px; }
  .sudoku-options { padding:8px; }
  .sudoku-options h2 { margin-bottom:4px; font-size:10px; }
  .sudoku-palette { gap:4px; }
  .sudoku-pick { min-height:47px; border-radius:8px; }
  .sudoku-pick img { width:38px; height:38px; }
  .potion-count,.erase-badge { min-width:27px; height:19px; font-size:9px; right:2px; bottom:2px; }
  .sudoku-actions { gap:4px; margin-top:4px; }
  .game-action { min-height:33px; height:33px; font-size:10px; padding:2px 6px; }
  .action-icon,.book-icon { width:27px; height:27px; }
  .hint-count { min-width:29px; height:21px; font-size:10px; right:5px; }
  .hint-note { display:none; }
  #sudoku-status { min-height:24px; margin-top:3px; padding:3px 8px; font-size:10px; }
}
@media (orientation:portrait) {
  body[data-game="sudoku"] { background-position:38% center; }
  .sudoku-layout { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) auto; gap:6px; padding:8px; }
  .sudoku-scene-space { display:flex; width:100%; min-height:0; padding-top:0; justify-content:center; }
  .sudoku-quick-panel { width:min(610px,100%); flex-direction:row; flex-wrap:wrap; align-items:center; gap:5px; padding:7px; }
  .sudoku-quick-overline { display:none; }
  .sudoku-quick-status { flex:1 1 44%; font-size:12px; padding-left:4px; }
  .sudoku-quick-progress { flex:1 1 44%; text-align:right; font-size:10px; margin:0; padding-right:4px; }
  .sudoku-quick-button { flex:1 1 0; min-width:0; min-height:32px; font-size:11px; padding:4px 5px; }
  .sudoku-board { width:min(100%,calc(100dvh - var(--footer-h) - env(safe-area-inset-top,0px) - 170px)); }
  .sudoku-options { width:100%; max-width:610px; margin:0 auto; padding:7px 8px; }
  .sudoku-options h2,.hint-note { display:none; }
  .sudoku-palette { grid-template-columns:repeat(6,minmax(0,1fr)); gap:4px; }
  .sudoku-pick { min-height:51px; }
  .sudoku-pick img { width:40px; height:40px; max-width:100%; }
  .potion-count,.erase-badge { min-width:25px; height:18px; padding:0 3px; font-size:8px; right:1px; bottom:1px; }
  .sudoku-actions { grid-template-columns:1fr 1fr; gap:5px; margin-top:5px; }
  .game-action { min-height:37px; height:37px; padding:2px 5px; font-size:11px; }
  .hint-action { padding-right:40px; }
  .action-icon,.book-icon { width:30px; height:30px; }
  #sudoku-status { min-height:28px; margin-top:4px; font-size:10px; }
}
@media (max-width:640px) and (orientation:portrait) {
  .sudoku-board { gap:2px; padding:4px; border-radius:12px; }
  .sudoku-cell { padding:4%; border-radius:5px; }
}
@media (prefers-reduced-motion:reduce) {
  .sudoku-cell,.sudoku-cell.bad,.sudoku-cell.hinted::after,.result-coin { animation:none; transition:none; }
}

/* Rozpoznatelná prázdná buňka po stisknutí Pokračovat. */
.sudoku-cell.continue-target { outline:4px solid #ffda68; outline-offset:-5px; animation:sudoku-continue-pulse .75s ease-in-out 2; }
@keyframes sudoku-continue-pulse { 0%,100% {box-shadow:inset 0 0 0 2px #f6d673;} 50% {box-shadow:inset 0 0 0 6px #ffd66c,0 0 18px #ffeb7f88;} }
@media (prefers-reduced-motion:reduce) { .sudoku-cell.continue-target { animation:none; } }


/* ==============================================================
   OSLÍ SUDOKU • UČESANÉ OVLÁDÁNÍ (verze 3)
   Jediná scéna, jeden postup, jeden panel odměny.
   ============================================================= */
.sudoku-layout { grid-template-columns:clamp(240px,23vw,325px) minmax(0,610px) minmax(232px,260px); gap:clamp(12px,1.55vw,24px); }
.sudoku-quick-panel { width:min(265px,100%); padding:18px 16px 15px; gap:0; border-color:rgba(235,187,99,.58); border-radius:18px; background:linear-gradient(150deg,rgba(11,30,61,.94),rgba(7,21,45,.93)); backdrop-filter:blur(8px); }
.sudoku-quick-overline { font-size:10px; letter-spacing:.08em; font-weight:900; }
.quick-star { color:#ffe3a2; font-size:15px; margin-right:3px; }
.sudoku-quick-panel h1 { margin:8px 0 12px; font-size:clamp(20px,1.7vw,25px); line-height:1.09; letter-spacing:-.025em; color:#fff4da; font-weight:900; }
.sudoku-quick-panel h1 span { color:#e4b869; font-size:.69em; white-space:nowrap; }
.sudoku-quick-status { font-size:13px; letter-spacing:.01em; color:#c9ddf6; margin-bottom:7px; font-weight:700; }
.sudoku-quick-progress-row { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:11px; color:#c2d4ea; }
.sudoku-quick-progress { margin:0; }
.sudoku-quick-progress-row strong { color:#ffe19a; font-size:12px; font-variant-numeric:tabular-nums; }
.sudoku-progress-track { height:7px; margin-top:7px; background:rgba(5,14,29,.9); box-shadow:inset 0 1px 2px #0009; border:1px solid #38557a; overflow:hidden; border-radius:100px; }
.sudoku-progress-track span { display:block; width:0; height:100%; border-radius:100px; background:linear-gradient(90deg,#c2813b,#ffe5a3); box-shadow:0 0 9px #f5c97c77; transition:width .2s ease; }
.sudoku-quick-divider { border-top:1px solid rgba(226,202,151,.23); margin:15px 0 11px; }
.sudoku-step-label { margin:0 0 7px; font-size:10px; font-weight:900; letter-spacing:.13em; color:#f2c978; }
.sudoku-quick-help { margin:0 0 5px; color:#cfdef0; font-size:11px; line-height:1.35; }
.sudoku-quick-actions { display:grid; gap:7px; margin-top:15px; }
.sudoku-quick-button { min-height:42px; font-size:12px; border-radius:10px; padding:8px; }
.sudoku-restart { color:#ffdea1; background:linear-gradient(180deg,#28527d,#17395e); border-color:#9d8f70; }
.sudoku-exit { color:#d5e4f5; background:linear-gradient(180deg,#233c60,#142944); }
.sudoku-auto-save { margin-top:11px; text-align:center; color:#9ab4d1; font-size:10px; }
.sudoku-rule-alert { margin-top:9px; padding:8px; border:1px solid #dc9965; border-radius:8px; background:rgba(120,38,38,.5); color:#ffcab2; font-size:11px; line-height:1.3; }
.sudoku-rule-alert[hidden] { display:none; }
.sudoku-board-caption { width:min(100%,610px); display:flex; align-items:center; justify-content:space-between; padding:0 4px 8px; font-size:10px; font-weight:800; letter-spacing:.07em; color:#e6d2a1; text-shadow:0 2px 5px #000c; }
.sudoku-board-caption span + span { font-weight:600; letter-spacing:0; color:#c0d4ea; }
.sudoku-board { width:min(100%,calc(100dvh - var(--footer-h) - env(safe-area-inset-top,0px) - 80px)); }
.sudoku-cell.conflict:not(.fixed) { border:2px solid #ed744b; padding:calc(5% - 1px); box-shadow:inset 0 0 0 2px rgba(209,66,46,.6),0 0 11px rgba(246,100,54,.35); }
.sudoku-cell.conflict:not(.fixed)::before { content:'!'; position:absolute; top:4px; right:5px; display:grid; place-items:center; width:16px; height:16px; border-radius:50%; background:#ba3e27; color:#fff; font-size:11px; font-weight:900; z-index:1; }
.sudoku-options { padding:15px 12px 12px; backdrop-filter:blur(7px); }
.sudoku-palette-head { position:relative; margin-bottom:11px; text-align:center; }
.sudoku-palette-head h2 { margin:0 0 4px; font-size:13px; letter-spacing:.055em; }
.sudoku-palette-head p { margin:0; font-size:11px; color:#b5c8df; }
.sudoku-palette { gap:7px; }
.sudoku-pick { min-height:75px; background:linear-gradient(150deg,rgba(43,72,116,.45),rgba(16,32,62,.54)); }
.sudoku-pick img { width:55px; height:55px; }
.sudoku-pick.selected { background:linear-gradient(160deg,rgba(247,192,76,.16),rgba(50,64,89,.64)); }
.sudoku-pick:focus-visible { outline:3px solid #ffdb76; outline-offset:2px; }
.sudoku-pick:disabled { opacity:.55; }
.sudoku-pick.erase-pick { background:linear-gradient(160deg,rgba(89,42,48,.44),rgba(31,31,52,.55)); }
.sudoku-pick.erase-pick.selected { background:rgba(155,51,48,.30); border-color:#fba6a0; }
.sudoku-pick.erase-pick img { width:52px; height:52px; margin-top:-6px; }
.erase-name { position:absolute; bottom:5px; left:0; right:0; text-align:center; font-size:9px; color:#ffcab8; font-weight:800; }
.potion-count { min-width:29px; height:20px; font-size:10px; border-color:#b5c7e3; background:#173657; }
.sudoku-selection-note { display:flex; gap:6px; align-items:center; justify-content:center; min-height:31px; margin:10px 0 3px; padding:5px 4px; border-top:1px solid rgba(209,189,142,.20); font-size:10px; line-height:1.2; color:#afc6e4; text-align:center; }
.sudoku-selection-note strong { color:#ffe1a1; font-size:11px; }
.sudoku-actions { margin-top:3px; gap:8px; }
.game-action { min-height:45px; }
.hint-action { background:linear-gradient(180deg,#2f4058,#1b2a42); color:#ead49b; border-color:rgba(228,195,126,.4); }
.hint-count { right:7px; }
.sudoku-reward-info { margin-top:11px; padding:10px 9px; border:1px solid rgba(211,172,93,.38); border-radius:10px; background:rgba(4,15,30,.59); text-align:center; display:flex; flex-direction:column; align-items:center; gap:4px; }
.reward-kicker { color:#acbad1; font-size:9px; font-weight:900; letter-spacing:.08em; }
.sudoku-reward-info strong { color:#ffe09a; font-size:14px; line-height:1.2; }
.sudoku-reward-info small { color:#c3d1e3; font-size:10px; line-height:1.3; }
#sudoku-status { max-width:610px; font-size:12px; min-height:29px; margin-top:9px; border-radius:11px; background:rgba(6,19,41,.77); border-color:rgba(160,187,228,.28); }
.sudoku-result-actions { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:15px; }
.sudoku-result-actions button { min-height:41px; padding:9px 16px; border-radius:9px; font:inherit; font-size:13px; font-weight:800; cursor:pointer; }
.sudoku-result-actions .result-next { background:linear-gradient(180deg,#eccc89,#b98537); color:#142842; border:1px solid #ffe7ab; }
.sudoku-result-actions .result-ok { background:#233f62; color:#e4edf8; border:1px solid #6d8bad; }
.sudoku-settings-dialog .theme-choice:focus-visible, .sudoku-settings-row:focus-visible, .sudoku-settings-close:focus-visible { outline:3px solid #ffdc8b; outline-offset:2px; }
@media (max-width:1180px) and (orientation:landscape) {
  .sudoku-layout { grid-template-columns:minmax(172px,23vw) minmax(0,1fr) minmax(187px,205px); gap:10px; }
  .sudoku-quick-panel { width:100%; padding:11px 10px; }
  .sudoku-quick-panel h1 { font-size:19px; }
  .sudoku-quick-help { font-size:10px; }
  .sudoku-pick { min-height:64px; }
  .sudoku-pick img { width:48px; height:48px; }
  .sudoku-reward-info { padding:8px 5px; }
  .sudoku-reward-info strong { font-size:12px; }
}
@media (max-height:735px) and (orientation:landscape) {
  .sudoku-quick-panel h1 { font-size:18px; margin:5px 0 7px; }
  .sudoku-quick-divider { margin:7px 0; }
  .sudoku-quick-help { margin-bottom:2px; }
  .sudoku-quick-actions { margin-top:9px; gap:5px; }
  .sudoku-quick-button { min-height:32px; padding:4px; }
  .sudoku-auto-save { margin-top:6px; }
  .sudoku-board-caption { padding-bottom:4px; }
  .sudoku-board { width:min(100%,calc(100dvh - var(--footer-h) - 75px)); }
  .sudoku-options { padding:9px; }
  .sudoku-palette-head { margin-bottom:6px; }
  .sudoku-pick { min-height:51px; }
  .sudoku-pick img { width:42px; height:42px; }
  .sudoku-pick.erase-pick img { width:38px; height:38px; }
  .sudoku-selection-note { margin:4px 0; padding:3px; min-height:24px; }
  .game-action { min-height:35px; height:35px; }
  .sudoku-reward-info { margin-top:6px; padding:7px 5px; }
  .sudoku-reward-info small { font-size:9px; }
  #sudoku-status { margin-top:4px; padding:5px 7px; font-size:10px; }
}
@media (orientation:portrait) {
  body[data-game="sudoku"] #game-page { overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; }
  .sudoku-layout { display:flex; flex-direction:column; justify-content:flex-start; gap:8px; padding:8px 9px 65px; height:auto; min-height:100%; }
  .sudoku-scene-space { width:100%; justify-content:center; order:0; }
  .sudoku-quick-panel { width:min(610px,100%); padding:10px 12px; display:grid; grid-template-columns:1fr auto; align-items:center; gap:4px 8px; }
  .sudoku-quick-overline,.sudoku-quick-divider,.sudoku-step-label,.sudoku-quick-help,.sudoku-auto-save { display:none; }
  .sudoku-quick-panel h1 { grid-column:1/-1; font-size:18px; margin:0; }
  .sudoku-quick-status { grid-column:1; font-size:11px; margin:0; }
  .sudoku-quick-progress-row { grid-column:2; margin:0; font-size:10px; }
  .sudoku-progress-track { grid-column:1/-1; margin:3px 0; }
  .sudoku-rule-alert { grid-column:1/-1; margin:4px 0; }
  .sudoku-quick-actions { grid-column:1/-1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin:5px 0 0; }
  .sudoku-quick-button { font-size:10px; min-height:36px; padding:5px 2px; }
  .sudoku-board-column { width:100%; order:1; }
  .sudoku-board-caption { max-width:560px; padding-bottom:5px; }
  .sudoku-board { width:min(100%,560px); max-width:560px; }
  #sudoku-status { width:min(100%,560px); }
  .sudoku-options { order:2; width:min(100%,560px); max-width:560px; margin:0 auto; padding:9px; }
  .sudoku-palette-head { display:block; margin-bottom:7px; }
  .sudoku-palette-head h2 { font-size:11px; margin-bottom:2px; }
  .sudoku-palette-head p { font-size:10px; }
  .sudoku-palette { grid-template-columns:repeat(6,minmax(0,1fr)); gap:4px; }
  .sudoku-pick { min-height:53px; border-radius:8px; }
  .sudoku-pick img { width:43px; height:43px; max-width:100%; }
  .sudoku-pick.erase-pick img { width:39px; height:39px; max-width:100%; }
  .sudoku-selection-note { margin:6px 0 3px; }
  .sudoku-actions { grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:5px; }
  .game-action { min-height:39px; font-size:11px; }
  .sudoku-reward-info { margin-top:7px; padding:7px; }
  .sudoku-reward-info small { font-size:10px; }
  .sudoku-settings-trigger { right:13px; bottom:calc(var(--footer-h,75px) + 12px); }
}
@media (max-width:390px) and (orientation:portrait) {
  .sudoku-quick-panel { padding:8px; }
  .sudoku-quick-button { font-size:9px; }
  .sudoku-pick { min-height:46px; padding:2px; }
  .sudoku-pick img { width:36px; height:36px; }
  .sudoku-pick.erase-pick img { width:32px; height:32px; }
  .potion-count { height:16px; min-width:22px; font-size:9px; padding:0 2px; }
  .sudoku-board { padding:5px; }
}

/* Menší panel na PC chrání postavu kouzelníka v pozadí. */
@media (min-width:1181px) and (orientation:landscape) {
  .sudoku-quick-panel { padding:14px 14px 12px; }
  .sudoku-quick-panel h1 { margin:4px 0 9px; }
  .sudoku-quick-divider { margin:10px 0 8px; }
  .sudoku-quick-help { margin:0 0 3px; }
  .sudoku-quick-actions { margin-top:10px; gap:5px; }
  .sudoku-quick-button { min-height:37px; }
  .sudoku-auto-save { margin-top:8px; }
}
@media (min-width:1400px) and (orientation:landscape) {
  .sudoku-scene-space { transform:translateX(-42px); }
}

/* Mobil: vnitřní padding nesmí zvětšovat desku mimo šířku displeje. */
.sudoku-board, .sudoku-options, .sudoku-board-column { box-sizing:border-box; }
@media (orientation:portrait) {
  .sudoku-settings-trigger {
    position:fixed; top:14px; right:16px; bottom:auto;
    width:39px; height:39px; border-width:1px;
  }
  .sudoku-settings-trigger svg { width:22px; height:22px; }
  .sudoku-quick-panel h1 { padding-right:38px; }
  .sudoku-quick-progress-row { padding-right:37px; }
}


/* ============================================================
   V4  •  OSLÍKOVO — SUDOKU: LEKTVARY & DRAHOKAMY
   Kompletně nové rozložení, společné originální pozadí.
   ============================================================ */
:root { --sudoku-gold:#f7cd71; --sudoku-navy:#071b3a; --sudoku-ink:#fff3d4; }
body[data-game="sudoku"],body[data-game="sudoku"][data-symbol-theme] {
  --scene-image:url("assets/sudoku-alchymie-v4.webp");
  background:linear-gradient(180deg,rgba(4,12,29,.06) 0%,rgba(4,12,29,.07) 70%,rgba(3,11,27,.35) 100%), var(--scene-image) center center / cover no-repeat fixed;
}
body[data-game="sudoku"] #game-page { display:flex; flex-direction:column; min-height:0; overflow:hidden; height:calc(100dvh - var(--footer-h,75px)); }
.sudoku-masthead { z-index:4; width:min(820px,calc(100% - 40px)); margin:10px 5.5vw 0 auto; flex:0 0 auto; display:flex; flex-direction:column; align-items:center; gap:9px; }
.sudoku-masthead-title { display:flex; justify-content:center; align-items:center; gap:19px; width:100%; box-sizing:border-box; padding:11px 22px 12px; color:var(--sudoku-ink); text-align:center; border:2px solid var(--sudoku-gold); border-radius:22px; background:linear-gradient(180deg,rgba(15,57,118,.96),rgba(6,24,65,.97)); box-shadow:0 0 0 4px rgba(9,24,52,.56),inset 0 2px 0 #ffffff30,0 11px 24px #0008; }
.masthead-sparkle { color:#ffdf83; font-size:24px; text-shadow:0 0 10px #ffe08a; }
.masthead-eyebrow { display:block; font-weight:800; color:#eecb7f; font-size:10px; letter-spacing:.2em; }
.sudoku-masthead h1 { margin:3px 0 0; font-family:Georgia,serif; font-size:clamp(21px,2.5vw,33px); line-height:1.06; font-weight:800; color:#ffe6a4; text-shadow:0 2px 3px #00112b; }
.sudoku-masthead h1 span { color:#9ac3f9; }
.sudoku-masthead h1 em { font-style:normal; white-space:nowrap; }
.sudoku-masthead p { margin:4px 0 0; font-size:clamp(10px,.9vw,13px); color:#e1e9f9; }
.sudoku-mode-switch { display:flex; justify-content:center; gap:9px; max-width:100%; }
.sudoku-mode { display:flex; align-items:center; justify-content:center; gap:7px; min-height:39px; padding:3px 18px; min-width:140px; color:#f0f5fc; background:linear-gradient(180deg,#284f84,#10294f); border:2px solid #bd9560; border-radius:999px; font-weight:800; font-size:14px; box-shadow:inset 0 1px 0 #ffffff3c,0 5px 14px #0007; cursor:pointer; transition:filter .14s,transform .14s; }
.sudoku-mode:hover { filter:brightness(1.18); transform:translateY(-1px); }
.sudoku-mode:focus-visible { outline:3px solid #fff2bc; outline-offset:3px; }
.sudoku-mode.active { color:#fff4c9; border-color:#ffe08e; background:linear-gradient(180deg,#2263aa,#073477); box-shadow:0 0 0 2px #d5a64c88,0 0 15px #efd67e77; }
.sudoku-mode img { width:28px; height:28px; object-fit:contain; }
.sudoku-layout { flex:1 1 auto; height:auto; min-height:0; padding:12px max(15px,2vw) 8px; width:100%; box-sizing:border-box; grid-template-columns:minmax(196px,230px) minmax(0,570px) minmax(218px,244px); gap:clamp(12px,1.35vw,22px); justify-content:end; align-items:center; }
.sudoku-scene-space { height:100%; align-self:center; justify-content:center; align-items:center; padding-top:0; transform:none; }
.sudoku-quick-panel { width:100%; max-width:232px; background:linear-gradient(160deg,rgba(12,45,91,.95),rgba(6,26,57,.95)); border:2px solid #dbad5b; border-radius:17px; box-shadow:0 13px 25px #0009,inset 0 0 0 3px #19335daa; padding:17px 14px; }
.sudoku-quick-panel h2 { margin:4px 0 10px; color:#ffdf9a; font-size:19px; font-family:Georgia,serif; text-align:center; }
.sudoku-quick-overline { text-align:center; letter-spacing:.12em; }
.sudoku-quick-status { padding:9px 8px; margin:0 0 10px; text-align:center; background:#061a36bb; border-radius:9px; font-size:12px; }
.sudoku-quick-progress-row { font-size:12px; }
.sudoku-progress-track { height:10px; margin:9px 0 10px; }
.sudoku-quick-facts { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:4px 0; }
.sudoku-quick-facts div { display:flex; flex-direction:column; gap:3px; text-align:center; padding:8px 4px; background:#071d3f; border:1px solid #576f90; border-radius:10px; }
.sudoku-quick-facts span { font-size:10px; color:#bbd1e9; }
.sudoku-quick-facts strong { font-size:17px; color:#ffe3a6; font-variant-numeric:tabular-nums; }
.sudoku-quick-help { text-align:center; line-height:1.48; font-size:11px; }
.sudoku-quick-actions { gap:9px; margin-top:11px; }
.sudoku-quick-button { min-height:42px; font-size:13px; border-radius:11px; text-shadow:0 1px 2px #0014; }
.sudoku-continue { color:white; background:linear-gradient(180deg,#4bb64b,#147033); border-color:#d6e79e; }
.sudoku-restart { color:#fff1d2; background:linear-gradient(180deg,#267dc0,#0d4785); border-color:#b5d6ed; }
.sudoku-exit { color:#f2e8d7; background:linear-gradient(180deg,#3c5173,#1b3356); border-color:#7795b6; }
.sudoku-auto-save { margin-top:12px; font-size:10px; line-height:1.3; }
.sudoku-board-column { min-width:0; }
.sudoku-board-caption { padding-bottom:6px; color:#fff0d1; font-size:11px; }
.sudoku-board { width:min(100%, calc(100dvh - var(--footer-h,75px) - 185px)); max-width:570px; min-width:0; border:3px solid #eeca76; background:linear-gradient(130deg,#ffe0a2,#9a5627 20%,#41281c 53%,#a3692f 83%,#ffe0a2); box-shadow:0 15px 27px #000b,0 0 0 5px #102851df,0 0 24px #ffd16d33; padding:10px; border-radius:16px; gap:4px; }
.sudoku-cell { border-radius:8px; border-color:#bc975c; }
.sudoku-cell.fixed { background:linear-gradient(155deg,#123d78,#082348); border-color:#397ab2; }
.sudoku-cell img { width:91%; height:91%; }
.sudoku-options { background:linear-gradient(180deg,rgba(14,48,94,.96),rgba(5,23,50,.96)); border:2px solid #d4ad67; border-radius:18px; box-shadow:0 13px 28px #0009,inset 0 0 0 3px #173b67; padding:15px 12px; }
.sudoku-options::before { border-color:#ffe7a61c; }
.sudoku-palette-head h2 { color:#ffe2a0; font-family:Georgia,serif; font-size:16px; letter-spacing:0; }
.sudoku-palette-head p { font-size:10px; color:#e3d9c8; }
.sudoku-palette { gap:6px; }
.sudoku-pick { background:linear-gradient(150deg,#fcf0d2,#dfcba6); border:2px solid #a88b5c; min-height:71px; border-radius:11px; }
.sudoku-pick:hover:not(:disabled) { background:linear-gradient(150deg,#fffded,#f0dab0); border-color:#ffdb83; }
.sudoku-pick.selected { background:linear-gradient(145deg,#fff8e7,#ffe1a8); border:3px solid #ffc54a; padding:2px; box-shadow:0 0 14px #ffd34f91; }
.sudoku-pick img { width:53px; height:53px; }
.sudoku-pick.erase-pick { background:linear-gradient(145deg,#fff1dd,#e7c2ae); }
.sudoku-pick.erase-pick img { width:49px; height:49px; margin-top:-6px; }
.sudoku-pick.erase-pick.selected { background:linear-gradient(145deg,#ffe0cb,#faad9d); border-color:#ef483e; }
.erase-name { color:#9c2929; font-size:10px; }
.potion-count { background:#112e57; color:#fff2d0; }
.sudoku-selection-note { margin:9px 0 4px; border-color:#e9c78c55; color:#ebddc2; }
.sudoku-selection-note strong { color:#ffdf90; }
.sudoku-actions { gap:8px; }
.check-action { background:linear-gradient(180deg,#42a649,#16732d); border:1px solid #a8d68b; }
.hint-action { background:linear-gradient(180deg,#286caa,#154376); border-color:#b5cde5; color:#fff1d5; }
.sudoku-reward-info { margin-top:11px; border:1px solid #e7bc6b; background:linear-gradient(180deg,#142b54,#091a36); padding:11px 9px; }
.sudoku-reward-info strong { color:#ffe5a4; }
#sudoku-status { width:100%; min-height:34px; margin:11px 0 0; background:linear-gradient(180deg,#103b78ec,#071d45f4); border:1px solid #d4aa5d; color:#fff4d9; padding:7px 13px; font-size:12px; }
.sudoku-settings-trigger { width:48px; height:48px; right:12px; bottom:calc(var(--footer-h,75px) + 12px); }
.sudoku-settings-dialog { border-color:#f1c875; background:linear-gradient(160deg,#164779,#061b3e); }
.sudoku-settings-head { background:linear-gradient(90deg,#185494,#0a2c5e); }
.sudoku-settings-description { margin:0 0 18px; }
@media (max-width:1280px) and (orientation:landscape) {
 .sudoku-masthead { width:min(700px,calc(100% - 22px)); margin-right:25px; }
 .sudoku-layout { grid-template-columns:minmax(160px,207px) minmax(0,1fr) minmax(174px,219px); gap:10px; padding:10px; }
 .sudoku-quick-panel { padding:10px 9px; }
 .sudoku-quick-panel h2 { font-size:16px; }
 .sudoku-pick { min-height:60px; }
 .sudoku-pick img { width:45px; height:45px; }
 .sudoku-pick.erase-pick img { width:43px; height:43px; }
}
@media (max-height:780px) and (orientation:landscape) {
 .sudoku-masthead { margin-top:7px; gap:6px; }
 .sudoku-masthead-title { padding:6px 15px; }
 .sudoku-masthead h1 { font-size:24px; }
 .sudoku-masthead p { font-size:10px; }
 .sudoku-mode { min-height:33px; padding:2px 12px; }
 .sudoku-mode img { width:24px; height:24px; }
 .sudoku-layout { padding-top:6px; }
 .sudoku-board { width:min(100%,calc(100dvh - var(--footer-h,75px) - 153px)); gap:3px; padding:7px; }
 .sudoku-quick-panel { padding:9px; }
 .sudoku-quick-panel h2 { font-size:16px; margin:2px 0 5px; }
 .sudoku-quick-status { padding:5px; margin-bottom:5px; }
 .sudoku-quick-divider { margin:8px 0; }
 .sudoku-quick-help { font-size:10px; }
 .sudoku-quick-actions { gap:5px; }
 .sudoku-quick-button { min-height:33px; }
 .sudoku-options { padding:9px; }
 .sudoku-pick { min-height:52px; }
 .sudoku-pick img { width:40px; height:40px; }
 .sudoku-pick.erase-pick img { width:37px; height:37px; }
 .game-action { min-height:36px; }
 .sudoku-reward-info { padding:7px; margin-top:7px; }
}
@media (orientation:portrait) {
 body[data-game="sudoku"] { background:linear-gradient(#091d42c4,#071629c4),var(--scene-image) 29% center/cover no-repeat fixed; }
 body[data-game="sudoku"] #game-page { overflow-y:auto; overflow-x:hidden; height:calc(100dvh - var(--footer-h,75px)); display:block; }
 .sudoku-masthead { width:calc(100% - 24px); margin:10px auto 0; gap:8px; }
 .sudoku-masthead-title { gap:7px; padding:11px 9px; }
 .masthead-sparkle { font-size:16px; }
 .sudoku-masthead h1 { font-size:clamp(19px,5.5vw,27px); }
 .sudoku-masthead p { font-size:10px; line-height:1.35; }
 .masthead-eyebrow { font-size:8px; }
 .sudoku-mode-switch { width:100%; gap:8px; }
 .sudoku-mode { min-width:0; flex:1; max-width:194px; min-height:39px; padding:2px 6px; font-size:12px; }
 .sudoku-mode img { width:26px; height:26px; }
 .sudoku-layout { display:flex; width:100%; height:auto; min-height:0; flex-direction:column; gap:9px; padding:10px 9px 82px; }
 .sudoku-scene-space { order:1; height:auto; width:100%; align-items:stretch; justify-content:center; }
 .sudoku-quick-panel { max-width:560px; width:100%; display:grid; grid-template-columns:1fr 1fr; gap:5px 8px; padding:9px; }
 .sudoku-quick-overline,.sudoku-quick-panel h2,.sudoku-quick-divider,.sudoku-quick-help,.sudoku-auto-save,.sudoku-quick-facts { display:none; }
 .sudoku-quick-status { grid-column:1; margin:0; font-size:11px; }
 .sudoku-quick-progress-row { grid-column:2; padding:0; }
 .sudoku-progress-track { grid-column:1/-1; margin:2px 0; }
 .sudoku-rule-alert { grid-column:1/-1; }
 .sudoku-quick-actions { grid-column:1/-1; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin-top:4px; }
 .sudoku-quick-button { min-height:36px; font-size:10px; padding:4px; }
 .sudoku-board-column { order:0; width:100%; }
 .sudoku-board-caption { padding:0 3px 4px; }
 .sudoku-board { width:min(100%,560px); max-width:560px; padding:5px; gap:3px; }
 #sudoku-status { width:min(100%,560px); margin-top:7px; font-size:10px; }
 .sudoku-options { order:2; width:min(100%,560px); margin:0 auto; padding:9px; }
 .sudoku-palette { grid-template-columns:repeat(6,minmax(0,1fr)); gap:4px; }
 .sudoku-pick { min-height:51px; padding:1px; }
 .sudoku-pick img { width:min(42px,90%); height:42px; }
 .sudoku-pick.erase-pick img { width:min(39px,85%); height:39px; }
 .sudoku-pick.selected { padding:0; }
 .sudoku-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .sudoku-reward-info { padding:8px; }
 .sudoku-settings-trigger { width:41px; height:41px; right:14px; top:15px; bottom:auto; position:fixed; }
 .sudoku-settings-trigger svg { width:21px; height:21px; }
 .sudoku-masthead-title { padding-right:32px; }
}
@media(max-width:390px) and (orientation:portrait) {
 .sudoku-pick { min-height:43px; }
 .sudoku-pick img { height:33px; width:33px; }
 .sudoku-pick.erase-pick img { height:31px; width:31px; }
 .erase-name { font-size:8px; bottom:1px; }
 .potion-count { font-size:8px; min-width:23px; height:16px; }
 .sudoku-quick-button { font-size:9px; }
}
@media (prefers-reduced-motion:reduce) { .sudoku-mode,.sudoku-cell { transition:none!important; animation:none!important; } }

/* Malý displej: výběr symbolů zůstává po ruce, bez posouvání tam a zpět. */
@media (orientation:portrait) and (max-width:650px) {
  .sudoku-palette {
    position:fixed;
    z-index:23;
    left: max(5px,env(safe-area-inset-left,0px));
    right:max(5px,env(safe-area-inset-right,0px));
    bottom:calc(var(--footer-h,75px) + env(safe-area-inset-bottom,0px) + 4px);
    padding:5px;
    border:1px solid #e6bd70;
    border-radius:12px;
    background:linear-gradient(180deg,rgba(12,51,102,.98),rgba(4,23,55,.98));
    box-shadow:0 0 0 3px #051a39b0,0 -8px 20px #0007;
  }
  .sudoku-pick { min-height:49px; }
  .sudoku-pick img { width:38px; height:38px; }
  .sudoku-pick.erase-pick img { width:35px; height:35px; }
  .sudoku-layout { padding-bottom:145px; }
}
/* Telefon otočený naležato: přednost má použitelná deska, nikoli nacpání tří panelů. */
@media (orientation:landscape) and (max-width:920px) {
  body[data-game="sudoku"] #game-page { display:block; overflow-y:auto; overflow-x:hidden; height:calc(100dvh - var(--footer-h,75px)); }
  .sudoku-masthead { width:calc(100% - 22px); margin:6px auto; gap:6px; }
  .sudoku-masthead-title { padding:6px; }
  .sudoku-masthead h1 { font-size:20px; }
  .sudoku-masthead p,.masthead-eyebrow,.masthead-sparkle { display:none; }
  .sudoku-mode { min-height:30px; min-width:128px; padding:2px 12px; font-size:12px; }
  .sudoku-mode img { width:25px; height:25px; }
  .sudoku-layout { display:flex; flex-direction:column; height:auto; min-height:0; padding:5px 12px 100px; gap:9px; }
  .sudoku-board-column { order:0; width:100%; }
  .sudoku-board { width:min(82vw,510px); max-width:510px; gap:3px; padding:6px; }
  .sudoku-scene-space { order:1; width:min(100%,510px); height:auto; padding:0; }
  .sudoku-quick-panel { width:100%; max-width:510px; padding:10px; display:grid; grid-template-columns:1fr 1fr; gap:5px 8px; }
  .sudoku-quick-overline,.sudoku-quick-panel h2,.sudoku-quick-divider,.sudoku-quick-help,.sudoku-auto-save,.sudoku-quick-facts { display:none; }
  .sudoku-quick-status { grid-column:1; font-size:11px; margin:0; }
  .sudoku-quick-progress-row { grid-column:2; }
  .sudoku-progress-track { grid-column:1/-1; margin:2px 0; }
  .sudoku-rule-alert { grid-column:1/-1; }
  .sudoku-quick-actions { grid-column:1/-1; grid-template-columns:repeat(3,1fr); margin:4px 0; gap:5px; }
  .sudoku-quick-button { min-height:35px; font-size:11px; }
  .sudoku-options { order:2; width:min(100%,510px); margin:0 auto; padding:9px; }
  .sudoku-palette { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .sudoku-pick { min-height:51px; }
  .sudoku-actions { grid-template-columns:repeat(2,1fr); }
  .sudoku-settings-trigger { position:fixed; top:8px; right:8px; bottom:auto; width:36px; height:36px; z-index:30; }
  .sudoku-settings-trigger svg { width:20px; height:20px; }
}
@media (orientation:portrait) and (max-width:650px) {
  /* backdrop-filter by vytvořil nový containing block a zabránil plovoucí paletě. */
  .sudoku-options { -webkit-backdrop-filter:none; backdrop-filter:none; }
}
@media (max-height:780px) and (orientation:landscape) and (min-width:921px) {
 .sudoku-board { width:min(100%,calc(100dvh - var(--footer-h,75px) - 205px)); }
}


/* V4.1 — čistý fullscreen: bez titulkové desky, odměnové karty a patičky.
   Paticka existuje jen skrytě kvůli společným funkcím, dialogům a hudebnímu ovladači. */
body[data-game="sudoku"] { --footer-h:0px; }
body[data-game="sudoku"] #paticka, body[data-game="sudoku"] footer#paticka.of-footer {
  display:none!important; visibility:hidden!important; height:0!important;
}
body[data-game="sudoku"] #game-page {
  display:flex; flex-direction:column; width:100%; height:100dvh!important;
  max-height:100dvh; min-height:0; padding:0; overflow:hidden;
}
body[data-game="sudoku"] .sudoku-masthead,body[data-game="sudoku"] .sudoku-reward-info {display:none!important}
body[data-game="sudoku"] .sudoku-layout {
  width:100%; max-width:1680px; height:100%; min-height:0; flex:1 1 auto;
  display:grid; align-items:center; justify-content:end;
  grid-template-columns:minmax(180px,212px) minmax(0,650px) minmax(208px,228px);
  gap:clamp(11px,1.25vw,19px); padding:12px 18px 12px 10px;
  margin:0 auto; box-sizing:border-box;
}
body[data-game="sudoku"] .sudoku-scene-space {align-self:center;height:auto;min-height:0;align-items:center;justify-content:center;padding:0;}
body[data-game="sudoku"] .sudoku-quick-panel {width:100%;max-width:212px;}
body[data-game="sudoku"] .sudoku-board-column {min-width:0;width:100%;justify-content:center;align-items:stretch;}
body[data-game="sudoku"] .sudoku-mode-switch {width:100%;max-width:570px;align-self:center;display:flex;justify-content:center;gap:11px;margin:0 0 12px;}
body[data-game="sudoku"] .sudoku-mode {min-width:150px;min-height:42px;}
body[data-game="sudoku"] .sudoku-board-caption {display:flex;justify-content:space-between;padding:0 5px 7px;}
body[data-game="sudoku"] .sudoku-board {
  box-sizing:border-box; max-width:650px; width:min(100%, calc(100dvh - 136px));
  height:auto; aspect-ratio:1; padding:9px; gap:4px; margin:0 auto;
}
body[data-game="sudoku"] .sudoku-cell img { width:92%;height:92%; }
body[data-game="sudoku"] .sudoku-options {width:100%; max-width:228px; min-width:0; margin:0;}
body[data-game="sudoku"] .sudoku-pick {min-height:66px;}
body[data-game="sudoku"] #sudoku-status {align-self:center; width:100%;margin-top:11px;}
/* Vedle kulatého přepínače hudby, který společná část Oslíkova vytváří vpravo nahoře. */
body[data-game="sudoku"] .sudoku-settings-trigger {
  position:fixed;top:14px;right:79px;bottom:auto;left:auto;z-index:75;
  width:49px;height:49px;border-radius:50%;
}
body[data-game="sudoku"] .sudoku-settings-trigger svg {width:25px;height:25px;}
body[data-game="sudoku"] .sudoku-settings-trigger:focus-visible {outline:3px solid #ffe8a3;outline-offset:3px;}
@media (min-width:1181px) and (max-height:770px) and (orientation:landscape) {
  body[data-game="sudoku"] .sudoku-layout {padding-top:7px;padding-bottom:7px;}
  body[data-game="sudoku"] .sudoku-board {width:min(100%,calc(100dvh - 155px));padding:7px;}
  body[data-game="sudoku"] .sudoku-mode-switch {margin-bottom:7px;}
  body[data-game="sudoku"] .sudoku-mode {min-height:36px;}
  body[data-game="sudoku"] .sudoku-quick-panel {padding:10px;}
  body[data-game="sudoku"] .sudoku-options {padding:10px;}
  body[data-game="sudoku"] .sudoku-pick {min-height:54px;}
  body[data-game="sudoku"] .sudoku-pick img {width:42px;height:42px;}
}
@media (min-width:921px) and (max-width:1210px) and (orientation:landscape) {
  body[data-game="sudoku"] .sudoku-layout {
    grid-template-columns:minmax(160px,184px) minmax(0,1fr) minmax(174px,206px);
    gap:10px;padding:8px 10px;
  }
  body[data-game="sudoku"] .sudoku-board {width:min(100%,calc(100dvh - 122px));}
  body[data-game="sudoku"] .sudoku-quick-panel {padding:10px;}
  body[data-game="sudoku"] .sudoku-options {padding:9px;}
  body[data-game="sudoku"] .sudoku-pick {min-height:55px;}
  body[data-game="sudoku"] .sudoku-pick img {width:43px;height:43px;}
  body[data-game="sudoku"] .sudoku-pick.erase-pick img {width:41px;height:41px;}
}
@media (orientation:portrait) {
  body[data-game="sudoku"] #game-page {display:block;overflow-y:auto;overflow-x:hidden;height:100dvh!important;max-height:100dvh;}
  body[data-game="sudoku"] .sudoku-layout {display:flex;flex-direction:column;align-items:center;justify-content:flex-start;height:auto;min-height:100%;gap:10px;padding:68px 9px 115px;}
  body[data-game="sudoku"] .sudoku-board-column {order:0;width:100%;max-width:560px;align-items:center;}
  body[data-game="sudoku"] .sudoku-mode-switch {max-width:430px;margin:0 0 10px;gap:8px;}
  body[data-game="sudoku"] .sudoku-mode {flex:1;min-width:0;min-height:40px;padding:3px 8px;}
  body[data-game="sudoku"] .sudoku-board-caption {width:100%;}
  body[data-game="sudoku"] .sudoku-board {width:min(100%,560px);max-width:560px;padding:5px;gap:3px;}
  body[data-game="sudoku"] .sudoku-scene-space {order:1;align-self:center;width:100%;max-width:560px;}
  body[data-game="sudoku"] .sudoku-quick-panel {width:100%;max-width:560px;}
  body[data-game="sudoku"] .sudoku-options {order:2;width:100%;max-width:560px;padding:10px;}
  body[data-game="sudoku"] .sudoku-palette {grid-template-columns:repeat(6,minmax(0,1fr));}
  body[data-game="sudoku"] .sudoku-pick {min-height:50px;}
  body[data-game="sudoku"] #sudoku-status {margin-top:7px;}
  body[data-game="sudoku"] .sudoku-settings-trigger {top:11px;right:72px;width:43px;height:43px;}
  body[data-game="sudoku"] .sudoku-settings-trigger svg {width:22px;height:22px;}
}
@media (orientation:portrait) and (max-width:650px) {
  body[data-game="sudoku"] .sudoku-palette {
    position:fixed;left:max(5px,env(safe-area-inset-left,0px));right:max(5px,env(safe-area-inset-right,0px));
    bottom:calc(env(safe-area-inset-bottom,0px) + 7px); z-index:23;
  }
  body[data-game="sudoku"] .sudoku-layout {padding-bottom:112px;}
}
@media (orientation:landscape) and (max-width:920px) {
  body[data-game="sudoku"] #game-page {display:block;overflow-y:auto;overflow-x:hidden;height:100dvh!important;max-height:100dvh;}
  body[data-game="sudoku"] .sudoku-layout {display:flex;flex-direction:column;align-items:center;justify-content:flex-start;height:auto;gap:10px;padding:58px 12px 40px;}
  body[data-game="sudoku"] .sudoku-board-column {order:0;width:100%;max-width:620px;align-items:center;}
  body[data-game="sudoku"] .sudoku-mode-switch {max-width:440px;margin-bottom:9px;}
  body[data-game="sudoku"] .sudoku-mode {min-height:37px;min-width:126px;}
  body[data-game="sudoku"] .sudoku-board {width:min(88vw,620px);max-width:620px;}
  body[data-game="sudoku"] .sudoku-scene-space {order:1;align-self:center;width:100%;max-width:620px;}
  body[data-game="sudoku"] .sudoku-quick-panel {width:100%;max-width:620px;}
  body[data-game="sudoku"] .sudoku-options {order:2;width:100%;max-width:620px;}
  body[data-game="sudoku"] .sudoku-palette {grid-template-columns:repeat(6,minmax(0,1fr));}
  body[data-game="sudoku"] .sudoku-settings-trigger {top:10px;right:70px;width:41px;height:41px;}
}
