/* ── ABACUS SIMULATOR STYLES ── */
.simulator-main {
  background: var(--orange-bg);
  min-height: calc(100vh - 200px);
}

.simulator-section {
  max-width: 1000px;
  margin: 0 auto;
}

.abacus-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.abacus-header .btn {
  margin-right: 10px;
}



.abacus-scroll {
  width: 100%;
  overflow: hidden; /* Remove scrollbars */
  position: relative;
}

.abacus-frame {
  width: 750px;
  min-width: 750px;
  height: 380px;
  margin: 0 auto;
  transform-origin: top left;
  border: 16px solid #5C2C16;
  border-radius: 8px;
  background: #FFF8DC;
  position: relative;
  box-shadow: 
    0 15px 35px rgba(0,0,0,0.15), 
    inset 0 0 20px rgba(0,0,0,0.1),
    inset 0px 5px 10px rgba(0,0,0,0.2);
  padding: 0 10px;
  box-sizing: border-box;
}

.horizontal-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: 100px;
  height: 16px;
  background: #5C2C16;
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
  z-index: 2;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 2px solid rgba(0,0,0,0.5);
}

.rods-container {
  display: flex;
  justify-content: space-between;
  height: 348px; /* Inner height */
}

.rod-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
  height: 100%;
}

.rod-stick {
  width: 8px;
  height: 100%;
  background: linear-gradient(to right, #6b340e, #a85517, #6b340e);
  z-index: 1;
  box-shadow: inset 1px 0 2px rgba(0,0,0,0.3);
}

.beam-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #FFF;
  border-radius: 50%;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

.bead {
  width: 85%;
  max-width: 56px;
  height: 34px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 40% 30%, #FF9F4A, var(--orange) 40%, #873b00 90%);
  border-radius: 50%;
  box-shadow: 0 6px 8px rgba(0,0,0,0.3), inset 0px -3px 6px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: top 0.12s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.15s ease, filter 0.15s ease;
  z-index: 3;
  touch-action: manipulation;
}

.bead::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 3px;
  right: 3px;
  height: 2px;
  background: rgba(255,255,255,0.25);
  transform: translateY(-50%);
}

.bead:hover {
  filter: brightness(1.2);
  transform: translateX(-50%) scale(1.03);
}

.bead:focus {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
}

/* Place values display below */
.place-values {
  position: absolute;
  bottom: -35px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
}

.place-value {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

@media (max-width: 768px) {
  .simulator-hero h1 { font-size: 2rem; }
  
  .abacus-header {
    flex-direction: column;
    gap: 1rem;
  }
  .abacus-header .btn {
    position: static;
    width: 100%;
  }
}
