
/* ===== General Styles ===== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  background: #f0f4f8;
  color: #333;
  transition: background 0.3s, color 0.3s, font-family 0.3s;
}

h1, h2 {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: bold;
  text-align: center;
  margin-bottom: 15px;
}

p { margin-bottom: 10px; }

/* ===== Header ===== */
header {
  background: linear-gradient(90deg, #005bbb, #00c6ff);
  color: white;
  padding: 25px 20px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
header nav a {
  margin: 0 15px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}
header nav a:hover {
  color: #ffea00;
  text-shadow: 0 0 5px #ffea00;
}

/* ===== Toolbar ===== */
#toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px;
  background: #ffffff;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border-radius: 12px;
  margin: 15px;
}
#toolbar button, #toolbar select {
  padding: 8px 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s, background 0.2s;
}
#toolbar button:hover, #toolbar select:hover {
  transform: translateY(-2px);
  background: #e0f7ff;
}

/* ===== Sections ===== */
section {
  padding: 25px;
  margin: 20px auto;
  background: linear-gradient(145deg, #ffffff, #f9f9f9);
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  max-width: 900px;
  transition: transform 0.3s;
}
section:hover {
  transform: translateY(-3px);
}

/* ===== Buttons ===== */
button {
  background: #005bbb;
  color: white;
  padding: 8px 15px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
button:hover {
  background: #00c6ff;
  transform: translateY(-2px);
}

/* ===== Maze Game ===== */
#mazeContainer {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  width: 300px;
  height: 300px;
  border-radius: 12px;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.maze-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: bold;
  transition: background 0.3s;
}
.wall { background: #333; border-radius: 4px; }
.player { background: #005bbb; color: white; border-radius: 6px; }
.finish { background: #28a745; color: white; border-radius: 6px; }

/* ===== Memory Game ===== */
#memoryGame {
  display: grid;
  grid-template-columns: repeat(4, 90px);
  gap: 15px;
  justify-content: center;
}
.memory-card {
  width: 90px;
  height: 90px;
  background: #005bbb;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  font-size: 28px;
  font-weight: bold;
  transition: transform 0.2s, background 0.3s;
}
.memory-card:hover { transform: scale(1.05); background: #00c6ff; }

/* ===== Quiz Box ===== */
#quizBox {
  margin: 15px auto;
  padding: 15px;
  border: 2px dashed #005bbb;
  border-radius: 12px;
  max-width: 500px;
  background: #f0f8ff;
  text-align: center;
}

/* ===== Stories ===== */
#storyForm textarea {
  width: 100%;
  height: 90px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid #ccc;
  padding: 8px;
  font-size: 16px;
  transition: border 0.3s;
}
#storyForm textarea:focus {
  border-color: #005bbb;
  outline: none;
}

/* ===== Links ===== */
a {
  color: #005bbb;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}
a:hover { color: #00c6ff; text-decoration: underline; }

/* ===== Footer ===== */
footer {
  background: linear-gradient(90deg, #005bbb, #00c6ff);
  color: white;
  text-align: center;
  padding: 15px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  margin-top: 20px;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.15);
}

/* ===== Contrast Modes ===== */
body.high-contrast {
  background: black !important;
  color: yellow !important;
}
body.deuteranopia {
  filter: contrast(1.2) saturate(0.8);
}
body.tritanopia {
  filter: contrast(1.2) saturate(0.8) hue-rotate(45deg);
}

/* ===== Dyslexia & Font ===== */
body.opendyslexic { font-family: 'OpenDyslexic', Arial, sans-serif; }
body.arial { font-family: Arial, Helvetica, sans-serif; }
