/* ====== Global ====== */
body {
  font-family: "Noto Sans Khmer", sans-serif;
  text-align: center;
  background: #111;
  color: #fff;
  margin: 0;
  padding: 20px 0 40px;
}

h2 { margin: 10px 0; }

/* ====== Category Selection Buttons ====== */
#categoryButtons {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.cat-btn {
  background: #222;
  color: #aaa;
  border: 1px solid #444;
  padding: 8px 16px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.cat-btn:hover {
  background: #333;
  color: #fff;
}

.cat-btn.selected-cat {
  background: #00eaff; /* Neon Cyan */
  color: #000;
  font-weight: bold;
  border-color: #00eaff;
  box-shadow: 0 0 8px rgba(0, 234, 255, 0.4);
}

/* ====== Dynamic Content Area ====== */
#dynamicContent {
  margin-bottom: 10px;
  min-height: 60px;
}

/* Section Title style (reused from your original) */
.section-title {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 22px;
  color: #00eaff;
  border-bottom: 1px solid #00eaff;
  display: inline-block;
  padding-bottom: 4px;
}

/* Letter Buttons */
#dynamicContent button {
  min-width: 46px;
  padding: 8px 14px;
  font-size: 20px;
  margin: 4px;
  border-radius: 6px;
  background: #222;
  border: 1px solid #444;
  color: #fff;
  cursor: pointer;
}

#dynamicContent button:hover {
  background: #333;
  border-color: #666;
}

#dynamicContent button.selected {
  background: lime;
  color: black;
  font-weight: bold;
  border-color: lime;
  transform: scale(1.1);
}

/* Back Button (Red) */
.back-btn {
  background: #ff5252 !important;
  color: #000 !important;
  border-color: #ff5252 !important;
  font-weight: bold;
  display: block;
  margin: 0 auto 10px auto;
  max-width: 150px;
}

/* Navigation Controls */
#navControls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.nav-btn {
  background: #444;
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
}
.nav-btn:hover { background: #555; }
.nav-btn:disabled { background: #222; color: #555; cursor: default; }

/* ====== Mode Bar, Canvas, Inputs (Keep original) ====== */
#modeBar {
  margin: 10px auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 640px;
}
#modeBarLabel { font-weight: bold; font-size: 16px; }
.mode-btn {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #555;
  background: #222;
  color: #fff;
  cursor: pointer;
}
.mode-btn:hover { background: #333; }
.mode-btn-selected {
  background: #00e676;
  color: #000;
  border-color: #00e676;
}
#modeStatusText { font-size: 14px; color: #ccc; }

#displayCanvas {
  border: 2px solid #fff;
  border-radius: 8px;
  margin-top: 6px;
}
#recordCanvas, #strokeOnlyCanvas { display: none; }

#indicator { font-size: 20px; margin: 10px; }
#progressContainer {
  width: 320px; height: 12px; background: #333;
  margin: 10px auto; border-radius: 6px; overflow: hidden;
}
#progressBar { height: 100%; width: 0%; background: lime; transition: width 0.3s; }

#langSelect, #userIdInput {
  font-size: 16px; padding: 4px 10px; margin: 4px;
  border-radius: 6px; border: 1px solid #444;
  background: #222; color: #fff;
}

#startBtn { background: #00e676; color: #000; border:none; padding:10px 20px; font-size:18px; border-radius:6px; cursor:pointer; font-weight:bold; margin:5px;}
#startBtn:disabled { background: #2b4f36; color: #777; }
#stopBtn { background: #ff5252; color: #000; border:none; padding:10px 20px; font-size:18px; border-radius:6px; cursor:pointer; font-weight:bold; margin:5px;}
#stopBtn:disabled { background: #4f2b2b; color: #777; }
#clearBtn { background: #40c4ff; color: #000; border:none; padding:10px 20px; font-size:18px; border-radius:6px; cursor:pointer; font-weight:bold; margin:5px;}
#clearBtn:disabled { background: #314a58; color: #777; }

#keyHint { margin-top: 4px; font-size: 13px; color: #ccc; }

/* Modals */
#userIdModalOverlay, #infoModalOverlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none;
  align-items: center; justify-content: center; z-index: 9999;
}
#userIdModal, #infoModal {
  background: #222; border-radius: 10px; padding: 20px; max-width: 320px; width: 90%;
  text-align: left; box-shadow: 0 0 20px rgba(0,0,0,0.7);
}
#infoModal { background: #fff; color: #000; }
#userIdModal h3 { margin: 0 0 8px; font-size: 20px; color: #00eaff; }
#userIdModal p { margin: 4px 0 10px; font-size: 14px; color: #ddd; }
#userIdModalInput { width: 100%; font-size: 16px; padding: 6px; margin: 6px 0 12px; background: #111; color: #fff; border: 1px solid #555; border-radius: 6px;}
#userIdError { color: #ff7675; font-size: 13px; min-height: 16px; }
#userIdModalButtons { display: flex; justify-content: flex-end; gap: 8px; }
.modal-btn-primary { background: #00b894; border: 1px solid #00b894; color: #000; padding: 6px 12px; border-radius: 6px; font-weight: bold; cursor: pointer;}
.modal-btn-secondary { background: #444; border: 1px solid #666; color: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer;}
