* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; min-height: 100dvh; height: 100%; overflow: hidden; font-family: system-ui, -apple-system, sans-serif; -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; background: #000000; color: #e2e8f0; }
#kiosk-app .screen { position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; padding: clamp(1rem, 3vh, 2rem) clamp(1rem, 4vw, 1.5rem); padding-top: calc(clamp(1rem, 3vh, 2rem) + env(safe-area-inset-top, 0px)); padding-bottom: calc(clamp(1rem, 3vh, 2rem) + env(safe-area-inset-bottom, 0px)); padding-left: calc(clamp(1rem, 4vw, 1.5rem) + env(safe-area-inset-left, 0px)); padding-right: calc(clamp(1rem, 4vw, 1.5rem) + env(safe-area-inset-right, 0px)); background: #000000; }
#kiosk-app .screen.active { display: flex; }
.content { max-width: 640px; width: 100%; text-align: center; padding-inline: clamp(0.5rem, 2vw, 1rem); }
.screen h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; letter-spacing: 0.02em; margin: 0 0 1.25rem; line-height: 1.2; }
.screen p { font-size: clamp(1rem, 2.5vw, 1.15rem); color: #a8b4c4; margin: 0 0 1rem; line-height: 1.45; }

/* Reusable logo on every screen – breathing room above and below */
.screen-logo { flex-shrink: 0; margin-top: clamp(0.5rem, 1.5vh, 1rem); margin-bottom: clamp(1rem, 2.5vh, 1.5rem); }
.screen-logo-img { max-width: min(280px, 60vw); height: auto; display: block; }
#screen-attract .screen-logo-img { max-width: min(520px, 92vw); }

/* Attractor: headline center, subtext; touch anywhere advances */
#screen-attract { cursor: pointer; justify-content: flex-start; padding-top: clamp(0.75rem, 2vh, 1.5rem); }
.attract-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; width: 100%; max-width: 640px; }
.attract-video-wrap { margin-bottom: 1rem; min-height: 0; }
.attract-video-wrap:empty { display: none; }
.attract-headline { font-size: clamp(2rem, 8vw, 4rem); font-weight: 800; text-align: center; margin: 0 0 0.75rem; letter-spacing: 0.04em; animation: attract-pulse 3s ease-in-out infinite; }
.attract-subtext { font-size: clamp(1rem, 3vw, 1.5rem); color: #a8b4c4; text-align: center; margin: 0; line-height: 1.4; }
@keyframes attract-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.88; } }

.btn { min-height: 56px; padding: 0.75rem 2rem; font-size: clamp(1.1rem, 2.5vw, 1.25rem); font-weight: 600; border: none; border-radius: 12px; cursor: pointer; touch-action: manipulation; width: 100%; max-width: 20rem; margin-left: auto; margin-right: auto; display: block; }
.btn-primary { background: #22c55e; color: #fff; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }

/* Terms: logo at top, centered box, clear separation to Agree button, dark neutral scroll */
.content-terms { display: flex; flex-direction: column; align-items: stretch; max-width: 720px; width: 100%; height: 100%; max-height: min(85vh, 85dvh); justify-content: flex-start; }
.content-terms h1 { flex-shrink: 0; margin-bottom: 1rem; text-align: center; }
.terms-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; text-align: left; padding: 1.25rem; background: #0d0d0d; border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; margin-bottom: 1.25rem; font-size: clamp(0.9rem, 1.8vw, 1.05rem); line-height: 1.5; -webkit-overflow-scrolling: touch; color: #b0b8c4; }
.terms-scroll p { margin: 0 0 0.75rem; }
.terms-scroll p:last-child { margin-bottom: 0; }
.terms-scroll a { color: #a5d6ff; text-decoration: underline; }
.btn-terms-accept { flex-shrink: 0; min-height: 64px; font-size: 1.2rem; margin-top: 0.25rem; }

/* Email/keyboard screen: balanced spacing, error secondary, submit dominant */
#screen-email .content { display: flex; flex-direction: column; align-items: center; gap: 0; }
#screen-email .content h1 { margin-bottom: 1rem; }
.email-display { min-height: 56px; padding: 1rem 1.25rem; font-size: clamp(1.15rem, 3vw, 1.35rem); background: rgba(255,255,255,0.08); border-radius: 12px; margin-bottom: 0.75rem; word-break: break-all; width: 100%; max-width: min(520px, 100%); }
.email-display.empty { color: #64748b; }
.native-email-wrap { display: flex; gap: 0.5rem; width: 100%; max-width: min(520px, 100%); margin: 0.5rem 0; }
.native-email-input { flex: 1; min-width: 0; padding: 0.85rem 1rem; font-size: 1.1rem; border-radius: 10px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); color: inherit; }
.native-email-input:focus { outline: 2px solid #60a5fa; outline-offset: 2px; }
.registration-form { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; max-width: min(520px, 100%); margin: 0.5rem 0; }
.registration-form .form-row { display: flex; flex-direction: column; gap: 0.25rem; text-align: left; }
.registration-form .form-row-split { flex-direction: row; gap: 0.75rem; }
.registration-form .form-row-split .form-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; text-align: left; }
.registration-form .form-label { font-size: 0.95rem; color: #cbd5e1; }
.registration-form input[type="text"],
.registration-form input[type="email"],
.registration-form select { width: 100%; padding: 0.85rem 1rem; font-size: 1.05rem; border-radius: 10px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); color: inherit; box-sizing: border-box; }
.registration-form input:focus,
.registration-form select:focus { outline: 2px solid #60a5fa; outline-offset: 2px; }
.registration-form .form-actions { align-items: stretch; }
.registration-form .form-actions .btn { width: 100%; }
.form-helper-note { margin: 1rem auto 0; padding: 0 0.25rem; max-width: min(520px, 100%); text-align: center; color: #94a3b8; font-size: 0.85rem; line-height: 1.4; }
.error { color: #f87171; font-size: 1rem; min-height: 1.5em; }
#screen-email .error { font-size: 0.95rem; margin-bottom: 1rem; opacity: 0.95; }
.keyboard { display: grid; gap: clamp(6px, 1.5vw, 8px); max-width: min(600px, 100%); width: 100%; margin: 0 auto; margin-top: 0.5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.5rem; }
.keyboard-row { display: flex; justify-content: center; gap: clamp(6px, 1.5vw, 8px); flex-shrink: 0; }
.key { min-height: 52px; min-width: 44px; padding: 0.5rem; font-size: clamp(1rem, 2.2vw, 1.1rem); font-weight: 500; color: #e2e8f0; background: rgba(255,255,255,0.12); border: none; border-radius: 8px; cursor: pointer; touch-action: manipulation; }
.key:active { background: rgba(255,255,255,0.25); }
.key.wide { min-width: 72px; }
.key.action { background: #1f1f1f; }
.key.submit { background: #16a34a; color: #fff; min-width: 100px; font-weight: 600; }
.spinner { width: 56px; height: 56px; border: 4px solid rgba(255,255,255,0.2); border-top-color: #e2e8f0; border-radius: 50%; animation: spin 0.9s linear infinite; margin: 0 auto 1.25rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.check-icon { font-size: 3.5rem; color: #16a34a; margin-bottom: 0.75rem; }
#screen-check-email .content p { margin-bottom: 0.5rem; }
.swipe-helper { font-size: 0.95rem; color: #94a3b8; margin-top: 0.5rem; }
.email-screen-body { display: none; margin-bottom: 1rem; }
.email-screen-body p { margin: 0 0 0.5rem; }

/* Mobile: keyboard fits within viewport, no horizontal overflow */
@media (max-width: 480px) {
  .registration-form .form-row-split { flex-direction: column; gap: 0.75rem; }
  .keyboard { gap: 4px; overflow-x: visible; max-width: 100%; }
  .keyboard-row { gap: 4px; flex-wrap: nowrap; justify-content: center; width: 100%; }
  .keyboard-row .key { flex: 1 1 0; min-width: 28px; max-width: 2.5em; min-height: 44px; font-size: 0.9rem; padding: 0.35rem 0.25rem; }
  .keyboard-row .key.wide { min-width: 44px; max-width: 4em; }
  .keyboard-row .key.submit { min-width: 56px; max-width: none; }
}
