/* Bouchal — svět (hry, balíčky). Prefix tříd: bch-. Tokeny z bouchal.css. */

/* ---------- úvod stránky her ---------- */
.bch-games-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 10px 0 26px; }
.bch-games-intro h1 { font-size: clamp(38px, 6vw, 72px); line-height: .98; letter-spacing: -.03em; margin: 12px 0; }
.bch-games-intro p { font-size: 16px; color: var(--bch-ink-soft); margin: 0; }
.bch-games-intro > img { height: 260px; width: 230px; object-fit: contain; transform: rotate(8deg); flex: none; }
.bch-games-welcome { display: inline-block; font-size: 12px; font-weight: 900; color: var(--bch-purple); }

/* ---------- výběr her ---------- */
.bch-game-selection { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.bch-game-card {
  text-align: left; padding: 22px; background: var(--bch-cream); color: var(--bch-ink);
  border: 1.5px solid var(--bch-ink); border-radius: 20px; box-shadow: var(--bch-shadow-soft);
  font-family: var(--bch-font-body); cursor: pointer; display: block; width: 100%;
  transition: transform .12s, box-shadow .12s;
}
.bch-game-card:hover { transform: translate(1px, 1px); box-shadow: 3px 4px 0 var(--bch-lav); }
.bch-game-card:focus-visible { outline: 4px solid var(--bch-purple); outline-offset: 4px; }
.bch-game-card small { display: block; font-size: 11px; color: var(--bch-purple); font-weight: 900; margin-top: 20px; }
.bch-game-card h2 { font-size: 30px; letter-spacing: -.02em; margin: 8px 0; }
.bch-game-card p { font-size: 13px; margin: 0 0 14px; color: var(--bch-ink-soft); }
.bch-game-card b {
  display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--bch-ink);
  border-radius: 7px; background: var(--bch-yellow); padding: 12px; font-size: 14px; box-shadow: var(--bch-shadow-pop);
}
.bch-game-art { height: 180px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; position: relative; overflow: hidden; }
.bch-game-art img { height: 140px; max-width: 45%; object-fit: contain; flex-shrink: 1; min-width: 0; }
.bch-memory-art { background: #eadcf8; }
.bch-memory-art i { font: 800 66px/1 var(--bch-font-head); background: #b58bda; width: 70px; height: 110px; border: 1px solid #714d91; border-radius: 10px; text-align: center; transform: rotate(-8deg); font-style: normal; display: grid; place-items: center; }
.bch-memory-art i:last-child { transform: rotate(8deg); }
.bch-words-art { background: #d9edbf; gap: 10px; }
.bch-words-art i { font: 800 55px var(--bch-font-head); font-style: normal; background: var(--bch-cream); padding: 0 15px; border: 2px solid #6e5091; border-radius: 10px; transform: rotate(-8deg); }
.bch-words-art i:nth-child(2) { transform: rotate(8deg); }
.bch-hunt-art { background: #f7d9a8; }
.bch-hunt-art > img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.bch-game-card--hunt { grid-column: 1 / -1; order: -1; display: grid; grid-template-columns: 1.2fr 1fr; column-gap: 28px; align-items: center; background: #fae8b1; }
.bch-game-card--hunt > .bch-game-art { grid-column: 1; grid-row: 1 / 6; height: 255px; }
.bch-game-card--hunt > small, .bch-game-card--hunt > h2, .bch-game-card--hunt > p, .bch-game-card--hunt > b { grid-column: 2; }
.bch-game-card--hunt > small { margin-top: 0; }
.bch-games-note { font-size: 12px; color: var(--bch-muted); text-align: center; max-width: 650px; margin: 32px auto 0; }

/* ---------- herní okno ---------- */
html.bch-dialog-open { overflow: hidden; }
.bch-play-dialog {
  width: min(750px, calc(100vw - 24px)); max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  padding: 36px 24px 24px; border: 2px solid var(--bch-ink); border-radius: 22px; background: var(--bch-cream);
  color: var(--bch-ink); text-align: center; box-shadow: 0 30px 100px #23163360; margin: auto;
}
.bch-play-dialog::backdrop { background: #211332b3; }
.bch-play-dialog[open] { display: block; }
.bch-play-dialog [hidden] { display: none !important; }
.bch-play-dialog button { font-family: var(--bch-font-body); }
.bch-play-dialog button:focus-visible { outline: 4px solid var(--bch-purple); outline-offset: 3px; }
.bch-play-close { position: absolute; right: 12px; top: 8px; font-size: 34px; line-height: 1; background: none; border: 0; color: var(--bch-ink); width: 44px; height: 44px; cursor: pointer; }
.bch-game-heading h2 { font-size: 36px; margin: 10px 0; }
.bch-game-heading > span { font-size: 12px; font-weight: 900; color: var(--bch-purple); }
.bch-game-heading p { font-size: 15px; font-weight: 800; margin: 0 0 8px; }
.bch-game-feedback { min-height: 25px; font-size: 14px; font-weight: 800; color: var(--bch-purple); margin: 10px 0; }
.bch-game-end-actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.bch-game-end-actions .bch-btn { min-height: 44px; margin: 0; }
.bch-game-win img { height: 180px; object-fit: contain; }
.bch-game-win h3 { font-size: 40px; }
.bch-game-win p { font-size: 15px; }

/* pexeso */
.bch-memory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bch-memory-grid button { height: 110px; border-radius: 14px; border: 1.5px solid #714d91; background: #ddc9f1; font: 800 52px var(--bch-font-head); color: var(--bch-ink); padding: 0; cursor: pointer; touch-action: manipulation; }
.bch-memory-grid img { height: 98px; max-width: 100%; object-fit: contain; }
.bch-memory-grid .matched { background: #d9edc8; border-color: #789857; }

/* písmenka */
.bch-word-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.bch-word-level { padding: 24px 12px; border: 2px solid #714d91; border-radius: 18px; background: #e4f0cb; color: var(--bch-ink); display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; }
.bch-word-level:nth-child(2) { background: #fff0ad; }
.bch-word-level:nth-child(3) { background: #f4c5df; }
.bch-word-level > span { color: #7745ac; font-size: 24px; }
.bch-word-level strong { font: 800 26px var(--bch-font-head); }
.bch-word-level small { font-size: 14px; }
.bch-word-level b { font-size: 13px; }
.bch-word-level:hover { transform: translateY(-3px); }
.bch-word-level-note { font-size: 13px; line-height: 1.6; text-align: center; color: var(--bch-ink-soft); }
.bch-word-picture { height: 110px; display: grid; place-items: center; }
.bch-word-picture img { height: 105px; }
.bch-word-picture > span { font-size: 78px; line-height: 1; }
.bch-word-clue { font-size: 14px; }
.bch-word-slots, .bch-letter-bank { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 20px 0; }
.bch-word-slots button, .bch-letter-bank button { width: 48px; height: 52px; border: 2px solid #795495; border-radius: 10px; background: #ffe482; color: #38214d; font: 800 26px var(--bch-font-head); padding: 0; cursor: pointer; touch-action: manipulation; }
.bch-word-slots button { background: #e9dff4; }
.bch-word-slots button:disabled { opacity: 1; cursor: default; }
.bch-letter-bank button:disabled { opacity: .22; cursor: default; }
.bch-word-controls { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.bch-word-controls .bch-btn { margin: 0; }

/* lunapark */
.bch-hunt-dialog { width: min(1140px, calc(100vw - 20px)); max-width: 1140px; padding: 32px 28px 24px; }
.bch-hunt-dialog .bch-game-heading h2 { margin: 8px 0; font-size: 35px; }
.bch-hunt-dialog .bch-game-heading p { font-size: 13px; max-width: 750px; margin: 0 auto 12px; }
.bch-hunt-checklist { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 0; margin: 0 0 12px; list-style: none; }
.bch-hunt-checklist li { display: flex; align-items: center; gap: 5px; border: 1px solid #d7c6e4; border-radius: 10px; padding: 5px 9px; font-size: 12px; font-weight: 800; min-height: 48px; background: #fff; }
.bch-hunt-checklist img { width: 30px; height: 38px; object-fit: contain; }
.bch-hunt-checklist b { min-width: 11px; color: #31713d; }
.bch-hunt-checklist .found { background: #e7f1d2; border-color: #709c58; }
.bch-hunt-toolbar { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 12px; flex-wrap: wrap; font-size: 12px; font-weight: 800; }
.bch-hunt-toolbar label { margin: 0; }
.bch-hunt-toolbar select { font: inherit; background: #fff; color: var(--bch-ink); border: 1px solid #806097; border-radius: 7px; padding: 10px; min-height: 44px; }
.bch-hunt-toolbar .bch-btn { font-size: 12px; min-height: 44px; padding: 9px 12px; margin: 0; }
.bch-hunt-viewport { width: min(100%, 78vh); width: min(100%, 78dvh); aspect-ratio: 3 / 2; margin: 0 auto; max-height: 52dvh; overflow: auto; border: 3px solid #6f478e; border-radius: 12px; overscroll-behavior: contain; background: #d6c5eb; cursor: grab; touch-action: none; scrollbar-width: thin; scrollbar-color: #79519b #e1d0ef; }
.bch-hunt-viewport.dragging { cursor: grabbing; }
.bch-hunt-board { width: 100%; min-height: 100%; position: relative; aspect-ratio: 3 / 2; line-height: 0; }
.bch-hunt-board, .bch-hunt-board * { user-select: none; -webkit-user-drag: none; }
.bch-hunt-background { display: block; width: 100%; height: auto; max-width: none; pointer-events: none; }
.bch-hunt-person { position: absolute; width: 3.5%; height: 6.5%; min-width: 22px; min-height: 30px; border: 0; background: none; padding: 0; transform: translate(-50%, -100%); cursor: crosshair; line-height: 0; touch-action: none; }
.bch-hunt-person img { height: 100%; width: 100%; max-width: none; object-fit: contain; pointer-events: none; }
.bch-hunt-person > span { display: none; }
.bch-hunt-person.found { cursor: default; }
.bch-hunt-person.found > span { display: grid; place-items: center; position: absolute; right: -20%; top: 0; width: 70%; aspect-ratio: 1; background: #fff8cf; border: 1px solid #56763c; border-radius: 50%; font-size: clamp(10px, 2vw, 25px); color: #336526; }
.bch-hunt-person:focus-visible { outline: 3px solid #fff !important; outline-offset: 2px !important; }
.bch-hunt-hint-ring { position: absolute; width: 18%; height: 24%; border: 5px dashed #fff5a1; border-radius: 50%; transform: translate(-50%, -60%); pointer-events: none; box-shadow: 0 0 0 3px #70418f80; }
.bch-hunt-tip { font-size: 11px; color: #6d577c; margin: 9px 0; }
.bch-hunt-dialog .bch-game-feedback:empty { display: none; }

@media (max-width: 760px) {
  .bch-games-intro { position: relative; padding: 4px 0 18px; }
  .bch-games-intro h1 { font-size: 40px; max-width: 235px; position: relative; z-index: 1; }
  .bch-games-intro p { font-size: 13px; max-width: 210px; }
  .bch-games-intro > img { height: 150px; width: 100px; position: absolute; right: -5px; bottom: 10px; opacity: .95; }
  .bch-game-selection { grid-template-columns: 1fr; gap: 18px; }
  .bch-game-card { padding: 18px; }
  .bch-game-art { height: 155px; }
  .bch-game-card h2 { font-size: 27px; }
  .bch-game-card--hunt { display: block; }
  .bch-game-card--hunt > .bch-game-art { height: 200px; }
  .bch-game-card--hunt > small { margin-top: 18px; }
  .bch-play-dialog { padding: 38px 14px 20px; }
  .bch-game-heading h2 { font-size: 28px; }
  .bch-game-heading p { font-size: 13px; }
  .bch-memory-grid { gap: 7px; }
  .bch-memory-grid button { height: 83px; font-size: 40px; }
  .bch-memory-grid img { height: 74px; }
  .bch-game-feedback { font-size: 12px; }
  .bch-game-end-actions { gap: 8px; }
  .bch-game-win h3 { font-size: 30px; }
  .bch-word-slots button, .bch-letter-bank button { width: 38px; height: 47px; font-size: 22px; }
  .bch-hunt-dialog { padding: 38px 10px 18px; }
  .bch-hunt-dialog .bch-game-heading h2 { font-size: 26px; }
  .bch-hunt-dialog .bch-game-heading p { font-size: 12px; }
  .bch-hunt-checklist { gap: 5px; }
  .bch-hunt-checklist li { width: 31%; padding: 3px; font-size: 11px; }
  .bch-hunt-checklist img { width: 24px; height: 32px; }
  .bch-hunt-viewport { width: 100%; max-height: 43dvh; }
  .bch-hunt-toolbar { gap: 8px; }
  .bch-hunt-toolbar > label { display: none; }
  .bch-hunt-tip { line-height: 1.5; }
}
@media (max-width: 500px) {
  .bch-word-levels { grid-template-columns: 1fr; gap: 10px; }
  .bch-word-level { padding: 14px; gap: 5px; }
  .bch-word-level strong { font-size: 23px; }
  .bch-word-level > span { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .bch-game-card, .bch-word-level { transition: none; }
  .bch-word-level:hover, .bch-game-card:hover { transform: none; }
}

/* ---------- dárkové balíčky ---------- */
.bch-bundles-intro { padding: 10px 0 26px; max-width: 760px; }
.bch-bundles-intro h1 { font-size: clamp(34px, 5vw, 56px); margin: 8px 0 12px; }
.bch-bundles-intro p { font-size: 16px; color: var(--bch-ink-soft); margin: 0; }
.bch-bundles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
.bch-bundle {
  background: var(--bch-cream); border: 1.5px solid var(--bch-ink); border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--bch-shadow-soft);
}
.bch-bundle__head { background: var(--bundle-tint, var(--bch-purple)); color: #fff; padding: 18px; }
.bch-bundle__head h2 { font-size: 26px; line-height: 1.1; margin: 0 0 4px; color: #fff; }
.bch-bundle__head p { margin: 0; font-size: 13px; font-weight: 700; opacity: .95; }
.bch-bundle__cast { display: flex; justify-content: center; align-items: flex-end; gap: 4px; padding: 14px; background: var(--bch-lav-soft); min-height: 130px; }
.bch-bundle__cast img { height: 100px; width: auto; max-width: 33%; object-fit: contain; }
.bch-bundle__body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.bch-bundle__list { list-style: none; margin: 0; padding: 0; flex: 1; }
.bch-bundle__list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--bch-line); font-size: 14px; font-weight: 700; }
.bch-bundle__list li:last-child { border-bottom: 0; }
.bch-bundle__list img { width: 54px; height: 54px; object-fit: contain; background: #fff; border: 1px solid var(--bch-line); border-radius: 8px; flex: none; }
.bch-bundle__list a { color: var(--bch-ink); text-decoration: underline; text-decoration-color: var(--bch-pink); text-underline-offset: 3px; }
.bch-bundle__list a:hover { color: var(--bch-purple); }
.bch-bundles-note { max-width: 760px; margin: 28px auto 0; text-align: center; font-size: 13px; color: var(--bch-muted); }
.bch-bundles-cta { text-align: center; margin-top: 22px; }
@media (max-width: 900px) { .bch-bundles { grid-template-columns: 1fr; } }

/* odměna za dohranou hru */
.bch-game-reward { margin: 14px 0 6px; padding: 18px 20px; text-align: center; background: var(--bch-yellow-soft); border: 1.5px solid var(--bch-ink); border-radius: 16px; box-shadow: var(--bch-shadow-soft); }
.bch-game-reward[hidden] { display: none; }
.bch-game-reward h3 { font-size: 24px; margin: 4px 0 6px; }
.bch-game-reward p { font-size: 14px; margin: 0 0 12px; }
.bch-game-reward small { display: block; margin-top: 12px; font-size: 11px; color: var(--bch-muted); line-height: 1.5; }
.bch-reward-star { font-size: 30px; color: var(--bch-purple); }
.bch-reward-code { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.bch-reward-code code { font-family: var(--bch-font-head); font-size: 26px; font-weight: 800; letter-spacing: .08em; color: var(--bch-ink); background: #fff; border: 1.5px dashed var(--bch-ink); border-radius: 10px; padding: 6px 16px; user-select: all; }

/* ---------- hry na mobilu (aktuální zadání: pexeso 2 sloupce, lunapark nativní posun, větší dotykové plochy) ---------- */
.bch-hunt-viewport { touch-action: pan-x pan-y; }
.bch-hunt-person { touch-action: pan-x pan-y; }
.bch-play-dialog { max-height: 90vh; max-height: 90dvh; }
@media (max-width: 760px) {
  .bch-play-dialog, .bch-hunt-dialog { width: calc(100% - 16px); max-width: none; padding: 52px 16px 22px; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); margin: auto; overscroll-behavior: contain; }
  .bch-play-close { width: 44px; height: 44px; right: 8px; top: 6px; line-height: 1; border-radius: 50%; z-index: 3; }
  .bch-memory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bch-memory-grid button { height: 100px; min-width: 0; }
  .bch-memory-grid img { width: 100%; height: 90px; object-fit: contain; }
  .bch-word-slots, .bch-letter-bank { gap: 5px; }
  .bch-word-slots button, .bch-letter-bank button { width: 44px; height: 48px; }
  .bch-hunt-viewport { height: 48vh; height: 48dvh; max-height: 48dvh; -webkit-overflow-scrolling: touch; }
  .bch-hunt-person:before { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
  .bch-hunt-toolbar select, .bch-hunt-toolbar button { min-height: 44px; max-width: 100%; }
}
@media (max-width: 380px) { .bch-hunt-checklist li { width: calc(50% - 5px); min-width: 0; } .bch-hunt-checklist img { flex-shrink: 0; } }

/* ---- Hry na telefonu — kompaktní okno (prototyp mobile.css „Compact mobile filters and games“): hrací plocha zůstává celá na obrazovce ---- */
@media (max-width: 760px) {
  .bch-play-dialog, .bch-hunt-dialog { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); padding: 44px 12px 12px; border-radius: 18px; }
  .bch-play-close { top: 4px; right: 4px; width: 44px; height: 44px; font-size: 28px; }
  .bch-game-heading h2, .bch-hunt-dialog .bch-game-heading h2 { font-size: 24px; line-height: 1.05; letter-spacing: -.5px; margin: 5px 0 7px; }
  .bch-game-heading > span { font-size: 11px; }
  .bch-game-heading p, .bch-hunt-dialog .bch-game-heading p { font-size: 12px; line-height: 1.4; margin: 0 0 10px; }
  .bch-memory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .bch-memory-grid button { height: clamp(44px, 10dvh, 72px); padding: 3px; border-radius: 9px; font-size: 32px; }
  .bch-memory-grid img { width: 100%; height: 100%; object-fit: contain; }
  .bch-memory-grid > button:nth-child(4n + 1):nth-last-child(2) { grid-column: 2; }
  .bch-game-feedback { min-height: 0; font-size: 12px; line-height: 1.35; margin: 8px 0; }
  .bch-game-feedback:empty { display: none; }
  .bch-game-end-actions { gap: 8px; margin-top: 10px; }
  .bch-game-end-actions .bch-btn { padding: 8px; font-size: 12px; }
  .bch-word-levels { grid-template-columns: 1fr; gap: 8px; margin: 10px 0; }
  .bch-word-level { display: grid; grid-template-columns: 52px 1fr auto; gap: 0 8px; padding: 10px; min-height: 64px; text-align: left; border-radius: 12px; }
  .bch-word-level > span { grid-column: 1; grid-row: 1 / 3; font-size: 16px; text-align: center; }
  .bch-word-level strong { grid-column: 2; font-size: 20px; line-height: 1.2; }
  .bch-word-level small { grid-column: 2; font-size: 12px; }
  .bch-word-level b { grid-column: 3; grid-row: 1 / 3; font-size: 11px; }
  .bch-word-level-note { font-size: 11px; line-height: 1.4; margin: 8px 0; }
  .bch-word-picture { height: 64px; }
  .bch-word-picture img { height: 62px; max-width: 100%; object-fit: contain; }
  .bch-word-picture > span { font-size: 50px; }
  .bch-word-clue { font-size: 12px; line-height: 1.4; margin: 6px 0; }
  .bch-word-slots, .bch-letter-bank { gap: 4px; margin: 10px 0; }
  .bch-word-slots button, .bch-letter-bank button { width: 44px; height: 44px; padding: 0; border-radius: 8px; font-size: 23px; }
  .bch-hunt-checklist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0 0 6px; }
  .bch-hunt-checklist li { width: auto; min-width: 0; min-height: 30px; padding: 2px; gap: 2px; font-size: 10px; border-radius: 7px; justify-content: center; }
  .bch-hunt-checklist img { width: 16px; height: 24px; flex-shrink: 0; }
  .bch-hunt-checklist b { min-width: 0; }
  .bch-hunt-toolbar { gap: 6px; margin: 6px 0; }
  .bch-hunt-toolbar select, .bch-hunt-toolbar .bch-btn { min-height: 44px; padding: 8px; font-size: 11px; }
  /* pevná výška bez aspect-ratio + min-width:0 u plátna (jako prototyp); jinak se plátno natahuje na min-height:100% a dlaždice pozadí se přepočítávají */
  .bch-hunt-viewport { height: clamp(180px, 42dvh, 360px); max-height: 42dvh; aspect-ratio: auto; }
  .bch-hunt-board { min-width: 0; }
  .bch-hunt-tip { font-size: 10px; line-height: 1.35; margin: 6px 0; }
  .bch-game-win img { height: 90px; }
  .bch-game-win h3 { font-size: 28px; }
  .bch-game-win p { font-size: 12px; }
}

/* hledačka: podkladový obrázek (SVG se 4 fotkami) vyplní celou desku napevno — na mobilních Safari/Chrome se SVG s height:auto
   a atributy width/height občas spočítalo nízké a zbytek desky ukázal fialové pozadí viewportu */
.bch-hunt-background { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.bch-hunt-board { background: #d6c5eb; }
/* deska vždy přesně 3:2 (jako podkladový obrázek); viewport se řídí její výškou — bez fialových pruhů nad/pod obrázkem */
.bch-hunt-viewport { aspect-ratio: auto; height: auto; }
.bch-hunt-board { min-height: 0; }
