/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Arial Rounded MT Bold", Arial, sans-serif;
}

/* Body */
body {
  background-color: #f4fbff;
  color: #333;
  text-align: center;
}

/* Header */
.header {
  background-color: #64adff;
  color: white;
  padding: 30px 20px;
}

.header h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.header p {
  font-size: 1.1rem;
}

/* Main */
.main {
  padding: 40px 20px;
  max-width: 900px;
  margin: 0 auto;
}
body[data-difficulty="hard"] .main {
  max-width: 1100px;
}

/* Buttons section */
.buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

/* Maze buttons */
.maze-button {
  display: block;
  width: 220px;
  padding: 25px;
  text-decoration: none;
  border-radius: 20px;
  font-size: 1.2rem;
  color: white;
  transition: transform 0.2s ease;
}

.maze-button span {
  font-size: 0.9rem;
}

/* Difficulty colors */
.easy {
  background-color: #4caf50;
}

.medium {
  background-color: #2196f3;
}

.hard {
  background-color: #f44336;
}

.expert {
  background-color: #8e44ad; /* purple = advanced */
}

body[data-difficulty="expert"] .main {
  max-width: 1200px;
}

/* Hover effect */
.maze-button:hover {
  transform: scale(1.05);
}

/* Info section */
.info h2 {
  font-size: 1.6rem;
  margin-bottom: 15px;
}

.info p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1rem;
}

/* Footer */
.footer {
  margin-top: 50px;
  padding: 15px;
  background-color: #e6f2ff;
  font-size: 0.9rem;
}
.footer-tagline {
  font-weight: bold;
  margin-bottom: 6px;
}

.footer-links a {
  color: #333;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Maze page */
.maze-container {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

/* Controls */
.maze-controls {
  margin-top: 20px;
}

.maze-controls button {
  font-size: 1.1rem;
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  background-color: #4da3ff;
  color: white;
  cursor: pointer;
}

.maze-controls button:hover {
  background-color: #2c8be6;
}

.touch-controls {
  margin-top: 25px;
}

.touch-controls button {
  font-size: 1.5rem;
  padding: 15px;
  margin: 5px;
  border-radius: 15px;
  border: none;
  background-color: #ffcc00;
  cursor: pointer;
}

.touch-controls button:active {
  transform: scale(0.95);
}

.win-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #4caf50;
  color: white;
  padding: 30px 40px;
  border-radius: 20px;
  font-size: 1.5rem;
  z-index: 1000;
  animation: pop 0.5s ease;
}

@keyframes pop {
  0% { transform: translate(-50%, -50%) scale(0.5); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.difficulty-selector {
  margin-top: 20px;
}

.difficulty-selector button {
  padding: 10px 18px;
  margin: 5px;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  max-width: 800px;   /* 👈 wider grid */
  margin: 0 auto;
}

/*progress bar */
.progress-wrapper {
  max-width: 400px;
  margin: 0 auto 25px;
}

.progress-bar {
  background: #ddd;
  border-radius: 10px;
  height: 16px;
  overflow: hidden;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: #4caf50;
  transition: width 0.4s ease;
}

#progressText {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

@media (max-width: 900px) {
  .level-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.level-card {
  background: #e6f2ff;
  border-radius: 15px;
  padding: 15px;
  cursor: pointer;
  font-size: 1.2rem;
}

.level-card.completed {
  background: #c8f7c5;
}

/*--print certificate--*/
.certificate {
  display: none; /* hidden by default */
  /* add your certificate styling here */
  background: #fff;
  padding: 20px;
  border-radius: 15px;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.certificate h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.name-line,
.date-line {
  margin: 10px auto 20px;
  font-size: 1.4rem;
}

.cert-site {
  margin-top: 40px;
  font-weight: bold;
}

.certificate-btn {
  margin-top: 20px;
  font-size: 1.2rem;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  background: #4caf50;
  color: white;
  cursor: pointer;
}

@media print {
  body * {
    visibility: hidden;   /* hide everything else */
  }

  #certificate, #certificate * {
    visibility: visible;  /* show only the certificate */
  }

  #certificate {
    position: absolute;   /* use absolute for print centering */
    top: 50%;             /* vertical center */
    left: 50%;            /* horizontal center */
    transform: translate(-50%, -50%); /* center perfectly */
    box-shadow: none;     /* optional: remove shadows for print */
    max-width: 100%;      /* fit page width */
  }
}


.difficulty-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  color: white;
  font-weight: bold;
  margin: 0 5px;
}

/* Color by difficulty */
.difficulty-easy {
  background: #4caf50;
}

.difficulty-medium {
  background: #2196f3;
}

.difficulty-hard {
  background: #f44336;
}

.teacher-note {
  font-size: 0.9rem;
  margin-top: 15px;
}

.name-input {
  font-size: 1.4rem;
  padding: 8px 12px;
  border: none;
  border-bottom: 2px solid #333;
  outline: none;
  text-align: center;
  margin-bottom: 20px;
  width: 260px;
}
