@font-face {
  font-family: "SVN-VAGRoundedNext";
  src: url("../assets/SVN-VAGRoundedNext-Regular.otf") format("opentype");
  font-weight: 400;
}

@font-face {
  font-family: "SVN-VAGRoundedNext";
  src: url("../assets/SVN-VAGRoundedNext-Bold.otf") format("opentype");
  font-weight: 700;
}

@font-face {
  font-family: "SVN-VAGRoundedNext";
  src: url("../assets/SVN-VAGRoundedNext-Heavy.otf") format("opentype");
  font-weight: 900;
}

:root {
  --red: #cf181f;
  --red-strong: #a91419;
  --red-soft: #fff0f1;
  --blue: #0a4f9f;
  --blue-deep: #07356e;
  --gold: #173ca5;
  --ink: #20202a;
  --muted: #656575;
  --line: #e7e7ee;
  --surface: #f4f5f8;
  --shadow: 0 18px 45px rgba(32, 32, 42, 0.12);
  --font: "SVN-VAGRoundedNext", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--surface);
}

body {
  margin: 0;
  font-family: var(--font);
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
  color: var(--ink);
  background: var(--surface);
  overflow-x: hidden;
  padding-bottom: 82px;
}

img,
video {
  display: block;
  max-width: 100%;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.ladi-page {
  width: min(430px, 100%);
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
}

.ladi-section {
  position: relative;
}

.organizer-credit {
  padding: 14px 18px;
  color: var(--red);
  background: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.organizer-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.anchor-target {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.ladi-image-section,
.ladi-video-section {
  line-height: 0;
}

.ladi-image-section > img,
.ladi-video-section > img {
  width: 100%;
  height: auto;
}

.section-hotspot {
  position: absolute;
  z-index: 4;
  display: block;
  border-radius: 999px;
}

.section-1-learn-more {
  left: 18.8%;
  top: 89%;
  width: 45%;
  height: 8%;
}

.ladi-video-section {
  --video-left: 6.48%;
  --video-top: 11.84%;
  --video-width: 87.03%;
  --video-height: 80.38%;
  isolation: isolate;
}

.ladi-video-section > img {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.short-video-slot {
  position: absolute;
  z-index: 2;
  left: var(--video-left);
  top: var(--video-top);
  width: var(--video-width);
  height: var(--video-height);
  overflow: hidden;
  border-radius: 18px;
  background: var(--red);
}

.short-video-slot video {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
  object-fit: cover;
}

.quiz-section {
  padding: 34px 12px 42px;
  background:
    linear-gradient(180deg, #fff 0%, #fff7f8 52%, #f7f7fb 100%);
}

.quiz-shell {
  width: 100%;
  margin: 0 auto;
}

.quiz-heading {
  width: 100%;
  margin: 0 0 18px;
  text-align: left;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0;
}

.quiz-heading h1 {
  margin: 0;
  color: var(--red);
  font-weight: 900;
  font-size: 26px;
  line-height: 1.1;
}

.quiz-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.referral-status {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #eef5ff;
  color: var(--blue-deep);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 12px;
}

.game-panel,
.prize-panel,
.side-leaderboard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.game-panel {
  min-height: 0;
  padding: 14px;
  overflow: hidden;
}

.minigame-side {
  display: grid;
  gap: 12px;
}

.game-intro {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  min-height: 0;
  text-align: center;
}

.game-intro h3,
.quiz-title,
.wheel-title,
.result-title {
  margin: 0;
  color: var(--red);
  font-weight: 900;
  font-size: 26px;
  line-height: 1.1;
}

.game-intro p,
.quiz-helper,
.wheel-copy,
.result-copy {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.game-intro img {
  order: -1;
  width: min(230px, 76%);
  max-height: 250px;
  margin: 0 auto;
  object-fit: contain;
}

.auth-card,
.backend-error,
.loading-state {
  display: grid;
  align-content: center;
  min-height: 0;
  padding: 14px;
  border: 2px solid var(--red-soft);
  border-radius: 8px;
  background: #fffafa;
}

.auth-card h3,
.backend-error h3,
.loading-state h3 {
  margin: 0;
  color: var(--red);
  font-size: 24px;
  line-height: 1.1;
}

.auth-card p:not(.eyebrow),
.backend-error p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.auth-status {
  margin: 14px 0;
  padding: 12px;
  border-radius: 8px;
  background: #eef5ff;
  color: var(--blue-deep);
  font-weight: 700;
  line-height: 1.45;
}

.auth-status.ok {
  background: #e9f8f1;
  color: #167348;
}

.auth-status.error {
  background: #ffe6e8;
  color: var(--red-strong);
}

.player-form,
.upgrade-card {
  gap: 12px;
}

.form-field {
  display: grid;
  gap: 7px;
  text-align: left;
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 900;
}

.form-field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 2px solid var(--red-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
}

.form-field input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 23, 36, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 13px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.68;
  box-shadow: none;
  transform: none;
}

.btn-red {
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 0 var(--red-strong);
}

.btn-blue {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 0 var(--blue-deep);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: none;
}

.quiz-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.quiz-count {
  color: var(--red);
  font-weight: 900;
  text-transform: uppercase;
}

.quiz-progress {
  display: flex;
  gap: 8px;
}

.quiz-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #d9dce6;
  border: 2px solid #d9dce6;
}

.quiz-dot.current {
  background: var(--red);
  border-color: var(--red);
}

.quiz-dot.correct {
  background: #20a362;
  border-color: #20a362;
}

.quiz-dot.wrong {
  background: #363b48;
  border-color: #363b48;
}

.quiz-dot.answered {
  background: var(--blue);
  border-color: var(--blue);
}

.quiz-card {
  padding: 14px;
  border: 2px solid var(--red-soft);
  border-radius: 8px;
  background: #fffafa;
}

.quiz-title {
  font-size: 21px;
}

.quiz-options {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
}

.quiz-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  min-height: 54px;
  padding: 12px;
  border: 2px solid #e4e5eb;
  border-radius: 8px;
  background: #fff;
  color: var(--red);
  text-align: left;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.35;
}

.quiz-option:hover:not(:disabled),
.quiz-option.selected {
  border-color: var(--red);
  background: var(--red-soft);
}

.quiz-option.correct {
  border-color: #20a362;
  background: #e9f8f1;
  color: #167348;
}

.quiz-option.wrong {
  border-color: var(--red);
  background: #ffe6e8;
  color: var(--red-strong);
}

.quiz-option:disabled {
  cursor: default;
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 14px;
}

.quiz-actions {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.feedback {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 900;
  line-height: 1.45;
}

.feedback.ok {
  color: #167348;
  background: #e9f8f1;
}

.feedback.bad {
  color: var(--red-strong);
  background: #ffe6e8;
}

.prize-panel {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  overflow: hidden;
  box-shadow: none;
}

.prize-panel img {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
}

.prize-panel h2 {
  margin: 0;
  color: var(--red);
  font-size: 22px;
}

.prize-panel p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.side-leaderboard {
  padding: 12px;
  overflow: hidden;
}

.side-leaderboard h2 {
  margin: 0;
  color: var(--red);
  font-size: 20px;
  line-height: 1.15;
}

.side-leaderboard .auth-status {
  margin-top: 12px;
}

.wheel-wrap {
  display: grid;
  gap: 20px;
  justify-items: center;
  text-align: center;
}

.wheel-stage {
  position: relative;
  width: min(330px, 96%);
  aspect-ratio: 1 / 1.12;
}

.wheel-frame,
.wheel-face {
  position: absolute;
  inset: 0;
}

.wheel-frame {
  z-index: 1;
  object-fit: contain;
  width: 100%;
  height: 100%;
}

.wheel-face {
  z-index: 2;
  top: 6.44%;
  left: 3.5%;
  width: 93%;
  height: auto;
  transform-origin: 50% 50%;
  transition: transform 5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-pointer {
  position: absolute;
  z-index: 3;
  top: 2.8%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 30px solid var(--red);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.32));
}

.result-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.result-layout img {
  max-height: 210px;
  margin: 0 auto;
  object-fit: contain;
}

.ref-message {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #eef5ff;
  color: var(--blue-deep);
  font-weight: 700;
}

.speed-intro {
  text-align: left;
}

.speed-intro-main {
  display: grid;
  gap: 12px;
}

.speed-intro h3 {
  font-size: 24px;
  overflow-wrap: anywhere;
}

.speed-subheadline {
  margin: 0;
  color: var(--blue-deep);
  font-weight: 700;
}

.speed-brief-list {
  display: grid;
  gap: 8px;
}

.speed-brief-item,
.speed-prize-callout {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
}

.speed-brief-item {
  background: #f7f9fd;
  color: var(--blue-deep);
}

.speed-brief-item span,
.speed-prize-callout span {
  font-size: 20px;
  line-height: 1.2;
}

.speed-brief-item p,
.speed-prize-callout p {
  margin: 0;
  color: inherit;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
}

.speed-prize-callout {
  border: 2px solid var(--red);
  background: #fff;
  color: var(--red);
}

.speed-intro .form-field {
  margin-top: 12px;
}

.speed-start-actions {
  margin-top: 2px;
}

.speed-question {
  display: grid;
  gap: 14px;
}

.quiz-topline,
.speed-scoreline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 900;
}

.speed-timer {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef8;
}

.speed-timer span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #0f5fae, #e31b23);
  transition: transform 0.1s linear;
}

.speed-feedback,
.speed-result {
  text-align: center;
}

.speed-facebook-prompt {
  margin: 6px 0 0;
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}

.speed-feedback h3,
.speed-result h3 {
  color: var(--red);
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  text-align: left;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e3e9f3;
  border-radius: 8px;
  background: #fff;
  color: var(--blue-deep);
  font-size: 13px;
}

.leaderboard-head {
  border-color: transparent;
  background: #f7f9fd;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-row.is-current {
  border-color: var(--red);
  background: #fff4f5;
}

.leaderboard-row .rank,
.leaderboard-row strong {
  font-weight: 900;
  color: var(--red);
}

.leaderboard-row .player {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row .phone {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 360px) {
  .quiz-heading h1 {
    font-size: 24px;
  }

  .quiz-title {
    font-size: 19px;
  }

  .speed-intro h3 {
    font-size: 22px;
  }

  .quiz-option {
    font-size: 13.5px;
  }

  .prize-panel {
    grid-template-columns: 82px minmax(0, 1fr);
  }
}

/* ── Fixed Bottom Bar ── */
.bottom-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  --bottom-bar-red: #cf181f;
  background: #fff;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, .14), 0 2px 8px rgba(0, 0, 0, .10);
}

.bottom-bar-inner {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: center;
  gap: 4px;
  width: min(430px, 100%);
  margin: 0 auto;
  min-height: 72px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}

.quick-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  padding: 6px 6px;
  border: 0;
  border-radius: 12px;
  color: var(--bottom-bar-red);
  background: transparent;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.quick-btn.primary {
  color: #fff;
  background: var(--bottom-bar-red);
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(201, 38, 34, .28);
}

.quick-icon {
  width: 24px;
  height: 24px;
  color: currentColor;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.quick-btn.primary .quick-icon {
  width: 26px;
  height: 26px;
}

.quick-icon-png {
  width: 28px;
  height: 28px;
  object-fit: contain;
  stroke: none;
  fill: none;
}

/* ── Popup cuộc thi IRON REVIEW ── */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: popupFadeIn 0.3s ease;
}
.popup-overlay[hidden] {
  display: none;
}
@keyframes popupFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.popup-container {
  position: relative;
  max-width: 420px;
  width: 100%;
  animation: popupSlideUp 0.35s ease;
}
@keyframes popupSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.popup-close {
  position: absolute;
  top: -18px;
  right: -10px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.popup-close:hover {
  background: rgba(0, 0, 0, 0.85);
}
.popup-link {
  display: block;
  text-decoration: none;
}
.popup-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.popup-cta {
  display: block;
  width: 100%;
  margin-top: 14px;
  text-align: center;
  font-size: 1.1rem;
  padding: 14px 20px;
  border-radius: 12px;
}
