 html,
 body {
     overflow-x: hidden;
     width: 100%;
     margin: 0;
     padding: 0;
     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
 }

 .generator-page {
     --brand-primary: #FF7A45;
     --brand-gradient: linear-gradient(135deg, #FFD966, #FF7A45);
     --brand-shadow: 0 4px 12px rgba(255, 122, 69, 0.4);
     --text-main: #333;
     --text-sub: #666;
     --bg-card: rgba(255, 255, 255, 0.95);
     --border-color: #eee;

     display: flex;
     flex-direction: column;
     min-height: auto;
     background: radial-gradient(circle at top, #E6F9FF, #FFFBE6);
     width: 100%;
 }

 .generator-layout {
     display: grid;
     grid-template-columns: 1fr 1fr;
     grid-template-rows: 500px;
     width: 100%;
     max-width: 1100px;
     margin: 0 auto;
     padding: 2rem;
     gap: 24px;
     flex: 1;
     align-items: stretch;
 }

 
 .stage-card {
     background: var(--bg-card);
     border-radius: 20px;
     padding: 2.5rem 2rem;
     box-shadow: 0 4px 20px rgba(255, 200, 100, 0.15);
     border: 1px solid rgba(255, 255, 255, 0.5);
     width: 100%;
     box-sizing: border-box;

     display: flex;
     flex-direction: column;
     justify-content: center;
     gap: 20px;
     height: 500px;
     position: relative;
 }

 .reels-container {
     display: flex;
     justify-content: center;
     align-items: center;
     gap: 10px;
     width: 100%;
     min-height: 120px;
 }

 .window-container {
     position: relative;
     flex: 1;
     max-width: 300px;
     height: 120px;
     background: #F4F6F8;
     border-radius: 20px;
     box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
     border: none;
     overflow: hidden;
     display: flex;
     align-items: center;
     justify-content: center;
     min-width: 60px;
 }

 .reels-container.multiple .window-container {
     max-width: 120px;
     border-radius: 16px;
 }

 .reset-icon-btn {
     position: absolute;
     top: 10px;
     right: 10px;
     width: 32px;
     height: 32px;
     background: rgba(255, 255, 255, 0.8);
     border-radius: 50%;
     border: 1px solid #ddd;
     display: none;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     z-index: 20;
     color: #666;
     font-size: 1rem;
     box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
 }

 .reset-icon-btn:active {
     background: #f5f5f5;
 }

 .window-overlay {
     position: absolute;
     inset: 0;
     background: linear-gradient(to bottom, rgba(0, 0, 0, 0.02) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.02) 100%);
     pointer-events: none;
     z-index: 10;
     border-radius: 20px;
 }

 .number-strip {
     display: flex;
     flex-direction: column;
     align-items: center;
     transition: transform 0.1s linear;
     will-change: transform;
 }

 .number-item {
     height: 120px;
     line-height: 120px;
     font-size: 4rem;
     font-weight: 900;
     color: var(--text-main);
     text-align: center;
     width: 100%;
     -webkit-font-smoothing: antialiased;
 }

 .reels-container.multiple .number-item {
     font-size: 2rem;
 }

 .reels-container.multiple.long-numbers .number-item {
     font-size: 1.5rem;
 }

 .action-buttons {
     width: 100%;
     max-width: 260px;
     display: flex;
     flex-direction: column;
     gap: 0.8rem;
     margin: 0 auto;
     flex-shrink: 0;
 }

 .btn-generate {
     width: 100%;
     padding: 1rem;
     background: var(--brand-gradient);
     color: white;
     border: none;
     border-radius: 16px;
     font-size: 1.2rem;
     font-weight: 800;
     cursor: pointer;
     box-shadow: var(--brand-shadow);
     transition: transform 0.1s;
     text-align: center;
 }

 .btn-generate:active {
     transform: scale(0.96);
 }

 .btn-generate:disabled {
     opacity: 0.5;
     cursor: not-allowed;
     transform: none;
 }

 .btn-reset {
     width: 100%;
     padding: 0.8rem;
     background: #fff;
     color: var(--text-sub);
     border: 2px solid var(--border-color);
     border-radius: 16px;
     font-weight: 700;
     cursor: pointer;
     transition: all 0.2s;
     text-align: center;
 }

 .btn-reset:hover {
     border-color: #ccc;
     color: var(--text-main);
 }

 
 .card-integrated {
     background: var(--bg-card);
     border-radius: 20px;
     padding: 1.5rem;
     box-shadow: 0 4px 20px rgba(255, 200, 100, 0.15);
     border: 1px solid rgba(255, 255, 255, 0.5);
     box-sizing: border-box;
     display: flex;
     flex-direction: column;
     height: 500px;
 }

 .settings-section {
     flex-shrink: 0;
 }

 .card-title {
     font-size: 0.9rem;
     font-weight: 800;
     color: #888;
     text-transform: uppercase;
     letter-spacing: 0.05em;
     margin-bottom: 1rem;
     display: flex;
     justify-content: space-between;
     align-items: center;
 }

 .sound-control {
     display: flex;
     align-items: center;
     gap: 4px;
     cursor: pointer;
     transition: all 0.2s;
     font-weight: 700;
     font-size: 0.85rem;
     user-select: none;
 }

 .sound-control.active {
     color: var(--brand-primary);
 }

 .sound-control.muted {
     color: #aaa;
 }

 .sound-control:hover {
     opacity: 0.8;
 }

 .preset-row {
     display: flex;
     flex-wrap: wrap;
     gap: 8px;
     margin-top: 12px;
     padding-top: 12px;
     border-top: 1px solid #f0f0f0;
     padding-bottom: 4px;
 }

 .preset-pill {
     padding: 5px 10px;
     background: #f8fafc;
     border: 1px solid var(--border-color);
     border-radius: 20px;
     font-size: 0.75rem;
     font-weight: 700;
     color: #555;
     cursor: pointer;
     transition: all 0.2s;
     display: inline-flex;
     align-items: center;
     gap: 4px;
 }

 .preset-pill:hover {
     border-color: #FFD966;
     color: var(--brand-primary);
     background: #fff;
 }

 .preset-pill.active {
     background: #fff;
     color: var(--brand-primary);
     border-color: var(--brand-primary);
     box-shadow: 0 2px 6px rgba(255, 122, 69, 0.15);
     font-weight: 800;
 }

 .settings-row {
     display: flex;
     gap: 1rem;
 }

 .input-group {
     flex: 1;
     display: flex;
     flex-direction: column;
     gap: 0.3rem;
 }

 .input-label {
     font-size: 0.75rem;
     font-weight: 700;
     color: #888;
     text-transform: uppercase;
 }

 .input-field {
     padding: 0.6rem;
     border: 2px solid var(--border-color);
     border-radius: 10px;
     font-size: 1.1rem;
     font-weight: 700;
     text-align: center;
     outline: none;
     transition: border-color 0.2s;
     width: 100%;
     box-sizing: border-box;
 }

 .input-field:focus {
     border-color: var(--brand-primary);
 }

 .control-row {
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 0.5rem 0;
     margin-top: 1rem;
     gap: 10px;
 }

 .smart-pill {
     background: transparent;
     border: 1px solid var(--brand-primary);
     color: var(--brand-primary);
     padding: 4px 10px;
     border-radius: 20px;
     font-size: 0.8rem;
     font-weight: 700;
     cursor: pointer;
     transition: all 0.2s;
     white-space: nowrap;
     text-align: center;
 }

 .smart-pill:hover {
     background: #FFF5EB;
     text-decoration: underline;
 }

 .stepper-col {
     display: flex;
     align-items: center;
     gap: 8px;
 }

 .stepper-label {
     font-weight: 600;
     color: var(--text-main);
     font-size: 0.9rem;
 }

 .stepper-control {
     display: flex;
     align-items: center;
     background: #f8fafc;
     border: 1px solid var(--border-color);
     border-radius: 12px;
     overflow: hidden;
 }

 .stepper-btn {
     width: 28px;
     height: 28px;
     border: none;
     background: transparent;
     font-size: 1.1rem;
     font-weight: bold;
     color: var(--brand-primary);
     cursor: pointer;
     transition: background 0.2s;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .stepper-btn:hover {
     background: #f0f0f0;
 }

 .stepper-btn:active {
     background: #e8e8e8;
 }

 .stepper-btn:disabled {
     color: #ccc;
     cursor: not-allowed;
 }

 .stepper-value {
     width: 30px;
     text-align: center;
     font-weight: 800;
     font-size: 1rem;
     color: var(--text-main);
     background: transparent;
 }

 .divider {
     height: 1px;
     background: #f0f0f0;
     margin: 1.5rem 0;
     flex-shrink: 0;
 }

 .history-section {
     display: flex;
     flex-direction: column;
     flex: 1;
     min-height: 0;
 }

 .history-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 0.5rem;
     flex-shrink: 0;
 }

 .history-list {
     flex: 1;
     overflow-y: auto;
     display: flex;
     flex-direction: column;
     gap: 0.5rem;
     padding-right: 5px;
     scrollbar-width: thin;
     scrollbar-color: #ddd transparent;
 }

 .history-list::-webkit-scrollbar {
     width: 4px;
 }

 .history-list::-webkit-scrollbar-track {
     background: transparent;
 }

 .history-list::-webkit-scrollbar-thumb {
     background-color: #ddd;
     border-radius: 2px;
 }

 .history-item {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 0.4rem 0;
     font-size: 0.9rem;
     color: #555;
     border-bottom: 1px solid #f0f0f0;
 }

 .history-item:last-child {
     border-bottom: none;
 }

 .history-val {
     font-weight: 700;
     color: var(--text-main);
 }

 .history-time {
     font-size: 0.75rem;
     color: #999;
 }

 #confetti-canvas {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     pointer-events: none;
     z-index: 9999;
 }

 
 @media (max-width: 768px) {
     .generator-layout {
         display: flex;
         flex-direction: column;
         padding: 0;
         gap: 0;
         align-items: stretch;
         grid-template-rows: auto;
     }

     .stage-card {
         height: auto;
         padding: 1.5rem;
         background: transparent;
         border: none;
         box-shadow: none;
         justify-content: flex-start;
         gap: 1.5rem;
         margin-bottom: 0;
     }

     .reels-container {
         min-height: 90px;
     }

     .window-container {
         height: 90px;
         min-width: 40px;
         background: #F4F6F8;
     }

     .number-item {
         height: 90px;
         line-height: 90px;
         font-size: 3rem;
     }

     .reels-container.multiple .window-container {
         max-width: 80px;
     }

     .reels-container.multiple .number-item {
         font-size: 1.5rem;
     }

     .reels-container.multiple.long-numbers .number-item {
         font-size: 14px;
     }

     .reset-icon-btn {
         display: flex;
     }

     .btn-reset {
         display: none;
     }

     .action-buttons {
         max-width: 100%;
     }

     .btn-generate {
         padding: 1.2rem;
         font-size: 1.2rem;
         border-radius: 12px;
     }

     .card-integrated {
         height: auto;
         margin: 0 20px;
         width: calc(100% - 40px);
         margin-bottom: 30px;
     }

     .preset-row {
         margin-bottom: 12px;
         padding-bottom: 0;
     }

     .control-row {
         justify-content: space-between;
         gap: 8px;
     }

     .smart-pill {
         font-size: 0.7rem;
         padding: 3px 8px;
     }

     .history-section {
         flex: none;
         max-height: none;
     }

     .history-list {
         overflow-y: visible;
         max-height: none;
     }

 
     .preset-row {
         flex-wrap: nowrap;
         overflow-x: auto;
    
         scrollbar-width: none;
   
         -ms-overflow-style: none;
      
     }

     .preset-row::-webkit-scrollbar {
     
         display: none;
     }

     .preset-pill {
         flex-shrink: 0;
     }
 }