 :root {
     --bg: #06060e;
     --surface: #12121f;
     --surface-light: #1a1a2e;
     --pink: #ff2d95;
     --pink-glow: #ff2d9540;
     --purple: #9d4edd;
     --purple-glow: #9d4edd40;
     --gold: #f0c060;
     --coral: #ff6b6b;
     --text: #e8e0f0;
     --text-dim: #8888a0;
     --radius: 16px;
 }

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

 body {
     background: var(--bg);
     color: var(--text);
     font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
     min-height: 100vh;
     overflow-x: hidden;
     display: flex;
     justify-content: center;
 }

 /* Animated background orbs */
 .bg-orbs {
     position: fixed;
     inset: 0;
     pointer-events: none;
     z-index: 0;
 }

 .orb {
     position: absolute;
     border-radius: 50%;
     filter: blur(80px);
     opacity: 0.15;
     animation: float 20s ease-in-out infinite;
 }

 .orb:nth-child(1) {
     width: 400px;
     height: 400px;
     background: var(--pink);
     top: -10%;
     left: -10%;
     animation-delay: 0s;
 }

 .orb:nth-child(2) {
     width: 350px;
     height: 350px;
     background: var(--purple);
     bottom: -10%;
     right: -10%;
     animation-delay: -7s;
 }

 .orb:nth-child(3) {
     width: 250px;
     height: 250px;
     background: var(--coral);
     top: 50%;
     left: 50%;
     animation-delay: -14s;
 }

 @keyframes float {

     0%,
     100% {
         transform: translate(0, 0) scale(1);
     }

     25% {
         transform: translate(60px, -40px) scale(1.1);
     }

     50% {
         transform: translate(-30px, -80px) scale(0.9);
     }

     75% {
         transform: translate(-50px, 30px) scale(1.05);
     }
 }

 .app {
     position: relative;
     z-index: 1;
     width: 100%;
     max-width: 500px;
     padding: 24px 16px 40px;
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 24px;
 }

 /* Header */
 header {
     text-align: center;
 }

 header h1 {
     font-family: 'ZCOOL QingKe HuangYou', cursive;
     font-size: clamp(28px, 6vw, 40px);
     background: linear-gradient(135deg, var(--pink), var(--purple), var(--coral));
     -webkit-background-clip: text;
     -webkit-text-fill-color: transparent;
     background-clip: text;
     filter: drop-shadow(0 0 20px var(--pink-glow));
     letter-spacing: 2px;
 }

 /* Wheel area */
 .wheel-wrapper {
     position: relative;
     width: min(80vw, 380px);
     height: min(80vw, 380px);
 }

 .wheel-wrapper canvas {
     width: 100%;
     height: 100%;
     border-radius: 50%;
     cursor: pointer;
 }

 .pointer {
     position: absolute;
     top: -4px;
     left: 50%;
     transform: translateX(-50%);
     width: 0;
     height: 0;
     border-left: 14px solid transparent;
     border-right: 14px solid transparent;
     border-top: 28px solid var(--gold);
     filter: drop-shadow(0 0 8px rgba(240, 192, 96, 0.6));
     z-index: 2;
 }

 .spin-btn {
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     width: 64px;
     height: 64px;
     border-radius: 50%;
     border: 3px solid var(--gold);
     background: radial-gradient(circle at 40% 35%, #1a1a2e, #0a0a15);
     color: var(--gold);
     font-size: 28px;
     cursor: pointer;
     z-index: 3;
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     box-shadow: 0 0 20px rgba(240, 192, 96, 0.3), inset 0 0 10px rgba(240, 192, 96, 0.1);
 }

 .spin-btn:hover {
     box-shadow: 0 0 35px rgba(240, 192, 96, 0.5), inset 0 0 15px rgba(240, 192, 96, 0.2);
     transform: translate(-50%, -50%) scale(1.08);
 }

 .spin-btn:active {
     transform: translate(-50%, -50%) scale(0.95);
 }

 .spin-btn.disabled {
     opacity: 0.5;
     pointer-events: none;
 }

 /* Options list */
 .options-section {
     width: 100%;
 }

 .options-section h3 {
     font-size: 15px;
     color: var(--text-dim);
     margin-bottom: 12px;
     text-align: center;
     letter-spacing: 1px;
 }

 .option-item {
     display: flex;
     align-items: center;
     gap: 10px;
     padding: 10px 14px;
     margin-bottom: 6px;
     background: var(--surface);
     border-radius: 10px;
     border: 1px solid transparent;
     transition: all 0.2s ease;
 }

 .option-item:hover {
     border-color: var(--purple-glow);
     background: var(--surface-light);
 }

 .option-num {
     flex-shrink: 0;
     width: 26px;
     height: 26px;
     border-radius: 50%;
     background: var(--purple-glow);
     color: var(--purple);
     font-size: 12px;
     font-weight: 700;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .option-text {
     flex: 1;
     font-size: 14px;
     overflow: hidden;
     text-overflow: ellipsis;
     white-space: nowrap;
 }

 .option-edit {
     flex-shrink: 0;
     width: 32px;
     height: 32px;
     border-radius: 8px;
     border: 1px solid #ffffff22;
     background: transparent;
     color: var(--text-dim);
     cursor: pointer;
     font-size: 16px;
     transition: all 0.2s ease;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .option-edit:hover {
     border-color: var(--pink);
     color: var(--pink);
     background: var(--pink-glow);
 }

 /* Language switch */
 .lang-switch {
     position: fixed;
     top: 16px;
     right: 16px;
     z-index: 50;
     display: flex;
     gap: 4px;
     background: var(--surface);
     border: 1px solid #ffffff22;
     border-radius: 22px;
     padding: 3px;
 }

 .lang-btn {
     padding: 5px 12px;
     border-radius: 18px;
     border: none;
     background: transparent;
     color: var(--text-dim);
     font-size: 12px;
     cursor: pointer;
     font-family: inherit;
     transition: all 0.2s ease;
     white-space: nowrap;
 }

 .lang-btn.active {
     background: var(--pink);
     color: #fff;
     font-weight: 700;
 }

 .lang-btn:not(.active):hover {
     color: var(--text);
 }

 /* Action buttons */
 .actions {
     display: flex;
     gap: 10px;
     flex-wrap: wrap;
     justify-content: center;
     width: 100%;
 }

 .btn {
     padding: 10px 22px;
     border-radius: 24px;
     border: 1px solid #ffffff22;
     background: var(--surface);
     color: var(--text);
     font-size: 14px;
     cursor: pointer;
     font-family: inherit;
     transition: all 0.2s ease;
     white-space: nowrap;
 }

 .btn:hover {
     border-color: var(--purple);
     background: var(--surface-light);
 }

 .btn.accent {
     border-color: var(--pink);
     background: var(--pink);
     color: #fff;
     font-weight: 700;
 }

 .btn.accent:hover {
     background: #ff4da6;
     box-shadow: 0 0 20px var(--pink-glow);
 }

 /* Modal */
 .modal-overlay {
     position: fixed;
     inset: 0;
     background: rgba(6, 6, 14, 0.85);
     backdrop-filter: blur(8px);
     z-index: 100;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 20px;
     animation: fadeIn 0.2s ease;
 }

 .modal {
     background: var(--surface);
     border: 1px solid #ffffff15;
     border-radius: var(--radius);
     padding: 24px;
     width: 100%;
     max-width: 460px;
     max-height: 80vh;
     overflow-y: auto;
     box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
 }

 .modal h3 {
     font-size: 18px;
     margin-bottom: 16px;
     text-align: center;
     background: linear-gradient(135deg, var(--pink), var(--purple));
     -webkit-background-clip: text;
     -webkit-text-fill-color: transparent;
     background-clip: text;
 }

 .modal-subtitle {
     font-size: 13px;
     color: var(--text-dim);
     margin-bottom: 12px;
     text-align: center;
 }

 .pool-grid {
     display: grid;
     grid-template-columns: 1fr 1fr;
     gap: 8px;
     margin-bottom: 20px;
 }

 .pool-item {
     padding: 10px 12px;
     background: var(--surface-light);
     border: 1px solid #ffffff0a;
     border-radius: 8px;
     font-size: 13px;
     cursor: pointer;
     transition: all 0.2s ease;
     text-align: center;
 }

 .pool-item:hover {
     border-color: var(--pink);
     background: #1f1f35;
 }

 .pool-item.selected {
     border-color: var(--pink);
     background: var(--pink-glow);
     color: var(--pink);
 }

 .custom-section {
     display: flex;
     gap: 8px;
     margin-bottom: 16px;
 }

 .custom-section input {
     flex: 1;
     padding: 10px 14px;
     border-radius: 20px;
     border: 1px solid #ffffff22;
     background: var(--surface-light);
     color: var(--text);
     font-size: 14px;
     font-family: inherit;
     outline: none;
     transition: border-color 0.2s;
 }

 .custom-section input:focus {
     border-color: var(--purple);
 }

 .custom-section input::placeholder {
     color: #555;
 }

 .modal-close {
     display: block;
     margin: 0 auto;
     padding: 8px 28px;
     border-radius: 20px;
     border: 1px solid #ffffff22;
     background: transparent;
     color: var(--text-dim);
     font-size: 14px;
     cursor: pointer;
     font-family: inherit;
     transition: all 0.2s;
 }

 .modal-close:hover {
     border-color: #ffffff44;
     color: var(--text);
 }

 /* Result overlay */
 .result-overlay {
     position: fixed;
     inset: 0;
     background: rgba(6, 6, 14, 0.9);
     backdrop-filter: blur(16px);
     z-index: 200;
     display: flex;
     align-items: center;
     justify-content: center;
     animation: fadeIn 0.3s ease;
 }

 .result-card {
     text-align: center;
     padding: 40px 30px;
     border-radius: var(--radius);
     background: var(--surface);
     border: 2px solid var(--gold);
     box-shadow: 0 0 60px rgba(240, 192, 96, 0.2), 0 20px 60px rgba(0, 0, 0, 0.5);
     animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
     position: relative;
     max-width: 360px;
     width: 90%;
 }

 .result-card .result-label {
     font-size: 16px;
     color: var(--text-dim);
     margin-bottom: 10px;
 }

 .result-card .result-text {
     font-family: 'ZCOOL QingKe HuangYou', cursive;
     font-size: 28px;
     background: linear-gradient(135deg, var(--pink), var(--coral), var(--gold));
     -webkit-background-clip: text;
     -webkit-text-fill-color: transparent;
     background-clip: text;
     margin-bottom: 24px;
     line-height: 1.4;
 }

 .result-close {
     padding: 10px 36px;
     border-radius: 24px;
     border: 1px solid var(--gold);
     background: transparent;
     color: var(--gold);
     font-size: 16px;
     cursor: pointer;
     font-family: inherit;
     transition: all 0.2s;
 }

 .result-close:hover {
     background: rgba(240, 192, 96, 0.1);
     box-shadow: 0 0 20px rgba(240, 192, 96, 0.2);
 }

 /* Confetti */
 .confetti-piece {
     position: fixed;
     z-index: 201;
     pointer-events: none;
     animation: confetti-fall 1.5s ease-out forwards;
 }

 @keyframes confetti-fall {
     0% {
         transform: translate(0, 0) rotate(0deg) scale(1);
         opacity: 1;
     }

     100% {
         transform: translate(var(--dx), var(--dy)) rotate(var(--dr)) scale(0);
         opacity: 0;
     }
 }

 @keyframes fadeIn {
     from {
         opacity: 0;
     }

     to {
         opacity: 1;
     }
 }

 @keyframes popIn {
     0% {
         transform: scale(0.5);
         opacity: 0;
     }

     100% {
         transform: scale(1);
         opacity: 1;
     }
 }

 /* Scrollbar */
 ::-webkit-scrollbar {
     width: 4px;
 }

 ::-webkit-scrollbar-track {
     background: transparent;
 }

 ::-webkit-scrollbar-thumb {
     background: #ffffff22;
     border-radius: 2px;
 }

 @media (max-width: 400px) {
     .app {
         padding: 16px 10px 30px;
         gap: 16px;
     }

     .pool-grid {
         grid-template-columns: 1fr;
     }

     .wheel-wrapper {
         width: min(85vw, 320px);
         height: min(85vw, 320px);
     }
 }