/* ============================================================
   wheel-letter.css — Styles cho Vòng Quay & Thư Gửi Mai Sau
   ============================================================ */

/* ══════════════════════════════════════
   WHEEL — Vòng quay
   ══════════════════════════════════════ */
.wheel-arena {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0 10px;
}

/* Decorative stars */
.wheel-star {
  position: absolute;
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  color: var(--moon);
  opacity: .4;
  animation: wheelStarFloat 4s ease-in-out infinite;
  pointer-events: none;
}
.wheel-star-1 { top: 8%;  left: 8%;  animation-delay: 0s; }
.wheel-star-2 { top: 15%; right: 10%; animation-delay: 1s; }
.wheel-star-3 { bottom: 12%; left: 12%; animation-delay: 2s; }
.wheel-star-4 { bottom: 8%; right: 8%; animation-delay: .5s; }
@keyframes wheelStarFloat {
  0%,100% { transform: translateY(0) scale(1);   opacity: .35; }
  50%     { transform: translateY(-8px) scale(1.2); opacity: .7; }
}

/* Wheel wrap */
.wheel-wrap {
  position: relative;
  width: clamp(240px, 60vw, 380px);
  height: clamp(240px, 60vw, 380px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Outer glow ring */
.wheel-outer-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(95,180,236,.25), rgba(184,127,255,.2),
    rgba(127,247,176,.18), rgba(255,110,180,.2),
    rgba(95,180,236,.25));
  filter: blur(8px);
  animation: wheelRingGlow 4s ease-in-out infinite;
  z-index: -1;
}
@keyframes wheelRingGlow {
  0%,100% { opacity: .6; transform: scale(1); }
  50%     { opacity: 1;  transform: scale(1.04); }
}

/* Wheel itself */
.wheel {
  width: 100%; height: 100%;
  border-radius: 50%;
  position: relative;
  box-shadow:
    0 0 0 4px rgba(95,180,236,.25),
    0 0 0 8px rgba(95,180,236,.1),
    0 20px 60px rgba(0,0,0,.6),
    0 0 80px rgba(95,180,236,.12);
  will-change: transform;
}

/* Wheel hub center */
.wheel-hub {
  position: absolute; z-index: 3;
  width: clamp(44px, 10vw, 60px);
  height: clamp(44px, 10vw, 60px);
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2c5a, #0c1830);
  border: 2px solid rgba(95,180,236,.5);
  display: grid; place-items: center;
  box-shadow: 0 0 20px rgba(95,180,236,.4), 0 4px 16px rgba(0,0,0,.6);
}
.wheel-hub-glyph { font-size: 1.4rem; }

/* Wheel pin (mũi tên) */
.wheel-pin {
  position: absolute;
  top: -16px; left: 50%; transform: translateX(-50%);
  z-index: 4;
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 22px solid rgba(95,180,236,.9);
  filter: drop-shadow(0 2px 6px rgba(95,180,236,.6));
}

/* Wheel labels */
.wheel-label {
  position: absolute;
  top: 50%; left: 50%;
  transform-origin: 0 0;
  font-size: clamp(.62rem, 1.4vw, .78rem);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: .02em;
}

/* Spin button */
.wheel-spin-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  padding: 14px 36px !important;
  font-family: 'Cinzel', serif;
  letter-spacing: .12em;
  font-size: 1rem !important;
}
.wheel-spin-btn .spin-icon {
  animation: spinIconRotate 3s linear infinite;
}
@keyframes spinIconRotate { to { transform: rotate(360deg); } }
.wheel-spin-btn:disabled .spin-icon { animation: none; }

/* Result panel */
.wheel-result-panel {
  margin-top: 28px;
  border-radius: 18px;
  padding: 0 !important;
  overflow: hidden;
}
.wheel-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  background: linear-gradient(90deg, rgba(95,180,236,.12), rgba(184,127,255,.08));
  border-bottom: 1px solid rgba(95,180,236,.15);
  font-family: 'Cinzel', serif;
  font-size: .85rem;
  letter-spacing: .12em;
  color: var(--moon);
}
.wheel-result-icon { font-size: 1.1rem; animation: iconPulse 2s ease-in-out infinite; }
#wheelBody { padding: 20px 24px; }

/* Nody speech bubble in result */
.wheel-nody-wrap {
  padding: 0 24px 24px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.wheel-nody-bubble {
  flex: 1;
  background: rgba(95,180,236,.06);
  border: 1px solid rgba(95,180,236,.15);
  border-radius: 12px 12px 12px 4px;
  padding: 12px 16px;
  font-style: italic;
  font-size: .9rem;
  color: var(--ink-mute);
  position: relative;
}
.wheel-nody-bubble::before {
  content: '"';
  position: absolute;
  top: -8px; left: 12px;
  font-size: 2rem;
  color: var(--moon);
  opacity: .4;
  font-family: Georgia, serif;
}

/* How it works grid */
.wheel-how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.wheel-how-item {
  padding: 20px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(95,180,236,.1);
  text-align: center;
}
.wheel-how-icon { font-size: 1.8rem; margin-bottom: 10px; }
.wheel-how-item h4 {
  font-size: .88rem; font-weight: 600;
  color: var(--ink); margin-bottom: 6px;
}
.wheel-how-item p { font-size: .8rem; color: var(--ink-mute); line-height: 1.5; }

/* ══════════════════════════════════════
   LETTER — Thư gửi mai sau
   ══════════════════════════════════════ */
.letter-compose-panel {
  border-radius: 20px !important;
  padding: 28px !important;
  position: relative;
  overflow: hidden;
}
.letter-compose-panel::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(95,180,236,.06), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.letter-compose-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(95,180,236,.1);
}
.letter-icon { font-size: 1.8rem; }

/* Paper effect */
.letter-paper {
  position: relative;
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(95,180,236,.12);
}
.letter-paper-lines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0px, transparent 29px,
    rgba(95,180,236,.06) 29px, rgba(95,180,236,.06) 30px
  );
  background-position: 0 14px;
  pointer-events: none;
}
.letter-textarea {
  position: relative;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  min-height: 220px;
  line-height: 30px;
  padding: 14px 16px !important;
  font-family: 'Lora', Georgia, serif;
  font-size: .95rem;
  color: var(--ink) !important;
  resize: vertical;
}
.letter-textarea:focus { box-shadow: none !important; outline: none !important; }

/* Date section */
.letter-date-section { margin-bottom: 16px; }
.letter-date-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.letter-quick-chips { margin-top: 10px; }

/* Nody hint */
.letter-nody-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(95,180,236,.05);
  border: 1px solid rgba(95,180,236,.1);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.letter-hint-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }

/* Send button */
.letter-send-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .95rem !important;
}

/* Mailbox header */
.letter-mailbox-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.letter-mailbox-sub {
  font-size: .78rem;
  color: var(--ink-mute);
  font-style: italic;
}

/* Letter items in list */
.log-item {
  border-radius: 14px !important;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.log-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 480px) {
  .wheel-wrap { width: clamp(200px, 85vw, 300px); height: clamp(200px, 85vw, 300px); }
  .wheel-how-grid { grid-template-columns: 1fr; }
  .letter-compose-panel { padding: 18px !important; }
  .wheel-result-header { padding: 12px 16px; }
  #wheelBody, .wheel-nody-wrap { padding-left: 16px; padding-right: 16px; }
}
