 html,
 body {
   width: 100%;
   margin: 0;
   padding: 0;
 }


 .spin-wheel-page {
   --brand-primary: #FF7A45;
   --brand-gradient: linear-gradient(135deg, #FFD966, #FF7A45);
   --brand-shadow: 0 10px 25px -5px rgba(255, 122, 69, 0.3);
   --wheel-text: #333;
   --wheel-border: #eee;

   display: flex;
   flex-direction: column;
   min-height: 100vh;
   background: radial-gradient(circle at top, #E6F9FF, #FFFBE6);
   width: 100%;
 }

 .wheel-main-layout {
   display: flex;
   width: 100%;
   max-width: 1400px;
   margin: 0 auto;
   padding: 2rem;
   gap: 2rem;
   flex: 1;
   align-items: flex-start;
 }


 .wheel-area {
   flex: 1;
   display: flex;
   flex-direction: column;
   align-items: center;
   position: sticky;
   top: 100px;
   align-self: flex-start;
 }


 .wheel-controls {
   width: 420px;
   display: flex;
   flex-direction: column;
   gap: 1.5rem;
 }


 .wheel-frame {
   position: relative;
   width: 100%;
   max-width: 550px;


   background: #fff;
   border-radius: 50%;
   box-shadow: 0 10px 30px -5px rgba(255, 122, 69, 0.25);
   border: 8px solid #fff;


   aspect-ratio: 1 / 1;
 }


 #wheelCanvas {
   width: 100%;
   height: 100%;
   display: block;

   border-radius: 50%;
 }


 .wheel-pointer {
   position: absolute;
   top: -15px;
   left: 50%;
   transform: translateX(-50%);
   width: 0;
   height: 0;
   border-left: 25px solid transparent;
   border-right: 25px solid transparent;
   border-top: 50px solid var(--wheel-text);
   z-index: 10;
   filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.2));
 }


 #wheelCenter {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   width: 140px;
   height: 140px;
   background: white;
   border-radius: 50%;
   box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   z-index: 20;
   transition: all 0.2s;
   font-size: 32px;
   font-weight: 900;
   color: #E05220;
   user-select: none;
   border: 6px solid #E05220;
   text-transform: uppercase;
 }

 #wheelCenter:hover {
   transform: translate(-50%, -50%) scale(1.05);
 }

 #wheelCenter:active {
   transform: translate(-50%, -50%) scale(0.95);
 }

 #wheelCenter:disabled {
   opacity: 0.5;
   cursor: not-allowed;
   border-color: #ccc;
   color: #ccc;
 }


 .modal-overlay {
   position: fixed;
   inset: 0;
   background: rgba(0, 0, 0, 0.4);
   backdrop-filter: blur(8px);
   z-index: 2000;
   display: flex;
   align-items: center;
   justify-content: center;
   opacity: 0;
   visibility: hidden;
   transition: all 0.3s ease;
 }

 .modal-overlay.show {
   opacity: 1;
   visibility: visible;
 }

 .modal-card {
   background: rgba(255, 255, 255, 0.9);
   padding: 2.5rem 2rem;
   border-radius: 24px;
   width: 90%;
   max-width: 360px;
   text-align: center;
   box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
   border: 1px solid rgba(255, 255, 255, 0.6);
   transform: scale(0.8);
   transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
 }

 .modal-overlay.show .modal-card {
   transform: scale(1);
 }

 .modal-header {
   font-size: 1rem;
   color: #666;
   margin-bottom: 0.5rem;
   font-weight: 600;
 }

 .modal-result-text {
   font-size: 2.5rem;
   font-weight: 900;
   margin: 1rem 0 2rem;
   color: var(--brand-primary);
 }

 .modal-actions {
   display: flex;
   gap: 1rem;
   justify-content: center;
 }

 .wheel-btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 0.4rem;
   padding: 0.6rem 1.2rem;
   border-radius: 12px;
   font-weight: 700;
   font-size: 0.9rem;
   transition: all 0.2s;
   cursor: pointer;
   border: none;
   font-family: inherit;
 }

 .wheel-btn-primary {
   background: var(--brand-gradient);
   color: white;
   box-shadow: 0 4px 12px rgba(255, 122, 69, 0.4);
 }

 .wheel-btn-primary:hover {
   transform: translateY(-2px);
   box-shadow: 0 6px 16px rgba(255, 122, 69, 0.5);
 }

 .wheel-btn-primary:disabled {
   opacity: 0.5;
   transform: none;
   cursor: not-allowed;
   background: #ccc;
 }

 .wheel-btn-outline {
   background: transparent;
   border: 2px solid var(--wheel-border);
   color: var(--wheel-text);
 }

 .wheel-btn-outline:hover {
   background: #f1f5f9;
   border-color: #ddd;
 }

 .wheel-btn-sm {
   padding: 0.25rem 0.6rem;
   font-size: 0.75rem;
   border-radius: 8px;
 }

 .wheel-input {
   flex: 1;
   padding: 0.75rem 1rem;
   border: 2px solid #eee;
   border-radius: 12px;
   font-family: inherit;
   font-weight: 700;
   font-size: 0.9rem;
   outline: none;
   transition: border-color 0.2s;
   background: #fff;
 }

 .wheel-input:focus {
   border-color: var(--brand-primary);
 }

 .input-panel {
   background: rgba(255, 255, 255, 0.95);
   border-radius: 16px;
   padding: 1.25rem 1.5rem;
   box-shadow: 0 4px 15px rgba(255, 200, 100, 0.15);
   border: 1px solid rgba(255, 255, 255, 0.5);
 }

 .preset-grid {
   display: flex;
   gap: 0.5rem;
   margin-top: 1rem;
 }


 .preset-btn {
   flex: 1;
   padding: 0.6rem;
   border: 1.5px solid #E2E8F0;
   background: #FFFFFF;
   border-radius: 12px;
   font-size: 0.85rem;
   font-weight: 600;
   cursor: pointer;
   transition: all 0.2s ease;
   font-family: inherit;
   color: #475569;
 }

 .preset-btn:hover {
   border-color: #FF7A45;
   color: #C2410C;
 }


 .preset-btn.active {
   background: #FFF7ED;
   color: #C2410C;
   border: 2px solid #EA580C;
   font-weight: 700;
 }

 .wheel-console {
   background: rgba(255, 255, 255, 0.95);
   border-radius: 16px;
   box-shadow: 0 4px 15px rgba(255, 200, 100, 0.15);
   border: 1px solid rgba(255, 255, 255, 0.5);
   overflow: hidden;
   display: flex;
   flex-direction: column;
   max-height: 500px;
 }

 .console-tabs {
   display: flex;
   background: #f8fafc;
   border-bottom: 1px solid #eee;
   padding: 12px 8px 0;
 }

 .tab-btn {
   flex: 1;
   padding: 0.8rem 0.5rem;
   background: transparent;
   border: none;
   font-family: inherit;
   font-weight: 800;
   font-size: 0.9rem;
   color: #595959;
   cursor: pointer;
   transition: all 0.2s;
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 0.3rem;
   position: relative;
   border-radius: 8px 8px 0 0;
 }

 .tab-btn:hover {
   color: #C2410C;
   background: rgba(255, 122, 69, 0.05);
 }

 .tab-btn.active {
   color: #C2410C;
   background: #fff;
   box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.02);

 }

 .tab-btn.active::after {
   content: '';
   position: absolute;
   bottom: 0;
   left: 50%;
   transform: translateX(-50%);
   width: 50px;
   height: 3px;
   background: #C2410C;
   border-radius: 3px;
 }

 .tab-count {
   font-size: 0.75rem;
   color: #555;
   font-weight: 600;
 }

 .tab-btn.active .tab-count {
   color: #C2410C;

 }

 .console-body {
   flex: 1;
   overflow-y: auto;
   padding: 0 1.5rem 1.5rem;
   min-height: 200px;
   scrollbar-width: thin;
   scrollbar-color: #E0E0E0 transparent;
 }

 .console-body::-webkit-scrollbar {
   width: 6px;
 }

 .console-body::-webkit-scrollbar-track {
   background: transparent;
 }

 .console-body::-webkit-scrollbar-thumb {
   background: #E0E0E0;
   border-radius: 10px;
 }

 .console-panel {
   display: none;
   padding-top: 1.5rem;
 }

 .console-panel.active {
   display: block;
 }

 .option-item {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.6rem 0.75rem 0.6rem 0.6rem;
   margin-bottom: 0.6rem;
   background: #f8fafc;
   border-radius: 10px;
   cursor: grab;
   transition: all 0.2s;
   border: 1px solid transparent;
 }

 .option-item:active {
   cursor: grabbing;
 }

 .option-item.highlight {
   background: #FFFBE6;
   border-color: #FFD966;
   color: var(--brand-primary);
 }

 .option-color {
   width: 12px;
   height: 12px;
   border-radius: 50%;
   flex-shrink: 0;
 }

 .option-text {
   flex: 1;
   font-size: 0.9rem;
   font-weight: 700;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
 }

 .option-input {
   flex: 1;
   border: none;
   background: transparent;
   font-size: 0.9rem;
   outline: none;
   font-family: inherit;
 }

 .action-btn {
   width: 26px;
   height: 26px;
   display: flex;
   align-items: center;
   justify-content: center;
   border-radius: 8px;
   border: none;
   background: transparent;
   cursor: pointer;
   color: #999;
   transition: all 0.2s;
   flex-shrink: 0;
 }

 .action-btn:hover {
   background: #eee;
   color: var(--wheel-text);
 }

 .action-btn.delete-btn:hover {
   background: #fee2e2;
   color: #dc2626;
 }

 .history-item {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   padding: 0.25rem 0;
   font-size: 0.875rem;
   cursor: pointer;
   color: #555;
 }

 .history-item:hover {
   text-decoration: underline;
   color: var(--brand-primary);
 }

 .history-dot {
   width: 8px;
   height: 8px;
   border-radius: 50%;
   flex-shrink: 0;
 }

 .stats-bar {
   height: 12px;
   width: 100%;
   display: flex;
   border-radius: 6px;
   overflow: hidden;
   background: #f1f5f9;
   margin-bottom: 1rem;
 }

 #statsLabels {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 0.8rem;
   background: #f8fafc;
   padding: 1rem;
   border-radius: 8px;
 }

 .stats-item {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   font-size: 0.85rem;
   color: #555;
   font-weight: 700;
 }

 .stats-dot {
   width: 10px;
   height: 10px;
   border-radius: 3px;
   flex-shrink: 0;
 }

 #confettiCanvas {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   pointer-events: none;
   z-index: 3000;
 }

 .hidden {
   display: none !important;
 }

 .empty-hint {
   text-align: center;
   color: #aaa;
   padding: 2rem 0;
   font-size: 0.9rem;
 }

 .particle {
   position: fixed;
   pointer-events: none;
   z-index: 999;
   animation: particle-anim 1s ease-out forwards;
 }

 @keyframes particle-anim {
   0% {
     transform: translate(0, 0) scale(1);
     opacity: 1;
   }

   100% {
     transform: translate(var(--tx), var(--ty)) scale(0);
     opacity: 0;
   }
 }


 @media (max-width: 768px) {
   .wheel-main-layout {
     flex-direction: column;
     padding: 0;
     align-items: center;
     gap: 1.5rem;
     width: 100%;
   }


   .wheel-area {
     position: relative;
     top: 0;
     margin-top: 20px;
     width: 100%;
     justify-content: center;

     overflow: visible !important;
     margin-bottom: 24px !important;
     padding-bottom: 10px;

   }


   .wheel-frame {

     height: auto !important;
     width: 78vw !important;
     max-width: 310px !important;
     aspect-ratio: 1 / 1 !important;
     margin: 0 auto !important;
     transform: translateZ(0);
     will-change: transform;
     background: #fff;
     border-radius: 50%;
     border: none;
     box-sizing: border-box;
     box-shadow: 0 0 0 6px #fff, 0 10px 25px -5px rgba(255, 122, 69, 0.25);
   }


   #wheelCanvas {
     width: 100% !important;
     height: 100% !important;
     display: block !important;
     border: none !important;

     box-shadow: none !important;

   }

   #wheelCenter {
     width: 90px;
     height: 90px;
     font-size: 22px;
     opacity: 0;
     transition: opacity 0.4s ease;
     border: 4px solid #E05220;
   }

   #wheelCenter.show {
     opacity: 1;
   }

   #wheelCenter:hover {
     transform: translate(-50%, -50%) scale(1.05);
   }

   #wheelCenter:active {
     transform: translate(-50%, -50%) scale(0.95);
   }

   #wheelCenter:disabled {
     opacity: 0.5 !important;
     cursor: not-allowed;
     border-color: #ccc;
     color: #ccc;
   }


   .wheel-controls {
     width: 100%;
     padding: 0 16px 30px 16px;
     box-sizing: border-box;
     opacity: 0;
     transition: opacity 0.4s ease;
   }

   .wheel-controls.show {
     opacity: 1;
   }


   .input-panel {
     padding: 1rem;
     width: 100%;
     box-sizing: border-box;
   }

   .input-panel>div:first-child {
     flex-direction: column;
     gap: 0.75rem;
   }

   .wheel-input {
     width: 100%;
   }

   #addBtn {
     width: 100%;
   }


   .preset-grid {
     overflow-x: auto;
     white-space: nowrap;
     flex-wrap: nowrap;
     gap: 0.5rem;
     margin-top: 0.75rem;
     padding-bottom: 5px;
     -webkit-overflow-scrolling: touch;
   }

   .preset-grid::-webkit-scrollbar {
     display: none;
   }

   .preset-btn {
     flex: 0 0 auto;
     min-width: 90px;
     padding: 0.5rem 1rem;
   }

   .wheel-console {
     max-height: none;
     width: 100%;
     box-sizing: border-box;
   }

   /* Tabs   */
   .console-tabs {
     padding: 8px 4px 0;
     width: 100%;

   }

   .tab-btn {
     font-size: 0;
     padding: 12px 2px;
     color: transparent;
   }

   .tab-btn[data-tab="options"]::before {
     content: "Options";
     font-size: 14px;
     font-weight: 900;
     color: #555;
   }

   .tab-btn[data-tab="history"]::before {
     content: "History";
     font-size: 14px;
     font-weight: 900;
     color: #555;
   }

   .tab-btn[data-tab="stats"]::before {
     content: "Stats";
     font-size: 14px;
     font-weight: 900;
     color: #555;
   }

   .tab-btn.active::before {
     color: #C2410C;
   }

   .tab-count {
     font-size: 14px !important;
     margin-left: 2px;
     color: #555;
   }

   .tab-btn.active .tab-count {
     color: #C2410C;
   }

   .stats-bar {
     margin-bottom: 0.5rem;
   }

   #statsLabels {
     padding: 0.8rem;
     gap: 0.5rem;
   }

   .stats-item {
     font-size: 0.75rem;
   }
 }
