/* Κυκλωματάκια · Circuit Kids */
@font-face {
  font-family: 'Ubuntu Sans';
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/ubuntu-sans-greek-wght-normal.woff2') format('woff2');
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}
@font-face {
  font-family: 'Ubuntu Sans';
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/ubuntu-sans-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2190-21FF, U+2212;
}

:root {
  --bg: #0B1120;
  --panel: rgba(15, 23, 42, 0.82);
  --card: #131C31;
  --line: rgba(255, 255, 255, 0.1);
  --sky: #38BDF8;
  --teal: #2DD4BF;
  --indigo: #6366F1;
  --violet: #A78BFA;
  --gold: #FACC15;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --bad: #F87171;
  --radius: 16px;
  --font: 'Ubuntu Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(800px 500px at 110% 10%, rgba(45, 212, 191, 0.16), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 60px 60px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 60px 60px,
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
input { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }

.app { max-width: 1040px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

/* Κεφαλίδα */
.app-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 56px; padding: 8px 18px;
  background: rgba(11, 17, 32, 0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hub-link { color: var(--teal); text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; }
.header-sep { color: #475569; }
.brand-title { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-controls { display: flex; gap: 8px; flex-shrink: 0; }
.pill-btn {
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; min-height: 36px;
}
.pill-btn:hover { background: rgba(255, 255, 255, 0.15); }
.lang-btn { color: var(--teal); font-weight: 800; }

.screen { flex: 1; display: flex; flex-direction: column; padding: 16px 18px 28px; }

/* Αρχική */
.home-screen { align-items: center; justify-content: center; text-align: center; }
.home-hero { max-width: 600px; display: flex; flex-direction: column; align-items: center; }
.mascot-wrapper { position: relative; margin-bottom: 16px; }
.hero-mascot { width: 190px; height: 190px; filter: drop-shadow(0 16px 26px rgba(99, 102, 241, 0.35)); animation: float 4s ease-in-out infinite alternate; }
@keyframes float { to { transform: translateY(-9px); } }
.mascot-speech-bubble {
  position: absolute; top: -6px; left: calc(100% - 10px); width: 210px;
  background: #312E81; border: 2px solid var(--indigo); border-radius: 18px 18px 18px 4px;
  padding: 12px 16px; font-size: 13.5px; font-weight: 600; line-height: 1.35; text-align: left;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}
.hero-title {
  font-size: clamp(38px, 8vw, 54px); font-weight: 900; line-height: 1.05; margin-bottom: 8px;
  background: linear-gradient(120deg, var(--sky), var(--violet) 55%, #EC4899);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-subtitle { font-size: 17px; color: var(--muted); margin-bottom: 18px; line-height: 1.4; }
.hero-demo { display: grid; grid-template-columns: repeat(4, 48px); gap: 6px; margin-bottom: 24px; }
.hero-demo span {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 10px;
  background: #F8FAFC; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.hero-demo svg { width: 34px; height: 34px; }
.hero-demo .blank { background: #E0E7FF; color: var(--indigo); font-weight: 900; font-size: 26px; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { background: #C7D2FE; transform: scale(1.06); } }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 18px; }
.action-btn {
  padding: 14px 26px; border-radius: 14px; font-size: 16px; font-weight: 800; cursor: pointer; border: none; min-height: 50px;
  box-shadow: 0 10px 20px -6px rgba(0, 0, 0, 0.4); transition: transform 0.15s, box-shadow 0.15s;
}
.primary-btn { background: linear-gradient(135deg, var(--sky), #2563EB); color: #fff; }
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -6px rgba(56, 189, 248, 0.5); }
.secondary-btn { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); }
.secondary-btn:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-2px); }
.text-link-btn {
  background: none; border: none; color: var(--gold); font-size: 15px; font-weight: 700; cursor: pointer;
  text-decoration: underline; text-underline-offset: 4px; padding: 8px;
}

/* Χάρτης */
.screen-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.screen-title { font-size: 22px; font-weight: 900; text-align: center; }
.nav-btn {
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; min-height: 40px; white-space: nowrap;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.15); }
.primary-nav-btn { background: linear-gradient(135deg, var(--sky), #2563EB); border-color: transparent; }
.map-subtitle { color: var(--muted); font-size: 14px; margin-bottom: 16px; text-align: center; }
.map-stars { color: var(--gold); font-weight: 800; white-space: nowrap; }
.mission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.mission-card {
  position: relative; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 12px 14px;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.mission-card:hover { transform: translateY(-3px); border-color: rgba(56, 189, 248, 0.5); box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.5); }
.sandbox-card { border-color: rgba(250, 204, 21, 0.35); background: linear-gradient(180deg, rgba(250, 204, 21, 0.08), var(--panel)); }
.card-num {
  position: absolute; top: 10px; left: 10px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; background: rgba(99, 102, 241, 0.25); color: #C7D2FE;
}
.card-icon { font-size: 34px; line-height: 1.2; }
.card-title { font-size: 16px; font-weight: 800; }
.card-size { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--teal); text-transform: uppercase; }
.card-desc { font-size: 12.5px; color: var(--muted); line-height: 1.35; flex: 1; margin: 2px 0 6px; }
.card-stars { display: flex; gap: 3px; }
.star { font-size: 18px; color: #334155; }
.star.earned { color: var(--gold); filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.6)); }
.sandbox-tag { font-size: 11px; font-weight: 800; color: var(--gold); background: rgba(250, 204, 21, 0.15); padding: 4px 10px; border-radius: 999px; }

/* Παιχνίδι */
.game-screen { padding-top: 10px; gap: 8px; }
.game-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mission-badge {
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 14px; border-radius: 999px; min-width: 0; overflow: hidden;
}
.mission-name { font-weight: 800; color: #C7D2FE; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.stats-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.stat-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px;
}
.stat-lbl { color: var(--muted); font-weight: 700; }
.stat-pill b { font-weight: 900; font-size: 15px; }
.stat-pill.timer { border-color: rgba(248, 113, 113, 0.4); color: #FCA5A5; }

.play-area {
  display: grid; gap: 12px; align-items: start; justify-items: center;
  grid-template-columns: 1fr; grid-template-areas: 'tip' 'board' 'pad';
}
.tip-box { grid-area: tip; display: flex; align-items: center; gap: 10px; width: 100%; max-width: 620px; }
.tip-mascot { border: none; background: none; cursor: pointer; flex-shrink: 0; }
.tip-mascot img { width: 58px; height: 58px; display: block; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4)); }
.tip-text {
  flex: 1; position: relative; font-size: 14.5px; font-weight: 600; line-height: 1.4;
  background: #1E1B4B; border: 2px solid var(--indigo); border-radius: 16px; padding: 10px 14px;
  /* σταθερό ύψος: τα κουμπιά από κάτω δεν «πηδάνε» όταν αλλάζει το μήνυμα */
  min-height: calc(3 * 1.4em + 24px);
  display: flex; align-items: center;
}
.tip-text::before {
  content: ''; position: absolute; left: -9px; top: 50%; margin-top: -8px;
  border: 8px solid transparent; border-right-color: var(--indigo); border-left: 0;
}
.tip-box[data-mood="good"] .tip-text, .tip-box[data-mood="unit"] .tip-text, .tip-box[data-mood="win"] .tip-text { background: #064E3B; border-color: #10B981; }
.tip-box[data-mood="good"] .tip-text::before, .tip-box[data-mood="unit"] .tip-text::before, .tip-box[data-mood="win"] .tip-text::before { border-right-color: #10B981; }
.tip-box[data-mood="oops"] .tip-text { background: #4C0519; border-color: #FB7185; }
.tip-box[data-mood="oops"] .tip-text::before { border-right-color: #FB7185; }
.tip-box[data-mood="hint"] .tip-text { background: #422006; border-color: var(--gold); }
.tip-box[data-mood="hint"] .tip-text::before { border-right-color: var(--gold); }
.tip-box.pop .tip-text { animation: tipPop 0.3s ease; }
@keyframes tipPop { 0% { transform: scale(0.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }

/* Αρχική: μικρό «κύκλωμα» */
.hero-demo { grid-template-columns: repeat(4, auto); align-items: center; gap: 0; }
.hero-demo span { position: relative; margin-right: 18px; color: #0F172A; font-weight: 900; font-size: 18px; }
.hero-demo span:not(:last-child)::after { content: ''; position: absolute; left: 100%; top: 50%; width: 18px; height: 4px; margin-top: -2px; background: #FACC15; }
.hero-demo span:last-child { margin-right: 0; }
.hero-demo .hd-sw { background: #475569; color: #F8FAFC; border-radius: 999px; }
.hero-demo .hd-sw:first-child::after { background: #475569; }
.hero-demo .hd-sw.on { background: #22C55E; }
.hero-demo .hd-gate { width: 64px; background: #6366F1; color: #fff; border-radius: 10px 30px 30px 10px; font-size: 15px; }
.hero-demo .hd-gate::after { background: #475569 !important; }
.hero-demo .hd-lamp { background: #1E293B; font-size: 26px; border-radius: 50%; filter: grayscale(1) brightness(0.7); animation: none; }

.mode-badge {
  display: inline-block; vertical-align: middle; margin-right: 8px; padding: 2px 8px; border-radius: 6px;
  font: 800 10.5px ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.08em; color: #0B1120; background: var(--teal);
}
.mode-badge[data-mode="discover"] { background: var(--gold); }
.mode-badge[data-mode="build"] { background: #F472B6; }
.mission-badge { display: flex; align-items: center; }
.mission-name { display: inline-block; vertical-align: middle; }

/* Κύκλωμα (SVG) */
.board-wrap { grid-area: board; width: 100%; display: flex; justify-content: center; }
.circuit {
  width: 100%; max-width: 760px; border-radius: 18px; padding: 6px;
  background:
    linear-gradient(rgba(56, 189, 248, 0.07) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(56, 189, 248, 0.07) 1px, transparent 1px) 0 0 / 24px 24px,
    #0A1628;
  border: 2px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7), inset 0 0 40px rgba(56, 189, 248, 0.08);
}
.circuit-svg { display: block; width: 100%; height: auto; max-height: calc(100dvh - 300px); min-height: 180px; overflow: visible; }
.circuit-svg text { font-family: var(--font); text-anchor: middle; pointer-events: none; }
.circuit-svg .hit { fill: transparent; }

.wire-base { fill: none; stroke: #334155; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.wire-flow { fill: none; stroke: #64748B; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.2s; }
.wire.on .wire-base { stroke: #713F12; }
.wire.on .wire-flow { stroke: #FACC15; stroke-dasharray: 12 10; animation: flow 0.6s linear infinite; filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.8)); }
.wire.dead .wire-flow { stroke: #1E293B; stroke-dasharray: 4 8; }
@keyframes flow { to { stroke-dashoffset: -22; } }

.switch { cursor: pointer; outline: none; }
.sw-track { fill: #334155; stroke: #64748B; stroke-width: 3; transition: fill 0.2s; }
.switch.on .sw-track { fill: #16A34A; stroke: #86EFAC; }
.sw-bit { font-size: 26px; font-weight: 900; fill: #94A3B8; }
.switch .sw-bit-1 { opacity: 0; }
.switch.on .sw-bit-1 { opacity: 1; fill: #DCFCE7; }
.switch.on .sw-bit-0 { opacity: 0; }
.sw-knob { transform: translateX(-26px); transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1); }
.switch.on .sw-knob { transform: translateX(26px); }
.sw-knob circle { fill: #F8FAFC; stroke: #0F172A; stroke-width: 3; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.sw-knob text { font-size: 26px; font-weight: 900; fill: #0F172A; }
.switch:hover .sw-track, .switch:focus-visible .sw-track { stroke: var(--sky); stroke-width: 4; }

.gate .stub { fill: none; stroke: #64748B; stroke-width: 5; stroke-linecap: round; }
.gate.on .stub { stroke: #FACC15; }
.gate-body { fill: var(--gc, #64748B); stroke: #F8FAFC; stroke-width: 3; stroke-linejoin: round; }
.gate-xor { fill: none; stroke: #F8FAFC; stroke-width: 3; stroke-linecap: round; }
.gate.on .gate-body { filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.55)); }
.gate-slot { fill: rgba(148, 163, 184, 0.12); stroke: #CBD5E1; stroke-width: 3; stroke-dasharray: 8 6; }
.gate-text { font-size: 19px; font-weight: 900; fill: #FFFFFF; paint-order: stroke; stroke: rgba(0, 0, 0, 0.25); stroke-width: 3px; }
.gate-text.q { font-size: 38px; fill: #E2E8F0; }
.gate-sub { font: 800 10px ui-monospace, 'SF Mono', Menlo, Consolas, monospace; fill: rgba(255, 255, 255, 0.85); letter-spacing: 0.06em; }
.gate.slot { cursor: pointer; outline: none; }
.gate.slot.empty .gate-slot { animation: slotPulse 1.6s ease-in-out infinite; }
@keyframes slotPulse { 50% { fill: rgba(56, 189, 248, 0.22); stroke: var(--sky); } }
.gate.slot:hover .gate-body, .gate.slot:focus-visible .gate-body, .gate.slot:hover .gate-slot, .gate.slot:focus-visible .gate-slot { stroke: var(--sky); stroke-width: 4; }
.slot-dot { fill: #F8FAFC; stroke: #0F172A; stroke-width: 2; }
.slot-pen { font-size: 13px; font-weight: 900; fill: #0F172A; }

.lamp-glow { opacity: 0; transition: opacity 0.25s; }
.lamp.on .lamp-glow { opacity: 1; animation: glow 1.6s ease-in-out infinite alternate; }
@keyframes glow { to { opacity: 0.7; transform: scale(1.08); } }
.lamp-glass { fill: #1E293B; stroke: #64748B; stroke-width: 3; transition: fill 0.2s; }
.lamp.on .lamp-glass { fill: url(#bulbOn); stroke: #FEF08A; }
.lamp-filament { fill: none; stroke: #64748B; stroke-width: 2.5; stroke-linejoin: round; }
.lamp.on .lamp-filament { stroke: #B45309; }
.lamp-base { fill: #94A3B8; stroke: #475569; stroke-width: 2; }
.lamp-thread { stroke: #475569; stroke-width: 2; }
.lamp-label { font-size: 20px; font-weight: 900; fill: #E2E8F0; }
.goal-pill { fill: rgba(15, 23, 42, 0.9); stroke: #F472B6; stroke-width: 2; }
.goal-pill.met { stroke: #34D399; fill: rgba(6, 78, 59, 0.85); }
.goal-text { font-size: 16px; font-weight: 800; }

.circuit-svg .focus { animation: nodeFocus 0.8s ease-in-out 3; }
@keyframes nodeFocus { 50% { opacity: 0.45; } }
.circuit-svg .hinted { animation: nodeFocus 0.5s ease-in-out 4; }
.circuit-svg .pop .lamp-glass, .circuit-svg .pop .gate-body { animation: nodePop 0.45s ease; }
@keyframes nodePop { 40% { stroke-width: 7; } }
.circuit-svg .shake { animation: nodeFocus 0.3s ease 2; }
.circuit-svg.solved .lamp.on .lamp-glow { animation: glow 0.3s ease-in-out 6 alternate; }

/* Πίνακας αλήθειας, ερώτηση, εργαλεία */
.side { grid-area: side; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; }
.truth-table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.tt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.tt-title { font: 800 11.5px ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sky); }
.tt-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.tt { width: 100%; border-collapse: separate; border-spacing: 0 3px; text-align: center; }
.tt th { font-size: 14px; font-weight: 900; color: #CBD5E1; padding: 2px 4px; }
.tt th small { font-size: 10px; margin-left: 2px; color: var(--muted); }
.tt th.tt-goal { color: #F9A8D4; }
.tt td { padding: 3px 4px; font-size: 16px; font-weight: 800; background: rgba(255, 255, 255, 0.04); }
.tt td:first-child { border-radius: 8px 0 0 8px; }
.tt td:last-child { border-radius: 0 8px 8px 0; }
.tt .bit.b1 { color: #4ADE80; }
.tt .bit.b0 { color: #64748B; }
.tt .unk { color: #475569; }
.tt .off { filter: grayscale(1); opacity: 0.6; font-size: 13px; }
.tt td.goalcell { background: rgba(244, 114, 182, 0.08); }
.tt-row.current td { background: rgba(56, 189, 248, 0.22); box-shadow: inset 0 2px 0 rgba(56, 189, 248, 0.5), inset 0 -2px 0 rgba(56, 189, 248, 0.5); }
.tt-row.bad td { background: rgba(248, 113, 113, 0.25); }
.tt-row.sparkle td { animation: rowSpark 0.5s ease 2; }
@keyframes rowSpark { 50% { background: rgba(250, 204, 21, 0.35); } }
.tt-row.shake { animation: shake 0.4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.quiz-box { background: #1E1B4B; border: 2px solid var(--gold); border-radius: var(--radius); padding: 12px; animation: tipPop 0.3s ease; }
.quiz-title { font: 800 11px ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.quiz-q { font-size: 15px; font-weight: 800; margin: 4px 0 10px; line-height: 1.35; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  text-align: left; cursor: pointer; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; font-weight: 700; min-height: 46px;
  background: rgba(255, 255, 255, 0.07); border: 2px solid rgba(255, 255, 255, 0.16);
}
.quiz-opt:hover { border-color: var(--sky); }
.quiz-opt.wrong { border-color: #FB7185; background: rgba(251, 113, 133, 0.15); text-decoration: line-through; opacity: 0.7; }

.tools { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pad-btn {
  position: relative; cursor: pointer; border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.14);
  background: #1E293B; display: grid; place-items: center; font-weight: 900; transition: transform 0.1s, background 0.15s;
}
.pad-btn:active { transform: scale(0.94); }
.pad-btn.tool { display: flex; gap: 6px; align-items: center; padding: 8px 18px; font-size: 15px; min-height: 48px; }
.tool-ico { font-size: 20px; }
.tool-lbl { font-size: 15px; font-weight: 800; }
.hint-btn { background: rgba(250, 204, 21, 0.15); border-color: rgba(250, 204, 21, 0.45); color: #FDE68A; }
.check-btn { background: linear-gradient(135deg, #22C55E, #15803D); border-color: #86EFAC; color: #fff; }

/* Επιλογή πύλης */
.gate-card { max-width: 520px; }
.gate-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 6px; }
.gate-opt {
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 255, 255, 0.14); min-height: 60px;
}
.gate-opt:hover { border-color: var(--sky); }
.gate-opt.on { border-color: var(--sky); background: rgba(56, 189, 248, 0.18); }
.gate-opt.empty-opt { justify-content: center; color: var(--muted); }
.gate-icon { width: 96px; height: 62px; }
.gate-icon .stub { fill: none; stroke: #94A3B8; stroke-width: 5; stroke-linecap: round; }
.go-name { font-size: 18px; font-weight: 900; }
.go-name small { font: 800 11px ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--muted); }
.go-desc { font-size: 12.5px; color: #CBD5E1; line-height: 1.3; }

/* Διάταξη παιχνιδιού: κινητό = στοίβα, μεγάλη οθόνη = κύκλωμα αριστερά + πλαϊνή στήλη */
.play-area { grid-template-areas: 'tip' 'board' 'side'; }
.game-screen[data-mode="toggle"] .side { max-width: 560px; }
@media (min-width: 900px) and (min-height: 560px) {
  .play-area {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    grid-template-areas: 'board tip' 'board side';
    grid-template-rows: auto 1fr;
    justify-content: center; column-gap: 22px;
  }
  .circuit-svg { max-height: calc(100dvh - 200px); }
  .tip-box { align-self: start; flex-direction: column; align-items: stretch; }
  .tip-text { min-height: calc(5 * 1.4em + 24px); }
  .tip-mascot { align-self: flex-start; }
  .tip-text::before { left: 26px; top: -9px; margin-top: 0; border: 8px solid transparent; border-bottom-color: var(--indigo); border-top: 0; }
  .tip-box[data-mood="good"] .tip-text::before, .tip-box[data-mood="unit"] .tip-text::before, .tip-box[data-mood="win"] .tip-text::before { border-bottom-color: #10B981; border-right-color: transparent; }
  .tip-box[data-mood="oops"] .tip-text::before { border-bottom-color: #FB7185; border-right-color: transparent; }
  .tip-box[data-mood="hint"] .tip-text::before { border-bottom-color: var(--gold); border-right-color: transparent; }
  .play-area .tip-box[data-mood="info"] .tip-text::before { border-bottom-color: var(--sky); border-right-color: transparent; }
  .side { align-self: start; }
}
.tip-box[data-mood="info"] .tip-text { background: #0C4A6E; border-color: var(--sky); }
.tip-box[data-mood="info"] .tip-text::before { border-right-color: var(--sky); }

/* Δίπλωμα */
.diploma-screen { align-items: center; }
.diploma-screen .screen-bar { width: 100%; }
.diploma-note { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; text-align: center; }
.diploma-note[data-state="ok"] { color: #6EE7B7; }
.diploma-note[data-state="todo"] { color: #FDE68A; }
.diploma-form-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.diploma-form-bar label { font-weight: 700; font-size: 14px; }
.diploma-form-bar input {
  background: var(--card); border: 1px solid rgba(255, 255, 255, 0.22); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font-size: 16px; font-family: inherit; outline: none; min-width: 200px;
}
.diploma-form-bar input:focus { border-color: var(--sky); }
.diploma-card { width: 100%; max-width: 780px; background: #FFFBEB; color: #1E293B; border-radius: 20px; padding: 20px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); }
.diploma-card.locked { filter: grayscale(0.55); opacity: 0.85; }
.diploma-border { border: 5px double #4338CA; border-radius: 12px; padding: 30px 34px; text-align: center; }
.diploma-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.diploma-brand { font-weight: 900; font-size: 13px; letter-spacing: 2px; color: #4338CA; }
.diploma-badge-pill { background: var(--gold); color: #422006; font-weight: 900; font-size: 12px; padding: 4px 12px; border-radius: 999px; letter-spacing: 1px; }
.diploma-title { font-size: clamp(24px, 5vw, 36px); font-weight: 900; color: #1E1B4B; margin-bottom: 10px; letter-spacing: 1px; }
.diploma-presents { font-size: 15px; color: #4B5563; margin-bottom: 22px; line-height: 1.45; }
.diploma-name-box { border-bottom: 2px solid #4338CA; padding: 8px 20px; margin-bottom: 24px; display: inline-block; min-width: 260px; }
#diplomaChildName { font-size: clamp(24px, 5vw, 34px); font-weight: 800; color: #7C2D12; font-style: italic; }
.diploma-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 36px; margin-bottom: 20px; }
.stat-box { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 12px; font-weight: 700; color: #6B7280; }
.stat-val { font-size: 16px; font-weight: 800; color: #1F2937; }
.diploma-footer { display: flex; align-items: flex-end; justify-content: space-between; }
.diploma-seal {
  width: 82px; height: 82px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, #6366F1, #312E81); box-shadow: 0 4px 12px rgba(67, 56, 202, 0.45);
}
.seal-inner { font-size: 10px; font-weight: 900; color: #FDE68A; text-align: center; line-height: 1.3; }
.diploma-mascot { width: 96px; height: 96px; }

/* Παράθυρα (νίκη, ελεύθερο παιχνίδι) */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(2, 6, 23, 0.75); backdrop-filter: blur(6px); overflow-y: auto;
}
.modal-card {
  width: 100%; max-width: 460px; text-align: center; margin: auto;
  background: #111A2E; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 22px; padding: 24px 24px 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7); animation: modalIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes modalIn { from { transform: scale(0.85); opacity: 0; } }
.modal-mascot { width: 90px; height: 90px; margin-bottom: 4px; }
.modal-title { font-size: 26px; font-weight: 900; margin-bottom: 6px; }
.modal-desc { color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.modal-stars { display: flex; justify-content: center; gap: 10px; margin-bottom: 8px; }
.modal-star { font-size: 40px; color: #334155; }
.modal-star.earned { color: var(--gold); filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.7)); animation: starIn 0.5s ease both; }
.modal-star.earned:nth-child(2) { animation-delay: 0.15s; }
.modal-star.earned:nth-child(3) { animation-delay: 0.3s; }
@keyframes starIn { from { transform: scale(0.3) rotate(-30deg); opacity: 0; } }
.modal-stats { font-size: 14px; color: #CBD5E1; margin-bottom: 14px; }
.modal-invalid { font-size: 13.5px; font-weight: 700; color: #FCA5A5; background: rgba(220, 38, 38, 0.15); border: 1px solid rgba(220, 38, 38, 0.4); border-radius: 10px; padding: 8px 10px; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .action-btn { flex: 1; padding: 12px 14px; font-size: 15px; }
.modal-card .gt-cta-strip { margin-top: 12px; font-size: 0.88rem; }
.free-card .opt-group { margin-bottom: 14px; text-align: left; }
.opt-label { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.opt-row { display: flex; gap: 8px; }
.opt-btn {
  flex: 1; cursor: pointer; padding: 10px 8px; border-radius: 12px; font-weight: 800; font-size: 15px; min-height: 46px;
  background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 255, 255, 0.14);
}
.opt-btn.on { background: rgba(56, 189, 248, 0.2); border-color: var(--sky); }
.opt-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Κινητά */
@media (max-width: 640px) {
  .app-header { padding: 6px 12px; }
  .brand-title { font-size: 14px; }
  .hub-link { font-size: 13px; }
  .pill-btn { padding: 5px 10px; font-size: 12px; }
  .screen { padding: 12px 12px 22px; }
  .mascot-speech-bubble { position: static; width: auto; max-width: 300px; margin: 8px auto 0; border-radius: 18px; text-align: center; }
  .hero-mascot { width: 140px; height: 140px; }
  .screen-title { font-size: 18px; }
  .nav-btn { padding: 7px 10px; font-size: 13px; }
  .mission-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .mission-card { padding: 14px 8px 12px; }
  .card-desc { font-size: 11.5px; }
  .tip-mascot img { width: 46px; height: 46px; }
  .tip-text { font-size: 13.5px; padding: 8px 12px; }
  .circuit { padding: 2px; border-radius: 14px; }
  .circuit-svg { max-height: none; }
  .mode-badge { display: none; }
  .diploma-border { padding: 20px 14px; }
  .modal-actions { flex-direction: column; }
  .gate-opts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .header-sep, .brand-title { display: none; }
}

/* Εκτύπωση διπλώματος */
@media print {
  body { background: #fff !important; color: #000; }
  .app-header, .screen-bar, .diploma-form-bar, .diploma-note, .gt-cta-strip, .modal-overlay { display: none !important; }
  .screen:not(#diplomaScreen) { display: none !important; }
  .diploma-card { box-shadow: none; max-width: 100%; filter: none; opacity: 1; }
}
