body {
   margin: 0;
   font-family: Arial, sans-serif;
   background: #1e1e1e;
   color: #f4f4f9;
   display: flex;
   justify-content: center;
   align-items: center;
   min-height: 100vh;
 }
 
 .container {
   display: flex;
   gap: 20px;
   width: 90%;
   max-width: 1400px;
   height: 80vh;
 }
 
 #app, #image-grid-section {
   flex: 1;
   background: #2a2a2a;
   padding: 20px;
   border-radius: 8px;
   box-shadow: 0 4px 6px rgba(0,0,0,0.5);
   box-sizing: border-box;
 }
 
 #app {
   display: flex;
   flex-direction: column;
   justify-content: flex-start;
   text-align: center;
 }
 
 h1, h2 {
   margin: 10px 0;
 }
 
 #toggle-inv-mode-btn {
   margin-bottom: 20px;
 }
 
 #gamble-timer-display,
 #dummy-timer-display,
 #next-reset-timer {
   margin-top: 10px;
   font-size: 1.2em;
   font-weight: bold;
 }
 
 button {
   width: 100%;
   padding: 10px;
   margin-top: 8px;
   font-size: 16px;
   border: none;
   border-radius: 4px;
   background-color: #0d6efd;
   color: #fff;
   cursor: pointer;
 }
 button:hover {
   background-color: #0b5ed7;
 }
 
 #clear-grid-btn {
   margin-top: 15px;
   background-color: #dc3545;
 }
 #clear-grid-btn:hover {
   background-color: #bb2d3b;
 }
 
 #image-grid {
   display: grid;
   grid-template-columns: repeat(7, 1fr);
   gap: 8px;
 }
 
 .grid-image {
   width: 100%;
   aspect-ratio: 1;
   object-fit: cover;
   border-radius: 4px;
   cursor: pointer;
   filter: grayscale(100%);
   transition: filter 0.3s;
 }
 .grid-image.clicked {
   filter: none !important;
 }
 
 #owen {
   color: red;
   margin-top: 20px;
 }
 
 /* Modals */
 .modal {
   position: fixed;
   top: 0; left: 0;
   width: 100vw; height: 100vh;
   background: rgba(0,0,0,0.7);
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 100;
 }
 .hidden {
   display: none !important;
 }
 
 .modal-content {
   position: relative;
   background: #2a2a2a;
   padding: 20px;
   border-radius: 8px;
   box-shadow: 0 4px 8px rgba(0,0,0,0.7);
 }
 .modal-content.small {
   width: 80vw;
   max-height: 80vh;
   overflow-y: auto;
 }
 .modal-content::before {
   content: "×";
   position: absolute;
   top: 8px; right: 12px;
   background: #2a2a2a;
   border: 1px solid #f4f4f9;
   color: #f4f4f9;
   width: 24px; height: 24px;
   line-height: 24px;
   text-align: center;
   border-radius: 4px;
   cursor: pointer;
 }
 .modal-content::before:hover {
   background: #444;
 }
 
 .modal-img {
   max-width: 95vw;
   max-height: 95vh;
   display: block;
   margin: 0 auto;
 }
 
 /* Real Inventory badges */
 #inventory-list {
   display: flex;
   flex-wrap: wrap;
   gap: 10px;
   justify-content: center;
 }
 .inv-item {
   position: relative;
 }
 .inv-item img {
   width: 50px;
   border-radius: 4px;
 }
 .inv-item .count-badge {
   position: absolute;
   bottom: 2px; right: 2px;
   background: #000; color: #fff;
   border-radius: 50%; padding: 2px 6px;
   font-size: 0.8em;
 }
 
 /* Game Inventory Mode Overlay */
 #inv-mode-overlay {
   position: fixed;
   top: 0; left: 0;
   width: 100vw; height: 100vh;
   background: rgba(0,0,0,0.9);
   display: none;
   z-index: 200;
   padding: 40px;
   box-sizing: border-box;
   overflow-y: auto;
   color: #f4f4f9;
   display: flex;
   flex-direction: column;
   align-items: center;
 }
 
 .inv-overlay-title {
   text-align: center;
   margin: 0;
   padding-top: 20px;
 }
 
 .inv-cap-label {
   display: block;
   text-align: center;
   margin: 10px 0 20px;
 }
 
 .close-overlay-btn {
   font-size: 1em;
   width: 20px;
   height: 20px;
   line-height: 18px;
   padding: 0;
   background: #2a2a2a;
   border: 1px solid #f4f4f9;
   color: #f4f4f9;
   border-radius: 4px;
   cursor: pointer;
   margin-bottom: 20px;
 }
 
 .inv-mode-grid {
   display: grid;
   grid-template-columns: repeat(7, 1fr);
   gap: 8px;
 }
 .inv-mode-item {
   position: relative;
   background: #2a2a2a;
   padding: 8px;
   border-radius: 4px;
   text-align: center;
 }
 .inv-mode-item.perm {
   border: 2px solid gold;
 }
 .inv-mode-item img {
   width: 100%;
   aspect-ratio: 1;
   object-fit: cover;
   border-radius: 4px;
 }
 .inv-mode-item .count-badge {
   position: absolute;
   bottom: 4px; right: 4px;
   background: #000; color: #fff;
   border-radius: 50%; padding: 2px 6px;
   font-size: 0.8em;
   cursor: pointer;
 }
 /* Mobile Styles - only affect screens smaller than 768px */
 @media (max-width: 768px) {
   .container {
     flex-direction: column;
     height: auto;
     gap: 16px;
   }
 
   #image-grid {
     grid-template-columns: repeat(4, 1fr);
   }
 
   .inv-mode-grid {
     grid-template-columns: repeat(4, 1fr);
   }
 
   .modal-content.small {
     width: 95vw;
     padding: 15px;
   }
 
   button {
     font-size: 14px;
     padding: 8px;
   }
 
   #gamble-timer-display,
   #dummy-timer-display,
   #next-reset-timer {
     font-size: 1em;
   }
 
   .inv-item img {
     width: 40px;
   }
 
   .inv-mode-item .count-badge,
   .inv-item .count-badge {
     font-size: 0.7em;
     padding: 2px 5px;
   }
 
   .close-overlay-btn {
     width: 18px;
     height: 18px;
     font-size: 0.9em;
   }
 }
 
 /* Mobile Styles - only affect screens smaller than 768px */
 @media (max-width: 768px) {
   .container {
     flex-direction: column;
     height: auto;
     gap: 16px;
   }
 
   #image-grid {
     grid-template-columns: repeat(4, 1fr);
   }
 
   .inv-mode-grid {
     grid-template-columns: repeat(4, 1fr);
   }
 
   .modal-content.small {
     width: 95vw;
     padding: 15px;
   }
 
   button {
     font-size: 14px;
     padding: 8px;
   }
 
   #gamble-timer-display,
   #dummy-timer-display,
   #next-reset-timer {
     font-size: 1em;
   }
 
   .inv-item img {
     width: 40px;
   }
 
   .inv-mode-item .count-badge,
   .inv-item .count-badge {
     font-size: 0.7em;
     padding: 2px 5px;
   }
 
   .close-overlay-btn {
     width: 18px;
     height: 18px;
     font-size: 0.9em;
   }
 }