button {
    background: rgba(240, 228, 66, 0.5);
    border: none;
    color: #009e73;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    width: 100%;
    border: 2px solid #e54e9e;
    box-shadow: 3px 3px 0 #e54e9e;
    margin: 0 6px;
    letter-spacing: 1px;
    margin: 0 6px;
}

button:hover {
    background: rgba(86, 180, 233, 0.5);
    box-shadow: 1px 1px 0 #e54e9e;
    transform: translate(2px, 2px);
}

/* BAYES RECTANGLE */

.sliders {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    justify-content: center;
}
.slider-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-items: center;
    min-width: 0;
}
.slider-group label {
    margin-bottom: 4px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}
.slider-group input[type="range"] {
    width: 150px;
}
.outputs span {
    display: inline-block;
    width: 240px;
    font-weight: bold;
    margin-bottom: 20px;
}
.equation {
    margin-bottom: 10px;
    font-size: 18px;
    text-align: center;
}
.highlight-term {
    font-weight: bold;
    color: #ff83c5;
    cursor: pointer;
}

.bayes-square-container {
    position: relative;
    width: 300px;
    height: 300px;
    border: 1px solid #e54e9e;
    margin-bottom: 20px;
    margin: 0 auto;
}
svg {
    width: 100%;
    height: 100%;
}

.regionAandB {
    fill: #009e73;
    opacity: 0.7;
}
.regionAandNotB {
    fill: #56b4e9;
    opacity: 0.7;
}
.regionNotAandB {
    fill: #f0e442;
    opacity: 0.7;
}
.regionNotAandNotB {
    fill: white;
    opacity: 0.4;
}

.hatch-overlay {
    pointer-events: none;
    mix-blend-mode: multiply;
}

.outline-red rect {
    fill: none;
    stroke: #e54e9e;
    stroke-width: 4;
    display: none;
}
.outline-blue rect {
    fill: none;
    stroke: #0072b2;
    stroke-width: 4;
    display: none;
}

.update-prior-button {
    margin-top: 10px;
    padding: 6px 12px;
    cursor: pointer;
}


#app1 .slider-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
    min-width: 200px;
}

#app1 .slider-group input[type="range"] {
    width: 150px;
    margin: 5px 0;
}

#app1 .slider-group span {
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    color: var(--text-color);
}

/* Posterior container for app1 */
#app1 .posterior-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
}

#app1 .stats {
    max-width: 400px;
    text-align: left;
}

#app1 .stats p {
    margin: 8px 0;
    color: var(--text-color);
}

#app1 .stats span {
    font-weight: bold;
    color: var(--accent-color);
}

/* Button styles that work with your existing theme */
#app1 button {
    display: inline-block;
    background: #00b3ff;
    color: white;
    padding: 8px 22px;
    font-family: "Zen Dots", sans-serif;
    font-size: 12px;
    text-decoration: none;
    border: 2px solid #1a3a5c;
    box-shadow: 3px 3px 0 #1a3a5c;
    transform: skewX(-12deg);
    margin: 0 6px;
    letter-spacing: 1px;
}

#app1 button:hover:not(:disabled) {
    background: #ff6b9d;
    box-shadow: 1px 1px 0 #1a3a5c;
    transform: skewX(-12deg) translate(2px, 2px);
}

#app1 button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Ensure canvas doesn't break layout */
#app1 canvas {
    max-width: 500px;
    min-width: 300px;
}

/* Prior sliders row - side by side layout */
#app1 .prior-sliders-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 15px 0;
    align-items: flex-start;
}

#app1 .prior-sliders-row .slider-group {
    min-width: 180px;
    margin: 0;
}

/* Ensure the alpha/beta sliders display as whole numbers */
#app1 .slider-group input[type="range"] {
    width: 150px;
    margin: 5px 0;
}

#app1 .slider-group span {
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    color: var(--text-color);
}


/* Bayesian Card Game */

.bg-app {
  font-family: "Comic Sans MS", "DotGothic16", cursive;
  max-width: 820px;
  margin: 20px auto;
  padding: 20px;
  background: transparent;
  color: #2a2540;
  position: relative;
  overflow: hidden;
  border: 2px solid #7fcfff;
}
.bg-app * { box-sizing: border-box; }
.bg-app h2 {
  margin: 0 0 12px 0; font-weight: 700; letter-spacing: 0.3px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.bg-app .bg-controls {
  background: rgba(255,255,255,0.6);
  padding: 14px; margin-bottom: 14px;
}
.bg-app .bg-row { display: inline-block; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.bg-app label { font-weight: 600; min-width: 110px; }
.bg-app select, .bg-app button {
  padding: 8px 14px; border: none;
  font-weight: 600; font-size: 14px; cursor: pointer; background: white;
  color: #2a2540;
}
.bg-app button.primary {
  display: inline-block;
    background: #00b3ff;
    color: white;
    padding: 8px 22px;
    font-family: "Zen Dots", sans-serif;
    font-size: 12px;
    text-decoration: none;
    border: 2px solid #1a3a5c;
    box-shadow: 3px 3px 0 #1a3a5c;
    transform: skewX(-12deg);
    margin: 0 6px;
    letter-spacing: 1px;
}
.bg-app button.primary:hover {
    background: #ff6b9d;
    box-shadow: 1px 1px 0 #1a3a5c;
    transform: skewX(-12deg) translate(2px, 2px);
}
.bg-app button:disabled { opacity: 0.5; cursor: not-allowed; }
.bg-app .bg-mode-toggle { display: inline-flex; background: white; padding: 3px; }
.bg-app .bg-mode-toggle button { background: transparent; box-shadow: none; padding: 6px 16px; font-size: 13px; }
.bg-app .bg-mode-toggle button.active { background: #00b3ff; color: white; }
.bg-app .bg-cards { 
    background: linear-gradient(135deg, #ffb3d9 0%, #7fcfff 50%, #ffb3d9 100%);
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 18px 0; 
}
.bg-app .bg-card {
  aspect-ratio: 0.8; 
  background: linear-gradient(135deg, #cfe9ff 0%, #9ccef5 100%);
  position: relative; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(50,80,140,0.2);
  transform: rotateY(180deg) scale(0.7); opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s, box-shadow 0.3s; 
  margin: 20px;
}
.bg-app .bg-card.shown { transform: rotate(-10deg) scale(1); opacity: 1; }
.bg-app .bg-card.placeholder { opacity: 0.25; transform: rotate(-10deg); }
.bg-app .bg-card.gold {
  background: linear-gradient(135deg, #fff2b0 0%, #ffd24a 50%, #f3a800 100%);
}
.bg-app .bg-card-halo { width: 45%; height: 100%; border: 3px solid rgba(50,80,140,0.55); border-radius: 50%; position: absolute; transform: rotateX(70deg); }
.bg-app .bg-card.gold .bg-card-halo { border-color: rgba(140,90,0,0.6); }
.bg-app .bg-card-star { position: absolute; width: 90%; height: 65%; background: rgba(50,80,140,0.4);
  clip-path: polygon(
    50% 0%,     /* top point */
    50% 48%,    /* inner right-top */
    100% 50%,   /* right point */
    50% 50%,    /* inner right-bottom */
    50% 100%,   /* bottom point */
    48% 50%,    /* inner left-bottom */
    0% 50%,     /* left point */
    48% 48%     /* inner left-top */
  );
}
.bg-app .bg-card.gold .bg-card-star { background: rgba(140,90,0,0.55); }
.bg-app .bg-card-band { position: absolute; bottom: 0%; left: 0%; right: 0%; height: 100%; box-sizing: border-box; container-type: inline-size;
  background: 
    linear-gradient(to bottom, 
      rgba(255,255,255,1) 0%, 
      rgba(255,255,255,1) 20%, 
      transparent 20%, 
      transparent 80%, 
      rgba(255,255,255,1) 80%, 
      rgba(255,255,255,1) 100%
    ),
    linear-gradient(to right, 
      rgba(255,255,255,1) 0%, 
      rgba(255,255,255,1) 10%, 
      transparent 10%, 
      transparent 90%, 
      rgba(255,255,255,1) 90%, 
      rgba(255,255,255,1) 100%
    );
  background-clip: border-box; }
/* .bg-app .bg-card.gold .bg-card-band { border-top-color: rgba(140,90,0,0.4); border-bottom-color: rgba(140,90,0,0.4); } */
.bg-app .bg-status { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; background: rgba(255,255,255,0.6); padding: 10px 14px; font-size: 14px; flex-wrap: wrap; }
.bg-app .bg-status strong { color: #00b3ff; }
.bg-app .bg-posterior { background: rgba(255,255,255,0.7);  padding: 14px; margin-top: 14px; }
.bg-app .bg-bar-row { display: grid; grid-template-columns: 42px 1fr 60px; gap: 8px; align-items: center; margin: 3px 0; font-size: 13px; }
.bg-app .bg-bar-bg { background: rgba(0,0,0,0.07); height: 14px; overflow: hidden; }
.bg-app .bg-bar-fill { height: 100%; background: linear-gradient(90deg, #6ec5ff, #b173e8); transition: width 0.5s ease; }
.bg-app .bg-bar-fill.max { background: linear-gradient(90deg, #ffb74d, #ff7043); }
.bg-app .bg-reveal { background: rgba(255,255,255,0.8); padding: 14px; margin-top: 14px; }
.bg-app table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bg-app th, .bg-app td { padding: 6px 8px; text-align: center; border-bottom: 1px solid rgba(0,0,0,0.08); }
.bg-app th { background: rgba(140, 90, 200, 0.15); font-weight: 700; }
.bg-app td.correct { background: rgba(120, 220, 130, 0.28); }
.bg-app td.wrong { background: rgba(255, 140, 140, 0.25); }
.bg-app .bg-final { text-align: center; padding: 18px; font-size: 17px; font-weight: 700;
  margin-bottom: 12px;
}
.bg-app .bg-hint { font-size: 12px; opacity: 0.75; margin-top: 6px; }