@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;800;900&family=Barlow:wght@400;600;700;800&display=swap');

@font-face {
  font-family: 'Snickers-Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Snickers-Arabic.ttf') format('truetype');
}
@font-face {
  font-family: 'Snickers-Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Snickers-Arabic.ttf') format('truetype');
}
@font-face {
  font-family: 'Snickers-Arabic';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/Snickers-Arabic.ttf') format('truetype');
}

@font-face {
  font-family: 'Tungsten-Bold';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Tungsten-Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'Chivo';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/Chivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Chivo';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/Chivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg:        #7A4B2A;
  --surface:   #4A1B09;
  --surface2:  #5C2210;
  --gold:      #E3A020;
  --red:       #DC1C1C;
  --blue:      #122a8a;
  --white:     #FFFFFF;
  --muted:     #B08060;
  --vh:        1vh;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
input, button, select, textarea { font-family: inherit; }

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

/* ── Background ─────────────────────────────────────────────── */
.bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: -1;
  pointer-events: none;
  background: url('../images/BC.jpg') center / cover no-repeat;
}

body {
  color: var(--white);
  font-family: 'Barlow', sans-serif;
  height: 100dvh;
  position: relative;
}

/* ── Screen ─────────────────────────────────────────────────── */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── Corner balls ───────────────────────────────────────────── */
.corner {
  width: 110px;
  height: 110px;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}
.corner-tl {
  position: absolute;
  left: 0px;
  top: 185px;
}
.corner-tr {
  position: absolute;
  top: -5px;
  right: -32px;
  overflow: visible;
}
.corner img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}
.corner-tl img { width: 110px; height: 110px; transform: rotate(5deg); }
.corner-tr img { width: 135px; height: 135px; transform: rotate(-25deg); }
.corner-tr.corner-tr--ty { position: absolute; top: 10px; right: -37px; z-index: 20; }
.corner-tr.corner-tr--ty img { width: 130px; height: 130px; }
.corner-tr.corner-tr--vote { right: -45px; top: 10px; }
.corner-tr.corner-tr--vote img { width: 115px; height: 115px; }
.ty-content-wrap { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 100%; }

/* ── Snickers logo ──────────────────────────────────────────── */
.logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
  padding: 0 16px;
  position: relative;
  z-index: 1;
  margin: 40px 0px 10px;
}
.logo-wrap img {
  max-width: 300px;
  max-height: 95px;
  object-fit: contain;
}
.logo-ph {
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gold);
  border: 2px dashed rgba(232,160,32,0.4);
  border-radius: 8px;
  padding: 10px 20px;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  text-align: center;
  position: relative;
  z-index: 1;
}
/* .fifa-tag {
  font-family: 'Tungsten-Bold', sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 4.5vw, 34px);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1;
} */
.main-title--guess {
  font-size: clamp(32px, 8.5vw, 60px);
  color: var(--white);
}
.main-title--sub {
  font-size: clamp(36px, 11.5vw, 76px);
  display: block;
  margin-top: 8px;
}.main-title {
  font-family: 'Tungsten-Bold', sans-serif;
  font-weight: 900;
  font-size: clamp(62px, 17vw, 110px);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 0.80;
  margin: 25px 0px 5px;
}
.tagline {
  font-family: 'Chivo', sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: var(--white);
  line-height: 1.5;
  max-width: 340px;
  margin: 0 auto;
}

/* ── Form ───────────────────────────────────────────────────── */
.form {
  padding: 30px 36px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  position: relative;
  z-index: 1;
}

.field {
  display: grid;
  grid-template-columns: 1fr auto;
  margin-bottom: 14px;
}
.field-label {
  display: block;
  font-family: 'Tungsten-Bold', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 5px;
}
.field .field-label {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  margin-left: 1.5%;
}
.field-input,
.phone-wrap {
  grid-column: 1 / -1;
  grid-row: 2;
}
.field .field-error {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  margin-top: 0;
  font-size: 11px;
  text-align: right;
}

.field-input {
  width: 97%;
  display: block;
  margin: 0 auto;
  padding: 13px 16px;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 8px;
  color: var(--white);
  font-size: 24px;
  font-family: 'Tungsten-Bold', sans-serif;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow 0.2s;
}
.field-input::placeholder { color: var(--muted); }
.field-input:focus { box-shadow: 0 0 0 2px rgba(232,160,32,0.5); background: rgba(255,255,255,0.22); }
.field-input:-webkit-autofill,
.field-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(255,255,255,0.06) inset;
  -webkit-text-fill-color: #ffffff;
  transition: background-color 9999s ease-out;
}
.field-input.error { box-shadow: 0 0 0 2px var(--red); }

/* ── Region selector ────────────────────────────────────────── */
.regions-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}
.regions-label-row .field-label { margin-bottom: 0; margin-left: 1.5%; }
.regions-label-row .field-error { font-size: 11px; margin-top: 0; }
.regions {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0;
}
.region-btns {
  display: flex;
  justify-content: space-between;
}
.region-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: none;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 6px 0;
  border-radius: 10px;
  transition: border-color 0.2s;
}
.region-btn .rname {
  font-family: 'Chivo', sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: var(--white);
  text-transform: uppercase;
}
.rflag-wrap {
  background: rgba(255,255,255,0.12);
  border-radius: 14px;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.region-btn .rflag {
  width: 64px;
  height: auto;
  border-radius: 3px;
  display: block;
}
.region-btn.active { border-color: var(--gold); }
.region-btn.active .rname { color: var(--gold); }
.region-btns.error .rflag-wrap { box-shadow: 0 0 0 2px var(--red); }

/* ── Phone field ────────────────────────────────────────────── */
.field--phone {
  position: relative;
  z-index: 50;
}
.phone-wrap {
  display: flex;
  gap: 8px;
  width: 97%;
  margin: 0 auto;
}
.phone-code-wrap {
  position: relative;
  width: 120px;
  flex-shrink: 0;
}
.phone-code-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding-right: 28px;
  white-space: nowrap;
  position: relative;
}
.phone-code-btn::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #ffffff;
}
.phone-code-list {
  display: none;
  position: fixed;
  width: 130px;
  max-height: 180px;
  overflow-y: auto;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(48px);
  -webkit-backdrop-filter: blur(48px);
  border-radius: 8px;
  list-style: none;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.phone-code-list.open { display: block; }
.phone-code-list li {
  padding: 10px 14px;
  font-family: 'Tungsten-Bold', sans-serif;
  font-size: 14px;
  color: var(--white);
  cursor: pointer;
  white-space: nowrap;
}
.phone-code-list li:hover { background: rgba(255,255,255,0.12); }
.phone-code-list li.selected { color: var(--gold); }
.phone-number { flex: 1; }
.phone-wrap .field-input { width: 100%; margin: 0; }

.field-error {
  display: none;
  font-size: 12px;
  color: var(--red);
  margin-top: 5px;
}
.field-error.show { display: block; }
.field-error.show::after {
  content: ' !';
  font-size: 10px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 3px 48px;
  border: none;
  border-radius: 50px;
  font-family: 'Tungsten-Bold', sans-serif;
  font-weight: 400;
  font-size: 36px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  text-decoration: none;
  line-height: 1.3;
  color: var(--white);
}
.btn-gold  { background: var(--gold); }
.btn-red   { background: var(--red);  }
.btn-blue  { background: var(--blue); }
.btn:hover  { opacity: 0.88; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-wrap { padding: 0 40px; margin-top: 14px; }
.form .btn-wrap {
  padding: 0;
  margin-bottom: max(16px, env(safe-area-inset-bottom));
}

/* ── Vote page — header ─────────────────────────────────────── */
.vote-header {
  text-align: center;
  padding: 10px 20px 16px;
  position: relative;
  z-index: 1;
}
.vote-title {
  font-family: 'Tungsten-Bold', sans-serif;
  font-weight: 900;
  font-size: clamp(58px, 10vw, 90px);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--white);
  line-height: 0.88;
  margin: 2px 0 8px;
}
.vote-subtitle {
  font-family: 'Chivo', sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: var(--white);
  line-height: 1.5;
}

/* ── Match cards ────────────────────────────────────────────── */
.matches-list {
  padding: 0 48px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 1;
}
.screen--vote .matches-list.slide-in {
  animation: slide-in-left 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
@keyframes slide-in-left {
  from { transform: translateX(60px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.matches-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 0;
  gap: 16px;
  color: var(--muted);
  font-family: 'Chivo', sans-serif;
  font-size: 14px;
}

.match-date-label {
  font-family: 'Tungsten-Bold', sans-serif;
  font-size: 19px;
  letter-spacing: 0;
  color: var(--white);
  padding: 6px 0px 4px;
  border-bottom: 2px solid var(--white);
  margin-top: 28px;
}
.match-date-label:first-child { margin-top: 0; }

.match-card {
  background: none;
  border: 2px solid transparent;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.match-date-label + .match-card { margin-top: 5px; }
.match-card.locked  { opacity: 0.45; pointer-events: none; }
.match-card.voted   { border-color: transparent; }

.match-time {
  text-align: center;
  font-family: 'Chivo', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
}
.stage-badge {
  display: inline-block;
  background: rgba(227,160,32,0.15);
  color: var(--gold);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  margin-left: 6px;
  letter-spacing: 1px;
}

.match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.team-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 14px 4px;
  cursor: pointer;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.team-btn:hover:not(:disabled) .team-name { background: rgba(255,255,255,0.2); }
.team-btn.selected .team-name { background: var(--gold) !important; color: var(--white); }
.team-btn.dimmed  { opacity: 0.35; }
.team-btn:active:not(:disabled) { transform: scale(0.97); }
.team-btn:disabled { cursor: default; }

.team-flag {
  display: none;
}

.team-name {
  font-family: 'Tungsten-Bold', sans-serif;
  font-size: clamp(25px, 5.5vw, 32px);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--white);
  text-align: center;
  line-height: 1.1;
  background: rgba(255,255,255,0.22);
  border-radius: 10px;
  padding: 14px 5px;
  white-space: nowrap;
  width: calc(100% + 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s;
}

.vs-divider {
  font-family: 'Tungsten-Bold', sans-serif;
  font-size: 22px;
  color: var(--white);
  flex-shrink: 0;
  background: var(--blue);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.locked-label {
  display: none;
  text-align: center;
  font-family: 'Chivo', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.match-card.locked .locked-label { display: block; }


/* ── Pagination ─────────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 4px;
  margin-top: auto;
}
.page-next-btn {
  width: 100%;
  border-radius: 0;
}

.page-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transition: background 0.2s, transform 0.2s;
}
.page-dot.active {
  background: var(--gold);
  transform: scale(1.3);
}

/* ── Submit bar ─────────────────────────────────────────────── */
.submit-bar {
  z-index: 20;
  background: transparent;
  padding: 12px 36px max(16px, env(safe-area-inset-bottom));
  margin-top: auto;
}
.submit-hint {
  text-align: center;
  font-family: 'Chivo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.submit-hint.ready { color: var(--gold); }
.submit-bar .btn-wrap { margin-top: 0; padding: 0; }
.submit-bar .btn { padding-top: 0px; padding-bottom: 0px; line-height: 0.9; }
.screen--vote .submit-bar .btn { padding-top: 6px; padding-bottom: 6px; line-height: 1.1; }

/* ── Thank you screen ───────────────────────────────────────── */
.screen--thankyou .logo-wrap { margin-top: 35px; }
.screen--thankyou .logo-wrap img { max-width: 270px; max-height: 88px; }
.ty-btn-wrap { margin-top: 28px; margin-bottom: 28px; padding: 0 24px; animation: slide-up-fade 0.5s ease-out 0.4s both; }
.ty-btn-wrap .btn { font-size: 25px; white-space: nowrap; letter-spacing: 1px; padding: 10px 24px; border-radius: 15px; }
.ty-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 24px 32px;
  position: relative;
  z-index: 1;
}
.ty-are-you {
  font-family: 'Tungsten-Bold', sans-serif;
  font-weight: 400;
  font-size: clamp(42px, 8vw, 62px);
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  line-height: 1;
  margin-top: 30px;
  animation: choco-zoom 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0s both;
}
.ty-title {
  font-family: 'Tungsten-Bold', sans-serif;
  font-weight: 400;
  font-size: clamp(82px, 15vw, 121px);
  letter-spacing: 2px;
  color: var(--white);
  text-transform: uppercase;
  line-height: 0.88;
  margin-top: 30px;
  margin-bottom: 24px;
  animation: choco-zoom 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}
@keyframes choco-zoom {
  0%   { transform: scale(0.05); opacity: 0; }
  70%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

.ty-picks {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  animation: slide-up-fade 0.5s ease-out 0.3s both;
}
.ty-pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  gap: 8px;
}
.ty-pick-teams {
  font-family: 'Tungsten-Bold', sans-serif;
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  flex: 1;
  text-align: left;
}
.ty-pick-winner {
  font-family: 'Tungsten-Bold', sans-serif;
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
}
.ty-locked {
  font-family: 'Tungsten-Bold', sans-serif;
  font-size: 38px;
  font-weight: 600;
  color: var(--white);
  line-height: 1;
  text-align: center;
  margin-top: 24px;
  margin-bottom: 24px;
  animation: slide-up-fade 0.5s ease-out 0.3s both;
}

.ty-note {
  font-family: 'Chivo', sans-serif;
  font-size: 16px;
  font-weight: 300;
  color: var(--white);
  line-height: 1.2;
  max-width: 300px;
  margin-top: 30px;
  animation: slide-up-fade 0.5s ease-out 0.45s both;
}

/* ── Spinner ────────────────────────────────────────────────── */
.loading { text-align: center; padding: 40px 0; color: var(--muted); }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(232,160,32,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error notification (drop from top) ─────────────────────── */
.error-notif {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-110%);
  width: calc(100% - 32px);
  max-width: 480px;
  background: var(--red);
  color: var(--white);
  border-radius: 0 0 14px 14px;
  padding: 14px 44px 14px 18px;
  z-index: 1100;
  display: flex;
  align-items: center;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  transition: transform 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.error-notif.show {
  transform: translateX(-50%) translateY(0);
}
.error-notif-msg {
  font-family: 'Chivo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}
.error-notif-close {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--red); color: white;
  padding: 12px 24px; border-radius: 50px;
  font-size: 14px; font-weight: 600;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none; z-index: 999; white-space: nowrap;
  font-family: 'Chivo', sans-serif;
}
.toast.show { opacity: 1; }
.toast.success { background: #1a7a3a; }

/* ── Loading overlay ─────────────────────────────────────────── */
/* ── Page transition overlay ────────────────────────────────── */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.page-transition.active {
  opacity: 1;
  pointer-events: all;
}
.pt-icon {
  width: 200px;
  height: 200px;
  object-fit: contain;
  animation: pt-spin 0.7s linear infinite;
}
@keyframes pt-spin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(122, 75, 42, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.loading-overlay.active { display: flex; }
.loading-overlay .spinner { margin: 0; }

/* ── Register animations ─────────────────────────────────────── */
@keyframes slide-up-fade {
  from { transform: translateY(120px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes drop-fade {
  from { transform: translateY(-32px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.screen--register .logo-wrap          { animation: drop-fade     0.5s ease-out 0s    both; }
/* .screen--register .fifa-tag           { animation: drop-fade     0.5s ease-out 0.1s  both; } */
.screen--register .main-title         { animation: drop-fade     0.5s ease-out 0.2s  both; }
.screen--register .tagline            { animation: drop-fade     0.5s ease-out 0.3s  both; }
.screen--register .field:nth-child(1) { animation: slide-up-fade 0.5s ease-out 0.2s  both; }
.screen--register .field:nth-child(2) { animation: slide-up-fade 0.5s ease-out 0.3s  both; }
.screen--register .field--phone       { animation: slide-up-fade 0.5s ease-out 0.4s  both; z-index: 50; }
.screen--register .regions            { animation: slide-up-fade 0.5s ease-out 0.5s  both; }
.screen--register .btn-wrap           { animation: slide-up-fade 0.5s ease-out 0.6s  both; }

/* ── Vote animations ─────────────────────────────────────────── */
.screen--vote .logo-wrap    { animation: drop-fade     0.5s ease-out 0s    both; }
.screen--vote .vote-header  { animation: drop-fade     0.5s ease-out 0.1s  both; }
.screen--vote .matches-list { animation: slide-up-fade 0.5s ease-out 0.2s both; }
.screen--vote .main-title { font-size: clamp(80px, 14vw, 120px); margin-top: 20px; margin-bottom: 24px; }
.screen--vote .main-title--guess { font-size: clamp(55px, 9vw, 80px); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (min-width: 600px) and (hover: hover) and (pointer: fine) {
  body {
    display: flex;
    justify-content: center;
    padding: 0;
    align-items: flex-start;
  }
  .screen { left: 50%; transform: translateX(-50%); width: 720px; }
  .logo-wrap img { max-width: 200px; max-height: 65px; }
  .corner-tl { top: 250px; }
  .form { padding: 30px 16px 0; }
}

@media (min-width: 1024px) {
  .screen { width: 100%; left: 0; transform: none; max-width: none; }
  .screen--register {
    display: grid;
    grid-template-columns: 360px 540px;
    grid-template-rows: auto 1fr;
    column-gap: 40px;
    align-content: start;
    justify-content: center;
  }
  .screen--register .logo-wrap { grid-column: 1 / -1; grid-row: 1; padding: 26px 40px 0; }
  .screen--register .hero      { grid-column: 1; grid-row: 2; text-align: left; padding: 24px 0 0 40px; }
  .screen--register .form      { grid-column: 2; grid-row: 2; padding: 24px 16px 0; max-width: 540px; justify-self: stretch; }
  .screen--register .btn-wrap  { padding: 0; }
  .screen--vote .main-title { font-size: clamp(65px, 10vw, 95px); }
  .screen--vote .main-title--guess { font-size: clamp(45px, 7vw, 68px); }
  .screen--thankyou .logo-wrap { margin-top: 24px; }
  .screen--thankyou .logo-wrap img { max-height: 78px; }
  .screen--thankyou .ty-body { padding-top: 10px; padding-bottom: 18px; }
  .screen--thankyou .ty-title { font-size: clamp(62px, 8vw, 88px); margin-top: 18px; margin-bottom: 16px; }
  .screen--thankyou .ty-locked { font-size: 32px; margin-top: 16px; margin-bottom: 16px; }
  .screen--thankyou .ty-btn-wrap { margin-top: 18px; margin-bottom: 18px; }
  .screen--thankyou .ty-note { font-size: 15px; margin-top: 18px; }
  .phone-code-list li { font-size: 18px; }
  .rflag { width: 78px; }
  .rflag-wrap { width: 66px; height: 66px; }
}

/* ── Background full-screen fix ─────────────────────────────── */
html { overflow-x: clip; }

/* ── Ready page ──────────────────────────────────────────────── */
.screen--ready { display: flex; flex-direction: column; align-items: center; padding: 0 24px 24px; }
.screen--ready .hero { width: 100%; text-align: center; padding: 6px 0 0; }
.screen--ready .hero .main-title { margin-top: 0; }
.screen--ready .logo-wrap { padding: 4px 0 8px; }
.screen--ready .btn-wrap { padding: 0 20px; }
#start-btn { margin-top: 15px; font-size: 45px; line-height: 0.9; padding-top: 4px;}

.ready-body { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ready-predict { font-family: 'Chivo', sans-serif; font-size: clamp(22px, 5.5vw, 32px); color: var(--white); text-align: center; line-height: 1.1; font-weight: 300; margin-top: 24px; width: 100%; }
.ready-predict-logo { height: 1.8em; width: auto; vertical-align: middle; display: inline-block; margin-bottom: 0.1em; }
.ready-tagline {font-family: 'Chivo', sans-serif; font-weight: 600; font-size: clamp(15px, 4vw, 19px); color: var(--white); text-align: center; line-height: 1.4; margin-top: 55px; }



.ready-trophy { width: 280px; height: 280px; object-fit: contain; margin: 20px auto -35px; display: block; }

@media (min-width: 600px) and (hover: hover) and (pointer: fine) {
  .ready-icon-overlay { width: 90%; max-width: 520px; }
  .ready-white-img { width: 55%; margin: 16px auto 0; }
}

/* ── All phones (under 600px) ───────────────────────────────── */
@media (max-width: 599px) {
  .corner-tl { top: 170px; left: 10px;}
  .pt-icon { width: 260px; height: 260px; }
  .field-label {font-size: 20px;}
}

@media (max-width: 770px) {
  .corner-tl img { width: 95px; height: 95px; }
  .corner-tl { left: 10px; top: 185px; }
}


/* @media (max-width: 447px) {
  .logo-wrap img { max-width: 260px; max-height: 82px; }
} */

/* ── Screens 440px and below ────────────────────────────────── */
@media (max-width: 440px) {
  .logo-wrap img { max-width: 220px; max-height: 70px; }
  .field-label { font-size: 22px; }
  .field-input { font-size: 18px; padding: 10px 14px; }
}

@media (max-width: 430px) {
  .screen--vote .team-name { font-size: 20px; }
  .screen--register .logo-wrap { margin-top: 16px; }
  .screen--register .corner-tl { top: 130px; left: 15px; }
  .screen--register .corner-tr { top: 5px; }
  .screen--register .main-title { margin-top: 12px; }
  .screen--ready .ready-body { gap: 6px; }
  .screen--ready .ready-trophy { margin-top: 2px; margin-bottom: -55px; }
  .screen--ready #start-btn { font-size: 38px; margin-top: 10px;}
  .screen--vote .submit-bar { padding-top: 4px; }
  .screen--vote .match-date-label { margin-top: 16px; }
  .screen--thankyou .logo-wrap { margin-top: 22px; }
  .screen--thankyou .ty-title { font-size: clamp(64px, 14vw, 76px); margin-top: 20px; margin-bottom: 18px; }
  .screen--thankyou .ty-locked { font-size: 33px; margin-top: 18px; margin-bottom: 18px; }
  .screen--thankyou .ty-btn-wrap { margin-top: 20px; margin-bottom: 20px; }
  .screen--thankyou .ty-btn-wrap .btn { font-size: 22px; }
  .screen--thankyou .ty-note { font-size: 15px; margin-top: 20px; }
}

/* ── Smaller phones (450px and below) ───────────────────────── */
@media (max-width: 450px) {
  .corner-tr { top: 15px; right: -48px; }
  .corner-tl { left: 10px; top: 170px; }
  .corner-tr img { width: 110px; height: 110px; }
  .screen--thankyou .logo-wrap img { max-width: 210px; max-height: 75px; }
}

@media (max-width: 447px) {
  .corner-tl { left: 10px; top: 160px; }
  .corner-tl img { width: 90px; height: 90px; }
  .logo-wrap img { max-width: 240px; max-height: 75px; }
}

@media (max-width: 415px) {
  .screen--vote .main-title { font-size: clamp(65px, 14vw, 80px); }
  .screen--vote .main-title--guess { font-size: clamp(44px, 9vw, 55px); }
}

@media (max-width: 385px) {
  .corner-tr.corner-tr--vote {top: 5px;}
  .screen--vote .main-title { font-size: clamp(55px, 13vw, 65px); }
  .screen--vote .main-title--guess { font-size: clamp(37px, 8vw, 44px); }
}

@media (max-width: 448px) {
  .ty-title { font-size: clamp(72px, 15vw, 90px); }
}

@media (max-width: 402px) {
  .ty-title { font-size: clamp(62px, 14vw, 75px); }
}

@media (max-width: 400px) {
  .corner-tl { left: 10px; top: 160px; }
  .corner-tr {right: -55px; }
  .corner-tr img { width: 95px; height: 95px; }
  .corner-tl img { width: 85px; height: 85px; }
  .corner-tr.corner-tr--vote {right: -50px;}
  .corner-tr.corner-tr--vote img { width: 105px; height: 105px; }
  .corner-tr.corner-tr--ty {right: -53px; top: 20px}
  .corner-tr.corner-tr--ty img { width: 100px; height: 100px; }
  .logo-wrap img { max-width: 200px; max-height: 70px; }
  .screen--vote .matches-list { padding-left: 16px; padding-right: 16px; }
  .screen--thankyou .ty-title { font-size: clamp(54px, 13vw, 66px); }
}

@media (max-width: 390px) {
  .rflag-wrap { width: 44px; height: 44px; border-radius: 10px; }
  .corner-tl { left: 5px; top: 160px; }
  .corner-tl img { width: 75px; height: 75px; }
  .region-btn .rflag { width: 50px; }
  .region-btn .rname { font-size: 12px; }
}

@media (max-width: 370px) {
  .ty-title { font-size: clamp(55px, 13vw, 65px); }
  #start-btn { font-size: 38px; }
}

/* ── RTL / Arabic overrides ──────────────────────────────────── */
html[dir="rtl"] .main-title,
html[dir="rtl"] .main-title--guess,
html[dir="rtl"] .main-title--sub,
html[dir="rtl"] .field-label,
html[dir="rtl"] .btn,
html[dir="rtl"] .field-input,
html[dir="rtl"] .phone-code-btn,
html[dir="rtl"] .phone-code-list li,
html[dir="rtl"] .region-btn .rname,
html[dir="rtl"] .team-name,
html[dir="rtl"] .match-date-label,
html[dir="rtl"] .locked-label,
html[dir="rtl"] .ty-title,
html[dir="rtl"] .ty-locked,
html[dir="rtl"] .ty-note,
html[dir="rtl"] .ready-predict,
html[dir="rtl"] .ready-tagline,
html[dir="rtl"] .submit-hint {
  font-family: 'Snickers-Arabic', sans-serif !important;
}


html[dir="rtl"] .screen--register .main-title--guess { font-size: clamp(26px, 7vw, 50px) !important; }
html[dir="rtl"] .screen--register .main-title--sub   { font-size: clamp(30px, 9.5vw, 62px) !important; }

html[dir="rtl"] .screen--vote .main-title       { font-size: clamp(52px, 9vw, 80px) !important; line-height: 1.05 !important; margin-bottom: 38px !important; }
html[dir="rtl"] .screen--vote .main-title--guess { font-size: clamp(38px, 6vw, 56px) !important; }
html[dir="rtl"] .screen--ready .main-title       { font-size: clamp(52px, 9vw, 80px) !important; margin-top: 24px !important; }
html[dir="rtl"] .screen--ready .main-title--guess { font-size: clamp(38px, 6vw, 56px) !important; }
html[dir="rtl"] .screen--ready .ready-body        { gap: 20px; }
html[dir="rtl"] .screen--ready .ready-predict     { margin-top: 32px; }
html[dir="rtl"] .screen--ready .ready-tagline     { margin-top: 68px; }

html[dir="rtl"] .corner-tr.corner-tr--ty          { transform: translateX(14px); }
html[dir="rtl"] .screen--thankyou .ty-title        { margin-bottom: 32px; }
html[dir="rtl"] .screen--thankyou .ty-locked       { margin-top: 32px; margin-bottom: 32px; }
html[dir="rtl"] .screen--thankyou .ty-btn-wrap     { margin-top: 26px; margin-bottom: 26px; }
html[dir="rtl"] .screen--thankyou .ty-note         { margin-top: 26px; }

/* ── Disclaimer ─────────────────────────────────────────────── */
#disclaimer-btn {
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s, color 0.2s;
}
#disclaimer-btn:hover {
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}
#disclaimer-btn:hover {
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}

#disclaimer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#disclaimer-overlay.active {
  display: flex;
}
#disclaimer-box {
  background: #2a0e05;
  border: 1px solid rgba(227, 160, 32, 0.4);
  border-radius: 16px;
  padding: 28px 24px 24px;
  max-width: 480px;
  width: 100%;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
}
#disclaimer-title {
  font-family: 'Tungsten-Bold', sans-serif;
  font-size: 28px;
  color: var(--gold);
  margin-bottom: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
#disclaimer-text {
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
}
#disclaimer-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
#disclaimer-close:hover { color: #fff; }

/* Lift disclaimer above bottom button bar on vote page only */
.screen--vote ~ #disclaimer-btn { bottom: 72px; }