/* ── Fonts ───────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'GT Pressura Mono';
  src: url('/fonts/GT-Pressura-Mono-Regular.woff') format('woff');
  font-weight: normal;
  font-style:  normal;
  font-display: swap;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* GEWA brand — light theme */
  --bg:        #ffffff;
  --surface:   #ffffff;
  --surface2:  #E8E6E1;
  --text:      #0A0A0A;
  --muted:     #0A0A0A;
  --accent:    #0A0A0A;
  --char-color: #0A0A0A;
  --border:    #cccccc;

  --radius:    12px;
  --radius-lg: 20px;
  --ease:      cubic-bezier(.4,0,.2,1);
  --dur:       .32s;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
html, body {
  height: 100%; width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'GT Pressura Mono', monospace;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; border: none; outline: none; cursor: pointer; }

/* position:fixed + inset:0 fills the true visual viewport edge-to-edge (with
   viewport-fit=cover), instead of 100vh which leaves a white safe-area bar at
   the bottom of the iPad in full-screen/standalone mode. */
#app { position: fixed; inset: 0; overflow: hidden; }

/* ── Screen transitions ─────────────────────────────────────────────────── */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: translateX(60px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.screen.active   { opacity: 1; pointer-events: all; transform: translateX(0); }
.screen.exit     { opacity: 0; transform: translateX(-60px); transition-duration: .22s; }

/* ══════════════════════════════════════════════════════════════════════════
   Screen 1 — Character selection
   ══════════════════════════════════════════════════════════════════════════ */
#screen-select { background: var(--bg); overflow-y: auto; }

.screen-content {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 28px; gap: 40px;
  min-height: 100%;
}

/* Title */
.title-block { text-align: center; }

.title-block h1 {
  text-transform: uppercase;
  font-family: 'GT Pressura Mono', monospace;
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: normal;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--accent);
}
.title-block h2 {
  font-family: 'GT Pressura Mono', monospace;
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  font-weight: 400; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text); opacity: .35; margin-top: 4px;
}
.subtitle {
  margin-top: 3em; font-size: 1.05rem;
  color: var(--muted); font-weight: 400;
}

/* Character cards */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px; width: 100%; max-width: 740px;
}

.character-card {
  --char-color: #0A0A0A;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px 28px;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  transition: border-color .2s var(--ease), transform .2s var(--ease),
              box-shadow .2s var(--ease);
  position: relative; overflow: hidden;
}
.character-card::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--char-color);
  opacity: 0; border-radius: inherit;
  transition: opacity .2s var(--ease);
}
.character-card:hover {
  border-color: var(--char-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px -8px var(--char-color);
}
.character-card:hover::after { opacity: .06; }
.character-card:active { transform: translateY(-1px); }

.char-emoji  { font-size: 3.2rem; position: relative; z-index: 1; }

/* Hand-drawn role illustration (replaces the emoji on the selection cards).
   Landscape artwork — let it run nearly card-wide and scale by height. */
.char-illustration {
  position: relative; z-index: 1;
  width: 100%; height: clamp(120px, 17vh, 190px);
  object-fit: contain;
  transform: scale(1.15);
  margin-bottom: 2px;
  filter: drop-shadow(0 6px 14px rgba(10,10,10,.14));
  transition: transform .2s var(--ease);
}
.character-card:hover .char-illustration { transform: scale(1.05); }
.char-name   {
  font-family: 'GT Pressura Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 6%;
  font-size: 1rem; font-weight: 400; text-align: center;
  letter-spacing: .01em;
  color: var(--text); position: relative; z-index: 1;
}
.char-desc   { font-size: .82rem; color: var(--muted); position: relative; z-index: 1; }
.char-cta    {
  font-size: .78rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase;
  color: var(--char-color); position: relative; z-index: 1;
  opacity: 0; transform: translateY(4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.character-card:hover .char-cta { opacity: 1; transform: translateY(0); }

/* Style-twist selector */
.twist-block {
  width: 100%; max-width: 740px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.twist-label {
  font-family: 'GT Pressura Mono', monospace;
  font-size: .82rem; font-weight: 400; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); opacity: .7;
}
.twist-label span { opacity: .55; font-weight: 400; text-transform: none; letter-spacing: 0; }

.twists-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
}
.twist-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; padding: 9px 16px;
  font-size: .88rem; font-weight: 400; color: var(--muted);
  transition: border-color .18s var(--ease), background .18s var(--ease),
              color .18s var(--ease), transform .18s var(--ease);
}
.twist-chip:hover { border-color: var(--accent); transform: translateY(-2px); }
.twist-chip.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 16px -6px rgba(10,10,10,.5);
}
.twist-emoji { font-size: 1.05rem; line-height: 1; }

/* Gallery button */
.gallery-fab {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); padding: 12px 26px; border-radius: 100px;
  font-size: .95rem; font-weight: 400;
  transition: background .2s, color .2s, border-color .2s;
}
.gallery-fab:hover { background: var(--surface2); color: var(--text); }

.start-actions {
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.info-fab {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'GT Pressura Mono', monospace;
  font-size: 1.15rem; font-style: italic; line-height: 1;
  transition: background .2s, color .2s, border-color .2s;
}
.info-fab:hover { background: var(--surface2); color: var(--text); }

/* ══════════════════════════════════════════════════════════════════════════
   Screen 2 — Camera (stays dark — it's a live video feed)
   ══════════════════════════════════════════════════════════════════════════ */
#screen-camera { background: #000; }

.camera-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  /* extra top padding keeps controls clear of the iOS status bar in full-screen */
  padding: calc(18px + env(safe-area-inset-top, 0px)) 22px 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,.75), transparent);
}

.back-btn {
  background: rgba(255,255,255,.15); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2); color: #fff;
  padding: 10px 20px; border-radius: 100px; font-size: .9rem; font-weight: 400;
  transition: background .18s;
}
.back-btn:hover { background: rgba(255,255,255,.28); }

.character-badge {
  background: rgba(0,0,0,.5); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18); color: #fff;
  padding: 8px 18px; border-radius: 100px; font-size: .88rem; font-weight: 400;
}

.camera-wrapper { flex: 1; position: relative; overflow: hidden; }

#video {
  width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1);
}

/* Face guide */
.face-guide-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.face-guide-oval {
  width: min(55vw, 300px); height: min(72vw, 390px);
  border: 3px dashed rgba(255,255,255,.55);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.32);
}
.face-guide-hint {
  margin-top: 28px; color: rgba(255,255,255,.85);
  font-size: .88rem; font-weight: 400;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  padding: 6px 16px; border-radius: 100px;
}

/* Flash */
.capture-flash {
  position: absolute; inset: 0;
  background: #fff; opacity: 0; pointer-events: none;
  transition: opacity .05s;
}
.capture-flash.flash { opacity: 1; }

/* Camera footer */
.camera-footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 28px 28px 40px;
  background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
}

.countdown-display {
  font-family: 'GT Pressura Mono', monospace;
  font-size: 5rem; font-weight: 400; color: #fff;
  text-shadow: 0 0 30px rgba(255,255,255,.6);
  animation: countPulse .85s ease infinite;
}
@keyframes countPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}

.capture-btn {
  width: 80px; height: 80px;
  border-radius: 50%; background: #fff;
  border: 5px solid rgba(255,255,255,.28);
  box-shadow: 0 0 0 4px rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: transform .15s, box-shadow .15s;
}
.capture-btn:hover  { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(255,255,255,.22); }
.capture-btn:active { transform: scale(.93); }
.capture-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════════════════
   Screen 3 — Processing (stays dark — matrix animation)
   ══════════════════════════════════════════════════════════════════════════ */
#screen-processing { background: #0a0a0a; overflow: hidden; }

#matrix-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%; opacity: .35;
}

.processing-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

.processing-card {
  background: rgba(240,239,236,.96); backdrop-filter: blur(20px);
  border: 1px solid rgba(10,10,10,.2);
  border-radius: var(--radius-lg);
  padding: 48px 56px; text-align: center;
  max-width: 460px; width: 90%;
}

.processing-card h2 {
  font-size: 1.1rem; font-weight: 400; color: var(--muted); margin-bottom: 6px;
}

.processing-char-name {
  font-family: 'GT Pressura Mono', monospace;
  font-size: 2rem; font-weight: 400; letter-spacing: .01em;
  color: var(--accent); margin-bottom: 32px;
}

.spinner {
  width: 52px; height: 52px; margin: 0 auto 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.terminal-lines {
  text-align: left;
  font-family: 'GT Pressura Mono', monospace;
  font-size: .76rem; line-height: 1.7; color: #0A0A0A;
  background: rgba(10,10,10,.06);
  border: 1px solid rgba(10,10,10,.18);
  border-radius: 8px; padding: 14px; max-height: 130px;
  overflow: hidden;
}
.terminal-line { animation: fadeSlide .25s ease; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════════════
   Screen 4 — Review
   ══════════════════════════════════════════════════════════════════════════ */
#screen-review {
  background: var(--bg);
  align-items: center; justify-content: center;
  gap: 24px; padding: 36px 24px;
}

.review-title {
  text-transform: uppercase;
  font-family: 'GT Pressura Mono', monospace;
  font-size: clamp(2rem, 5vw, 3rem); font-weight: normal;
  color: var(--accent); text-align: center;
}

.review-grid {
  display: flex; align-items: center; gap: 14px;
  width: 100%; max-width: 1200px; flex: 1;
}

.review-pane {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  align-items: center; gap: 10px;
}
.review-pane label {
  font-family: 'GT Pressura Mono', monospace;
  font-size: .82rem; font-weight: 400; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
/* Show the full frame (contain, not cover) and let it grow as large as the
   space allows — but never upscale past the image's own resolution. */
.review-pane img {
  width: auto; height: auto;
  max-width: 100%; max-height: 72vh; object-fit: contain;
  border-radius: var(--radius); border: 1px solid var(--border);
  transition: opacity .25s var(--ease);
}
.result-pane img {
  border-color: var(--char-color);
  box-shadow: 0 0 28px -8px var(--char-color);
}

.review-arrow { font-size: 2rem; color: var(--border); flex-shrink: 0; }

.review-actions {
  display: flex; gap: 14px;
  width: 100%; max-width: 520px;
}

/* ── Shared buttons ─────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary {
  flex: 1; padding: 18px 20px;
  border-radius: var(--radius);
  font-size: 1rem; font-weight: 400; letter-spacing: .04em; text-transform: uppercase;
  transition: all .2s var(--ease);
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 20px -6px rgba(10,10,10,.4);
}
.btn-primary:hover  { filter: brightness(1.08); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.wide   { flex: none; width: 100%; max-width: 320px; }

.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface2); }

/* ══════════════════════════════════════════════════════════════════════════
   Screen 5 — Success
   ══════════════════════════════════════════════════════════════════════════ */
#screen-success { background: var(--bg); align-items: center; justify-content: center; }

.success-content {
  display: flex; flex-direction: column;
  align-items: center; gap: 22px;
  padding: 40px; text-align: center;
}
.success-content h2 {
  text-transform: uppercase;
  font-family: 'GT Pressura Mono', monospace;
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: normal;
  color: var(--accent);
}

.success-icon { font-size: 4.5rem; animation: bounceIn .5s var(--ease); }
@keyframes bounceIn {
  0%   { transform: scale(0);    opacity: 0; }
  60%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); }
}

.success-photo {
  width: auto; height: auto;
  max-width: min(560px, 86vw); max-height: 64vh;
  border-radius: var(--radius-lg);
  border: 2px solid var(--char-color);
  box-shadow: 0 8px 32px -8px var(--char-color);
}

/* ══════════════════════════════════════════════════════════════════════════
   Download QR code (success screen + gallery lightbox)
   ══════════════════════════════════════════════════════════════════════════ */
.qr-download {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: fadeSlide .3s var(--ease);
}
.qr-code {
  background: #fff; padding: 10px; border-radius: var(--radius);
  border: 1px solid var(--border);
  line-height: 0;          /* drop inline-image whitespace so the frame hugs the QR */
}
.qr-code img {
  /* Rendered near its natural size (cellSize 4 ≈ 180–200px) so module edges stay
     sharp — scaling a QR down can merge columns and break scanning. */
  display: block; width: auto; height: auto; max-width: 200px;
}
.qr-hint {
  font-family: 'GT Pressura Mono', monospace;
  font-size: .82rem; letter-spacing: .01em; color: var(--muted);
  max-width: 260px; text-align: center;
}
/* Lightbox sits on a near-black backdrop — lighten the hint for contrast. */
.qr-download--dark .qr-hint { color: rgba(255,255,255,.75); }

/* Share button pinned to the bottom-right corner of the lightbox photo. */
.lightbox-share {
  position: absolute; bottom: 14px; right: 14px; z-index: 3;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(10,10,10,.55); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.22); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 0;
  transition: background .18s, transform .18s;
}
.lightbox-share svg { width: 22px; height: 22px; }
.lightbox-share:hover  { background: rgba(10,10,10,.78); }
.lightbox-share:active { transform: scale(.92); }
.lightbox-share.active { background: var(--accent); border-color: var(--accent); }

/* The QR pops up above the share button instead of always being on screen. */
.lightbox-qr-pop {
  position: absolute; bottom: 74px; right: 14px; z-index: 3;
  padding: 14px; border-radius: var(--radius-lg);
  background: rgba(10,10,10,.78); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 12px 40px -10px rgba(0,0,0,.7);
  animation: fadeSlide .2s var(--ease);
}
.lightbox-qr-pop[hidden] { display: none; }
.lightbox-qr-pop .qr-hint { max-width: 180px; }

/* ══════════════════════════════════════════════════════════════════════════
   Gallery modal
   ══════════════════════════════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: stretch;
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20,20,20,.45); backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative; width: 100%; height: 100%;
  background: var(--surface);
  display: flex; flex-direction: column; overflow: hidden;
  animation: slideUp .3s var(--ease);
}
@keyframes slideUp {
  from { transform: translateY(48px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(22px + env(safe-area-inset-top, 0px)) 28px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 {
  text-transform: uppercase;
  font-family: 'GT Pressura Mono', monospace;
  font-size: 2rem; font-weight: normal; color: var(--accent);
}

.close-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface2); color: var(--text);
  font-size: 1rem; border: 1px solid var(--border);
  transition: background .18s;
}
.close-btn:hover { background: var(--border); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  /* Fixed row height (not aspect-ratio) so tracks can't collapse and let tiles
     overflow into the next row. Uniform rows, packed from the top, scrollable. */
  grid-auto-rows: 200px;
  align-content: start;
  gap: 16px; padding: 24px;
  flex: 1; min-height: 0;          /* allow the grid to shrink so it scrolls… */
  overflow-y: auto;                /* …instead of expanding past the panel */
  -webkit-overflow-scrolling: touch;
}

.gallery-item {
  position: relative; border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px -8px rgba(20,20,20,.2);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s var(--ease);
  display: block;
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 28px 10px 10px;
  background: linear-gradient(transparent, rgba(20,20,20,.8));
  font-size: .78rem; font-weight: 400; text-align: center; color: #fff;
  letter-spacing: .03em;
}

.gallery-empty {
  padding: 80px; text-align: center;
  color: var(--muted); font-size: 1.05rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   Info modal
   ══════════════════════════════════════════════════════════════════════════ */
.info-card {
  position: relative; z-index: 1;
  margin: auto;                       /* center within the .modal flex container */
  width: min(620px, 92vw);
  max-height: 88vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px -20px rgba(20,20,20,.5);
  animation: slideUp .3s var(--ease);
}
.info-body { padding: 22px 28px 30px; }
.info-body h3 {
  font-family: 'GT Pressura Mono', monospace;
  text-transform: uppercase; font-weight: normal;
  font-size: 1rem; letter-spacing: .03em; color: var(--accent);
  margin: 22px 0 8px;
}
.info-body h3:first-child { margin-top: 4px; }
.info-body p {
  font-size: 1rem; line-height: 1.55; color: var(--text);
  margin-bottom: 6px;
}
.info-body code {
  font-family: 'GT Pressura Mono', monospace;
  font-size: .9em; background: var(--surface2);
  padding: 1px 6px; border-radius: 6px;
}
.info-note {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: .92rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   Lightbox
   ══════════════════════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(10,10,10,.94);
}

.lightbox-stage {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  max-width: min(92vw, 1100px);
  animation: lbFadeIn .2s var(--ease);
}
@keyframes lbFadeIn {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-img-wrap {
  position: relative;            /* anchor for the share button + QR popover */
  display: inline-block; line-height: 0;
  max-width: 100%;
}

#lightbox-img {
  width: auto; height: auto;
  /* Leave a little vertical room for the caption below the photo. */
  max-height: 78vh; max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  display: block;
  transition: opacity .18s var(--ease);
}

.lightbox-caption {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px;
}
.lightbox-caption #lightbox-char {
  font-family: 'GT Pressura Mono', monospace;
  font-size: 1rem; font-weight: 400; letter-spacing: .01em;
  color: rgba(255,255,255,.85);
}
.lightbox-caption #lightbox-counter {
  font-size: .82rem; color: rgba(255,255,255,.4);
}

.lightbox-nav {
  position: absolute; z-index: 2;
  top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.12); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18); color: #fff;
  font-size: 2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s, transform .18s;
}
.lightbox-nav:hover { background: rgba(255,255,255,.25); }
.lightbox-nav:active { transform: translateY(-50%) scale(.93); }
.lightbox-prev { left: clamp(12px, 3vw, 40px); }
.lightbox-next { right: clamp(12px, 3vw, 40px); }

.lightbox-close {
  position: absolute; top: 20px; right: 20px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.12); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18); color: #fff;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s;
}
.lightbox-close:hover { background: rgba(10,10,10,.7); }

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  padding: 14px 28px; border-radius: 100px;
  font-size: .92rem; font-weight: 400;
  z-index: 300; animation: fadeSlide .3s var(--ease);
  white-space: nowrap;
}
.toast[hidden] { display: none; }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ══════════════════════════════════════════════════════════════════════════
   Tablet / kiosk — tuned for the iPad Pro 12.9" booth (1024 × 1366, portrait).
   Mobile phones keep the compact base layout above; this scales the booth up so
   the six role cards fit on one screen and touch targets are comfortably large.
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  /* ── Screen 1 · selection ─────────────────────────────────────────────── */
  .screen-content { padding: 56px 44px; gap: 44px; }

  .title-block h1 { font-size: 4rem; }
  .subtitle { margin-top: 1.4em; font-size: 1.35rem; }

  /* 6 cards → a clean 3 × 2 grid that uses the full tablet width */
  .characters-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px; max-width: 920px;
  }
  .character-card { padding: 26px 20px 22px; gap: 12px; }
  .char-illustration { height: clamp(150px, 18vh, 200px); }
  .char-name { font-size: 1.3rem; }
  .char-desc { font-size: .98rem; }
  .char-cta  { font-size: .85rem; }

  .twist-block { max-width: 920px; gap: 16px; }
  .twist-label { font-size: .95rem; }
  .twist-chip  { padding: 12px 22px; font-size: 1.02rem; }
  .twist-emoji { font-size: 1.25rem; }

  .gallery-fab { padding: 16px 34px; font-size: 1.1rem; }

  /* ── Screen 2 · camera ────────────────────────────────────────────────── */
  .face-guide-oval { width: min(60vw, 460px); height: min(78vw, 600px); }
  .face-guide-hint { margin-top: 36px; font-size: 1.05rem; }
  .back-btn, .character-badge { font-size: 1.05rem; padding: 12px 24px; }
  .capture-btn { width: 104px; height: 104px; }
  .countdown-display { font-size: 7rem; }

  /* ── Screen 3 · processing ────────────────────────────────────────────── */
  .processing-card { max-width: 560px; padding: 56px 64px; }
  .processing-card h2 { font-size: 1.3rem; }
  .processing-char-name { font-size: 2.4rem; }
  .terminal-lines { font-size: .92rem; max-height: 170px; }

  /* ── Screen 4 · review ────────────────────────────────────────────────── */
  .review-grid { gap: 22px; }
  .review-pane label { font-size: .95rem; }
  .review-arrow { font-size: 2.6rem; }
  .review-actions { max-width: 640px; }

  /* ── Shared buttons ───────────────────────────────────────────────────── */
  .btn-primary, .btn-secondary { padding: 22px 24px; font-size: 1.15rem; }

  /* ── Screen 5 · success ───────────────────────────────────────────────── */
  .success-photo { max-width: min(640px, 80vw); max-height: 60vh; }

  /* ── Gallery modal ────────────────────────────────────────────────────── */
  .modal-header h2 { font-size: 2.4rem; }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    grid-auto-rows: 230px;
    gap: 20px; padding: 32px;
  }
  .gallery-item-label { font-size: .92rem; }
}
