:root{
  --bg: #ffffff;
  --text: #111111;
  --muted: #4b4b4b;
  --border: #d7d7d7;

  --point: #D55E00;
  --lsline: #0072B2;
  --mean: #7A7A7A;
  --resid: #4D4D4D;

  --infoBg: #0a1f78;
  --infoText: #ffffff;

  --dangerBg: #b22b2b;
  --dangerBorder: #8f1f1f;

  --radius: 0.5rem;
}

*{ box-sizing: border-box; }
body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

.skipLink{
  position: absolute;
  left: -999px;
  top: 0;
  background: #000;
  color: #fff;
  padding: 0.5rem 0.75rem;
  z-index: 1000;
}
.skipLink:focus{ left: 0.5rem; top: 0.5rem; }

.siteHeader{
  border-bottom: 2px solid #2b2b9b;
  padding: 1rem;
}
.siteHeaderInner{
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 380px);
  gap: 1rem;
}
.siteKicker{ font-weight: 700; color: #1f2b7b; }
.siteTitle{ margin: 0.25rem 0 0; font-size: clamp(1.25rem, 2.2vw, 1.75rem); }

.introText{
  margin-top: 0.75rem;
  color: var(--text);
  max-width: 70ch;
}
.introText p{
  margin: 0.75rem 0;
}

.infoBox{
  background: var(--infoBg);
  color: var(--infoText);
  border-radius: var(--radius);
  padding: 0.875rem;
  font-size: 0.95rem;
}

.app{
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
}

.tabs{
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.tab{
  border: 1px solid var(--border);
  border-bottom: 3px solid transparent;
  background: #f6f6f6;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem 0.5rem 0 0;
  cursor: pointer;
}
.tab[aria-selected="true"]{
  background: #fff;
  border-bottom-color: #2b2b9b;
  font-weight: 700;
}

.workspace{
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 60vh;
}

.sidebar{
  border-right: 2px solid var(--border);
  padding: 1rem;
}
.sectionTitle{
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.statRow{ margin-bottom: 0.75rem; }
.statLabel{ color: var(--muted); font-size: 0.95rem; }
.statValue{ font-size: 2.5rem; font-weight: 800; }

.plotSummary{ color: var(--muted); font-size: 0.95rem; margin: 0.75rem 0 0; }

.fieldset{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin: 0.75rem 0;
}
.fieldset label{ display: block; margin: 0.5rem 0; }

.btnDanger{
  width: 100%;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius);
  border: 2px solid var(--dangerBorder);
  background: var(--dangerBg);
  color: #fff;
  font-weight: 800;
  text-transform: none;
}
.btnDanger:focus{ outline: 3px solid #000; outline-offset: 2px; }

.hint{ color: var(--muted); min-height: 1.2em; }

.plotArea{ padding: 0.5rem; }
.plot{ width: 100%; height: 72vh; min-height: 520px; }
.plotHelp{ margin: 0.5rem; color: var(--muted); font-size: 0.95rem; }

/* Game canvas */
.gameCanvas{
  width: 100%;
  height: 60vh;
  min-height: 360px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #2f8f3a;
  display: block;
  cursor: crosshair;
}
.gameCanvas.isMeasuring{
  cursor: progress;
}

/* sampled values list */
.sampleList{
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafafa;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
}

/* Mobile layout */
@media (max-width: 900px){
  .siteHeaderInner{ grid-template-columns: 1fr; }
  .workspace{ grid-template-columns: 1fr; }
  .sidebar{ border-right: none; border-bottom: 2px solid var(--border); }
  .plot{ height: 65vh; min-height: 420px; }
  .gameCanvas{ height: 55vh; min-height: 320px; }
}

/* Correlation Guessing Game */
/* ( from version 2 BRUH) */

.gameGuessContainer {
  background: #f8f9ff;
  border-radius: 1rem;
  padding: 1rem;
}

.gameGuessHeader {
  margin-bottom: 1rem;
}

.gameGuessRow {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.gamePlotArea {
  flex: 2;
  min-width: 250px;
}

.guessPlot {
  width: 100%;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 0.75rem;
}

.gameControlArea {
  flex: 1;
  min-width: 220px;
  background: #fff;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.difficultySelector {
  margin-bottom: 1.2rem;
}

.difficultySelector select {
  width: 100%;
  padding: 0.4rem;
  margin-top: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.guessInputArea {
  margin: 1.2rem 0;
}

.guessInputArea input {
  width: 100%;
  padding: 0.5rem;
  margin: 0.3rem 0;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

/* Consolidated button styling so the guessing game matches v1lesgoo */
.btnPrimary,
.btnSecondary {
  display: inline-block;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  font-weight: 800;
  cursor: pointer;
}

.btnPrimary {
  background: #2b2b9b;
  color: #fff;
  border: 2px solid #1f1f73;
}

.btnSecondary {
  background: #e9e9e9;
  color: var(--text);
  border: 2px solid var(--border);
}

.btnPrimary:focus,
.btnSecondary:focus {
  outline: 3px solid #000;
  outline-offset: 2px;
}

.guessFeedback {
  background: #f0f0f0;
  padding: 0.6rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
  font-size: 0.95rem;
  border: 1px solid var(--border);
}

.scoreArea {
  background: #e9ecef;
  padding: 0.6rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
  font-weight: bold;
  border: 1px solid var(--border);
}

.panelText{
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: #fff;
}

.textCard{
  max-width: 80ch;
  margin: 0 auto;
}

.textCard h2{
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.textCard p{
  margin: 0.75rem 0;
  color: var(--text);
}

.introText p{
  margin: 0.75rem 0;
}