/* Super simple, bare experiment styling inspired by expfactory & jsPsych */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background-color: #f4f4f4;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Minimal Top Bar */
.experiment-header {
  background: #ffffff;
  border-bottom: 1px solid #ccc;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.experiment-header h1 {
  font-size: 16px;
  font-weight: bold;
}

.experiment-header p {
  font-size: 12px;
  color: #666;
}

/* Main Experiment Canvas Container */
.experiment-container {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 25px auto;
  padding: 0 15px;
}

.experiment-box {
  background: #ffffff;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 25px 30px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Headings and Text */
h2 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #111;
}

p {
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  margin-bottom: 15px;
}

/* Buttons */
button, .btn {
  background: #f0f0f0;
  border: 1px solid #888;
  border-radius: 3px;
  padding: 8px 16px;
  font-size: 14px;
  color: #111;
  cursor: pointer;
}

button:hover, .btn:hover {
  background: #e2e2e2;
  border-color: #666;
}

button:disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #2b6cb0;
  color: #ffffff;
  border-color: #2b6cb0;
  font-weight: bold;
}

.btn-primary:hover {
  background: #2c5282;
  border-color: #2c5282;
}

/* Form input */
input[type="text"] {
  padding: 8px 12px;
  font-size: 15px;
  border: 1px solid #999;
  border-radius: 3px;
  outline: none;
}

input[type="text"]:focus {
  border-color: #2b6cb0;
}

/* Flow Indicator */
.step-indicator {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 13px;
  color: #777;
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 10px;
}

.step-indicator span.active {
  font-weight: bold;
  color: #000;
  border-bottom: 2px solid #2b6cb0;
  padding-bottom: 4px;
}

.step-indicator span.done {
  color: #2b6cb0;
}

/* Task Info Header */
.task-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 10px 15px;
  margin-bottom: 20px;
}

.timer-box {
  font-size: 18px;
  font-weight: bold;
  font-family: monospace;
  background: #333;
  color: #fff;
  padding: 4px 10px;
  border-radius: 3px;
}

.timer-box.warning {
  background: #c53030;
}

/* Local Search Stimulus */
.target-word-display {
  text-align: center;
  margin: 25px 0;
  padding: 20px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.target-word-display .word {
  font-size: 38px;
  font-weight: bold;
  color: #2b6cb0;
  letter-spacing: 1px;
}

.input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.input-row input {
  flex: 1;
}

.submissions-list {
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 12px;
  background: #fafafa;
  min-height: 80px;
  margin-bottom: 20px;
}

.submissions-list .title {
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 8px;
}

.submitted-words-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.word-chip {
  background: #ffffff;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 13px;
}

.word-chip.valid {
  background: #e6fffa;
  border-color: #38b2ac;
  color: #234e52;
  font-weight: bold;
}

.word-chip.invalid {
  background: #fff5f5;
  border-color: #feb2b2;
  color: #9b2c2c;
  text-decoration: line-through;
}

/* Tower of London Layout (Bare expfactory style) */
.tol-stage {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  margin: 25px 0;
}

@media (max-width: 700px) {
  .tol-stage {
    flex-direction: column;
    align-items: center;
  }
}

.tol-board-panel {
  background: #fdfdfd;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 15px;
  width: 320px;
  text-align: center;
}

.tol-board-panel.active-panel {
  border-color: #2b6cb0;
}

.tol-panel-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #333;
}

.tol-board {
  position: relative;
  width: 280px;
  height: 220px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tol-pegs-container {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 190px;
  width: 100%;
}

.tol-peg-slot {
  position: relative;
  width: 70px;
  height: 100%;
  display: flex;
  flex-direction: column-reverse; /* Bottom ball at bottom */
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.tol-board-panel:not(.active-panel) .tol-peg-slot {
  cursor: default;
}

/* Brown vertical peg */
.tol-peg-pole {
  position: absolute;
  bottom: 0;
  width: 10px;
  background-color: #8B4513; /* Classic brown peg from expfactory */
  border-radius: 5px 5px 0 0;
  z-index: 1;
}

/* Peg capacities: 1, 2, 3 */
.peg-1 .tol-peg-pole { height: 60px; }
.peg-2 .tol-peg-pole { height: 115px; }
.peg-3 .tol-peg-pole { height: 170px; }

.tol-peg-caption {
  position: absolute;
  bottom: -20px;
  font-size: 11px;
  color: #777;
  font-weight: bold;
}

/* Balls */
.tol-ball-item {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 15px;
  z-index: 2;
  margin-bottom: 2px;
  cursor: pointer;
  border: 2px solid rgba(0,0,0,0.4);
  transition: transform 0.15s ease;
}

/* Balls colors (Black, Grey, White as in CeDEx paper Table 2) */
.ball-color-W {
  background-color: #ffffff;
  color: #111;
  border-color: #888;
}

.ball-color-G {
  background-color: #808080;
  color: #fff;
  border-color: #444;
}

.ball-color-B {
  background-color: #111111;
  color: #fff;
  border-color: #000;
}

/* Selected top ball lifts up directly on the peg (NO HAND BOX) */
.tol-ball-item.lifted {
  transform: translateY(-20px);
  box-shadow: 0 0 0 3px #2b6cb0;
  z-index: 10;
}

.tol-base-bar {
  width: 100%;
  height: 14px;
  background-color: #8B4513; /* Classic brown base from expfactory */
  border-radius: 2px;
  margin-top: 4px;
}

/* Stat row below TOL */
.tol-info-row {
  display: flex;
  justify-content: space-around;
  margin-top: 15px;
  padding: 10px;
  background: #f7fafc;
  border: 1px solid #edf2f7;
  border-radius: 3px;
  font-size: 13px;
}

/* Simple Benchmark Table */
.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.benchmark-table th, .benchmark-table td {
  padding: 10px 12px;
  border: 1px solid #ddd;
  text-align: left;
}

.benchmark-table th {
  background: #f0f4f8;
  color: #333;
}

.benchmark-table tr:nth-child(even) {
  background: #fafafa;
}

/* Simple Dialog Modal */
.simple-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.simple-modal-window {
  background: #ffffff;
  border: 1px solid #999;
  border-radius: 4px;
  width: 90%;
  max-width: 520px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
