:root {
  --primary-dark: #002c6b;
  --primary: #0047ab;
  --accent: #ff8000;
  --accent-light: #ffce99;
  --text-light: #ffffff;
  --text-dark: #0f172a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Outfit', sans-serif;
  color: var(--text-light);
  background-color: var(--primary-dark);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

.bg-wrapper {
  flex-grow: 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  position: relative;
  background-image: url('https://offertabs.s3.amazonaws.com/offer/sz28ba/site/media/6a1c64ea3dbbd7.48506697.png');
}

.content-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.top-domain {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  text-align: center;
}

.header-chip {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  color: #0047ab;
  padding: 8px 24px;
  border-radius: 99px;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bean-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 12px;
  box-shadow: 0 0 10px var(--accent);
}

h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--text-light);
  text-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 30px;
  line-height: 1.5;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  max-width: 90%;
}

.countdown-timer {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 35px;
  width: 100%;
}

.cd-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 15px;
  min-width: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.cd-box span {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-light);
  line-height: 1.1;
  font-family: 'Sora', sans-serif;
}

.cd-box small {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 1px;
  margin-top: 4px;
  font-weight: 600;
}

.ended {
  font-size: 1.25rem;
  font-weight: bold;
  color: #ffce99;
  padding: 15px 30px;
  background: rgba(0,0,0,0.5);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

.intro-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 24px;
  line-height: 1.5;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  max-width: 95%;
}

.prize-page-link {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent-light);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: all 0.2s;
}

.prize-page-link:hover {
  color: #ffffff;
  text-decoration-color: #ffffff;
}

.toast-prize-link {
  margin-top: 20px;
  margin-bottom: 0;
  font-size: 1.2rem;
}

.come-back-note {
  margin-top: 20px;
  margin-bottom: 5px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-light);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.wheel-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  margin-bottom: 30px;
  transition: all 0.3s ease;
}

@keyframes wheelAttention {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 10px 20px rgba(255,128,0,0.2)); }
  50% { transform: scale(1.02); filter: drop-shadow(0 20px 40px rgba(255,128,0,0.6)); }
}

.wheel-container.idle {
  animation: wheelAttention 3s infinite ease-in-out;
}

.wheel-pointer {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 50px;
  background: var(--text-light);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  z-index: 10;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

#wheel-canvas {
  width: 100%; height: 100%;
  border-radius: 50%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 0 8px rgba(255, 255, 255, 0.1);
  transition: transform 5s cubic-bezier(0.2, 0.8, 0.1, 1);
  transform: rotate(0deg);
}

.wheel-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90px; height: 90px;
  background: var(--text-dark);
  border-radius: 50%;
  z-index: 5;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5), inset 0 -4px 10px rgba(0,0,0,0.3);
  display: flex; justify-content: center; align-items: center;
  padding: 6px;
  border: 4px solid var(--accent);
}

.wheel-center-inner {
  width: 100%; height: 100%;
  background: radial-gradient(circle, var(--accent-light) 0%, var(--accent) 100%);
  border-radius: 50%;
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.5);
}

.spin-form {
  display: flex;
  width: 100%;
  max-width: 480px;
  gap: 12px;
  margin-bottom: 24px;
  align-items: flex-end;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: left;
  gap: 8px;
}

.spin-form label {
  color: #ffffff;
  font-weight: bold;
  font-size: 1.05rem;
  padding-left: 4px;
}

.spin-form input {
  width: 100%;
  padding: 18px 24px;
  font-size: 1.1rem;
  font-family: inherit;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-light);
  outline: none;
  transition: all 0.3s;
}

.spin-form input::placeholder { color: rgba(255, 255, 255, 0.6); }
.spin-form input:focus { border-color: var(--accent); background: rgba(0, 0, 0, 0.4); }

.spin-form button {
  padding: 18px 36px;
  font-size: 1.2rem;
  font-weight: 800;
  font-family: inherit;
  border: none;
  border-radius: 12px;
  background: #ff8000;
  color: var(--text-light);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 128, 0, 0.4);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.spin-form button::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.8), transparent);
  transform: rotate(45deg) translate(-100%, -100%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: rotate(45deg) translate(-100%, -100%); }
  20% { transform: rotate(45deg) translate(100%, 100%); }
  100% { transform: rotate(45deg) translate(100%, 100%); }
}

.spin-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 128, 0, 0.6);
}

.spin-form button:disabled {
  opacity: 0.7; cursor: not-allowed; transform: none;
}

.footer-text {
  font-size: 0.95rem;
  color: #ffffff;
  font-weight: bold;
}

/* Toast */
.toast {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex; justify-content: center; align-items: center;
  padding: 20px;
  animation: fadeIn 0.3s forwards;
}

.toast-content {
  position: relative;
  background: #0047ab;
  color: var(--text-light);
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  max-width: 400px; width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  transform: scale(0.9);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #ffffff;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { to { transform: scale(1); } }

.toast h2 {
  font-family: 'Sora', sans-serif;
  font-size: 2.2rem; margin-bottom: 12px; color: #ffffff;
}

#toast-prize { margin-bottom: 24px; }

.landed-on-text {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  display: block;
}

#win-slicename {
  font-weight: 600;
}

.theme-text {
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.9;
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.8);
}

.you-won-text {
  display: block;
  margin-top: 16px;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
}

.prize-text {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-light);
  margin-top: 4px;
}

.inspiration-text {
  display: block;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  font-style: italic;
  margin-top: 16px;
  line-height: 1.4;
  opacity: 0.9;
}

.qr-box { margin-bottom: 20px; }
.qr-box img { width: 150px; height: 150px; margin: 0 auto 10px; display: block; border-radius: 8px; }
.qr-box p { font-size: 0.9rem; color: rgba(255, 255, 255, 0.8); }

.error-msg {
  color: #fca5a5; margin-top: 12px; font-size: 0.95rem; font-weight: 600;
  text-align: center; width: 100%;
}

/* Sharing buttons */
.share-panel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.share-panel p {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
}
.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.share-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.fb-btn { background: #1877F2; }
.tw-btn { background: #000000; border: 1px solid rgba(255,255,255,0.2); }
.copy-btn { background: rgba(255,255,255,0.2); color: white; }
.share-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }

#wbx-powered-by-slot {
  margin-top: 40px; width: 100%; display: flex; justify-content: center;
}

@media (max-width: 600px) {
  .countdown-timer { gap: 8px; }
  .cd-box { min-width: 65px; padding: 10px 12px; }
  .cd-box span { font-size: 1.5rem; }
  .cd-box small { font-size: 0.65rem; }
  .spin-form { flex-direction: column; align-items: stretch; }
  .spin-form button { width: 100%; }
  h1 { font-size: 2.5rem; }
  .share-buttons { flex-direction: column; }
}