.acetyl-group-drag {
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.18s, filter 0.18s;
}
.acetyl-group-drag:active {
  cursor: grabbing;
}
.acetyl-group-shape {
  width: 36px;
  height: 36px;
  display: block;
}
.reset-btn-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
}
.reset-btn {
  background: #f87171;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5em 1.2em;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(248,113,113,0.13);
  transition: background 0.2s;
}
.reset-btn:hover {
  background: #dc2626;
}
/* Slider animation for condensation/relaxation */
.slider-wrapper.condense-anim {
  animation: slider-condense 0.4s cubic-bezier(.7,1.7,.7,1) 1;
}
.slider-wrapper.relax-anim {
  animation: slider-relax 0.4s cubic-bezier(.7,1.7,.7,1) 1;
}
@keyframes slider-condense {
  0% { transform: scale(1); }
  40% { transform: scale(1.08) translateY(-8px); }
  100% { transform: scale(1) translateY(0); }
}
@keyframes slider-relax {
  0% { transform: scale(1); }
  40% { transform: scale(1.08) translateY(8px); }
  100% { transform: scale(1) translateY(0); }
}
.dna-svg {
  cursor: pointer;
  z-index: 3;
}
.dna-svg.highlight {
  filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.55)) drop-shadow(0 0 14px rgba(254, 240, 138, 0.45));
}
.dna-svg.dragging {
  z-index: 10;
}
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: #f4f8fb;
  color: #222;
}
header {
  background: #2d3e50;
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
header h1 {
  margin: 0 0 0.5rem 0;
}
nav a {
  color: #fff;
  margin-right: 1.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
nav a:hover {
  color: #ffd700;
}
main {
  padding: 2rem;
}
.home {
  max-width: 600px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  padding: 2rem;
  text-align: center;
}
.home ul {
  list-style: none;
  padding: 0;
}
.home li {
  margin: 1rem 0;
}
.home a {
  color: #2d3e50;
  font-weight: bold;
  text-decoration: underline;
}

/* Game Layout */
.game-layout {
  display: flex;
  flex-direction: row;
  height: 520px;
  background: #eaf1f7;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin: 2rem auto;
  max-width: 1100px;
  min-width: 800px;
  overflow: hidden;
}
.tool-column {
  width: 120px;
  background: #dbeafe;
  border-right: 2px solid #b6c6e2;
  overflow-y: auto;
  padding: 1rem 0.5rem;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.level-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.level-bottom-controls {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.4rem 1rem 0.6rem 1rem;
  background: #e2e8f0;
  border-top: 1px solid #b6c6e2;
}
.info-bar {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  min-height: 40px;
  background: #c7e0f7;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0.5rem;
  padding: 0.65rem 1rem;
  font-size: 1.1rem;
  color: #1a2a3a;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
}
.info-bar__text {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}
.info-bar__text em {
  font-style: italic;
  color: #0f172a;
}
.info-bar__actions {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
}
.info-bar__actions button {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.45em 0.9em;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.35);
  transition: background 0.15s, transform 0.1s;
}
.info-bar__actions button:hover:not(:disabled) {
  background: #2563eb;
}
.info-bar__actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.info-bar__actions--hidden {
  display: none !important;
}
/* Tutorial pulse rings: distinct from default hover gold (#facc15 / 250,204,21) */
#tutorial-highlight-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2500;
  overflow: visible;
}
.tutorial-glow-ring {
  position: fixed;
  left: 0;
  top: 0;
  border-radius: 50%;
  box-sizing: border-box;
  border: 3px solid rgba(180, 120, 20, 0.95);
  background: rgba(255, 237, 150, 0.12);
  box-shadow:
    0 0 0 3px rgba(202, 138, 4, 0.35),
    0 0 18px 6px rgba(250, 204, 30, 0.28);
  will-change: transform, opacity;
  /* Position uses left/top = center − size/2; scale() then stays centered. */
  transform-origin: 50% 50%;
  animation: tutorial-pulse-in 1.9s ease-in-out infinite;
}
.tutorial-glow-ring.tutorial-glow-ring--whole-strand {
  /* Slightly looser read on the big group highlight */
  border-width: 4px;
}
.tutorial-glow-ring.tutorial-glow-ring--stopped {
  animation: none;
  transform: scale(1);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.15s ease;
}
@keyframes tutorial-pulse-in {
  0% {
    transform: scale(2.2);
    opacity: 0;
  }
  16% {
    transform: scale(1.1);
    opacity: 0.6;
  }
  50%,
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
}
.level-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 600px;
  min-height: 0;
}

/* Nucleosome Level Framework */
.level-wrapper {
  position: relative;
  width: 900px;
  height: 220px;
  margin: 0 auto;
  user-select: none;
  overflow: hidden; /* Hide anything outside the bounds */
  box-shadow: 0 0 0 4px #b6c6e2 inset;
  background: #f8fafc;
}
.nucleosome {
  position: absolute;
  width: 64px;
  height: 64px;
  z-index: 2;
  background: none;
  box-shadow: none;
  border: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-items: center;
  cursor: grab;
  transition: box-shadow 0.2s, border 0.2s;
}
/* .dna-wrapped removed: no wrapped DNA on nucleosome */
/* Methyl group styles */
.methyl-group-wrapper {
  user-select: none;
}
.methyl-group-drag {
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.18s, border-color 0.18s;
}
.methyl-group-drag:active {
  cursor: grabbing;
}
.methyl-group-shape {
  width: 32px;
  height: 32px;
  position: relative;
}
.dna-link {
  position: absolute;
  top: 28px;
  width: 120px;
  height: 8px;
  background: linear-gradient(90deg, #3b82f6 60%, #60a5fa 100%);
  border-radius: 8px;
  z-index: 1;
  transition: background 0.2s, box-shadow 0.2s;
  cursor: ew-resize;
}

/* Highlight and Drag Effects */
.nucleosome.highlight, .dna-link.highlight {
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.55), 0 0 18px rgba(254, 240, 138, 0.45);
  border-color: #facc15;
  background: none;
}
.dna-link.highlight {
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.55), 0 0 18px rgba(254, 240, 138, 0.45);
}
.nucleosome.dragging, .dna-link.dragging {
  z-index: 10;
  filter: brightness(1.15) drop-shadow(0 4px 16px #facc15);
  cursor: grabbing;
}

/* Slider (lives in .level-bottom-controls, not over the playfield) */
.slider-wrapper {
  position: relative;
  right: auto;
  bottom: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 0.7rem 1.2rem;
  z-index: 1;
  display: flex;
  align-items: center;
}
.methyl-group-source,
.acetyl-group-source {
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.methyl-group-source:active,
.acetyl-group-source:active {
  cursor: grabbing;
}

/* Notification Dialog */
.notification-dialog {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 20px 30px;
  z-index: 1000;
  display: none; /* Hidden by default */
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  text-align: center;
  min-width: 300px;
}

.notification-dialog.show {
  display: block;
  opacity: 1;
}

.notification-dialog .notification-content p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
  color: #333;
}

.notification-dialog.success .notification-content p {
  color: #22c55e; /* Green for success */
}

.notification-dialog.error .notification-content p {
  color: #ef4444; /* Red for error */
}

.slider-wrapper input[type="range"] {
  width: 180px;
  accent-color: #3b82f6;
  margin-left: 0.5rem;
}
