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

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: #1a0a00;
  color: #fff;
  min-height: 100vh;
}

.landing {
  position: relative;
  width: 100%;
  height: 100vh;
  background-image: url('img/bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* ── Header ── */
header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: 20px 32px;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  height: 56px;
  width: auto;
  display: block;
}

.info-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.info-btn:hover { background: rgba(255, 255, 255, 0.28); }
.info-btn svg { width: 26px; height: 26px; }

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Language switcher */
.lang-wrap { position: relative; }

.lang-switcher {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  user-select: none;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s;
}

.lang-switcher:hover { background: rgba(0, 0, 0, 0.5); }

.fi {
  width: 24px !important;
  height: 18px !important;
  border-radius: 3px;
  background-size: cover;
  flex-shrink: 0;
}

.lang-code { letter-spacing: 0.03em; }

.lang-arrow {
  font-size: 11px;
  opacity: 0.8;
  margin-left: 2px;
  transition: transform 0.2s;
}

.lang-wrap.open .lang-arrow { transform: rotate(180deg); }

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 100%;
  background: rgba(20, 10, 0, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  overflow: hidden;
  z-index: 100;
}

.lang-wrap.open .lang-dropdown { display: block; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  transition: background 0.15s;
  white-space: nowrap;
}

.lang-option:hover  { background: rgba(255, 255, 255, 0.1); }
.lang-option.active { background: rgba(255, 255, 255, 0.07); }

/* Attempts counter */
.attempts-counter {
  display: flex;
  align-items: center;
  gap: 12px;
}

.attempts-label {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  line-height: 1.3;
  text-transform: uppercase;
  opacity: 0.9;
  letter-spacing: 0.03em;
}

.attempts-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e02020;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(224, 32, 32, 0.5);
}

/* ── Footer ── */
.footer {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  z-index: 10;
}

/* ── Modals ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.visible { display: flex; }

.modal {
  position: relative;
  background: #121212;
  border-radius: 20px;
  width: min(480px, 92vw);
  padding: 0 28px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  animation: modal-in 0.35s ease;
  overflow: hidden;
}

@keyframes modal-in {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover { background: rgba(255,255,255,0.22); }

.modal-img {
  width: calc(100% + 56px);
  margin-left: -28px;
  pointer-events: none;
  line-height: 0;
  background: #121212;
}

.modal-img img { width: 100%; height: auto; display: block; }

.modal-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-top: 20px;
  margin-bottom: 20px;
  text-transform: uppercase;
  line-height: 1.4;
}

.modal-prizes-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: -8px;
  margin-bottom: 20px;
}

.modal-prize-item { font-size: 20px; font-weight: 800; color: #fff; line-height: 1.4; }

.modal-password-wrap { position: relative; }
.modal-password-wrap .modal-input { padding-right: 48px; }

.modal-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  padding: 0;
  display: flex;
  align-items: center;
  font-size: 18px;
}

.modal-eye:hover { color: rgba(255,255,255,0.7); }

.modal-form { display: flex; flex-direction: column; gap: 10px; }
.modal-input-row { display: flex; gap: 10px; align-items: stretch; }
.modal-input-row .modal-input { flex: 1; width: auto; min-width: 0; }

.modal-input {
  width: 100%;
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 14px 16px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.modal-input::placeholder { color: rgba(255,255,255,0.4); }
.modal-input:focus { border-color: rgba(255,100,100,0.5); }

.modal-phone-flag {
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 56px;
  height: 52px;
  box-sizing: border-box;
}

.modal-submit {
  width: 100%;
  background: #e02020;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.modal-submit:hover { background: #c01818; }

.info-modal { width: min(420px, 92vw); padding: 32px 28px 28px; text-align: left; }

.info-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.info-modal-body { display: flex; flex-direction: column; gap: 10px; }
.info-modal-body p { font-size: 14px; color: rgba(255,255,255,0.8); line-height: 1.6; }
.info-modal-body strong { color: #e02020; font-size: 16px; }

/* hide broken images */
img { min-width: 0; min-height: 0; }
img:not([src]), img[src=""] { display: none; }

/* ── Wheel ── */
.wheel-area {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.wheel-body {
  position: relative;
  width: 52vh;
}

.wheel-sections-wrap {
  position: absolute;
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
  width: 82%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
}

.wheel-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.wheel-sections {
  position: absolute;
  top: -26%;
  left: -27%;
  width: 160%;
  height: 160%;
  object-fit: contain;
  will-change: transform;
  transform-origin: center center;
  z-index: 1;
}

.wheel-mask {
  position: absolute;
  top: -26%;
  left: -27%;
  width: 160%;
  height: 160%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
}

.wheel-frame {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 3;
  pointer-events: none;
}

.wheel-btn-pos {
  position: absolute;
  top: 42%;
  left: 53%;
  transform: translate(-50%, -50%);
  width: 22%;
  aspect-ratio: 1 / 1;
  z-index: 4;
}

.wheel-btn-pos.pulsing { animation: pulse-btn 1.2s ease-in-out infinite; }

.wheel-btn {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background-image: url('img/btn_wheel_center.png');
  background-size: 100% 200%;
  background-position: 0% 0%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.6));
  outline: none;
  border: none;
  user-select: none;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.wheel-btn:hover  { filter: drop-shadow(0 2px 10px rgba(0,0,0,0.6)) brightness(1.18); }
.wheel-btn:active { filter: drop-shadow(0 2px 10px rgba(0,0,0,0.6)) brightness(0.9); }


/* Result clouds */
.result-cloud {
  position: absolute;
  width: 26vh;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.6) translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.result-cloud.visible { opacity: 1; transform: scale(1) translateY(0); }
.result-cloud img.cloud-bg { width: 100%; height: auto; display: block; }

.result-cloud-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16% 8% 10%;
}

.result-cloud-text .prize-main { font-size: 3vh; font-weight: 900; color: #b01c1c; line-height: 1; }
.result-cloud-text .prize-sub  { font-size: 1.3vh; font-weight: 700; color: #4a2a1a; line-height: 1.3; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.05em; }

/* Hide chance sign from main.js */
#chanceWrap { display: none; }

@keyframes pulse-btn {
  0%   { transform: translate(-50%, -50%) scale(1); }
  50%  { transform: translate(-50%, -50%) scale(1.08); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* ── Wheel ── */
.wheel-area {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.wheel-body {
  position: relative;
  width: 52vh;
  aspect-ratio: 1 / 1;
}

.wheel-deco-wrap {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 0;
  pointer-events: none;
  animation: deco-pulse 2.5s ease-in-out infinite;
}

.wheel-deco {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@keyframes deco-pulse {
  0%   { opacity: 0.85; transform: scale(1); }
  50%  { opacity: 1;    transform: scale(1.06); }
  100% { opacity: 0.85; transform: scale(1); }
}

.wheel-spin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  will-change: transform;
  transform-origin: center center;
  z-index: 1;
}

.wheel-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
}

.spin-btn {
  position: absolute;
  bottom: 10vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: auto;
  background: #e02020;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.12em;
  border: none;
  border-radius: 10px;
  padding: 12px 100px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 20px rgba(224,32,32,0.45);
  text-transform: uppercase;
}

.spin-btn:hover    { background: #c01818; }
.spin-btn:active   { background: #a01010; transform: translateX(-50%) !important; }
.spin-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: translateX(-50%) !important; }

/* ── Result popup — same style as main modal ── */
.result-title  { font-size: 22px; font-weight: 800; color: #fff; margin-top: 20px; margin-bottom: 8px; text-align: center; text-transform: uppercase; line-height: 1.4; }
.result-prize  { font-size: 26px; font-weight: 900; color: #fff; text-align: center; margin-bottom: 20px; line-height: 1.2; }
.spin-again-btn { width: 100%; background: #e02020; color: #fff; font-size: 17px; font-weight: 600; border: none; border-radius: 10px; padding: 16px; cursor: pointer; transition: background 0.2s; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.spin-again-btn:hover { background: #c01818; }

.spin-again-btn:hover { background: #c01818; }

/* ── Bokeh overlay ── */
.bokeh-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.bokeh-overlay span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 70%);
  animation: bokeh-float linear infinite;
}

.bokeh-overlay span:nth-child(1) { width: 180px; height: 180px; left: 8%;  top: 10%; animation-duration: 12s; animation-delay: 0s;   opacity: 0.5; }
.bokeh-overlay span:nth-child(2) { width: 100px; height: 100px; left: 75%; top: 20%; animation-duration: 9s;  animation-delay: 1.5s; opacity: 0.4; }
.bokeh-overlay span:nth-child(3) { width: 220px; height: 220px; left: 50%; top: 60%; animation-duration: 14s; animation-delay: 3s;   opacity: 0.3; }
.bokeh-overlay span:nth-child(4) { width: 80px;  height: 80px;  left: 20%; top: 70%; animation-duration: 8s;  animation-delay: 0.5s; opacity: 0.5; }
.bokeh-overlay span:nth-child(5) { width: 140px; height: 140px; left: 85%; top: 55%; animation-duration: 11s; animation-delay: 2s;   opacity: 0.35; }
.bokeh-overlay span:nth-child(6) { width: 60px;  height: 60px;  left: 40%; top: 15%; animation-duration: 7s;  animation-delay: 4s;   opacity: 0.45; }
.bokeh-overlay span:nth-child(7) { width: 160px; height: 160px; left: 5%;  top: 45%; animation-duration: 13s; animation-delay: 1s;   opacity: 0.3; }
.bokeh-overlay span:nth-child(8) { width: 90px;  height: 90px;  left: 62%; top: 80%; animation-duration: 10s; animation-delay: 2.5s; opacity: 0.4; }

@keyframes bokeh-float {
  0%   { transform: translateY(0px) scale(1);    opacity: inherit; }
  33%  { transform: translateY(-20px) scale(1.1); }
  66%  { transform: translateY(10px) scale(0.95); }
  100% { transform: translateY(0px) scale(1);    opacity: inherit; }
}

/* ── People ── */
.person {
  position: absolute;
  bottom: 0;
  z-index: 3;
  pointer-events: none;
  height: 60vh;
  width: auto;
}

.person-left  { left: 8%; }
.person-right { right: 8%; }

/* ── Responsive ── */
@media (max-width: 1279px) {
  header { padding: 16px 24px; }
  .logo img { height: 48px; }
  .wheel-body { width: 46vh; }
}

@media (max-width: 768px) {
  .landing {
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  header {
    position: relative;
    padding: 12px 16px;
    order: 1;
    flex: 0 0 auto;
  }

  .logo img { height: 40px; }
  .info-btn { width: 28px; height: 28px; border-radius: 10px; }
  .info-btn svg { width: 18px; height: 18px; }
  .attempts-label { font-size: 11px; }
  .attempts-badge { width: 36px; height: 36px; font-size: 18px; }

  .wheel-area {
    position: relative;
    order: 2;
    flex: 1;
  }

  .wheel-body { width: 70vw; }

  .person { height: 38vh; }
  .person-left  { left: -30vw; }
  .person-right { right: -30vw; }

  .footer {
    position: relative;
    order: 3;
    padding: 6px 0 12px;
    font-size: 12px;
  }
}

.modal-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: rgba(255,255,255,0.35);
  font-size: 13px;
}
.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.15);
}
.modal-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #333;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.modal-google-btn:hover { background: #f5f5f5; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.modal-google-btn:disabled { opacity: 0.6; cursor: not-allowed; }
