/* Live-Phishing-Quiz. Farben und Schrift aus der Präsentation «Cyber Security 101». */

:root {
  --slate: #3a4241;
  --slate-deep: #2c3332;
  --slate-line: #4c5554;
  --ink: #111312;
  --paper: #fbfcfb;
  --fog: #c9d3d1;
  --lime: #c9f5ae;
  --mint: #9de5cb;
  --sky: #7ec3d6;
  --coral: #ff8f78;
  --coral-deep: #e0573c;

  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--slate);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
[hidden] { display: none !important; }

/* Formen für Antwortoptionen: Farbe plus Form, damit niemand nur auf Farbe angewiesen ist */
.shape { display: inline-block; flex: none; width: 1em; height: 1em; background: currentColor; }
.shape-0 { clip-path: polygon(50% 4%, 96% 92%, 4% 92%); }
.shape-1 { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.shape-2 { border-radius: 50%; }
.shape-3 { border-radius: 3px; }

.opt-0 { --c: var(--lime); }
.opt-1 { --c: var(--sky); }
.opt-2 { --c: var(--mint); }
.opt-3 { --c: var(--fog); }
.opt-phishing { --c: var(--coral); }
.opt-echt { --c: var(--mint); }

/* =====================================================================
   Moderationsansicht (Beamer, 16:9)
   ===================================================================== */

.host {
  font-size: clamp(14px, 1.15vw, 26px);
  overflow: hidden;
}
.host .screen { position: fixed; inset: 0; display: flex; flex-direction: column; }

.host-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1em 2em; font-size: 0.95em; color: var(--fog);
}
.host-bar strong { color: var(--paper); font-weight: 700; }

/* Lobby */
.lobby { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3em; padding: 2em 4em 2.5em; flex: 1; min-height: 0; }
.lobby-left { display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.lobby h1 {
  font-size: 5.6em; line-height: 0.95; font-weight: 800; letter-spacing: -0.035em;
}
.lobby h1 .q { color: var(--lime); }
.lobby .lede { font-size: 1.5em; margin-top: 0.8em; color: var(--fog); max-width: 24em; line-height: 1.35; }
.lobby .players { margin-top: 2em; min-height: 0; overflow: hidden; }
.lobby .count { font-size: 1.15em; color: var(--fog); margin-bottom: 0.7em; }
.lobby .count b { color: var(--paper); font-size: 1.6em; font-weight: 800; margin-right: 0.2em; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5em; max-height: 10.5em; overflow: hidden; }
.chip {
  background: var(--slate-deep); border: 1px solid var(--slate-line);
  padding: 0.35em 0.85em; border-radius: 999px; font-size: 1.05em; font-weight: 600;
  animation: chip-in 0.35s ease-out;
}
.chip:hover { border-color: var(--coral); text-decoration: line-through; }
@keyframes chip-in { from { transform: scale(0.6); opacity: 0; } }

.lobby-right { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2em; }
.qr-card {
  background: var(--paper); color: var(--ink); border-radius: var(--r-lg);
  padding: 1.6em; display: flex; flex-direction: column; align-items: center; gap: 0.9em;
  box-shadow: 0 0 0 0.6em rgba(201, 245, 174, 0.12);
}
.qr-card canvas, .qr-card img { width: min(30vw, 52vh); height: auto; image-rendering: pixelated; display: block; }
.qr-url { font-size: 1.3em; font-weight: 700; letter-spacing: -0.01em; }

.btn-primary {
  background: var(--lime); color: var(--ink); font-weight: 800; font-size: 1.35em;
  padding: 0.75em 1.8em; border-radius: 999px;
}
.btn-primary:disabled { opacity: 0.35; cursor: default; }
.btn-ghost { color: var(--fog); font-size: 0.9em; padding: 0.4em 0.8em; border-radius: var(--r-sm); }
.btn-ghost:hover { color: var(--paper); background: var(--slate-deep); }
.keyhint { color: var(--fog); font-size: 0.85em; }

/* Frage und Auflösung */
.timeline { height: 0.5em; background: var(--slate-deep); position: relative; }
.timeline i {
  position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--lime);
  transform-origin: left; will-change: transform;
}
.timeline.low i { background: var(--coral); }

.stage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 2.5em; padding: 1.2em 3em 2em; }

.mail-col { display: flex; flex-direction: column; min-height: 0; gap: 0.7em; }
.mail-card {
  position: relative; flex: 1; min-height: 0; background: #fff; border-radius: var(--r-md);
  overflow: hidden; box-shadow: 0 1.2em 3em rgba(0, 0, 0, 0.28);
}
.mail-card iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

.linkhint {
  display: flex; gap: 0.7em; align-items: baseline;
  background: var(--slate-deep); border-radius: var(--r-sm); padding: 0.6em 0.9em;
  font-size: 0.95em; color: var(--fog);
}
.linkhint .lbl { flex: none; }
.linkhint code { font-family: inherit; color: var(--paper); font-weight: 600; word-break: break-all; }
.reveal .linkhint.bad code { color: var(--coral); }

/* Stempel: der eine grosse Moment der Auflösung */
.stamp {
  position: absolute; left: 50%; top: 42%;
  transform: translate(-50%, -50%) rotate(-11deg);
  font-size: 5.2em; font-weight: 900; letter-spacing: 0.04em;
  padding: 0.12em 0.45em; border: 0.11em solid currentColor; border-radius: 0.18em;
  background: rgba(255, 255, 255, 0.82); pointer-events: none;
  animation: stamp-in 0.42s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.stamp.phishing { color: var(--coral-deep); }
.stamp.echt { color: #1f8a63; }
@keyframes stamp-in {
  from { transform: translate(-50%, -50%) rotate(-11deg) scale(2.2); opacity: 0; }
}

.side { display: flex; flex-direction: column; min-height: 0; padding-top: 0.4em; }
.qnum { color: var(--fog); font-size: 1.05em; }
.prompt { font-size: 3.3em; font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; margin: 0.25em 0 0.6em; }

.options { display: grid; gap: 0.7em; }
.options.binary { grid-template-columns: 1fr 1fr; }
.option {
  display: flex; align-items: center; gap: 0.75em;
  background: var(--slate-deep); border-left: 0.45em solid var(--c);
  border-radius: var(--r-sm); padding: 0.85em 1em; font-size: 1.35em; font-weight: 700;
  position: relative; overflow: hidden;
}
.option .shape { color: var(--c); font-size: 0.9em; }
.options.binary .option { font-size: 2em; padding: 0.7em 0.8em; }
.option .bar {
  position: absolute; inset: 0 auto 0 0; background: var(--c); opacity: 0.16;
  width: 0; transition: width 0.6s ease-out;
}
.option .num { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--fog); font-weight: 600; position: relative; }
.option .txt, .option .shape { position: relative; }
/* In der Auflösung braucht die Erklärung Platz: Frage und Optionen werden kompakter */
.reveal .prompt { font-size: 2.5em; margin-bottom: 0.5em; }
.reveal .option { font-size: 1.15em; padding: 0.6em 1em; }
.reveal .options.binary .option { font-size: 1.6em; padding: 0.55em 0.8em; }
.reveal .option.wrong { opacity: 0.4; }
.reveal .option.right { background: var(--paper); color: var(--ink); }
.reveal .option.right .num { color: var(--ink); }
.reveal .option.right .bar { opacity: 0.45; }

.status { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 1em; }
.answered { font-size: 1.2em; color: var(--fog); }
.answered b { font-size: 2.2em; color: var(--paper); font-weight: 800; font-variant-numeric: tabular-nums; margin-right: 0.12em; }
.clock { font-size: 5em; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 0.9; letter-spacing: -0.04em; }
.clock.low { color: var(--coral); }

.explain { margin-top: 1.4em; min-height: 0; overflow: hidden; }
.explain h3 { font-size: 1.05em; color: var(--fog); font-weight: 600; margin-bottom: 0.5em; }
.flags { list-style: none; display: grid; gap: 0.45em; }
.flags li { display: flex; gap: 0.6em; align-items: baseline; font-size: 1.3em; font-weight: 600; line-height: 1.25; }
.flags li::before { content: ""; flex: none; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--coral); transform: translateY(-0.1em); }
.flags.echt li::before { background: var(--mint); }
.tip { margin-top: 0.9em; font-size: 1.1em; color: var(--fog); line-height: 1.4; max-width: 34em; }

.actions { display: flex; align-items: center; gap: 1em; margin-top: 1em; }

/* Zwischenstand und Schluss */
.board { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 1em 3em 2em; min-height: 0; }
.board h2 { font-size: 3.6em; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.6em; }
.ranks { list-style: none; width: min(60em, 100%); display: grid; gap: 0.5em; }
.ranks li {
  display: grid; grid-template-columns: 3em 1fr auto; align-items: center;
  background: var(--slate-deep); border-radius: var(--r-sm); padding: 0.65em 1.1em; font-size: 1.45em;
}
.ranks .rk { color: var(--fog); font-weight: 700; font-variant-numeric: tabular-nums; }
.ranks .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranks .pt { font-weight: 800; font-variant-numeric: tabular-nums; }
.ranks li:first-child { background: var(--lime); color: var(--ink); }
.ranks li:first-child .rk { color: var(--ink); }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 15em)); align-items: end; gap: 1.2em; margin-bottom: 1.6em; }
.podium .step { display: flex; flex-direction: column; align-items: center; text-align: center; animation: rise 0.6s ease-out both; }
.podium .who { font-size: 1.8em; font-weight: 800; margin-bottom: 0.15em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pts { color: var(--fog); font-size: 1.15em; margin-bottom: 0.6em; font-variant-numeric: tabular-nums; }
.podium .block {
  width: 100%; border-radius: var(--r-md) var(--r-md) 0 0; display: flex; justify-content: center;
  padding-top: 0.3em; font-size: 4em; font-weight: 900; color: var(--ink);
}
.podium .p1 { order: 2; animation-delay: 1.6s; }
.podium .p2 { order: 1; animation-delay: 0.8s; }
.podium .p3 { order: 3; animation-delay: 0s; }
.podium .p1 .block { height: 2.4em; background: var(--lime); }
.podium .p2 .block { height: 1.8em; background: var(--sky); }
.podium .p3 .block { height: 1.3em; background: var(--mint); }
@keyframes rise { from { opacity: 0; transform: translateY(1.5em); } }
.ranks.rest li:first-child { background: var(--slate-deep); color: var(--paper); }
.ranks.rest li:first-child .rk { color: var(--fog); }
.ranks.rest { width: min(44em, 100%); }
.ranks.rest li { font-size: 1.15em; padding: 0.45em 1em; }

.keygate { margin: auto; width: min(26em, 90vw); display: grid; gap: 1em; text-align: center; }
.keygate input { font: inherit; font-size: 1.3em; padding: 0.6em 0.8em; border-radius: var(--r-sm); border: 0; }

.toast {
  position: fixed; left: 50%; bottom: 1.5em; transform: translateX(-50%);
  background: var(--coral-deep); color: #fff; padding: 0.6em 1.1em; border-radius: var(--r-sm); font-weight: 600;
}

/* =====================================================================
   Spieler (Handy)
   ===================================================================== */

.player { font-size: 17px; min-height: 100dvh; }
.player main {
  min-height: 100dvh; display: flex; flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
}
.p-top { display: flex; justify-content: space-between; align-items: center; color: var(--fog); font-size: 0.9em; min-height: 1.5em; }
.p-top b { color: var(--paper); }
.p-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 18px 0; }
.p-title { font-size: 2.3em; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.p-title .q { color: var(--lime); }
.p-text { color: var(--fog); font-size: 1.1em; line-height: 1.4; }
.p-big { font-size: 1.9em; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }

.field { display: grid; gap: 8px; }
.field label { font-weight: 600; }
.field input {
  font: inherit; font-size: 1.25em; padding: 14px 16px; border-radius: var(--r-md);
  border: 2px solid transparent; background: var(--paper); color: var(--ink);
}
.field input:focus { border-color: var(--lime); outline: none; }
.p-btn {
  background: var(--lime); color: var(--ink); font-weight: 800; font-size: 1.2em;
  padding: 16px; border-radius: var(--r-md); width: 100%;
}
.p-btn:disabled { opacity: 0.5; }
.p-error { color: var(--coral); font-weight: 600; min-height: 1.3em; }

.p-timer { height: 6px; background: var(--slate-deep); border-radius: 3px; overflow: hidden; }
.p-timer i { display: block; height: 100%; background: var(--lime); transform-origin: left; }

.answers { flex: 1; display: grid; gap: 12px; }
.answers.binary { grid-template-rows: 1fr 1fr; }
.answers.choice { grid-template-rows: repeat(4, 1fr); }
.answer {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--c); color: var(--ink); border-radius: var(--r-md);
  padding: 16px 18px; font-size: 1.2em; font-weight: 750; line-height: 1.2;
  min-height: 64px; transition: transform 0.08s;
}
.answer:active { transform: scale(0.97); }
.answer .shape { font-size: 0.9em; color: rgba(17, 19, 18, 0.7); }
.answers.binary .answer { justify-content: center; font-size: 2em; font-weight: 800; }
.answers.binary .answer .shape { display: none; }

.result { border-radius: var(--r-lg); padding: 26px 22px; display: grid; gap: 8px; }
.result.ok { background: var(--mint); color: var(--ink); }
.result.bad { background: var(--coral); color: var(--ink); }
.result.none { background: var(--slate-deep); }
.result .pts { font-size: 2.8em; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.p-rank { font-size: 1.15em; color: var(--fog); }
.p-rank b { color: var(--paper); font-size: 1.5em; }

.pulse { width: 18px; height: 18px; border-radius: 50%; background: var(--lime); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.6); opacity: 0.4; } }

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