/* ===== ADHD test – nadväzuje na assets/style.css ===== */
.adhd {
  --ink: #020202;
  --green: #00f67b;
  --pink: #ff2bd6;
  --cyan: #3dfcff;
  --yellow: #fff200;
  --purple: #5f27cd;
  --red: #ff2a3d;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* ---------- Hlavička s logom ---------- */
.adhd-top {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 3vh 1rem 0.5rem;
}
.adhd .logo { font-size: clamp(2rem, 5vw, 3.8rem); }
.adhd .logo a { display: inline-block; }
.adhd .logo a:focus-visible { outline: 4px dashed #fff; outline-offset: 6px; }

.progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  list-style: none;
  font-family: "Jersey 10", sans-serif;
  font-size: 1.25rem;
}
.progress li {
  padding: 0.05em 0.6em;
  border: 3px solid var(--ink);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}
.progress li.done { background: var(--ink); color: var(--green); text-decoration: line-through; }
.progress li.now { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); animation: px-jitter 0.6s steps(1) infinite; }

/* ---------- Spoločné ---------- */
.adhd-main {
  position: relative;
  z-index: 3;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 1rem 16px 4rem;
}
.screen { animation: screen-in 0.35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes screen-in { from { opacity: 0; transform: scale(0.94) rotate(-1deg); } }

.adhd .card { margin-bottom: 1rem; }
.screen-title, .task-title {
  font-family: "Jersey 10", sans-serif;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
}
.screen-title { font-size: clamp(3rem, 8vw, 4.5rem); text-shadow: 3px 3px 0 var(--pink); }
.task-title { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 0.6rem; }
.task-title span {
  display: inline-block; font-size: 0.55em; vertical-align: middle;
  background: var(--ink); color: var(--green); padding: 0.1em 0.4em; margin-right: 0.3em;
}
.lead { font-size: 1.15rem; line-height: 1.45; margin: 0.4rem 0 1rem; }
.muted { color: #5a4d6e; }
.small { font-size: 0.9rem; }
.adhd p + p { margin-top: 0.6rem; }

.btn {
  display: inline-block;
  font-family: "Jersey 10", sans-serif;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.3em 0.8em 0.35em;
  color: var(--ink);
  background: var(--green);
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--green); box-shadow: 5px 5px 0 var(--pink); outline: none; }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--pink); }
.btn.ghost { background: #fff; }
.btn.ghost:hover, .btn.ghost:focus-visible { background: var(--ink); }
.btn.big { font-size: 2.1rem; }
.btn.small { font-size: 1.2rem; box-shadow: 3px 3px 0 var(--ink); border-width: 3px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.row-btns { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1rem; }
.row-btns.center { justify-content: center; }

.adhd input[type=text] {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1.2rem;
  padding: 0.55em 0.7em;
  border: 4px solid var(--ink);
  background: #fff;
  color: var(--ink);
  border-radius: 0;
}
.adhd input[type=text]:focus { outline: none; box-shadow: 5px 5px 0 var(--pink); }
.adhd input.code {
  font-family: "Jersey 10", monospace;
  font-size: 2.6rem;
  letter-spacing: 0.35em;
  text-align: center;
  padding: 0.15em 0.3em 0.15em 0.65em;
}

/* ---------- 1. Intro ---------- */
.intro { max-width: 520px; margin: 4vh auto 0; padding: clamp(1.2rem, 4vw, 2.2rem); }
.intro label { display: block; font-weight: 600; font-size: 1.1rem; margin: 1.1rem 0 0.4rem; }
.intro .btn { margin-top: 1.4rem; width: 100%; }
.form-err { color: #c4002a; font-weight: 600; min-height: 1.4em; margin-top: 0.6rem; }

/* ---------- 2. Pamäť ---------- */
.memory { max-width: 680px; margin: 3vh auto 0; text-align: center; padding: clamp(1.2rem, 4vw, 2.4rem); }
.countdown {
  font-family: "Jersey 10", monospace;
  font-size: clamp(6rem, 22vw, 11rem);
  line-height: 0.9;
  color: var(--red);
  text-shadow: 6px 6px 0 var(--ink);
  animation: pulse 1s steps(2) infinite;
}
.countdown.stop { animation: none; }
@keyframes pulse { 50% { transform: scale(1.08) rotate(-2deg); } }
.memory input.code { max-width: 360px; margin: 0 auto; }
.verdict-box {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  font-size: 1.15rem;
  line-height: 1.45;
  border: 4px solid var(--ink);
  text-align: left;
}
.verdict-box.bad { background: var(--red); color: #fff; box-shadow: 6px 6px 0 var(--ink); }
.verdict-box.good { background: var(--green); color: var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.memory .row-btns { justify-content: center; }

body.flash-red::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: var(--red);
  animation: flash 0.9s steps(2) 3;
}
@keyframes flash { 0% { opacity: 0.75; } 100% { opacity: 0; } }
.shake { animation: shake 0.45s steps(6); }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-10px, 4px) rotate(-1deg); }
  40% { transform: translate(9px, -5px) rotate(1deg); }
  60% { transform: translate(-6px, 3px); }
  80% { transform: translate(5px, -2px) rotate(0.5deg); }
}

/* ---------- Úloha 1 ---------- */
.t1-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.2rem; align-items: stretch; }
.t1-play { display: flex; flex-direction: column; }
.rules { background: #fff7c2; border: 3px dashed var(--ink); padding: 0.7rem 0.9rem; line-height: 1.4; }
.rules .g { color: #00a651; }
.t1-hud, .t2-hud, .t3-hud {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; align-items: center;
  font-family: "Jersey 10", sans-serif; font-size: 1.6rem; line-height: 1.1;
}
.t1-hud { margin: 0.8rem 0 0.4rem; }
.t1-rounds { display: inline-flex; align-items: center; gap: 0.6rem; }
.boxes { display: inline-flex; gap: 3px; }
.boxes i { width: 14px; height: 14px; border: 2px solid var(--ink); background: #fff; }
.boxes i.on { background: var(--purple); }
.t1-hud b, .t2-hud b, .t3-hud b { color: var(--purple); font-weight: 400; }
.t1-stage {
  position: relative;
  flex: 1;
  min-height: 260px;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(45deg, #f4eefe 0 14px, #ebe2fb 14px 28px);
  border: 3px solid var(--ink);
  overflow: hidden;
}
.t1-btn {
  position: relative;
  font-family: "Jersey 10", sans-serif;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1;
  min-width: 7.5em;
  padding: 0.45em 0.6em 0.5em;
  border: 5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 8px 0 var(--ink);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1), background 0.08s;
  touch-action: manipulation;
  user-select: none;
}
.t1-btn:active:not(:disabled) { box-shadow: 0 2px 0 var(--ink); translate: 0 6px; }
.t1-btn:disabled { cursor: default; }
.t1-btn.pink   { background: #ff8fd8; }
.t1-btn.green  { background: #19e05f; }
.t1-btn.teal   { background: #14c8b4; }
.t1-btn.red    { background: #ff3b3b; color: #fff; }
.t1-btn.yellow { background: #ffe600; }
.t1-btn.blue   { background: #4b7bec; color: #fff; }
.t1-btn.orange { background: #ff9f1a; }
.t1-btn.gray   { background: #b9b4c4; }
.t1-btn.boom   { background: var(--ink); color: var(--red); }
.t1-btn.square { border-radius: 0; }
.t1-btn.rounded { border-radius: 18px; }
.t1-btn.pill { border-radius: 999px; }
.t1-boom {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-content: center; text-align: center;
  background: rgba(255, 42, 61, 0.88);
  color: #fff; pointer-events: none;
  animation: boom 1.3s steps(8) forwards;
}
.t1-boom b { font-family: "Jersey 10", sans-serif; font-weight: 400; font-size: clamp(4rem, 12vw, 7rem); line-height: 0.9; text-shadow: 5px 5px 0 var(--ink); }
.t1-boom span { font-family: "Jersey 10", sans-serif; font-size: 1.8rem; text-shadow: 3px 3px 0 var(--ink); }
@keyframes boom {
  0% { opacity: 0; transform: scale(1.4); }
  10% { opacity: 1; transform: scale(1); }
  20%, 40%, 60% { background: rgba(2, 2, 2, 0.85); }
  30%, 50% { background: rgba(255, 42, 61, 0.9); }
  85% { opacity: 1; }
  100% { opacity: 0; }
}
.t1-msg.bad { background: #c4002a; color: #fff !important; padding: 0.3rem 0.6rem; border: 3px solid var(--ink); }
.t1-msg { min-height: 1.6em; margin-top: 0.7rem; font-weight: 600; font-size: 1.1rem; }
.t1-msg.good { color: #00863f; }

.t1-ads { position: relative; display: flex; flex-direction: column; background: rgba(2, 2, 2, 0.82); color: #fff; min-height: 420px; }
.ads-label { font-family: "Jersey 10", sans-serif; font-size: 1.2rem; color: var(--yellow); letter-spacing: 0.05em; }
.ads-field { position: relative; flex: 1; overflow: hidden; }
.ad {
  position: absolute;
  width: 82%;
  max-width: 82%;
  padding: 0.6rem 0.75rem 0.7rem;
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  animation: ad-in 0.3s cubic-bezier(.2, 1.8, .4, 1);
}
.ad { font-size: 1.3rem; padding: 0.9rem 1rem 1rem !important; }
.ad small { display: block; font-family: "Jersey 10", sans-serif; font-weight: 400; font-size: 1.2rem; opacity: 0.7; }
.ad .btn { display: block; width: fit-content; font-size: 1.5rem; margin-top: 0.5rem; box-shadow: 3px 3px 0 var(--ink); border-width: 3px; }
.ad.out { animation: ad-out 0.25s forwards; }
.ad.blink { animation: ad-in 0.3s cubic-bezier(.2, 1.8, .4, 1), ad-blink 0.6s steps(2) 0.3s infinite; }
@keyframes ad-in { from { transform: scale(0.2) rotate(-25deg); opacity: 0; } }
@keyframes ad-out { to { transform: scale(0.1) rotate(30deg); opacity: 0; } }
@keyframes ad-blink { 50% { filter: invert(1); } }

/* ---------- Úloha 2 ---------- */
.t2-intro, .t3-intro { max-width: 760px; margin: 0 auto; line-height: 1.45; padding: clamp(1.1rem, 3vw, 2rem); }
.t2-hud, .t3-hud { padding: 0.6rem 1rem; }
.t2-hud .btn { margin-left: auto; }
.t2-board { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem; align-items: start; }
#t2-canvas {
  display: block;
  width: 100%;
  height: clamp(340px, calc(100vh - 280px), 640px);
  background: #000;
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  image-rendering: pixelated;
}
.t2-side .side-title { font-family: "Jersey 10", sans-serif; font-size: 1.5rem; margin-bottom: 0.4rem; }
.hint { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.6rem; border: 3px solid var(--ink); }
.hint-label { font-family: "Jersey 10", sans-serif; font-size: 1.3rem; line-height: 1; }
.hint-arrows { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.hint-arrows i { font-style: normal; font-family: "Jersey 10", sans-serif; font-size: 1.7rem; line-height: 1; padding: 0.1em 0.35em; }
.hint.real { background: #0b1f12; color: var(--green); box-shadow: 4px 4px 0 var(--green); }
.hint.real .hint-arrows i { background: var(--green); color: var(--ink); border: 2px solid var(--ink); }
.hint.fake { background: #2a0820; color: var(--pink); box-shadow: 4px 4px 0 var(--pink); transform: rotate(-1.5deg); }
.hint.fake .hint-arrows i { background: transparent; color: var(--pink); border: 2px dashed var(--pink); font-style: italic; }
.hint.demo { max-width: 340px; margin: 0.4rem 0 0.8rem; }
.hint-text { font-size: 0.95rem; line-height: 1.3; }
.hint.hidden-hint { background: #f3f0fa; color: var(--ink); border-style: dashed; margin-bottom: 0.7rem; }
.t2-view { position: relative; }
.t2-memo {
  position: absolute; left: 12px; top: 12px;
  width: min(320px, 70%); z-index: 6; margin: 0 !important; background: #fff;
  padding: 0.7rem 0.8rem !important;
}
.t2-memo.pop { animation: sign-in 0.3s cubic-bezier(.2, 1.8, .4, 1); transform-origin: top left; }
@keyframes sign-in { from { transform: scale(0.3) rotate(-8deg); opacity: 0; } }
.t2-memo.fake { background: #2a0820; border-color: var(--pink); box-shadow: 6px 6px 0 var(--pink); }
.t2-memo.fake .memo-kicker { color: var(--pink); }
.t2-memo .muted { margin-top: 0.4rem; }
.memo-kicker { font-family: "Jersey 10", sans-serif; font-size: 1.3rem; line-height: 1.1; margin-bottom: 0.5rem; }
.legend { list-style: none; display: grid; gap: 0.35rem; font-size: 0.92rem; line-height: 1.25; margin-bottom: 0.4rem; }
.legend li { display: flex; gap: 0.5rem; align-items: center; }
.legend i { flex: none; display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; font-style: normal; font-weight: 700; border: 2px solid var(--ink); }
.legend .lg-new { background: #fff200; }
.legend .lg-old { background: #00f67b; }
.legend .lg-fake { background: #2a0820; color: var(--pink); border-color: var(--pink); }
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(2, 64px);
  gap: 6px;
  justify-content: center;
  margin-top: 1.2rem;
}
.dpad button {
  font-size: 1.9rem; font-weight: 700;
  border: 4px solid var(--ink); background: #fff; box-shadow: 4px 4px 0 var(--ink); cursor: pointer;
  touch-action: manipulation;
}
.dpad button:active { background: var(--green); transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.dpad [data-dir=up] { grid-column: 2; grid-row: 1; }
.dpad [data-dir=left] { grid-column: 1; grid-row: 2; }
.dpad [data-dir=down] { grid-column: 2; grid-row: 2; }
.dpad [data-dir=right] { grid-column: 3; grid-row: 2; }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(27, 16, 48, 0.55);
}
.modal-box { width: min(420px, 100%); text-align: center; animation: ad-in 0.3s cubic-bezier(.2, 1.8, .4, 1); }
.modal-kicker { font-family: "Jersey 10", sans-serif; font-size: 1.3rem; color: var(--purple); }
.modal-q { font-family: "Jersey 10", sans-serif; font-size: 3.4rem; line-height: 1; margin: 0.3rem 0 0.8rem; }
.modal input[type=text] { text-align: center; font-size: 1.8rem; }
.modal-fb { min-height: 1.5em; font-weight: 600; margin: 0.5rem 0; }
.modal-fb.bad { color: #c4002a; }
.modal-fb.good { color: #00863f; }
.odrb-box { width: min(480px, 100%); }
.odrb-txt { font-size: 1.2rem; line-height: 1.45; margin: 0.4rem 0 1.2rem; }
.odrb-txt:focus { outline: none; }
#odrb .row-btns { justify-content: center; flex-wrap: wrap; }

/* ---------- Úloha 3: Hacker pod tlakom ---------- */
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 0.35em; text-align: center;
  font-family: "Jersey 10", monospace; font-size: 1.25em; line-height: 1.2;
  background: var(--ink); color: var(--green); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--pink);
}
.hk-rules { margin: 0.6rem 0 0.8rem 1.2rem; line-height: 1.45; }
.hk-rules li + li { margin-top: 0.25rem; }
.hk-rules .g { color: #00863f; }
.hk-rules .r { color: #c4002a; }
.hk-demo {
  display: inline-flex; margin: 0.2rem 0 0.6rem; padding: 0.4rem 0.6rem;
  background: #000; border: 4px solid var(--ink); box-shadow: 4px 4px 0 var(--purple);
}
.hk-demo span, .hk-cell {
  font-family: "Jersey 10", monospace; line-height: 1; text-align: center; color: #e4e4ea;
  border: 3px solid transparent; border-left-width: 0; border-right-width: 0;
}
.hk-demo span { font-size: 1.9rem; padding: 0.05em 0.35em; }
.t3-hud .low { color: var(--red); animation: pulse 0.5s steps(2) infinite; display: inline-block; }

.hk-device {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  background: #1b2aa0;
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 0 12px 12px;
}
.hk-bar {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.45rem 0.2rem;
  font-family: "Jersey 10", monospace; font-size: 1.3rem; line-height: 1; color: #c9d1ff;
}
.hk-dots { display: inline-flex; gap: 5px; }
.hk-dots i { width: 12px; height: 12px; border: 2px solid var(--ink); background: var(--pink); }
.hk-dots i:nth-child(2) { background: var(--yellow); }
.hk-dots i:nth-child(3) { background: var(--green); }
.hk-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hk-sig { color: var(--green); letter-spacing: -0.1em; }
.hk-screen {
  position: relative;
  overflow: hidden;
  background: #000;
  border: 4px solid var(--ink);
  padding: clamp(0.8rem, 3vw, 1.6rem) clamp(0.4rem, 3vw, 2rem) 1rem;
  text-align: center;
}
.hk-screen::after {           /* CRT riadky */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 4px);
}
.hk-label { font-family: "Jersey 10", monospace; font-size: 1.1rem; letter-spacing: 0.3em; text-transform: uppercase; color: #7d7d92; }
.hk-target {
  font-family: "Jersey 10", monospace;
  font-size: clamp(2.8rem, 9vw, 4.6rem);
  line-height: 1;
  color: var(--red);
  text-shadow: 0 0 14px rgba(255, 42, 61, 0.55);
  letter-spacing: 0.04em;
}
.hk-target.boot { animation: hk-boot 0.45s steps(4); }
@keyframes hk-boot { 0% { opacity: 0; transform: scaleY(0.1); } 50% { opacity: 1; filter: invert(1); } }
.hk-clock { font-family: "Jersey 10", monospace; font-size: 1.7rem; color: #2fbf3a; margin: 0.3rem 0 0.7rem; }
.hk-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  row-gap: 0.15rem;
  max-width: 640px;
  margin: 0 auto;
  touch-action: manipulation;
  user-select: none;
}
.hk-cell { font-size: clamp(1.35rem, 5vw, 2.6rem); padding: 0.06em 0; }
.hk-demo .sel, .hk-cell.sel {
  color: var(--red);
  border-top-color: #2ee59d; border-bottom-color: #2ee59d;
  background: rgba(46, 229, 157, 0.07);
}
.hk-demo .sl, .hk-cell.sl { border-left: 3px solid #2ee59d; border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.hk-demo .sr, .hk-cell.sr { border-right: 3px solid #2ee59d; border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.hk-status { min-height: 1.4em; margin-top: 0.8rem; font-family: "Jersey 10", monospace; font-size: 1.6rem; line-height: 1.1; color: #7d7d92; }
.hk-status.good { color: var(--green); text-shadow: 0 0 10px rgba(0, 246, 123, 0.6); }
.hk-status.bad { color: var(--red); }
.hk-pen {
  position: absolute; left: 50%; top: 38%; z-index: 2;
  font-family: "Jersey 10", monospace; font-size: clamp(3.5rem, 12vw, 6rem); line-height: 1;
  color: var(--red); text-shadow: 4px 4px 0 var(--ink);
  opacity: 0; pointer-events: none; transform: translate(-50%, 0);
}
.hk-pen.show { animation: hk-pen 1.2s ease-out; }
@keyframes hk-pen { 0% { opacity: 1; transform: translate(-50%, 0) scale(1.6); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
.hk-device.alarm { animation: hk-alarm 0.9s steps(2); }
.hk-device.alarm .hk-screen { animation: hk-red 0.9s steps(3); }
@keyframes hk-alarm { 0%, 100% { transform: none; } 25% { transform: translate(-6px, 2px); } 50% { transform: translate(6px, -2px); } 75% { transform: translate(-3px, 1px); } }
@keyframes hk-red { 0%, 66% { background: #3a0008; } }
.hk-device.ok .hk-screen { animation: hk-green 0.7s steps(2); }
@keyframes hk-green { 0%, 50% { background: #002a12; } }
.hk-device.off .hk-grid { opacity: 0.25; filter: grayscale(1); }
.hk-pad { display: none; }
.hk-help { text-align: center; margin-top: 0.8rem; }
.t3-panel { text-align: center; max-width: 820px; margin: 1rem auto 0; }
.t3-panel h3 { font-family: "Jersey 10", sans-serif; font-weight: 400; font-size: 2.3rem; line-height: 1; margin-bottom: 0.5rem; }
.t3-panel .row-btns { justify-content: center; }
.t3-hud { max-width: 820px; margin-left: auto; margin-right: auto; }

@media (pointer: coarse) {
  .hk-help { display: none; }
  .hk-pad {
    display: grid; grid-template-columns: repeat(3, 58px) 1fr; grid-template-rows: repeat(2, 54px);
    gap: 6px; max-width: 420px; margin: 0.9rem auto 0;
  }
  .hk-pad button {
    font-family: "Jersey 10", sans-serif; font-size: 1.7rem; line-height: 1;
    background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
    touch-action: manipulation;
  }
  .hk-pad button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
  .hk-pad [data-mv="-10"] { grid-column: 2; grid-row: 1; }
  .hk-pad [data-mv="-1"] { grid-column: 1; grid-row: 2; }
  .hk-pad [data-mv="10"] { grid-column: 2; grid-row: 2; }
  .hk-pad [data-mv="1"] { grid-column: 3; grid-row: 2; }
  .hk-pad .ok { grid-column: 4; grid-row: 1 / 3; background: var(--green); font-size: 2rem; }
}
@media (max-width: 480px) {
  .hk-device { padding: 0 6px 6px; box-shadow: 5px 5px 0 var(--ink); }
  .hk-bar { font-size: 1.1rem; }
  .hk-cell { border-top-width: 2px; border-bottom-width: 2px; }
  .hk-cell.sl { border-left-width: 2px; } .hk-cell.sr { border-right-width: 2px; }
}

/* ---------- Protokol ---------- */
.protocol {
  position: relative;
  max-width: 820px;
  margin: 0 auto 1.5rem;
  padding: clamp(1.2rem, 4vw, 3rem);
  background: #fffdf5;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
  box-shadow: 10px 10px 0 var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
  overflow: hidden;
}
.protocol::before {
  content: "";
  position: absolute; inset: 10px;
  border: 1px solid #1a1a1a;
  pointer-events: none;
}
.pr-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 3px double #1a1a1a; padding-bottom: 0.8rem; margin-bottom: 1rem; }
.pr-inst { font-variant: small-caps; letter-spacing: 0.05em; font-size: 1.05rem; }
.pr-inst b { display: block; font-size: 1.3rem; }
.pr-no { text-align: right; font-size: 0.9rem; }
.protocol h2 { text-align: center; font-size: clamp(1.4rem, 3.5vw, 2rem); letter-spacing: 0.08em; text-transform: uppercase; margin: 0.4rem 0 1rem; }
.pr-meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1rem; margin-bottom: 1.2rem; }
.pr-meta dt { font-weight: 700; }
.pr-score { position: relative; display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; border: 2px solid #1a1a1a; padding: 0.8rem 1rem; margin-bottom: 1.2rem; background: #fff; }
.pr-pct { font-family: "Jersey 10", monospace; font-size: clamp(4rem, 12vw, 6rem); line-height: 0.9; color: #b0001e; }
.pr-grade small { display: block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pr-grade { flex: 1; min-width: 200px; padding-right: 9rem; }
.pr-grade b { font-size: 1.35rem; }
.protocol table { width: 100%; border-collapse: collapse; margin-bottom: 1.2rem; font-size: 0.95rem; }
.protocol th, .protocol td { border: 1px solid #1a1a1a; padding: 0.35rem 0.5rem; text-align: left; vertical-align: top; }
.protocol th { background: #efeadb; }
.protocol h3 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 1rem 0 0.3rem; }
.pr-sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.pr-sign .line { min-width: 220px; border-top: 1px solid #1a1a1a; padding-top: 0.2rem; font-size: 0.9rem; text-align: center; }
.pr-sign .scrawl { font-family: "Jersey 10", cursive; font-size: 2rem; transform: rotate(-6deg); display: block; margin-bottom: -0.3rem; color: #1d2a8f; }
.stamp {
  position: absolute;
  right: 1.2rem;
  top: 50%;
  margin-top: -1.6em;
  padding: 0.3rem 0.8rem;
  border: 5px double #c4002a;
  color: #c4002a;
  font-family: "Jersey 10", sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1;
  text-align: center;
  transform: rotate(-14deg);
  opacity: 0.8;
  mix-blend-mode: multiply;
  pointer-events: none;
  animation: stamp 0.5s cubic-bezier(.2, 1.6, .4, 1) 0.6s backwards;
}
@keyframes stamp { from { transform: rotate(-14deg) scale(3); opacity: 0; } }
.pr-rank { font-style: italic; margin-top: 0.4rem; }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  .t1-grid { grid-template-columns: 1fr; }
  .t1-ads { order: -1; min-height: 190px; }
  .t2-board { grid-template-columns: 1fr; }
  #t2-canvas { height: 56vh; min-height: 300px; }
  .dpad {
    position: fixed; right: 12px; bottom: 12px; z-index: 30; margin: 0;
    grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 5px;
    opacity: 0.9;
  }
  .t2-side { margin-bottom: 140px; }
  .t2-memo { position: static; width: auto; margin-top: 0.8rem !important; }
}
@media (max-width: 480px) {
  .btn.big { font-size: 1.7rem; }
  .t1-hud, .t2-hud, .t3-hud { font-size: 1.3rem; gap: 0.3rem 1rem; }
  .stamp { position: static; display: inline-block; margin: 0.5rem 0; }
  .pr-grade { padding-right: 0; }
}

@media print {
  body { background: #fff !important; animation: none !important; }
  .blob, #trail, .adhd-top, .no-print { display: none !important; }
  .protocol { box-shadow: none; margin: 0; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .countdown, .progress li.now, .ad, .ad.blink, .stamp, .hk-target.boot, .hk-pen.show, .hk-device.alarm, .t3-hud .low, body.flash-red::after { animation-duration: 0.01s !important; animation-iteration-count: 1 !important; }
}
