.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
}

.screen.active {
  display: block;
}

/* Intro Screen Styles */
.intro-content {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  color: white;
}

.intro-content h1 {
  font-size: 2em;
  margin-bottom: 30px;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.quantum-decoration {
  height: 150px;
  margin: 30px 0;
  position: relative;
}

.bloch-sphere {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  border: 3px solid rgba(255,255,255,0.8);
  border-radius: 50%;
  position: relative;
  animation: rotate 10s linear infinite;
}

.bloch-sphere::before,
.bloch-sphere::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.8);
  top: 50%;
  left: 0;
  transform-origin: center;
}

.bloch-sphere::after {
  transform: rotate(90deg);
}

@keyframes rotate {
  from { transform: rotate(0deg) perspective(500px) rotateX(45deg); }
  to { transform: rotate(360deg) perspective(500px) rotateX(45deg); }
}

.intro-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
  padding: 0 20px;
}

.intro-buttons .glow-button {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.3em;
}

.glow-button {
  padding: 15px 40px;
  font-size: 1.2em;
  background: transparent;
  border: 2px solid white;
  color: white;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
}

.glow-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.3),
    transparent
  );
  transition: 0.5s;
}

.glow-button:hover::before {
  left: 100%;
}

.glow-button:hover {
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 20px rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* How to Play Screen Styles */
.how-to-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  color: white;
}

.tutorial-section {
  background: rgba(255,255,255,0.1);
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
}

.tutorial-section h2 {
  color: #fdbb2d;
  margin-bottom: 15px;
}

.tutorial-section ul {
  list-style-type: none;
  padding: 0;
}

.tutorial-section li {
  margin: 10px 0;
  padding-left: 20px;
  position: relative;
}

.tutorial-section li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #fdbb2d;
}

.gates-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.gate-info {
  background: rgba(255,255,255,0.1);
  padding: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.gate-info .gate {
  min-width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.gate-info p {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.3;
}

.mode-details {
  margin-top: 15px;
}

.mode-details h3 {
  color: #fdbb2d;
  margin: 15px 0 10px 0;
  font-size: 1.1em;
}

.mode-details ul {
  margin-left: 20px;
  list-style-type: disc;
}

.mode-details li {
  margin: 5px 0;
  padding-left: 5px;
}

body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 10px;
  background: #2c3e50;
  color: #2c3e50;
  min-height: 100vh;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  color: white;
}

h1 {
  text-align: center;
  color: white;
  margin-bottom: 20px;
  font-size: 1.8em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
  font-size: 1em;
  font-weight: bold;
  background: rgba(255,255,255,0.1);
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stats div {
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.circuit-container {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  flex-wrap: wrap;
}

.qubit {
  font-family: monospace;
  font-size: 1.2em;
  margin-right: 15px;
  color: white;
  font-weight: bold;
}

.qubit sub {
  font-size: 0.7em;
  vertical-align: sub;
}

.gates {
  display: flex;
  gap: 10px;
  flex-grow: 1;
  min-height: 40px;
  flex-wrap: wrap;
}

.gate {
  width: 35px;
  height: 35px;
  border: 2px solid rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  background: rgba(255,255,255,0.1);
  color: white;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
  font-size: 0.9em;
}

.gate:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  background: rgba(255,255,255,0.2);
}

.betting-controls {
  margin-bottom: 25px;
  background: rgba(255,255,255,0.1);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: relative;
}

.betting-controls button {
  margin-top: 20px;
}

.probability-sliders {
  margin-bottom: 20px;
}

.slider-group {
  margin-bottom: 15px;
}

.slider-group label {
  display: block;
  margin-bottom: 8px;
  color: white;
  font-weight: bold;
}

input[type="range"] {
  width: 100%;
  margin: 10px 0;
  height: 8px;
  border-radius: 4px;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.2);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: #fdbb2d;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #ff8c00;
}

button {
  display: block;
  width: 180px;
  margin: 10px auto;
  padding: 10px;
  font-size: 1em;
  background: transparent;
  color: white;
  border: 2px solid white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-transform: uppercase;
  letter-spacing: 1px;
}

button:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

button:disabled {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.result {
  background: rgba(255,255,255,0.1);
  padding: 25px;
  border-radius: 10px;
  margin-top: 35px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: relative;
}

.result button {
  margin-top: 50px;
}

.result h2 {
  color: white;
  margin-top: 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.result-details {
  margin: 15px 0;
  line-height: 1.6;
}

.result-details div {
  margin-bottom: 12px;
  padding: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  color: white;
  white-space: pre-wrap;
}

.positive {
  color: #80FF00;
  font-weight: bold;
}

.negative {
  color: #FF0000;
  font-weight: bold;
}

.hidden {
  display: none;
}

@keyframes bounceAndGlow {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(255,255,255,0);
  }
  50% {
    transform: scale(1.3);
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(255,255,255,0);
  }
}

.animate-earnings {
  animation: bounceAndGlow 0.5s ease-out;
}

.phase-display {
  display: flex;
  justify-content: space-around;
  margin: 30px 0;
  text-align: center;
  flex-wrap: wrap;
  gap: 20px;
}

.phase-ring {
  width: 80px;
  height: 80px;
  position: relative;
}

.phase-ring svg {
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}

.phase-ring-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9em;
  color: #2c3e50;
}

.phase-ring svg circle.phase-ring-background {
  fill: none;
  stroke: rgba(255,255,255,0.1);
  stroke-width: 8px;
}

.phase-ring svg circle.phase-ring-value {
  fill: none;
  stroke: url(#phaseGradient);
  stroke-width: 8px;
  stroke-dashoffset: 282.74;
  transform-origin: center;
}

.phase-sliders {
  margin-top: 15px;
}

.phase-value {
  color: #8e44ad;
}

.complex-number {
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.hint-controls {
  background: rgba(255,255,255,0.1);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 25px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.hint-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.hint-button {
  width: auto;
  padding: 6px 12px;
  font-size: 0.8em;
}

.hints-remaining {
  text-align: center;
  color: white;
  font-weight: bold;
  margin-bottom: 10px;
}

#hints-display {
  margin-top: 15px;
}

.hint-message {
  background: rgba(255,255,255,0.1);
  padding: 10px;
  margin: 5px 0;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  color: white;
  white-space: pre-wrap;
}

.amplitude-histogram {
  background: rgba(255,255,255,0.05);
  margin: 15px 0 35px 0;
  padding: 15px 30px;
  border-radius: 8px;
  height: 120px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.histogram-bar {
  width: 60px;
  background: linear-gradient(to top, #FF0000, #FF8000, #FFFF00, #80FF00, #00FF00, #00FF80, #00FFFF, #0080FF, #0000FF, #8000FF, #FF00FF, #FF0080, #FF0000);
  background-size: 100% 1300%;
  transition: all 0.3s ease;
  position: relative;
  border-radius: 4px 4px 0 0;
}

.histogram-value {
  position: absolute;
  top: -20px;
  width: 100%;
  text-align: center;
  font-size: 0.8em;
  color: white;
}

.histogram-label {
  position: absolute;
  bottom: -25px;
  width: 100%;
  text-align: center;
  font-weight: bold;
  color: white;
}

.amplitude-histogram::before {
  content: '';
  position: absolute;
  left: 20px;
  bottom: 0;
  top: 0;
  width: 1px;
  background: rgba(255,255,255,0.3);
}

.amplitude-histogram::after {
  content: '1.0';
  position: absolute;
  left: 5px;
  top: 0;
  font-size: 0.8em;
  color: white;
}

.amplitude-histogram-labels {
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 0 20px 0;
  font-size: 0.8em;
  color: white;
}

.result-histogram-container {
  background: rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: 10px;
  margin: 30px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.result-histogram-container h3 {
  color: white;
  margin: 10px 0;
  text-align: center;
}

.result-histogram {
  margin: 30px 0;
  background: rgba(255,255,255,0.05);
  position: relative;
  margin: 20px 0;
  padding: 15px;
  height: 150px;
  display: flex;
  align-items: flex-end;
  border-radius: 8px;
}

.histogram-bar-group {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  width: 100%;
  height: 100%;
}

.histogram-bar-actual, .histogram-bar-bet {
  position: relative;
  width: 80px;
  transition: height 0.3s ease;
  border-radius: 4px 4px 0 0;
}

.histogram-bar-actual {
  background: linear-gradient(to top, #FF0000, #FF8000, #FFFF00, #80FF00, #00FF00, #00FF80, #00FFFF, #0080FF, #0000FF, #8000FF, #FF00FF, #FF0080, #FF0000);
  background-size: 100% 1300%;
}

.histogram-bar-bet {
  background: rgba(52, 152, 219, 0.8);
}

.histogram-value {
  position: absolute;
  top: -25px;
  width: 100%;
  text-align: center;
  font-size: 0.9em;
  color: white;
}

.histogram-label {
  position: absolute;
  bottom: -25px;
  width: 100%;
  text-align: center;
  font-weight: bold;
  color: white;
}

.gate-tooltip {
  position: absolute;
  background: rgba(255,255,255,0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  width: 300px;
  z-index: 1000;
  font-size: 0.9em;
  color: #2c3e50;
  backdrop-filter: blur(5px);
}

.gate-tooltip h3 {
  margin: 0 0 10px 0;
  color: #2980b9;
}

.gate-tooltip p {
  margin: 8px 0;
  line-height: 1.4;
}

.gate-tooltip .matrix {
  font-family: 'Courier New', monospace;
  margin: 15px 0;
  background: rgba(0,0,0,0.05);
  padding: 10px;
  border-radius: 4px;
  display: inline-block;
}

.matrix-row {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.matrix-row span {
  min-width: 30px;
  text-align: center;
}

.matrix-display {
  font-family: 'Courier New', monospace;
  margin: 10px 0;
  text-align: center;
}

.matrix-bracket {
  font-size: 2em;
  display: flex;
  align-items: center;
}

.new-gates-announcement {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  text-align: center;
  opacity: 0;
  transition: all 0.5s ease;
  z-index: 1000;
  max-width: 90%;
  width: 400px;
  color: #2c3e50;
}

.new-gates-announcement.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.new-gates-announcement h3 {
  color: #2980b9;
  margin: 0 0 15px 0;
  font-size: 1.4em;
}

.new-gates-announcement p {
  margin: 10px 0;
  font-size: 0.9em;
}

.new-gates {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
}

.new-gate {
  animation: popIn 0.5s ease forwards;
  opacity: 0;
  transform: scale(0.5);
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  70% {
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.new-gates .gate:nth-child(1) { animation-delay: 0.2s; }
.new-gates .gate:nth-child(2) { animation-delay: 0.4s; }
.new-gates .gate:nth-child(3) { animation-delay: 0.6s; }

.coin {
  position: fixed;
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, #ffd700, #daa520);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b8860b;
  font-weight: bold;
  font-size: 24px;
  box-shadow: 
    inset -2px -2px 6px rgba(0,0,0,0.3),
    inset 2px 2px 6px rgba(255,255,255,0.8),
    2px 2px 8px rgba(0,0,0,0.3);
  z-index: 9999;
  pointer-events: none;
  user-select: none;
}

.coin.positive {
  background: linear-gradient(45deg, #ffd700, #ffa500);
  color: #8b4513;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.4);
}

.coin.negative {
  background: linear-gradient(45deg, #ff4444, #cc0000);
  color: white;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}

.sandbox-controls {
  background: rgba(255,255,255,0.1);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.available-gates {
  margin-bottom: 20px;
}

.available-gates h3 {
  color: white;
  margin-bottom: 15px;
}

.gate-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.gate-btn {
  width: 50px;
  height: 50px;
  font-size: 1.2em;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.8);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gate-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.clear-btn {
  margin-left: 20px;
  padding: 8px 15px;
  background: rgba(255,0,0,0.2);
  border: 2px solid rgba(255,0,0,0.4);
}

.clear-btn:hover {
  background: rgba(255,0,0,0.3);
}

.sandbox-state {
  margin-top: 20px;
  padding: 15px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  color: white;
}

.sandbox-state h3 {
  margin: 0 0 10px 0;
}

#sandbox-state-display {
  font-family: 'Courier New', monospace;
  font-size: 1.2em;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 5px;
}

#back-to-intro-game {
  display: block;
  margin: 20px auto;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.8);
  padding: 12px 25px;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#back-to-intro-game:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.game-widget {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.widget-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.hist-bar {
  width: 12px;
  height: 40px;
  background: rgba(255, 255, 255, 0.8);
  margin: 0 3px;
  position: relative;
  animation: histBars 2s infinite;
}

.hist-bar:first-child {
  height: 30px;
  animation-delay: 0.5s;
}

@keyframes histBars {
  0%, 100% { height: 20px; }
  50% { height: 40px; }
}

.phase-circle {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  position: relative;
}

.phase-line {
  position: absolute;
  width: 20px;
  height: 3px;
  background: rgba(255, 255, 255, 0.8);
  top: 50%;
  left: 50%;
  transform-origin: left;
  animation: rotateLine 4s linear infinite;
}

@keyframes rotateLine {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

.sandbox-gate {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  font-size: 0.8em;
  background: rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease;
}

.sandbox-gate:first-child {
  transform: translate(-10px, -10px);
  animation: floatGate 2s infinite;
}

.sandbox-gate:last-child {
  transform: translate(10px, 10px);
  animation: floatGate 2s infinite reverse;
}

@keyframes floatGate {
  0%, 100% { transform: translate(-10px, -10px); }
  50% { transform: translate(-15px, -15px); }
}

.help-circle {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  font-weight: bold;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.game-widget span {
  flex-grow: 1;
  text-align: center;
}

@media (max-width: 480px) {
  .intro-buttons .glow-button {
    padding: 15px;
    font-size: 1.1em;
  }
  
  .widget-icon {
    width: 40px;
    height: 40px;
  }
  
  .hist-bar {
    width: 8px;
    height: 30px;
  }
  
  .phase-circle, .help-circle {
    width: 30px;
    height: 30px;
  }
  
  .sandbox-gate {
    width: 15px;
    height: 15px;
    font-size: 0.7em;
  }
  
  .container {
    padding: 10px;
  }
  
  h1 {
    font-size: 1.5em;
  }
  
  .stats {
    font-size: 0.9em;
  }
  
  .gate {
    width: 30px;
    height: 30px;
  }
  
  .histogram-bar {
    width: 40px;
  }
  
  .phase-ring {
    width: 50px;
    height: 50px;
  }
  
  .phase-ring svg {
    width: 50px;
    height: 50px;
  }
  
  .phase-ring-label {
    font-size: 0.7em;
  }
  
  .phase-display {
    margin: 15px 0 40px 0;
  }
  
  .result button {
    margin-top: 40px;
  }
  
  button {
    width: 150px;
    font-size: 0.9em;
  }
  
  .gate-tooltip {
    width: 200px;
  }
}

.two-qubit-circuit {
  position: relative;
  margin: 20px 0;
  padding: 20px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
}

.two-qubit-gate {
  width: 50px;
  height: 100px;
  border: 2px solid rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  cursor: pointer;
  position: absolute;
  top: -25px;
  z-index: 2;
}

.gate-column {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.two-qubit-line {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  height: 140px;
}

.qubit-line {
  display: flex;
  align-items: center;
  height: 50px;
  position: relative;
}

.qubit-line::after {
  content: '';
  position: absolute;
  width: calc(100% - 60px);
  height: 2px;
  background: rgba(255,255,255,0.3);
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
}

.qubit {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-size: 1.2em;
  width: 60px;
  text-align: right;
  padding-right: 10px;
  z-index: 1;
  color: white;
}

.gate-container {
  display: flex;
  gap: 70px;
  flex-grow: 1;
  height: 100%;
  align-items: center;
  z-index: 1;
  position: relative;
}

.gate {
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  background: rgba(255,255,255,0.1);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

.two-qubit-gate {
  width: 50px;
  height: 120px;
  border: 2px solid rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  cursor: pointer;
  position: absolute;
  top: -15px;
}

.single-qubit-spacer {
  width: 50px;
  height: 50px;
  visibility: hidden;
}

.control {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  margin: 19px auto;
}

.target {
  width: 30px;
  height: 30px;
  border: 2px solid white;
  border-radius: 50%;
  margin: 10px auto;
  position: relative;
}

.target.x::before,
.target.x::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: white;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.target.x::after {
  transform: translateY(-50%) rotate(90deg);
}

.target.z::before {
  content: 'Z';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
}

.swap {
  width: 30px;
  height: 30px;
  position: relative;
  margin: 10px auto;
}

.swap::before,
.swap::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: white;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

.swap::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.state-explanation-container {
  background: rgba(255,255,255,0.1);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
}

.state-explanation {
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  color: white;
  margin: 0;
  font-size: 0.9em;
  line-height: 1.4;
  overflow-x: auto;
}

.state-explanation-container h3 {
  color: white;
  margin: 0 0 10px 0;
  font-size: 1.1em;
}

@media (max-width: 480px) {
  .state-explanation {
    font-size: 0.8em;
  }
}

.two-qubit-histogram {
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  position: relative;
  margin: 30px 0;
}

.two-qubit-histogram .histogram-bar {
  width: 40px;
}

.qubit-circle {
  width: 25px;
  height: 25px;
  border: 2px solid rgba(255,255,255,0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Times New Roman', serif;
  font-style: italic;
  color: white;
  position: absolute;
}

.qubit-circle.q0 {
  top: 5px;
  left: 5px;
}

.qubit-circle.q1 {
  bottom: 5px;
  right: 5px;
}

@media (max-width: 480px) {
  .two-qubit-histogram .histogram-bar {
    width: 30px;
  }
  
  .qubit-circle {
    width: 20px;
    height: 20px;
    font-size: 0.8em;
  }
}

.development-banner {
  background: rgba(255, 87, 34, 0.9);
  color: white;
  text-align: center;
  padding: 10px;
  position: relative;
  margin-bottom: 20px;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.development-banner::before {
  content: '🚧';
  margin-right: 8px;
}

.development-banner::after {
  content: '🚧';
  margin-left: 8px;
}

.credits-footer {
  margin-top: 30px;
  text-align: center;
  padding: 20px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  animation: glowPulse 2s infinite;
}

.credits-text {
  font-size: 1.2em;
  color: white;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
  letter-spacing: 2px;
}

.how-to-credits {
  margin-top: 50px;
  padding: 25px;
  background: rgba(255,255,255,0.15);
}

.credits-link {
  display: block;
  margin-top: 10px;
  color: #fdbb2d;
  text-decoration: none;
  font-size: 1.1em;
  transition: all 0.3s ease;
}

.credits-link:hover {
  color: #ffd700;
  text-shadow: 0 0 15px rgba(255,215,0,0.6);
  transform: scale(1.05);
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 10px rgba(255,255,255,0.2); }
  50% { box-shadow: 0 0 20px rgba(255,255,255,0.4); }
  100% { box-shadow: 0 0 10px rgba(255,255,255,0.2); }
}

@media (max-width: 480px) {
  .credits-footer {
    margin-top: 20px;
    padding: 15px;
  }
  
  .credits-text {
    font-size: 1em;
  }
  
  .credits-link {
    font-size: 0.9em;
  }
}