/* Κωδικοναύτες (code-bots) — Stylesheet */

@font-face {
  font-family: 'Ubuntu Sans';
  font-weight: 400 800;
  src: url('assets/fonts/ubuntu-sans-greek-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Ubuntu Sans';
  font-weight: 400 800;
  src: url('assets/fonts/ubuntu-sans-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}

:root {
  --bg: #06090E;
  --panel: #0F172A;
  --card: #1E293B;
  --border: rgba(56, 189, 248, 0.25);
  --primary: #38BDF8;
  --indigo: #818CF8;
  --gold: #FACC15;
  --green: #22C55E;
  --red: #EF4444;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --font: 'Ubuntu Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background-color: var(--bg); color: var(--text); font-family: var(--font);
}

.bar {
  height: 54px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); position: fixed; top: 0; left: 0; right: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { border-radius: 50%; box-shadow: 0 0 0 2px var(--primary); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 16px; }
.brand-text b span { color: var(--primary); }
.brand-text small { font-size: 9px; letter-spacing: 0.15em; color: var(--muted); }

.bar-tools { display: flex; align-items: center; gap: 12px; }
.tool {
  background: none; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px;
  padding: 6px 10px; font-size: 16px; cursor: pointer; color: var(--text);
}
.lang { display: flex; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 8px; overflow: hidden; }
.lang button { background: transparent; border: none; color: var(--muted); padding: 6px 10px; font-size: 13px; font-weight: 700; cursor: pointer; }
.lang button.active { background: var(--primary); color: #0F172A; }

.screen { position: absolute; top: 54px; left: 0; right: 0; bottom: 0; overflow-y: auto; display: none; padding: 16px; }
.screen.active { display: flex; flex-direction: column; align-items: center; }

.col { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; text-align: center; margin: auto; padding: 20px 0; }
.col.wide { max-width: 900px; }

.mono-tag { font-family: monospace; font-size: 12px; letter-spacing: 0.25em; color: var(--primary); margin-bottom: 8px; }
.title {
  font-size: 42px; font-weight: 800; line-height: 1.1;
  background: linear-gradient(90deg, #38BDF8, #818CF8, #EC4899);
  -webkit-background-clip: text; color: transparent; margin-bottom: 8px;
}
.subtitle { font-size: 16px; color: var(--muted); margin-bottom: 20px; }
.hero { position: relative; margin: 10px 0 20px; }
.hero-guide.bob { animation: bobAnim 3s ease-in-out infinite alternate; filter: drop-shadow(0 14px 24px rgba(56, 189, 248, 0.4)); }
@keyframes bobAnim { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }

.bubble {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 18px; font-size: 15px; line-height: 1.45; color: #E2E8F0; margin-bottom: 24px;
}
.bubble.big { font-size: 16px; }
.bubble b { color: var(--primary); }
.note { font-size: 12px; color: var(--muted); margin-top: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 15px; font-weight: 700; border-radius: 12px;
  padding: 12px 24px; cursor: pointer; border: none; text-decoration: none; transition: all 0.2s;
}
.btn.primary { background: linear-gradient(135deg, #0284C7, #38BDF8); color: #FFF; box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4); }
.btn.primary.big { font-size: 18px; padding: 14px 36px; }
.btn.outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn:active { transform: scale(0.97); }

/* Map */
.screen-header { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; text-align: left; }
.section-title { font-size: 26px; font-weight: 800; }
.section-sub { font-size: 14px; color: var(--muted); }
.lessons-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lesson-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: all 0.2s; text-align: left;
}
.lesson-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.lesson-card.locked { opacity: 0.45; cursor: not-allowed; }
.card-num { width: 38px; height: 38px; background: rgba(56, 189, 248, 0.15); color: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; }
.card-body { flex: 1; }
.card-title { font-size: 15px; font-weight: 700; }
.card-sub { font-size: 12px; color: var(--muted); }
.card-stars { font-size: 14px; color: var(--gold); }

/* Game Coding Arena */
.game-layout { width: 100%; max-width: 900px; margin: auto; display: flex; flex-direction: column; gap: 10px; }
.game-top-bar { display: flex; align-items: center; justify-content: space-between; }
.lesson-meta { display: flex; align-items: center; gap: 10px; }
.badge { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 700; color: var(--primary); }
.lesson-name { font-size: 18px; font-weight: 700; }
.game-actions { display: flex; gap: 8px; }

.mascot-bar { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px; }
.mascot-bubble { font-size: 14px; color: #E2E8F0; line-height: 1.35; }
.mascot-bubble.glow { color: var(--gold); text-shadow: 0 0 10px rgba(250, 204, 21, 0.6); }

.coding-arena { display: flex; gap: 16px; align-items: stretch; }
@media (max-width: 768px) {
  .coding-arena { flex-direction: column; }
}

.canvas-wrap {
  flex: 1.1; aspect-ratio: 6 / 5; background: #000; border-radius: 14px;
  border: 2px solid var(--border); overflow: hidden; position: relative;
}
#gridCanvas { width: 100%; height: 100%; display: block; }

.coding-workspace {
  flex: 0.9; display: flex; flex-direction: column; gap: 12px;
}
.panel-section {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
}
.panel-section h4 { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

.commands-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.cmd-block {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; color: var(--text); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 6px; cursor: pointer; transition: all 0.15s;
}
.cmd-block:hover { border-color: var(--primary); transform: translateY(-1px); }
.cmd-block:active { transform: scale(0.95); }

.program-section { flex: 1; display: flex; flex-direction: column; }
.program-tray {
  flex: 1; min-height: 140px; max-height: 220px; overflow-y: auto;
  background: rgba(0, 0, 0, 0.4); border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start;
}
.empty-hint { font-size: 12px; color: var(--muted); margin: auto; }

.prog-block {
  background: #0284C7; border: 1px solid #38BDF8; border-radius: 6px;
  padding: 5px 10px; font-size: 12px; font-weight: 700; color: #FFF;
  display: inline-flex; align-items: center; gap: 6px;
}
.prog-block.executing {
  background: var(--gold); border-color: #FFF; color: #0F172A;
  box-shadow: 0 0 12px var(--gold); transform: scale(1.05);
}
.del-btn {
  background: none; border: none; color: rgba(255, 255, 255, 0.7);
  font-size: 14px; font-weight: 800; cursor: pointer; line-height: 1;
}

.game-bottom-bar { display: flex; gap: 12px; justify-content: center; margin-top: 4px; }
.run-btn { min-width: 170px; font-size: 16px; }
.run-btn.running { background: linear-gradient(135deg, #EF4444, #DC2626); }

/* Diploma */
.diploma-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.diploma-controls input { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; color: #FFF; font-size: 16px; outline: none; }
.diploma-preview { width: 100%; max-width: 720px; margin-bottom: 16px; }
#diplomaCanvas { width: 100%; height: auto; border-radius: 12px; border: 2px solid var(--primary); }
.diploma-actions { display: flex; gap: 12px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal.active { display: flex; }
.modal-box { background: var(--panel); border: 2px solid var(--border); border-radius: 20px; padding: 28px; text-align: center; max-width: 360px; width: 100%; }
.stars-row { font-size: 40px; color: var(--gold); margin-bottom: 10px; }
.victory-title { font-size: 20px; font-weight: 800; color: #FFF; margin-bottom: 6px; }
.victory-praise { font-size: 15px; color: var(--primary); margin-bottom: 20px; }
