/* ==========================================================
   VZHLED „Tabule s obálkami“
   Křídová tabule v dřevěném rámu, obálky a sáčky z kraftového
   papíru na provázku. Písma: Caveat Brush (titulek, čísla obálek, nadpisy)
   a Kalam (ručně psané pro texty) – obě s češtinou.
   Barvy a písma jsou v :root.
   ========================================================== */
:root {
  --board: #262b29;
  --board-2: #1d2120;
  --chalk: #f1efe8;
  --chalk-dim: rgba(241, 239, 232, .62);
  --wood: #a9814f;
  --wood-dark: #7c5b35;
  --kraft: #c4a071;
  --kraft-d: #a9844f;
  --sage: #98ab92;
  --sage-d: #7b9075;
  --cream: #efe7d6;
  --cream-d: #d9ccb2;
  --berry: #a8262d;
  --berry-d: #861c22;
  --pine: #3d5f43;
  --twine: #cbb083;
  --ink: #2f2820;
  --ink-soft: #6d5f4d;
  --ok: #2f7a45;
  --ok-chalk: #b5e3be;
  --err: #a8262d;
  --err-chalk: #ffb3b3;
  --font-heading: "Kalam", "Segoe Print", cursive;
  --font-body: "Kalam", "Segoe Print", cursive;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { background: var(--board-2); }
body {
  margin: 0; min-height: 100dvh; overflow-x: hidden;
  color: var(--chalk); font: 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.15; margin: 0; font-weight: 600; }

/* ---------- Scéna ---------- */
.board, #snow, .village, .frame { position: fixed; pointer-events: none; }
.board {
  inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 15%, rgba(255, 255, 255, .06), transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 60%, rgba(255, 255, 255, .045), transparent 70%),
    radial-gradient(ellipse 70% 30% at 40% 90%, rgba(255, 255, 255, .04), transparent 70%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #2b302e, var(--board) 50%, #222624);
}
#snow { inset: 0; width: 100%; height: 100%; z-index: 1; opacity: .7; }
.village { left: 50%; bottom: 12px; transform: translateX(-50%); width: min(100%, 640px); height: auto; aspect-ratio: 480 / 120; z-index: 1; }
/* dřevěný rám po okraji obrazovky */
.frame {
  inset: 0; z-index: 8;
  border: 10px solid var(--wood);
  border-image: repeating-linear-gradient(90deg, #b48b58 0 9px, #a27a49 9px 15px, #b9925f 15px 27px, #94703f 27px 31px) 10;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), inset 0 0 18px rgba(0, 0, 0, .55);
}

.wrap {
  position: relative; z-index: 2; max-width: 480px; margin: 0 auto;
  padding: 0 22px max(130px, calc(110px + env(safe-area-inset-bottom)));
}
.loading { text-align: center; color: var(--chalk-dim); padding-top: 40vh; }

/* ---------- Hlavička ---------- */
.top {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -22px 4px; padding: max(18px, calc(env(safe-area-inset-top) + 12px)) 22px 12px;
  background: linear-gradient(180deg, rgba(34, 38, 36, .97) 70%, rgba(34, 38, 36, 0));
}
.top .brand { font: 600 16px/1.2 var(--font-heading); text-decoration: none; color: var(--chalk); max-width: 62%; }
.top .brand small { display: block; font: 500 11px var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--chalk-dim); margin-bottom: 2px; }
.pill {
  border: 1px solid rgba(241, 239, 232, .3); border-radius: 999px; background: transparent;
  padding: 7px 13px; font-size: 13px; cursor: pointer; max-width: 48%; color: var(--chalk);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none;
}
.menu { position: absolute; right: 22px; top: 100%; margin-top: -4px; }

/* ---------- Papír (karty) ---------- */
.card {
  position: relative; color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, .55), transparent 45%),
    repeating-radial-gradient(circle at 30% 40%, rgba(120, 90, 50, .025) 0 1px, transparent 1px 3px),
    linear-gradient(175deg, #f6f0e2, var(--cream) 60%, #e6dcc6);
  border-radius: 6px; padding: 20px; margin-bottom: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 12px 26px rgba(0, 0, 0, .45), 0 2px 4px rgba(0, 0, 0, .3);
}
.card .label, .card .muted { color: var(--ink-soft); }
.label { font: 600 11px var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--chalk-dim); }
.muted { color: var(--chalk-dim); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.err { color: var(--err-chalk); font-size: 14px; min-height: 1.4em; margin: 0; }
.card .err { color: var(--err); }
.ok { color: var(--ok-chalk); font-size: 14px; margin: 0; }
.card .ok { color: var(--ok); }

/* kolíček – drží papír nahoře */
.pinned { padding-top: 30px; }
.pinned::before {
  content: ""; position: absolute; left: 50%; top: -14px; width: 14px; height: 38px; margin-left: -7px; border-radius: 3px;
  background: linear-gradient(90deg, #c9a46f, #e2c493 45%, #bf9862);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .35);
}
.pinned::after {
  content: ""; position: absolute; left: 50%; top: 2px; width: 18px; height: 4px; margin-left: -9px; border-radius: 2px;
  background: #8a8f93; box-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}

.input {
  width: 100%; min-height: 48px; padding: 11px 14px; color: var(--ink);
  border: 1px solid #cbbd9f; border-radius: 8px; background: #fffdf8; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: #a8997f; }
.input:focus { border-color: var(--pine); box-shadow: 0 0 0 3px rgba(61, 95, 67, .2); }
textarea.input { min-height: 110px; resize: vertical; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 20px; border-radius: 8px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #b8323a, var(--berry) 60%, var(--berry-d)); color: #fff;
  font-weight: 600; letter-spacing: .01em; text-decoration: none;
  box-shadow: 0 2px 0 #5f1418, 0 6px 14px rgba(0, 0, 0, .25);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 #5f1418, 0 3px 8px rgba(0, 0, 0, .25); }
.btn:disabled { opacity: .6; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: inherit; border: 1px solid currentColor; box-shadow: none; opacity: .85; }
.btn.danger { background: transparent; color: var(--err); border: 1px solid rgba(168, 38, 45, .45); box-shadow: none; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.link { background: none; border: 0; padding: 0; color: var(--chalk-dim); cursor: pointer; font-size: 14px; text-decoration: none; }
.card .link { color: var(--ink-soft); }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- Úvod ---------- */
.hero { text-align: center; padding: max(56px, calc(env(safe-area-inset-top) + 40px)) 0 24px; }
.hero .over { font: 600 12px var(--font-body); letter-spacing: .3em; text-transform: uppercase; color: var(--chalk-dim); }
.hero h1 { font: 600 38px/1.12 var(--font-heading); margin-top: 10px; color: var(--chalk); }
.hero h1 em { font-style: italic; font-weight: 500; }
.hero .rule { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; color: var(--chalk-dim); }
.hero .rule::before, .hero .rule::after { content: ""; height: 1px; width: 60px; background: rgba(241, 239, 232, .35); }
.hero .rule svg { width: 34px; height: 20px; }
.hero p { color: var(--chalk-dim); max-width: 330px; margin: 16px auto 0; }
.foot { text-align: center; margin-top: 26px; }
.help-line { text-align: center; color: var(--chalk-dim); font-size: 14px; margin: 22px auto 0; max-width: 330px; }
.help-line a { color: var(--chalk); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* ---------- PIN ---------- */
.pin-name { font: 600 24px var(--font-heading); margin-top: 10px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0 8px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-soft); transition: background .15s, transform .15s; }
.pin-dot.on { background: var(--berry); border-color: var(--berry); transform: scale(1.1); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 8px auto 0; }
.key {
  height: 60px; border-radius: 10px; border: 1px solid #d4c6a8; cursor: pointer; color: var(--ink);
  background: linear-gradient(180deg, #fffdf7, #efe5d0); box-shadow: 0 2px 0 #cdbd9c;
  font: 500 24px var(--font-body); transition: transform .08s, box-shadow .08s;
}
.key:active { transform: translateY(2px); box-shadow: 0 0 0 #cdbd9c; }
.key.blank { visibility: hidden; }

/* ---------- Tajenka křídou ---------- */
.secret-board { margin: 6px 0 4px; }
.secret-board .head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px 10px 16px; border-radius: 14px; cursor: pointer; text-align: left;
  background: rgba(241, 239, 232, .05); border: 1px solid rgba(241, 239, 232, .14); color: var(--chalk);
  font: inherit; transition: background .15s, border-color .15s;
}
.secret-board .head:hover { background: rgba(241, 239, 232, .09); border-color: rgba(241, 239, 232, .26); }
.secret-board .head:focus-visible { outline: 2px solid var(--twine); outline-offset: 2px; }
.secret-board .head h2 { font: italic 500 22px var(--font-heading); color: var(--chalk); }
.secret-board .count { font: 600 14px var(--font-body); color: var(--chalk-dim); white-space: nowrap; }
.secret-board .progress { flex: 1; height: 4px; min-width: 30px; border-radius: 4px; background: rgba(241, 239, 232, .14); overflow: hidden; }
.secret-board .progress i { display: block; height: 100%; border-radius: inherit; background: var(--twine); transition: width .4s; }
.secret-board .toggle { display: inline-flex; align-items: center; gap: 4px; font: 600 13px var(--font-body); color: var(--chalk-dim); white-space: nowrap; }
.secret-board .toggle .icon, .secret-board .toggle svg { width: 16px; height: 16px; transition: transform .25s; }
.secret-board.open .toggle svg { transform: rotate(180deg); }
.slots-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.slots-wrap > .slots { overflow: hidden; }
.secret-board.open .slots-wrap { grid-template-rows: 1fr; }
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 7px; padding-top: 12px; min-height: 0; }
.secret-board:not(.open) .slots { padding-top: 0; }
@media (max-width: 380px) { .secret-board .toggle { font-size: 0; gap: 0; } }

/* ---------- Tlačítko zpět (jednotné) ---------- */
.back {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  height: 38px; padding: 0 15px 0 8px; border-radius: 999px; margin-right: auto;
  background: rgba(241, 239, 232, .07); border: 1px solid rgba(241, 239, 232, .22);
  color: var(--chalk); font: 600 14px/1 var(--font-body); text-decoration: none; white-space: nowrap;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .15s, border-color .15s, transform .08s;
}
.back svg { width: 17px; height: 17px; flex: none; }
.back .chev { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(241, 239, 232, .12); transition: transform .15s; }
.back .chev svg { width: 15px; height: 15px; }
.back:hover { background: rgba(241, 239, 232, .13); border-color: rgba(241, 239, 232, .4); }
.back:hover .chev { transform: translateX(-2px); }
.back:active { transform: translateY(1px); }
.back:focus-visible { outline: 2px solid var(--twine); outline-offset: 2px; }
.btn svg { width: 17px; height: 17px; flex: none; }
.slot {
  min-width: 26px; height: 34px; padding: 0 2px 3px; display: grid; place-items: end center;
  border-bottom: 2px solid rgba(241, 239, 232, .5);
  font: 600 22px/1 var(--font-heading); color: var(--chalk);
}
.slot.pop { animation: chalkIn .9s ease-out both; }
@keyframes chalkIn { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Obálky a sáčky na provázku ---------- */
.lines { margin-top: 44px; }
.line { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding-top: 16px; margin-bottom: 54px; }
.line::before { /* provázek */
  content: ""; position: absolute; left: -10px; right: -10px; top: 4px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 16' preserveAspectRatio='none'%3E%3Cpath d='M0,2 Q50,16 100,2' fill='none' stroke='%23cbb083' stroke-width='1.8' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .4));
}
.pouch {
  position: relative; display: block; aspect-ratio: 3 / 4; margin-top: var(--sag, 0px);
  text-decoration: none; color: var(--ink); cursor: pointer;
  transform-origin: 50% -12px; perspective: 600px;
}
/* kolíček */
.pouch .peg {
  position: absolute; z-index: 6; left: 50%; top: -16px; width: 10px; height: 26px; margin-left: -5px; border-radius: 2px;
  background: linear-gradient(90deg, #c49d68, #e0c08e 45%, #b98f58); box-shadow: 0 2px 3px rgba(0, 0, 0, .4);
}
.pouch .peg::after { content: ""; position: absolute; left: -2px; right: -2px; top: 9px; height: 3px; border-radius: 1px; background: #8b9094; }
/* tělo */
.pouch .body {
  position: absolute; inset: 0; z-index: 3; border-radius: 3px; overflow: hidden;
  background: var(--paper);
  box-shadow: 0 8px 14px rgba(0, 0, 0, .45), 0 1px 2px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.pouch .body::before { /* vlákna papíru */
  content: ""; position: absolute; inset: 0;
  background:
    repeating-radial-gradient(circle at 40% 30%, rgba(80, 50, 20, .035) 0 1px, transparent 1px 3px),
    linear-gradient(170deg, rgba(255, 255, 255, .22), transparent 40%, rgba(0, 0, 0, .08));
}
.env .body::after { /* šikmé spoje obálky */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to top right, transparent 49.4%, rgba(0, 0, 0, .1) 49.6%, rgba(255, 255, 255, .12) 50.4%, transparent 50.6%) 0 100% / 50% 55% no-repeat,
    linear-gradient(to top left, transparent 49.4%, rgba(0, 0, 0, .1) 49.6%, rgba(255, 255, 255, .12) 50.4%, transparent 50.6%) 100% 100% / 50% 55% no-repeat;
}
.bag .body::after { /* boční sklady sáčku */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .1), transparent 9%, transparent 91%, rgba(0, 0, 0, .1)),
    linear-gradient(transparent 82%, rgba(0, 0, 0, .07) 82.5%, transparent 84%);
}
.pouch .num {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 12%; text-align: center;
  font: 600 clamp(22px, 7vw, 30px)/1 var(--font-heading); color: var(--ink);
}
/* chlopeň */
.pouch .flap {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0; transform-origin: top center; transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.3, 1.2, .5, 1);
}
.pouch .flap .f, .pouch .flap .b { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pouch .flap .f { background: var(--paper-d); }
.pouch .flap .b { transform: rotateX(180deg); background: var(--paper); filter: brightness(1.06); }
.env .flap { height: 52%; }
.env .flap .f, .env .flap .b { clip-path: polygon(0 0, 100% 0, 50% 100%); }
.bag .flap { height: 24%; }
.bag .flap .f, .bag .flap .b { border-radius: 3px 3px 0 0; box-shadow: 0 2px 3px rgba(0, 0, 0, .25); }
/* ozdoba na chlopni */
.pouch .deco { position: absolute; z-index: 1; left: 50%; width: 46%; transform: translate(-50%, -50%); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.env .deco { top: 92%; }
.bag .deco { top: 100%; }
/* kartička uvnitř */
.pouch .note {
  position: absolute; z-index: 2; left: 9%; right: 9%; top: 6%; height: 86%; border-radius: 2px;
  background: linear-gradient(180deg, #fffdf6, #f3ead6); box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  display: flex; justify-content: center; padding-top: 3%;
  transition: transform .7s cubic-bezier(.3, 1.3, .5, 1) .25s;
}
.pouch .note b { font: 600 clamp(17px, 5.4vw, 22px)/1 var(--font-heading); color: var(--berry); }
/* otevřená obálka: chlopeň za kartičkou, kartička vyjede nad kolíček */
.pouch.solved .flap, .pouch.opening .flap { transform: rotateX(-178deg); z-index: 1; }
.pouch.solved .note { transform: translateY(-54%); transition: none; }
.pouch.solved .flap { transition: none; }
.pouch.opening .note { transform: translateY(-40%); }
/* kolíček u otevřené obálky uhne na kraj, aby nezakrýval písmeno na kartičce */
.pouch .peg { transition: left .5s ease .2s; }
.pouch.solved .peg, .pouch.opening .peg { left: 12%; }
.pouch.solved .peg { transition: none; }

/* barvy papíru */
.c0 { --paper: var(--kraft); --paper-d: var(--kraft-d); }
.c1 { --paper: var(--sage); --paper-d: var(--sage-d); }
.c2 { --paper: var(--cream); --paper-d: var(--cream-d); }
.final-day { --paper: #a8353b; --paper-d: #872a2f; }
.final-day .num { color: #fbf1e0; }

/* zavřené (budoucí) – zapečetěné voskem */
.pouch.locked .body, .pouch.locked .flap .f { filter: saturate(.7) brightness(.8); }
.pouch .seal {
  position: absolute; z-index: 2; left: 50%; top: 92%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: radial-gradient(circle at 38% 35%, #c9454b, #8e1f25 70%); box-shadow: 0 2px 3px rgba(0, 0, 0, .45), inset 0 0 0 3px rgba(0, 0, 0, .12);
}
.bag .seal { top: 100%; }
.pouch .seal svg { width: 52%; height: 52%; }
.pouch.wiggle { animation: swingHard .7s ease-in-out; }
@keyframes swingHard { 20% { transform: rotate(6deg); } 45% { transform: rotate(-4deg); } 70% { transform: rotate(2deg); } 100% { transform: rotate(0); } }

/* dnešní – houpe se a má štítek */
.pouch.today:not(.solved) { animation: sway 3.2s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(2deg); } 50% { transform: rotate(-2deg); } }
.pouch.today .body { box-shadow: 0 0 0 2px rgba(255, 236, 190, .9), 0 0 20px rgba(255, 225, 160, .4), 0 8px 14px rgba(0, 0, 0, .45); }
.tag {
  position: absolute; z-index: 6; right: -7px; bottom: -9px; padding: 2px 7px 3px; border-radius: 3px;
  background: #fffaf0; color: var(--berry); font: 700 10px var(--font-body); letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .4); transform: rotate(-6deg);
}
/* minulé nevyřešené – tečka „čeká na tebe“ */
.pouch.open:not(.solved):not(.today) .num::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 3px; vertical-align: super; border-radius: 50%; background: var(--berry);
}

/* nástup při prvním vykreslení */
.lines.intro .pouch { animation: drop .7s cubic-bezier(.25, 1.4, .5, 1) both; animation-delay: calc(var(--i) * 40ms); }
.lines.intro .pouch.today:not(.solved) { animation: drop .7s cubic-bezier(.25, 1.4, .5, 1) both, sway 3.2s ease-in-out 1.2s infinite; animation-delay: calc(var(--i) * 40ms), 1.2s; }
@keyframes drop { from { opacity: 0; transform: translateY(-26px) rotate(-6deg); } to { opacity: 1; transform: none; } }

.hint { text-align: center; color: var(--chalk-dim); font-size: 14px; margin: 16px 0 4px; }

/* ---------- Detail dne ---------- */
.day-head { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 24px; }
.day-head .big-num { font: 600 60px/0.9 var(--font-heading); color: var(--chalk); }
.day-head .month { font: italic 500 26px var(--font-heading); color: var(--chalk-dim); }
.riddle { font: 500 20px/1.5 var(--font-heading); white-space: pre-line; margin: 6px 0 0; color: var(--ink); }
.photo { width: 100%; border-radius: 4px; display: block; margin-top: 14px; }
.map-btn { margin-top: 14px; }

.answer-card { text-align: center; }
.tile-input {
  width: 96px; height: 104px; margin: 8px auto 0; display: block; text-align: center; text-transform: uppercase;
  font: 600 52px var(--font-heading); color: #3b2a17; border: 0; border-radius: 10px; outline: none;
  background:
    repeating-linear-gradient(95deg, rgba(120, 80, 30, .08) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #ecd3a5, #d9b67c 60%, #c99f61);
  box-shadow: 0 4px 0 #9b7440, 0 10px 18px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.tile-input:focus { box-shadow: 0 4px 0 #9b7440, 0 10px 18px rgba(0, 0, 0, .3), 0 0 0 4px rgba(61, 95, 67, .3); }
.code-input { text-transform: uppercase; letter-spacing: .18em; text-align: center; font: 600 26px var(--font-heading); }

.solved-card { display: flex; align-items: center; gap: 18px; }
.flip { perspective: 600px; flex: none; }
.flip .tile {
  min-width: 78px; height: 86px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center;
  font: 600 44px var(--font-heading); color: #3b2a17;
  background: repeating-linear-gradient(95deg, rgba(120, 80, 30, .08) 0 2px, transparent 2px 9px), linear-gradient(180deg, #ecd3a5, #d9b67c 60%, #c99f61);
  box-shadow: 0 4px 0 #9b7440, 0 10px 18px rgba(0, 0, 0, .3);
}
.flip.anim .tile { animation: flipIn .9s cubic-bezier(.3, 1.3, .5, 1) both; }
@keyframes flipIn { 0% { transform: rotateY(-180deg); } 100% { transform: rotateY(0); } }
.shake { animation: shake .4s; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.big-icon { width: 40px; height: 40px; margin: 0 auto; color: var(--ink-soft); display: block; }
.headline { margin: 0; font: 600 24px/1.2 var(--font-heading); }

/* ---------- Finále ---------- */
.gift { position: relative; width: 150px; height: 140px; margin: 34px auto 22px; }
.gift .box, .gift .lid { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 3px; }
.gift .box {
  bottom: 0; width: 128px; height: 94px;
  background: linear-gradient(90deg, transparent 46%, #f4ede0 46% 48%, var(--berry) 48% 52%, #f4ede0 52% 54%, transparent 54%), var(--kraft);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .45);
}
.gift .lid {
  bottom: 90px; width: 142px; height: 28px; z-index: 2;
  background: linear-gradient(90deg, transparent 46%, #f4ede0 46% 48%, var(--berry) 48% 52%, #f4ede0 52% 54%, transparent 54%), var(--kraft-d);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .3);
}
.gift .bow { position: absolute; left: 50%; top: -26px; width: 58px; transform: translateX(-50%); }
.gift.open .lid { animation: lidOff 1.1s cubic-bezier(.3, 1.2, .5, 1) forwards; }
.gift .glow { position: absolute; left: 50%; bottom: 80px; width: 10px; height: 10px; transform: translateX(-50%); border-radius: 50%; }
.gift.open .glow { animation: beam 1.4s ease-out .3s forwards; }
@keyframes lidOff { 0% { transform: translateX(-50%); } 40% { transform: translate(-50%, -36px) rotate(-6deg); } 100% { transform: translate(-82%, -22px) rotate(-22deg); } }
@keyframes beam { 50% { box-shadow: 0 0 60px 40px rgba(255, 230, 170, .6); } 100% { box-shadow: 0 0 40px 22px rgba(255, 230, 170, .3); } }
.reveal { animation: fadeUp .8s ease-out .6s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; }
.tab { flex: none; border: 1px solid rgba(241, 239, 232, .3); background: transparent; color: var(--chalk); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.tab.on { background: var(--chalk); color: var(--board); font-weight: 600; }
details.day { border-radius: 6px; margin-bottom: 8px; color: var(--ink); background: linear-gradient(175deg, #f6f0e2, var(--cream)); box-shadow: 0 6px 14px rgba(0, 0, 0, .35); }
details.day > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
details.day > summary::-webkit-details-marker { display: none; }
details.day[open] > summary { border-bottom: 1px solid #d9ccb2; }
details.day .body { padding: 12px; }
details.day .card { box-shadow: 0 4px 10px rgba(0, 0, 0, .15); margin: 12px 0 4px; }
details.day .label { color: var(--ink-soft); }
.dnum { width: 34px; text-align: center; font: 600 22px/1 var(--font-heading); color: var(--berry); }
.dans { min-width: 34px; height: 34px; padding: 0 4px; border-radius: 6px; display: grid; place-items: center; font: 600 18px/1 var(--font-heading); background: #e4d9c2; color: var(--ink-soft); }
.dans.on { background: var(--pine); color: #fff; }
.letter-input { width: 96px; text-align: center; text-transform: uppercase; font: 600 28px var(--font-heading); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #ddd0b6; }
.list-row:last-child { border-bottom: 0; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #e4d9c2; }

.demo-bar { position: relative; z-index: 7; background: #f6efdc; color: var(--ink); font-size: 12px; text-align: center; padding: 6px 10px; margin: 0 -22px; }

.toast {
  position: fixed; z-index: 20; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: #fffaf0; color: var(--ink); padding: 11px 18px; border-radius: 8px; font-weight: 600; font-size: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Titulek ve stylu loňského papírového kalendáře ---------- */
.titleblock { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "strip strip" "year tag"; align-items: center; justify-items: center; gap: 2px 8px; margin: 8px auto 20px; max-width: 360px; }
.titleblock .strip-wrap { grid-area: strip; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); transform: rotate(-2deg); }
.titleblock .strip {
  display: block; padding: 12px 26px 8px; color: #1f1d1b;
  font: 700 46px/1 "Caveat Brush", var(--font-heading); letter-spacing: .03em; white-space: nowrap;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 255, 255, .7), transparent 45%),
    repeating-radial-gradient(circle at 60% 40%, rgba(120, 90, 50, .03) 0 1px, transparent 1px 3px),
    linear-gradient(175deg, #f7f2e6, #ebe2cd 70%, #ddd1b6);
  clip-path: polygon(0 8%, 6% 0, 15% 6%, 26% 1%, 38% 5%, 50% 0, 62% 6%, 74% 1%, 86% 5%, 95% 0, 100% 9%, 98% 30%, 100% 52%, 97% 74%, 100% 93%, 92% 100%, 80% 95%, 67% 100%, 54% 96%, 41% 100%, 28% 95%, 15% 100%, 4% 95%, 0 88%, 2% 66%, 0 44%, 3% 24%);
}
.titleblock .year-wrap { grid-area: year; justify-self: end; transform: rotate(-4deg); }
.titleblock .year {
  display: block; font: 700 62px/1 var(--font-heading); letter-spacing: .02em;
  color: #efe5cf; -webkit-text-stroke: 2px #2a2420; paint-order: stroke fill;
  text-shadow: 3px 4px 0 #1a1612, 0 0 18px rgba(255, 240, 210, .15);
}
.titleblock .tag-wrap { grid-area: tag; justify-self: start; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45)); transform: rotate(5deg); }
.titleblock .tag2 {
  display: block; padding: 7px 14px 5px; color: #2a2016;
  font: 700 26px/1 "Caveat Brush", var(--font-heading); letter-spacing: .06em;
  background: repeating-linear-gradient(95deg, rgba(90, 60, 25, .06) 0 2px, transparent 2px 7px), linear-gradient(175deg, #d6b98b, var(--kraft) 70%, #b08c5c);
  clip-path: polygon(0 10%, 8% 0, 22% 7%, 40% 0, 58% 6%, 76% 0, 92% 6%, 100% 0, 97% 50%, 100% 100%, 84% 94%, 66% 100%, 48% 94%, 30% 100%, 12% 94%, 0 100%, 3% 52%);
}
.titleblock.compact { margin: 2px auto 14px; max-width: 300px; }
.titleblock.compact .strip { font-size: 36px; padding: 9px 20px 6px; }
.titleblock.compact .year { font-size: 44px; -webkit-text-stroke-width: 1.6px; text-shadow: 2px 3px 0 #1a1612; }
.titleblock.compact .tag2 { font-size: 21px; }
@media (max-width: 380px) {
  .titleblock .strip { font-size: 38px; padding: 10px 18px 6px; }
  .titleblock .year { font-size: 50px; }
  .titleblock.compact .strip { font-size: 31px; }
}

/* ---------- Obálky ve stylu titulku: natržený papír, kreslená čísla ---------- */
.pouch { rotate: var(--r, 0deg); filter: drop-shadow(0 7px 7px rgba(0, 0, 0, .45)) drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.pouch .body { box-shadow: none; border-radius: 0; clip-path: var(--tear); }
.pouch .body::before {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .55), transparent 45%),
    repeating-radial-gradient(circle at 60% 40%, rgba(120, 90, 50, .04) 0 1px, transparent 1px 3px),
    linear-gradient(175deg, rgba(255, 255, 255, .18), transparent 45%, rgba(0, 0, 0, .1));
}
.pouch .flap .f, .pouch .flap .b { box-shadow: none; }
.env .flap .f, .env .flap .b { clip-path: polygon(0 0, 7% 3%, 14% 0, 22% 4%, 31% 1%, 40% 4%, 50% 0, 60% 4%, 69% 1%, 78% 4%, 86% 0, 93% 3%, 100% 0, 52% 100%, 48% 100%); }
.bag .flap .f, .bag .flap .b { border-radius: 0; clip-path: polygon(0 6%, 9% 0, 20% 7%, 33% 1%, 46% 6%, 58% 0, 71% 6%, 84% 1%, 94% 7%, 100% 2%, 100% 100%, 88% 94%, 75% 100%, 62% 95%, 50% 100%, 37% 95%, 24% 100%, 11% 94%, 0 100%); }
.pouch .num {
  bottom: 7%; font: 700 clamp(42px, 13vw, 58px)/1 "Caveat Brush", var(--font-heading);
  color: #1f1d1b; letter-spacing: .02em; text-shadow: 1px 1px 0 rgba(255, 255, 255, .55);
}
.final-day .num { color: #fbf1e0; text-shadow: 1px 1px 0 rgba(0, 0, 0, .35); }
.pouch .note { clip-path: polygon(0 4%, 12% 0, 26% 3%, 40% 0, 55% 4%, 70% 0, 85% 3%, 100% 0, 100% 100%, 0 100%); border-radius: 0; }
.pouch .note b { font: 700 clamp(24px, 7.5vw, 30px)/1 "Caveat Brush", var(--font-heading); padding-top: 2px; }

/* barvy papíru jako v titulku */
.c2 { --paper: #efe6d1; --paper-d: #ddd1b6; }   /* krémový pruh */
.c0 { --paper: #c9a676; --paper-d: #ad8a58; }   /* kraftový štítek */
.c1 { --paper: #a5b59d; --paper-d: #879a80; }   /* šalvějový */
.c0 .body { background: repeating-linear-gradient(95deg, rgba(90, 60, 25, .07) 0 2px, transparent 2px 7px), var(--paper); }

/* natržené okraje – tři varianty */
.pouch.t0 { --tear: polygon(0 3%, 8% 0, 19% 3%, 31% 0, 44% 3%, 57% 0, 70% 3%, 83% 0, 93% 3%, 100% 1%, 98% 18%, 100% 36%, 97% 55%, 100% 73%, 98% 90%, 100% 100%, 86% 97%, 72% 100%, 58% 97%, 44% 100%, 30% 97%, 16% 100%, 0 98%, 2% 80%, 0 62%, 3% 44%, 0 26%, 2% 12%); }
.pouch.t1 { --tear: polygon(2% 0, 14% 3%, 27% 0, 40% 2%, 53% 0, 66% 3%, 79% 0, 91% 2%, 100% 0, 97% 16%, 100% 33%, 98% 51%, 100% 69%, 97% 86%, 99% 100%, 85% 98%, 70% 100%, 56% 97%, 41% 100%, 27% 98%, 12% 100%, 1% 97%, 3% 81%, 0 64%, 2% 47%, 0 30%, 3% 14%); }
.pouch.t2 { --tear: polygon(0 1%, 11% 3%, 24% 0, 37% 3%, 50% 1%, 63% 3%, 76% 0, 89% 3%, 100% 0, 98% 15%, 100% 32%, 97% 49%, 100% 66%, 98% 83%, 100% 99%, 89% 100%, 75% 97%, 61% 100%, 47% 97%, 33% 100%, 19% 97%, 6% 100%, 0 97%, 2% 82%, 0 66%, 3% 50%, 0 34%, 2% 18%); }

/* dnešní: zlaté světlo kolem papíru místo rámečku */
.pouch.today .body { box-shadow: none; }
.pouch.today { filter: drop-shadow(0 0 7px rgba(255, 228, 160, .9)) drop-shadow(0 7px 7px rgba(0, 0, 0, .45)); }
.tag { font: 700 15px/1.1 "Caveat Brush", var(--font-body); letter-spacing: .08em; padding: 2px 9px 1px; }
.pouch.open:not(.solved):not(.today) .num::after { width: 6px; height: 6px; vertical-align: 60%; }

/* ---------- Pečeť a ozdoba výš, aby nezakrývaly číslo; zavřená čísla zašedlá ---------- */
.pouch .seal { width: 24%; top: 66%; }
.bag .seal { top: 100%; }
.env .deco { top: 70%; width: 40%; }
.bag .deco { width: 40%; }
.pouch.locked .num { color: rgba(40, 36, 32, .38); text-shadow: none; }
.final-day.locked .num { color: rgba(251, 241, 224, .45); }
.pouch.locked .body::before { background: linear-gradient(180deg, rgba(60, 60, 60, .12), rgba(60, 60, 60, .18)); }

/* ---------- Titulek čte se shora: Tuchoměřický → Adventní kalendář → 2026 ---------- */
.titleblock { grid-template-columns: 1fr; grid-template-areas: "tag" "strip" "year"; gap: 0; }
.titleblock .tag-wrap { justify-self: center; transform: translateX(-28%) rotate(-4deg); margin-bottom: -6px; z-index: 1; }
.titleblock .strip-wrap { transform: rotate(-1.5deg); }
.titleblock .year-wrap { justify-self: center; transform: translateX(22%) rotate(-3deg); margin-top: 4px; }
/* horní lišta jen se jménem domácnosti */
.top { justify-content: flex-end; padding-bottom: 6px; background: transparent; position: relative; }

.qr-box { width: 200px; margin: 12px auto 4px; background: #fff; padding: 10px; border-radius: 6px; }
.qr-box canvas, .qr-box img { width: 100% !important; height: auto !important; display: block; }

/* ---------- Obrazovka s kódem: velká obálka na provázku ---------- */
.code-env { position: relative; margin: 30px 2px 22px; padding-top: 18px; rotate: -.8deg; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .5)) drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.code-env::before { /* provázek */
  content: ""; position: absolute; left: -24px; right: -24px; top: 2px; height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 16' preserveAspectRatio='none'%3E%3Cpath d='M0,2 Q50,16 100,2' fill='none' stroke='%23cbb083' stroke-width='1.8' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
}
.code-env .peg { position: absolute; z-index: 6; top: 2px; width: 12px; height: 32px; border-radius: 2px; background: linear-gradient(90deg, #c49d68, #e0c08e 45%, #b98f58); }
.code-env .peg::after { content: ""; position: absolute; left: -2px; right: -2px; top: 11px; height: 3px; border-radius: 1px; background: #8b9094; }
.code-env .peg.l { left: 18%; } .code-env .peg.r { right: 18%; }
.ce-body {
  position: relative; z-index: 2; color: var(--ink); text-align: center; padding: 128px 24px 26px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, .6), transparent 40%),
    repeating-radial-gradient(circle at 60% 40%, rgba(120, 90, 50, .035) 0 1px, transparent 1px 3px),
    linear-gradient(175deg, #f7f2e6, #ece3cf 65%, #ddd1b6);
  clip-path: polygon(0 1.5%, 8% 0, 19% 1.2%, 31% 0, 44% 1.4%, 57% 0, 70% 1.2%, 83% 0, 93% 1.3%, 100% .4%, 98.5% 18%, 100% 36%, 98% 55%, 100% 73%, 98.5% 90%, 100% 100%, 86% 98.8%, 72% 100%, 58% 98.6%, 44% 100%, 30% 98.8%, 16% 100%, 0 99%, 1.5% 80%, 0 62%, 2% 44%, 0 26%, 1.5% 12%);
}
.ce-body::after { /* šikmé spoje obálky dole */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top right, transparent 49.6%, rgba(0, 0, 0, .07) 49.8%, rgba(255, 255, 255, .25) 50.4%, transparent 50.6%) 0 100% / 50% 34% no-repeat,
    linear-gradient(to top left, transparent 49.6%, rgba(0, 0, 0, .07) 49.8%, rgba(255, 255, 255, .25) 50.4%, transparent 50.6%) 100% 100% / 50% 34% no-repeat;
}
.ce-body > * { position: relative; z-index: 1; }
.ce-flap { position: absolute; z-index: 4; left: 0; right: 0; top: 18px; height: 96px; transform-origin: top center; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3, 1.2, .5, 1); }
.ce-flap .f, .ce-flap .b { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  clip-path: polygon(0 0, 6% 3%, 13% 0, 21% 4%, 30% 1%, 40% 4%, 50% 0, 60% 4%, 70% 1%, 79% 4%, 87% 0, 94% 3%, 100% 0, 51% 100%, 49% 100%); }
.ce-flap .f { background: repeating-linear-gradient(95deg, rgba(90, 60, 25, .07) 0 2px, transparent 2px 7px), linear-gradient(175deg, #d4b585, #b99563); }
.ce-flap .b { transform: rotateX(180deg); background: #efe6d1; }
.ce-flap .seal { position: absolute; left: 50%; top: 100%; width: 54px; height: 54px; transform: translate(-50%, -62%); backface-visibility: hidden; transition: opacity .3s, transform .4s; }
.code-env.opened .ce-flap { transform: rotateX(-178deg); }
.code-env.opened .ce-flap .seal { opacity: 0; transform: translate(-50%, -62%) scale(1.4) rotate(20deg); }
.ce-label { font: 600 11px var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.ce-title { margin: 4px 0 0; font: 700 44px/1 "Caveat Brush", var(--font-heading); color: #1f1d1b; }
.ce-text { margin: 8px auto 0; max-width: 300px; color: var(--ink-soft); font-size: 14px; }
.ce-input {
  display: block; width: 100%; margin: 18px 0 0; padding: 6px 4px; text-align: center; text-transform: uppercase;
  font: 700 34px/1.1 "Caveat Brush", var(--font-heading); letter-spacing: .12em; color: var(--ink);
  background: transparent; border: 0; border-bottom: 2px dashed #9c8a6e; border-radius: 0; outline: none;
}
.ce-input::placeholder { color: #b9a98c; letter-spacing: .06em; }
.ce-input:focus { border-bottom-color: var(--berry); }
.ce-body .err { color: var(--err); margin-top: 8px; }
.ce-body .btn { margin-top: 6px; }

/* natržený papír pro kartičky finále */
.torn-wrap { filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .5)) drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); margin-bottom: 16px; rotate: .6deg; }
.torn-wrap + .torn-wrap { rotate: -.8deg; }
.card.torn {
  border-radius: 0; box-shadow: none; margin-bottom: 0; padding: 24px 22px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, .6), transparent 40%),
    repeating-radial-gradient(circle at 60% 40%, rgba(120, 90, 50, .035) 0 1px, transparent 1px 3px),
    linear-gradient(175deg, #f7f2e6, #ece3cf 65%, #ddd1b6);
  clip-path: polygon(0 2%, 8% 0, 19% 1.6%, 31% 0, 44% 1.8%, 57% 0, 70% 1.6%, 83% 0, 93% 1.7%, 100% .5%, 98.5% 18%, 100% 36%, 98% 55%, 100% 73%, 98.5% 90%, 100% 100%, 86% 98.4%, 72% 100%, 58% 98.2%, 44% 100%, 30% 98.4%, 16% 100%, 0 98.6%, 1.5% 80%, 0 62%, 2% 44%, 0 26%, 1.5% 12%);
}

/* ==========================================================
   Všechny kartičky jako natržený papír.
   Papír je vrstva ::before s natrženým okrajem; stín dělá
   filter na kartičce, takže kopíruje natržený tvar.
   ========================================================== */
.card {
  background: none; box-shadow: none; border-radius: 0; isolation: isolate;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .45)) drop-shadow(0 1px 1px rgba(0, 0, 0, .3));
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, .6), transparent 40%),
    repeating-radial-gradient(circle at 60% 40%, rgba(120, 90, 50, .035) 0 1px, transparent 1px 3px),
    linear-gradient(175deg, #f7f2e6, #ece3cf 65%, #ddd1b6);
  clip-path: polygon(0 1.6%, 8% 0, 19% 1.3%, 31% 0, 44% 1.5%, 57% 0, 70% 1.3%, 83% 0, 93% 1.4%, 100% .4%, 98.6% 18%, 100% 36%, 98.2% 55%, 100% 73%, 98.6% 90%, 100% 100%, 86% 98.7%, 72% 100%, 58% 98.5%, 44% 100%, 30% 98.7%, 16% 100%, 0 98.8%, 1.4% 80%, 0 62%, 1.8% 44%, 0 26%, 1.4% 12%);
}
.card:nth-of-type(even) { rotate: -.5deg; }
.card:nth-of-type(odd) { rotate: .4deg; }
/* kolíček nahoře – jeden pseudo-prvek (dřevo + kovová pružinka) */
.pinned::before { /* u připnuté kartičky nese ::before papír (zruší starý kolíček), kolíček je v ::after */
  top: 0; left: 0; width: auto; height: auto; margin-left: 0; border-radius: 0; box-shadow: none;
}
.pinned::after {
  content: ""; position: absolute; left: 50%; top: -14px; width: 14px; height: 38px; margin-left: -7px; border-radius: 3px;
  background:
    linear-gradient(#8a8f93, #8a8f93) 0 15px / 100% 4px no-repeat,
    linear-gradient(90deg, #c9a46f, #e2c493 45%, #bf9862);
  box-shadow: none;
}
/* starší samostatné varianty už nepotřebují vlastní papír ani stín */
.card.torn { clip-path: none; background: none; }
.torn-wrap { filter: none; }
/* admin – rozbalovací dny taky jako papír */
details.day { background: none; box-shadow: none; border-radius: 0; position: relative; isolation: isolate; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .4)); }
details.day::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(175deg, #f7f2e6, #ece3cf 65%, #e2d7bf);
  /* zuby v pixelech, ne v % výšky – jinak rozbalený (vysoký) den uřízne nahoře řádek s číslem */
  clip-path: polygon(0 4px, 10% 0, 25% 3px, 40% 0, 55% 4px, 70% 0, 85% 3px, 100% 0, calc(100% - 3px) 50%, 100% 100%, 85% calc(100% - 3px), 70% 100%, 55% calc(100% - 4px), 40% 100%, 25% calc(100% - 3px), 10% 100%, 0 calc(100% - 3px), 3px 50%);
}
details.day .card { filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .2)); }
.menu.card { padding: 10px !important; }

/* nadpisy na papírcích stejně jako titulek a obálka s kódem */
.headline { font: 700 36px/1.05 "Caveat Brush", var(--font-heading); color: #1f1d1b; }

/* ---------- Mobil: obálky dál od dřevěného rámu (rám zabírá 10 px) ---------- */
.wrap { padding-left: 30px; padding-right: 30px; }
.top, .demo-bar { margin-left: -30px; margin-right: -30px; padding-left: 30px; padding-right: 30px; }
.line { gap: 10px; }
.line::before { left: -14px; right: -14px; }
.lines { padding: 0 4px; }
@media (max-width: 380px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
  .top, .demo-bar { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
  .line { gap: 8px; }
}

/* sloupce se smí zúžit pod šířku obsahu – jinak mřížka na úzkém mobilu přeteče doprava */
.line, .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* klášter je vyšší než původní vesnice */
.village { aspect-ratio: 480 / 160; bottom: 8px; }

/* ---------- Na šířku (mobil otočený, tablet, počítač): 6 obálek v řadě, texty v čitelné šířce ---------- */
@media (min-width: 700px) {
  .wrap { max-width: 800px; }
  .line { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  .card, .code-env, .torn-wrap, .secret-board, .hint, .day-head, details.day, .tabs, .titleblock + p, .foot, .gift {
    max-width: 540px; margin-left: auto; margin-right: auto;
  }
  .day-head { display: flex; }
  .pouch .num { font-size: 50px; }
}
/* Nízký displej (mobil na šířku): menší klášter a hlavička, ať nezabírají půl obrazovky */
@media (max-height: 520px) {
  .village { width: min(40%, 300px); bottom: 6px; }
  .wrap { padding-bottom: 100px; }
  .hero { padding-top: 22px; padding-bottom: 14px; }
  .titleblock { margin-top: 0; margin-bottom: 12px; }
}
