@font-face {
  font-family: 'DaxPro';
  src: url('../fonts/DaxPro-Light.otf') format('opentype');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'DaxPro';
  src: url('../fonts/DaxPro-Medium.otf') format('opentype');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'DaxPro';
  src: url('DaxOffcPro-Bold.eot');
  src: url('DaxOffcPro-Bold.eot?#iefix') format('embedded-opentype'),
    url('DaxOffcPro-Bold.woff2') format('woff2'),
    url('DaxOffcPro-Bold.woff') format('woff'),
    url('DaxOffcPro-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DaxPro';
  src: url('DaxOffcPro-Medi.eot');
  src: url('DaxOffcPro-Medi.eot?#iefix') format('embedded-opentype'),
    url('DaxOffcPro-Medi.woff2') format('woff2'),
    url('DaxOffcPro-Medi.woff') format('woff'),
    url('DaxOffcPro-Medi.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DaxPro';
  src: url('DaxPro-Light.eot');
  src: url('DaxPro-Light.eot?#iefix') format('embedded-opentype'),
    url('DaxPro-Light.woff2') format('woff2'),
    url('DaxPro-Light.woff') format('woff'),
    url('DaxPro-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}



* {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
html, body {  min-height: 100vh;
    height: auto;}
html { background: #00234b; }
body {
  font-family: 'DaxPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #00234b;
  color: #fff;
  min-height: 100vh;
  overflow: hidden;
}
img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}
::selection { background: transparent; }

/* --- Info page (mobile-only / no session) --- */
.page-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
  text-align: center;
  color: #fff;
  background: linear-gradient(#80CAED 0%, #009FD9 25%, #1479BB 50%, #155B91 75%, #1C375B 100%);
}
.info-logo {
  width: clamp(200px, 60vw, 320px);
  margin-bottom: 32px;
}
.info-card {
  max-width: 340px;
  margin-bottom: 32px;
}
.info-card p {
  font-size: 16px;
  line-height: 1.6;
  color: #fff;
  font-weight: 400;
  margin-bottom: 12px;
}
.info-footer-logo {
  width: clamp(140px, 40vw, 200px);
  margin-top: auto;
}

/* --- Splash screen --- */
#splash-screen {
  position: relative;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 100px 24px 30px;
  text-align: center;
  background: linear-gradient(#80CAED 0%, #009FD9 25%, #1479BB 50%, #155B91 75%, #1C375B 100%);
}
#shared-logo {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(200px, 200px, 320px);
  z-index: 100;
  pointer-events: none;
}
/* Fade-out transition for splash content (not the logo) */
#splash-screen .splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  width: 100%;
  transition: opacity 0.4s ease-out;
}
#splash-screen.fading .splash-content {
  opacity: 0;
}
#splash-ball-canvas {
  width: clamp(240px, 250px, 340px);
  height: clamp(240px, 250px, 340px);
  margin-top: -50px;
  z-index: -1;
  flex-shrink: 0;
}
.splash-text {
  padding: 0 24px 24px;
  width: 100%;
}
.splash-cta {
  font-size: 20px;
  font-weight: 400;
  color: #fff;
}
.splash-win {
  font-size: clamp(36px, 10vw, 52px);
  font-weight: 700;
  color: #fff;
  line-height: .9;
}
.splash-prizes {
  font-size: 20px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 12px;
}
.splash-list {
  font-size: 13px;
  font-weight: 300;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
}
.btn-splash {
  padding: 8px 60px;
  font-size: 20px;
  font-family: inherit;
  font-weight: 700;
  text-transform: uppercase;
  border: none;
  border-radius: 25px;
  background: #fff;
  color: #1479BB;
}

.splash-footer-logo {
  width: clamp(140px, 40vw, 200px);
  margin-top: auto;
}

/* --- Code entry section --- */
#code-entry {
  position: relative;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 140px 24px 40px;
  text-align: center;
  overflow: hidden;
}
#code-entry .code-content {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out 0.3s, transform 0.5s ease-out 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
#code-entry.ready .code-content {
  opacity: 1;
  transform: translateY(0);
}
#code-bg {
  position: absolute;
  inset: 0;
  background: url('../stade.jpg') center top / cover no-repeat;
  z-index: -1;
}
#code-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,20,40,0.3) 0%, rgba(0,20,40,0.6) 40%, rgba(0,20,40,0.95) 70%, #001428 100%);
}
.code-instructions {
  font-size: 16px;
  font-weight: 400;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 24px;
  padding: 0 10px;
  max-width: 340px;
}
.no-session-block {
  text-align: center;
  max-width: 340px;
}
.no-session-msg {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}
.no-session-detail {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
}

.lang-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px;
  z-index: 300;
}

.code-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.code-label {
  font-size: 18px;
  font-weight: 500;
  color: #80CAED;
  margin-bottom: 10px;
}
.code-input {
  width: 100%;
  padding: 14px 20px;
  font-size: 24px;
  font-family: 'DaxPro', monospace;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 4px;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: #1C375B;
  outline: none;
  transition: box-shadow .3s;
}
.code-input::placeholder {
  color: #bbb;
  letter-spacing: 1px;
  font-size: 16px;
  text-transform: none;
  font-weight: 400;
}
.code-input:focus { box-shadow: 0 0 0 3px rgba(128,202,237,0.5); }
.code-expiry {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-top: 10px;
}

.btn-play {
  margin-top: 24px;
  padding: 12px 60px;
  font-size: 22px;
  font-family: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: none;
  border-radius: 30px;
  background: #fff;
  color: #1479BB;
  cursor: pointer;
  transition: transform .2s, opacity .2s;
}
.btn-play:hover { opacity: .9; }
.btn-play:active { transform: scale(0.97); }
.btn-play:disabled { opacity: .5; cursor: not-allowed; }

.error-msg {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(230, 57, 70, .2);
  border: 1px solid rgba(230, 57, 70, .4);
  border-radius: 10px;
  font-size: 15px;
  color: #ff8a8a;
  display: none;
  width: 100%;
}
.error-msg.visible { display: block; }

/* --- Game area (hidden by default) --- */
#game-area { display: none; position: relative; z-index: 50; }
#game-area.active { display: block; }

/* --- 3D scene --- */
#scene-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  touch-action: none;
  z-index: 55;
  pointer-events: none;
  visibility: hidden;
}
#game-area.active #scene-canvas { visibility: visible; }

/* --- Loading overlay --- */
#loading {
  position: fixed;
  inset: 0;
  background: #00234b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity .5s;
}
#loading.hidden { opacity: 0; pointer-events: none; }
#loading .spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
#loading p { color: #fff; margin-top: 16px; font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Intro background --- */
#intro-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #00234b;
  transition: opacity .8s ease-out;
}
#intro-bg.hidden { opacity: 0; pointer-events: none; }

/* --- Game background (field) --- */
#bg-image {
  position: fixed;
  inset: 0;
  background: url('/assets/stade.jpg') center/cover no-repeat;
  z-index: 1;
  transform-origin: center center;
  transition: opacity .8s ease-out, transform .8s ease-out;
}
#bg-image.zooming { transform: scale(4); }
#bg-image.hidden { opacity: 0; }

/* --- Thème Canada Soccer --- */
body.theme-canada #code-bg,
body.theme-canada #bg-image { background-image: url('../stade_bmo.jpg'); }



/* --- Swipe hint --- */
#swipe-hint {
  position: fixed;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255, .85);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  z-index: 10;
  animation: hintFadeIn .6s ease-out forwards, hintPulse 2s ease-in-out .6s infinite;
  pointer-events: none;
  display: none;
  opacity: 0;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  width: 80vh;
}
#swipe-hint.hidden-temp { visibility: hidden; }
#swipe-hint .arrow {
  font-size: 32px;
  display: block;
  margin-bottom: 4px;
  transform: rotate(90deg);
  letter-spacing: -4px;
}
@keyframes hintFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes hintPulse {
  0%, 100% { opacity: .6; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(-10px); }
}

/* --- Swipe feedback --- */
#swipe-feedback {
  position: fixed;
  top: 25vh;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 24px;
  max-width: 80vw;
  font-weight: 700;
  text-align: center;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  background: rgba(230, 57, 70, .9);
  padding: 12px 24px;
  border-radius: 18px;
  transition: opacity .3s;
  width: 100%;
}
#swipe-feedback.visible { opacity: 1; }

/* --- Confetti canvas --- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
}

/* --- Win overlay --- */
#win-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(#80CAED 0%, #009FD9 25%,  #1479BB 50%, #155B91 75%, #1C375B 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s;
  overflow: hidden;
  padding-top: 175px;
}
#win-overlay.visible { opacity: 1; pointer-events: auto; }
#win-overlay.loss .line:first-of-type { margin-top: 90px; }
#win-overlay.loss .subtitle { font-size: 26px; font-weight: 700; }

#win-ball-img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  position: fixed;
  top: 0;
  left: 50%;
  margin-left: -110px;
  z-index: 1;
  flex-shrink: 0;
  transform: scale(0.1);
  will-change: transform;
  pointer-events: none;
}

#win-overlay .line {
  opacity: 0;
  padding: 0 20px;
  transform: translateY(20px) scale(0.9);
  transition: opacity .5s ease-out, transform .5s ease-out;
}
#win-overlay .line.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.win-but {
  z-index: 1;
  width: 250px;
  margin-bottom: 16px;
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}
.win-but.show {
  animation: butBounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes butBounceIn {
  0%   { opacity: 0; transform: scale(0); }
  50%  { opacity: 1; transform: scale(1.2); }
  70%  { transform: scale(0.9); }
  85%  { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

#win-overlay .subtitle {
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  text-align: center;
}
#win-overlay .prize-name {
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
}
#win-overlay .ambassador-msg {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
}
#win-overlay .claim-msg {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  margin-top: 4px;
}

/* --- Barcode display --- */
#barcode-container {
  margin-top: 18px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 18px;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 3px 3px 15px rgba(0,0,0,.4);
}
#barcode-container.visible { display: flex; }
#barcode-container > svg, #barcode-container > canvas { display: none; }
.btn-save-barcode {
  flex-shrink: 0;
  padding: 8px;
  background: #1479BB;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-show-qr {
  flex: 1;
  padding: 10px 14px;
  background: #1479BB;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 14px;
}
#qr-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#qr-overlay.visible { display: flex; flex-direction: column; }
#qr-overlay canvas { background: #fff; padding: 16px; border-radius: 12px 12px 0 0; width: min(92vw, 92vh); height: min(92vw, 92vh); box-sizing: border-box; }
#qr-overlay-code { background: #fff; color: #000; text-align: center; font-size: 18px; font-weight: 600; letter-spacing: 4px; padding: 8px 16px 14px; border-radius: 0 0 12px 12px; width: min(92vw, 92vh); box-sizing: border-box; }
#barcode-number {
  text-align: center;
  font-size: 12px;
  color: #000;
  margin-top: 3px;
  font-weight: 500;
  letter-spacing: 3px;
}

/* --- Already-used screen --- */
#already-used-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(#80CAED 0%, #009FD9 25%, #1479BB 50%, #155B91 75%, #1C375B 100%);
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 24px;
  z-index: 300;
  overflow-y: auto;
}
#already-used-screen.visible { display: flex; }

#already-used-screen .au-logo {
  max-width: 180px;
  width: 60%;
  margin-bottom: 24px;
}

#already-used-screen .au-title {
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 20px;
}

#already-used-screen .au-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 340px;
  flex: 1;
}
#already-used-screen .au-panel.visible { display: flex; }

#already-used-screen .au-prize {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 16px;
}

#already-used-screen .au-msg {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
  margin: 0 0 16px;
}

#already-used-screen .au-hint {
  color: #e67e22;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin: 12px 0 0;
}

#already-used-screen .au-claim {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  margin: 12px 0 0;
}

#au-barcode-container {
  margin-top: 8px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 3px 3px 15px rgba(0,0,0,.4);
}
#au-barcode-container > canvas { display: none; }

#already-used-screen .au-footer-logo {
  max-width: 120px;
  width: 40%;
  margin-top: 24px;
}
