/* ─────────────────────────────────────────────────────────
   CyberCheck – Deutsche Bank
   Design System & Layout
   ───────────────────────────────────────────────────────── */

/* ── DeutscheBankVar ── */
@font-face {
  font-family: 'DeutscheBankVar';
  src: url('fonts/deutsche-bank-var.woff2') format('woff2'),
       url('fonts/deutsche-bank-var.woff')  format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DeutscheBankVar';
  src: url('fonts/deutsche-bank-var-italic.woff2') format('woff2'),
       url('fonts/deutsche-bank-var-italic.woff')  format('woff');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ── Custom Properties ── */
:root {
  --db-deep-blue:  #1e2a78;
  --db-dark-blue:  #16184e;
  --db-bright-blue:#0550d1;
  --db-mid-blue:   #0069b1;
  --db-sundown:    #F28011;
  --db-white:      #ffffff;
  --db-off-white:  #edf1f7;
  --db-light-blue: #ecf4fc;
  --db-ice-blue:   #cdebf6;
  --db-correct:    #25a62d;
  --db-wrong:      #e7001d;
  --db-warn-bg:    rgba(37,166,45,.12);
  --db-err-bg:     rgba(231,0,29,.12);

  --font: 'DeutscheBankVar', system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --radius-lg: 16px;
  --trans: 220ms ease;
  --shadow: 0 4px 24px rgba(22,24,78,.18);
  --header-h: 60px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--db-dark-blue);
  color: var(--db-white);
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
img, video { display: block; max-width: 100%; }
button { cursor: pointer; border: none; font-family: var(--font); }
a { color: inherit; }
ul, ol { list-style: none; }

/* ── App Shell ── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 24px 24px 0;
  background: transparent;
  pointer-events: none;
}
.app-header > * { pointer-events: auto; }

/* Logo hidden – page is embedded inside DB portal which carries its own logo */
.logo-wrap { display: none; }
.db-logo { width: 48px; height: 48px; }

.lang-btn {
  background: var(--db-sundown);
  color: var(--db-dark-blue);
  border: none;
  border-radius: 4px;
  padding: 8px 18px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .03em;
  transition: background var(--trans), color var(--trans);
}
.lang-btn:hover {
  background: var(--db-white);
  color: var(--db-dark-blue);
}

/* ── Main Screen ── */
#screen {
  flex: 1;
  outline: none;
}

/* ═══════════════════════════════════════════════════════
   HUB SCREEN
   ═══════════════════════════════════════════════════════ */
.hub {
  height: 100vh;
  display: grid;
  grid-template-columns: 45% 55%;
  background: var(--db-deep-blue);
  position: relative;
  overflow: hidden;
}

/* Left panel */
.hub__left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 28px) 48px 60px 48px;
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, var(--db-dark-blue) 0%, rgba(30,42,120,.92) 100%);
}
.hub__tagline {
  font-size: clamp(1.75rem, 3.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.02em;
  margin-bottom: 24px;
  text-wrap: balance;
  /* Match width with subtitle for visual alignment */
  max-width: 40rem;
}
.hub__subtitle {
  font-size: clamp(.95rem, 1.5vw, 1.25rem);
  font-weight: 400;
  line-height: 1.65;
  color: rgba(255,255,255,.78);
  max-width: 40rem;
}
.hub__hublink {
  margin-top: 20px;
  font-size: clamp(.85rem, 1.1vw, 1rem);
  color: rgba(255,255,255,.6);
}
.hub__hublink a {
  color: var(--db-sundown);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--trans);
}
.hub__hublink a:hover { color: var(--db-white); }

/* Right panel – tile grid */
.hub__right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  background: var(--db-deep-blue);
}

/* Individual game tile */
.hub-tile {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--db-dark-blue);
  border: none;
  text-align: left;
  color: var(--db-white);
  padding: 0;
  transition: transform var(--trans);
}
.hub-tile:focus-visible {
  outline: 3px solid var(--db-bright-blue);
  outline-offset: -3px;
  z-index: 2;
}
.hub-tile__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease, filter 400ms ease;
  filter: brightness(.65) saturate(.8);
}
.hub-tile:hover .hub-tile__photo,
.hub-tile:focus-visible .hub-tile__photo {
  transform: scale(1.04);
  filter: brightness(.8) saturate(.9);
}
.hub-tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(22,24,78,.85) 0%,
    rgba(22,24,78,.3) 50%,
    transparent 100%
  );
}
.hub-tile__content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 20px 22px;
}
.hub-tile__arrow {
  align-self: flex-end;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background var(--trans), border-color var(--trans);
}
.hub-tile:hover .hub-tile__arrow,
.hub-tile:focus-visible .hub-tile__arrow {
  background: var(--db-bright-blue);
  border-color: var(--db-bright-blue);
}
.hub-tile__badge {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hub-tile__tag {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: none;
  color: rgba(255,255,255,.65);
}
.hub-tile__name {
  font-size: clamp(1.35rem, 2.1vw, 1.65rem);
  font-weight: 700;
  line-height: 1.25;
}
.hub-tile__done {
  display: inline-flex;
  align-items: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--db-white);
  opacity: .8;
  margin-top: 4px;
  letter-spacing: .03em;
}
/* Completed-Status erkennt man am Text – kein farbiger Arrow mehr */

/* All-done banner */
.hub__all-done {
  grid-column: 1 / -1;
  background: var(--db-correct);
  color: #fff;
  text-align: center;
  padding: 14px 24px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background var(--trans);
  border: none;
  font-family: var(--font);
  width: 100%;
  display: none;
}
.hub__all-done:hover { background: #1e8a24; }
.hub__all-done.visible { display: block; }

/* ═══════════════════════════════════════════════════════
   GAME SCREENS – shared
   ═══════════════════════════════════════════════════════ */
.game-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--db-dark-blue);
  overflow: hidden;
}

/* ── Game nav bar ── */
.game-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--header-h) 40px 0;
  flex-shrink: 0;
}
.game-nav__back {
  background: none;
  color: rgba(255,255,255,.7);
  font-size: .85rem;
  font-weight: 500;
  padding: 8px 0;
  transition: color var(--trans);
  display: flex;
  align-items: center;
  gap: 6px;
}
.game-nav__back:hover { color: #fff; }
.game-nav__progress {
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  letter-spacing: .05em;
}

/* ── Video mute button ── */
.video-mute-wrap {
  position: relative;
  width: 100%;
}
.video-mute-wrap video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}
.video-mute-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: var(--db-sundown);
  border: 2px solid var(--db-sundown);
  color: var(--db-dark-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(242,128,17,.35);
  transition: background var(--trans), border-color var(--trans), box-shadow var(--trans), transform var(--trans);
  font-family: var(--font);
}
.video-mute-btn:hover {
  background: #ff9226;
  border-color: #ff9226;
  box-shadow: 0 6px 18px rgba(242,128,17,.5);
}
.video-mute-btn:focus-visible {
  outline: 3px solid var(--db-white);
  outline-offset: 2px;
}
.video-mute-btn--on {
  background: var(--db-white);
  border-color: var(--db-white);
  color: var(--db-sundown);
}
.video-mute-btn--on:hover {
  background: var(--db-off-white);
  border-color: var(--db-off-white);
}
.video-mute-btn svg {
  pointer-events: none;
  width: 28px;
  height: 28px;
}

/* ── Video pause button (sits left of the mute button) ── */
.video-pause-btn {
  position: absolute;
  /* Vertically centered with the larger 65px mute button */
  bottom: 27px;
  right: 89px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(22,24,78,.7);
  border: 1.5px solid rgba(255,255,255,.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background var(--trans), border-color var(--trans);
  font-family: var(--font);
}
.video-pause-btn:hover {
  background: rgba(22,24,78,.9);
  border-color: rgba(255,255,255,.65);
}
.video-pause-btn:focus-visible {
  outline: 3px solid var(--db-sundown);
  outline-offset: 2px;
}
.video-pause-btn svg { pointer-events: none; }
/* When the video sits in a wrap that has no mute button (Game 1, or
   Game 4 scenarios flagged noAudio), the pause button takes the
   rightmost position with the normal bottom offset. */
.g1-video-wrap .video-pause-btn,
.video-mute-wrap--no-audio .video-pause-btn { right: 12px; bottom: 12px; }

/* ── Game intro ── */
.game-intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 40px 80px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}
.game-intro__tag {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: none;
  color: var(--db-ice-blue);
  margin-bottom: 20px;
}
.game-intro__title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 24px;
}
.game-intro__desc {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255,255,255,.75);
  margin-bottom: 40px;
}
.btn-primary {
  background: var(--db-sundown);
  color: var(--db-dark-blue);
  font-size: 1rem;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: 4px;
  border: none;
  transition: background var(--trans), color var(--trans), transform var(--trans);
  font-family: var(--font);
}
.btn-primary:hover { background: var(--db-white); color: var(--db-dark-blue); transform: translateY(-1px); }
.btn-primary:focus-visible {
  outline: 3px solid var(--db-sundown);
  outline-offset: 3px;
}
.btn-secondary {
  background: transparent;
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 40px;
  border: 1.5px solid rgba(255,255,255,.25);
  transition: all var(--trans);
  font-family: var(--font);
}
.btn-secondary:hover {
  border-color: rgba(255,255,255,.6);
  color: #fff;
}
.btn-secondary:focus-visible {
  outline: 3px solid var(--db-ice-blue);
  outline-offset: 3px;
}

/* ── Game play area ── */
.game-play {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 40px 40px;
  gap: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.game-play__mech-tag {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: none;
  color: var(--db-ice-blue);
  align-self: flex-start;
}

/* ── Feedback panel ── */
.feedback {
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  animation: slideUp 300ms ease;
}
.feedback--correct { background: var(--db-warn-bg); border: 1.5px solid var(--db-correct); }
.feedback--wrong   { background: var(--db-err-bg);  border: 1.5px solid var(--db-wrong);   }
.feedback__verdict {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.feedback--correct .feedback__verdict { color: var(--db-correct); }
.feedback--wrong   .feedback__verdict { color: var(--db-wrong);   }
.feedback__text {
  font-size: .9rem;
  line-height: 1.65;
  color: rgba(255,255,255,.85);
  white-space: pre-line;
}
.feedback__next {
  margin-top: 20px;
}

/* ── Results screen ── */
.game-results {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 40px 80px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  gap: 16px;
}
.game-results__score-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--db-bright-blue) calc(var(--pct) * 1%), rgba(255,255,255,.1) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.game-results__score-ring::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--db-dark-blue);
}
.game-results__score-num {
  position: relative;
  font-size: 2rem;
  font-weight: 700;
}
.game-results__heading {
  font-size: 1.15rem;
  font-weight: 700;
}
.game-results__grade {
  font-size: .95rem;
  color: rgba(255,255,255,.72);
  line-height: 1.55;
}
.game-results__remember {
  margin-top: 8px;
  background: rgba(5,80,209,.15);
  border: 1.5px solid rgba(5,80,209,.4);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-align: left;
  width: 100%;
}
.game-results__remember-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: none;
  color: var(--db-ice-blue);
  margin-bottom: 8px;
}
.game-results__remember-text {
  font-size: .9rem;
  line-height: 1.6;
  color: rgba(255,255,255,.8);
}
.game-results__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding: 14px 26px;
  border-radius: 4px;
  background: var(--db-sundown);
  color: var(--db-dark-blue);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  transition: background var(--trans), color var(--trans), transform var(--trans);
}
.game-results__cta:hover {
  background: var(--db-white);
  color: var(--db-dark-blue);
  transform: translateY(-1px);
}
.game-results__cta:focus-visible {
  outline: 3px solid var(--db-white);
  outline-offset: 3px;
}
.game-results__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════
   GAME 1 – Choose a Side
   ═══════════════════════════════════════════════════════ */
.g1-scene {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}
.g1-video-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent;
  line-height: 0;
  /* Cap display size — assets are max 520x422 to avoid pixelation */
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}
.g1-video-wrap video {
  display: block;
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
}
.g1-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}
.g1-hint {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 700;
  color: var(--db-white);
  text-align: center;
  margin: 6px 0 4px;
  letter-spacing: .005em;
}
.g1-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.g1-btn {
  padding: 14px 16px;
  border-radius: 4px;
  font-size: .95rem;
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: .02em;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
  border: 1.5px solid transparent;
  background: rgba(191,213,247,.12);
  color: var(--db-white);
}
.g1-btn--fake { border-color: rgba(231,0,29,.45); }
.g1-btn--real { border-color: rgba(37,166,45,.45); }
.g1-btn--fake:hover { background: var(--db-wrong);   color: var(--db-white); }
.g1-btn--real:hover { background: var(--db-correct); color: var(--db-white); }
.g1-btn:disabled { pointer-events: none; opacity: .4; }
.g1-btn:focus-visible {
  outline: 3px solid var(--db-sundown);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════
   GAME 2 – Multiple Choice
   ═══════════════════════════════════════════════════════ */
.g2-scene {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}
.g2-video-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent;
  position: relative;
  width: 100%;
  /* Cap display size — assets are max 520x422 to avoid pixelation */
  max-width: 520px;
  margin: 0 auto;
}
.g2-video-wrap video {
  width: 100%;
  height: auto;
  display: block;
}
.g2-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.g2-label {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 700;
  letter-spacing: .005em;
  text-transform: none;
  color: var(--db-white);
  margin: 6px 0 4px;
}
.g2-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* CI standard for non-right/wrong fields: low opacity White #bfd5f7 */
.g2-option {
  background: rgba(191, 213, 247, .12);
  border: 1.5px solid rgba(191, 213, 247, .28);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-align: left;
  color: var(--db-white);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.45;
  font-family: var(--font);
  transition: background var(--trans), color var(--trans), border-color var(--trans), transform var(--trans);
  display: flex;
  align-items: center;
}
.g2-option:hover:not(:disabled) {
  background: var(--db-sundown);
  border-color: var(--db-sundown);
  color: var(--db-dark-blue);
}
.g2-option--correct {
  background: rgba(37, 166, 45, .15) !important;
  border-color: var(--db-correct) !important;
  color: var(--db-white) !important;
}
.g2-option--wrong {
  background: rgba(231, 0, 29, .15) !important;
  border-color: var(--db-wrong) !important;
  color: var(--db-white) !important;
  opacity: .85;
}
.g2-option:disabled { pointer-events: none; }
.g2-option:focus-visible {
  outline: 3px solid var(--db-sundown);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════
   GAME 3 – Spot the Mistake
   ═══════════════════════════════════════════════════════ */
.g3-scene {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  /* Match Game 1's content width so feedback panel etc. don't stretch wide */
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}
.g3-hint {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 700;
  color: var(--db-white);
  text-align: center;
  margin: 6px 0 8px;
  letter-spacing: .005em;
}
.g3-img-wrap {
  position: relative;
  display: block;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent;
  cursor: crosshair;
  align-self: center;
  /* Source assets are 520x422 max — preventing upscaling avoids pixelation */
  max-width: 520px;
  width: 100%;
  user-select: none;
}
.g3-img-wrap:focus-visible {
  outline: 3px solid var(--db-sundown);
  outline-offset: 2px;
}
.g3-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}
/* Hotspot overlay (hidden until answered) */
.g3-hotspot {
  position: absolute;
  pointer-events: none;
  border: 3px solid transparent;
  border-radius: 6px;
  transition: border-color 300ms, box-shadow 300ms, background 300ms;
}
.g3-hotspot--correct {
  border-color: var(--db-correct);
  box-shadow: 0 0 0 9999px rgba(22, 24, 78, .55);
  background: rgba(37, 166, 45, .12);
}
.g3-hotspot--miss {
  border-color: var(--db-wrong);
  box-shadow: 0 0 0 9999px rgba(22, 24, 78, .55);
  background: rgba(231, 0, 29, .15);
  animation: g3-miss-pulse 600ms ease;
}
@keyframes g3-miss-pulse {
  0%   { transform: scale(.92); opacity: 0; }
  50%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}
/* Click ripple */
.g3-ripple {
  position: absolute;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  background: rgba(255,255,255,.35);
  pointer-events: none;
  animation: ripple 500ms ease forwards;
}
.g3-show-answer {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  font-size: .78rem;
  font-family: var(--font);
  text-decoration: underline;
  padding: 4px 8px;
  margin-top: 4px;
  align-self: center;
  transition: color var(--trans);
}
.g3-show-answer:hover { color: rgba(255,255,255,.75); }

/* ═══════════════════════════════════════════════════════
   GAME 4 – Drag & Drop
   ═══════════════════════════════════════════════════════ */
.g4-scene {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  flex: 1;
}

/* Asset panel */
.g4-asset {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.g4-asset-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* Source assets are 520x422 max — preventing upscaling avoids pixelation */
  max-width: 520px;
  width: 100%;
  align-self: center;
  margin: 0 auto;
}
.g4-asset-wrap img,
.g4-asset-wrap video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}

/* Sorting panel */
.g4-sort {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Drop zones */
.g4-zones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.g4-zone {
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(255,255,255,.2);
  padding: 12px;
  min-height: 90px;
  transition: border-color var(--trans), background var(--trans);
}
.g4-zone--right { border-color: rgba(37,166,45,.4); background: rgba(37,166,45,.05); }
.g4-zone--wrong { border-color: rgba(231,0,29,.4);  background: rgba(231,0,29,.05);  }
.g4-zone.drag-over {
  border-style: solid;
  background: rgba(255,255,255,.08);
}
.g4-zone__label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: none;
  margin-bottom: 8px;
}
.g4-zone--right .g4-zone__label { color: var(--db-correct); }
.g4-zone--wrong .g4-zone__label { color: var(--db-wrong);   }
.g4-zone__cards { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }

/* Cards pool */
.g4-pool-label {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-weight: 700;
  letter-spacing: .005em;
  text-transform: none;
  color: var(--db-white);
  margin: 6px 0 4px;
}
.g4-kbd-hint {
  font-size: .72rem;
  line-height: 1.5;
  color: rgba(255,255,255,.6);
  padding: 8px 12px;
  background: rgba(255,255,255,.05);
  border-left: 2px solid var(--db-sundown);
  border-radius: 4px;
  margin: 4px 0 8px;
}
.g4-pool {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

/* Cards */
.g4-card {
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: .83rem;
  line-height: 1.4;
  color: rgba(255,255,255,.88);
  cursor: grab;
  transition: background var(--trans), border-color var(--trans), transform var(--trans), opacity var(--trans);
  font-family: var(--font);
  user-select: none;
  position: relative;
}
.g4-card:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.3); }
.g4-card:active, .g4-card.dragging { cursor: grabbing; opacity: .6; transform: rotate(1.5deg) scale(.97); }
.g4-card:focus-visible { outline: 3px solid var(--db-ice-blue); outline-offset: 2px; }
.g4-card[data-placed="right"] { border-color: rgba(37,166,45,.5); background: rgba(37,166,45,.1); }
.g4-card[data-placed="wrong"] { border-color: rgba(231,0,29,.4);  background: rgba(231,0,29,.08);  }
.g4-card--correct-reveal { border-color: var(--db-correct) !important; background: var(--db-warn-bg) !important; }
.g4-card--wrong-reveal   { border-color: var(--db-wrong)   !important; background: var(--db-err-bg)  !important; }

/* Mobile tap mode: select + zone buttons */
.g4-card.selected {
  border-color: var(--db-bright-blue);
  background: rgba(5,80,209,.2);
  box-shadow: 0 0 0 3px rgba(5,80,209,.3);
}
.g4-zone--tap-target {
  cursor: pointer;
  transition: all var(--trans);
}
.g4-zone--tap-target:hover {
  border-style: solid;
  background: rgba(255,255,255,.1);
}

/* Check button */
.g4-check-wrap {
  display: flex;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════
   END SCREEN
   ═══════════════════════════════════════════════════════ */
.end-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 16px) 40px 60px;
  background: linear-gradient(160deg, var(--db-dark-blue) 0%, var(--db-deep-blue) 100%);
  text-align: center;
}
.end-screen__title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  max-width: 660px;
}
.end-screen__subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,.65);
  margin-bottom: 40px;
}
.end-learnings {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 840px;
  width: 100%;
  margin-bottom: 40px;
}
.end-learning {
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  text-align: left;
}
.end-learning__icon { font-size: 1.8rem; margin-bottom: 12px; }
.end-learning__title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--db-ice-blue);
  margin-bottom: 8px;
  letter-spacing: .03em;
}
.end-learning__text {
  font-size: .85rem;
  line-height: 1.6;
  color: rgba(255,255,255,.72);
}
.end-screen__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn-cta {
  background: var(--db-sundown);
  color: var(--db-dark-blue);
  font-size: 1rem;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: 4px;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--trans), color var(--trans), transform var(--trans);
  font-family: var(--font);
}
.btn-cta:hover { background: var(--db-white); color: var(--db-dark-blue); transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════
   PASSWORD GATE
   ═══════════════════════════════════════════════════════ */
#pw-gate {
  position: fixed;
  inset: 0;
  background: var(--db-dark-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 300ms ease;
}
#pw-gate.pw-gate--out {
  animation: fadeIn 350ms ease reverse forwards;
  pointer-events: none;
}
.pw-gate__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  padding: 48px 40px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  gap: 0;
}
.pw-gate__logo { margin-bottom: 24px; }
.pw-gate__title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--db-white);
  margin-bottom: 8px;
}
.pw-gate__subtitle {
  font-size: .9rem;
  color: rgba(255,255,255,.55);
  text-align: center;
  margin-bottom: 28px;
}
.pw-gate__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pw-gate__input-wrap {
  position: relative;
  width: 100%;
}
.pw-gate__input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  color: var(--db-white);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--trans);
}
.pw-gate__input::placeholder { color: rgba(255,255,255,.35); }
.pw-gate__input:focus { border-color: var(--db-bright-blue); }
.pw-gate__toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color var(--trans);
}
.pw-gate__toggle:hover { color: rgba(255,255,255,.8); }
.pw-gate__toggle svg { width: 18px; height: 18px; }
.pw-gate__error {
  font-size: .82rem;
  color: var(--db-wrong);
  min-height: 1.2em;
  text-align: center;
}
.pw-gate__btn {
  width: 100%;
  padding: 14px;
  background: var(--db-sundown);
  color: var(--db-dark-blue);
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  transition: background var(--trans), color var(--trans), transform var(--trans);
  margin-top: 4px;
}
.pw-gate__btn:hover { background: var(--db-white); color: var(--db-dark-blue); transform: translateY(-1px); }
.pw-gate__btn:active { transform: translateY(0); }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}
.pw-gate--shake { animation: shake 0.45s ease; }

/* ═══════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════ */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes ripple {
  from { transform: scale(1); opacity: 1; }
  to   { transform: scale(3); opacity: 0; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.fade-in { animation: fadeIn 280ms ease; }

/* ═══════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,.05); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE – Tablet (≤ 1024px)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .hub { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .hub__left {
    padding: calc(var(--header-h) + 24px) 32px 32px;
    background: linear-gradient(180deg, var(--db-dark-blue) 0%, rgba(30,42,120,.9) 100%);
  }
  .hub__tagline,
  .hub__subtitle { max-width: 100%; }
  .hub__right { min-height: 60vw; }

  .g1-video-wrap video { max-height: 50vh; }

  .g4-scene { grid-template-columns: 1fr; }
  .g4-pool { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; max-height: 220px; }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE – Mobile (≤ 640px)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  :root { --header-h: 52px; }

  .app-header { padding: 14px 18px 0; }

  /* Hub */
  .hub { height: auto; min-height: 100vh; overflow: visible; }
  .hub__left { padding: calc(var(--header-h) + 20px) 20px 28px; }
  .hub__tagline { font-size: 1.55rem; white-space: normal; }
  .hub__right { grid-template-columns: 1fr; min-height: unset; }
  .hub-tile { min-height: 180px; }
  .hub-tile__photo { filter: brightness(.55) saturate(.7); }

  /* Game nav */
  .game-nav { padding: var(--header-h) 20px 0; }
  .game-play { padding: 16px 20px calc(88px + env(safe-area-inset-bottom, 0px)); }

  /* Game intro */
  .game-intro { padding: 32px 20px 60px; }
  .game-intro__title { font-size: 1.4rem; }

  /* Game 1 */
  .g1-video-wrap video { max-height: 42vh; }
  .g1-btns { gap: 8px; }
  .g1-btn { padding: 12px 10px; font-size: .9rem; }

  /* Game 2 */
  .g2-option { padding: 12px 14px; font-size: .9rem; }

  /* Game 3 – ensure image scales well on phones (small hotspots) */
  .g3-img-wrap { border-radius: var(--radius); max-width: 100%; }
  .g3-hotspot  { border-width: 4px; }   /* slightly thicker outline on touch */

  /* Game 4 */
  .g4-zones { grid-template-columns: 1fr; }
  .g4-zone { min-height: 60px; }
  .g4-pool { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; max-height: 180px; }

  /* End screen */
  .end-screen { padding: 80px 20px 40px; }
  .end-learnings { grid-template-columns: 1fr; }
  .end-screen__actions { flex-direction: column; align-items: center; }

  /* Results */
  .game-results { padding: 24px 20px 60px; }
  .game-results__actions { flex-direction: column; align-items: center; }
}

/* ═══════════════════════════════════════════════════════
   TOUCH DEVICES – disable hover effects
   Prevents sticky hover highlights on tap
   ═══════════════════════════════════════════════════════ */
@media (hover: none) {
  .hub-tile:hover .hub-tile__photo,
  .hub-tile:focus-visible .hub-tile__photo { transform: scale(1); }
  .hub-tile:hover .hub-tile__arrow { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); }
  .hub-tile:hover { transform: none; }
  .hub__all-done:hover { background: var(--db-correct); }
  .lang-btn:hover { background: var(--db-sundown); color: var(--db-dark-blue); }
  .btn-primary:hover,
  .btn-cta:hover { background: var(--db-sundown); color: var(--db-dark-blue); transform: none; }
  .btn-secondary:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.8); }
  .game-nav__back:hover { color: rgba(255,255,255,.7); }
  .g1-btn--fake:hover { background: rgba(191,213,247,.12); color: var(--db-white); }
  .g1-btn--real:hover { background: rgba(191,213,247,.12); color: var(--db-white); }
  .g2-option:hover:not(:disabled) { background: rgba(191,213,247,.12); border-color: rgba(191,213,247,.28); color: var(--db-white); transform: none; }
  .g4-card:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); }
  .pw-gate__btn:hover { background: var(--db-sundown); color: var(--db-dark-blue); transform: none; }
  .pw-gate__toggle:hover { color: rgba(255,255,255,.6); }
}

/* ═══════════════════════════════════════════════════════════
   Reduced motion (WCAG 2.3.3 / vestibular sensitivity)
   Honors the user's OS preference for minimized animations.
   Pure accessibility win — has no effect on users without
   the preference set.
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Stop autoplaying videos from looping endlessly for these users.
     They can still press play via the pause/play button. */
  video[autoplay] { animation: none; }
}

