	#dale-root {
		  position: relative;
		  width: 100%;
		  height: 100%;
		  overflow: hidden;
		  background: #dfd2c0;
		}
	
		#renderCanvas {
		  width: 100%;
		  height: 100%;
		  display: block;
		  opacity: 0;
		  pointer-events: none;
		  transition: opacity 0.35s ease;
		}

		#dale-root.dale-ready #renderCanvas {
		  opacity: 1;
		  pointer-events: auto;
		}

		#kidale-dale-loader {
		  position: absolute;
		  inset: 0;
		  z-index: 1000000;
		  display: flex;
		  align-items: center;
		  justify-content: center;
		  padding: 24px;
		  background:
		    radial-gradient(circle at 50% 30%, rgba(255,255,255,0.78), rgba(223,210,192,0.9) 42%, rgba(126,90,66,0.55)),
		    #dfd2c0;
		  color: #183138;
		  text-align: center;
		  transition: opacity 0.28s ease, visibility 0.28s ease;
		}

		#dale-root.dale-ready #kidale-dale-loader {
		  opacity: 0;
		  visibility: hidden;
		  pointer-events: none;
		}

		.kidale-dale-loader-card {
		  width: min(420px, 92vw);
		  padding: clamp(22px, 4vw, 34px);
		  border: 1px solid rgba(255,255,255,0.55);
		  border-radius: 28px;
		  background: rgba(255,255,255,0.62);
		  box-shadow: 0 24px 70px rgba(60,39,27,0.24);
		  backdrop-filter: blur(12px);
		}

		.kidale-dale-loader-orb {
		  width: 74px;
		  height: 74px;
		  margin: 0 auto 18px;
		  border-radius: 50%;
		  background:
		    radial-gradient(circle at 35% 30%, #fff8d7, #ffcc4d 38%, #5ec8d8 72%, #1c6571);
		  box-shadow: 0 0 0 8px rgba(255,255,255,0.24), 0 14px 30px rgba(28,101,113,0.28);
		  animation: kidale-loader-breathe 1.4s ease-in-out infinite;
		}

		.kidale-dale-loader-title {
		  font-size: clamp(20px, 3vw, 30px);
		  line-height: 1.15;
		  font-weight: 800;
		  margin-bottom: 10px;
		}

		.kidale-dale-loader-status {
		  font-size: clamp(14px, 1.7vw, 17px);
		  line-height: 1.45;
		  color: rgba(24,49,56,0.74);
		}

		#dale-root.dale-load-error #kidale-dale-loader {
		  background: linear-gradient(135deg, #fff2ec, #f7d8cf);
		}

		#dale-root.dale-load-error .kidale-dale-loader-orb {
		  background: radial-gradient(circle at 35% 30%, #fff, #ff9f85 44%, #b93827);
		  animation: none;
		}

		@keyframes kidale-loader-breathe {
		  0%, 100% { transform: scale(1); opacity: 0.82; }
		  50% { transform: scale(1.08); opacity: 1; }
		}
	
		 #siderenios {
			  position: fixed;
			  bottom: 20px;
			  left: 20px;
			  width: 260px;
			  z-index: 30;
			  pointer-events: none;
			  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
			}
	
			#board {
			  position: fixed;
			  inset: 0;
			  overflow: auto;
			  background: #deb8e7;
			  padding: clamp(14px, 2vw, 28px);
			  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
			}
			/* Περιοχή περιεχομένου */
			#board-content {
			  width: min(920px, 92vw);
			  margin: 0 auto;
			  display: grid;
			  gap: clamp(10px, 1.6vw, 18px);
			}
			#board-content h1,
			#board-content h2 {
			  margin: 0;
			  line-height: 1.15;
			  font-weight: 800;
			  font-size: clamp(22px, 3.2vw, 40px);
			}
			#board-content p,
			#board-content .intro {
			  margin: 0;
			  line-height: 1.6;
			  font-size: clamp(15px, 1.5vw, 20px);
			  color: #222;
			}
			/* Bullets */
			#board-content ul {
			  margin: 0;
			  padding-left: 1.15em;
			}
			#board-content li {
			  line-height: 1.55;
			  margin: 0.25em 0;
			  font-size: clamp(15px, 1.45vw, 19px);
			}
			/* Εικόνες */
			#board-content img {
			  width: 100%;
			  max-height: 35vh;
			  object-fit: contain;
			  border-radius: 14px;
			  background: rgba(145, 17, 17, 0.671);
			}
			/* “Dense mode” (θα μπαίνει από JS όταν δεν χωράει) */
			#board.dense #board-content h1,
			#board.dense #board-content h2 {
			  font-size: clamp(18px, 2.4vw, 30px);
			}
			#board.dense #board-content p,
			#board.dense #board-content li,
			#board.dense #board-content .intro {
			  font-size: clamp(13px, 1.25vw, 16px);
			  line-height: 1.45;
			}
	
			.board-bullets {
			  width: 100%;
			  max-width: 720px;
			  margin: 0 auto;
			  display: flex;
			  flex-direction: column;
			  gap: 16px;
			}
			.board-bullets h2 {
			  font-size: clamp(22px, 4vw, 40px);
			  margin: 0;
			}
	
			/* Intro */
			.board-bullets .intro {
			  font-size: clamp(14px, 2.2vw, 18px);
			  color: #333;
			}
	
			.board-bullets ul {
			  padding-left: 20px;
			  margin: 0;
			}
	
			.board-bullets li {
			  font-size: clamp(15px, 2vw, 18px);
			  line-height: 1.6;
			  margin-bottom: 8px;
			} 
	
			/* Τίτλος */
			.board-image h2 {
			  font-size: clamp(22px, 4vw, 40px);
			  line-height: 1.2;
			  margin: 0;
			}
	
			/* Εικόνα */
			.board-image img {
			  width: 100%;
			  max-height: 35vh;      /* 👈 ΕΔΩ το “μέχρι τη μέση” */
			  object-fit: contain;  /* δεν κόβεται */
			  border-radius: 12px;
			  background: #000000ad;
			}
	
			/* Caption */
			.board-image .caption {
			  font-size: clamp(14px, 2.2vw, 18px);
			  line-height: 1.6;
			  color: #222;
			}
			.board-markup-blue { color: #135fbd; font-weight: 700; }
			.board-markup-red { color: #b42318; font-weight: 700; }
			.board-markup-green { color: #16794a; font-weight: 700; }
			.board-markup-purple { color: #7627a8; font-weight: 700; }
			.board-lesson-final {
			  width: 100%;
			  max-width: 860px;
			  margin: 0 auto;
			  display: grid;
			  gap: 12px;
			}
			.board-lesson-final ul {
			  margin: 0;
			  padding-left: 22px;
			}
			.board-lesson-final img {
			  width: 100%;
			  max-height: 42vh;
			  object-fit: contain;
			  border-radius: 12px;
			  background: #ffffff;
			}
			.board-lesson-final .caption {
			  font-size: clamp(13px, 1.6vw, 17px);
			  line-height: 1.45;
			  color: #222;
			}
			.board-lesson-step {
			  width: 100%;
			  display: grid;
			  gap: clamp(10px, 1.5vw, 18px);
			  align-content: start;
			}
			.board-lesson-step + .board-lesson-step {
			  border-top: 1px solid rgba(40, 20, 50, 0.22);
			  padding-top: clamp(12px, 1.8vw, 22px);
			}
			.board-lesson-statement {
			  display: grid;
			  gap: 10px;
			  padding: clamp(12px, 1.8vw, 22px);
			  border-radius: 14px;
			  background: rgba(255, 255, 255, 0.38);
			}
			.board-lesson-statement p {
			  white-space: pre-wrap;
			}
			.board-lesson-attention {
			  padding: clamp(12px, 1.6vw, 20px);
			  border-left: 5px solid #b42318;
			  border-radius: 10px;
			  background: rgba(255, 245, 242, 0.72);
			}
			.board-lesson-attention h3 {
			  margin: 0 0 0.55em;
			  font-weight: 800;
			}
			.board-lesson-step .math-formula {
			  overflow-x: auto;
			  padding: 0.65em;
			  font-size: clamp(18px, 2.2vw, 30px);
			}
			.board-inline-math {
			  display: inline-block;
			  margin: 0 0.12em;
			  vertical-align: -0.08em;
			}
			.board-lesson-step img {
			  width: 100%;
			  max-height: 42vh;
			  object-fit: contain;
			  background: rgba(255, 255, 255, 0.45);
			}
			#mic-btn {
			  position: fixed;
			  bottom: 24px;
			  right: 170px;
	
			  width: 220px;
			  height: 80px;
	
			  z-index: 0;               /* αρχικά κρυφό */
			  pointer-events: none;     /* δεν πιάνει click */
	
			  background: #2b7cff;
			  color: white;
			  border: none;
			  border-radius: 12px;
	
			  font-size: 16px;
			  font-weight: 600;
			  text-align: center;
	
			  padding: 12px;
			  cursor: pointer;
	
			  opacity: 0;
			  transition: opacity 0.25s ease, transform 0.25s ease;
			}
	
			/* Όταν είναι ενεργό */
			#mic-btn.active {
			  z-index: 999;
			  pointer-events: auto;
			  opacity: 1;
			  transform: scale(1);
			}
	
			/* Όταν γράφει */
			#mic-btn.recording {
			  background: #e53935;
			  box-shadow: 0 0 16px rgba(229, 57, 53, 0.9);
			}
			@media (max-width: 768px) {
			  .board-image {
				max-width: 100%;
			  }
			  #board {
				padding: 16px;
			  }
			  }
			/* Stage: πάντα πάνω από board */
			#stage{
			  position: fixed;
			  inset: 0;
			  z-index: 20;
			  transition: all 0.6s ease;
			  /* για να μη βλέπεις “λευκά” λόγω canvas sizing */
			  background: #dfd2c0;
			}
	
			body.board-active #stage {
			  transform:
				translate(
				  calc(100vw - 25vw - 20px),
				  calc(100vh - 40vh - 20px),
				)
				scale(0.1);
			}
	
			body.board-active #board {
			  opacity: 1;
			  pointer-events: auto;
			}
			#siderenios img {
			  width: 100%;
			  height: auto;
			  display: block;
			}
			#siderenios .audio-overlay {
			  position: absolute;
			  inset: 0;
			  background: rgba(0, 140, 255, 0.25);
			  opacity: 0;
			  pointer-events: none;
			}
	
			#siderenios .audio-overlay.active {
			  animation: sidereniosPulse 0.8s infinite;
			  opacity: 1;
			}
			body.board-active #ui-layer {
			  grid-template-columns: 40% 360px;
			}
	
			body.board-active #stage {
			  transform: scale(0.3);
			  transform-origin: right bottom;
			}
	
			@keyframes sidereniosPulse {
			  0%   { opacity: 0.2; }
			  50%  { opacity: 0.5; }
			  100% { opacity: 0.2; }
			}
			#user-input-overlay {
			  position: fixed;
			  inset: 0;
			  background: rgba(88, 8, 149, 0.482);
			  z-index: 980;
	
			  display: flex;
			  align-items: center;
			  justify-content: center;
			  padding: 24px 16px 120px;
			}
	
		#user-input-overlay.hidden {
		  display: none;
		}
	
		.ui-card {
			background: #d09bdb;
			width: min(560px, 94vw);
			height: auto;
			max-height: min(560px, 68vh);
			padding: 16px;
			border: 1px solid rgba(255, 255, 255, 0.16);
			border-radius: 8px;
			box-shadow: inset 1px 14px 19px 7px rgba(0, 0, 0, 0.35);
			display: flex;
			flex-direction: column;
			gap: 12px;
			overflow: hidden;
		}
	
		.ui-card h3 {
		  margin: 0;
		  text-align: center;
		  color: #fff;
		  font-size: 18px;
		  line-height: 1.25;
		}
	
		.options {
		  display: grid;
		  gap: 10px;
		  overflow-y: auto;
		  min-height: 0;
		  padding-right: 8px;
		  scrollbar-width: thin;
		  scrollbar-color: rgba(255, 255, 255, 0.45) transparent;
		}

		.options::-webkit-scrollbar {
		  width: 8px;
		}

		.options::-webkit-scrollbar-thumb {
		  background: rgba(255, 255, 255, 0.38);
		  border-radius: 999px;
		}

		#kidale-composer {
		  position: fixed;
		  left: 16px;
		  right: 16px;
		  bottom: 16px;

		  display: flex;
		  align-items: flex-end;
		  gap: 8px;

		  padding: 10px;
		  background: rgba(163, 7, 230, 0.92);
		  border: 1px solid rgba(255, 255, 255, 0.14);
		  border-radius: 8px;
		  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);

		  z-index: 1000;
		}

		#kidale-composer.hidden {
		  display: none;
		}

		#kidale-composer textarea {
		  flex: 1;
		  min-height: 44px;
		  max-height: 120px;

		  resize: vertical;
		  padding: 10px 12px;

		  border-radius: 16px;
		  border: 1px solid rgba(255, 255, 255, 0.18);
		  background: #fff;
		  color: #111;
		}

		#kidale-composer button {
			width: 46px;
			height: 44px;
			border-radius: 10px;
			border: 1px solid rgba(255,255,255,0.25);
			background: linear-gradient(180deg, #8e7cf6, #1f2ed1);
			color: white;
			font-weight: 800;
			font-size: 24px;
			line-height: 1;
			cursor: pointer;
			box-shadow:
				inset 0 1px 0 rgba(255,255,255,0.35),
				0 4px 0 #174f96,
				0 8px 14px rgba(0,0,0,0.35);
			transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
		}
		#kidale-composer button:hover {
			filter: brightness(1.08);
			transform: translateY(-1px);
			box-shadow:
				inset 0 1px 0 rgba(255,255,255,0.4),
				0 5px 0 #174f96,
				0 10px 16px rgba(0,0,0,0.4);
		}

		#kidale-composer button:active {
			transform: translateY(3px);
			box-shadow:
				inset 0 1px 0 rgba(255,255,255,0.25),
				0 1px 0 #174f96,
				0 4px 8px rgba(0,0,0,0.35);
		}

		#kidale-composer-send {
			min-width: 76px;
			background: linear-gradient(180deg, #62d66b, #2f9e44);
			box-shadow:
				inset 0 1px 0 rgba(255,255,255,0.35),
				0 4px 0 #1f6f31,
				0 8px 14px rgba(0,0,0,0.35);
		}

		#kidale-composer-mic.recording {
			background: linear-gradient(180deg, #ff6b65, #d92828);
			box-shadow:
				inset 0 1px 0 rgba(255,255,255,0.35),
				0 4px 0 #941818,
				0 0 16px rgba(229,57,53,0.9);
		}

		#kidale-composer-attach.loading {
		  opacity: 0.65;
		  cursor: wait;
		}

		#kidale-composer button:disabled,
		#kidale-composer textarea:disabled {
		  opacity: 0.62;
		  cursor: wait;
		}

		.kidale-attach-modal {
		  position: fixed;
		  inset: 0;
		  z-index: 1200;
		  display: flex;
		  align-items: center;
		  justify-content: center;
		  padding: 16px;
		  background: rgba(0, 0, 0, 0.48);
		}

		.kidale-attach-modal.hidden {
		  display: none;
		}

		.kidale-attach-box {
		    width: min(460px, 94vw);
			background: rgb(69 40 83 / 98%);
			color: #fff;
			border: 1px solid rgba(255, 255, 255, 0.16);
			border-radius: 8px;
			box-shadow: inset 0 22px 56px rgb(187 64 217 / 42%);
			padding: 14px;
		}

		.kidale-attach-header {
		  display: flex;
		  align-items: center;
		  justify-content: space-between;
		  gap: 12px;
		  margin-bottom: 12px;
		}

		.kidale-attach-header h3 {
		  margin: 0;
		  font-size: 17px;
		  line-height: 1.25;
		}

		.kidale-attach-close {
		  width: 36px;
		  height: 36px;
		  border: 0;
		  border-radius: 8px;
		  background: rgba(255, 255, 255, 0.12);
		  color: #fff;
		  font-size: 22px;
		  cursor: pointer;
		}

		.kidale-attach-source {
		  display: grid;
		  grid-template-columns: 1fr 1fr;
		  gap: 10px;
		}

		.kidale-attach-source button,
		.kidale-attach-submit {
		  min-height: 42px;
		  border: 0;
		  border-radius: 8px;
		  background: #2f7dd1;
		  color: #fff;
		  font-weight: 700;
		  cursor: pointer;
		}

		.kidale-attach-instructions {
		  display: grid;
		  gap: 10px;
		}

		.kidale-attach-file-name {
		  color: rgba(255, 255, 255, 0.78);
		  font-size: 13px;
		  overflow: hidden;
		  text-overflow: ellipsis;
		  white-space: nowrap;
		}

		.kidale-attach-instructions textarea {
		  width: 100%;
		  box-sizing: border-box;
		  min-height: 86px;
		  resize: vertical;
		  padding: 10px 12px;
		  border-radius: 8px;
		  border: 1px solid rgba(255, 255, 255, 0.18);
		}

		.kidale-attach-presets {
		  display: flex;
		  flex-wrap: wrap;
		  gap: 8px;
		}

		.kidale-attach-presets button {
		  border: 1px solid rgba(255, 255, 255, 0.16);
		  border-radius: 8px;
		  background: rgba(255, 255, 255, 0.1);
		  color: #fff;
		  padding: 8px 10px;
		  cursor: pointer;
		}

		.kidale-attach-submit {
		  background: #43a047;
		}

		.kidale-attach-processing {
		  display: grid;
		  justify-items: center;
		  gap: 10px;
		  padding: 18px 10px 12px;
		  text-align: center;
		}

		.kidale-attach-processing.hidden {
		  display: none;
		}

		.kidale-attach-spinner {
		  width: 34px;
		  height: 34px;
		  border-radius: 50%;
		  border: 4px solid rgba(255, 255, 255, 0.24);
		  border-top-color: #40c4ff;
		  animation: kidale-spin 0.9s linear infinite;
		}

		.kidale-attach-processing-title {
		  font-size: 18px;
		  font-weight: 800;
		}

		.kidale-attach-processing-text {
		  max-width: 360px;
		  color: rgba(255, 255, 255, 0.82);
		  font-size: 14px;
		  line-height: 1.45;
		}

		.kidale-attach-modal-busy .kidale-attach-close {
		  opacity: 0.4;
		  cursor: wait;
		}

		@keyframes kidale-spin {
		  to {
		    transform: rotate(360deg);
		  }
		}

		.hidden {
		  display: none;
		}
		.choice-card {
		  display: flex;
		  align-items: center;
		  gap: 12px;
		  padding: 10px;
		  margin: 8px 0;
		  background: #1e1e1e;
		  border-radius: 8px;
		  cursor: pointer;
		  transition: transform 0.15s ease, background 0.2s;
		}
	
		.choice-card:hover {
		  background: #2a2a2a;
		  transform: scale(1.02);
		}
	
		.choice-thumb {
		  width: 64px;
		  height: 64px;
		  object-fit: cover;
		  border-radius: 8px;
		}
	
		.choice-text-wrap {
		  display: flex;
		  flex-direction: column;
		  min-width: 0;
		}
	
		.choice-label {
		  font-size: 14px;
		  color: white;
		  font-weight: 600;
		}
	
		.choice-icon {
		  width: 64px;
		  height: 64px;
		  display: flex;
		  align-items: center;
		  justify-content: center;
		  font-size: 24px;
		  background: #333;
		  border-radius: 8px;
		}
		.choice-details {
		  color: #bdbdbd;
		  font-size: 12px;
		  margin-top: 4px;
		  line-height: 1.3;
		}
		#kidale-skip-btn {
		  position: fixed;
		  bottom: 20px;
		  right: 20px;
		  z-index: 99;
	
		  background: #ffcc00;
		  border: none;
		  padding: 10px 14px;
		  border-radius: 8px;
		  font-weight: bold;
		}
	
		#start-dale {
		  position: fixed; /* 🔥 αυτό είναι το σημαντικό */
	
		  bottom: 50px;
		  left: 50%;
		  transform: translateX(-50%);
	
		  padding: 16px 28px;
		  font-size: 18px;
		  font-weight: 600;
	
		  border: none;
		  border-radius: 14px;
	
		  background: linear-gradient(135deg, #4facfe, #00f2fe);
		  color: white;
	
		  cursor: pointer;
		  background: rgba(0, 200, 255, 0.9);
		  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
	
		  transition: all 0.2s ease;
	
		  z-index: 999999; /* 🔥 ποτέ ξανά hidden */
		}
	
		/* hover */
		#start-dale:hover {
		  transform: translateX(-50%) scale(1.05);
		}
	
		/* click */
		#start-dale:active {
		  transform: translateX(-50%) scale(0.96);
		}
	
		/* hide */
		#start-dale.hidden {
		  display: none;
		}
	
		@media (max-width: 768px) {
		  #start-dale {
			bottom: 50px;   /* 🔥 αντί για 250 */
			width: 80%;
			font-size: 16px;
		  }
		}
		#captions {
		  position: fixed;
		  left: 5px;
			right: 5px;
		  bottom: 340px;
		  /*transform: translateX(-50%);*/
	
		  display: flex;
		  align-items: center;
		  gap: 12px;
	
		  /*max-width: 100%;*/
		  padding: 10px 16px;
	
		  border-radius: 16px;
		  background: rgba(0,0,0,0.65);
		  color: white;
	
		  font-size: 16px;
		  line-height: 1.4;
	
		  z-index: 30;
		}
	
		#caption-avatar {
		  width: 36px;
		  height: 36px;
		  border-radius: 50%;
		  object-fit: cover;
		}
	
		#caption-text {
		  flex: 1;
		}
	
		#captions {
		  transition: all 0.2s ease;
		}
	@media (max-width: 768px) {
	
	  #siderenios img {
	    position: absolute;
	    bottom: 10px;
	    left: 10px;
	    width: 220px;
	    height: auto;
	    z-index: 1001;
	  }

	}
.board-video-wrapper {
    width: 100%;
    height: 100%;
}

#board-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#story-controls {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);

  display: flex;
  gap: 12px;

  z-index: 9999;
}

#story-controls button {
  width: 48px;
  height: 48px;

  border: none;
  border-radius: 50%;

  background: rgba(0,0,0,0.65);
  color: white;

  font-size: 20px;
  cursor: pointer;

  backdrop-filter: blur(6px);
}

#story-controls button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.hidden {
  display: none !important;
}

.kidale-login-modal.hidden {
  display: none !important;
}

.kidale-login-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.65);

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;
}

.kidale-login-box {
  max-width: 420px;
  width: 100%;

  background: white;
  color: #222;

  border-radius: 18px;
  padding: 24px;

  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.kidale-login-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.kidale-btn.secondary {
  opacity: 0.75;
}

.kidale-profile-modal.hidden {
  display: none !important;
}

.kidale-profile-chip {
  position: fixed;
  top: 1px;
  left: 1px;
  z-index: 100002;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  max-width: 170px;
  padding: 0 9px 0 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  overflow: hidden;
  color: #fff;
  background: rgba(18, 20, 38, 0.66);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  font: inherit;
  line-height: 1;
}

.kidale-profile-chip:hover {
  background: rgba(30, 34, 62, 0.78);
}

.kidale-profile-chip-avatar {
  width: 34px;
  height: 34px;
  border-radius: 0;
  object-fit: cover;
  flex: 0 0 auto;
  display: block;
  margin: 0;
}

.kidale-profile-chip-name {
  max-width: 88px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.kidale-profile-chip-flag {
  font-size: 16px;
  line-height: 1;
  flex: 0 0 auto;
}

.kidale-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(7, 10, 24, 0.58);
  backdrop-filter: blur(8px);
}

.kidale-profile-box {
  width: min(520px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 24px;
  padding: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 0%, rgba(124, 92, 255, 0.45), transparent 34%),
    linear-gradient(145deg, rgba(20, 28, 58, 0.96), rgba(14, 18, 36, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
}

.kidale-profile-box h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 4vw, 30px);
}

.kidale-profile-box p {
  margin: 0 0 18px;
  opacity: 0.86;
  line-height: 1.45;
}

.kidale-profile-field,
.kidale-profile-check {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  font-size: 14px;
}

.kidale-profile-field input,
.kidale-profile-field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  color: #111827;
  background: rgba(255, 255, 255, 0.94);
  font-size: 16px;
}

.kidale-profile-check {
  grid-template-columns: auto 1fr;
  align-items: start;
  line-height: 1.35;
}

.kidale-profile-check input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.kidale-profile-check a {
  color: #ffd27d;
  font-weight: 800;
}

.kidale-profile-status {
  min-height: 22px;
  margin-top: 10px;
  color: #ffd27d;
  font-size: 14px;
}

.kidale-profile-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 16px;
}

.kidale-profile-slot {
  position: relative;
  display: grid;
  grid-template-rows: 46px auto;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 86px;
  padding: 7px 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.kidale-profile-slot:hover {
  border-color: rgba(255, 210, 125, 0.65);
  background: rgba(255, 255, 255, 0.13);
}

.kidale-profile-slot.selected {
  border-color: #ffd27d;
  box-shadow: 0 0 0 3px rgba(255, 210, 125, 0.2);
}

.kidale-profile-slot.locked {
  opacity: 0.72;
}

.kidale-profile-slot-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.kidale-profile-slot-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.kidale-profile-slot-text {
  min-width: 0;
  max-width: 100%;
  text-align: center;
  line-height: 1.05;
}

.kidale-profile-slot-text strong,
.kidale-profile-slot-text small {
  display: block;
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kidale-profile-slot-text strong {
  font-size: 12px;
  font-weight: 900;
}

.kidale-profile-slot-text small {
  margin-top: 3px;
  opacity: 0.68;
  font-size: 10px;
}

.kidale-profile-slot-lock {
  position: absolute;
  top: 5px;
  left: 5px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #21140a;
  background: #ffd27d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.kidale-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 64px));
  gap: 10px;
  margin-top: 8px;
}

.kidale-avatar-option {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  line-height: 0;
}

.kidale-avatar-option img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}

.kidale-avatar-option:hover {
  border-color: rgba(255, 210, 125, 0.75);
}

.kidale-avatar-option.selected {
  border-color: #ffd27d;
  box-shadow: 0 0 0 3px rgba(255, 210, 125, 0.22);
}

.kidale-avatar-option.locked {
  cursor: pointer;
  opacity: 0.78;
}

.kidale-avatar-lock {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #21140a;
  background: #ffd27d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.kidale-profile-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 14px;
}

.kidale-profile-choices {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.kidale-profile-choice {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  text-align: left;
}

.kidale-profile-choice:hover {
  background: rgba(255, 255, 255, 0.18);
}

.kidale-profile-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, #ffb86b, #7c5cff);
  font-weight: 800;
  font-size: 22px;
}

.kidale-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kidale-profile-choice strong,
.kidale-profile-choice small {
  display: block;
}

.kidale-profile-choice small {
  margin-top: 3px;
  opacity: 0.72;
}

/* News/weather board presentation hook */
.board-image.news-mode {
  text-align: left;
  gap: clamp(8px, 1.2vw, 14px);
}
.board-image.news-mode h2 {
  font-size: clamp(20px, 3vw, 34px);
  line-height: 1.18;
}
.board-image.news-mode img {
  max-height: 30vh;
  object-fit: cover;
}
.board-image.news-mode .caption {
  font-size: clamp(13px, 1.6vw, 17px);
  line-height: 1.45;
}
.board-image.weather-mode img {
  object-fit: contain;
  max-height: 18vh;
}

/* Kidale main navigation */
#kidale-main-menu-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 15000;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(18, 72, 78, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #165f68;
  box-shadow: 0 5px 18px rgba(17, 46, 50, 0.2);
  font: 700 25px/1 Arial, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

#kidale-main-menu-toggle:hover,
#kidale-main-menu-toggle:focus-visible {
  color: #fff;
  background: #167580;
  transform: translateY(-1px);
}

body.admin-bar #kidale-main-menu-toggle {
  top: 50px;
}

.kidale-main-menu {
  position: fixed;
  inset: 0;
  z-index: 16000;
  display: grid;
  place-items: center;
  padding: 20px;
  font-family: Arial, sans-serif;
}

.kidale-main-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 24, 28, 0.68);
  backdrop-filter: blur(5px);
}

.kidale-main-menu-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(680px, calc(100dvh - 40px));
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: #f7faf9;
  color: #102d31;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.34);
}

.kidale-main-menu-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid #d8e3e2;
}

.kidale-main-menu-brand {
  display: block;
  margin-bottom: 5px;
  color: #e35e4e;
  font-size: 11px;
  font-weight: 800;
}

.kidale-main-menu-header h2 {
  margin: 0;
  color: #102d31;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

#kidale-main-menu-close {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #cbd9d7;
  border-radius: 8px;
  background: #fff;
  color: #34585c;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

#kidale-main-menu-close:hover,
#kidale-main-menu-close:focus-visible {
  color: #fff;
  background: #e35e4e;
  border-color: #e35e4e;
}

.kidale-main-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 24px 24px;
}

.kidale-main-menu-item {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 72px;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #d4e0df;
  border-radius: 8px;
  background: #fff;
  color: #153b40;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 3px 10px rgba(18, 56, 61, 0.07);
}

.kidale-main-menu-item:hover,
.kidale-main-menu-item:focus-visible {
  color: #102d31;
  border-color: #6aa9ad;
  background: #eef8f7;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(18, 56, 61, 0.13);
}

.kidale-main-menu-item[aria-disabled="true"] {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.kidale-main-menu-separator {
  grid-column: 1 / -1;
  height: 1px;
  margin: 4px 0;
  background: #d4e0df;
}

.kidale-main-menu-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #dcefee;
  font-size: 23px;
  font-weight: 700;
}

.kidale-main-menu-item.songs .kidale-main-menu-icon {
  background: #ffe1d9;
  color: #a63f32;
}

.kidale-main-menu-item.lesson .kidale-main-menu-icon {
  background: #e8f3ff;
  color: #285ea8;
}

.kidale-main-menu-item.games .kidale-main-menu-icon {
  background: #e3e5fa;
}

.kidale-main-menu-item.quiz .kidale-main-menu-icon {
  background: #fff0bd;
}

.kidale-main-menu-item.jokes .kidale-main-menu-icon {
  background: #dcebd6;
}

.kidale-main-menu-item.subscription .kidale-main-menu-icon {
  background: #eee8ff;
  color: #5d3fb3;
}

.kidale-main-menu-item.join .kidale-main-menu-icon {
  background: #ffe7f3;
  color: #a82f72;
}

.kidale-main-menu-item.tokens .kidale-main-menu-icon {
  background: #fff0bd;
  color: #9a6a00;
}

@media (max-width: 520px) {
  #kidale-main-menu-toggle {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
  }

  body.admin-bar #kidale-main-menu-toggle {
    top: 58px;
  }

  .kidale-main-menu {
    padding: 12px;
  }

  .kidale-main-menu-panel {
    max-height: calc(100dvh - 24px);
  }

  .kidale-main-menu-header {
    padding: 18px 16px 14px;
  }

  .kidale-main-menu-header h2 {
    font-size: 20px;
  }

  .kidale-main-menu-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 16px 18px;
  }

  .kidale-main-menu-item {
    min-height: 58px;
    padding: 8px 10px;
  }

  .kidale-main-menu-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    font-size: 21px;
  }
}


.kidale-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 10, 18, 0.88);
}

.kidale-crop-modal.hidden {
  display: none;
}

.kidale-crop-box {
  width: min(94vw, 820px);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: #17202b;
  color: #fff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}

.kidale-crop-message {
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
}

.kidale-crop-stage {
  position: relative;
  width: fit-content;
  max-width: 100%;
  max-height: 68vh;
  overflow: hidden;
  line-height: 0;
  touch-action: none;
  user-select: none;
}

.kidale-crop-editor.hidden,
.kidale-crop-review.hidden {
  display: none;
}

.kidale-crop-editor {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.kidale-crop-preview {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.kidale-crop-selection {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: none;
}

.kidale-crop-polygon {
  fill: rgba(79, 209, 255, 0.10);
  stroke: #4fd1ff;
  stroke-width: 6;
  vector-effect: non-scaling-stroke;
}

.kidale-crop-handle {
  fill: #18aeea;
  stroke: #fff;
  stroke-width: 7;
  vector-effect: non-scaling-stroke;
  cursor: grab;
  touch-action: none;
}

.kidale-crop-handle:active {
  cursor: grabbing;
}

.kidale-crop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.kidale-crop-review {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
}

.kidale-crop-review-message {
  text-align: center;
  font-size: 16px;
}

.kidale-crop-review-stage {
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: #0c1118;
}

.kidale-crop-review-preview {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

.kidale-crop-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.kidale-crop-filters button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.kidale-crop-filters button.active {
  border-color: #4fd1ff;
  background: rgba(79, 209, 255, 0.22);
}

.kidale-crop-actions button {
  min-height: 42px;
  padding: 9px 15px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.kidale-crop-actions .primary {
  background: #18aeea;
  color: #fff;
}

.kidale-crop-modal.processing .kidale-crop-stage,
.kidale-crop-modal.processing .kidale-crop-actions button:not([data-action="crop"]) {
  pointer-events: none;
}

.kidale-crop-modal.processing {
  cursor: progress;
}

.kidale-crop-actions button:disabled {
  opacity: 0.7;
  cursor: progress;
}

@media (max-width: 560px) {
  .kidale-crop-box { padding: 12px; }
  .kidale-crop-stage,
  .kidale-crop-preview { max-height: 62vh; }
  .kidale-crop-actions button { flex: 1 1 auto; }
}
