* {
  box-sizing: border-box;
}

:root {
  --bg: #070914;
  --card: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.12);
  --text: #f8fbff;
  --muted: #aab4d4;
  --gold: #ffd166;
  --cyan: #4cc9f0;
  --purple: #b517ff;
  --pink: #ff4ecd;
  --danger: #ff3864;
  --success: #54ffb7;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(181, 23, 255, 0.35), transparent 34%),
    radial-gradient(circle at bottom right, rgba(76, 201, 240, 0.25), transparent 35%),
    linear-gradient(135deg, #060713, #111529 55%, #070914);
}

.background-glow {
  position: fixed;
  inset: -30%;
  background:
    conic-gradient(from 0deg, transparent, rgba(255, 209, 102, 0.12), transparent, rgba(255, 78, 205, 0.14), transparent);
  animation: rotateGlow 18s linear infinite;
  pointer-events: none;
  filter: blur(20px);
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(320px, 620px);
  gap: 28px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 34px;
  padding-bottom: 190px;
}

.app.locked {
  pointer-events: none;
  filter: blur(5px);
  user-select: none;
}

.hero-card,
.game-card,
.roulette-card,
.video-box,
.announcement-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(145deg, rgba(255,255,255,0.13), rgba(255,255,255,0.05));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.18);
  backdrop-filter: blur(18px);
  border-radius: 28px;
}

.hero-card {
  padding: 32px;
}

.badge {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.14);
  color: var(--gold);
  border: 1px solid rgba(255, 209, 102, 0.32);
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

h1 {
  margin: 18px 0 8px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 0.95;
}

h2 {
  margin-top: 8px;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.small-note {
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 26px 0;
}

.stats div {
  padding: 16px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.stats span {
  display: block;
  font-size: 28px;
  font-weight: 800;
}

.stats small {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border: 0;
  color: #061018;
  background: linear-gradient(135deg, var(--gold), #fff2a8);
  padding: 13px 18px;
  font-weight: 800;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(255, 209, 102, 0.25);
  transition: transform 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(1) brightness(0.65);
  transform: none;
}

.hint {
  font-size: 14px;
  margin-bottom: 0;
}

.game-card {
  padding: 20px;
  overflow: visible;
}

.puzzle-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, minmax(110px, 1fr));
  gap: 10px;
  width: min(90vw, 590px);
  aspect-ratio: 16 / 9;
}

.tile {
  border-radius: 18px;
  background-image: var(--puzzle-image);
  background-size: 400% 200%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  box-shadow: inset 0 0 22px rgba(255,255,255,0.08), 0 14px 30px rgba(0,0,0,0.28);
  transition: transform 0.18s ease, outline 0.18s ease, box-shadow 0.18s ease;
}

.tile:hover {
  transform: translateY(-3px) scale(1.015);
}

.tile.selected {
  outline: 3px solid var(--gold);
  box-shadow: 0 0 34px rgba(255, 209, 102, 0.65);
}

.tile.correct-flash {
  animation: correctFlash 0.75s ease;
}

.announcement-overlay,
.roulette-panel,
.video-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 4, 12, 0.76);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}

.announcement-card {
  width: min(94vw, 560px);
  padding: 32px;
  text-align: center;
  animation: pop 0.3s ease both;
}

.hidden {
  display: none !important;
}

.roulette-card {
  width: min(94vw, 520px);
  padding: 28px;
  text-align: center;
}

.wheel-wrap {
  position: relative;
  width: min(75vw, 360px);
  aspect-ratio: 1;
  margin: 26px auto;
}

.pointer {
  position: absolute;
  left: 50%;
  top: -10px;
  z-index: 3;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid var(--gold);
  filter: drop-shadow(0 0 12px rgba(255, 209, 102, 0.85));
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 9px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 50px rgba(181, 23, 255, 0.38), inset 0 0 35px rgba(0,0,0,0.55);
  transition: transform 4.8s cubic-bezier(.12,.74,.13,1);
  position: relative;
  overflow: hidden;
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 18%;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #12162a, #070914);
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 0 20px rgba(255,255,255,0.08);
}

.wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 42px;
  height: 42px;
  margin-left: -21px;
  margin-top: -21px;
  display: grid;
  place-items: center;
  font-size: clamp(15px, 2.4vw, 22px);
  font-weight: 900;
  color: #061018;
  text-shadow: 0 1px 1px rgba(255,255,255,0.45);
  pointer-events: none;
}

.result {
  min-height: 32px;
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
}

.video-box {
  width: min(94vw, 820px);
  padding: 24px;
  text-align: center;
}

.video-box video {
  width: 100%;
  max-height: 70vh;
  border-radius: 20px;
  background: #000;
  box-shadow: 0 0 50px rgba(255, 78, 205, 0.35);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 20;
  transform: translateX(-50%);
  width: min(92vw, 520px);
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(8, 13, 28, 0.9);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text);
  text-align: center;
  box-shadow: 0 16px 38px rgba(0,0,0,0.35);
}

/* SOCIAL BUTTONS */
.social-wrapper {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* SAWERIA DAN INSTAGRAM DIBUAT SAMA UKURANNYA */
.saweria-link,
.instagram-link {
  position: relative;

  width: 230px;
  height: 52px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  border-radius: 999px;
  text-decoration: none;

  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.4px;
  line-height: 1;

  overflow: hidden;
  white-space: nowrap;

  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.saweria-link {
  background: linear-gradient(135deg, #ff7b00, #ffd000);
  color: #1b1200;
  box-shadow:
    0 0 20px rgba(255,183,3,0.55),
    0 10px 35px rgba(255,145,0,0.4);
  animation: floatSocial 2s ease-in-out infinite;
}

.instagram-link {
  color: #ffffff;
  background: linear-gradient(
    45deg,
    #feda75,
    #fa7e1e,
    #d62976,
    #962fbf,
    #4f5bd5
  );
  background-size: 300% 300%;
  box-shadow:
    0 0 22px rgba(214,41,118,0.5),
    0 12px 30px rgba(79,91,213,0.35);
  animation:
    igGradient 5s ease infinite,
    floatSocial 2.4s ease-in-out infinite;
}

.instagram-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.7),
    transparent
  );
  transition: 0.7s;
}

.instagram-link:hover::before {
  left: 120%;
}

.saweria-link:hover,
.instagram-link:hover {
  transform: scale(1.06);
}

.ig-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.ig-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* ANIMASI */
@keyframes rotateGlow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes correctFlash {
  0%, 100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.75) saturate(1.4);
    box-shadow: 0 0 36px rgba(84,255,183,0.7);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes floatSocial {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes igGradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* RESPONSIVE TABLET */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
    padding: 20px;
    padding-bottom: 190px;
  }

  .puzzle-board {
    grid-template-rows: repeat(2, minmax(80px, 1fr));
  }

  h1 {
    font-size: 42px;
  }
}

/* RESPONSIVE HP */
@media (max-width: 520px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .game-card,
  .roulette-card,
  .video-box,
  .announcement-card {
    border-radius: 22px;
  }

  .puzzle-board {
    gap: 7px;
  }

  .tile {
    border-radius: 12px;
  }

  .social-wrapper {
    bottom: 12px;
  }

  .saweria-link,
  .instagram-link {
    width: 205px;
    height: 46px;
    font-size: 13px;
  }

  .ig-icon,
  .ig-icon svg {
    width: 20px;
    height: 20px;
  }
}