@font-face {
  font-family: "Rounded Elegance";
  src: url("font/Rounded_Elegance (2).ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #ecf3fb;
  --accent: #0b4f9c;
  --accent-dark: #083a73;
  --accent-light: #2a79d7;
  --gold: #f2c94c;
  --cream: #f7fbff;
  --ink: #0b1c2e;
  --shadow: rgba(6, 29, 54, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: var(--cream);
  background-image: radial-gradient(rgba(11, 79, 156, 0.16) 1px, transparent 1px),
    radial-gradient(circle at top, #ffffff, var(--bg));
  background-size: 22px 22px, 100% 100%;
  background-position: 0 0, center;
  background-repeat: repeat, no-repeat;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px 48px;
}

.app {
  width: min(960px, 100%);
  display: grid;
  gap: 28px;
  justify-items: center;
}

.header {
  text-align: center;
}

.header h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 52px);
  letter-spacing: 0.05em;
}

.title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.title-text {
  text-transform: uppercase;
  font-size: 1.1em;
  letter-spacing: 0.1em;
}

.title-logo {
  height: clamp(34px, 7vw, 70px);
  width: auto;
  object-fit: contain;
}

.title-brand {
  font-family: "Rounded Elegance", "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  font-size: clamp(28px, 6vw, 52px);
  letter-spacing: 0.04em;
  text-transform: none;
}

.sub {
  margin: 6px 0 0;
  opacity: 0.7;
}

.wheel-section {
  display: grid;
  gap: 20px;
  justify-items: center;
  margin-top: 12px;
}

.wheel-wrap {
  position: relative;
  width: min(92vw, 460px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  width: 36px;
  height: 36px;
  background: #e01b2f;
  border-radius: 50% 50% 50% 0;
  transform: translateX(-50%) rotate(-45deg);
  box-shadow: 0 6px 10px var(--shadow);
  z-index: 5;
}

.pointer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  background: var(--gold);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 12px solid var(--accent-dark);
  box-shadow: 0 18px 30px var(--shadow);
  position: relative;
  transition: transform 4.5s cubic-bezier(0.2, 0.9, 0.2, 1);
  overflow: hidden;
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 6px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

.wheel::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 6px solid rgba(10, 60, 120, 0.7);
  border-radius: 50%;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.4);
}

.slice {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.slice-dot {
  position: absolute;
  width: clamp(6px, 1.6vw, 10px);
  height: clamp(6px, 1.6vw, 10px);
  background: #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.slice-dot.active {
  background: var(--gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(255, 255, 255, 0.65);
  transform: translate(-50%, -50%) scale(1.2);
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}

.confetti-piece {
  position: absolute;
  top: -10vh;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.9;
  animation: confetti-fall var(--duration, 3s) linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translate3d(var(--drift, 0vw), 110vh, 0) rotate(720deg);
    opacity: 0.2;
  }
}

.slice-content {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
  width: 34%;
  max-width: 170px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  z-index: 3;
}

.slice-content span {
  width: 80%;
  font-size: clamp(11px, 3vw, 16px);
  line-height: 1.1;
  display: block;
  transform: rotate(var(--text-rot, 0deg));
  transform-origin: center;
  white-space: normal;
  word-break: break-word;
}

.slice-content.active span {
  background: rgba(255, 255, 255, 0.22);
  padding: 6px 8px;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.slice-content.large span {
  width: 90%;
  font-size: clamp(13px, 3.6vw, 20px);
  letter-spacing: 0.06em;
}

.slice-content.large.ten span {
  width: 88%;
  font-size: clamp(12px, 3.4vw, 19px);
}


.center-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  box-shadow: inset 0 0 0 6px var(--accent-dark), 0 10px 16px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  font-weight: 800;
  z-index: 4;
}

.center-logo {
  width: 84%;
  height: auto;
  object-fit: contain;
}

.center-badge span {
  font-size: clamp(12px, 2.8vw, 16px);
  letter-spacing: 0.1em;
}

.center-badge small {
  font-size: clamp(10px, 2.4vw, 12px);
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.controls {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(176, 15, 34, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 20px rgba(176, 15, 34, 0.4);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-muted {
  opacity: 0.6;
  box-shadow: none;
}

.btn-muted:hover {
  transform: none;
  box-shadow: none;
}

.result {
  margin: 0;
  font-weight: 800;
  text-align: center;
  font-size: clamp(16px, 4.6vw, 24px);
  letter-spacing: 0.06em;
  line-height: 1.2;
  width: min(92vw, 460px);
  padding: 12px 18px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, #ff2a4b, #a80e21);
  border: 3px solid var(--gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --result-shadow: 0 14px 22px rgba(0, 0, 0, 0.26), 0 0 0 6px rgba(242, 201, 76, 0.15), 0 0 28px rgba(242, 201, 76, 0.25);
  --result-shadow-strong: 0 20px 32px rgba(0, 0, 0, 0.34), 0 0 0 8px rgba(242, 201, 76, 0.22), 0 0 44px rgba(242, 201, 76, 0.4);
  box-shadow: var(--result-shadow);
}

.result-pop {
  animation: result-pop 620ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.result-win {
  background: linear-gradient(90deg, rgba(242, 201, 76, 0.75), rgba(224, 27, 47, 0.98), rgba(242, 201, 76, 0.75));
  background-size: 200% 100%;
  background-position: 0% 50%;
  border-color: rgba(255, 244, 201, 0.95);
  --result-shadow: 0 16px 26px rgba(0, 0, 0, 0.28), 0 0 0 7px rgba(242, 201, 76, 0.22), 0 0 34px rgba(242, 201, 76, 0.45);
  --result-shadow-strong: 0 24px 38px rgba(0, 0, 0, 0.36), 0 0 0 9px rgba(242, 201, 76, 0.3), 0 0 56px rgba(242, 201, 76, 0.62);
}

.result-win.result-pop {
  animation: result-pop 620ms cubic-bezier(0.2, 0.9, 0.2, 1), result-shine 1100ms ease-in-out;
}

@keyframes result-pop {
  0% {
    transform: scale(1);
    box-shadow: var(--result-shadow);
  }
  45% {
    transform: scale(1.06);
    box-shadow: var(--result-shadow-strong);
  }
  100% {
    transform: scale(1);
    box-shadow: var(--result-shadow);
  }
}

@keyframes result-shine {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-pop,
  .result-win.result-pop {
    animation: none;
  }
}

@media (max-width: 600px) {
  .pointer {
    width: 30px;
    height: 30px;
    top: -14px;
  }

  .wheel {
    border-width: 10px;
  }

  .slice-content {
    width: 38%;
    gap: 4px;
  }
}
