/* KRIMISTO, doprovodný web ke hrám. Tokeny převzaté z eshopu. */
:root {
  --b: #15171a;
  --f: #2e3238;
  --d: #eee8dc;
  --e: #8f949c;
  --a: #fca311;
  --a2: #ffc04d;
  --paper: #efe6d2;
  --paper2: #e6dbc2;
  --ink: #1d1f22;
  --ink2: #4b4a45;
  --red: #b3372d;
  --o: Anton, Impact, 'Arial Narrow', sans-serif;
  --i: 'IBM Plex Sans', system-ui, sans-serif;
  --m: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --hand: Caveat, 'Segoe Script', cursive;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gut: 16px;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='.33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}
@media (min-width: 700px) { :root { --gut: 24px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--b);
  color: var(--d);
  font: 400 16px/1.55 var(--i);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
/* světlo lampy vpravo nahoře */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(640px circle at 78% 0%, rgba(252, 163, 17, .09), transparent 70%);
}
body::after { content: ''; position: fixed; inset: 0; z-index: 50; pointer-events: none; background: var(--noise); opacity: .07; mix-blend-mode: overlay; }

.wrap { width: min(1080px, 100% - var(--gut) * 2); margin-inline: auto; }
.mono { font-family: var(--m); font-size: 12px; line-height: 18px; letter-spacing: .12em; text-transform: uppercase; }
header.top, main, footer { position: relative; z-index: 1; }
:focus-visible { outline: 3px solid var(--a); outline-offset: 3px; border-radius: 4px; }

/* hlavička */
header.top { border-bottom: 1px solid var(--f); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 10px 0; padding-top: max(10px, env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--d); text-decoration: none; font: 400 20px/1 var(--o); letter-spacing: .1em; }
.brand img { display: block; width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px var(--a); }
.menu { display: flex; align-items: center; gap: 22px; }
.menu a { color: var(--d); text-decoration: none; font-weight: 600; font-size: 14px; }
.menu a:hover { color: var(--a); }
.menu a.shop { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 12px; background: var(--a); color: var(--b); transition: background .2s; }
.menu a.shop:hover { background: var(--a2); color: var(--b); }

/* tlačítka */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  border: 0; border-radius: 12px;
  background: var(--a); color: var(--b);
  font: 600 16px/1.2 var(--i);
  text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--a2); }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.ghost:hover { background: var(--a); color: var(--b); box-shadow: inset 0 0 0 1.5px var(--a); }
.link { background: none; border: 0; padding: 12px 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.link:hover { color: var(--a); }

/* úvod */
.home { padding: clamp(36px, 8vw, 88px) 0 clamp(48px, 8vw, 96px); }
h1 { margin: 0 0 clamp(54px, 8vw, 72px); font: 400 clamp(52px, 13vw, 104px)/.95 var(--o); text-transform: uppercase; }
h1 em { font-style: normal; color: var(--a); }
.rise { animation: rise .7s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.dossier {
  position: relative; display: block; max-width: 560px;
  padding: 32px 22px 22px;
  background: var(--paper); color: var(--ink);
  border-radius: 3px; text-decoration: none;
  box-shadow: 0 30px 50px -28px #000;
  transition: transform .35s var(--ease);
  animation: rise .7s .15s var(--ease) both;
}
.dossier::after { content: ''; position: absolute; inset: 0; border-radius: 3px; pointer-events: none; background: var(--noise); opacity: .12; mix-blend-mode: multiply; }
.dossier:hover { transform: translateY(-4px); }
.dossier .tab { position: absolute; top: -22px; left: 18px; padding: 6px 12px 5px; background: var(--paper2); border-radius: 4px 4px 0 0; color: var(--ink2); }
.dossier h2 { margin: 0 0 6px; font: 400 clamp(40px, 10vw, 64px)/.98 var(--o); text-transform: uppercase; }
.dossier .sub { color: var(--ink2); }
.dossier .go { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.dossier .btn { background: var(--ink); color: var(--paper); }
.dossier:hover .btn { background: var(--a); color: var(--b); }
.dossier .state { color: var(--ink2); }

/* razítko */
.stamp {
  display: inline-block; padding: 4px 11px 3px;
  border: 3px solid currentColor; border-radius: 4px;
  font: 500 14px/1.15 var(--m); letter-spacing: .14em; text-transform: uppercase;
  filter: url(#rough); mix-blend-mode: multiply; opacity: .9;
  --rot: -6deg;
  transform: rotate(var(--rot));
}
.stamp.red { color: var(--red); }
.stamp.ink { color: var(--ink); }
@keyframes slam {
  0% { opacity: 0; transform: rotate(calc(var(--rot) - 10deg)) scale(2); }
  60% { opacity: 1; transform: rotate(var(--rot)) scale(.94); }
  100% { opacity: .9; transform: rotate(var(--rot)) scale(1); }
}

/* případ */
.stage { width: min(760px, 100% - var(--gut) * 2); margin: 0 auto; padding: clamp(20px, 5vw, 48px) 0 clamp(40px, 8vw, 90px); }

.rail { position: relative; margin: 0 0 22px; padding-bottom: 26px; --p: 0; }
.rail .track { position: absolute; left: 6px; right: 6px; top: 6px; height: 2px; background: var(--f); }
.rail .fill { position: absolute; inset: 0; background: var(--a); transform-origin: left; transform: scaleX(var(--p)); transition: transform .9s var(--ease); }
.rail ol { position: relative; display: flex; justify-content: space-between; margin: 0; padding: 0; list-style: none; }
.rail li { position: relative; width: 14px; height: 14px; border-radius: 3px; background: var(--f); transition: background .3s .4s; }
.rail li span { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); color: var(--e); }
.rail li:first-child span { left: 0; transform: none; }
.rail li:last-child span { left: auto; right: 0; transform: none; }
.rail li.done { background: var(--a); }
.rail li.done span, .rail li.now span { color: var(--d); }
.rail li.now { background: var(--b); box-shadow: 0 0 0 2px var(--a); }
.rail li.now::after { content: ''; position: absolute; inset: 3px; border-radius: 1px; background: var(--a); }

.sheet {
  position: relative; isolation: isolate;
  padding: 20px 16px 22px;
  background: var(--paper); color: var(--ink);
  border-radius: 3px;
  box-shadow: 0 30px 50px -28px #000;
  animation: sheetIn .45s var(--ease) both;
}
@media (min-width: 700px) { .sheet { padding: 32px 36px 36px; } }
.sheet::after { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: 3px; background: var(--noise); opacity: .12; mix-blend-mode: multiply; }
.sheet > * { position: relative; z-index: 1; }
.sheet.leave { animation: sheetOut .22s ease-in both; pointer-events: none; }
@keyframes sheetIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes sheetOut { to { opacity: 0; transform: translateX(-28px); } }

.sheet-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 20px; border-bottom: 1px solid rgba(29, 31, 34, .28); color: var(--ink2); }

.q { margin: 0; font: 500 clamp(18px, 4.6vw, 23px)/1.45 var(--m); color: var(--ink); }

.opts { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.opt {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 14px;
  width: 100%; min-height: 60px; padding: 10px 14px 10px 10px;
  border: 1px solid rgba(29, 31, 34, .32); border-radius: 3px;
  background: rgba(255, 255, 255, .32); color: var(--ink);
  font: 600 16px/1.35 var(--i); text-align: left; cursor: pointer;
  transition: border-color .2s;
  touch-action: manipulation;
}
.opt::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--a); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
@media (hover: hover) {
  .opt:hover:not(:disabled) { border-color: var(--ink); }
  .opt:hover:not(:disabled)::before { transform: scaleX(1); }
}
.opt:active:not(:disabled)::before { transform: scaleX(1); }
.opt .k { display: grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--ink); border-radius: 2px; font: 500 13px/1 var(--m); }
.opt:disabled { cursor: default; }
.opt.right::before { transform: scaleX(1); }
.opt.right { border-color: var(--ink); }
.opt.wrong > span:not(.stamp) { opacity: .45; }
.opt.wrong > span:nth-child(2) { text-decoration: line-through; text-decoration-color: rgba(179, 55, 45, .85); }
.sheet.done .opt:not(.right):not(.wrong) { opacity: .4; }
.opt.wrong, .opt.right { padding-bottom: 46px; }
.opt .stamp { position: absolute; right: 10px; bottom: 8px; font-size: 12px; animation: slam .45s cubic-bezier(.3, 1.4, .5, 1) both; }
@media (min-width: 560px) {
  .opt.wrong, .opt.right { padding-bottom: 10px; padding-right: 140px; }
  .opt .stamp { right: 14px; bottom: auto; top: 50%; translate: 0 -50%; font-size: 13px; }
}

/* odpověď: lístek s poznámkou */
.note {
  margin: 20px 0 0; padding: 18px 18px 16px;
  background: #f7efd9; border-radius: 2px;
  box-shadow: 0 12px 22px -14px rgba(0, 0, 0, .5);
  animation: rise .45s var(--ease) both;
}
.note p { margin: 0; font: 600 23px/1.28 var(--hand); color: #2b2d31; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 20px; }
.actions .btn { max-width: 100%; }
.sheet .btn.ghost { color: var(--ink); }
.hint { margin-top: 14px; padding: 12px 14px; border-left: 4px solid var(--a); background: rgba(255, 255, 255, .35); animation: rise .35s var(--ease) both; }
.hint .mono { display: block; color: var(--ink2); }
.hint p { margin: 2px 0 0; font-weight: 600; }

/* nepovinná šifra */
.cipher { margin-top: 26px; padding-top: 16px; border-top: 1px dashed rgba(29, 31, 34, .4); }
.cipher-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 0; background: none; border: 0; color: var(--ink); font: 600 16px/1.3 var(--i); text-align: left; cursor: pointer; }
.cipher-toggle .mono { color: var(--ink2); margin-left: auto; }
.cipher-toggle::after { content: '+'; font: 500 22px/1 var(--m); }
.cipher-toggle[aria-expanded='true']::after { content: '\2212'; }
.cipher-body[hidden] { display: none; }
.cipher-list .hint { margin-top: 10px; }
.hint.solution { border-left-color: var(--ink); }
.hint.solution .code { font: 500 15px/1.5 var(--m); letter-spacing: .04em; word-break: break-word; }

/* závěr */
.final .sheet { padding-top: 22px; }
.final h1 { margin: 6px 0 0; color: var(--ink); font-size: clamp(48px, 13vw, 92px); }
.final .stamp { position: absolute; z-index: 2; top: 62px; right: 14px; --rot: -9deg; font-size: clamp(14px, 4vw, 24px); padding: 6px 14px 5px; border-width: 4px; animation: slam .55s .4s cubic-bezier(.3, 1.4, .5, 1) both; }
.final .lead { margin: 14px 0 0; font: 600 19px/1.4 var(--i); }
.final .actions .btn:not(.ghost) { background: var(--ink); color: var(--paper); }
.final .actions .btn:not(.ghost):hover { background: var(--a); color: var(--b); }

/* patička */
.foot { margin-top: auto; border-top: 1px solid var(--f); padding: 26px 0 max(30px, env(safe-area-inset-bottom)); font-size: 13px; line-height: 20px; color: var(--e); }
.foot p { margin: 0 0 6px; max-width: 68ch; }
.foot a { color: var(--d); text-underline-offset: 3px; }
.foot a:hover { color: var(--a); }

@media (max-width: 560px) {
  .final .stamp { position: static; margin: 4px 0 2px; }
}
@media (max-width: 420px) {
  .menu .m-games { display: none; }
  .actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
