/*
 * Komponenty Záhady vody: herní obrazovky (akvárium, úlohy, doplňkové úlohy, trezor) a metodický list.
 * Společné prvky jsou v /core/css/base.css, barvy a efekty v theme.css.
 */

/* ---------- Typografie a panely hry ---------- */

.gold { color: var(--highlight); font-weight: 700; }
.lead { max-width: 900px; margin: 0 auto 24px; text-align: center; font-size: 1.12em; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }

.panels { display: grid; gap: 20px; }
.panels.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.panels.three { grid-template-columns: 1fr; }
@media (min-width: 960px) { .panels.three { grid-template-columns: 1fr 1.1fr 0.9fr; } }
.panel h2 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  text-align: center;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--heading);
  text-shadow: var(--heading-effect);
  border-bottom: 1px solid rgba(150, 228, 255, 0.35);
}
.panel p { margin: 0.5em 0; }
.panel img.tools { border-radius: 14px; margin: 0 auto 12px; }

/* Bublinová tlačítka odpovědí jako ve slidech */
.options { display: grid; gap: 16px; margin-top: 18px; }
.bubble {
  position: relative;
  min-height: 64px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2px solid rgba(200, 244, 255, 0.75);
  background:
    radial-gradient(120% 70% at 30% 10%, rgba(255, 255, 255, 0.45) 0, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, rgba(120, 200, 240, 0.35), rgba(20, 70, 110, 0.55));
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 30, 60, 0.8);
  box-shadow: inset 0 3px 8px rgba(255, 255, 255, 0.35), inset 0 -4px 10px rgba(0, 40, 80, 0.4), 0 0 16px rgba(110, 220, 255, 0.35);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
}
.bubble:hover:not(:disabled) { transform: translateY(-2px); box-shadow: inset 0 3px 8px rgba(255, 255, 255, 0.4), 0 0 26px rgba(127, 233, 255, 0.7); }
.bubble:disabled { cursor: wait; opacity: 0.7; }
.bubble.chosen { opacity: 1; border-color: var(--highlight); }
.question { text-align: center; font-size: 1.25em; margin: 8px 0; }
.solved-note { text-align: center; font-size: 1.15em; margin-top: 24px; }
.solved-note .gold { font-size: 2em; }

.back { display: inline-block; margin-bottom: 4px; color: var(--heading); text-decoration: none; font-weight: 600; text-shadow: 0 1px 4px #000; }
.back:hover { text-decoration: underline; }

/* ---------- Horní lišta ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(2, 26, 46, 0.86);
  border-bottom: 1px solid var(--edge);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.95rem;
}
.topbar[hidden] { display: none; }
.topbar .who { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--heading); white-space: nowrap; }
.timer.warn { color: var(--late); }
.timer.over { color: var(--bad); }
.timer.ok { color: var(--ok); }
.digits { display: flex; gap: 4px; }
.digit {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 32px;
  border-radius: 8px;
  background: rgba(245, 192, 74, 0.18);
  border: 1px solid var(--highlight);
  color: var(--highlight);
  font-weight: 700;
}
.digit.empty { border-color: rgba(150, 228, 255, 0.35); background: transparent; color: var(--muted); }
@media (max-width: 520px) { .topbar .who { display: none; } }

/* ---------- Úvod ---------- */

.hero { width: 100%; max-width: 980px; margin: 0 auto 8px; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.intro-card .hero { margin-bottom: 16px; }
.intro .page-title { font-size: clamp(1.4rem, 3.4vw, 2.4rem); text-transform: uppercase; }
/* Ostatní jazyky: dolní část obrázku bez českého nápisu a název hry jako text. */
.hero-crop { position: relative; overflow: hidden; aspect-ratio: 1600 / 560; }
.hero-crop img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.hero-title { margin: 0 0 12px; text-align: center; font-size: clamp(1.5rem, 4.6vw, 2.4rem); line-height: 1.15; }
.reward { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.reward img { width: 120px; flex: none; border-radius: 12px; }
.start-box { max-width: 720px; margin: 24px auto 0; text-align: center; }
.who-big { margin: 0 0 4px; font-weight: 600; color: var(--heading); }
.note { margin: 8px 0; }

/* ---------- Akvárium ---------- */

.aquarium { position: relative; max-width: 1100px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 2px var(--edge), 0 14px 44px rgba(0, 0, 0, 0.5); }
.aquarium img { width: 100%; }
.hotspot { position: absolute; border-radius: 50%; outline-offset: 2px; transition: box-shadow 0.2s, background 0.2s; }
.hotspot.fish:not(.solved) { animation: pulse 2.6s ease-in-out infinite; }
.hotspot:hover, .hotspot:focus-visible { background: rgba(127, 233, 255, 0.16); box-shadow: 0 0 0 3px rgba(190, 245, 255, 0.9), 0 0 24px rgba(127, 233, 255, 0.9); }
.hotspot.pending { box-shadow: 0 0 0 3px rgba(255, 179, 87, 0.9), 0 0 18px rgba(255, 179, 87, 0.7); animation: none; }
.hotspot.solved { box-shadow: 0 0 0 2px rgba(245, 192, 74, 0.8); }
.hotspot.lock { border-radius: 18%; }
.hotspot.lock.ready { animation: pulse-gold 1.6s ease-in-out infinite; }
.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: clamp(22px, 3vw, 36px);
  height: clamp(22px, 3vw, 36px);
  border-radius: 50%;
  background: var(--highlight);
  color: #3a2500;
  font-weight: 700;
  font-size: clamp(0.8rem, 1.6vw, 1.2rem);
  box-shadow: 0 0 12px rgba(245, 192, 74, 0.9);
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(190, 245, 255, 0); }
  50% { box-shadow: 0 0 0 3px rgba(190, 245, 255, 0.55), 0 0 18px rgba(127, 233, 255, 0.55); }
}
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 192, 74, 0); }
  50% { box-shadow: 0 0 0 4px rgba(245, 192, 74, 0.8), 0 0 26px rgba(245, 192, 74, 0.8); }
}
@media (prefers-reduced-motion: reduce) { .hotspot { animation: none !important; } }

.task-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--edge);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.chip-link img { width: 52px; height: 34px; object-fit: cover; border-radius: 999px; }
.chip-link:hover { box-shadow: var(--heading-effect); }
.chip-link.solved { border-color: var(--highlight); }
.chip-link .digit { width: 26px; height: 26px; }
.pending-mark { color: var(--late); }

/* ---------- Úspěch, trezor, konec ---------- */

.success { display: grid; justify-items: center; gap: 20px; padding-top: 4vh; }
.success-box { max-width: 900px; font-size: clamp(1.2rem, 2.6vw, 1.8rem); font-weight: 600; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.success-box p { margin: 0.3em 0; }
.success-box .gold { font-size: 1.3em; }
.success-fish img { width: min(230px, 60vw); border-radius: 50%; aspect-ratio: 1.6; object-fit: cover; box-shadow: 0 0 0 3px var(--highlight), 0 0 40px rgba(245, 192, 74, 0.6); animation: swim 3s ease-in-out infinite; }
@keyframes swim { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }

.lock-box, .ending { text-align: center; margin-top: 12px; }
.safe { width: 180px; margin: 0 auto 8px; border-radius: 14px; }
.code-form { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 18px 0 6px; }
.code-input {
  width: 9ch;
  padding: 8px 12px;
  font: inherit;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  border-radius: 14px;
  border: 2px solid var(--highlight);
  background: rgba(2, 26, 46, 0.7);
  color: var(--highlight);
}
.msg { min-height: 1.5em; color: var(--late); font-weight: 600; }
.ending { max-width: 860px; margin: 12px auto 0; text-align: left; }
.ending h1, .ending .safe { text-align: center; }
.ending .result { text-align: center; font-size: 1.1em; }
.result.ok strong { color: var(--ok); }
.result.over strong { color: var(--late); }
.findings { padding-left: 1.2em; }
.findings li { margin: 6px 0; }

/* ---------- Doplňkové úlohy ---------- */

.remediation { max-width: 1000px; margin: 0 auto; }
.remediation h2 { color: var(--heading); text-shadow: var(--heading-effect); margin-top: 0; }
.activity { margin: 18px 0 6px; }
.feedback { margin-top: 18px; padding: 16px 18px; border-radius: 16px; background: rgba(40, 140, 90, 0.25); border: 1.5px solid var(--ok); }
.feedback h3 { margin-top: 0; color: var(--ok); }
.feedback .btn { margin-top: 8px; }

.targets { display: grid; gap: 12px; margin-bottom: 18px; }
.targets.groups { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.target { border-radius: 16px; border: 1.5px dashed var(--edge); background: rgba(2, 26, 46, 0.35); padding: 10px; }
.target.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
@media (max-width: 600px) { .target.pair { grid-template-columns: 1fr; } }
.pair-left { font-weight: 600; padding: 6px 8px; }
.target.group h3 { margin: 4px 6px 10px; color: var(--heading); text-align: center; }
.slot { display: flex; flex-wrap: wrap; gap: 8px; min-height: 48px; align-items: center; }
.slot-empty { color: var(--muted); padding: 0 8px; }
.pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 60px; padding: 12px; border-radius: 16px; background: rgba(2, 26, 46, 0.35); }
.card-chip {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--edge);
  background: var(--surface-strong);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.card-chip:hover:not(:disabled) { box-shadow: var(--heading-effect); }
.card-chip.selected { border-color: var(--highlight); box-shadow: 0 0 0 2px var(--highlight), 0 0 16px rgba(245, 192, 74, 0.6); }
.card-chip.correct { border-color: var(--ok); background: rgba(40, 140, 90, 0.35); cursor: default; opacity: 1; }
.card-chip.wrong { border-color: var(--bad); }

.crossword-wrap { display: grid; gap: 20px; }
@media (min-width: 900px) { .crossword-wrap { grid-template-columns: auto 1fr; align-items: start; } }
.crossword {
  --cell: min(34px, calc((100vw - 72px) / var(--cols)));
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  grid-auto-rows: var(--cell);
  justify-content: center;
}
.cw-cell { position: relative; background: #eaf7fc; border: 1px solid #5d8aa3; }
.cw-cell.sol { background: #fff0c4; }
.cw-cell.active { background: #c9f1ff; }
.cw-cell.sol.active { background: #ffe39a; }
.cw-cell.wrong { background: #ffd2d2; }
.cw-cell.correct { background: #c9f3dc; }
.cw-cell input {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: #062a44;
  text-align: center;
  font: inherit;
  font-weight: 700;
  font-size: calc(var(--cell) * 0.55);
  text-transform: uppercase;
  caret-color: transparent;
}
.cw-cell input:focus { outline: 2px solid #f5a623; outline-offset: -2px; }
.cw-num, .cw-sol { position: absolute; font-size: 9px; line-height: 1; color: #2b5068; pointer-events: none; }
.cw-num { top: 2px; left: 2px; }
.cw-sol { bottom: 2px; left: 2px; color: #a36a00; }
.clues h3 { margin: 0 0 6px; color: var(--heading); }
.clue-list { margin: 0 0 14px; padding-left: 0; list-style: none; }
.clue-list li { padding: 6px 10px; border-radius: 10px; cursor: pointer; }
.clue-list li:hover { background: rgba(127, 233, 255, 0.1); }
.clue-list li.active { background: rgba(127, 233, 255, 0.2); }
.tajenka { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; justify-content: center; margin-top: 18px; }
.tajenka-label { margin-right: 8px; font-weight: 600; color: var(--heading); }
.tj { position: relative; display: grid; place-items: center; width: 38px; height: 42px; background: #fff0c4; color: #062a44; border: 1px solid #a37b2a; font-weight: 700; font-size: 1.2rem; }
.tj small { position: absolute; bottom: 1px; left: 3px; font-size: 9px; font-weight: 400; color: #a36a00; }
.tajenka.correct .tj { background: #c9f3dc; }

.multi { display: grid; gap: 10px; }
.multi-opt {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--edge);
  background: var(--surface-strong);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.multi-opt .box { flex: none; width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--accent); }
.multi-opt[aria-pressed='true'] { border-color: var(--highlight); }
.multi-opt[aria-pressed='true'] .box { background: var(--highlight); border-color: var(--highlight); box-shadow: inset 0 0 0 4px var(--surface-strong); }
.multi-opt.correct { border-color: var(--ok); }
.multi-opt:disabled { cursor: default; }

/* ---------- Metodický list (stránka učitele) ---------- */

.method { display: grid; grid-template-columns: minmax(10em, 15em) 1fr; margin: 12px 0 0; }
.method dt, .method dd { padding: 12px 0; border-top: 1px solid var(--divider); }
.method dt { padding-right: 16px; color: var(--heading); font-weight: 600; }
.method dd { margin: 0; }
.method dd > :first-child { margin-top: 0; }
.method dd > :last-child { margin-bottom: 0; }
.method ul, .method ol { padding-left: 1.2em; }
.method li { margin: 4px 0; }
.method h3 { margin: 14px 0 4px; font-size: 1em; color: var(--heading); }
.method h3 + p, .method h3 + ol { margin-top: 0; }
.method-tasks th { padding-top: 10px; }
.method-tasks td { white-space: normal; }
@media (max-width: 700px) {
  .method { grid-template-columns: 1fr; }
  .method dt { padding-bottom: 4px; }
  .method dd { padding-top: 0; border-top: 0; }
}
