:root {
  --blue: #1769f5;
  --blue-dark: #1552bf;
  --cyan: #19b9df;
  --ink: #132440;
  --muted: #65748f;
  --line: #d8e3f4;
  --page: #eef5ff;
  --card: #ffffff;
  --danger: #b42318;
  --gold: #ffd54f;
  --shadow: 0 18px 50px rgba(28, 75, 150, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgba(25, 185, 223, 0.18), transparent 26%),
    radial-gradient(circle at 85% 85%, rgba(255, 77, 109, 0.12), transparent 28%),
    linear-gradient(135deg, #f7fbff, #e8f2ff);
}

button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(230px, 270px) minmax(360px, 660px);
  gap: 24px;
  justify-content: center;
  align-items: stretch;
  padding: 18px;
}

.brand-card,
.game-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.brand-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
}

.brand-logo {
  width: min(180px, 100%);
  height: auto;
  object-fit: contain;
  border-radius: 16px;
}

.brand-card p {
  margin: 24px 0 0;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.game-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  overflow: hidden;
}

.details-panel { width: min(100%, 430px); }
.details-panel h1 { margin: 0 0 8px; font-size: clamp(2rem, 5vw, 3rem); }
.details-panel > p { color: var(--muted); margin: 0 0 28px; }
form { display: grid; gap: 10px; }
label { font-weight: 700; margin-top: 8px; }

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 15px;
  color: var(--ink);
  background: #fbfdff;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(23, 105, 245, 0.12);
}

.primary-button,
.secondary-button {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 15px 20px;
  font-weight: 800;
}

.primary-button {
  margin-top: 14px;
  color: #fff;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 10px 22px rgba(23, 105, 245, 0.22);
}

.secondary-button {
  margin-top: 14px;
  color: var(--ink);
  background: #edf2f8;
  border: 1px solid #d5deeb;
}

.primary-button:hover,
.secondary-button:hover { transform: translateY(-1px); }
.primary-button:disabled { opacity: 0.58; cursor: not-allowed; transform: none; }

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  text-decoration: underline;
  padding: 12px;
}

.wheel-panel { width: 100%; text-align: center; }

.wheel-wrap {
  position: relative;
  width: min(78vw, 430px);
  aspect-ratio: 1;
  margin: 0 auto 18px;
  border-radius: 50%;
}

.wheel-wrap::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(#ffd54f, #ff4d6d, #19b9df, #7c4dff, #4caf50, #ff9800, #ffd54f);
  filter: blur(10px);
  opacity: 0.28;
  z-index: 0;
}

#wheelCanvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform 5s cubic-bezier(0.12, 0.72, 0.15, 1);
  filter: drop-shadow(0 14px 22px rgba(16, 62, 130, 0.22));
}

.wheel-wrap.spinning #wheelCanvas {
  animation: wheelGlow 0.7s ease-in-out infinite alternate;
}

@keyframes wheelGlow {
  from { filter: drop-shadow(0 0 8px rgba(23, 105, 245, 0.65)); }
  to { filter: drop-shadow(0 0 24px rgba(255, 193, 7, 0.95)); }
}

.pointer {
  position: absolute;
  z-index: 5;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 45px solid #15233f;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.24));
}

.wheel-go {
  position: absolute;
  z-index: 4;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 7px solid #fff;
  background: linear-gradient(145deg, #1d7aff, #134fc2);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.25), inset 0 2px 5px rgba(255,255,255,.35);
}

.status-message {
  min-height: 24px;
  margin: 8px 0;
  color: var(--muted);
  font-weight: 700;
}
.status-message.error { color: var(--danger); }

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 22, 47, 0.62);
}

.modal-card {
  position: relative;
  width: min(100%, 620px);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #66738a;
  font-size: 32px;
  line-height: 1;
}
.modal-close:hover { background: #edf3fb; color: var(--blue); }

.video-card h2,
.video-card p { text-align: center; }
.ad-company { color: var(--muted); font-weight: 700; }

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
}
.video-container iframe,
.video-container video { width: 100%; height: 100%; border: 0; display: block; }
.video-status { margin-bottom: 0; color: var(--muted); }

.prize-card { text-align: center; padding-top: 30px; }
.celebration { font-size: 3rem; animation: pop 0.6s ease-out; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 80% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }

.eyebrow {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.prize-card h2 { margin: 6px 0; }
.prize-card h3 { margin: 12px 0 20px; font-size: 1.75rem; color: var(--blue-dark); }

.prize-details {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f5f9ff;
}
.prize-details div { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; align-items: center; padding: 7px 0; }
.prize-details dt { text-align: left; color: var(--muted); }
.prize-details dd { margin: 0; text-align: right; font-weight: 800; overflow-wrap: anywhere; }

.result-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 20px 0 4px; }
.result-links a { color: var(--blue); font-weight: 700; }

.prize-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; padding: 10px; }
  .brand-card { min-height: 155px; padding: 18px; }
  .brand-logo { width: 145px; }
  .brand-card p { margin-top: 10px; }
  .game-card { padding: 18px; }
}

@media (max-width: 480px) {
  .prize-actions { grid-template-columns: 1fr; gap: 0; }
}
