/* ==================================================
   CHOICY WHEEL – FRONTEND UI (FINAL POLISHED VERSION)
================================================== */

.choicy-wheel {
  max-width: 100%;
  margin: 60px auto;
  text-align: center;
  padding: 30px 20px 35px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.08);
  font-family:
    -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  position: relative;
}

/* ---------- Pointer ---------- */

.choicy-pointer {
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 26px solid #0f172a;
  margin: 0 auto -8px;
  position: relative;
  z-index: 30;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}
.choicy-pointer {
  transform: rotate(180deg);
}

/* ---------- Canvas Wrapper ---------- */

.choicy-canvas-wrap {
  position: relative;
  display: inline-block;
}

/* ---------- Wheel ---------- */

.choicy-wheel canvas {
  display: block;
  margin: auto;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    inset 0 0 0 10px #ffffff,
    0 15px 35px rgba(0, 0, 0, 0.15);
}

/* ---------- Spin Button (CENTER) ---------- */

.choicy-spin {
  position: absolute;
  top: 50%;
  left: 50%;
  /* transform: translate(-50%, -50%); */
 width: 18%;
    height: 18%;
  border-radius: 50%;
  border: 4px solid #ffffff;
  background: radial-gradient(circle at top, #7c3aed, #2563eb);
  color: #ffffff;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.5px;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
  translate: -50% -50%;
}

.choicy-spin:hover {
  transform: scale(1.08);
}

.choicy-spin:active {
  transform: scale(0.95);
}

/* ---------- Result Box ---------- */

.choicy-result {
  display: none;
  margin-top: 22px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ecfeff, #f0f9ff);
  border: 2px dashed #22d3ee;
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  animation: choicyPop 0.4s ease;
}

.choicy-result strong {
  color: #2563eb;
}

/* ---------- Result Animation ---------- */

@keyframes choicyPop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 520px) {
  .choicy-wheel {
    margin: 30px auto;
    padding: 20px 12px 28px;
  }

  /* .choicy-spin {
        width: 80px;
        height: 80px;
        font-size: 16px;
    } */
  .choicy-spin {
    position: absolute;
    /* inset: 50%; */
     width: 22%;
        height: 22%;
        font-size: 16px;
    translate: -50% -50%;
  }
}

/* ---------- Dark Mode ---------- */

@media (prefers-color-scheme: dark) {
  .choicy-wheel {
    background: linear-gradient(180deg, #020617, #020617);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  }

  .choicy-wheel canvas {
    background: #020617;
    box-shadow:
      inset 0 0 0 10px #020617,
      0 15px 35px rgba(0, 0, 0, 0.5);
  }

  .choicy-pointer {
    border-bottom-color: #f8fafc;
  }

  .choicy-result {
    background: linear-gradient(135deg, #020617, #020617);
    border-color: #22d3ee;
    color: #f8fafc;
  }
}

/* .choicy-app {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 100%;
        margin: 10px;
} */

.choicy-left {
  /* position: relative; */
  width: 60%;

  display: flex;
}

.choicy-right {
  width: 30%;
  max-width: 320px;

  display: flex;
  flex-direction: column;
  min-height: 0;
}

.choicy-tabs {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.choicy-tabs button {
  padding: 6px 12px;
  border-radius: 10px;
  border: 0;
  font-weight: 500;
  background: #2563eb;
  cursor: pointer;
  color: #fff;
}

.choicy-tabs button.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.choicy-panel {
  display: none;
  height: 100%;
  overflow: hidden;
}

.choicy-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#choicy-entry-box {
  flex: 1;
  resize: none;
  overflow-y: auto;
}

.choicy-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.choicy-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 0;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}

.choicy-table {
  width: 100%;
  border-collapse: collapse;
}

.choicy-table th,
.choicy-table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.choicy-sound {
  margin-left: auto;
  font-size: 14px;
}

/* Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .slider {
  background: #2563eb;
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.choicy-app {
  display: flex;
  gap: 30px;
  align-items: stretch;
  /* 🔥 IMPORTANT */
  justify-content: center;
  max-width: 100%;
  margin: 10px;
}
@media(max-width:900px){

    .choicy-app{
        flex-direction: column;
    }

     .choicy-spin{
        width: 22%;
        height: 22%;
        font-size: 18px;
    }

    .choicy-right{
        width:100%;
        max-width:100%;
        display:block;   /* 🔥 important */
    }

    .choicy-panel.active{
        display:block;   /* remove flex behaviour */
    }

    #choicy-entry-box{
        height:auto;
        min-height:120px;
        width: 98%;
        max-height: clamp(150px, 35vh, 300px);
        overflow-y:auto;
    }
}

@media (max-width: 768px) {
  .choicy-tabs button {
    padding: 4px 8px;
    border-radius: 10px;
    border: 0;
    font-weight: 400;
    background: #2563eb;
    cursor: pointer;
    color: #fff;
  }
}

/* ===== Wheel Layout ===== */
.choicy-wheel-wrap {
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* IMPORTANT: stage must control height */
.choicy-wheel-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  /* 🔥 CRITICAL */
}

/* Center button */
/* .choicy-spin-btn {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  white-space: nowrap;
} */

/* Pointer */
.choicy-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(180deg); /* your required direction */
  z-index: 6;
}

/* Mobile */
@media (max-width: 768px) {
  .choicy-wheel-wrap {
    /* max-width: 360px; */
    width: 100%;
  }
 .choicy-spin{
        width: 22%;
        height: 22%;
        font-size: 10px;
    }
  /* .choicy-spin-btn {
    font-size: 13px;
    padding: 10px 14px;
  } */
  .choicy-left {
    order: 1;
    width: 90%;
    display: flex;
    /* max-width: 400px; */
  }
  .choicy-right {
    order: 2;
    width: 90%;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    /* max-width: 400px; */
  }
}

/* Canvas fills stage */
.choicy-wheel-canvas {
    /* margin: 10%; */
  width: 100%;
  height: 100%;
  display: block;
}

/* Prevent clipping */
.choicy-wheel-wrap,
.choicy-wheel-stage {
  overflow: visible;
  /* 🔥 CRITICAL */
}

/* ===== Winner Popup ===== */
.choicy-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  width: 100%;
  height: 100%;
}

.choicy-popup {
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  text-align: center;
  min-width: 260px;
  max-width: 90%;
	z-index: 9999;
  position: relative;
  animation: choicyPop 0.3s ease;
}

@keyframes choicyPop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.choicy-popup h3 {
  margin: 0 0 10px;
}

.choicy-popup-winner {
  font-size: 22px;
  font-weight: bold;
  color: #2563eb;
}

.choicy-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
	color:#b82105;
}
