body{font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;background:linear-gradient(to bottom,#f7f3e9,#ffffff);text-align:center;padding:40px;margin:0;overflow-x:hidden;overflow-y:auto;position:relative;}
#settingsButton {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 10;
}
.settings-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}
#settingsButton.open {
    box-shadow: 0 0 10px 4px rgba(212, 163, 115, 0.7);
    border-radius: 50%;
}
#settingsMenu {
    display: none;
    position: fixed;
    top: 60px;
    right: 20px;
    background: #fff;
    border: 2px solid #d4a373;
    padding: 10px;
    padding-bottom: 4px;
    border-radius: 8px;
    z-index: 9999;
    width: 180px;
}
#settingsMenu button {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: bold;
    color: #5c4327;
    background: #efe1c3;
    border: 2px solid #d4a373;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
} 
h1{font-size:50px;margin-bottom:10px;color:#5c4327;}
.score-card{margin:30px auto 20px auto;background:white;border:2px solid #d4a373;border-radius:10px;padding:0;overflow:hidden;width:320px;height:320px;box-shadow:0 6px 15px rgba(0,0,0,0.25);text-align:center;position:relative;}
.score-card img{width:100%;height:100%;object-fit:cover;border-radius:10px; }
#scoreOverlay {
  position: fixed;
  width:320px;
  top: 10px;
  left: 50%;
  padding:6px 10px;
  transform: translateX(-50%);
  background: rgba(255, 250, 240, 0.95);
  border: 2px solid #d4a373;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: flex;
  flex-direction:column;
  z-index: 1000;
  font-weight: bold;
  color: #5c4327;
  font-size: 18px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
#scoreOverlay span {
    font-size: 16px;
}
#oatmealBowl {
    touch-action: none; /* allows full multi-touch handling */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
#oatmealCard{margin-top:220px;}
.score-card-tall{margin:30px auto 20px auto;background:#f7f3e9;border:2px solid #d4a373;border-radius:10px;padding:0;overflow:hidden;width:320px;box-shadow:0 6px 15px rgba(0,0,0,0.25);text-align:center;position:relative;}
.upgrades-container{display:flex;flex-direction:column;align-items:center;gap:30px;margin-top:50px;}
.upgrade{position:relative;width:250px;border-radius:10px;overflow:hidden;box-shadow:0 6px 12px rgba(0,0,0,0.15);background:#fff;transition:filter 0.5s,opacity 0.5s;border:2px solid #d4a373;padding:10px}
.tier-image{width:100%;display:block;border-radius:10px;object-fit:contain;background:#fff;}
.upgrade-content{
  padding: 10px;
  padding-bottom:0;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  color:#5c4327;
  text-align:left;
}
.upgrade-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    color: white;
    text-shadow: 0 2px 4px black;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.upgrade-top h2 {
    margin: 0;
    padding-top: 8px;
    padding-bottom:2px;
    background: rgba(0, 0, 0, 0.4);
    font-size: 16px;
    border-radius: 10px 10px 0 0;
}
.upgrade-top .per-unit-rate {
    background: rgba(0, 0, 0, 0.4);
    font-size: 12px;
    padding: 2px 0 6px;
    text-align: center;
}  
.progress-bar{height:40px;background-color:#ccc;border-radius:10px;overflow:hidden;margin-top:10px;position:relative;cursor:pointer;}
.progress-bar-fill{height:100%;width:0%;transition:width 0.3s,background-color 0.3s;}
.progress-bar-fill.affordable{background-color:#4CAF50;}
.progress-bar-fill.unaffordable{background-color:#888;}
.progress-bar-fill.affordable:hover{background-color:#66dd66;}
.progress-bar-text{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:18px;color:white;font-weight:bold;text-shadow:0 1px 2px black;pointer-events:none;}
.blurred{filter:blur(8px) brightness(50%);pointer-events:none;}
.menu-buttons button{
  background: rgba(224,192,151,0.8);
  border: 2px solid #7a5c3b;
  padding: 2px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
  box-sizing: border-box;
  cursor: pointer;
  position: relative;
  transition: background 0.2s, transform 0.1s;
}
.menu-buttons button::after{
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border: 1px solid #a27b52;
  pointer-events: none;
}
.menu-buttons button:hover{
  background: rgba(241,215,170,0.9);
  transform: translateY(-1px);
}
.menu-buttons button.active{ background: rgba(241,215,170,0.9); }
.button-icon{ width: 48px; height: 48px; image-rendering: pixelated; }
.buyToggleBtn {
  background: rgba(224,192,151,0.8);
  border: 2px solid #7a5c3b;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: bold;
  color: #5c4327;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.buyToggleBtn:hover { background: rgba(241,215,170,0.9); }
.buyToggleBtn.active {
  background: #d4a373;
  color: white;
}

.scientist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  width: 100%;
}

.scientist-card {
  background: #fff;
  border: 2px solid #d4a373;
  border-radius: 10px;
  overflow: visible;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  text-align: center;
  padding: 0;
  position: relative;
}

.scientist-wrapper {
  position: relative;
  width: 100%;
  height: 480px;
  overflow: visible;
  background: #f7f3e9;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scientist-img {
  width: 100%;
}

.scientist-label {
  position: absolute;
  bottom: 5px;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.0);
  color: white;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  pointer-events: none;
}

.scientist-busy {
  position: absolute;
  top: 5px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #c00;
  font-weight: bold;
  background: rgba(255,255,255,0.8);
  padding: 2px 0;
}

.scientist-buy {
  position: absolute;
  bottom: 10px;
  left: 10%;
  width: 80%;
  height: 30px;
  cursor: pointer;
}

.scientist-chat {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background: rgba(224,192,151,0.9);
  border: 2px solid #a27b52;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background 0.2s;
  z-index: 2;
}
.scientist-chat:hover {
  background: rgba(241,215,170,1);
}

.scientist-dialogue {
  position: absolute;
  bottom: 0;
  left: 0;
  background: rgba(255,250,240,0.97);
  border-top: 2px solid #d4a373;
  border-radius: 0 0 10px 10px;
  padding: 5px;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  font-size: 14px;
  z-index: 10;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: 100%;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

.dialogue-question {
  background: #f7f3e9;
  border: 1px solid #d4a373;
  border-radius: 8px;
  padding: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  max-width: 280px;
  text-align: left;
  width: 100%;
}
.dialogue-question:hover {
  background: #efe1c3;
}

.dialogue-response {
  padding: 4px;
  background: #fffbe6;
  border-radius: 8px;
  border: 1px solid #d4a373;
  color: #5c4327;
  font-style: italic;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  text-align: left;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.combo-images {
  display: flex;
  gap: 5px; /* Or your desired gap */
  justify-content: flex-start; /* NEW: This aligns items to the start (left) of the container */
  min-height: 56px; /* Or adjust as needed per slot */
  perspective: 800px;
  padding-left: 8px;
}

/* The rest of your .combo-images img styles remain the same: */
.combo-images img {
  width: 48px !important;
  height: 48px !important;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #d4a373;
  background: #efe1c3;
}

/* Your animation for individual images remains the same */
@keyframes spinReveal {
  0% { transform: rotateY(90deg) scale(0.8); opacity: 0; }
  60% { transform: rotateY(-20deg) scale(1.05); opacity: 1; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

.combo-img.spin {
  animation: spinReveal 0.6s ease-out forwards;
  transform-origin: center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.combo-thinking { /* If you had styles for this */
  font-size: 14px;
  color: #5c4327;
  font-weight: bold;
  /* display: none; /* Initial display state is handled by JS */
}

.ingredient-wrapper {
  width: 90px;
  height: 90px;
  position:relative;
  border-radius:10px;
  overflow:hidden;
  border: 2px solid #d4a373;
  background: #f8ebd0;
}

.ingredient-img, .combo-img {
  border-radius: 10px;
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.ingredient-label {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2px 0;
  color: #5c4327;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  box-sizing: border-box;
}

.recipe-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #d4a373;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  font-weight: bold;
}

#recipeTesterWrapper {
  align-items: center; /* Keep this */
  padding: 10px; /* Keep this or adjust */
  width: 100%; /* Make it fill the parent card's content width */
  box-sizing: border-box;
}

.recipe-tester-instance {
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.recipe-tester-instance h3 { /* Style the "Tester 1" / "Tester 2" headings */
  margin: 0;
  padding: 10px;
  font-size: 16px;
  color: #5c4327;
}

/* Ensure the shared stats are below the testers */
#recipeTestStats {
  margin-top: 15px;
  width: 100%;
  max-width: 300px; /* Match tester instance width if desired */
}

@keyframes floatUp {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100%  { transform: translate(-50%, -150%) scale(1.2); opacity: 0; }
}
  
.floating-oats {
    position: absolute;
    color: #3e2b16;
    font-size: 18px;
    font-weight: 600;
    pointer-events: none;
    z-index: 1000;
    animation: floatUp 1.4s ease-out forwards;
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}
#clicksPerSecMeter{position:absolute;bottom:5px;left:50%;transform:translateX(-50%);width:60%;height:14px;background:#533e2d;border:1px solid #a67c52;border-radius:5px;overflow:hidden;font-size:11px;line-height:14px;text-align:center;color:#fff;}
#meterFill{height:100%;width:0;background:#d4a373;position:absolute;left:0;top:0;z-index:0;transition:width 0.1s ease;}
#meterText{position:relative;z-index:1;}
.deposit-button {
    padding:6px 12px;
    background:#d4a373;
    color:#3e2b16;
    border:none;
    border-radius:6px;
    font-weight:bold;
    cursor:pointer;
    font-size:14px;
}
#bankContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding:20px;
    margin-top: 30px;
}
input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #d4a373 0%, #d4a373 var(--slider-percent, 50%), #ccc var(--slider-percent, 50%), #ccc 100%);
    outline: none;
    transition: background 0.2s ease;
}
  
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    background: #5c4327;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}
  
input[type="range"]::-moz-range-thumb {
    height: 16px;
    width: 16px;
    background: #5c4327;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.rarity-0 { color:rgb(218, 218, 218); }
.rarity-1 { color: #a0bea1; }

#upgrades {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 1px;
}

#upgrades > .upgrade:not(:first-child) {
  margin-top: 30px;
}

.tab-visible {
  display: flex;
  flex-direction: column;
  align-items: center;

}
.tab-hidden {
  display: none;
}

#upgrade-button-div {
  display: flex;
  gap: 10px;
  margin: 15px auto 0 auto;
  padding: 0 20px;
  max-width: 400px;
  width: 100%;
  box-sizing: border-box;
}

.upgrade-tab {
  flex: 1;
  background-color: #e0c097;
  border: none;
  padding: 10px 0;
  font-weight: bold;
  cursor: pointer;
  border-radius: 6px;
  color: #5c4327;
  font-size: 16px;
  text-align: center;
}

.upgrade-tab.active {
  background-color: #d4a373;
}

#available-upgrades,
#owned-upgrades {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 5px;
  box-sizing: border-box;
  width: 100%;
  justify-items: center;
}

#available-upgrades .upgrade,
#owned-upgrades .upgrade {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  border: 2px solid #d4a373;
  position: relative;
  box-sizing: border-box;
  padding: 0 !important;
  margin-top: 0 !important;
  background:#5c4327;
}

#available-upgrades .tier-image,
#owned-upgrades .tier-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: #fff;
}

#available-upgrades .upgrade-top h2,
#owned-upgrades .upgrade-top h2 {
  font-size: 12px;
  margin: 0;
  padding: 4px 0;
  background: rgba(0, 0, 0, 0.6);
}

#available-upgrades .progress-bar,
#owned-upgrades .progress-bar {
  height: 20px !important;
  margin-top: 6px;
  width: 70% !important;
  position: relative;
}

#available-upgrades .progress-bar-text,
#owned-upgrades .progress-bar-text {
  font-size: 11px;
}

#available-upgrades .progress-bar-fill,
#owned-upgrades .progress-bar-fill {
  height: 100%;
}

.granular-description {
  padding:4px;
  font-size: 11px;
  color: #ffffff;
  font-weight: bold;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

#oatsPerSecond {
  transition: color 0.3s ease;
}

.expand-button {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: #d4a373;
  color: #3e2b16;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  line-height: 24px;
  text-align: center;
}

.minimize-button {
  position: absolute;
  top: 6px;
  right: 10px;
  background: #d4a373;
  color: #3e2b16;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  line-height: 24px;
  text-align: center;
}

input.graph-slider {
  appearance: none;
  height: 6px;
  background: transparent;
  border-radius: 3px;
  margin-top: 6px;
  cursor: pointer;
}

input.graph-slider:focus {
  outline: none;
}

/* Track */
input.graph-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border-radius: 3px;
}
input.graph-slider::-moz-range-track {
  height: 6px;
  background: #444;
  border-radius: 3px;
}

/* Thumb base style */
input.graph-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  margin-top: -4px; /* align thumb to track */
  cursor: pointer;
}
input.graph-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* Gold variant */
input.graph-gold::-webkit-slider-thumb {
  background: #d4a373;
}
input.graph-gold::-moz-range-thumb {
  background: #d4a373;
}

/* Blue variant */
input.graph-blue::-webkit-slider-thumb {
  background: #6ca0f6;
}
input.graph-blue::-moz-range-thumb {
  background: #6ca0f6;
}
